diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 9de50aa4824..e595785d9d3 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -346,3 +346,4 @@ c1f30ac14db0eaff398429c04cd9fab92e1b4b2a jdk-9+100 c4d72a1620835b5d657b7b6792c2879367d0154f jdk-9+101 6406ecf5d39482623225bb1b3098c2cac6f7d450 jdk-9+102 47d6462e514b2097663305a57d9c844c15d5b609 jdk-9+103 +9a38f8b4ba220708db198d08d82fd2144a64777d jdk-9+104 diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 index be85de751eb..3ffc8499c5c 100644 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -573,6 +573,11 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS], # Locate the directory of this script. AUTOCONF_DIR=$TOPDIR/common/autoconf + + # Setup username (for use in adhoc version strings etc) + # Outer [ ] to quote m4. + [ USERNAME=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` ] + AC_SUBST(USERNAME) ]) # Evaluates platform specific overrides for devkit variables. diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 index e6b8417241f..fcc2322793d 100644 --- a/common/autoconf/flags.m4 +++ b/common/autoconf/flags.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2016, 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 @@ -80,8 +80,9 @@ AC_DEFUN([FLAGS_SETUP_SYSROOT_FLAGS], if test "x$OPENJDK_TARGET_OS" = xsolaris; then # Solaris Studio does not have a concept of sysroot. Instead we must # make sure the default include and lib dirs are appended to each - # compile and link command line. - $1SYSROOT_CFLAGS="-I[$]$1SYSROOT/usr/include" + # compile and link command line. Must also add -I-xbuiltin to enable + # inlining of system functions and intrinsics. + $1SYSROOT_CFLAGS="-I-xbuiltin -I[$]$1SYSROOT/usr/include" $1SYSROOT_LDFLAGS="-L[$]$1SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \ -L[$]$1SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \ -L[$]$1SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR" @@ -425,7 +426,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION], # Add runtime stack smashing and undefined behavior checks. # Not all versions of gcc support -fstack-protector STACK_PROTECTOR_CFLAG="-fstack-protector-all" - FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$STACK_PROTECTOR_CFLAG], IF_FALSE: [STACK_PROTECTOR_CFLAG=""]) + FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$STACK_PROTECTOR_CFLAG -Werror], IF_FALSE: [STACK_PROTECTOR_CFLAG=""]) CFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1" CXXFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1" @@ -601,22 +602,22 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], esac elif test "x$TOOLCHAIN_TYPE" = xclang; then if test "x$OPENJDK_TARGET_OS" = xlinux; then - if test "x$OPENJDK_TARGET_CPU" = xx86; then - # Force compatibility with i586 on 32 bit intel platforms. - COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586" - fi - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ - -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" - case $OPENJDK_TARGET_CPU_ARCH in - ppc ) - # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - * ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - esac + if test "x$OPENJDK_TARGET_CPU" = xx86; then + # Force compatibility with i586 on 32 bit intel platforms. + COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586" + fi + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ + -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" + case $OPENJDK_TARGET_CPU_ARCH in + ppc ) + # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing + CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" + ;; + * ) + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" + CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" + ;; + esac fi elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 0fdc4605014..e4823f8e1ed 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -917,6 +917,7 @@ JVM_VARIANTS JVM_INTERPRETER JDK_VARIANT SET_OPENJDK +USERNAME CANONICAL_TOPDIR ORIGINAL_TOPDIR TOPDIR @@ -3834,7 +3835,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2016, 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 @@ -4835,7 +4836,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1454146111 +DATE_WHEN_GENERATED=1454926898 ############################################################################### # @@ -15652,6 +15653,11 @@ $as_echo "$as_me: The path of TOPDIR, which resolves as \"$path\", is invalid." # Locate the directory of this script. AUTOCONF_DIR=$TOPDIR/common/autoconf + # Setup username (for use in adhoc version strings etc) + # Outer [ ] to quote m4. + USERNAME=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` + + # Check if it's a pure open build or if custom sources are to be used. @@ -23429,9 +23435,8 @@ $as_echo "$as_me: WARNING: --with-version-opt value has been sanitized from '$wi # Default is to calculate a string like this .. timestamp=`$DATE '+%Y-%m-%d-%H%M%S'` # Outer [ ] to quote m4. - username=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` basedirname=`$BASENAME "$TOPDIR" | $TR -d -c '[a-z][A-Z][0-9].-'` - VERSION_OPT="$timestamp.$username.$basedirname" + VERSION_OPT="$timestamp.$USERNAME.$basedirname" fi fi @@ -29968,8 +29973,9 @@ fi if test "x$OPENJDK_TARGET_OS" = xsolaris; then # Solaris Studio does not have a concept of sysroot. Instead we must # make sure the default include and lib dirs are appended to each - # compile and link command line. - SYSROOT_CFLAGS="-I$SYSROOT/usr/include" + # compile and link command line. Must also add -I-xbuiltin to enable + # inlining of system functions and intrinsics. + SYSROOT_CFLAGS="-I-xbuiltin -I$SYSROOT/usr/include" SYSROOT_LDFLAGS="-L$SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \ -L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \ -L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR" @@ -42361,8 +42367,9 @@ $as_echo "$BUILD_DEVKIT_ROOT" >&6; } if test "x$OPENJDK_TARGET_OS" = xsolaris; then # Solaris Studio does not have a concept of sysroot. Instead we must # make sure the default include and lib dirs are appended to each - # compile and link command line. - BUILD_SYSROOT_CFLAGS="-I$BUILD_SYSROOT/usr/include" + # compile and link command line. Must also add -I-xbuiltin to enable + # inlining of system functions and intrinsics. + BUILD_SYSROOT_CFLAGS="-I-xbuiltin -I$BUILD_SYSROOT/usr/include" BUILD_SYSROOT_LDFLAGS="-L$BUILD_SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \ -L$BUILD_SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \ -L$BUILD_SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR" @@ -46191,12 +46198,12 @@ $as_echo "$ac_cv_c_bigendian" >&6; } # Execute function body - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$STACK_PROTECTOR_CFLAG\"" >&5 -$as_echo_n "checking if compiler supports \"$STACK_PROTECTOR_CFLAG\"... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$STACK_PROTECTOR_CFLAG -Werror\"" >&5 +$as_echo_n "checking if compiler supports \"$STACK_PROTECTOR_CFLAG -Werror\"... " >&6; } supports=yes saved_cflags="$CFLAGS" - CFLAGS="$CFLAGS $STACK_PROTECTOR_CFLAG" + CFLAGS="$CFLAGS $STACK_PROTECTOR_CFLAG -Werror" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -46222,7 +46229,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CFLAGS="$saved_cflags" saved_cxxflags="$CXXFLAGS" - CXXFLAGS="$CXXFLAG $STACK_PROTECTOR_CFLAG" + CXXFLAGS="$CXXFLAG $STACK_PROTECTOR_CFLAG -Werror" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -46441,22 +46448,22 @@ $as_echo "$supports" >&6; } esac elif test "x$TOOLCHAIN_TYPE" = xclang; then if test "x$OPENJDK_TARGET_OS" = xlinux; then - if test "x$OPENJDK_TARGET_CPU" = xx86; then - # Force compatibility with i586 on 32 bit intel platforms. - COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586" - fi - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ - -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" - case $OPENJDK_TARGET_CPU_ARCH in - ppc ) - # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - * ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - esac + if test "x$OPENJDK_TARGET_CPU" = xx86; then + # Force compatibility with i586 on 32 bit intel platforms. + COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586" + fi + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ + -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" + case $OPENJDK_TARGET_CPU_ARCH in + ppc ) + # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing + CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" + ;; + * ) + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" + CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" + ;; + esac fi elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" diff --git a/common/autoconf/jdk-version.m4 b/common/autoconf/jdk-version.m4 index 32bf2e42bb2..2dc63865c49 100644 --- a/common/autoconf/jdk-version.m4 +++ b/common/autoconf/jdk-version.m4 @@ -162,9 +162,8 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS], # Default is to calculate a string like this .. timestamp=`$DATE '+%Y-%m-%d-%H%M%S'` # Outer [ ] to quote m4. - [ username=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` ] [ basedirname=`$BASENAME "$TOPDIR" | $TR -d -c '[a-z][A-Z][0-9].-'` ] - VERSION_OPT="$timestamp.$username.$basedirname" + VERSION_OPT="$timestamp.$USERNAME.$basedirname" fi fi diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index a78b30ba5ad..2bb4bdbbcd7 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -184,6 +184,7 @@ JDK_RC_PLATFORM_NAME:=@JDK_RC_PLATFORM_NAME@ COMPANY_NAME:=@COMPANY_NAME@ MACOSX_BUNDLE_NAME_BASE=@MACOSX_BUNDLE_NAME_BASE@ MACOSX_BUNDLE_ID_BASE=@MACOSX_BUNDLE_ID_BASE@ +USERNAME:=@USERNAME@ # Different naming strings generated from the above information. RUNTIME_NAME=$(PRODUCT_NAME) $(PRODUCT_SUFFIX) diff --git a/corba/.hgtags b/corba/.hgtags index ba693c7dd28..a2e1db4ac4a 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -346,3 +346,4 @@ ea285530245cf4e0edf0479121a41347d3030eba jdk-9+98 30dfb3bd3d06b4bb80a087babc0d1841edba187b jdk-9+101 9c4662334d933d299928d1f599d02ff50777cbf8 jdk-9+102 0680fb7dae4da1ee6cf783c4b74184e3e08d3179 jdk-9+103 +e385e95e6101711d5c63e7b1a827e99b6ec7a1cc jdk-9+104 diff --git a/hotspot/.hgtags b/hotspot/.hgtags index fbc7ac926fb..dd9a2e88193 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -506,3 +506,4 @@ bdb0acafc63c42e84d9d8195bf2e2b25ee9c3306 jdk-9+100 9f45d3d57d6948cf526fbc2e2891a9a74ac6941a jdk-9+101 d5239fc1b69749ae50793c61b899fcdacf3df857 jdk-9+102 c5f55130b1b69510d9a6f4a3105b58e21cd7ffe1 jdk-9+103 +534c50395957c6025fb6627e93b35756f8d48a08 jdk-9+104 diff --git a/hotspot/.mx.jvmci/mx_jvmci.py b/hotspot/.mx.jvmci/mx_jvmci.py index d1069e6284c..1db4fbb5dcd 100644 --- a/hotspot/.mx.jvmci/mx_jvmci.py +++ b/hotspot/.mx.jvmci/mx_jvmci.py @@ -40,6 +40,8 @@ from mx_unittest import unittest _suite = mx.suite('jvmci') +JVMCI_VERSION = 9 + """ Top level directory of the JDK source workspace. """ @@ -153,11 +155,17 @@ class JvmciJDKDeployedDist(object): def deploy(self, jdkDir): mx.nyi('deploy', self) + def post_parse_cmd_line(self): + self.set_archiveparticipant() + + def set_archiveparticipant(self): + dist = self.dist() + dist.set_archiveparticipant(JVMCIArchiveParticipant(dist)) + class ExtJDKDeployedDist(JvmciJDKDeployedDist): def __init__(self, name): JvmciJDKDeployedDist.__init__(self, name) - """ The monolithic JVMCI distribution is deployed through use of -Xbootclasspath/p so that it's not necessary to run JDK make after editing JVMCI sources. @@ -186,7 +194,7 @@ To build hotspot and import it into the JDK: "mx make hotspot import-hotspot" # JDK9 must be bootstrapped with a JDK8 compliance = mx.JavaCompliance('8') jdk8 = mx.get_jdk(compliance.exactMatch, versionDescription=compliance.value) - cmd = ['sh', 'configure', '--with-debug-level=' + _vm.debugLevel, '--disable-debug-symbols', '--disable-precompiled-headers', + cmd = ['sh', 'configure', '--with-debug-level=' + _vm.debugLevel, '--with-native-debug-symbols=none', '--disable-precompiled-headers', '--with-jvm-variants=' + _vm.jvmVariant, '--disable-warnings-as-errors', '--with-boot-jdk=' + jdk8.home] mx.run(cmd, cwd=_jdkSourceRoot) cmd = [mx.gmake_cmd(), 'CONF=' + _vm.debugLevel] @@ -205,7 +213,15 @@ To build hotspot and import it into the JDK: "mx make hotspot import-hotspot" mx.run(cmd, cwd=_jdkSourceRoot) if 'images' in cmd: - _create_jdk_bundle(jdkBuildDir) + jdkImageDir = join(jdkBuildDir, 'images', 'jdk') + + # The OpenJDK build creates an empty cacerts file so copy one from + # the default JDK (which is assumed to be an OracleJDK) + srcCerts = join(mx.get_jdk(tag='default').home, 'jre', 'lib', 'security', 'cacerts') + dstCerts = join(jdkImageDir, 'lib', 'security', 'cacerts') + shutil.copyfile(srcCerts, dstCerts) + + _create_jdk_bundle(jdkBuildDir, _vm.debugLevel, jdkImageDir) def _get_jdk_bundle_arches(): """ @@ -220,15 +236,14 @@ def _get_jdk_bundle_arches(): return ['sparcv9'] mx.abort('Unsupported JDK bundle arch: ' + cpu) -def _create_jdk_bundle(jdkBuildDir): +def _create_jdk_bundle(jdkBuildDir, debugLevel, jdkImageDir): """ Creates a tar.gz JDK archive, an accompanying tar.gz.sha1 file with its SHA1 signature plus symlinks to the archive for non-canonical architecture names. """ - jdkImageDir = join(jdkBuildDir, 'images', 'jdk') arches = _get_jdk_bundle_arches() - jdkTgzPath = join(_suite.get_output_root(), 'jdk-bundles', 'jdk9-{}-{}.tar.gz'.format(_get_openjdk_os(), arches[0])) + jdkTgzPath = join(_suite.get_output_root(), 'jdk-bundles', 'jdk9-{}-{}-{}.tar.gz'.format(debugLevel, _get_openjdk_os(), arches[0])) with mx.Archiver(jdkTgzPath, kind='tgz') as arc: mx.log('Creating ' + jdkTgzPath) for root, _, filenames in os.walk(jdkImageDir): @@ -236,10 +251,6 @@ def _create_jdk_bundle(jdkBuildDir): f = join(root, name) arcname = 'jdk1.9.0/' + os.path.relpath(f, jdkImageDir) arc.zf.add(name=f, arcname=arcname, recursive=False) - # The OpenJDK build creates an empty cacerts file so grab one from - # the default JDK which is assumed to be an OracleJDK - cacerts = join(mx.get_jdk(tag='default').home, 'jre', 'lib', 'security', 'cacerts') - arc.zf.add(name=cacerts, arcname='jdk1.9.0/lib/security/cacerts') with open(jdkTgzPath + '.sha1', 'w') as fp: mx.log('Creating ' + jdkTgzPath + '.sha1') @@ -252,7 +263,7 @@ def _create_jdk_bundle(jdkBuildDir): os.symlink(source, link_name) for arch in arches[1:]: - link_name = join(_suite.get_output_root(), 'jdk-bundles', 'jdk9-{}-{}.tar.gz'.format(_get_openjdk_os(), arch)) + link_name = join(_suite.get_output_root(), 'jdk-bundles', 'jdk9-{}-{}-{}.tar.gz'.format(debugLevel, _get_openjdk_os(), arch)) jdkTgzName = os.path.basename(jdkTgzPath) _create_link(jdkTgzName, link_name) _create_link(jdkTgzName + '.sha1', link_name + '.sha1') @@ -668,15 +679,10 @@ class JVMCIArchiveParticipant: def __opened__(self, arc, srcArc, services): self.services = services + self.jvmciServices = services self.arc = arc def __add__(self, arcname, contents): - if arcname.startswith('META-INF/jvmci.providers/'): - provider = arcname[len('META-INF/jvmci.providers/'):] - for service in contents.strip().split(os.linesep): - assert service - self.services.setdefault(service, []).append(provider) - return True return False def __addsrc__(self, arcname, contents): @@ -757,6 +763,14 @@ class JVMCI9JDKConfig(mx.JDKConfig): args = ['-Xbootclasspath/p:' + dep.classpath_repr() for dep in _jvmci_bootclasspath_prepends] + args + # Remove JVMCI jars from class path. They are only necessary when + # compiling with a javac from JDK8 or earlier. + cpIndex, cp = mx.find_classpath_arg(args) + if cp: + excluded = frozenset([dist.path for dist in _suite.dists]) + cp = os.pathsep.join([e for e in cp.split(os.pathsep) if e not in excluded]) + args[cpIndex] = cp + jvmciModeArgs = _jvmciModes[_vm.jvmciMode] if jvmciModeArgs: bcpDeps = [jdkDist.dist() for jdkDist in jdkDeployedDists] @@ -812,7 +826,7 @@ def get_jvmci_jdk(debugLevel=None): _jvmci_jdks[debugLevel] = jdk return jdk -class JVMCIJDKFactory(mx.JDKFactory): +class JVMCI9JDKFactory(mx.JDKFactory): def getJDKConfig(self): jdk = get_jvmci_jdk(_vm.debugLevel) return jdk @@ -836,8 +850,9 @@ mx.add_argument('--jdk-jvm-variant', '--vm', action='store', choices=_jdkJvmVari mx.add_argument('--jdk-debug-level', '--vmbuild', action='store', choices=_jdkDebugLevels + sorted(_legacyVmbuilds.viewkeys()), help='the JDK debug level to build/run (default: ' + _vm.debugLevel + ')') mx.add_argument('-I', '--use-jdk-image', action='store_true', help='build/run JDK image instead of exploded JDK') +mx.addJDKFactory(_JVMCI_JDK_TAG, mx.JavaCompliance('9'), JVMCI9JDKFactory()) + def mx_post_parse_cmd_line(opts): - mx.addJDKFactory(_JVMCI_JDK_TAG, mx.JavaCompliance('9'), JVMCIJDKFactory()) mx.set_java_command_default_jdk_tag(_JVMCI_JDK_TAG) jdkTag = mx.get_jdk_option().tag @@ -864,6 +879,39 @@ def mx_post_parse_cmd_line(opts): _vm.update(jvmVariant, debugLevel, jvmciMode) for jdkDist in jdkDeployedDists: - dist = jdkDist.dist() - if isinstance(jdkDist, JvmciJDKDeployedDist): - dist.set_archiveparticipant(JVMCIArchiveParticipant(dist)) + jdkDist.post_parse_cmd_line() + +def _update_JDK9_STUBS_library(): + """ + Sets the "path" and "sha1" attributes of the "JDK9_STUBS" library. + """ + jdk9InternalLib = _suite.suiteDict['libraries']['JDK9_STUBS'] + jarInputDir = join(_suite.get_output_root(), 'jdk9-stubs') + jarPath = join(_suite.get_output_root(), 'jdk9-stubs.jar') + + stubs = [ + ('jdk.internal.misc', 'VM', """package jdk.internal.misc; +public class VM { + public static String getSavedProperty(String key) { + throw new InternalError("should not reach here"); + } +} +""") + ] + + if not exists(jarPath): + sourceFiles = [] + for (package, className, source) in stubs: + sourceFile = join(jarInputDir, package.replace('.', os.sep), className + '.java') + mx.ensure_dir_exists(os.path.dirname(sourceFile)) + with open(sourceFile, 'w') as fp: + fp.write(source) + sourceFiles.append(sourceFile) + jdk = mx.get_jdk(tag='default') + mx.run([jdk.javac, '-d', jarInputDir] + sourceFiles) + mx.run([jdk.jar, 'cf', jarPath, '.'], cwd=jarInputDir) + + jdk9InternalLib['path'] = jarPath + jdk9InternalLib['sha1'] = mx.sha1OfFile(jarPath) + +_update_JDK9_STUBS_library() diff --git a/hotspot/.mx.jvmci/suite.py b/hotspot/.mx.jvmci/suite.py index 05d0027a8bb..28c00818dd7 100644 --- a/hotspot/.mx.jvmci/suite.py +++ b/hotspot/.mx.jvmci/suite.py @@ -1,5 +1,5 @@ suite = { - "mxversion" : "5.5.12", + "mxversion" : "5.6.11", "name" : "jvmci", "url" : "http://openjdk.java.net/projects/graal", "developer" : { @@ -24,7 +24,7 @@ suite = { "defaultLicense" : "GPLv2-CPE", - # This puts mx/ as a sibiling of the JDK build configuration directories + # This puts mx/ as a sibling of the JDK build configuration directories # (e.g., macosx-x86_64-normal-server-release). "outputRoot" : "../build/mx/hotspot", @@ -32,8 +32,6 @@ suite = { "libraries" : { - # ------------- Libraries ------------- - "HCFDIS" : { "urls" : ["https://lafo.ssw.uni-linz.ac.at/pub/hcfdis-3.jar"], "sha1" : "a71247c6ddb90aad4abf7c77e501acc60674ef57", @@ -53,34 +51,32 @@ suite = { "sha1" : "122b87ca88e41a415cf8b523fd3d03b4325134a3", "urls" : ["https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/batik-all-1.7.jar"], }, + + # Stubs for classes introduced in JDK9 that allow compilation with a JDK8 javac and Eclipse. + # The "path" and "sha1" attributes are added when mx_jvmci is loaded + # (see mx_jvmci._update_JDK9_STUBS_library()). + "JDK9_STUBS" : { + "license" : "GPLv2-CPE", + }, }, "projects" : { # ------------- JVMCI:Service ------------- - "jdk.vm.ci.service" : { + "jdk.vm.ci.services" : { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], "javaCompliance" : "1.8", "workingSets" : "API,JVMCI", }, - "jdk.vm.ci.service.processor" : { - "subDir" : "src/jdk.vm.ci/share/classes", - "sourceDirs" : ["src"], - "dependencies" : ["jdk.vm.ci.service"], - "checkstyle" : "jdk.vm.ci.service", - "javaCompliance" : "1.8", - "workingSets" : "JVMCI,Codegen,HotSpot", - }, - # ------------- JVMCI:API ------------- "jdk.vm.ci.common" : { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "API,JVMCI", }, @@ -88,7 +84,7 @@ suite = { "jdk.vm.ci.meta" : { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "API,JVMCI", }, @@ -97,7 +93,7 @@ suite = { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], "dependencies" : ["jdk.vm.ci.meta"], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "API,JVMCI", }, @@ -108,7 +104,7 @@ suite = { "dependencies" : [ "jdk.vm.ci.code", ], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "API,JVMCI", }, @@ -121,7 +117,7 @@ suite = { "jdk.vm.ci.common", "jdk.vm.ci.runtime", ], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "API,JVMCI", }, @@ -129,7 +125,7 @@ suite = { "jdk.vm.ci.inittimer" : { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "JVMCI", }, @@ -140,7 +136,7 @@ suite = { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], "dependencies" : ["jdk.vm.ci.code"], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "JVMCI,AArch64", }, @@ -149,7 +145,7 @@ suite = { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], "dependencies" : ["jdk.vm.ci.code"], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "JVMCI,AMD64", }, @@ -158,7 +154,7 @@ suite = { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], "dependencies" : ["jdk.vm.ci.code"], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "JVMCI,SPARC", }, @@ -171,9 +167,10 @@ suite = { "jdk.vm.ci.common", "jdk.vm.ci.inittimer", "jdk.vm.ci.runtime", - "jdk.vm.ci.service", + "jdk.vm.ci.services", + "JDK9_STUBS", ], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "JVMCI", }, @@ -181,7 +178,7 @@ suite = { "jdk.vm.ci.hotspotvmconfig" : { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "JVMCI,HotSpot", }, @@ -193,10 +190,7 @@ suite = { "jdk.vm.ci.aarch64", "jdk.vm.ci.hotspot", ], - "checkstyle" : "jdk.vm.ci.service", - "annotationProcessors" : [ - "JVMCI_SERVICE_PROCESSOR", - ], + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "JVMCI,HotSpot,AArch64", }, @@ -208,10 +202,7 @@ suite = { "jdk.vm.ci.amd64", "jdk.vm.ci.hotspot", ], - "checkstyle" : "jdk.vm.ci.service", - "annotationProcessors" : [ - "JVMCI_SERVICE_PROCESSOR", - ], + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "JVMCI,HotSpot,AMD64", }, @@ -223,10 +214,7 @@ suite = { "jdk.vm.ci.sparc", "jdk.vm.ci.hotspot", ], - "checkstyle" : "jdk.vm.ci.service", - "annotationProcessors" : [ - "JVMCI_SERVICE_PROCESSOR", - ], + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "JVMCI,HotSpot,SPARC", }, @@ -241,9 +229,9 @@ suite = { # ------------- Distributions ------------- - "JVMCI_SERVICE" : { + "JVMCI_SERVICES" : { "subDir" : "src/jdk.vm.ci/share/classes", - "dependencies" : ["jdk.vm.ci.service"], + "dependencies" : ["jdk.vm.ci.services"], }, "JVMCI_API" : { @@ -257,7 +245,7 @@ suite = { "jdk.vm.ci.sparc", ], "distDependencies" : [ - "JVMCI_SERVICE", + "JVMCI_SERVICES", ], }, @@ -277,7 +265,7 @@ suite = { ], "distDependencies" : [ "JVMCI_HOTSPOTVMCONFIG", - "JVMCI_SERVICE", + "JVMCI_SERVICES", "JVMCI_API", ], }, @@ -293,28 +281,18 @@ suite = { "exclude" : ["mx:JUNIT"], }, - - "JVMCI_SERVICE_PROCESSOR" : { - "subDir" : "src/jdk.vm.ci/share/classes", - "dependencies" : ["jdk.vm.ci.service.processor"], - "distDependencies" : [ - "JVMCI_SERVICE", - ], - }, - # This exists to have a monolithic jvmci.jar file which simplifies # using the -Xoverride option in JDK9. "JVMCI" : { "subDir" : "src/jdk.vm.ci/share/classes", "overlaps" : [ "JVMCI_API", - "JVMCI_SERVICE", + "JVMCI_SERVICES", "JVMCI_HOTSPOT", "JVMCI_HOTSPOTVMCONFIG", - "JVMCI_SERVICE_PROCESSOR", ], "dependencies" : [ - "jdk.vm.ci.service", + "jdk.vm.ci.services", "jdk.vm.ci.inittimer", "jdk.vm.ci.runtime", "jdk.vm.ci.common", @@ -325,8 +303,8 @@ suite = { "jdk.vm.ci.hotspot.aarch64", "jdk.vm.ci.hotspot.amd64", "jdk.vm.ci.hotspot.sparc", - "jdk.vm.ci.service.processor" ], + "exclude" : ["JDK9_STUBS"] }, }, } diff --git a/hotspot/make/aix/Makefile b/hotspot/make/aix/Makefile index 77e54d08dc0..951a98502fa 100644 --- a/hotspot/make/aix/Makefile +++ b/hotspot/make/aix/Makefile @@ -1,6 +1,6 @@ # # Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2015 SAP AG. All rights reserved. +# Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/make/aix/makefiles/buildtree.make b/hotspot/make/aix/makefiles/buildtree.make index 1f2b556a4fe..94b71eb760f 100644 --- a/hotspot/make/aix/makefiles/buildtree.make +++ b/hotspot/make/aix/makefiles/buildtree.make @@ -1,6 +1,6 @@ # # Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. All rights reserved. +# Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/make/aix/makefiles/compiler2.make b/hotspot/make/aix/makefiles/compiler2.make index 73f544f118d..13986308edf 100644 --- a/hotspot/make/aix/makefiles/compiler2.make +++ b/hotspot/make/aix/makefiles/compiler2.make @@ -1,6 +1,6 @@ # # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. All rights reserved. +# Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/make/aix/makefiles/debug.make b/hotspot/make/aix/makefiles/debug.make index 5e2cacd365d..1a1c4ebbd7d 100644 --- a/hotspot/make/aix/makefiles/debug.make +++ b/hotspot/make/aix/makefiles/debug.make @@ -1,6 +1,6 @@ # # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. All rights reserved. +# Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/make/aix/makefiles/defs.make b/hotspot/make/aix/makefiles/defs.make index cca6803c9d5..b9c54e36149 100644 --- a/hotspot/make/aix/makefiles/defs.make +++ b/hotspot/make/aix/makefiles/defs.make @@ -1,6 +1,6 @@ # # Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. All rights reserved. +# Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/make/aix/makefiles/fastdebug.make b/hotspot/make/aix/makefiles/fastdebug.make index d7feb025617..c0d50079d16 100644 --- a/hotspot/make/aix/makefiles/fastdebug.make +++ b/hotspot/make/aix/makefiles/fastdebug.make @@ -1,6 +1,6 @@ # # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. All rights reserved. +# Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/make/aix/makefiles/jsig.make b/hotspot/make/aix/makefiles/jsig.make index 1d8a62184bd..86c4bea5ae1 100644 --- a/hotspot/make/aix/makefiles/jsig.make +++ b/hotspot/make/aix/makefiles/jsig.make @@ -1,6 +1,6 @@ # # Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. All rights reserved. +# Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/make/aix/makefiles/jvmti.make b/hotspot/make/aix/makefiles/jvmti.make index 105fd8e109d..cff6a741da6 100644 --- a/hotspot/make/aix/makefiles/jvmti.make +++ b/hotspot/make/aix/makefiles/jvmti.make @@ -1,6 +1,6 @@ # # Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. All rights reserved. +# Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/make/aix/makefiles/ppc64.make b/hotspot/make/aix/makefiles/ppc64.make index 2634d8adcc3..d7ad9510e11 100644 --- a/hotspot/make/aix/makefiles/ppc64.make +++ b/hotspot/make/aix/makefiles/ppc64.make @@ -1,6 +1,6 @@ # # Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2015 SAP AG. All rights reserved. +# Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/make/aix/makefiles/product.make b/hotspot/make/aix/makefiles/product.make index f1ef85a8192..f36ef69b32e 100644 --- a/hotspot/make/aix/makefiles/product.make +++ b/hotspot/make/aix/makefiles/product.make @@ -1,6 +1,6 @@ # # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. All rights reserved. +# Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/make/aix/makefiles/tiered.make b/hotspot/make/aix/makefiles/tiered.make index 992d59d5241..f04496bdb60 100644 --- a/hotspot/make/aix/makefiles/tiered.make +++ b/hotspot/make/aix/makefiles/tiered.make @@ -1,6 +1,6 @@ # # Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2015 SAP AG. All rights reserved. +# Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/make/aix/makefiles/vm.make b/hotspot/make/aix/makefiles/vm.make index 5de8a2dc997..808bb124892 100644 --- a/hotspot/make/aix/makefiles/vm.make +++ b/hotspot/make/aix/makefiles/vm.make @@ -1,6 +1,6 @@ # # Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. All rights reserved. +# Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/make/aix/makefiles/xlc.make b/hotspot/make/aix/makefiles/xlc.make index 676ba5c6a6d..c44d306359e 100644 --- a/hotspot/make/aix/makefiles/xlc.make +++ b/hotspot/make/aix/makefiles/xlc.make @@ -1,6 +1,6 @@ # # Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 2012, 2015 SAP. All rights reserved. +# Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk b/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk deleted file mode 100644 index cfcf9329a3d..00000000000 --- a/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk +++ /dev/null @@ -1,105 +0,0 @@ -# -# Copyright (c) 2015, 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. -# - -default: all - -include $(SPEC) -include MakeBase.gmk -include JavaCompilation.gmk -include SetupJavaCompilers.gmk - -GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.vm.ci -SRC_DIR := $(HOTSPOT_TOPDIR)/src/jdk.vm.ci/share/classes - -################################################################################ -# Compile the annotation processor - -$(eval $(call SetupJavaCompilation, BUILD_JVMCI_SERVICE, \ - SETUP := GENERATE_OLDBYTECODE, \ - SRC := $(SRC_DIR)/jdk.vm.ci.service/src \ - $(SRC_DIR)/jdk.vm.ci.service.processor/src, \ - BIN := $(BUILDTOOLS_OUTPUTDIR)/jvmci_service, \ - JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.ci.service.jar, \ -)) - -################################################################################ - -PROC_SRC_SUBDIRS := \ - jdk.vm.ci.hotspot \ - jdk.vm.ci.hotspot.aarch64 \ - jdk.vm.ci.hotspot.amd64 \ - jdk.vm.ci.hotspot.sparc \ - jdk.vm.ci.runtime \ - # - -PROC_SRC_DIRS := $(patsubst %, $(SRC_DIR)/%/src, $(PROC_SRC_SUBDIRS)) - -PROC_SRCS := $(filter %.java, $(call CacheFind, $(PROC_SRC_DIRS))) - -ALL_SRC_DIRS := $(wildcard $(SRC_DIR)/*/src) -SOURCEPATH := $(call PathList, $(ALL_SRC_DIRS)) -PROCESSOR_PATH := $(call PathList, \ - $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.ci.service.jar) - -$(GENSRC_DIR)/_gensrc_proc_done: $(PROC_SRCS) \ - $(BUILD_JVMCI_SERVICE) - $(MKDIR) -p $(@D) - $(eval $(call ListPathsSafely,PROC_SRCS,$(@D)/_gensrc_proc_files)) - $(JAVA_SMALL) $(NEW_JAVAC) \ - -XDignore.symbol.file \ - -bootclasspath $(JDK_OUTPUTDIR)/modules/java.base \ - -sourcepath $(SOURCEPATH) \ - -implicit:none \ - -proc:only \ - -processorpath $(PROCESSOR_PATH) \ - -d $(GENSRC_DIR) \ - -s $(GENSRC_DIR) \ - @$(@D)/_gensrc_proc_files - $(TOUCH) $@ - -TARGETS += $(GENSRC_DIR)/_gensrc_proc_done - -################################################################################ - -$(GENSRC_DIR)/_providers_converted: $(GENSRC_DIR)/_gensrc_proc_done - $(MKDIR) -p $(GENSRC_DIR)/META-INF/services - ($(CD) $(GENSRC_DIR)/META-INF/jvmci.providers && \ - for i in $$($(LS)); do \ - c=$$($(CAT) $$i | $(TR) -d '\n\r'); \ - $(ECHO) $$i >> $(GENSRC_DIR)/META-INF/services/$$c.tmp; \ - done) - ($(CD) $(GENSRC_DIR)/META-INF/services && \ - for i in $$($(LS) *.tmp); do \ - $(MV) $$i $${i%.tmp}; \ - done) - $(TOUCH) $@ - -TARGETS += $(GENSRC_DIR)/_providers_converted - -################################################################################ - -all: $(TARGETS) - -.PHONY: default all diff --git a/hotspot/make/linux/makefiles/ppc64.make b/hotspot/make/linux/makefiles/ppc64.make index f3392de49a6..acb51ab2b7a 100644 --- a/hotspot/make/linux/makefiles/ppc64.make +++ b/hotspot/make/linux/makefiles/ppc64.make @@ -1,6 +1,6 @@ # # Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. All rights reserved. +# Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/make/share/makefiles/mapfile-vers b/hotspot/make/share/makefiles/mapfile-vers index 2085a98b459..28338d046f6 100644 --- a/hotspot/make/share/makefiles/mapfile-vers +++ b/hotspot/make/share/makefiles/mapfile-vers @@ -13,6 +13,7 @@ JVM_Clone; JVM_ConstantPoolGetClassAt; JVM_ConstantPoolGetClassAtIfLoaded; + JVM_ConstantPoolGetClassRefIndexAt; JVM_ConstantPoolGetDoubleAt; JVM_ConstantPoolGetFieldAt; JVM_ConstantPoolGetFieldAtIfLoaded; @@ -22,8 +23,11 @@ JVM_ConstantPoolGetMethodAt; JVM_ConstantPoolGetMethodAtIfLoaded; JVM_ConstantPoolGetMemberRefInfoAt; + JVM_ConstantPoolGetNameAndTypeRefInfoAt; + JVM_ConstantPoolGetNameAndTypeRefIndexAt; JVM_ConstantPoolGetSize; JVM_ConstantPoolGetStringAt; + JVM_ConstantPoolGetTagAt; JVM_ConstantPoolGetUTF8At; JVM_CountStackFrames; JVM_CurrentClassLoader; diff --git a/hotspot/make/solaris/makefiles/sparcWorks.make b/hotspot/make/solaris/makefiles/sparcWorks.make index 062732b14dc..9bdab00ba66 100644 --- a/hotspot/make/solaris/makefiles/sparcWorks.make +++ b/hotspot/make/solaris/makefiles/sparcWorks.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2016, 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 @@ -48,9 +48,9 @@ CC_COMPILER_REV := \ $(shell $(CC) -V 2>&1 | sed -n 's/^.*[ ,\t]C[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p') # Pick which compiler is validated -# Validated compiler for JDK9 is SS12.3 (5.12) -VALIDATED_COMPILER_REVS := 5.12 -VALIDATED_CC_COMPILER_REVS := 5.12 +# Validated compiler for JDK9 is SS12.4 (5.13) +VALIDATED_COMPILER_REVS := 5.13 +VALIDATED_CC_COMPILER_REVS := 5.13 # Warning messages about not using the above validated versions ENFORCE_COMPILER_REV${ENFORCE_COMPILER_REV} := $(strip ${VALIDATED_COMPILER_REVS}) diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad index f19eb0e71c7..2b5d3d8838d 100644 --- a/hotspot/src/cpu/aarch64/vm/aarch64.ad +++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2014, Red Hat Inc. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // @@ -577,7 +577,7 @@ reg_class no_special_reg32_with_fp( R26 /* R27, */ // heapbase /* R28, */ // thread - R29, // fp + /* R29, */ // fp /* R30, */ // lr /* R31 */ // sp ); @@ -646,7 +646,7 @@ reg_class no_special_reg_with_fp( R26, R26_H, /* R27, R27_H, */ // heapbase /* R28, R28_H, */ // thread - R29, R29_H, // fp + /* R29, R29_H, */ // fp /* R30, R30_H, */ // lr /* R31, R31_H */ // sp ); @@ -4442,11 +4442,7 @@ encode %{ enc_class aarch64_enc_mov_byte_map_base(iRegP dst, immByteMapBase src) %{ MacroAssembler _masm(&cbuf); - address page = (address)$src$$constant; - Register dst_reg = as_Register($dst$$reg); - unsigned long off; - __ adrp(dst_reg, ExternalAddress(page), off); - assert(off == 0, "assumed offset == 0"); + __ load_byte_map_base($dst$$Register); %} enc_class aarch64_enc_mov_n(iRegN dst, immN src) %{ @@ -6673,6 +6669,14 @@ opclass iRegIorL2I(iRegI, iRegL2I); //----------PIPELINE----------------------------------------------------------- // Rules which define the behavior of the target architectures pipeline. + +// For specific pipelines, eg A53, define the stages of that pipeline +//pipe_desc(ISS, EX1, EX2, WR); +#define ISS S0 +#define EX1 S1 +#define EX2 S2 +#define WR S3 + // Integer ALU reg operation pipeline %{ @@ -6707,12 +6711,499 @@ resources( INS0, INS1, INS01 = INS0 | INS1, //----------PIPELINE DESCRIPTION----------------------------------------------- // Pipeline Description specifies the stages in the machine's pipeline -pipe_desc(ISS, EX1, EX2, WR); +// Define the pipeline as a generic 6 stage pipeline +pipe_desc(S0, S1, S2, S3, S4, S5); //----------PIPELINE CLASSES--------------------------------------------------- // Pipeline Classes describe the stages in which input and output are // referenced by the hardware pipeline. +pipe_class fp_dop_reg_reg_s(vRegF dst, vRegF src1, vRegF src2) +%{ + single_instruction; + src1 : S1(read); + src2 : S2(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_dop_reg_reg_d(vRegD dst, vRegD src1, vRegD src2) +%{ + single_instruction; + src1 : S1(read); + src2 : S2(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_uop_s(vRegF dst, vRegF src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_uop_d(vRegD dst, vRegD src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_d2f(vRegF dst, vRegD src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_f2d(vRegD dst, vRegF src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_f2i(iRegINoSp dst, vRegF src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_f2l(iRegLNoSp dst, vRegF src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_i2f(vRegF dst, iRegIorL2I src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_l2f(vRegF dst, iRegL src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_d2i(iRegINoSp dst, vRegD src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_d2l(iRegLNoSp dst, vRegD src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_i2d(vRegD dst, iRegIorL2I src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_l2d(vRegD dst, iRegIorL2I src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_div_s(vRegF dst, vRegF src1, vRegF src2) +%{ + single_instruction; + src1 : S1(read); + src2 : S2(read); + dst : S5(write); + INS0 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_div_d(vRegD dst, vRegD src1, vRegD src2) +%{ + single_instruction; + src1 : S1(read); + src2 : S2(read); + dst : S5(write); + INS0 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_cond_reg_reg_s(vRegF dst, vRegF src1, vRegF src2, rFlagsReg cr) +%{ + single_instruction; + cr : S1(read); + src1 : S1(read); + src2 : S1(read); + dst : S3(write); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class fp_cond_reg_reg_d(vRegD dst, vRegD src1, vRegD src2, rFlagsReg cr) +%{ + single_instruction; + cr : S1(read); + src1 : S1(read); + src2 : S1(read); + dst : S3(write); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class fp_imm_s(vRegF dst) +%{ + single_instruction; + dst : S3(write); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class fp_imm_d(vRegD dst) +%{ + single_instruction; + dst : S3(write); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class fp_load_constant_s(vRegF dst) +%{ + single_instruction; + dst : S4(write); + INS01 : ISS; + NEON_FP : S4; +%} + +pipe_class fp_load_constant_d(vRegD dst) +%{ + single_instruction; + dst : S4(write); + INS01 : ISS; + NEON_FP : S4; +%} + +pipe_class vmul64(vecD dst, vecD src1, vecD src2) +%{ + single_instruction; + dst : S5(write); + src1 : S1(read); + src2 : S1(read); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class vmul128(vecX dst, vecX src1, vecX src2) +%{ + single_instruction; + dst : S5(write); + src1 : S1(read); + src2 : S1(read); + INS0 : ISS; + NEON_FP : S5; +%} + +pipe_class vmla64(vecD dst, vecD src1, vecD src2) +%{ + single_instruction; + dst : S5(write); + src1 : S1(read); + src2 : S1(read); + dst : S1(read); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class vmla128(vecX dst, vecX src1, vecX src2) +%{ + single_instruction; + dst : S5(write); + src1 : S1(read); + src2 : S1(read); + dst : S1(read); + INS0 : ISS; + NEON_FP : S5; +%} + +pipe_class vdop64(vecD dst, vecD src1, vecD src2) +%{ + single_instruction; + dst : S4(write); + src1 : S2(read); + src2 : S2(read); + INS01 : ISS; + NEON_FP : S4; +%} + +pipe_class vdop128(vecX dst, vecX src1, vecX src2) +%{ + single_instruction; + dst : S4(write); + src1 : S2(read); + src2 : S2(read); + INS0 : ISS; + NEON_FP : S4; +%} + +pipe_class vlogical64(vecD dst, vecD src1, vecD src2) +%{ + single_instruction; + dst : S3(write); + src1 : S2(read); + src2 : S2(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vlogical128(vecX dst, vecX src1, vecX src2) +%{ + single_instruction; + dst : S3(write); + src1 : S2(read); + src2 : S2(read); + INS0 : ISS; + NEON_FP : S3; +%} + +pipe_class vshift64(vecD dst, vecD src, vecX shift) +%{ + single_instruction; + dst : S3(write); + src : S1(read); + shift : S1(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vshift128(vecX dst, vecX src, vecX shift) +%{ + single_instruction; + dst : S3(write); + src : S1(read); + shift : S1(read); + INS0 : ISS; + NEON_FP : S3; +%} + +pipe_class vshift64_imm(vecD dst, vecD src, immI shift) +%{ + single_instruction; + dst : S3(write); + src : S1(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vshift128_imm(vecX dst, vecX src, immI shift) +%{ + single_instruction; + dst : S3(write); + src : S1(read); + INS0 : ISS; + NEON_FP : S3; +%} + +pipe_class vdop_fp64(vecD dst, vecD src1, vecD src2) +%{ + single_instruction; + dst : S5(write); + src1 : S1(read); + src2 : S1(read); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class vdop_fp128(vecX dst, vecX src1, vecX src2) +%{ + single_instruction; + dst : S5(write); + src1 : S1(read); + src2 : S1(read); + INS0 : ISS; + NEON_FP : S5; +%} + +pipe_class vmuldiv_fp64(vecD dst, vecD src1, vecD src2) +%{ + single_instruction; + dst : S5(write); + src1 : S1(read); + src2 : S1(read); + INS0 : ISS; + NEON_FP : S5; +%} + +pipe_class vmuldiv_fp128(vecX dst, vecX src1, vecX src2) +%{ + single_instruction; + dst : S5(write); + src1 : S1(read); + src2 : S1(read); + INS0 : ISS; + NEON_FP : S5; +%} + +pipe_class vsqrt_fp128(vecX dst, vecX src) +%{ + single_instruction; + dst : S5(write); + src : S1(read); + INS0 : ISS; + NEON_FP : S5; +%} + +pipe_class vunop_fp64(vecD dst, vecD src) +%{ + single_instruction; + dst : S5(write); + src : S1(read); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class vunop_fp128(vecX dst, vecX src) +%{ + single_instruction; + dst : S5(write); + src : S1(read); + INS0 : ISS; + NEON_FP : S5; +%} + +pipe_class vdup_reg_reg64(vecD dst, iRegI src) +%{ + single_instruction; + dst : S3(write); + src : S1(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vdup_reg_reg128(vecX dst, iRegI src) +%{ + single_instruction; + dst : S3(write); + src : S1(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vdup_reg_freg64(vecD dst, vRegF src) +%{ + single_instruction; + dst : S3(write); + src : S1(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vdup_reg_freg128(vecX dst, vRegF src) +%{ + single_instruction; + dst : S3(write); + src : S1(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vdup_reg_dreg128(vecX dst, vRegD src) +%{ + single_instruction; + dst : S3(write); + src : S1(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vmovi_reg_imm64(vecD dst) +%{ + single_instruction; + dst : S3(write); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vmovi_reg_imm128(vecX dst) +%{ + single_instruction; + dst : S3(write); + INS0 : ISS; + NEON_FP : S3; +%} + +pipe_class vload_reg_mem64(vecD dst, vmem mem) +%{ + single_instruction; + dst : S5(write); + mem : ISS(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vload_reg_mem128(vecX dst, vmem mem) +%{ + single_instruction; + dst : S5(write); + mem : ISS(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vstore_reg_mem64(vecD src, vmem mem) +%{ + single_instruction; + mem : ISS(read); + src : S2(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vstore_reg_mem128(vecD src, vmem mem) +%{ + single_instruction; + mem : ISS(read); + src : S2(read); + INS01 : ISS; + NEON_FP : S3; +%} + //------- Integer ALU operations -------------------------- // Integer ALU reg-reg operation @@ -7559,7 +8050,7 @@ instruct loadConF_packed(vRegF dst, immFPacked con) %{ __ fmovs(as_FloatRegister($dst$$reg), (double)$con$$constant); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_imm_s); %} // Load Float Constant @@ -7577,7 +8068,7 @@ instruct loadConF(vRegF dst, immF con) %{ __ ldrs(as_FloatRegister($dst$$reg), $constantaddress($con)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_load_constant_s); %} // Load Packed Double Constant @@ -7590,7 +8081,7 @@ instruct loadConD_packed(vRegD dst, immDPacked con) %{ __ fmovd(as_FloatRegister($dst$$reg), $con$$constant); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_imm_d); %} // Load Double Constant @@ -7607,7 +8098,7 @@ instruct loadConD(vRegD dst, immD con) %{ __ ldrd(as_FloatRegister($dst$$reg), $constantaddress($con)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_load_constant_d); %} // Store Instructions @@ -9615,7 +10106,7 @@ instruct cmovF_reg(cmpOp cmp, rFlagsReg cr, vRegF dst, vRegF src1, vRegF src2) cond); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_cond_reg_reg_s); %} instruct cmovUF_reg(cmpOpU cmp, rFlagsRegU cr, vRegF dst, vRegF src1, vRegF src2) @@ -9633,7 +10124,7 @@ instruct cmovUF_reg(cmpOpU cmp, rFlagsRegU cr, vRegF dst, vRegF src1, vRegF src cond); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_cond_reg_reg_s); %} instruct cmovD_reg(cmpOp cmp, rFlagsReg cr, vRegD dst, vRegD src1, vRegD src2) @@ -9651,7 +10142,7 @@ instruct cmovD_reg(cmpOp cmp, rFlagsReg cr, vRegD dst, vRegD src1, vRegD src2) cond); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_cond_reg_reg_d); %} instruct cmovUD_reg(cmpOpU cmp, rFlagsRegU cr, vRegD dst, vRegD src1, vRegD src2) @@ -9669,7 +10160,7 @@ instruct cmovUD_reg(cmpOpU cmp, rFlagsRegU cr, vRegD dst, vRegD src1, vRegD src cond); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_cond_reg_reg_d); %} // ============================================================================ @@ -12033,7 +12524,7 @@ instruct addF_reg_reg(vRegF dst, vRegF src1, vRegF src2) %{ as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_dop_reg_reg_s); %} instruct addD_reg_reg(vRegD dst, vRegD src1, vRegD src2) %{ @@ -12048,7 +12539,7 @@ instruct addD_reg_reg(vRegD dst, vRegD src1, vRegD src2) %{ as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_dop_reg_reg_d); %} instruct subF_reg_reg(vRegF dst, vRegF src1, vRegF src2) %{ @@ -12063,7 +12554,7 @@ instruct subF_reg_reg(vRegF dst, vRegF src1, vRegF src2) %{ as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_dop_reg_reg_s); %} instruct subD_reg_reg(vRegD dst, vRegD src1, vRegD src2) %{ @@ -12078,7 +12569,7 @@ instruct subD_reg_reg(vRegD dst, vRegD src1, vRegD src2) %{ as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_dop_reg_reg_d); %} instruct mulF_reg_reg(vRegF dst, vRegF src1, vRegF src2) %{ @@ -12093,7 +12584,7 @@ instruct mulF_reg_reg(vRegF dst, vRegF src1, vRegF src2) %{ as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_dop_reg_reg_s); %} instruct mulD_reg_reg(vRegD dst, vRegD src1, vRegD src2) %{ @@ -12108,7 +12599,7 @@ instruct mulD_reg_reg(vRegD dst, vRegD src1, vRegD src2) %{ as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_dop_reg_reg_d); %} // We cannot use these fused mul w add/sub ops because they don't @@ -12256,7 +12747,7 @@ instruct divF_reg_reg(vRegF dst, vRegF src1, vRegF src2) %{ as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_div_s); %} instruct divD_reg_reg(vRegD dst, vRegD src1, vRegD src2) %{ @@ -12271,7 +12762,7 @@ instruct divD_reg_reg(vRegD dst, vRegD src1, vRegD src2) %{ as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_div_d); %} instruct negF_reg_reg(vRegF dst, vRegF src) %{ @@ -12285,7 +12776,7 @@ instruct negF_reg_reg(vRegF dst, vRegF src) %{ as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_uop_s); %} instruct negD_reg_reg(vRegD dst, vRegD src) %{ @@ -12299,7 +12790,7 @@ instruct negD_reg_reg(vRegD dst, vRegD src) %{ as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_uop_d); %} instruct absF_reg(vRegF dst, vRegF src) %{ @@ -12312,7 +12803,7 @@ instruct absF_reg(vRegF dst, vRegF src) %{ as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_uop_s); %} instruct absD_reg(vRegD dst, vRegD src) %{ @@ -12325,7 +12816,7 @@ instruct absD_reg(vRegD dst, vRegD src) %{ as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_uop_d); %} instruct sqrtD_reg(vRegD dst, vRegD src) %{ @@ -12338,7 +12829,7 @@ instruct sqrtD_reg(vRegD dst, vRegD src) %{ as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_div_s); %} instruct sqrtF_reg(vRegF dst, vRegF src) %{ @@ -12351,7 +12842,7 @@ instruct sqrtF_reg(vRegF dst, vRegF src) %{ as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_div_d); %} // ============================================================================ @@ -12638,7 +13129,7 @@ instruct convD2F_reg(vRegF dst, vRegD src) %{ __ fcvtd(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_d2f); %} instruct convF2D_reg(vRegD dst, vRegF src) %{ @@ -12651,7 +13142,7 @@ instruct convF2D_reg(vRegD dst, vRegF src) %{ __ fcvts(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_f2d); %} instruct convF2I_reg_reg(iRegINoSp dst, vRegF src) %{ @@ -12664,7 +13155,7 @@ instruct convF2I_reg_reg(iRegINoSp dst, vRegF src) %{ __ fcvtzsw(as_Register($dst$$reg), as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_f2i); %} instruct convF2L_reg_reg(iRegLNoSp dst, vRegF src) %{ @@ -12677,7 +13168,7 @@ instruct convF2L_reg_reg(iRegLNoSp dst, vRegF src) %{ __ fcvtzs(as_Register($dst$$reg), as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_f2l); %} instruct convI2F_reg_reg(vRegF dst, iRegIorL2I src) %{ @@ -12690,7 +13181,7 @@ instruct convI2F_reg_reg(vRegF dst, iRegIorL2I src) %{ __ scvtfws(as_FloatRegister($dst$$reg), as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_i2f); %} instruct convL2F_reg_reg(vRegF dst, iRegL src) %{ @@ -12703,7 +13194,7 @@ instruct convL2F_reg_reg(vRegF dst, iRegL src) %{ __ scvtfs(as_FloatRegister($dst$$reg), as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_l2f); %} instruct convD2I_reg_reg(iRegINoSp dst, vRegD src) %{ @@ -12716,7 +13207,7 @@ instruct convD2I_reg_reg(iRegINoSp dst, vRegD src) %{ __ fcvtzdw(as_Register($dst$$reg), as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_d2i); %} instruct convD2L_reg_reg(iRegLNoSp dst, vRegD src) %{ @@ -12729,7 +13220,7 @@ instruct convD2L_reg_reg(iRegLNoSp dst, vRegD src) %{ __ fcvtzd(as_Register($dst$$reg), as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_d2l); %} instruct convI2D_reg_reg(vRegD dst, iRegIorL2I src) %{ @@ -12742,7 +13233,7 @@ instruct convI2D_reg_reg(vRegD dst, iRegIorL2I src) %{ __ scvtfwd(as_FloatRegister($dst$$reg), as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_i2d); %} instruct convL2D_reg_reg(vRegD dst, iRegL src) %{ @@ -12755,7 +13246,7 @@ instruct convL2D_reg_reg(vRegD dst, iRegL src) %{ __ scvtfd(as_FloatRegister($dst$$reg), as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_l2d); %} // stack <-> reg and reg <-> reg shuffles with no conversion @@ -14500,7 +14991,7 @@ instruct loadV4(vecD dst, vmem mem) ins_cost(4 * INSN_COST); format %{ "ldrs $dst,$mem\t# vector (32 bits)" %} ins_encode( aarch64_enc_ldrvS(dst, mem) ); - ins_pipe(pipe_class_memory); + ins_pipe(vload_reg_mem64); %} // Load vector (64 bits) @@ -14511,7 +15002,7 @@ instruct loadV8(vecD dst, vmem mem) ins_cost(4 * INSN_COST); format %{ "ldrd $dst,$mem\t# vector (64 bits)" %} ins_encode( aarch64_enc_ldrvD(dst, mem) ); - ins_pipe(pipe_class_memory); + ins_pipe(vload_reg_mem64); %} // Load Vector (128 bits) @@ -14522,7 +15013,7 @@ instruct loadV16(vecX dst, vmem mem) ins_cost(4 * INSN_COST); format %{ "ldrq $dst,$mem\t# vector (128 bits)" %} ins_encode( aarch64_enc_ldrvQ(dst, mem) ); - ins_pipe(pipe_class_memory); + ins_pipe(vload_reg_mem128); %} // Store Vector (32 bits) @@ -14533,7 +15024,7 @@ instruct storeV4(vecD src, vmem mem) ins_cost(4 * INSN_COST); format %{ "strs $mem,$src\t# vector (32 bits)" %} ins_encode( aarch64_enc_strvS(src, mem) ); - ins_pipe(pipe_class_memory); + ins_pipe(vstore_reg_mem64); %} // Store Vector (64 bits) @@ -14544,7 +15035,7 @@ instruct storeV8(vecD src, vmem mem) ins_cost(4 * INSN_COST); format %{ "strd $mem,$src\t# vector (64 bits)" %} ins_encode( aarch64_enc_strvD(src, mem) ); - ins_pipe(pipe_class_memory); + ins_pipe(vstore_reg_mem64); %} // Store Vector (128 bits) @@ -14555,7 +15046,7 @@ instruct storeV16(vecX src, vmem mem) ins_cost(4 * INSN_COST); format %{ "strq $mem,$src\t# vector (128 bits)" %} ins_encode( aarch64_enc_strvQ(src, mem) ); - ins_pipe(pipe_class_memory); + ins_pipe(vstore_reg_mem128); %} instruct replicate8B(vecD dst, iRegIorL2I src) @@ -14568,7 +15059,7 @@ instruct replicate8B(vecD dst, iRegIorL2I src) ins_encode %{ __ dup(as_FloatRegister($dst$$reg), __ T8B, as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_reg64); %} instruct replicate16B(vecX dst, iRegIorL2I src) @@ -14580,7 +15071,7 @@ instruct replicate16B(vecX dst, iRegIorL2I src) ins_encode %{ __ dup(as_FloatRegister($dst$$reg), __ T16B, as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_reg128); %} instruct replicate8B_imm(vecD dst, immI con) @@ -14593,7 +15084,7 @@ instruct replicate8B_imm(vecD dst, immI con) ins_encode %{ __ mov(as_FloatRegister($dst$$reg), __ T8B, $con$$constant & 0xff); %} - ins_pipe(pipe_class_default); + ins_pipe(vmovi_reg_imm64); %} instruct replicate16B_imm(vecX dst, immI con) @@ -14605,7 +15096,7 @@ instruct replicate16B_imm(vecX dst, immI con) ins_encode %{ __ mov(as_FloatRegister($dst$$reg), __ T16B, $con$$constant & 0xff); %} - ins_pipe(pipe_class_default); + ins_pipe(vmovi_reg_imm128); %} instruct replicate4S(vecD dst, iRegIorL2I src) @@ -14618,7 +15109,7 @@ instruct replicate4S(vecD dst, iRegIorL2I src) ins_encode %{ __ dup(as_FloatRegister($dst$$reg), __ T4H, as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_reg64); %} instruct replicate8S(vecX dst, iRegIorL2I src) @@ -14630,7 +15121,7 @@ instruct replicate8S(vecX dst, iRegIorL2I src) ins_encode %{ __ dup(as_FloatRegister($dst$$reg), __ T8H, as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_reg128); %} instruct replicate4S_imm(vecD dst, immI con) @@ -14643,7 +15134,7 @@ instruct replicate4S_imm(vecD dst, immI con) ins_encode %{ __ mov(as_FloatRegister($dst$$reg), __ T4H, $con$$constant & 0xffff); %} - ins_pipe(pipe_class_default); + ins_pipe(vmovi_reg_imm64); %} instruct replicate8S_imm(vecX dst, immI con) @@ -14655,7 +15146,7 @@ instruct replicate8S_imm(vecX dst, immI con) ins_encode %{ __ mov(as_FloatRegister($dst$$reg), __ T8H, $con$$constant & 0xffff); %} - ins_pipe(pipe_class_default); + ins_pipe(vmovi_reg_imm128); %} instruct replicate2I(vecD dst, iRegIorL2I src) @@ -14667,7 +15158,7 @@ instruct replicate2I(vecD dst, iRegIorL2I src) ins_encode %{ __ dup(as_FloatRegister($dst$$reg), __ T2S, as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_reg64); %} instruct replicate4I(vecX dst, iRegIorL2I src) @@ -14679,7 +15170,7 @@ instruct replicate4I(vecX dst, iRegIorL2I src) ins_encode %{ __ dup(as_FloatRegister($dst$$reg), __ T4S, as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_reg128); %} instruct replicate2I_imm(vecD dst, immI con) @@ -14691,7 +15182,7 @@ instruct replicate2I_imm(vecD dst, immI con) ins_encode %{ __ mov(as_FloatRegister($dst$$reg), __ T2S, $con$$constant); %} - ins_pipe(pipe_class_default); + ins_pipe(vmovi_reg_imm64); %} instruct replicate4I_imm(vecX dst, immI con) @@ -14703,7 +15194,7 @@ instruct replicate4I_imm(vecX dst, immI con) ins_encode %{ __ mov(as_FloatRegister($dst$$reg), __ T4S, $con$$constant); %} - ins_pipe(pipe_class_default); + ins_pipe(vmovi_reg_imm128); %} instruct replicate2L(vecX dst, iRegL src) @@ -14715,7 +15206,7 @@ instruct replicate2L(vecX dst, iRegL src) ins_encode %{ __ dup(as_FloatRegister($dst$$reg), __ T2D, as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_reg128); %} instruct replicate2L_zero(vecX dst, immI0 zero) @@ -14729,7 +15220,7 @@ instruct replicate2L_zero(vecX dst, immI0 zero) as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmovi_reg_imm128); %} instruct replicate2F(vecD dst, vRegF src) @@ -14742,7 +15233,7 @@ instruct replicate2F(vecD dst, vRegF src) __ dup(as_FloatRegister($dst$$reg), __ T2S, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_freg64); %} instruct replicate4F(vecX dst, vRegF src) @@ -14755,7 +15246,7 @@ instruct replicate4F(vecX dst, vRegF src) __ dup(as_FloatRegister($dst$$reg), __ T4S, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_freg128); %} instruct replicate2D(vecX dst, vRegD src) @@ -14768,7 +15259,7 @@ instruct replicate2D(vecX dst, vRegD src) __ dup(as_FloatRegister($dst$$reg), __ T2D, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_dreg128); %} // ====================REDUCTION ARITHMETIC==================================== @@ -15014,7 +15505,7 @@ instruct vadd8B(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop64); %} instruct vadd16B(vecX dst, vecX src1, vecX src2) @@ -15028,7 +15519,7 @@ instruct vadd16B(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop128); %} instruct vadd4S(vecD dst, vecD src1, vecD src2) @@ -15043,7 +15534,7 @@ instruct vadd4S(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop64); %} instruct vadd8S(vecX dst, vecX src1, vecX src2) @@ -15057,7 +15548,7 @@ instruct vadd8S(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop128); %} instruct vadd2I(vecD dst, vecD src1, vecD src2) @@ -15071,7 +15562,7 @@ instruct vadd2I(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop64); %} instruct vadd4I(vecX dst, vecX src1, vecX src2) @@ -15085,7 +15576,7 @@ instruct vadd4I(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop128); %} instruct vadd2L(vecX dst, vecX src1, vecX src2) @@ -15099,7 +15590,7 @@ instruct vadd2L(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop128); %} instruct vadd2F(vecD dst, vecD src1, vecD src2) @@ -15113,7 +15604,7 @@ instruct vadd2F(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop_fp64); %} instruct vadd4F(vecX dst, vecX src1, vecX src2) @@ -15127,7 +15618,7 @@ instruct vadd4F(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop_fp128); %} instruct vadd2D(vecX dst, vecX src1, vecX src2) @@ -15140,7 +15631,7 @@ instruct vadd2D(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop_fp128); %} // --------------------------------- SUB -------------------------------------- @@ -15157,7 +15648,7 @@ instruct vsub8B(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop64); %} instruct vsub16B(vecX dst, vecX src1, vecX src2) @@ -15171,7 +15662,7 @@ instruct vsub16B(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop128); %} instruct vsub4S(vecD dst, vecD src1, vecD src2) @@ -15186,7 +15677,7 @@ instruct vsub4S(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop64); %} instruct vsub8S(vecX dst, vecX src1, vecX src2) @@ -15200,7 +15691,7 @@ instruct vsub8S(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop128); %} instruct vsub2I(vecD dst, vecD src1, vecD src2) @@ -15214,7 +15705,7 @@ instruct vsub2I(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop64); %} instruct vsub4I(vecX dst, vecX src1, vecX src2) @@ -15228,7 +15719,7 @@ instruct vsub4I(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop128); %} instruct vsub2L(vecX dst, vecX src1, vecX src2) @@ -15242,7 +15733,7 @@ instruct vsub2L(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop128); %} instruct vsub2F(vecD dst, vecD src1, vecD src2) @@ -15256,7 +15747,7 @@ instruct vsub2F(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop_fp64); %} instruct vsub4F(vecX dst, vecX src1, vecX src2) @@ -15270,7 +15761,7 @@ instruct vsub4F(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop_fp128); %} instruct vsub2D(vecX dst, vecX src1, vecX src2) @@ -15284,7 +15775,7 @@ instruct vsub2D(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop_fp128); %} // --------------------------------- MUL -------------------------------------- @@ -15301,7 +15792,7 @@ instruct vmul4S(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmul64); %} instruct vmul8S(vecX dst, vecX src1, vecX src2) @@ -15315,7 +15806,7 @@ instruct vmul8S(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmul128); %} instruct vmul2I(vecD dst, vecD src1, vecD src2) @@ -15329,7 +15820,7 @@ instruct vmul2I(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmul64); %} instruct vmul4I(vecX dst, vecX src1, vecX src2) @@ -15343,7 +15834,7 @@ instruct vmul4I(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmul128); %} instruct vmul2F(vecD dst, vecD src1, vecD src2) @@ -15357,7 +15848,7 @@ instruct vmul2F(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmuldiv_fp64); %} instruct vmul4F(vecX dst, vecX src1, vecX src2) @@ -15371,7 +15862,7 @@ instruct vmul4F(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmuldiv_fp128); %} instruct vmul2D(vecX dst, vecX src1, vecX src2) @@ -15385,7 +15876,7 @@ instruct vmul2D(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmuldiv_fp128); %} // --------------------------------- MLA -------------------------------------- @@ -15402,7 +15893,7 @@ instruct vmla4S(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmla64); %} instruct vmla8S(vecX dst, vecX src1, vecX src2) @@ -15416,7 +15907,7 @@ instruct vmla8S(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmla128); %} instruct vmla2I(vecD dst, vecD src1, vecD src2) @@ -15430,7 +15921,7 @@ instruct vmla2I(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmla64); %} instruct vmla4I(vecX dst, vecX src1, vecX src2) @@ -15444,7 +15935,7 @@ instruct vmla4I(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmla128); %} // --------------------------------- MLS -------------------------------------- @@ -15461,7 +15952,7 @@ instruct vmls4S(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmla64); %} instruct vmls8S(vecX dst, vecX src1, vecX src2) @@ -15475,7 +15966,7 @@ instruct vmls8S(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmla128); %} instruct vmls2I(vecD dst, vecD src1, vecD src2) @@ -15489,7 +15980,7 @@ instruct vmls2I(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmla64); %} instruct vmls4I(vecX dst, vecX src1, vecX src2) @@ -15503,7 +15994,7 @@ instruct vmls4I(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmla128); %} // --------------------------------- DIV -------------------------------------- @@ -15519,7 +16010,7 @@ instruct vdiv2F(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmuldiv_fp64); %} instruct vdiv4F(vecX dst, vecX src1, vecX src2) @@ -15533,7 +16024,7 @@ instruct vdiv4F(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmuldiv_fp128); %} instruct vdiv2D(vecX dst, vecX src1, vecX src2) @@ -15547,7 +16038,7 @@ instruct vdiv2D(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmuldiv_fp128); %} // --------------------------------- SQRT ------------------------------------- @@ -15561,7 +16052,7 @@ instruct vsqrt2D(vecX dst, vecX src) __ fsqrt(as_FloatRegister($dst$$reg), __ T2D, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vsqrt_fp128); %} // --------------------------------- ABS -------------------------------------- @@ -15576,7 +16067,7 @@ instruct vabs2F(vecD dst, vecD src) __ fabs(as_FloatRegister($dst$$reg), __ T2S, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vunop_fp64); %} instruct vabs4F(vecX dst, vecX src) @@ -15589,7 +16080,7 @@ instruct vabs4F(vecX dst, vecX src) __ fabs(as_FloatRegister($dst$$reg), __ T4S, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vunop_fp128); %} instruct vabs2D(vecX dst, vecX src) @@ -15602,7 +16093,7 @@ instruct vabs2D(vecX dst, vecX src) __ fabs(as_FloatRegister($dst$$reg), __ T2D, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vunop_fp128); %} // --------------------------------- NEG -------------------------------------- @@ -15617,7 +16108,7 @@ instruct vneg2F(vecD dst, vecD src) __ fneg(as_FloatRegister($dst$$reg), __ T2S, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vunop_fp64); %} instruct vneg4F(vecX dst, vecX src) @@ -15630,7 +16121,7 @@ instruct vneg4F(vecX dst, vecX src) __ fneg(as_FloatRegister($dst$$reg), __ T4S, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vunop_fp128); %} instruct vneg2D(vecX dst, vecX src) @@ -15643,7 +16134,7 @@ instruct vneg2D(vecX dst, vecX src) __ fneg(as_FloatRegister($dst$$reg), __ T2D, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vunop_fp128); %} // --------------------------------- AND -------------------------------------- @@ -15660,7 +16151,7 @@ instruct vand8B(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vlogical64); %} instruct vand16B(vecX dst, vecX src1, vecX src2) @@ -15674,7 +16165,7 @@ instruct vand16B(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vlogical128); %} // --------------------------------- OR --------------------------------------- @@ -15691,7 +16182,7 @@ instruct vor8B(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vlogical64); %} instruct vor16B(vecX dst, vecX src1, vecX src2) @@ -15705,7 +16196,7 @@ instruct vor16B(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vlogical128); %} // --------------------------------- XOR -------------------------------------- @@ -15722,7 +16213,7 @@ instruct vxor8B(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vlogical64); %} instruct vxor16B(vecX dst, vecX src1, vecX src2) @@ -15736,7 +16227,7 @@ instruct vxor16B(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vlogical128); %} // ------------------------------ Shift --------------------------------------- @@ -15747,7 +16238,7 @@ instruct vshiftcntL(vecX dst, iRegIorL2I cnt) %{ ins_encode %{ __ dup(as_FloatRegister($dst$$reg), __ T16B, as_Register($cnt$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_reg128); %} // Right shifts on aarch64 SIMD are implemented as left shift by -ve amount @@ -15758,7 +16249,7 @@ instruct vshiftcntR(vecX dst, iRegIorL2I cnt) %{ __ dup(as_FloatRegister($dst$$reg), __ T16B, as_Register($cnt$$reg)); __ negr(as_FloatRegister($dst$$reg), __ T16B, as_FloatRegister($dst$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_reg128); %} instruct vsll8B(vecD dst, vecD src, vecX shift) %{ @@ -15773,7 +16264,7 @@ instruct vsll8B(vecD dst, vecD src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64); %} instruct vsll16B(vecX dst, vecX src, vecX shift) %{ @@ -15787,7 +16278,7 @@ instruct vsll16B(vecX dst, vecX src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128); %} instruct vsrl8B(vecD dst, vecD src, vecX shift) %{ @@ -15801,7 +16292,7 @@ instruct vsrl8B(vecD dst, vecD src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64); %} instruct vsrl16B(vecX dst, vecX src, vecX shift) %{ @@ -15814,7 +16305,7 @@ instruct vsrl16B(vecX dst, vecX src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128); %} instruct vsll8B_imm(vecD dst, vecD src, immI shift) %{ @@ -15834,7 +16325,7 @@ instruct vsll8B_imm(vecD dst, vecD src, immI shift) %{ as_FloatRegister($src$$reg), sh); } %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsll16B_imm(vecX dst, vecX src, immI shift) %{ @@ -15853,7 +16344,7 @@ instruct vsll16B_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), sh); } %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsra8B_imm(vecD dst, vecD src, immI shift) %{ @@ -15869,7 +16360,7 @@ instruct vsra8B_imm(vecD dst, vecD src, immI shift) %{ __ sshr(as_FloatRegister($dst$$reg), __ T8B, as_FloatRegister($src$$reg), sh); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsra16B_imm(vecX dst, vecX src, immI shift) %{ @@ -15884,7 +16375,7 @@ instruct vsra16B_imm(vecX dst, vecX src, immI shift) %{ __ sshr(as_FloatRegister($dst$$reg), __ T16B, as_FloatRegister($src$$reg), sh); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsrl8B_imm(vecD dst, vecD src, immI shift) %{ @@ -15904,7 +16395,7 @@ instruct vsrl8B_imm(vecD dst, vecD src, immI shift) %{ as_FloatRegister($src$$reg), -sh & 7); } %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsrl16B_imm(vecX dst, vecX src, immI shift) %{ @@ -15923,7 +16414,7 @@ instruct vsrl16B_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), -sh & 7); } %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsll4S(vecD dst, vecD src, vecX shift) %{ @@ -15938,7 +16429,7 @@ instruct vsll4S(vecD dst, vecD src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64); %} instruct vsll8S(vecX dst, vecX src, vecX shift) %{ @@ -15952,7 +16443,7 @@ instruct vsll8S(vecX dst, vecX src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128); %} instruct vsrl4S(vecD dst, vecD src, vecX shift) %{ @@ -15966,7 +16457,7 @@ instruct vsrl4S(vecD dst, vecD src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64); %} instruct vsrl8S(vecX dst, vecX src, vecX shift) %{ @@ -15979,7 +16470,7 @@ instruct vsrl8S(vecX dst, vecX src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128); %} instruct vsll4S_imm(vecD dst, vecD src, immI shift) %{ @@ -15999,7 +16490,7 @@ instruct vsll4S_imm(vecD dst, vecD src, immI shift) %{ as_FloatRegister($src$$reg), sh); } %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsll8S_imm(vecX dst, vecX src, immI shift) %{ @@ -16018,7 +16509,7 @@ instruct vsll8S_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), sh); } %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsra4S_imm(vecD dst, vecD src, immI shift) %{ @@ -16034,7 +16525,7 @@ instruct vsra4S_imm(vecD dst, vecD src, immI shift) %{ __ sshr(as_FloatRegister($dst$$reg), __ T4H, as_FloatRegister($src$$reg), sh); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsra8S_imm(vecX dst, vecX src, immI shift) %{ @@ -16049,7 +16540,7 @@ instruct vsra8S_imm(vecX dst, vecX src, immI shift) %{ __ sshr(as_FloatRegister($dst$$reg), __ T8H, as_FloatRegister($src$$reg), sh); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsrl4S_imm(vecD dst, vecD src, immI shift) %{ @@ -16069,7 +16560,7 @@ instruct vsrl4S_imm(vecD dst, vecD src, immI shift) %{ as_FloatRegister($src$$reg), -sh & 15); } %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsrl8S_imm(vecX dst, vecX src, immI shift) %{ @@ -16088,7 +16579,7 @@ instruct vsrl8S_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), -sh & 15); } %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsll2I(vecD dst, vecD src, vecX shift) %{ @@ -16102,7 +16593,7 @@ instruct vsll2I(vecD dst, vecD src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsll4I(vecX dst, vecX src, vecX shift) %{ @@ -16116,7 +16607,7 @@ instruct vsll4I(vecX dst, vecX src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsrl2I(vecD dst, vecD src, vecX shift) %{ @@ -16129,7 +16620,7 @@ instruct vsrl2I(vecD dst, vecD src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsrl4I(vecX dst, vecX src, vecX shift) %{ @@ -16142,7 +16633,7 @@ instruct vsrl4I(vecX dst, vecX src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsll2I_imm(vecD dst, vecD src, immI shift) %{ @@ -16155,7 +16646,7 @@ instruct vsll2I_imm(vecD dst, vecD src, immI shift) %{ as_FloatRegister($src$$reg), (int)$shift$$constant & 31); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsll4I_imm(vecX dst, vecX src, immI shift) %{ @@ -16168,7 +16659,7 @@ instruct vsll4I_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), (int)$shift$$constant & 31); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsra2I_imm(vecD dst, vecD src, immI shift) %{ @@ -16181,7 +16672,7 @@ instruct vsra2I_imm(vecD dst, vecD src, immI shift) %{ as_FloatRegister($src$$reg), -(int)$shift$$constant & 31); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsra4I_imm(vecX dst, vecX src, immI shift) %{ @@ -16194,7 +16685,7 @@ instruct vsra4I_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), -(int)$shift$$constant & 31); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsrl2I_imm(vecD dst, vecD src, immI shift) %{ @@ -16207,7 +16698,7 @@ instruct vsrl2I_imm(vecD dst, vecD src, immI shift) %{ as_FloatRegister($src$$reg), -(int)$shift$$constant & 31); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsrl4I_imm(vecX dst, vecX src, immI shift) %{ @@ -16220,7 +16711,7 @@ instruct vsrl4I_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), -(int)$shift$$constant & 31); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsll2L(vecX dst, vecX src, vecX shift) %{ @@ -16234,7 +16725,7 @@ instruct vsll2L(vecX dst, vecX src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128); %} instruct vsrl2L(vecX dst, vecX src, vecX shift) %{ @@ -16247,7 +16738,7 @@ instruct vsrl2L(vecX dst, vecX src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128); %} instruct vsll2L_imm(vecX dst, vecX src, immI shift) %{ @@ -16260,7 +16751,7 @@ instruct vsll2L_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), (int)$shift$$constant & 63); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128); %} instruct vsra2L_imm(vecX dst, vecX src, immI shift) %{ @@ -16273,7 +16764,7 @@ instruct vsra2L_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), -(int)$shift$$constant & 63); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsrl2L_imm(vecX dst, vecX src, immI shift) %{ @@ -16286,7 +16777,7 @@ instruct vsrl2L_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), -(int)$shift$$constant & 63); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} //----------PEEPHOLE RULES----------------------------------------------------- diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/abstractInterpreter_aarch64.cpp similarity index 96% rename from hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp rename to hotspot/src/cpu/aarch64/vm/abstractInterpreter_aarch64.cpp index b067af82d44..77f49a72854 100644 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/abstractInterpreter_aarch64.cpp @@ -31,12 +31,6 @@ #include "utilities/debug.hpp" #include "utilities/macros.hpp" -// Size of interpreter code. Increase if too small. Interpreter will -// fail with a guarantee ("not enough space for interpreter generation"); -// if too small. -// Run with +PrintInterpreter to get the VM to print out the size. -// Max size with JVMTI -int TemplateInterpreter::InterpreterCodeSize = 200 * 1024; int AbstractInterpreter::BasicType_as_index(BasicType type) { int i = 0; diff --git a/hotspot/src/cpu/aarch64/vm/c1_CodeStubs_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_CodeStubs_aarch64.cpp index 865b4c20374..3b51e62e7ca 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_CodeStubs_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/c1_CodeStubs_aarch64.cpp @@ -256,6 +256,7 @@ void PatchingStub::emit_code(LIR_Assembler* ce) { void DeoptimizeStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); + ce->store_parameter(_trap_request, 0); __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::deoptimize_id))); ce->add_call_info_here(_info); DEBUG_ONLY(__ should_not_reach_here()); diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp index 210b29e1e75..e32a3c76b79 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp @@ -3169,7 +3169,8 @@ void LIR_Assembler::atomic_op(LIR_Code code, LIR_Opr src, LIR_Opr data, LIR_Opr Register obj = as_reg(data); Register dst = as_reg(dest); if (is_oop && UseCompressedOops) { - __ encode_heap_oop(obj); + __ encode_heap_oop(rscratch1, obj); + obj = rscratch1; } assert_different_registers(obj, addr.base(), tmp, rscratch2, dst); Label again; diff --git a/hotspot/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp index 77498c35972..b1df18ade63 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp @@ -1066,7 +1066,9 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { { StubFrame f(sasm, "deoptimize", dont_gc_arguments); OopMap* oop_map = save_live_registers(sasm); - int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, deoptimize)); + f.load_argument(0, c_rarg1); + int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, deoptimize), c_rarg1); + oop_maps = new OopMapSet(); oop_maps->add_gc_map(call_offset, oop_map); restore_live_registers(sasm); @@ -1148,9 +1150,6 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { #if INCLUDE_ALL_GCS -// Registers to be saved around calls to g1_wb_pre or g1_wb_post -#define G1_SAVE_REGS (RegSet::range(r0, r18) - RegSet::of(rscratch1, rscratch2)) - case g1_pre_barrier_slow_id: { StubFrame f(sasm, "g1_pre_barrier", dont_gc_arguments); @@ -1192,10 +1191,10 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ b(done); __ bind(runtime); - __ push(G1_SAVE_REGS, sp); + __ push_call_clobbered_registers(); f.load_argument(0, pre_val); __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), pre_val, thread); - __ pop(G1_SAVE_REGS, sp); + __ pop_call_clobbered_registers(); __ bind(done); } break; @@ -1223,45 +1222,49 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { Address buffer(thread, in_bytes(JavaThread::dirty_card_queue_offset() + DirtyCardQueue::byte_offset_of_buf())); - const Register card_addr = rscratch2; - ExternalAddress cardtable((address) ct->byte_map_base); + const Register card_offset = rscratch2; + // LR is free here, so we can use it to hold the byte_map_base. + const Register byte_map_base = lr; - f.load_argument(0, card_addr); - __ lsr(card_addr, card_addr, CardTableModRefBS::card_shift); - unsigned long offset; - __ adrp(rscratch1, cardtable, offset); - __ add(card_addr, card_addr, rscratch1); - __ ldrb(rscratch1, Address(card_addr, offset)); + assert_different_registers(card_offset, byte_map_base, rscratch1); + + f.load_argument(0, card_offset); + __ lsr(card_offset, card_offset, CardTableModRefBS::card_shift); + __ load_byte_map_base(byte_map_base); + __ ldrb(rscratch1, Address(byte_map_base, card_offset)); __ cmpw(rscratch1, (int)G1SATBCardTableModRefBS::g1_young_card_val()); __ br(Assembler::EQ, done); assert((int)CardTableModRefBS::dirty_card_val() == 0, "must be 0"); __ membar(Assembler::StoreLoad); - __ ldrb(rscratch1, Address(card_addr, offset)); + __ ldrb(rscratch1, Address(byte_map_base, card_offset)); __ cbzw(rscratch1, done); // storing region crossing non-NULL, card is clean. // dirty card and log. - __ strb(zr, Address(card_addr, offset)); + __ strb(zr, Address(byte_map_base, card_offset)); + + // Convert card offset into an address in card_addr + Register card_addr = card_offset; + __ add(card_addr, byte_map_base, card_addr); __ ldr(rscratch1, queue_index); __ cbz(rscratch1, runtime); __ sub(rscratch1, rscratch1, wordSize); __ str(rscratch1, queue_index); - const Register buffer_addr = r0; + // Reuse LR to hold buffer_addr + const Register buffer_addr = lr; - __ push(RegSet::of(r0, r1), sp); __ ldr(buffer_addr, buffer); __ str(card_addr, Address(buffer_addr, rscratch1)); - __ pop(RegSet::of(r0, r1), sp); __ b(done); __ bind(runtime); - __ push(G1_SAVE_REGS, sp); + __ push_call_clobbered_registers(); __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_post), card_addr, thread); - __ pop(G1_SAVE_REGS, sp); + __ pop_call_clobbered_registers(); __ bind(done); } diff --git a/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp deleted file mode 100644 index 7c9b9bef572..00000000000 --- a/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "asm/macroAssembler.hpp" -#include "interpreter/bytecodeHistogram.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "interpreter/interp_masm.hpp" -#include "interpreter/templateInterpreterGenerator.hpp" -#include "interpreter/templateTable.hpp" -#include "oops/arrayOop.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "prims/methodHandles.hpp" -#include "runtime/arguments.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/timer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#ifdef COMPILER1 -#include "c1/c1_Runtime1.hpp" -#endif - -#define __ _masm-> - - -address AbstractInterpreterGenerator::generate_slow_signature_handler() { - address entry = __ pc(); - - __ andr(esp, esp, -16); - __ mov(c_rarg3, esp); - // rmethod - // rlocals - // c_rarg3: first stack arg - wordSize - - // adjust sp - __ sub(sp, c_rarg3, 18 * wordSize); - __ str(lr, Address(__ pre(sp, -2 * wordSize))); - __ call_VM(noreg, - CAST_FROM_FN_PTR(address, - InterpreterRuntime::slow_signature_handler), - rmethod, rlocals, c_rarg3); - - // r0: result handler - - // Stack layout: - // rsp: return address <- sp - // 1 garbage - // 8 integer args (if static first is unused) - // 1 float/double identifiers - // 8 double args - // stack args <- esp - // garbage - // expression stack bottom - // bcp (NULL) - // ... - - // Restore LR - __ ldr(lr, Address(__ post(sp, 2 * wordSize))); - - // Do FP first so we can use c_rarg3 as temp - __ ldrw(c_rarg3, Address(sp, 9 * wordSize)); // float/double identifiers - - for (int i = 0; i < Argument::n_float_register_parameters_c; i++) { - const FloatRegister r = as_FloatRegister(i); - - Label d, done; - - __ tbnz(c_rarg3, i, d); - __ ldrs(r, Address(sp, (10 + i) * wordSize)); - __ b(done); - __ bind(d); - __ ldrd(r, Address(sp, (10 + i) * wordSize)); - __ bind(done); - } - - // c_rarg0 contains the result from the call of - // InterpreterRuntime::slow_signature_handler so we don't touch it - // here. It will be loaded with the JNIEnv* later. - __ ldr(c_rarg1, Address(sp, 1 * wordSize)); - for (int i = c_rarg2->encoding(); i <= c_rarg7->encoding(); i += 2) { - Register rm = as_Register(i), rn = as_Register(i+1); - __ ldp(rm, rn, Address(sp, i * wordSize)); - } - - __ add(sp, sp, 18 * wordSize); - __ ret(lr); - - return entry; -} - - -// -// Various method entries -// - -address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { - // rmethod: Method* - // r13: sender sp - // esp: args - - if (!InlineIntrinsics) return NULL; // Generate a vanilla entry - - // These don't need a safepoint check because they aren't virtually - // callable. We won't enter these intrinsics from compiled code. - // If in the future we added an intrinsic which was virtually callable - // we'd have to worry about how to safepoint so that this code is used. - - // mathematical functions inlined by compiler - // (interpreter must provide identical implementation - // in order to avoid monotonicity bugs when switching - // from interpreter to compiler in the middle of some - // computation) - // - // stack: - // [ arg ] <-- esp - // [ arg ] - // retaddr in lr - - address entry_point = NULL; - Register continuation = lr; - switch (kind) { - case Interpreter::java_lang_math_abs: - entry_point = __ pc(); - __ ldrd(v0, Address(esp)); - __ fabsd(v0, v0); - __ mov(sp, r13); // Restore caller's SP - break; - case Interpreter::java_lang_math_sqrt: - entry_point = __ pc(); - __ ldrd(v0, Address(esp)); - __ fsqrtd(v0, v0); - __ mov(sp, r13); - break; - case Interpreter::java_lang_math_sin : - case Interpreter::java_lang_math_cos : - case Interpreter::java_lang_math_tan : - case Interpreter::java_lang_math_log : - case Interpreter::java_lang_math_log10 : - case Interpreter::java_lang_math_exp : - entry_point = __ pc(); - __ ldrd(v0, Address(esp)); - __ mov(sp, r13); - __ mov(r19, lr); - continuation = r19; // The first callee-saved register - generate_transcendental_entry(kind, 1); - break; - case Interpreter::java_lang_math_pow : - entry_point = __ pc(); - __ mov(r19, lr); - continuation = r19; - __ ldrd(v0, Address(esp, 2 * Interpreter::stackElementSize)); - __ ldrd(v1, Address(esp)); - __ mov(sp, r13); - generate_transcendental_entry(kind, 2); - break; - default: - ; - } - if (entry_point) { - __ br(continuation); - } - - return entry_point; -} - - // double trigonometrics and transcendentals - // static jdouble dsin(jdouble x); - // static jdouble dcos(jdouble x); - // static jdouble dtan(jdouble x); - // static jdouble dlog(jdouble x); - // static jdouble dlog10(jdouble x); - // static jdouble dexp(jdouble x); - // static jdouble dpow(jdouble x, jdouble y); - -void TemplateInterpreterGenerator::generate_transcendental_entry(AbstractInterpreter::MethodKind kind, int fpargs) { - address fn; - switch (kind) { - case Interpreter::java_lang_math_sin : - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dsin); - break; - case Interpreter::java_lang_math_cos : - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dcos); - break; - case Interpreter::java_lang_math_tan : - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dtan); - break; - case Interpreter::java_lang_math_log : - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dlog); - break; - case Interpreter::java_lang_math_log10 : - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dlog10); - break; - case Interpreter::java_lang_math_exp : - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dexp); - break; - case Interpreter::java_lang_math_pow : - fpargs = 2; - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dpow); - break; - default: - ShouldNotReachHere(); - fn = NULL; // unreachable - } - const int gpargs = 0, rtype = 3; - __ mov(rscratch1, fn); - __ blrt(rscratch1, gpargs, fpargs, rtype); -} - -// Abstract method entry -// Attempt to execute abstract method. Throw exception -address TemplateInterpreterGenerator::generate_abstract_entry(void) { - // rmethod: Method* - // r13: sender SP - - address entry_point = __ pc(); - - // abstract method entry - - // pop return address, reset last_sp to NULL - __ empty_expression_stack(); - __ restore_bcp(); // bcp must be correct for exception handler (was destroyed) - __ restore_locals(); // make sure locals pointer is correct as well (was destroyed) - - // throw exception - __ call_VM(noreg, CAST_FROM_FN_PTR(address, - InterpreterRuntime::throw_AbstractMethodError)); - // the call_VM checks for exception, so we should never return here. - __ should_not_reach_here(); - - return entry_point; -} diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp index c64f1277aab..b1b9a55df1b 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp @@ -2301,6 +2301,30 @@ void MacroAssembler::c_stub_prolog(int gp_arg_count, int fp_arg_count, int ret_t } #endif +void MacroAssembler::push_call_clobbered_registers() { + push(RegSet::range(r0, r18) - RegSet::of(rscratch1, rscratch2), sp); + + // Push v0-v7, v16-v31. + for (int i = 30; i >= 0; i -= 2) { + if (i <= v7->encoding() || i >= v16->encoding()) { + stpd(as_FloatRegister(i), as_FloatRegister(i+1), + Address(pre(sp, -2 * wordSize))); + } + } +} + +void MacroAssembler::pop_call_clobbered_registers() { + + for (int i = 0; i < 32; i += 2) { + if (i <= v7->encoding() || i >= v16->encoding()) { + ldpd(as_FloatRegister(i), as_FloatRegister(i+1), + Address(post(sp, 2 * wordSize))); + } + } + + pop(RegSet::range(r0, r18) - RegSet::of(rscratch1, rscratch2), sp); +} + void MacroAssembler::push_CPU_state(bool save_vectors) { push(0x3fffffff, sp); // integer registers except lr & sp @@ -3099,12 +3123,7 @@ void MacroAssembler::store_check(Register obj) { assert(CardTableModRefBS::dirty_card_val() == 0, "must be"); - { - ExternalAddress cardtable((address) ct->byte_map_base); - unsigned long offset; - adrp(rscratch1, cardtable, offset); - assert(offset == 0, "byte_map_base is misaligned"); - } + load_byte_map_base(rscratch1); if (UseCondCardMark) { Label L_already_dirty; @@ -3596,12 +3615,10 @@ void MacroAssembler::g1_write_barrier_post(Register store_addr, lsr(card_addr, store_addr, CardTableModRefBS::card_shift); - unsigned long offset; - adrp(tmp2, cardtable, offset); - // get the address of the card + load_byte_map_base(tmp2); add(card_addr, card_addr, tmp2); - ldrb(tmp2, Address(card_addr, offset)); + ldrb(tmp2, Address(card_addr)); cmpw(tmp2, (int)G1SATBCardTableModRefBS::g1_young_card_val()); br(Assembler::EQ, done); @@ -3609,13 +3626,13 @@ void MacroAssembler::g1_write_barrier_post(Register store_addr, membar(Assembler::StoreLoad); - ldrb(tmp2, Address(card_addr, offset)); + ldrb(tmp2, Address(card_addr)); cbzw(tmp2, done); // storing a region crossing, non-NULL oop, card is clean. // dirty card and log. - strb(zr, Address(card_addr, offset)); + strb(zr, Address(card_addr)); ldr(rscratch1, queue_index); cbz(rscratch1, runtime); @@ -3938,7 +3955,7 @@ void MacroAssembler::bang_stack_size(Register size, Register tmp) { // was post-decremented.) Skip this address by starting at i=1, and // touch a few more pages below. N.B. It is important to touch all // the way down to and including i=StackShadowPages. - for (int i = 0; i < (JavaThread::stack_shadow_zone_size() / os::vm_page_size()) - 1; i++) { + for (int i = 0; i < (int)(JavaThread::stack_shadow_zone_size() / os::vm_page_size()) - 1; i++) { // this could be any sized move but this is can be a debugging crumb // so the bigger the better. lea(tmp, Address(tmp, -os::vm_page_size())); @@ -3971,6 +3988,9 @@ void MacroAssembler::adrp(Register reg1, const Address &dest, unsigned long &byt long offset_low = dest_page - low_page; long offset_high = dest_page - high_page; + assert(is_valid_AArch64_address(dest.target()), "bad address"); + assert(dest.getMode() == Address::literal, "ADRP must be applied to a literal address"); + InstructionMark im(this); code_section()->relocate(inst_mark(), dest.rspec()); // 8143067: Ensure that the adrp can reach the dest from anywhere within @@ -3982,11 +4002,26 @@ void MacroAssembler::adrp(Register reg1, const Address &dest, unsigned long &byt long offset = dest_page - pc_page; offset = (offset & ((1<<20)-1)) << 12; _adrp(reg1, pc()+offset); - movk(reg1, ((unsigned long)dest.target() >> 32) & 0xffff, 32); + movk(reg1, (unsigned long)dest.target() >> 32, 32); } byte_offset = (unsigned long)dest.target() & 0xfff; } +void MacroAssembler::load_byte_map_base(Register reg) { + jbyte *byte_map_base = + ((CardTableModRefBS*)(Universe::heap()->barrier_set()))->byte_map_base; + + if (is_valid_AArch64_address((address)byte_map_base)) { + // Strictly speaking the byte_map_base isn't an address at all, + // and it might even be negative. + unsigned long offset; + adrp(reg, ExternalAddress((address)byte_map_base), offset); + assert(offset == 0, "misaligned card table base"); + } else { + mov(reg, (uint64_t)byte_map_base); + } +} + void MacroAssembler::build_frame(int framesize) { assert(framesize > 0, "framesize must be > 0"); if (framesize < ((1 << 9) + 2 * wordSize)) { diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp index 99afc3b5522..4256d3a0989 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp @@ -437,6 +437,13 @@ public: void push(RegSet regs, Register stack) { if (regs.bits()) push(regs.bits(), stack); } void pop(RegSet regs, Register stack) { if (regs.bits()) pop(regs.bits(), stack); } + // Push and pop everything that might be clobbered by a native + // runtime call except rscratch1 and rscratch2. (They are always + // scratch, so we don't have to protect them.) Only save the lower + // 64 bits of each vector register. + void push_call_clobbered_registers(); + void pop_call_clobbered_registers(); + // now mov instructions for loading absolute addresses and 32 or // 64 bit integers @@ -1116,6 +1123,15 @@ public: // of your data. Address form_address(Register Rd, Register base, long byte_offset, int shift); + // Return true iff an address is within the 48-bit AArch64 address + // space. + bool is_valid_AArch64_address(address a) { + return ((uint64_t)a >> 48) == 0; + } + + // Load the base of the cardtable byte map into reg. + void load_byte_map_base(Register reg); + // Prolog generator routines to support switch between x86 code and // generated ARM code diff --git a/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp index 40b53127487..9b80b0b48ec 100644 --- a/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp @@ -87,7 +87,6 @@ void Relocation::pd_set_call_destination(address x) { return; } } - assert(addr() != x, "call instruction in an infinite loop"); MacroAssembler::pd_patch_instruction(addr(), x); assert(pd_call_destination(addr()) == x, "fail in reloc"); } diff --git a/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp index 22e8eb04780..82640865457 100644 --- a/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp @@ -1090,7 +1090,7 @@ static void restore_args(MacroAssembler *masm, int arg_count, int first_arg, VMR } -// Check GC_locker::needs_gc and enter the runtime if it's true. This +// Check GCLocker::needs_gc and enter the runtime if it's true. This // keeps a new JNI critical region from starting until a GC has been // forced. Save down any oops in registers and describe them in an // OopMap. @@ -1272,14 +1272,14 @@ static void gen_special_dispatch(MacroAssembler* masm, // GetPrimtiveArrayCritical and disallow the use of any other JNI // functions. The wrapper is expected to unpack the arguments before // passing them to the callee and perform checks before and after the -// native call to ensure that they GC_locker +// native call to ensure that they GCLocker // lock_critical/unlock_critical semantics are followed. Some other // parts of JNI setup are skipped like the tear down of the JNI handle // block and the check for pending exceptions it's impossible for them // to be thrown. // // They are roughly structured like this: -// if (GC_locker::needs_gc()) +// if (GCLocker::needs_gc()) // SharedRuntime::block_for_jni_critical(); // tranistion to thread_in_native // unpack arrray arguments and call native entry point diff --git a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp index 32e92a99e7d..6d8042f604a 100644 --- a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp @@ -744,7 +744,7 @@ class StubGenerator: public StubCodeGenerator { __ sub(end, end, start); // number of bytes to copy const Register count = end; // 'end' register contains bytes count now - __ mov(scratch, (address)ct->byte_map_base); + __ load_byte_map_base(scratch); __ add(start, start, scratch); if (UseConcMarkSweepGC) { __ membar(__ StoreStore); diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp index 37176c78072..e37c0881d5c 100644 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -57,6 +57,13 @@ #include "../../../../../../simulator/simulator.hpp" #endif +// Size of interpreter code. Increase if too small. Interpreter will +// fail with a guarantee ("not enough space for interpreter generation"); +// if too small. +// Run with +PrintInterpreter to get the VM to print out the size. +// Max size with JVMTI +int TemplateInterpreter::InterpreterCodeSize = 200 * 1024; + #define __ _masm-> //----------------------------------------------------------------------------- @@ -65,6 +72,213 @@ extern "C" void entry(CodeBuffer*); //----------------------------------------------------------------------------- +address TemplateInterpreterGenerator::generate_slow_signature_handler() { + address entry = __ pc(); + + __ andr(esp, esp, -16); + __ mov(c_rarg3, esp); + // rmethod + // rlocals + // c_rarg3: first stack arg - wordSize + + // adjust sp + __ sub(sp, c_rarg3, 18 * wordSize); + __ str(lr, Address(__ pre(sp, -2 * wordSize))); + __ call_VM(noreg, + CAST_FROM_FN_PTR(address, + InterpreterRuntime::slow_signature_handler), + rmethod, rlocals, c_rarg3); + + // r0: result handler + + // Stack layout: + // rsp: return address <- sp + // 1 garbage + // 8 integer args (if static first is unused) + // 1 float/double identifiers + // 8 double args + // stack args <- esp + // garbage + // expression stack bottom + // bcp (NULL) + // ... + + // Restore LR + __ ldr(lr, Address(__ post(sp, 2 * wordSize))); + + // Do FP first so we can use c_rarg3 as temp + __ ldrw(c_rarg3, Address(sp, 9 * wordSize)); // float/double identifiers + + for (int i = 0; i < Argument::n_float_register_parameters_c; i++) { + const FloatRegister r = as_FloatRegister(i); + + Label d, done; + + __ tbnz(c_rarg3, i, d); + __ ldrs(r, Address(sp, (10 + i) * wordSize)); + __ b(done); + __ bind(d); + __ ldrd(r, Address(sp, (10 + i) * wordSize)); + __ bind(done); + } + + // c_rarg0 contains the result from the call of + // InterpreterRuntime::slow_signature_handler so we don't touch it + // here. It will be loaded with the JNIEnv* later. + __ ldr(c_rarg1, Address(sp, 1 * wordSize)); + for (int i = c_rarg2->encoding(); i <= c_rarg7->encoding(); i += 2) { + Register rm = as_Register(i), rn = as_Register(i+1); + __ ldp(rm, rn, Address(sp, i * wordSize)); + } + + __ add(sp, sp, 18 * wordSize); + __ ret(lr); + + return entry; +} + + +// +// Various method entries +// + +address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { + // rmethod: Method* + // r13: sender sp + // esp: args + + if (!InlineIntrinsics) return NULL; // Generate a vanilla entry + + // These don't need a safepoint check because they aren't virtually + // callable. We won't enter these intrinsics from compiled code. + // If in the future we added an intrinsic which was virtually callable + // we'd have to worry about how to safepoint so that this code is used. + + // mathematical functions inlined by compiler + // (interpreter must provide identical implementation + // in order to avoid monotonicity bugs when switching + // from interpreter to compiler in the middle of some + // computation) + // + // stack: + // [ arg ] <-- esp + // [ arg ] + // retaddr in lr + + address entry_point = NULL; + Register continuation = lr; + switch (kind) { + case Interpreter::java_lang_math_abs: + entry_point = __ pc(); + __ ldrd(v0, Address(esp)); + __ fabsd(v0, v0); + __ mov(sp, r13); // Restore caller's SP + break; + case Interpreter::java_lang_math_sqrt: + entry_point = __ pc(); + __ ldrd(v0, Address(esp)); + __ fsqrtd(v0, v0); + __ mov(sp, r13); + break; + case Interpreter::java_lang_math_sin : + case Interpreter::java_lang_math_cos : + case Interpreter::java_lang_math_tan : + case Interpreter::java_lang_math_log : + case Interpreter::java_lang_math_log10 : + case Interpreter::java_lang_math_exp : + entry_point = __ pc(); + __ ldrd(v0, Address(esp)); + __ mov(sp, r13); + __ mov(r19, lr); + continuation = r19; // The first callee-saved register + generate_transcendental_entry(kind, 1); + break; + case Interpreter::java_lang_math_pow : + entry_point = __ pc(); + __ mov(r19, lr); + continuation = r19; + __ ldrd(v0, Address(esp, 2 * Interpreter::stackElementSize)); + __ ldrd(v1, Address(esp)); + __ mov(sp, r13); + generate_transcendental_entry(kind, 2); + break; + default: + ; + } + if (entry_point) { + __ br(continuation); + } + + return entry_point; +} + + // double trigonometrics and transcendentals + // static jdouble dsin(jdouble x); + // static jdouble dcos(jdouble x); + // static jdouble dtan(jdouble x); + // static jdouble dlog(jdouble x); + // static jdouble dlog10(jdouble x); + // static jdouble dexp(jdouble x); + // static jdouble dpow(jdouble x, jdouble y); + +void TemplateInterpreterGenerator::generate_transcendental_entry(AbstractInterpreter::MethodKind kind, int fpargs) { + address fn; + switch (kind) { + case Interpreter::java_lang_math_sin : + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dsin); + break; + case Interpreter::java_lang_math_cos : + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dcos); + break; + case Interpreter::java_lang_math_tan : + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dtan); + break; + case Interpreter::java_lang_math_log : + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dlog); + break; + case Interpreter::java_lang_math_log10 : + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dlog10); + break; + case Interpreter::java_lang_math_exp : + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dexp); + break; + case Interpreter::java_lang_math_pow : + fpargs = 2; + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dpow); + break; + default: + ShouldNotReachHere(); + fn = NULL; // unreachable + } + const int gpargs = 0, rtype = 3; + __ mov(rscratch1, fn); + __ blrt(rscratch1, gpargs, fpargs, rtype); +} + +// Abstract method entry +// Attempt to execute abstract method. Throw exception +address TemplateInterpreterGenerator::generate_abstract_entry(void) { + // rmethod: Method* + // r13: sender SP + + address entry_point = __ pc(); + + // abstract method entry + + // pop return address, reset last_sp to NULL + __ empty_expression_stack(); + __ restore_bcp(); // bcp must be correct for exception handler (was destroyed) + __ restore_locals(); // make sure locals pointer is correct as well (was destroyed) + + // throw exception + __ call_VM(noreg, CAST_FROM_FN_PTR(address, + InterpreterRuntime::throw_AbstractMethodError)); + // the call_VM checks for exception, so we should never return here. + __ should_not_reach_here(); + + return entry_point; +} + address TemplateInterpreterGenerator::generate_StackOverflowError_handler() { address entry = __ pc(); @@ -716,7 +930,7 @@ address TemplateInterpreterGenerator::generate_Reference_get_entry(void) { // If G1 is not enabled then attempt to go through the accessor entry point // Reference.get is an accessor - return generate_accessor_entry(); + return NULL; } /** @@ -842,7 +1056,7 @@ void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) { // an interpreter frame with greater than a page of locals, so each page // needs to be checked. Only true for non-native. if (UseStackBanging) { - const int size_t n_shadow_pages = JavaThread::stack_shadow_zone_size() / os::vm_page_size(); + const int n_shadow_pages = JavaThread::stack_shadow_zone_size() / os::vm_page_size(); const int start_page = native_call ? n_shadow_pages : 1; const int page_size = os::vm_page_size(); for (int pages = start_page; pages <= n_shadow_pages ; pages++) { @@ -1184,8 +1398,8 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { { Label no_reguard; __ lea(rscratch1, Address(rthread, in_bytes(JavaThread::stack_guard_state_offset()))); - __ ldrb(rscratch1, Address(rscratch1)); - __ cmp(rscratch1, JavaThread::stack_guard_yellow_disabled); + __ ldrw(rscratch1, Address(rscratch1)); + __ cmp(rscratch1, JavaThread::stack_guard_yellow_reserved_disabled); __ br(Assembler::NE, no_reguard); __ pusha(); // XXX only save smashed registers diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp index d48f4ee3a25..6de94bee33d 100644 --- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp @@ -121,7 +121,6 @@ void VM_Version::get_processor_features() { FLAG_SET_DEFAULT(PrefetchScanIntervalInBytes, 256); FLAG_SET_DEFAULT(PrefetchFieldsAhead, 256); FLAG_SET_DEFAULT(PrefetchCopyIntervalInBytes, 256); - FLAG_SET_DEFAULT(UseSSE42Intrinsics, true); unsigned long auxv = getauxval(AT_HWCAP); diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/abstractInterpreter_ppc.cpp similarity index 93% rename from hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp rename to hotspot/src/cpu/ppc/vm/abstractInterpreter_ppc.cpp index cf0af66de9b..eaff19ddf71 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/abstractInterpreter_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2015 SAP AG. All rights reserved. + * Copyright (c) 2015 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,13 +31,6 @@ #include "utilities/debug.hpp" #include "utilities/macros.hpp" -// Size of interpreter code. Increase if too small. Interpreter will -// fail with a guarantee ("not enough space for interpreter generation"); -// if too small. -// Run with +PrintInterpreter to get the VM to print out the size. -// Max size with JVMTI -int TemplateInterpreter::InterpreterCodeSize = 230*K; - int AbstractInterpreter::BasicType_as_index(BasicType type) { int i = 0; switch (type) { @@ -58,10 +51,19 @@ int AbstractInterpreter::BasicType_as_index(BasicType type) { return i; } +// Support abs and sqrt like in compiler. +// For others we can use a normal (native) entry. +bool AbstractInterpreter::math_entry_available(AbstractInterpreter::MethodKind kind) { + if (!InlineIntrinsics) return false; + + return ((kind==Interpreter::java_lang_math_sqrt && VM_Version::has_fsqrt()) || + (kind==Interpreter::java_lang_math_abs)); +} + // These should never be compiled since the interpreter will prefer // the compiled version to the intrinsic version. bool AbstractInterpreter::can_be_compiled(methodHandle m) { - return !TemplateInterpreter::math_entry_available(method_kind(m)); + return !math_entry_available(method_kind(m)); } // How much stack a method activation needs in stack slots. @@ -159,15 +161,3 @@ void AbstractInterpreter::layout_activation(Method* method, interpreter_frame->interpreter_frame_set_sender_sp(sender_sp); } } - -// Support abs and sqrt like in compiler. -// For others we can use a normal (native) entry. - -bool TemplateInterpreter::math_entry_available(AbstractInterpreter::MethodKind kind) { - if (!InlineIntrinsics) return false; - - return ((kind==Interpreter::java_lang_math_sqrt && VM_Version::has_fsqrt()) || - (kind==Interpreter::java_lang_math_abs)); -} - - diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp index 66e4f08c3d4..c09703ff916 100644 --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp index 035bd4abf26..3cae863f41c 100644 --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp index 9248ae5cb6f..8393a579151 100644 --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/bytes_ppc.hpp b/hotspot/src/cpu/ppc/vm/bytes_ppc.hpp index 2a8fc59c892..be005cbbfba 100644 --- a/hotspot/src/cpu/ppc/vm/bytes_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/bytes_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_CodeStubs_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_CodeStubs_ppc.cpp index a19c7b7de11..eca7d87a22e 100644 --- a/hotspot/src/cpu/ppc/vm/c1_CodeStubs_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c1_CodeStubs_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_Defs_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_Defs_ppc.hpp index 73edcaba207..4f7075c17fa 100644 --- a/hotspot/src/cpu/ppc/vm/c1_Defs_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/c1_Defs_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_FpuStackSim_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_FpuStackSim_ppc.hpp index 19f85034ba9..6f2f90ba0da 100644 --- a/hotspot/src/cpu/ppc/vm/c1_FpuStackSim_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/c1_FpuStackSim_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.cpp index 90afc7873ce..5a50b965371 100644 --- a/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.hpp index 5eee5ffca1f..8ce25e97b87 100644 --- a/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp index 8a64bab4be4..b7bc0cbf50d 100644 --- a/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.hpp index 03d1faedbf9..543156c0951 100644 --- a/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp index 909d0136011..cba04106f8c 100644 --- a/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.cpp index 7c73b1c70a8..026540f25b2 100644 --- a/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp index d0f6002929e..261db8d77ef 100644 --- a/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.cpp index f41a83b1c71..851b0b644ce 100644 --- a/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp index 9989baa8700..4f40b20b551 100644 --- a/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_Runtime1_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_Runtime1_ppc.cpp index 5fbaa4beb4e..1aa158b4a8f 100644 --- a/hotspot/src/cpu/ppc/vm/c1_Runtime1_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c1_Runtime1_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_globals_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_globals_ppc.hpp index 234248e387e..b641852e8a3 100644 --- a/hotspot/src/cpu/ppc/vm/c1_globals_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/c1_globals_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp b/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp index 9934d1f0143..2a5ae0f248f 100644 --- a/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp b/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp index a9fe522671c..4df27d43d1b 100644 --- a/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/codeBuffer_ppc.hpp b/hotspot/src/cpu/ppc/vm/codeBuffer_ppc.hpp index 1855aea1f29..ae618ceffd0 100644 --- a/hotspot/src/cpu/ppc/vm/codeBuffer_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/codeBuffer_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp b/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp index 197d3069817..68dabc4b031 100644 --- a/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/copy_ppc.hpp b/hotspot/src/cpu/ppc/vm/copy_ppc.hpp index 0094c0c6d30..06a5a010033 100644 --- a/hotspot/src/cpu/ppc/vm/copy_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/copy_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/debug_ppc.cpp b/hotspot/src/cpu/ppc/vm/debug_ppc.cpp index dc91efc78bb..5427a1e4644 100644 --- a/hotspot/src/cpu/ppc/vm/debug_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/debug_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/depChecker_ppc.hpp b/hotspot/src/cpu/ppc/vm/depChecker_ppc.hpp index 33f04c06050..07ed6267640 100644 --- a/hotspot/src/cpu/ppc/vm/depChecker_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/depChecker_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/disassembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/disassembler_ppc.hpp index eb2a81d390e..dc98a8bb06a 100644 --- a/hotspot/src/cpu/ppc/vm/disassembler_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/disassembler_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp index 29921834ac1..08463758370 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.hpp b/hotspot/src/cpu/ppc/vm/frame_ppc.hpp index 3b90da157a5..8115a20640e 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp index 2c90cd2a6a1..7fce0585f10 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp index f7aa82d6cde..ba981816f4a 100644 --- a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/globals_ppc.hpp b/hotspot/src/cpu/ppc/vm/globals_ppc.hpp index b3a1ef5d729..695014fd836 100644 --- a/hotspot/src/cpu/ppc/vm/globals_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/globals_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp b/hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp index 8e16078b3d7..6e2c34341a5 100644 --- a/hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/icache_ppc.cpp b/hotspot/src/cpu/ppc/vm/icache_ppc.cpp index 641841b9463..916d3d72590 100644 --- a/hotspot/src/cpu/ppc/vm/icache_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/icache_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/icache_ppc.hpp b/hotspot/src/cpu/ppc/vm/icache_ppc.hpp index 4941f5586f8..fc9790f2133 100644 --- a/hotspot/src/cpu/ppc/vm/icache_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/icache_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp index 6c88cede5b8..8a75af011bd 100644 --- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp +++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.cpp b/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.cpp index 98ab1041dde..7869ef1238c 100644 --- a/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp b/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp index da98715a102..d71781cbc83 100644 --- a/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp deleted file mode 100644 index bd3488f9873..00000000000 --- a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp +++ /dev/null @@ -1,555 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "asm/macroAssembler.inline.hpp" -#include "interpreter/bytecodeHistogram.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "interpreter/interp_masm.hpp" -#include "interpreter/templateInterpreterGenerator.hpp" -#include "interpreter/templateTable.hpp" -#include "oops/arrayOop.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "prims/methodHandles.hpp" -#include "runtime/arguments.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/timer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#ifdef COMPILER1 -#include "c1/c1_Runtime1.hpp" -#endif - -#define __ _masm-> - -#ifdef PRODUCT -#define BLOCK_COMMENT(str) // nothing -#else -#define BLOCK_COMMENT(str) __ block_comment(str) -#endif - -#define BIND(label) bind(label); BLOCK_COMMENT(#label ":") - -address AbstractInterpreterGenerator::generate_slow_signature_handler() { - // Slow_signature handler that respects the PPC C calling conventions. - // - // We get called by the native entry code with our output register - // area == 8. First we call InterpreterRuntime::get_result_handler - // to copy the pointer to the signature string temporarily to the - // first C-argument and to return the result_handler in - // R3_RET. Since native_entry will copy the jni-pointer to the - // first C-argument slot later on, it is OK to occupy this slot - // temporarilly. Then we copy the argument list on the java - // expression stack into native varargs format on the native stack - // and load arguments into argument registers. Integer arguments in - // the varargs vector will be sign-extended to 8 bytes. - // - // On entry: - // R3_ARG1 - intptr_t* Address of java argument list in memory. - // R15_prev_state - BytecodeInterpreter* Address of interpreter state for - // this method - // R19_method - // - // On exit (just before return instruction): - // R3_RET - contains the address of the result_handler. - // R4_ARG2 - is not updated for static methods and contains "this" otherwise. - // R5_ARG3-R10_ARG8: - When the (i-2)th Java argument is not of type float or double, - // ARGi contains this argument. Otherwise, ARGi is not updated. - // F1_ARG1-F13_ARG13 - contain the first 13 arguments of type float or double. - - const int LogSizeOfTwoInstructions = 3; - - // FIXME: use Argument:: GL: Argument names different numbers! - const int max_fp_register_arguments = 13; - const int max_int_register_arguments = 6; // first 2 are reserved - - const Register arg_java = R21_tmp1; - const Register arg_c = R22_tmp2; - const Register signature = R23_tmp3; // is string - const Register sig_byte = R24_tmp4; - const Register fpcnt = R25_tmp5; - const Register argcnt = R26_tmp6; - const Register intSlot = R27_tmp7; - const Register target_sp = R28_tmp8; - const FloatRegister floatSlot = F0; - - address entry = __ function_entry(); - - __ save_LR_CR(R0); - __ save_nonvolatile_gprs(R1_SP, _spill_nonvolatiles_neg(r14)); - // We use target_sp for storing arguments in the C frame. - __ mr(target_sp, R1_SP); - __ push_frame_reg_args_nonvolatiles(0, R11_scratch1); - - __ mr(arg_java, R3_ARG1); - - __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::get_signature), R16_thread, R19_method); - - // Signature is in R3_RET. Signature is callee saved. - __ mr(signature, R3_RET); - - // Get the result handler. - __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::get_result_handler), R16_thread, R19_method); - - { - Label L; - // test if static - // _access_flags._flags must be at offset 0. - // TODO PPC port: requires change in shared code. - //assert(in_bytes(AccessFlags::flags_offset()) == 0, - // "MethodDesc._access_flags == MethodDesc._access_flags._flags"); - // _access_flags must be a 32 bit value. - assert(sizeof(AccessFlags) == 4, "wrong size"); - __ lwa(R11_scratch1/*access_flags*/, method_(access_flags)); - // testbit with condition register. - __ testbitdi(CCR0, R0, R11_scratch1/*access_flags*/, JVM_ACC_STATIC_BIT); - __ btrue(CCR0, L); - // For non-static functions, pass "this" in R4_ARG2 and copy it - // to 2nd C-arg slot. - // We need to box the Java object here, so we use arg_java - // (address of current Java stack slot) as argument and don't - // dereference it as in case of ints, floats, etc. - __ mr(R4_ARG2, arg_java); - __ addi(arg_java, arg_java, -BytesPerWord); - __ std(R4_ARG2, _abi(carg_2), target_sp); - __ bind(L); - } - - // Will be incremented directly after loop_start. argcnt=0 - // corresponds to 3rd C argument. - __ li(argcnt, -1); - // arg_c points to 3rd C argument - __ addi(arg_c, target_sp, _abi(carg_3)); - // no floating-point args parsed so far - __ li(fpcnt, 0); - - Label move_intSlot_to_ARG, move_floatSlot_to_FARG; - Label loop_start, loop_end; - Label do_int, do_long, do_float, do_double, do_dontreachhere, do_object, do_array, do_boxed; - - // signature points to '(' at entry -#ifdef ASSERT - __ lbz(sig_byte, 0, signature); - __ cmplwi(CCR0, sig_byte, '('); - __ bne(CCR0, do_dontreachhere); -#endif - - __ bind(loop_start); - - __ addi(argcnt, argcnt, 1); - __ lbzu(sig_byte, 1, signature); - - __ cmplwi(CCR0, sig_byte, ')'); // end of signature - __ beq(CCR0, loop_end); - - __ cmplwi(CCR0, sig_byte, 'B'); // byte - __ beq(CCR0, do_int); - - __ cmplwi(CCR0, sig_byte, 'C'); // char - __ beq(CCR0, do_int); - - __ cmplwi(CCR0, sig_byte, 'D'); // double - __ beq(CCR0, do_double); - - __ cmplwi(CCR0, sig_byte, 'F'); // float - __ beq(CCR0, do_float); - - __ cmplwi(CCR0, sig_byte, 'I'); // int - __ beq(CCR0, do_int); - - __ cmplwi(CCR0, sig_byte, 'J'); // long - __ beq(CCR0, do_long); - - __ cmplwi(CCR0, sig_byte, 'S'); // short - __ beq(CCR0, do_int); - - __ cmplwi(CCR0, sig_byte, 'Z'); // boolean - __ beq(CCR0, do_int); - - __ cmplwi(CCR0, sig_byte, 'L'); // object - __ beq(CCR0, do_object); - - __ cmplwi(CCR0, sig_byte, '['); // array - __ beq(CCR0, do_array); - - // __ cmplwi(CCR0, sig_byte, 'V'); // void cannot appear since we do not parse the return type - // __ beq(CCR0, do_void); - - __ bind(do_dontreachhere); - - __ unimplemented("ShouldNotReachHere in slow_signature_handler", 120); - - __ bind(do_array); - - { - Label start_skip, end_skip; - - __ bind(start_skip); - __ lbzu(sig_byte, 1, signature); - __ cmplwi(CCR0, sig_byte, '['); - __ beq(CCR0, start_skip); // skip further brackets - __ cmplwi(CCR0, sig_byte, '9'); - __ bgt(CCR0, end_skip); // no optional size - __ cmplwi(CCR0, sig_byte, '0'); - __ bge(CCR0, start_skip); // skip optional size - __ bind(end_skip); - - __ cmplwi(CCR0, sig_byte, 'L'); - __ beq(CCR0, do_object); // for arrays of objects, the name of the object must be skipped - __ b(do_boxed); // otherwise, go directly to do_boxed - } - - __ bind(do_object); - { - Label L; - __ bind(L); - __ lbzu(sig_byte, 1, signature); - __ cmplwi(CCR0, sig_byte, ';'); - __ bne(CCR0, L); - } - // Need to box the Java object here, so we use arg_java (address of - // current Java stack slot) as argument and don't dereference it as - // in case of ints, floats, etc. - Label do_null; - __ bind(do_boxed); - __ ld(R0,0, arg_java); - __ cmpdi(CCR0, R0, 0); - __ li(intSlot,0); - __ beq(CCR0, do_null); - __ mr(intSlot, arg_java); - __ bind(do_null); - __ std(intSlot, 0, arg_c); - __ addi(arg_java, arg_java, -BytesPerWord); - __ addi(arg_c, arg_c, BytesPerWord); - __ cmplwi(CCR0, argcnt, max_int_register_arguments); - __ blt(CCR0, move_intSlot_to_ARG); - __ b(loop_start); - - __ bind(do_int); - __ lwa(intSlot, 0, arg_java); - __ std(intSlot, 0, arg_c); - __ addi(arg_java, arg_java, -BytesPerWord); - __ addi(arg_c, arg_c, BytesPerWord); - __ cmplwi(CCR0, argcnt, max_int_register_arguments); - __ blt(CCR0, move_intSlot_to_ARG); - __ b(loop_start); - - __ bind(do_long); - __ ld(intSlot, -BytesPerWord, arg_java); - __ std(intSlot, 0, arg_c); - __ addi(arg_java, arg_java, - 2 * BytesPerWord); - __ addi(arg_c, arg_c, BytesPerWord); - __ cmplwi(CCR0, argcnt, max_int_register_arguments); - __ blt(CCR0, move_intSlot_to_ARG); - __ b(loop_start); - - __ bind(do_float); - __ lfs(floatSlot, 0, arg_java); -#if defined(LINUX) - // Linux uses ELF ABI. Both original ELF and ELFv2 ABIs have float - // in the least significant word of an argument slot. -#if defined(VM_LITTLE_ENDIAN) - __ stfs(floatSlot, 0, arg_c); -#else - __ stfs(floatSlot, 4, arg_c); -#endif -#elif defined(AIX) - // Although AIX runs on big endian CPU, float is in most significant - // word of an argument slot. - __ stfs(floatSlot, 0, arg_c); -#else -#error "unknown OS" -#endif - __ addi(arg_java, arg_java, -BytesPerWord); - __ addi(arg_c, arg_c, BytesPerWord); - __ cmplwi(CCR0, fpcnt, max_fp_register_arguments); - __ blt(CCR0, move_floatSlot_to_FARG); - __ b(loop_start); - - __ bind(do_double); - __ lfd(floatSlot, - BytesPerWord, arg_java); - __ stfd(floatSlot, 0, arg_c); - __ addi(arg_java, arg_java, - 2 * BytesPerWord); - __ addi(arg_c, arg_c, BytesPerWord); - __ cmplwi(CCR0, fpcnt, max_fp_register_arguments); - __ blt(CCR0, move_floatSlot_to_FARG); - __ b(loop_start); - - __ bind(loop_end); - - __ pop_frame(); - __ restore_nonvolatile_gprs(R1_SP, _spill_nonvolatiles_neg(r14)); - __ restore_LR_CR(R0); - - __ blr(); - - Label move_int_arg, move_float_arg; - __ bind(move_int_arg); // each case must consist of 2 instructions (otherwise adapt LogSizeOfTwoInstructions) - __ mr(R5_ARG3, intSlot); __ b(loop_start); - __ mr(R6_ARG4, intSlot); __ b(loop_start); - __ mr(R7_ARG5, intSlot); __ b(loop_start); - __ mr(R8_ARG6, intSlot); __ b(loop_start); - __ mr(R9_ARG7, intSlot); __ b(loop_start); - __ mr(R10_ARG8, intSlot); __ b(loop_start); - - __ bind(move_float_arg); // each case must consist of 2 instructions (otherwise adapt LogSizeOfTwoInstructions) - __ fmr(F1_ARG1, floatSlot); __ b(loop_start); - __ fmr(F2_ARG2, floatSlot); __ b(loop_start); - __ fmr(F3_ARG3, floatSlot); __ b(loop_start); - __ fmr(F4_ARG4, floatSlot); __ b(loop_start); - __ fmr(F5_ARG5, floatSlot); __ b(loop_start); - __ fmr(F6_ARG6, floatSlot); __ b(loop_start); - __ fmr(F7_ARG7, floatSlot); __ b(loop_start); - __ fmr(F8_ARG8, floatSlot); __ b(loop_start); - __ fmr(F9_ARG9, floatSlot); __ b(loop_start); - __ fmr(F10_ARG10, floatSlot); __ b(loop_start); - __ fmr(F11_ARG11, floatSlot); __ b(loop_start); - __ fmr(F12_ARG12, floatSlot); __ b(loop_start); - __ fmr(F13_ARG13, floatSlot); __ b(loop_start); - - __ bind(move_intSlot_to_ARG); - __ sldi(R0, argcnt, LogSizeOfTwoInstructions); - __ load_const(R11_scratch1, move_int_arg); // Label must be bound here. - __ add(R11_scratch1, R0, R11_scratch1); - __ mtctr(R11_scratch1/*branch_target*/); - __ bctr(); - __ bind(move_floatSlot_to_FARG); - __ sldi(R0, fpcnt, LogSizeOfTwoInstructions); - __ addi(fpcnt, fpcnt, 1); - __ load_const(R11_scratch1, move_float_arg); // Label must be bound here. - __ add(R11_scratch1, R0, R11_scratch1); - __ mtctr(R11_scratch1/*branch_target*/); - __ bctr(); - - return entry; -} - -address AbstractInterpreterGenerator::generate_result_handler_for(BasicType type) { - // - // Registers alive - // R3_RET - // LR - // - // Registers updated - // R3_RET - // - - Label done; - address entry = __ pc(); - - switch (type) { - case T_BOOLEAN: - // convert !=0 to 1 - __ neg(R0, R3_RET); - __ orr(R0, R3_RET, R0); - __ srwi(R3_RET, R0, 31); - break; - case T_BYTE: - // sign extend 8 bits - __ extsb(R3_RET, R3_RET); - break; - case T_CHAR: - // zero extend 16 bits - __ clrldi(R3_RET, R3_RET, 48); - break; - case T_SHORT: - // sign extend 16 bits - __ extsh(R3_RET, R3_RET); - break; - case T_INT: - // sign extend 32 bits - __ extsw(R3_RET, R3_RET); - break; - case T_LONG: - break; - case T_OBJECT: - // unbox result if not null - __ cmpdi(CCR0, R3_RET, 0); - __ beq(CCR0, done); - __ ld(R3_RET, 0, R3_RET); - __ verify_oop(R3_RET); - break; - case T_FLOAT: - break; - case T_DOUBLE: - break; - case T_VOID: - break; - default: ShouldNotReachHere(); - } - - __ BIND(done); - __ blr(); - - return entry; -} - -// Abstract method entry. -// -address TemplateInterpreterGenerator::generate_abstract_entry(void) { - address entry = __ pc(); - - // - // Registers alive - // R16_thread - JavaThread* - // R19_method - callee's method (method to be invoked) - // R1_SP - SP prepared such that caller's outgoing args are near top - // LR - return address to caller - // - // Stack layout at this point: - // - // 0 [TOP_IJAVA_FRAME_ABI] <-- R1_SP - // alignment (optional) - // [outgoing Java arguments] - // ... - // PARENT [PARENT_IJAVA_FRAME_ABI] - // ... - // - - // Can't use call_VM here because we have not set up a new - // interpreter state. Make the call to the vm and make it look like - // our caller set up the JavaFrameAnchor. - __ set_top_ijava_frame_at_SP_as_last_Java_frame(R1_SP, R12_scratch2/*tmp*/); - - // Push a new C frame and save LR. - __ save_LR_CR(R0); - __ push_frame_reg_args(0, R11_scratch1); - - // This is not a leaf but we have a JavaFrameAnchor now and we will - // check (create) exceptions afterward so this is ok. - __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError), - R16_thread); - - // Pop the C frame and restore LR. - __ pop_frame(); - __ restore_LR_CR(R0); - - // Reset JavaFrameAnchor from call_VM_leaf above. - __ reset_last_Java_frame(); - - // We don't know our caller, so jump to the general forward exception stub, - // which will also pop our full frame off. Satisfy the interface of - // SharedRuntime::generate_forward_exception() - __ load_const_optimized(R11_scratch1, StubRoutines::forward_exception_entry(), R0); - __ mtctr(R11_scratch1); - __ bctr(); - - return entry; -} - -// Interpreter intrinsic for WeakReference.get(). -// 1. Don't push a full blown frame and go on dispatching, but fetch the value -// into R8 and return quickly -// 2. If G1 is active we *must* execute this intrinsic for corrrectness: -// It contains a GC barrier which puts the reference into the satb buffer -// to indicate that someone holds a strong reference to the object the -// weak ref points to! -address TemplateInterpreterGenerator::generate_Reference_get_entry(void) { - // Code: _aload_0, _getfield, _areturn - // parameter size = 1 - // - // The code that gets generated by this routine is split into 2 parts: - // 1. the "intrinsified" code for G1 (or any SATB based GC), - // 2. the slow path - which is an expansion of the regular method entry. - // - // Notes: - // * In the G1 code we do not check whether we need to block for - // a safepoint. If G1 is enabled then we must execute the specialized - // code for Reference.get (except when the Reference object is null) - // so that we can log the value in the referent field with an SATB - // update buffer. - // If the code for the getfield template is modified so that the - // G1 pre-barrier code is executed when the current method is - // Reference.get() then going through the normal method entry - // will be fine. - // * The G1 code can, however, check the receiver object (the instance - // of java.lang.Reference) and jump to the slow path if null. If the - // Reference object is null then we obviously cannot fetch the referent - // and so we don't need to call the G1 pre-barrier. Thus we can use the - // regular method entry code to generate the NPE. - // - - if (UseG1GC) { - address entry = __ pc(); - - const int referent_offset = java_lang_ref_Reference::referent_offset; - guarantee(referent_offset > 0, "referent offset not initialized"); - - Label slow_path; - - // Debugging not possible, so can't use __ skip_if_jvmti_mode(slow_path, GR31_SCRATCH); - - // In the G1 code we don't check if we need to reach a safepoint. We - // continue and the thread will safepoint at the next bytecode dispatch. - - // If the receiver is null then it is OK to jump to the slow path. - __ ld(R3_RET, Interpreter::stackElementSize, R15_esp); // get receiver - - // Check if receiver == NULL and go the slow path. - __ cmpdi(CCR0, R3_RET, 0); - __ beq(CCR0, slow_path); - - // Load the value of the referent field. - __ load_heap_oop(R3_RET, referent_offset, R3_RET); - - // Generate the G1 pre-barrier code to log the value of - // the referent field in an SATB buffer. Note with - // these parameters the pre-barrier does not generate - // the load of the previous value. - - // Restore caller sp for c2i case. -#ifdef ASSERT - __ ld(R9_ARG7, 0, R1_SP); - __ ld(R10_ARG8, 0, R21_sender_SP); - __ cmpd(CCR0, R9_ARG7, R10_ARG8); - __ asm_assert_eq("backlink", 0x544); -#endif // ASSERT - __ mr(R1_SP, R21_sender_SP); // Cut the stack back to where the caller started. - - __ g1_write_barrier_pre(noreg, // obj - noreg, // offset - R3_RET, // pre_val - R11_scratch1, // tmp - R12_scratch2, // tmp - true); // needs_frame - - __ blr(); - - // Generate regular method entry. - __ bind(slow_path); - __ jump_to_entry(Interpreter::entry_for_kind(Interpreter::zerolocals), R11_scratch1); - return entry; - } - - return NULL; -} diff --git a/hotspot/src/cpu/ppc/vm/javaFrameAnchor_ppc.hpp b/hotspot/src/cpu/ppc/vm/javaFrameAnchor_ppc.hpp index 26ca0dbf181..2b66bbce292 100644 --- a/hotspot/src/cpu/ppc/vm/javaFrameAnchor_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/javaFrameAnchor_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/jniFastGetField_ppc.cpp b/hotspot/src/cpu/ppc/vm/jniFastGetField_ppc.cpp index b16be25c5c0..8447e1c37d9 100644 --- a/hotspot/src/cpu/ppc/vm/jniFastGetField_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/jniFastGetField_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/jniTypes_ppc.hpp b/hotspot/src/cpu/ppc/vm/jniTypes_ppc.hpp index 9178bd442ad..7179e998931 100644 --- a/hotspot/src/cpu/ppc/vm/jniTypes_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/jniTypes_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/jni_ppc.h b/hotspot/src/cpu/ppc/vm/jni_ppc.h index da8cc361c14..64e4b9bf061 100644 --- a/hotspot/src/cpu/ppc/vm/jni_ppc.h +++ b/hotspot/src/cpu/ppc/vm/jni_ppc.h @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp index fae424b569e..c51555e0b23 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016 SAP SE. 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 @@ -3172,11 +3172,12 @@ void MacroAssembler::clear_memory_doubleword(Register base_ptr, Register cnt_dwo // // Assumes that result differs from all other registers. // -// Haystack, needle are the addresses of jchar-arrays. -// NeedleChar is needle[0] if it is known at compile time. -// Haycnt is the length of the haystack. We assume haycnt >=1. +// 'haystack' is the addresses of a jchar-array. +// 'needle' is either the character to search for or R0. +// 'needleChar' is the character to search for if 'needle' == R0.. +// 'haycnt' is the length of the haystack. We assume 'haycnt' >=1. // -// Preserves haystack, haycnt, kills all other registers. +// Preserves haystack, haycnt, needle and kills all other registers. // // If needle == R0, we search for the constant needleChar. void MacroAssembler::string_indexof_1(Register result, Register haystack, Register haycnt, @@ -3186,13 +3187,11 @@ void MacroAssembler::string_indexof_1(Register result, Register haystack, Regist assert_different_registers(result, haystack, haycnt, needle, tmp1, tmp2); Label L_InnerLoop, L_FinalCheck, L_Found1, L_Found2, L_Found3, L_NotFound, L_End; - Register needle0 = needle, // Contains needle[0]. - addr = tmp1, + Register addr = tmp1, ch1 = tmp2, ch2 = R0; -//2 (variable) or 3 (const): - if (needle != R0) lhz(needle0, 0, needle); // Preload needle character, needle has len==1. +//3: dcbtct(haystack, 0x00); // Indicate R/O access to haystack. srwi_(tmp2, haycnt, 1); // Shift right by exact_log2(UNROLL_FACTOR). @@ -3203,8 +3202,8 @@ void MacroAssembler::string_indexof_1(Register result, Register haystack, Regist bind(L_InnerLoop); // Main work horse (2x unrolled search loop). lhz(ch1, 0, addr); // Load characters from haystack. lhz(ch2, 2, addr); - (needle != R0) ? cmpw(CCR0, ch1, needle0) : cmplwi(CCR0, ch1, needleChar); - (needle != R0) ? cmpw(CCR1, ch2, needle0) : cmplwi(CCR1, ch2, needleChar); + (needle != R0) ? cmpw(CCR0, ch1, needle) : cmplwi(CCR0, ch1, needleChar); + (needle != R0) ? cmpw(CCR1, ch2, needle) : cmplwi(CCR1, ch2, needleChar); beq(CCR0, L_Found1); // Did we find the needle? beq(CCR1, L_Found2); addi(addr, addr, 4); @@ -3214,7 +3213,7 @@ void MacroAssembler::string_indexof_1(Register result, Register haystack, Regist andi_(R0, haycnt, 1); beq(CCR0, L_NotFound); lhz(ch1, 0, addr); // One position left at which we have to compare. - (needle != R0) ? cmpw(CCR1, ch1, needle0) : cmplwi(CCR1, ch1, needleChar); + (needle != R0) ? cmpw(CCR1, ch1, needle) : cmplwi(CCR1, ch1, needleChar); beq(CCR1, L_Found3); //21: bind(L_NotFound); @@ -3399,7 +3398,15 @@ void MacroAssembler::string_compare(Register str1_reg, Register str2_reg, Regist chr2_reg = cnt2_reg, addr_diff = str2_reg; + // 'cnt_reg' contains the number of characters in the string's character array for the + // pre-CompactStrings strings implementation and the number of bytes in the string's + // byte array for the CompactStrings strings implementation. + const int HAS_COMPACT_STRING = java_lang_String::has_coder_field() ? 1 : 0; // '1' = byte array, '0' = char array + // Offset 0 should be 32 byte aligned. +//-6: + srawi(cnt1_reg, cnt1_reg, HAS_COMPACT_STRING); + srawi(cnt2_reg, cnt2_reg, HAS_COMPACT_STRING); //-4: dcbtct(str1_reg, 0x00); // Indicate R/O access to str1. dcbtct(str2_reg, 0x00); // Indicate R/O access to str2. @@ -3478,14 +3485,21 @@ void MacroAssembler::char_arrays_equals(Register str1_reg, Register str2_reg, Re Register index_reg = tmp5_reg; Register cbc_iter = tmp4_reg; + // 'cnt_reg' contains the number of characters in the string's character array for the + // pre-CompactStrings strings implementation and the number of bytes in the string's + // byte array for the CompactStrings strings implementation. + const int HAS_COMPACT_STRING = java_lang_String::has_coder_field() ? 1 : 0; // '1' = byte array, '0' = char array + //-1: dcbtct(str1_reg, 0x00); // Indicate R/O access to str1. dcbtct(str2_reg, 0x00); // Indicate R/O access to str2. //1: - andi(cbc_iter, cnt_reg, 4-1); // Remaining iterations after 4 java characters per iteration loop. + // cbc_iter: remaining characters after the '4 java characters per iteration' loop. + rlwinm(cbc_iter, cnt_reg, 32 - HAS_COMPACT_STRING, 30, 31); // (cnt_reg % (HAS_COMPACT_STRING ? 8 : 4)) >> HAS_COMPACT_STRING li(index_reg, 0); // init li(result_reg, 0); // assume false - srwi_(tmp2_reg, cnt_reg, exact_log2(4)); // Div: 4 java characters per iteration (main loop). + // tmp2_reg: units of 4 java characters (i.e. 8 bytes) per iteration (main loop). + srwi_(tmp2_reg, cnt_reg, exact_log2(4 << HAS_COMPACT_STRING)); // cnt_reg / (HAS_COMPACT_STRING ? 8 : 4) cmpwi(CCR1, cbc_iter, 0); // CCR1 = (cbc_iter==0) beq(CCR0, Linit_cbc); // too short @@ -3526,6 +3540,11 @@ void MacroAssembler::char_arrays_equalsImm(Register str1_reg, Register str2_reg, assert(sizeof(jchar) == 2, "must be"); assert(cntval >= 0 && ((cntval & 0x7fff) == cntval), "wrong immediate"); + // 'cntval' contains the number of characters in the string's character array for the + // pre-CompactStrings strings implementation and the number of bytes in the string's + // byte array for the CompactStrings strings implementation. + cntval >>= (java_lang_String::has_coder_field() ? 1 : 0); // '1' = byte array strings, '0' = char array strings + Label Ldone_false; if (cntval < 16) { // short case @@ -3652,9 +3671,9 @@ int MacroAssembler::crc32_table_columns(Register table, Register tc0, Register t assert_different_registers(table, tc0, tc1, tc2); assert(table == tc3, "must be!"); - if (ix0 != 0) addi(tc0, table, ix0); - if (ix1 != 0) addi(tc1, table, ix1); - if (ix2 != 0) addi(tc2, table, ix2); + addi(tc0, table, ix0); + addi(tc1, table, ix1); + addi(tc2, table, ix2); if (ix3 != 0) addi(tc3, table, ix3); return ix3; @@ -3720,14 +3739,14 @@ void MacroAssembler::update_byteLoop_crc32(Register crc, Register buf, Register const int mainLoop_alignment = loopAlignment ? 32 : 4; // (InputForNewCode > 4 ? InputForNewCode : 32) : 4; // Process all bytes in a single-byte loop. - cmpdi(CCR0, len, 0); // Anything to do? - mtctr(len); + clrldi_(len, len, 32); // Enforce 32 bit. Anything to do? beq(CCR0, L_done); if (invertCRC) { nand(crc, crc, crc); // ~c } + mtctr(len); align(mainLoop_alignment); BIND(L_mainLoop); lbz(data, 0, buf); // Byte from buffer, zero-extended. @@ -3943,7 +3962,7 @@ void MacroAssembler::kernel_crc32_1word(Register crc, Register buf, Register len #else Register crc_rv = tmp; // Load_reverse needs separate registers to work on. // Occupies tmp, but frees up crc. - load_reverse_32(crc_rv, crc); // evert byte order because we are dealing with big-endian data. + load_reverse_32(crc_rv, crc); // Revert byte order because we are dealing with big-endian data. tmp = crc; #endif diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp index df58832b160..925e73a82d1 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp index 62843482074..a15f07528b6 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/metaspaceShared_ppc.cpp b/hotspot/src/cpu/ppc/vm/metaspaceShared_ppc.cpp index 9aa479a0e09..6fd569a1122 100644 --- a/hotspot/src/cpu/ppc/vm/metaspaceShared_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/metaspaceShared_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp index 12e10dbc573..dea4bfca545 100644 --- a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.hpp b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.hpp index 63fd6070272..144e1f0f369 100644 --- a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp index 37956925d0d..08704344050 100644 --- a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.hpp b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.hpp index f0f6b6a87d9..586dcaa9380 100644 --- a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad index 001b539399f..50c96d03bb4 100644 --- a/hotspot/src/cpu/ppc/vm/ppc.ad +++ b/hotspot/src/cpu/ppc/vm/ppc.ad @@ -1,6 +1,6 @@ // -// Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. -// Copyright 2012, 2015 SAP AG. All rights reserved. +// Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2012, 2015 SAP SE. 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 @@ -956,36 +956,40 @@ static int cc_to_biint(int cc, int flags_reg) { // the instruction. The padding must match the size of a NOP instruction. int string_indexOf_imm1_charNode::compute_padding(int current_offset) const { - return (3*4-current_offset)&31; + return (3*4-current_offset)&31; // see MacroAssembler::string_indexof_1 } int string_indexOf_imm1Node::compute_padding(int current_offset) const { - return (2*4-current_offset)&31; + return (3*4-current_offset)&31; // see MacroAssembler::string_indexof_1 +} + +int string_indexOfCharNode::compute_padding(int current_offset) const { + return (3*4-current_offset)&31; // see MacroAssembler::string_indexof_1 } int string_indexOf_immNode::compute_padding(int current_offset) const { - return (3*4-current_offset)&31; + return (3*4-current_offset)&31; // see MacroAssembler::string_indexof(constant needlecount) } int string_indexOfNode::compute_padding(int current_offset) const { - return (1*4-current_offset)&31; + return (1*4-current_offset)&31; // see MacroAssembler::string_indexof(variable needlecount) } int string_compareNode::compute_padding(int current_offset) const { - return (4*4-current_offset)&31; + return (2*4-current_offset)&31; // see MacroAssembler::string_compare } int string_equals_immNode::compute_padding(int current_offset) const { - if (opnd_array(3)->constant() < 16) return 0; // Don't insert nops for short version (loop completely unrolled). - return (2*4-current_offset)&31; + if (opnd_array(3)->constant() < 16) return 0; // For strlen < 16 no nops because loop completely unrolled + return (2*4-current_offset)&31; // Genral case - see MacroAssembler::char_arrays_equalsImm } int string_equalsNode::compute_padding(int current_offset) const { - return (7*4-current_offset)&31; + return (7*4-current_offset)&31; // see MacroAssembler::char_arrays_equals } int inlineCallClearArrayNode::compute_padding(int current_offset) const { - return (2*4-current_offset)&31; + return (2*4-current_offset)&31; // see MacroAssembler::clear_memory_doubleword } //============================================================================= @@ -2025,6 +2029,8 @@ const bool Matcher::match_rule_supported(int opcode) { return SpecialStringEquals && !CompactStrings; case Op_StrIndexOf: return SpecialStringIndexOf && !CompactStrings; + case Op_StrIndexOfChar: + return SpecialStringIndexOf && !CompactStrings; } return true; // Per default match rules are supported. @@ -11034,11 +11040,11 @@ instruct inlineCallClearArray(rarg1RegL cnt, rarg2RegP base, Universe dummy, reg instruct string_indexOf_imm1_char(iRegIdst result, iRegPsrc haystack, iRegIsrc haycnt, immP needleImm, immL offsetImm, immI_1 needlecntImm, iRegIdst tmp1, iRegIdst tmp2, - flagsRegCR0 cr0, flagsRegCR1 cr1) %{ + flagsRegCR0 cr0, flagsRegCR1 cr1, regCTR ctr) %{ predicate(SpecialStringIndexOf && !CompactStrings); // type check implicit by parameter type, See Matcher::match_rule_supported match(Set result (StrIndexOf (Binary haystack haycnt) (Binary (AddP needleImm offsetImm) needlecntImm))); - effect(TEMP_DEF result, TEMP tmp1, TEMP tmp2, KILL cr0, KILL cr1); + effect(TEMP_DEF result, TEMP tmp1, TEMP tmp2, KILL cr0, KILL cr1, KILL ctr); ins_cost(150); format %{ "String IndexOf CSCL1 $haystack[0..$haycnt], $needleImm+$offsetImm[0..$needlecntImm]" @@ -11050,10 +11056,23 @@ instruct string_indexOf_imm1_char(iRegIdst result, iRegPsrc haystack, iRegIsrc h immPOper *needleOper = (immPOper *)$needleImm; const TypeOopPtr *t = needleOper->type()->isa_oopptr(); ciTypeArray* needle_values = t->const_oop()->as_type_array(); // Pointer to live char * - + jchar chr; + if (java_lang_String::has_coder_field()) { + // New compact strings byte array strings +#ifdef VM_LITTLE_ENDIAN + chr = (((jchar)needle_values->element_value(1).as_byte()) << 8) | + (jchar)needle_values->element_value(0).as_byte(); +#else + chr = (((jchar)needle_values->element_value(0).as_byte()) << 8) | + (jchar)needle_values->element_value(1).as_byte(); +#endif + } else { + // Old char array strings + chr = needle_values->char_at(0); + } __ string_indexof_1($result$$Register, $haystack$$Register, $haycnt$$Register, - R0, needle_values->char_at(0), + R0, chr, $tmp1$$Register, $tmp2$$Register); %} ins_pipe(pipe_class_compare); @@ -11073,12 +11092,13 @@ instruct string_indexOf_imm1_char(iRegIdst result, iRegPsrc haystack, iRegIsrc h instruct string_indexOf_imm1(iRegIdst result, iRegPsrc haystack, iRegIsrc haycnt, rscratch2RegP needle, immI_1 needlecntImm, iRegIdst tmp1, iRegIdst tmp2, - flagsRegCR0 cr0, flagsRegCR1 cr1) %{ + flagsRegCR0 cr0, flagsRegCR1 cr1, regCTR ctr) %{ match(Set result (StrIndexOf (Binary haystack haycnt) (Binary needle needlecntImm))); effect(USE_KILL needle, /* TDEF needle, */ TEMP_DEF result, - TEMP tmp1, TEMP tmp2); + TEMP tmp1, TEMP tmp2, KILL cr0, KILL cr1, KILL ctr); // Required for EA: check if it is still a type_array. - predicate(SpecialStringIndexOf && !CompactStrings && n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop() && + predicate(SpecialStringIndexOf && !CompactStrings && + n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop() && n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop()->is_type_array()); ins_cost(180); @@ -11091,17 +11111,54 @@ instruct string_indexOf_imm1(iRegIdst result, iRegPsrc haystack, iRegIsrc haycnt Node *ndl = in(operand_index($needle)); // The node that defines needle. ciTypeArray* needle_values = ndl->bottom_type()->is_aryptr()->const_oop()->as_type_array(); guarantee(needle_values, "sanity"); - if (needle_values != NULL) { - __ string_indexof_1($result$$Register, - $haystack$$Register, $haycnt$$Register, - R0, needle_values->char_at(0), - $tmp1$$Register, $tmp2$$Register); + jchar chr; + if (java_lang_String::has_coder_field()) { + // New compact strings byte array strings +#ifdef VM_LITTLE_ENDIAN + chr = (((jchar)needle_values->element_value(1).as_byte()) << 8) | + (jchar)needle_values->element_value(0).as_byte(); +#else + chr = (((jchar)needle_values->element_value(0).as_byte()) << 8) | + (jchar)needle_values->element_value(1).as_byte(); +#endif } else { - __ string_indexof_1($result$$Register, - $haystack$$Register, $haycnt$$Register, - $needle$$Register, 0, - $tmp1$$Register, $tmp2$$Register); + // Old char array strings + chr = needle_values->char_at(0); } + __ string_indexof_1($result$$Register, + $haystack$$Register, $haycnt$$Register, + R0, chr, + $tmp1$$Register, $tmp2$$Register); + %} + ins_pipe(pipe_class_compare); +%} + +// String_IndexOfChar +// +// Assumes register result differs from all input registers. +// +// Preserves registers haystack, haycnt +// Kills registers tmp1, tmp2 +// Defines registers result +// +// Use dst register classes if register gets killed, as it is the case for tmp registers! +instruct string_indexOfChar(iRegIdst result, iRegPsrc haystack, iRegIsrc haycnt, + iRegIsrc ch, iRegIdst tmp1, iRegIdst tmp2, + flagsRegCR0 cr0, flagsRegCR1 cr1, regCTR ctr) %{ + match(Set result (StrIndexOfChar (Binary haystack haycnt) ch)); + effect(TEMP_DEF result, TEMP tmp1, TEMP tmp2, KILL cr0, KILL cr1, KILL ctr); + predicate(SpecialStringIndexOf && !CompactStrings); + ins_cost(180); + + ins_alignment(8); // 'compute_padding()' gets called, up to this number-1 nops will get inserted. + + format %{ "String IndexOfChar $haystack[0..$haycnt], $ch" + " -> $result \t// KILL $haycnt, $tmp1, $tmp2, $cr0, $cr1" %} + ins_encode %{ + __ string_indexof_1($result$$Register, + $haystack$$Register, $haycnt$$Register, + $ch$$Register, 0 /* this is not used if the character is already in a register */, + $tmp1$$Register, $tmp2$$Register); %} ins_pipe(pipe_class_compare); %} @@ -11120,10 +11177,10 @@ instruct string_indexOf_imm1(iRegIdst result, iRegPsrc haystack, iRegIsrc haycnt instruct string_indexOf_imm(iRegIdst result, iRegPsrc haystack, rscratch1RegI haycnt, iRegPsrc needle, uimmI15 needlecntImm, iRegIdst tmp1, iRegIdst tmp2, iRegIdst tmp3, iRegIdst tmp4, iRegIdst tmp5, - flagsRegCR0 cr0, flagsRegCR1 cr1, flagsRegCR6 cr6) %{ + flagsRegCR0 cr0, flagsRegCR1 cr1, flagsRegCR6 cr6, regCTR ctr) %{ match(Set result (StrIndexOf (Binary haystack haycnt) (Binary needle needlecntImm))); effect(USE_KILL haycnt, /* better: TDEF haycnt, */ TEMP_DEF result, - TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, KILL cr0, KILL cr1, KILL cr6); + TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, KILL cr0, KILL cr1, KILL cr6, KILL ctr); // Required for EA: check if it is still a type_array. predicate(SpecialStringIndexOf && !CompactStrings && n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop() && n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop()->is_type_array()); @@ -11153,11 +11210,11 @@ instruct string_indexOf_imm(iRegIdst result, iRegPsrc haystack, rscratch1RegI ha // Use dst register classes if register gets killed, as it is the case for tmp registers! instruct string_indexOf(iRegIdst result, iRegPsrc haystack, rscratch1RegI haycnt, iRegPsrc needle, rscratch2RegI needlecnt, iRegLdst tmp1, iRegLdst tmp2, iRegLdst tmp3, iRegLdst tmp4, - flagsRegCR0 cr0, flagsRegCR1 cr1, flagsRegCR6 cr6) %{ + flagsRegCR0 cr0, flagsRegCR1 cr1, flagsRegCR6 cr6, regCTR ctr) %{ match(Set result (StrIndexOf (Binary haystack haycnt) (Binary needle needlecnt))); effect(USE_KILL haycnt, USE_KILL needlecnt, /*better: TDEF haycnt, TDEF needlecnt,*/ TEMP_DEF result, - TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL cr0, KILL cr1, KILL cr6); + TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL cr0, KILL cr1, KILL cr6, KILL ctr); predicate(SpecialStringIndexOf && !CompactStrings); // See Matcher::match_rule_supported. ins_cost(300); diff --git a/hotspot/src/cpu/ppc/vm/ppc_64.ad b/hotspot/src/cpu/ppc/vm/ppc_64.ad index 4c1be69601a..712f18fe969 100644 --- a/hotspot/src/cpu/ppc/vm/ppc_64.ad +++ b/hotspot/src/cpu/ppc/vm/ppc_64.ad @@ -1,6 +1,6 @@ // // Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. -// Copyright 2012, 2013 SAP AG. All rights reserved. +// Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/registerMap_ppc.hpp b/hotspot/src/cpu/ppc/vm/registerMap_ppc.hpp index b3d89c2ba09..06fdff2e891 100644 --- a/hotspot/src/cpu/ppc/vm/registerMap_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/registerMap_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/register_definitions_ppc.cpp b/hotspot/src/cpu/ppc/vm/register_definitions_ppc.cpp index 6b002d2efd2..2a2d968e44d 100644 --- a/hotspot/src/cpu/ppc/vm/register_definitions_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/register_definitions_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/register_ppc.cpp b/hotspot/src/cpu/ppc/vm/register_ppc.cpp index edff7485a97..e0b07c98168 100644 --- a/hotspot/src/cpu/ppc/vm/register_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/register_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/register_ppc.hpp b/hotspot/src/cpu/ppc/vm/register_ppc.hpp index def1f6e3872..8f6dda40eea 100644 --- a/hotspot/src/cpu/ppc/vm/register_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/register_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 SAP SE. 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 @@ -609,13 +609,11 @@ REGISTER_DECLARATION(Register, R26_tmp6, R26); REGISTER_DECLARATION(Register, R27_tmp7, R27); REGISTER_DECLARATION(Register, R28_tmp8, R28); REGISTER_DECLARATION(Register, R29_tmp9, R29); -#ifndef CC_INTERP REGISTER_DECLARATION(Register, R24_dispatch_addr, R24); REGISTER_DECLARATION(Register, R25_templateTableBase, R25); REGISTER_DECLARATION(Register, R26_monitor, R26); REGISTER_DECLARATION(Register, R27_constPoolCache, R27); REGISTER_DECLARATION(Register, R28_mdx, R28); -#endif // CC_INTERP REGISTER_DECLARATION(Register, R19_inline_cache_reg, R19); REGISTER_DECLARATION(Register, R29_TOC, R29); @@ -638,12 +636,9 @@ REGISTER_DECLARATION(Register, R29_TOC, R29); #define R26_monitor AS_REGISTER(Register, R26) #define R27_constPoolCache AS_REGISTER(Register, R27) #define R28_mdx AS_REGISTER(Register, R28) -#endif #define R19_inline_cache_reg AS_REGISTER(Register, R19) #define R29_TOC AS_REGISTER(Register, R29) - -#define CCR4_is_synced AS_REGISTER(ConditionRegister, CCR4) #endif // Scratch registers are volatile. diff --git a/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp b/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp index 9c5065d0dd4..44b2d79e515 100644 --- a/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/relocInfo_ppc.hpp b/hotspot/src/cpu/ppc/vm/relocInfo_ppc.hpp index 3cd7da47ec8..3778e0c674d 100644 --- a/hotspot/src/cpu/ppc/vm/relocInfo_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/relocInfo_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp b/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp index e887877d14e..77353f891e7 100644 --- a/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp index 5e7c7c2a0a4..c945027a50d 100644 --- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2015 SAP SE. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016 SAP SE. 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 @@ -1477,7 +1477,7 @@ static void save_or_restore_arguments(MacroAssembler* masm, } } -// Check GC_locker::needs_gc and enter the runtime if it's true. This +// Check GCLocker::needs_gc and enter the runtime if it's true. This // keeps a new JNI critical region from starting until a GC has been // forced. Save down any oops in registers and describe them in an // OopMap. @@ -1489,9 +1489,9 @@ static void check_needs_gc_for_critical_native(MacroAssembler* masm, VMRegPair* in_regs, BasicType* in_sig_bt, Register tmp_reg ) { - __ block_comment("check GC_locker::needs_gc"); + __ block_comment("check GCLocker::needs_gc"); Label cont; - __ lbz(tmp_reg, (RegisterOrConstant)(intptr_t)GC_locker::needs_gc_address()); + __ lbz(tmp_reg, (RegisterOrConstant)(intptr_t)GCLocker::needs_gc_address()); __ cmplwi(CCR0, tmp_reg, 0); __ beq(CCR0, cont); @@ -1690,14 +1690,14 @@ static void gen_special_dispatch(MacroAssembler* masm, // GetPrimtiveArrayCritical and disallow the use of any other JNI // functions. The wrapper is expected to unpack the arguments before // passing them to the callee and perform checks before and after the -// native call to ensure that they GC_locker +// native call to ensure that they GCLocker // lock_critical/unlock_critical semantics are followed. Some other // parts of JNI setup are skipped like the tear down of the JNI handle // block and the check for pending exceptions it's impossible for them // to be thrown. // // They are roughly structured like this: -// if (GC_locker::needs_gc()) +// if (GCLocker::needs_gc()) // SharedRuntime::block_for_jni_critical(); // tranistion to thread_in_native // unpack arrray arguments and call native entry point @@ -3400,9 +3400,9 @@ static void reverse_words(unsigned long *s, unsigned long *d, int len) { void SharedRuntime::montgomery_multiply(jint *a_ints, jint *b_ints, jint *n_ints, jint len, jlong inv, jint *m_ints) { + len = len & 0x7fffFFFF; // C2 does not respect int to long conversion for stub calls. assert(len % 2 == 0, "array length in montgomery_multiply must be even"); int longwords = len/2; - assert(longwords > 0, "unsupported"); // Make very sure we don't use so much space that the stack might // overflow. 512 jints corresponds to an 16384-bit integer and @@ -3430,9 +3430,9 @@ void SharedRuntime::montgomery_multiply(jint *a_ints, jint *b_ints, jint *n_ints void SharedRuntime::montgomery_square(jint *a_ints, jint *n_ints, jint len, jlong inv, jint *m_ints) { + len = len & 0x7fffFFFF; // C2 does not respect int to long conversion for stub calls. assert(len % 2 == 0, "array length in montgomery_square must be even"); int longwords = len/2; - assert(longwords > 0, "unsupported"); // Make very sure we don't use so much space that the stack might // overflow. 512 jints corresponds to an 16384-bit integer and diff --git a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp index 78082716d85..c3f6922fe2d 100644 --- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016 SAP SE. 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 @@ -1070,6 +1070,12 @@ class StubGenerator: public StubCodeGenerator { return start; } + inline void assert_positive_int(Register count) { +#ifdef ASSERT + __ srdi_(R0, count, 31); + __ asm_assert_eq("missing zero extend", 0xAFFE); +#endif + } // Generate overlap test for array copy stubs. // @@ -1082,10 +1088,7 @@ class StubGenerator: public StubCodeGenerator { Register tmp1 = R6_ARG4; Register tmp2 = R7_ARG5; -#ifdef ASSERT - __ srdi_(tmp2, R5_ARG3, 31); - __ asm_assert_eq("missing zero extend", 0xAFFE); -#endif + assert_positive_int(R5_ARG3); __ subf(tmp1, R3_ARG1, R4_ARG2); // distance in bytes __ sldi(tmp2, R5_ARG3, log2_elem_size); // size in bytes @@ -1125,14 +1128,15 @@ class StubGenerator: public StubCodeGenerator { address generate_disjoint_byte_copy(bool aligned, const char * name) { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); + assert_positive_int(R5_ARG3); Register tmp1 = R6_ARG4; Register tmp2 = R7_ARG5; Register tmp3 = R8_ARG6; Register tmp4 = R9_ARG7; - Label l_1, l_2, l_3, l_4, l_5, l_6, l_7, l_8, l_9; + // Don't try anything fancy if arrays don't have many elements. __ li(tmp3, 0); __ cmpwi(CCR0, R5_ARG3, 17); @@ -1257,6 +1261,7 @@ class StubGenerator: public StubCodeGenerator { address generate_conjoint_byte_copy(bool aligned, const char * name) { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); + assert_positive_int(R5_ARG3); Register tmp1 = R6_ARG4; Register tmp2 = R7_ARG5; @@ -1349,8 +1354,10 @@ class StubGenerator: public StubCodeGenerator { Register tmp4 = R9_ARG7; address start = __ function_entry(); + assert_positive_int(R5_ARG3); Label l_1, l_2, l_3, l_4, l_5, l_6, l_7, l_8; + // don't try anything fancy if arrays don't have many elements __ li(tmp3, 0); __ cmpwi(CCR0, R5_ARG3, 9); @@ -1479,6 +1486,7 @@ class StubGenerator: public StubCodeGenerator { address generate_conjoint_short_copy(bool aligned, const char * name) { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); + assert_positive_int(R5_ARG3); Register tmp1 = R6_ARG4; Register tmp2 = R7_ARG5; @@ -1521,6 +1529,7 @@ class StubGenerator: public StubCodeGenerator { Register tmp4 = R0; Label l_1, l_2, l_3, l_4, l_5, l_6; + // for short arrays, just do single element copy __ li(tmp3, 0); __ cmpwi(CCR0, R5_ARG3, 5); @@ -1603,6 +1612,7 @@ class StubGenerator: public StubCodeGenerator { address generate_disjoint_int_copy(bool aligned, const char * name) { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); + assert_positive_int(R5_ARG3); generate_disjoint_int_copy_core(aligned); __ li(R3_RET, 0); // return 0 __ blr(); @@ -1688,7 +1698,7 @@ class StubGenerator: public StubCodeGenerator { address generate_conjoint_int_copy(bool aligned, const char * name) { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); - + assert_positive_int(R5_ARG3); address nooverlap_target = aligned ? STUB_ENTRY(arrayof_jint_disjoint_arraycopy) : STUB_ENTRY(jint_disjoint_arraycopy); @@ -1775,6 +1785,7 @@ class StubGenerator: public StubCodeGenerator { address generate_disjoint_long_copy(bool aligned, const char * name) { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); + assert_positive_int(R5_ARG3); generate_disjoint_long_copy_core(aligned); __ li(R3_RET, 0); // return 0 __ blr(); @@ -1858,7 +1869,7 @@ class StubGenerator: public StubCodeGenerator { address generate_conjoint_long_copy(bool aligned, const char * name) { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); - + assert_positive_int(R5_ARG3); address nooverlap_target = aligned ? STUB_ENTRY(arrayof_jlong_disjoint_arraycopy) : STUB_ENTRY(jlong_disjoint_arraycopy); @@ -1885,7 +1896,7 @@ class StubGenerator: public StubCodeGenerator { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); - + assert_positive_int(R5_ARG3); address nooverlap_target = aligned ? STUB_ENTRY(arrayof_oop_disjoint_arraycopy) : STUB_ENTRY(oop_disjoint_arraycopy); @@ -1922,7 +1933,7 @@ class StubGenerator: public StubCodeGenerator { address generate_disjoint_oop_copy(bool aligned, const char * name, bool dest_uninitialized) { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); - + assert_positive_int(R5_ARG3); gen_write_ref_array_pre_barrier(R3_ARG1, R4_ARG2, R5_ARG3, dest_uninitialized, R9_ARG7); // save some arguments, disjoint_long_copy_core destroys them. @@ -1996,7 +2007,24 @@ class StubGenerator: public StubCodeGenerator { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); - // TODO: Assert that int is 64 bit sign extended and arrays are not conjoint. + // Assert that int is 64 bit sign extended and arrays are not conjoint. +#ifdef ASSERT + { + assert_positive_int(R5_ARG3); + const Register tmp1 = R11_scratch1, tmp2 = R12_scratch2; + Label no_overlap; + __ subf(tmp1, R3_ARG1, R4_ARG2); // distance in bytes + __ sldi(tmp2, R5_ARG3, LogBytesPerHeapOop); // size in bytes + __ cmpld(CCR0, R3_ARG1, R4_ARG2); // Use unsigned comparison! + __ cmpld(CCR1, tmp1, tmp2); + __ crnand(CCR0, Assembler::less, CCR1, Assembler::less); + // Overlaps if Src before dst and distance smaller than size. + // Branch to forward copy routine otherwise. + __ blt(CCR0, no_overlap); + __ stop("overlap in checkcast_copy", 0x9543); + __ bind(no_overlap); + } +#endif gen_write_ref_array_pre_barrier(R3_from, R4_to, R5_count, dest_uninitialized, R12_tmp, /* preserve: */ R6_ckoff, R7_ckval); @@ -2445,12 +2473,14 @@ class StubGenerator: public StubCodeGenerator { STUB_ENTRY(checkcast_arraycopy)); // fill routines - StubRoutines::_jbyte_fill = generate_fill(T_BYTE, false, "jbyte_fill"); - StubRoutines::_jshort_fill = generate_fill(T_SHORT, false, "jshort_fill"); - StubRoutines::_jint_fill = generate_fill(T_INT, false, "jint_fill"); - StubRoutines::_arrayof_jbyte_fill = generate_fill(T_BYTE, true, "arrayof_jbyte_fill"); - StubRoutines::_arrayof_jshort_fill = generate_fill(T_SHORT, true, "arrayof_jshort_fill"); - StubRoutines::_arrayof_jint_fill = generate_fill(T_INT, true, "arrayof_jint_fill"); + if (OptimizeFill) { + StubRoutines::_jbyte_fill = generate_fill(T_BYTE, false, "jbyte_fill"); + StubRoutines::_jshort_fill = generate_fill(T_SHORT, false, "jshort_fill"); + StubRoutines::_jint_fill = generate_fill(T_INT, false, "jint_fill"); + StubRoutines::_arrayof_jbyte_fill = generate_fill(T_BYTE, true, "arrayof_jbyte_fill"); + StubRoutines::_arrayof_jshort_fill = generate_fill(T_SHORT, true, "arrayof_jshort_fill"); + StubRoutines::_arrayof_jint_fill = generate_fill(T_INT, true, "arrayof_jint_fill"); + } } // Safefetch stubs. @@ -2535,6 +2565,11 @@ class StubGenerator: public StubCodeGenerator { BLOCK_COMMENT("Entry:"); + // C2 does not respect int to long conversion for stub calls. + __ clrldi(xlen, xlen, 32); + __ clrldi(ylen, ylen, 32); + __ clrldi(zlen, zlen, 32); + // Save non-volatile regs (frameless). int current_offs = 8; __ std(R24, -current_offs, R1_SP); current_offs += 8; diff --git a/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.cpp index 1f49fe1de26..bed7f40a501 100644 --- a/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.hpp b/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.hpp index cd3a8bfb9d4..a005677ffa0 100644 --- a/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.hpp +++ b/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp index eb00b5742c1..19b732a2ad6 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2015 SAP AG. All rights reserved. + * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015 SAP SE. 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 @@ -51,6 +51,13 @@ #undef __ #define __ _masm-> +// Size of interpreter code. Increase if too small. Interpreter will +// fail with a guarantee ("not enough space for interpreter generation"); +// if too small. +// Run with +PrintInterpreter to get the VM to print out the size. +// Max size with JVMTI +int TemplateInterpreter::InterpreterCodeSize = 230*K; + #ifdef PRODUCT #define BLOCK_COMMENT(str) /* nothing */ #else @@ -61,6 +68,500 @@ //----------------------------------------------------------------------------- +address TemplateInterpreterGenerator::generate_slow_signature_handler() { + // Slow_signature handler that respects the PPC C calling conventions. + // + // We get called by the native entry code with our output register + // area == 8. First we call InterpreterRuntime::get_result_handler + // to copy the pointer to the signature string temporarily to the + // first C-argument and to return the result_handler in + // R3_RET. Since native_entry will copy the jni-pointer to the + // first C-argument slot later on, it is OK to occupy this slot + // temporarilly. Then we copy the argument list on the java + // expression stack into native varargs format on the native stack + // and load arguments into argument registers. Integer arguments in + // the varargs vector will be sign-extended to 8 bytes. + // + // On entry: + // R3_ARG1 - intptr_t* Address of java argument list in memory. + // R15_prev_state - BytecodeInterpreter* Address of interpreter state for + // this method + // R19_method + // + // On exit (just before return instruction): + // R3_RET - contains the address of the result_handler. + // R4_ARG2 - is not updated for static methods and contains "this" otherwise. + // R5_ARG3-R10_ARG8: - When the (i-2)th Java argument is not of type float or double, + // ARGi contains this argument. Otherwise, ARGi is not updated. + // F1_ARG1-F13_ARG13 - contain the first 13 arguments of type float or double. + + const int LogSizeOfTwoInstructions = 3; + + // FIXME: use Argument:: GL: Argument names different numbers! + const int max_fp_register_arguments = 13; + const int max_int_register_arguments = 6; // first 2 are reserved + + const Register arg_java = R21_tmp1; + const Register arg_c = R22_tmp2; + const Register signature = R23_tmp3; // is string + const Register sig_byte = R24_tmp4; + const Register fpcnt = R25_tmp5; + const Register argcnt = R26_tmp6; + const Register intSlot = R27_tmp7; + const Register target_sp = R28_tmp8; + const FloatRegister floatSlot = F0; + + address entry = __ function_entry(); + + __ save_LR_CR(R0); + __ save_nonvolatile_gprs(R1_SP, _spill_nonvolatiles_neg(r14)); + // We use target_sp for storing arguments in the C frame. + __ mr(target_sp, R1_SP); + __ push_frame_reg_args_nonvolatiles(0, R11_scratch1); + + __ mr(arg_java, R3_ARG1); + + __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::get_signature), R16_thread, R19_method); + + // Signature is in R3_RET. Signature is callee saved. + __ mr(signature, R3_RET); + + // Get the result handler. + __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::get_result_handler), R16_thread, R19_method); + + { + Label L; + // test if static + // _access_flags._flags must be at offset 0. + // TODO PPC port: requires change in shared code. + //assert(in_bytes(AccessFlags::flags_offset()) == 0, + // "MethodDesc._access_flags == MethodDesc._access_flags._flags"); + // _access_flags must be a 32 bit value. + assert(sizeof(AccessFlags) == 4, "wrong size"); + __ lwa(R11_scratch1/*access_flags*/, method_(access_flags)); + // testbit with condition register. + __ testbitdi(CCR0, R0, R11_scratch1/*access_flags*/, JVM_ACC_STATIC_BIT); + __ btrue(CCR0, L); + // For non-static functions, pass "this" in R4_ARG2 and copy it + // to 2nd C-arg slot. + // We need to box the Java object here, so we use arg_java + // (address of current Java stack slot) as argument and don't + // dereference it as in case of ints, floats, etc. + __ mr(R4_ARG2, arg_java); + __ addi(arg_java, arg_java, -BytesPerWord); + __ std(R4_ARG2, _abi(carg_2), target_sp); + __ bind(L); + } + + // Will be incremented directly after loop_start. argcnt=0 + // corresponds to 3rd C argument. + __ li(argcnt, -1); + // arg_c points to 3rd C argument + __ addi(arg_c, target_sp, _abi(carg_3)); + // no floating-point args parsed so far + __ li(fpcnt, 0); + + Label move_intSlot_to_ARG, move_floatSlot_to_FARG; + Label loop_start, loop_end; + Label do_int, do_long, do_float, do_double, do_dontreachhere, do_object, do_array, do_boxed; + + // signature points to '(' at entry +#ifdef ASSERT + __ lbz(sig_byte, 0, signature); + __ cmplwi(CCR0, sig_byte, '('); + __ bne(CCR0, do_dontreachhere); +#endif + + __ bind(loop_start); + + __ addi(argcnt, argcnt, 1); + __ lbzu(sig_byte, 1, signature); + + __ cmplwi(CCR0, sig_byte, ')'); // end of signature + __ beq(CCR0, loop_end); + + __ cmplwi(CCR0, sig_byte, 'B'); // byte + __ beq(CCR0, do_int); + + __ cmplwi(CCR0, sig_byte, 'C'); // char + __ beq(CCR0, do_int); + + __ cmplwi(CCR0, sig_byte, 'D'); // double + __ beq(CCR0, do_double); + + __ cmplwi(CCR0, sig_byte, 'F'); // float + __ beq(CCR0, do_float); + + __ cmplwi(CCR0, sig_byte, 'I'); // int + __ beq(CCR0, do_int); + + __ cmplwi(CCR0, sig_byte, 'J'); // long + __ beq(CCR0, do_long); + + __ cmplwi(CCR0, sig_byte, 'S'); // short + __ beq(CCR0, do_int); + + __ cmplwi(CCR0, sig_byte, 'Z'); // boolean + __ beq(CCR0, do_int); + + __ cmplwi(CCR0, sig_byte, 'L'); // object + __ beq(CCR0, do_object); + + __ cmplwi(CCR0, sig_byte, '['); // array + __ beq(CCR0, do_array); + + // __ cmplwi(CCR0, sig_byte, 'V'); // void cannot appear since we do not parse the return type + // __ beq(CCR0, do_void); + + __ bind(do_dontreachhere); + + __ unimplemented("ShouldNotReachHere in slow_signature_handler", 120); + + __ bind(do_array); + + { + Label start_skip, end_skip; + + __ bind(start_skip); + __ lbzu(sig_byte, 1, signature); + __ cmplwi(CCR0, sig_byte, '['); + __ beq(CCR0, start_skip); // skip further brackets + __ cmplwi(CCR0, sig_byte, '9'); + __ bgt(CCR0, end_skip); // no optional size + __ cmplwi(CCR0, sig_byte, '0'); + __ bge(CCR0, start_skip); // skip optional size + __ bind(end_skip); + + __ cmplwi(CCR0, sig_byte, 'L'); + __ beq(CCR0, do_object); // for arrays of objects, the name of the object must be skipped + __ b(do_boxed); // otherwise, go directly to do_boxed + } + + __ bind(do_object); + { + Label L; + __ bind(L); + __ lbzu(sig_byte, 1, signature); + __ cmplwi(CCR0, sig_byte, ';'); + __ bne(CCR0, L); + } + // Need to box the Java object here, so we use arg_java (address of + // current Java stack slot) as argument and don't dereference it as + // in case of ints, floats, etc. + Label do_null; + __ bind(do_boxed); + __ ld(R0,0, arg_java); + __ cmpdi(CCR0, R0, 0); + __ li(intSlot,0); + __ beq(CCR0, do_null); + __ mr(intSlot, arg_java); + __ bind(do_null); + __ std(intSlot, 0, arg_c); + __ addi(arg_java, arg_java, -BytesPerWord); + __ addi(arg_c, arg_c, BytesPerWord); + __ cmplwi(CCR0, argcnt, max_int_register_arguments); + __ blt(CCR0, move_intSlot_to_ARG); + __ b(loop_start); + + __ bind(do_int); + __ lwa(intSlot, 0, arg_java); + __ std(intSlot, 0, arg_c); + __ addi(arg_java, arg_java, -BytesPerWord); + __ addi(arg_c, arg_c, BytesPerWord); + __ cmplwi(CCR0, argcnt, max_int_register_arguments); + __ blt(CCR0, move_intSlot_to_ARG); + __ b(loop_start); + + __ bind(do_long); + __ ld(intSlot, -BytesPerWord, arg_java); + __ std(intSlot, 0, arg_c); + __ addi(arg_java, arg_java, - 2 * BytesPerWord); + __ addi(arg_c, arg_c, BytesPerWord); + __ cmplwi(CCR0, argcnt, max_int_register_arguments); + __ blt(CCR0, move_intSlot_to_ARG); + __ b(loop_start); + + __ bind(do_float); + __ lfs(floatSlot, 0, arg_java); +#if defined(LINUX) + // Linux uses ELF ABI. Both original ELF and ELFv2 ABIs have float + // in the least significant word of an argument slot. +#if defined(VM_LITTLE_ENDIAN) + __ stfs(floatSlot, 0, arg_c); +#else + __ stfs(floatSlot, 4, arg_c); +#endif +#elif defined(AIX) + // Although AIX runs on big endian CPU, float is in most significant + // word of an argument slot. + __ stfs(floatSlot, 0, arg_c); +#else +#error "unknown OS" +#endif + __ addi(arg_java, arg_java, -BytesPerWord); + __ addi(arg_c, arg_c, BytesPerWord); + __ cmplwi(CCR0, fpcnt, max_fp_register_arguments); + __ blt(CCR0, move_floatSlot_to_FARG); + __ b(loop_start); + + __ bind(do_double); + __ lfd(floatSlot, - BytesPerWord, arg_java); + __ stfd(floatSlot, 0, arg_c); + __ addi(arg_java, arg_java, - 2 * BytesPerWord); + __ addi(arg_c, arg_c, BytesPerWord); + __ cmplwi(CCR0, fpcnt, max_fp_register_arguments); + __ blt(CCR0, move_floatSlot_to_FARG); + __ b(loop_start); + + __ bind(loop_end); + + __ pop_frame(); + __ restore_nonvolatile_gprs(R1_SP, _spill_nonvolatiles_neg(r14)); + __ restore_LR_CR(R0); + + __ blr(); + + Label move_int_arg, move_float_arg; + __ bind(move_int_arg); // each case must consist of 2 instructions (otherwise adapt LogSizeOfTwoInstructions) + __ mr(R5_ARG3, intSlot); __ b(loop_start); + __ mr(R6_ARG4, intSlot); __ b(loop_start); + __ mr(R7_ARG5, intSlot); __ b(loop_start); + __ mr(R8_ARG6, intSlot); __ b(loop_start); + __ mr(R9_ARG7, intSlot); __ b(loop_start); + __ mr(R10_ARG8, intSlot); __ b(loop_start); + + __ bind(move_float_arg); // each case must consist of 2 instructions (otherwise adapt LogSizeOfTwoInstructions) + __ fmr(F1_ARG1, floatSlot); __ b(loop_start); + __ fmr(F2_ARG2, floatSlot); __ b(loop_start); + __ fmr(F3_ARG3, floatSlot); __ b(loop_start); + __ fmr(F4_ARG4, floatSlot); __ b(loop_start); + __ fmr(F5_ARG5, floatSlot); __ b(loop_start); + __ fmr(F6_ARG6, floatSlot); __ b(loop_start); + __ fmr(F7_ARG7, floatSlot); __ b(loop_start); + __ fmr(F8_ARG8, floatSlot); __ b(loop_start); + __ fmr(F9_ARG9, floatSlot); __ b(loop_start); + __ fmr(F10_ARG10, floatSlot); __ b(loop_start); + __ fmr(F11_ARG11, floatSlot); __ b(loop_start); + __ fmr(F12_ARG12, floatSlot); __ b(loop_start); + __ fmr(F13_ARG13, floatSlot); __ b(loop_start); + + __ bind(move_intSlot_to_ARG); + __ sldi(R0, argcnt, LogSizeOfTwoInstructions); + __ load_const(R11_scratch1, move_int_arg); // Label must be bound here. + __ add(R11_scratch1, R0, R11_scratch1); + __ mtctr(R11_scratch1/*branch_target*/); + __ bctr(); + __ bind(move_floatSlot_to_FARG); + __ sldi(R0, fpcnt, LogSizeOfTwoInstructions); + __ addi(fpcnt, fpcnt, 1); + __ load_const(R11_scratch1, move_float_arg); // Label must be bound here. + __ add(R11_scratch1, R0, R11_scratch1); + __ mtctr(R11_scratch1/*branch_target*/); + __ bctr(); + + return entry; +} + +address TemplateInterpreterGenerator::generate_result_handler_for(BasicType type) { + // + // Registers alive + // R3_RET + // LR + // + // Registers updated + // R3_RET + // + + Label done; + address entry = __ pc(); + + switch (type) { + case T_BOOLEAN: + // convert !=0 to 1 + __ neg(R0, R3_RET); + __ orr(R0, R3_RET, R0); + __ srwi(R3_RET, R0, 31); + break; + case T_BYTE: + // sign extend 8 bits + __ extsb(R3_RET, R3_RET); + break; + case T_CHAR: + // zero extend 16 bits + __ clrldi(R3_RET, R3_RET, 48); + break; + case T_SHORT: + // sign extend 16 bits + __ extsh(R3_RET, R3_RET); + break; + case T_INT: + // sign extend 32 bits + __ extsw(R3_RET, R3_RET); + break; + case T_LONG: + break; + case T_OBJECT: + // unbox result if not null + __ cmpdi(CCR0, R3_RET, 0); + __ beq(CCR0, done); + __ ld(R3_RET, 0, R3_RET); + __ verify_oop(R3_RET); + break; + case T_FLOAT: + break; + case T_DOUBLE: + break; + case T_VOID: + break; + default: ShouldNotReachHere(); + } + + BIND(done); + __ blr(); + + return entry; +} + +// Abstract method entry. +// +address TemplateInterpreterGenerator::generate_abstract_entry(void) { + address entry = __ pc(); + + // + // Registers alive + // R16_thread - JavaThread* + // R19_method - callee's method (method to be invoked) + // R1_SP - SP prepared such that caller's outgoing args are near top + // LR - return address to caller + // + // Stack layout at this point: + // + // 0 [TOP_IJAVA_FRAME_ABI] <-- R1_SP + // alignment (optional) + // [outgoing Java arguments] + // ... + // PARENT [PARENT_IJAVA_FRAME_ABI] + // ... + // + + // Can't use call_VM here because we have not set up a new + // interpreter state. Make the call to the vm and make it look like + // our caller set up the JavaFrameAnchor. + __ set_top_ijava_frame_at_SP_as_last_Java_frame(R1_SP, R12_scratch2/*tmp*/); + + // Push a new C frame and save LR. + __ save_LR_CR(R0); + __ push_frame_reg_args(0, R11_scratch1); + + // This is not a leaf but we have a JavaFrameAnchor now and we will + // check (create) exceptions afterward so this is ok. + __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError), + R16_thread); + + // Pop the C frame and restore LR. + __ pop_frame(); + __ restore_LR_CR(R0); + + // Reset JavaFrameAnchor from call_VM_leaf above. + __ reset_last_Java_frame(); + + // We don't know our caller, so jump to the general forward exception stub, + // which will also pop our full frame off. Satisfy the interface of + // SharedRuntime::generate_forward_exception() + __ load_const_optimized(R11_scratch1, StubRoutines::forward_exception_entry(), R0); + __ mtctr(R11_scratch1); + __ bctr(); + + return entry; +} + +// Interpreter intrinsic for WeakReference.get(). +// 1. Don't push a full blown frame and go on dispatching, but fetch the value +// into R8 and return quickly +// 2. If G1 is active we *must* execute this intrinsic for corrrectness: +// It contains a GC barrier which puts the reference into the satb buffer +// to indicate that someone holds a strong reference to the object the +// weak ref points to! +address TemplateInterpreterGenerator::generate_Reference_get_entry(void) { + // Code: _aload_0, _getfield, _areturn + // parameter size = 1 + // + // The code that gets generated by this routine is split into 2 parts: + // 1. the "intrinsified" code for G1 (or any SATB based GC), + // 2. the slow path - which is an expansion of the regular method entry. + // + // Notes: + // * In the G1 code we do not check whether we need to block for + // a safepoint. If G1 is enabled then we must execute the specialized + // code for Reference.get (except when the Reference object is null) + // so that we can log the value in the referent field with an SATB + // update buffer. + // If the code for the getfield template is modified so that the + // G1 pre-barrier code is executed when the current method is + // Reference.get() then going through the normal method entry + // will be fine. + // * The G1 code can, however, check the receiver object (the instance + // of java.lang.Reference) and jump to the slow path if null. If the + // Reference object is null then we obviously cannot fetch the referent + // and so we don't need to call the G1 pre-barrier. Thus we can use the + // regular method entry code to generate the NPE. + // + + if (UseG1GC) { + address entry = __ pc(); + + const int referent_offset = java_lang_ref_Reference::referent_offset; + guarantee(referent_offset > 0, "referent offset not initialized"); + + Label slow_path; + + // Debugging not possible, so can't use __ skip_if_jvmti_mode(slow_path, GR31_SCRATCH); + + // In the G1 code we don't check if we need to reach a safepoint. We + // continue and the thread will safepoint at the next bytecode dispatch. + + // If the receiver is null then it is OK to jump to the slow path. + __ ld(R3_RET, Interpreter::stackElementSize, R15_esp); // get receiver + + // Check if receiver == NULL and go the slow path. + __ cmpdi(CCR0, R3_RET, 0); + __ beq(CCR0, slow_path); + + // Load the value of the referent field. + __ load_heap_oop(R3_RET, referent_offset, R3_RET); + + // Generate the G1 pre-barrier code to log the value of + // the referent field in an SATB buffer. Note with + // these parameters the pre-barrier does not generate + // the load of the previous value. + + // Restore caller sp for c2i case. +#ifdef ASSERT + __ ld(R9_ARG7, 0, R1_SP); + __ ld(R10_ARG8, 0, R21_sender_SP); + __ cmpd(CCR0, R9_ARG7, R10_ARG8); + __ asm_assert_eq("backlink", 0x544); +#endif // ASSERT + __ mr(R1_SP, R21_sender_SP); // Cut the stack back to where the caller started. + + __ g1_write_barrier_pre(noreg, // obj + noreg, // offset + R3_RET, // pre_val + R11_scratch1, // tmp + R12_scratch2, // tmp + true); // needs_frame + + __ blr(); + + // Generate regular method entry. + __ bind(slow_path); + __ jump_to_entry(Interpreter::entry_for_kind(Interpreter::zerolocals), R11_scratch1); + return entry; + } + + return NULL; +} + // Actually we should never reach here since we do stack overflow checks before pushing any frame. address TemplateInterpreterGenerator::generate_StackOverflowError_handler() { address entry = __ pc(); @@ -222,12 +723,6 @@ address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state, i return entry; } -// A result handler converts the native result into java format. -// Use the shared code between c++ and template interpreter. -address TemplateInterpreterGenerator::generate_result_handler_for(BasicType type) { - return AbstractInterpreterGenerator::generate_result_handler_for(type); -} - address TemplateInterpreterGenerator::generate_safept_entry_for(TosState state, address runtime_entry) { address entry = __ pc(); @@ -602,7 +1097,7 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call, Regist // End of helpers address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { - if (!TemplateInterpreter::math_entry_available(kind)) { + if (!Interpreter::math_entry_available(kind)) { NOT_PRODUCT(__ should_not_reach_here();) return NULL; } diff --git a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp index ec92898e890..d537f73dac4 100644 --- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013, 2015 SAP AG. All rights reserved. + * Copyright (c) 2013, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.hpp b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.hpp index 1dfa8841c64..943f12abb0f 100644 --- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.hpp +++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013, 2014 SAP AG. All rights reserved. + * Copyright (c) 2013, 2014 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/vmStructs_ppc.hpp b/hotspot/src/cpu/ppc/vm/vmStructs_ppc.hpp index bb4db41095d..c5297f395e1 100644 --- a/hotspot/src/cpu/ppc/vm/vmStructs_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/vmStructs_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp index fec10b9268e..51bc85d869d 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp index 63b9ba09793..46fdd6b6470 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/vmreg_ppc.cpp b/hotspot/src/cpu/ppc/vm/vmreg_ppc.cpp index a2a83f2f361..5931bdf7b76 100644 --- a/hotspot/src/cpu/ppc/vm/vmreg_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/vmreg_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp b/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp index 4fe7bdb62e1..29f99765e88 100644 --- a/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp index 16e5e5d8fd7..6113d458ebf 100644 --- a/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp index d19c211300f..0c30519a518 100644 --- a/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/abstractInterpreter_sparc.cpp similarity index 96% rename from hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp rename to hotspot/src/cpu/sparc/vm/abstractInterpreter_sparc.cpp index b1bc7fc6136..d85bd78bbbd 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/abstractInterpreter_sparc.cpp @@ -31,18 +31,6 @@ #include "runtime/synchronizer.hpp" #include "utilities/macros.hpp" -// Size of interpreter code. Increase if too small. Interpreter will -// fail with a guarantee ("not enough space for interpreter generation"); -// if too small. -// Run with +PrintInterpreter to get the VM to print out the size. -// Max size with JVMTI -#ifdef _LP64 - // The sethi() instruction generates lots more instructions when shell - // stack limit is unlimited, so that's why this is much bigger. -int TemplateInterpreter::InterpreterCodeSize = 260 * K; -#else -int TemplateInterpreter::InterpreterCodeSize = 230 * K; -#endif int AbstractInterpreter::BasicType_as_index(BasicType type) { int i = 0; diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp index 82e9bbddf2a..128f6c31171 100644 --- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp @@ -1805,9 +1805,7 @@ void LIR_Assembler::fpop() { void LIR_Assembler::intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr thread, LIR_Opr dest, LIR_Op* op) { switch (code) { - case lir_sin: - case lir_tan: - case lir_cos: { + case lir_tan: { assert(thread->is_valid(), "preserve the thread object for performance reasons"); assert(dest->as_double_reg() == F0, "the result will be in f0/f1"); break; diff --git a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp index 2e4bb6bac7d..fbd0e1ce6b4 100644 --- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp @@ -205,12 +205,7 @@ void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register void C1_MacroAssembler::initialize_body(Register base, Register index) { - assert_different_registers(base, index); - Label loop; - bind(loop); - subcc(index, HeapWordSize, index); - brx(Assembler::greaterEqual, true, Assembler::pt, loop); - delayed()->st_ptr(G0, base, index); + zero_memory(base, index); } @@ -237,7 +232,7 @@ void C1_MacroAssembler::allocate_object( } try_allocate(obj, noreg, obj_size * wordSize, t2, t3, slow_case); - initialize_object(obj, klass, noreg, obj_size * HeapWordSize, t1, t2); + initialize_object(obj, klass, noreg, obj_size * HeapWordSize, t1, t2, /* is_tlab_allocated */ UseTLAB); } void C1_MacroAssembler::initialize_object( @@ -246,7 +241,8 @@ void C1_MacroAssembler::initialize_object( Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise int con_size_in_bytes, // object size in bytes if known at compile time Register t1, // temp register - Register t2 // temp register + Register t2, // temp register + bool is_tlab_allocated // the object was allocated in a TLAB; relevant for the implementation of ZeroTLAB ) { const int hdr_size_in_bytes = instanceOopDesc::header_size() * HeapWordSize; @@ -269,31 +265,33 @@ void C1_MacroAssembler::initialize_object( #endif - // initialize body - const int threshold = 5 * HeapWordSize; // approximate break even point for code size - if (var_size_in_bytes != noreg) { - // use a loop - add(obj, hdr_size_in_bytes, t1); // compute address of first element - sub(var_size_in_bytes, hdr_size_in_bytes, t2); // compute size of body - initialize_body(t1, t2); + if (!(UseTLAB && ZeroTLAB && is_tlab_allocated)) { + // initialize body + const int threshold = 5 * HeapWordSize; // approximate break even point for code size + if (var_size_in_bytes != noreg) { + // use a loop + add(obj, hdr_size_in_bytes, t1); // compute address of first element + sub(var_size_in_bytes, hdr_size_in_bytes, t2); // compute size of body + initialize_body(t1, t2); #ifndef _LP64 - } else if (con_size_in_bytes < threshold * 2) { - // on v9 we can do double word stores to fill twice as much space. - assert(hdr_size_in_bytes % 8 == 0, "double word aligned"); - assert(con_size_in_bytes % 8 == 0, "double word aligned"); - for (int i = hdr_size_in_bytes; i < con_size_in_bytes; i += 2 * HeapWordSize) stx(G0, obj, i); + } else if (con_size_in_bytes < threshold * 2) { + // on v9 we can do double word stores to fill twice as much space. + assert(hdr_size_in_bytes % 8 == 0, "double word aligned"); + assert(con_size_in_bytes % 8 == 0, "double word aligned"); + for (int i = hdr_size_in_bytes; i < con_size_in_bytes; i += 2 * HeapWordSize) stx(G0, obj, i); #endif - } else if (con_size_in_bytes <= threshold) { - // use explicit NULL stores - for (int i = hdr_size_in_bytes; i < con_size_in_bytes; i += HeapWordSize) st_ptr(G0, obj, i); - } else if (con_size_in_bytes > hdr_size_in_bytes) { - // use a loop - const Register base = t1; - const Register index = t2; - add(obj, hdr_size_in_bytes, base); // compute address of first element - // compute index = number of words to clear - set(con_size_in_bytes - hdr_size_in_bytes, index); - initialize_body(base, index); + } else if (con_size_in_bytes <= threshold) { + // use explicit NULL stores + for (int i = hdr_size_in_bytes; i < con_size_in_bytes; i += HeapWordSize) st_ptr(G0, obj, i); + } else if (con_size_in_bytes > hdr_size_in_bytes) { + // use a loop + const Register base = t1; + const Register index = t2; + add(obj, hdr_size_in_bytes, base); // compute address of first element + // compute index = number of words to clear + set(con_size_in_bytes - hdr_size_in_bytes, index); + initialize_body(base, index); + } } if (CURRENT_ENV->dtrace_alloc_probes()) { diff --git a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp index 492ca678d89..695ac7f4d27 100644 --- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp @@ -50,7 +50,8 @@ Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise int con_size_in_bytes, // object size in bytes if known at compile time Register t1, // temp register - Register t2 // temp register + Register t2, // temp register + bool is_tlab_allocated // the object was allocated in a TLAB; relevant for the implementation of ZeroTLAB ); // allocation of fixed-size objects diff --git a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp index 45bfab26f45..283f260886d 100644 --- a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp @@ -435,7 +435,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ tlab_allocate(O0_obj, G1_obj_size, 0, G3_t1, slow_path); - __ initialize_object(O0_obj, G5_klass, G1_obj_size, 0, G3_t1, G4_t2); + __ initialize_object(O0_obj, G5_klass, G1_obj_size, 0, G3_t1, G4_t2, /* is_tlab_allocated */ true); __ verify_oop(O0_obj); __ mov(O0, I0); __ ret(); @@ -447,7 +447,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ eden_allocate(O0_obj, G1_obj_size, 0, G3_t1, G4_t2, slow_path); __ incr_allocated_bytes(G1_obj_size, G3_t1, G4_t2); - __ initialize_object(O0_obj, G5_klass, G1_obj_size, 0, G3_t1, G4_t2); + __ initialize_object(O0_obj, G5_klass, G1_obj_size, 0, G3_t1, G4_t2, /* is_tlab_allocated */ false); __ verify_oop(O0_obj); __ mov(O0, I0); __ ret(); @@ -542,7 +542,9 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ ldub(klass_lh, G3_t1, klass_lh_header_size_offset); __ sub(G1_arr_size, G3_t1, O1_t2); // body length __ add(O0_obj, G3_t1, G3_t1); // body start - __ initialize_body(G3_t1, O1_t2); + if (!ZeroTLAB) { + __ initialize_body(G3_t1, O1_t2); + } __ verify_oop(O0_obj); __ retl(); __ delayed()->nop(); diff --git a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp deleted file mode 100644 index cf22a6c6f2e..00000000000 --- a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "asm/macroAssembler.hpp" -#include "interpreter/bytecodeHistogram.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "interpreter/interp_masm.hpp" -#include "interpreter/templateInterpreterGenerator.hpp" -#include "interpreter/templateTable.hpp" -#include "oops/arrayOop.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "prims/methodHandles.hpp" -#include "runtime/arguments.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/timer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#ifdef COMPILER1 -#include "c1/c1_Runtime1.hpp" -#endif - - - -// Generation of Interpreter -// -// The TemplateInterpreterGenerator generates the interpreter into Interpreter::_code. - - -#define __ _masm-> - - -//---------------------------------------------------------------------------------------------------- - -#ifndef _LP64 -address AbstractInterpreterGenerator::generate_slow_signature_handler() { - address entry = __ pc(); - Argument argv(0, true); - - // We are in the jni transition frame. Save the last_java_frame corresponding to the - // outer interpreter frame - // - __ set_last_Java_frame(FP, noreg); - // make sure the interpreter frame we've pushed has a valid return pc - __ mov(O7, I7); - __ mov(Lmethod, G3_scratch); - __ mov(Llocals, G4_scratch); - __ save_frame(0); - __ mov(G2_thread, L7_thread_cache); - __ add(argv.address_in_frame(), O3); - __ mov(G2_thread, O0); - __ mov(G3_scratch, O1); - __ call(CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), relocInfo::runtime_call_type); - __ delayed()->mov(G4_scratch, O2); - __ mov(L7_thread_cache, G2_thread); - __ reset_last_Java_frame(); - - // load the register arguments (the C code packed them as varargs) - for (Argument ldarg = argv.successor(); ldarg.is_register(); ldarg = ldarg.successor()) { - __ ld_ptr(ldarg.address_in_frame(), ldarg.as_register()); - } - __ ret(); - __ delayed()-> - restore(O0, 0, Lscratch); // caller's Lscratch gets the result handler - return entry; -} - - -#else -// LP64 passes floating point arguments in F1, F3, F5, etc. instead of -// O0, O1, O2 etc.. -// Doubles are passed in D0, D2, D4 -// We store the signature of the first 16 arguments in the first argument -// slot because it will be overwritten prior to calling the native -// function, with the pointer to the JNIEnv. -// If LP64 there can be up to 16 floating point arguments in registers -// or 6 integer registers. -address AbstractInterpreterGenerator::generate_slow_signature_handler() { - - enum { - non_float = 0, - float_sig = 1, - double_sig = 2, - sig_mask = 3 - }; - - address entry = __ pc(); - Argument argv(0, true); - - // We are in the jni transition frame. Save the last_java_frame corresponding to the - // outer interpreter frame - // - __ set_last_Java_frame(FP, noreg); - // make sure the interpreter frame we've pushed has a valid return pc - __ mov(O7, I7); - __ mov(Lmethod, G3_scratch); - __ mov(Llocals, G4_scratch); - __ save_frame(0); - __ mov(G2_thread, L7_thread_cache); - __ add(argv.address_in_frame(), O3); - __ mov(G2_thread, O0); - __ mov(G3_scratch, O1); - __ call(CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), relocInfo::runtime_call_type); - __ delayed()->mov(G4_scratch, O2); - __ mov(L7_thread_cache, G2_thread); - __ reset_last_Java_frame(); - - - // load the register arguments (the C code packed them as varargs) - Address Sig = argv.address_in_frame(); // Argument 0 holds the signature - __ ld_ptr( Sig, G3_scratch ); // Get register argument signature word into G3_scratch - __ mov( G3_scratch, G4_scratch); - __ srl( G4_scratch, 2, G4_scratch); // Skip Arg 0 - Label done; - for (Argument ldarg = argv.successor(); ldarg.is_float_register(); ldarg = ldarg.successor()) { - Label NonFloatArg; - Label LoadFloatArg; - Label LoadDoubleArg; - Label NextArg; - Address a = ldarg.address_in_frame(); - __ andcc(G4_scratch, sig_mask, G3_scratch); - __ br(Assembler::zero, false, Assembler::pt, NonFloatArg); - __ delayed()->nop(); - - __ cmp(G3_scratch, float_sig ); - __ br(Assembler::equal, false, Assembler::pt, LoadFloatArg); - __ delayed()->nop(); - - __ cmp(G3_scratch, double_sig ); - __ br(Assembler::equal, false, Assembler::pt, LoadDoubleArg); - __ delayed()->nop(); - - __ bind(NonFloatArg); - // There are only 6 integer register arguments! - if ( ldarg.is_register() ) - __ ld_ptr(ldarg.address_in_frame(), ldarg.as_register()); - else { - // Optimization, see if there are any more args and get out prior to checking - // all 16 float registers. My guess is that this is rare. - // If is_register is false, then we are done the first six integer args. - __ br_null_short(G4_scratch, Assembler::pt, done); - } - __ ba(NextArg); - __ delayed()->srl( G4_scratch, 2, G4_scratch ); - - __ bind(LoadFloatArg); - __ ldf( FloatRegisterImpl::S, a, ldarg.as_float_register(), 4); - __ ba(NextArg); - __ delayed()->srl( G4_scratch, 2, G4_scratch ); - - __ bind(LoadDoubleArg); - __ ldf( FloatRegisterImpl::D, a, ldarg.as_double_register() ); - __ ba(NextArg); - __ delayed()->srl( G4_scratch, 2, G4_scratch ); - - __ bind(NextArg); - - } - - __ bind(done); - __ ret(); - __ delayed()-> - restore(O0, 0, Lscratch); // caller's Lscratch gets the result handler - return entry; -} -#endif - -void TemplateInterpreterGenerator::generate_counter_overflow(Label& Lcontinue) { - - // Generate code to initiate compilation on the counter overflow. - - // InterpreterRuntime::frequency_counter_overflow takes two arguments, - // the first indicates if the counter overflow occurs at a backwards branch (NULL bcp) - // and the second is only used when the first is true. We pass zero for both. - // The call returns the address of the verified entry point for the method or NULL - // if the compilation did not complete (either went background or bailed out). - __ set((int)false, O2); - __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), O2, O2, true); - // returns verified_entry_point or NULL - // we ignore it in any case - __ ba_short(Lcontinue); - -} - - -// End of helpers - -// Various method entries - -// Abstract method entry -// Attempt to execute abstract method. Throw exception -// -address TemplateInterpreterGenerator::generate_abstract_entry(void) { - address entry = __ pc(); - // abstract method entry - // throw exception - __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); - // the call_VM checks for exception, so we should never return here. - __ should_not_reach_here(); - return entry; - -} diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp index b8b1bbf9ddf..51bc6afa8fe 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -3386,10 +3386,20 @@ void MacroAssembler::tlab_refill(Label& retry, Label& try_eden, Label& slow_case // Retain tlab and allocate object in shared space if // the amount free in the tlab is too large to discard. cmp(t1, t2); - brx(Assembler::lessEqual, false, Assembler::pt, discard_tlab); + brx(Assembler::lessEqual, false, Assembler::pt, discard_tlab); // increment waste limit to prevent getting stuck on this slow path - delayed()->add(t2, ThreadLocalAllocBuffer::refill_waste_limit_increment(), t2); + if (Assembler::is_simm13(ThreadLocalAllocBuffer::refill_waste_limit_increment())) { + delayed()->add(t2, ThreadLocalAllocBuffer::refill_waste_limit_increment(), t2); + } else { + delayed()->nop(); + // set64 does not use the temp register if the given constant is 32 bit. So + // we can just use any register; using G0 results in ignoring of the upper 32 bit + // of that value. + set64(ThreadLocalAllocBuffer::refill_waste_limit_increment(), t3, G0); + add(t2, t3, t2); + } + st_ptr(t2, G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset())); if (TLABStats) { // increment number of slow_allocations @@ -3459,11 +3469,27 @@ void MacroAssembler::tlab_refill(Label& retry, Label& try_eden, Label& slow_case add(top, t1, top); // t1 is tlab_size sub(top, ThreadLocalAllocBuffer::alignment_reserve_in_bytes(), top); st_ptr(top, G2_thread, in_bytes(JavaThread::tlab_end_offset())); + + if (ZeroTLAB) { + // This is a fast TLAB refill, therefore the GC is not notified of it. + // So compiled code must fill the new TLAB with zeroes. + ld_ptr(G2_thread, in_bytes(JavaThread::tlab_start_offset()), t2); + zero_memory(t2, t1); + } verify_tlab(); ba(retry); delayed()->nop(); } +void MacroAssembler::zero_memory(Register base, Register index) { + assert_different_registers(base, index); + Label loop; + bind(loop); + subcc(index, HeapWordSize, index); + brx(Assembler::greaterEqual, true, Assembler::pt, loop); + delayed()->st_ptr(G0, base, index); +} + void MacroAssembler::incr_allocated_bytes(RegisterOrConstant size_in_bytes, Register t1, Register t2) { // Bump total bytes allocated by this thread diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp index eb6188a3b9a..fe0c36ace97 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp @@ -1278,6 +1278,7 @@ public: Label& slow_case // continuation point if fast allocation fails ); void tlab_refill(Label& retry_tlab, Label& try_eden, Label& slow_case); + void zero_memory(Register base, Register index); void incr_allocated_bytes(RegisterOrConstant size_in_bytes, Register t1, Register t2); diff --git a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp index 2c3e3b7c10a..1c5a563a4e3 100644 --- a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp @@ -1748,7 +1748,7 @@ static void save_or_restore_arguments(MacroAssembler* masm, } -// Check GC_locker::needs_gc and enter the runtime if it's true. This +// Check GCLocker::needs_gc and enter the runtime if it's true. This // keeps a new JNI critical region from starting until a GC has been // forced. Save down any oops in registers and describe them in an // OopMap. @@ -1759,9 +1759,9 @@ static void check_needs_gc_for_critical_native(MacroAssembler* masm, OopMapSet* oop_maps, VMRegPair* in_regs, BasicType* in_sig_bt) { - __ block_comment("check GC_locker::needs_gc"); + __ block_comment("check GCLocker::needs_gc"); Label cont; - AddressLiteral sync_state(GC_locker::needs_gc_address()); + AddressLiteral sync_state(GCLocker::needs_gc_address()); __ load_bool_contents(sync_state, G3_scratch); __ cmp_zero_and_br(Assembler::equal, G3_scratch, cont); __ delayed()->nop(); @@ -1936,14 +1936,14 @@ static void gen_special_dispatch(MacroAssembler* masm, // GetPrimtiveArrayCritical and disallow the use of any other JNI // functions. The wrapper is expected to unpack the arguments before // passing them to the callee and perform checks before and after the -// native call to ensure that they GC_locker +// native call to ensure that they GCLocker // lock_critical/unlock_critical semantics are followed. Some other // parts of JNI setup are skipped like the tear down of the JNI handle // block and the check for pending exceptions it's impossible for them // to be thrown. // // They are roughly structured like this: -// if (GC_locker::needs_gc()) +// if (GCLocker::needs_gc()) // SharedRuntime::block_for_jni_critical(); // tranistion to thread_in_native // unpack arrray arguments and call native entry point diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp index b8ac98b61cf..172221ab47b 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,6 +52,18 @@ #endif #undef FAST_DISPATCH +// Size of interpreter code. Increase if too small. Interpreter will +// fail with a guarantee ("not enough space for interpreter generation"); +// if too small. +// Run with +PrintInterpreter to get the VM to print out the size. +// Max size with JVMTI +#ifdef _LP64 + // The sethi() instruction generates lots more instructions when shell + // stack limit is unlimited, so that's why this is much bigger. +int TemplateInterpreter::InterpreterCodeSize = 260 * K; +#else +int TemplateInterpreter::InterpreterCodeSize = 230 * K; +#endif // Generation of Interpreter // @@ -63,6 +75,174 @@ //---------------------------------------------------------------------------------------------------- +#ifndef _LP64 +address TemplateInterpreterGenerator::generate_slow_signature_handler() { + address entry = __ pc(); + Argument argv(0, true); + + // We are in the jni transition frame. Save the last_java_frame corresponding to the + // outer interpreter frame + // + __ set_last_Java_frame(FP, noreg); + // make sure the interpreter frame we've pushed has a valid return pc + __ mov(O7, I7); + __ mov(Lmethod, G3_scratch); + __ mov(Llocals, G4_scratch); + __ save_frame(0); + __ mov(G2_thread, L7_thread_cache); + __ add(argv.address_in_frame(), O3); + __ mov(G2_thread, O0); + __ mov(G3_scratch, O1); + __ call(CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), relocInfo::runtime_call_type); + __ delayed()->mov(G4_scratch, O2); + __ mov(L7_thread_cache, G2_thread); + __ reset_last_Java_frame(); + + // load the register arguments (the C code packed them as varargs) + for (Argument ldarg = argv.successor(); ldarg.is_register(); ldarg = ldarg.successor()) { + __ ld_ptr(ldarg.address_in_frame(), ldarg.as_register()); + } + __ ret(); + __ delayed()-> + restore(O0, 0, Lscratch); // caller's Lscratch gets the result handler + return entry; +} + + +#else +// LP64 passes floating point arguments in F1, F3, F5, etc. instead of +// O0, O1, O2 etc.. +// Doubles are passed in D0, D2, D4 +// We store the signature of the first 16 arguments in the first argument +// slot because it will be overwritten prior to calling the native +// function, with the pointer to the JNIEnv. +// If LP64 there can be up to 16 floating point arguments in registers +// or 6 integer registers. +address TemplateInterpreterGenerator::generate_slow_signature_handler() { + + enum { + non_float = 0, + float_sig = 1, + double_sig = 2, + sig_mask = 3 + }; + + address entry = __ pc(); + Argument argv(0, true); + + // We are in the jni transition frame. Save the last_java_frame corresponding to the + // outer interpreter frame + // + __ set_last_Java_frame(FP, noreg); + // make sure the interpreter frame we've pushed has a valid return pc + __ mov(O7, I7); + __ mov(Lmethod, G3_scratch); + __ mov(Llocals, G4_scratch); + __ save_frame(0); + __ mov(G2_thread, L7_thread_cache); + __ add(argv.address_in_frame(), O3); + __ mov(G2_thread, O0); + __ mov(G3_scratch, O1); + __ call(CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), relocInfo::runtime_call_type); + __ delayed()->mov(G4_scratch, O2); + __ mov(L7_thread_cache, G2_thread); + __ reset_last_Java_frame(); + + + // load the register arguments (the C code packed them as varargs) + Address Sig = argv.address_in_frame(); // Argument 0 holds the signature + __ ld_ptr( Sig, G3_scratch ); // Get register argument signature word into G3_scratch + __ mov( G3_scratch, G4_scratch); + __ srl( G4_scratch, 2, G4_scratch); // Skip Arg 0 + Label done; + for (Argument ldarg = argv.successor(); ldarg.is_float_register(); ldarg = ldarg.successor()) { + Label NonFloatArg; + Label LoadFloatArg; + Label LoadDoubleArg; + Label NextArg; + Address a = ldarg.address_in_frame(); + __ andcc(G4_scratch, sig_mask, G3_scratch); + __ br(Assembler::zero, false, Assembler::pt, NonFloatArg); + __ delayed()->nop(); + + __ cmp(G3_scratch, float_sig ); + __ br(Assembler::equal, false, Assembler::pt, LoadFloatArg); + __ delayed()->nop(); + + __ cmp(G3_scratch, double_sig ); + __ br(Assembler::equal, false, Assembler::pt, LoadDoubleArg); + __ delayed()->nop(); + + __ bind(NonFloatArg); + // There are only 6 integer register arguments! + if ( ldarg.is_register() ) + __ ld_ptr(ldarg.address_in_frame(), ldarg.as_register()); + else { + // Optimization, see if there are any more args and get out prior to checking + // all 16 float registers. My guess is that this is rare. + // If is_register is false, then we are done the first six integer args. + __ br_null_short(G4_scratch, Assembler::pt, done); + } + __ ba(NextArg); + __ delayed()->srl( G4_scratch, 2, G4_scratch ); + + __ bind(LoadFloatArg); + __ ldf( FloatRegisterImpl::S, a, ldarg.as_float_register(), 4); + __ ba(NextArg); + __ delayed()->srl( G4_scratch, 2, G4_scratch ); + + __ bind(LoadDoubleArg); + __ ldf( FloatRegisterImpl::D, a, ldarg.as_double_register() ); + __ ba(NextArg); + __ delayed()->srl( G4_scratch, 2, G4_scratch ); + + __ bind(NextArg); + + } + + __ bind(done); + __ ret(); + __ delayed()-> + restore(O0, 0, Lscratch); // caller's Lscratch gets the result handler + return entry; +} +#endif + +void TemplateInterpreterGenerator::generate_counter_overflow(Label& Lcontinue) { + + // Generate code to initiate compilation on the counter overflow. + + // InterpreterRuntime::frequency_counter_overflow takes two arguments, + // the first indicates if the counter overflow occurs at a backwards branch (NULL bcp) + // and the second is only used when the first is true. We pass zero for both. + // The call returns the address of the verified entry point for the method or NULL + // if the compilation did not complete (either went background or bailed out). + __ set((int)false, O2); + __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), O2, O2, true); + // returns verified_entry_point or NULL + // we ignore it in any case + __ ba_short(Lcontinue); + +} + + +// End of helpers + +// Various method entries + +// Abstract method entry +// Attempt to execute abstract method. Throw exception +// +address TemplateInterpreterGenerator::generate_abstract_entry(void) { + address entry = __ pc(); + // abstract method entry + // throw exception + __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); + // the call_VM checks for exception, so we should never return here. + __ should_not_reach_here(); + return entry; + +} void TemplateInterpreterGenerator::save_native_result(void) { // result potentially in O0/O1: save it across calls @@ -911,6 +1091,31 @@ address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(Abstract address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { return NULL; } + +// TODO: rather than touching all pages, check against stack_overflow_limit and bang yellow page to +// generate exception +void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) { + // Quick & dirty stack overflow checking: bang the stack & handle trap. + // Note that we do the banging after the frame is setup, since the exception + // handling code expects to find a valid interpreter frame on the stack. + // Doing the banging earlier fails if the caller frame is not an interpreter + // frame. + // (Also, the exception throwing code expects to unlock any synchronized + // method receiever, so do the banging after locking the receiver.) + + // Bang each page in the shadow zone. We can't assume it's been done for + // an interpreter frame with greater than a page of locals, so each page + // needs to be checked. Only true for non-native. + if (UseStackBanging) { + const int page_size = os::vm_page_size(); + const int n_shadow_pages = ((int)JavaThread::stack_shadow_zone_size()) / page_size; + const int start_page = native_call ? n_shadow_pages : 1; + for (int pages = start_page; pages <= n_shadow_pages; pages++) { + __ bang_stack_with_offset(pages*page_size); + } + } +} + // // Interpreter stub for calling a native method. (asm interpreter) // This sets up a somewhat different looking stack for calling the native method diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp index 158bb544d9e..a8b1c36159e 100644 --- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -3356,7 +3356,15 @@ void TemplateTable::_new() { __ cmp_and_brx_short(RtlabWasteLimitValue, RfreeValue, Assembler::greaterEqualUnsigned, Assembler::pt, slow_case); // tlab waste is small // increment waste limit to prevent getting stuck on this slow path - __ add(RtlabWasteLimitValue, ThreadLocalAllocBuffer::refill_waste_limit_increment(), RtlabWasteLimitValue); + if (Assembler::is_simm13(ThreadLocalAllocBuffer::refill_waste_limit_increment())) { + __ add(RtlabWasteLimitValue, ThreadLocalAllocBuffer::refill_waste_limit_increment(), RtlabWasteLimitValue); + } else { + // set64 does not use the temp register if the given constant is 32 bit. So + // we can just use any register; using G0 results in ignoring of the upper 32 bit + // of that value. + __ set64(ThreadLocalAllocBuffer::refill_waste_limit_increment(), G4_scratch, G0); + __ add(RtlabWasteLimitValue, G4_scratch, RtlabWasteLimitValue); + } __ st_ptr(RtlabWasteLimitValue, G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset())); } else { // No allocation in the shared eden. diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp b/hotspot/src/cpu/x86/vm/abstractInterpreter_x86.cpp similarity index 95% rename from hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp rename to hotspot/src/cpu/x86/vm/abstractInterpreter_x86.cpp index 0e3cd9927c1..ed991d5c1b8 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp +++ b/hotspot/src/cpu/x86/vm/abstractInterpreter_x86.cpp @@ -27,16 +27,6 @@ #include "interpreter/interpreter.hpp" #include "runtime/frame.inline.hpp" -// Size of interpreter code. Increase if too small. Interpreter will -// fail with a guarantee ("not enough space for interpreter generation"); -// if too small. -// Run with +PrintInterpreter to get the VM to print out the size. -// Max size with JVMTI -#ifdef AMD64 -int TemplateInterpreter::InterpreterCodeSize = 256 * 1024; -#else -int TemplateInterpreter::InterpreterCodeSize = 224 * 1024; -#endif // AMD64 // asm based interpreter deoptimization helpers int AbstractInterpreter::size_activation(int max_stack, diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.cpp b/hotspot/src/cpu/x86/vm/assembler_x86.cpp index 9a7fd0069cf..222d9ba60e2 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp @@ -1891,6 +1891,12 @@ void Assembler::divl(Register src) { // Unsigned emit_int8((unsigned char)(0xF0 | encode)); } +void Assembler::imull(Register src) { + int encode = prefix_and_encode(src->encoding()); + emit_int8((unsigned char)0xF7); + emit_int8((unsigned char)(0xE8 | encode)); +} + void Assembler::imull(Register dst, Register src) { int encode = prefix_and_encode(dst->encoding(), src->encoding()); emit_int8(0x0F); @@ -4112,6 +4118,14 @@ void Assembler::testb(Register dst, int imm8) { emit_arith_b(0xF6, 0xC0, dst, imm8); } +void Assembler::testb(Address dst, int imm8) { + InstructionMark im(this); + prefix(dst); + emit_int8((unsigned char)0xF6); + emit_operand(rax, dst, 1); + emit_int8(imm8); +} + void Assembler::testl(Register dst, int32_t imm32) { // not using emit_arith because test // doesn't support sign-extension of diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.hpp b/hotspot/src/cpu/x86/vm/assembler_x86.hpp index 45ecc01f24a..167f44325fa 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.hpp @@ -1205,6 +1205,7 @@ private: void idivq(Register src); #endif + void imull(Register src); void imull(Register dst, Register src); void imull(Register dst, Register src, int value); void imull(Register dst, Address src); @@ -1727,6 +1728,7 @@ private: void subss(XMMRegister dst, XMMRegister src); void testb(Register dst, int imm8); + void testb(Address dst, int imm8); void testl(Register dst, int32_t imm32); void testl(Register dst, Register src); diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp index 963c1b77df1..fb36620c19b 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @@ -2368,15 +2368,6 @@ void LIR_Assembler::intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr unused, L case lir_log10 : __ flog10() ; break; case lir_abs : __ fabs() ; break; case lir_sqrt : __ fsqrt(); break; - case lir_sin : - // Should consider not saving rbx, if not necessary - __ trigfunc('s', op->as_Op2()->fpu_stack_size()); - break; - case lir_cos : - // Should consider not saving rbx, if not necessary - assert(op->as_Op2()->fpu_stack_size() <= 6, "sin and cos need two free stack slots"); - __ trigfunc('c', op->as_Op2()->fpu_stack_size()); - break; case lir_tan : // Should consider not saving rbx, if not necessary __ trigfunc('t', op->as_Op2()->fpu_stack_size()); diff --git a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp index 63073ac4648..b545d0b6989 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @@ -811,7 +811,8 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { assert(x->number_of_arguments() == 1 || (x->number_of_arguments() == 2 && x->id() == vmIntrinsics::_dpow), "wrong type"); if (x->id() == vmIntrinsics::_dexp || x->id() == vmIntrinsics::_dlog || - x->id() == vmIntrinsics::_dpow) { + x->id() == vmIntrinsics::_dpow || x->id() == vmIntrinsics::_dcos || + x->id() == vmIntrinsics::_dsin) { do_LibmIntrinsic(x); return; } @@ -821,11 +822,10 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { bool use_fpu = false; if (UseSSE >= 2) { switch(x->id()) { - case vmIntrinsics::_dsin: - case vmIntrinsics::_dcos: case vmIntrinsics::_dtan: case vmIntrinsics::_dlog10: use_fpu = true; + break; } } else { value.set_destroys_register(); @@ -870,8 +870,6 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { switch(x->id()) { case vmIntrinsics::_dabs: __ abs (calc_input, calc_result, LIR_OprFact::illegalOpr); break; case vmIntrinsics::_dsqrt: __ sqrt (calc_input, calc_result, LIR_OprFact::illegalOpr); break; - case vmIntrinsics::_dsin: __ sin (calc_input, calc_result, tmp1, tmp2); break; - case vmIntrinsics::_dcos: __ cos (calc_input, calc_result, tmp1, tmp2); break; case vmIntrinsics::_dtan: __ tan (calc_input, calc_result, tmp1, tmp2); break; case vmIntrinsics::_dlog10: __ log10(calc_input, calc_result, tmp1); break; default: ShouldNotReachHere(); @@ -923,19 +921,31 @@ void LIRGenerator::do_LibmIntrinsic(Intrinsic* x) { case vmIntrinsics::_dlog: if (VM_Version::supports_sse2()) { __ call_runtime_leaf(StubRoutines::dlog(), getThreadTemp(), result_reg, cc->args()); - } - else { + } else { __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dlog), getThreadTemp(), result_reg, cc->args()); } break; case vmIntrinsics::_dpow: if (VM_Version::supports_sse2()) { __ call_runtime_leaf(StubRoutines::dpow(), getThreadTemp(), result_reg, cc->args()); - } - else { + } else { __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dpow), getThreadTemp(), result_reg, cc->args()); } break; + case vmIntrinsics::_dsin: + if (VM_Version::supports_sse2() && StubRoutines::dsin() != NULL) { + __ call_runtime_leaf(StubRoutines::dsin(), getThreadTemp(), result_reg, cc->args()); + } else { + __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dsin), getThreadTemp(), result_reg, cc->args()); + } + break; + case vmIntrinsics::_dcos: + if (VM_Version::supports_sse2() && StubRoutines::dcos() != NULL) { + __ call_runtime_leaf(StubRoutines::dcos(), getThreadTemp(), result_reg, cc->args()); + } else { + __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dcos), getThreadTemp(), result_reg, cc->args()); + } + break; default: ShouldNotReachHere(); } #else @@ -949,8 +959,23 @@ void LIRGenerator::do_LibmIntrinsic(Intrinsic* x) { case vmIntrinsics::_dpow: __ call_runtime_leaf(StubRoutines::dpow(), getThreadTemp(), result_reg, cc->args()); break; + case vmIntrinsics::_dsin: + if (StubRoutines::dsin() != NULL) { + __ call_runtime_leaf(StubRoutines::dsin(), getThreadTemp(), result_reg, cc->args()); + } else { + __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dsin), getThreadTemp(), result_reg, cc->args()); + } + break; + case vmIntrinsics::_dcos: + if (StubRoutines::dcos() != NULL) { + __ call_runtime_leaf(StubRoutines::dcos(), getThreadTemp(), result_reg, cc->args()); + } else { + __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dcos), getThreadTemp(), result_reg, cc->args()); + } + break; + default: ShouldNotReachHere(); } -#endif +#endif // _LP64 __ move(result_reg, calc_result); } diff --git a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp index 52924b6e8dc..c3108727fec 100644 --- a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp @@ -811,9 +811,7 @@ void FpuStackAllocator::handle_op2(LIR_Op2* op2) { } - case lir_tan: - case lir_sin: - case lir_cos: { + case lir_tan: { // sin, cos and exp need two temporary fpu stack slots, so there are two temporary // registers (stored in right and temp of the operation). // the stack allocator must guarantee that the stack slots are really free, diff --git a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.hpp b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.hpp index 3902d974bc0..a5e533696b2 100644 --- a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.hpp @@ -67,9 +67,7 @@ inline bool LinearScan::is_caller_save(int assigned_reg) { inline void LinearScan::pd_add_temps(LIR_Op* op) { switch (op->code()) { - case lir_tan: - case lir_sin: - case lir_cos: { + case lir_tan: { // The slow path for these functions may need to save and // restore all live registers but we don't want to save and // restore everything all the time, so mark the xmms as being diff --git a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp index 76d160ac113..24cdaa46024 100644 --- a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp @@ -182,54 +182,13 @@ void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register // preserves obj, destroys len_in_bytes void C1_MacroAssembler::initialize_body(Register obj, Register len_in_bytes, int hdr_size_in_bytes, Register t1) { + assert(hdr_size_in_bytes >= 0, "header size must be positive or 0"); Label done; - assert(obj != len_in_bytes && obj != t1 && t1 != len_in_bytes, "registers must be different"); - assert((hdr_size_in_bytes & (BytesPerWord - 1)) == 0, "header size is not a multiple of BytesPerWord"); - Register index = len_in_bytes; - // index is positive and ptr sized - subptr(index, hdr_size_in_bytes); - jcc(Assembler::zero, done); - // initialize topmost word, divide index by 2, check if odd and test if zero - // note: for the remaining code to work, index must be a multiple of BytesPerWord -#ifdef ASSERT - { Label L; - testptr(index, BytesPerWord - 1); - jcc(Assembler::zero, L); - stop("index is not a multiple of BytesPerWord"); - bind(L); - } -#endif - xorptr(t1, t1); // use _zero reg to clear memory (shorter code) - if (UseIncDec) { - shrptr(index, 3); // divide by 8/16 and set carry flag if bit 2 was set - } else { - shrptr(index, 2); // use 2 instructions to avoid partial flag stall - shrptr(index, 1); - } -#ifndef _LP64 - // index could have been not a multiple of 8 (i.e., bit 2 was set) - { Label even; - // note: if index was a multiple of 8, than it cannot - // be 0 now otherwise it must have been 0 before - // => if it is even, we don't need to check for 0 again - jcc(Assembler::carryClear, even); - // clear topmost word (no jump needed if conditional assignment would work here) - movptr(Address(obj, index, Address::times_8, hdr_size_in_bytes - 0*BytesPerWord), t1); - // index could be 0 now, need to check again - jcc(Assembler::zero, done); - bind(even); - } -#endif // !_LP64 - // initialize remaining object fields: rdx is a multiple of 2 now - { Label loop; - bind(loop); - movptr(Address(obj, index, Address::times_8, hdr_size_in_bytes - 1*BytesPerWord), t1); - NOT_LP64(movptr(Address(obj, index, Address::times_8, hdr_size_in_bytes - 2*BytesPerWord), t1);) - decrement(index); - jcc(Assembler::notZero, loop); - } - // done + // len_in_bytes is positive and ptr sized + subptr(len_in_bytes, hdr_size_in_bytes); + jcc(Assembler::zero, done); + zero_memory(obj, len_in_bytes, hdr_size_in_bytes, t1); bind(done); } @@ -241,47 +200,49 @@ void C1_MacroAssembler::allocate_object(Register obj, Register t1, Register t2, try_allocate(obj, noreg, object_size * BytesPerWord, t1, t2, slow_case); - initialize_object(obj, klass, noreg, object_size * HeapWordSize, t1, t2); + initialize_object(obj, klass, noreg, object_size * HeapWordSize, t1, t2, UseTLAB); } -void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register var_size_in_bytes, int con_size_in_bytes, Register t1, Register t2) { +void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register var_size_in_bytes, int con_size_in_bytes, Register t1, Register t2, bool is_tlab_allocated) { assert((con_size_in_bytes & MinObjAlignmentInBytesMask) == 0, "con_size_in_bytes is not multiple of alignment"); const int hdr_size_in_bytes = instanceOopDesc::header_size() * HeapWordSize; initialize_header(obj, klass, noreg, t1, t2); - // clear rest of allocated space - const Register t1_zero = t1; - const Register index = t2; - const int threshold = 6 * BytesPerWord; // approximate break even point for code size (see comments below) - if (var_size_in_bytes != noreg) { - mov(index, var_size_in_bytes); - initialize_body(obj, index, hdr_size_in_bytes, t1_zero); - } else if (con_size_in_bytes <= threshold) { - // use explicit null stores - // code size = 2 + 3*n bytes (n = number of fields to clear) - xorptr(t1_zero, t1_zero); // use t1_zero reg to clear memory (shorter code) - for (int i = hdr_size_in_bytes; i < con_size_in_bytes; i += BytesPerWord) - movptr(Address(obj, i), t1_zero); - } else if (con_size_in_bytes > hdr_size_in_bytes) { - // use loop to null out the fields - // code size = 16 bytes for even n (n = number of fields to clear) - // initialize last object field first if odd number of fields - xorptr(t1_zero, t1_zero); // use t1_zero reg to clear memory (shorter code) - movptr(index, (con_size_in_bytes - hdr_size_in_bytes) >> 3); - // initialize last object field if constant size is odd - if (((con_size_in_bytes - hdr_size_in_bytes) & 4) != 0) - movptr(Address(obj, con_size_in_bytes - (1*BytesPerWord)), t1_zero); - // initialize remaining object fields: rdx is a multiple of 2 - { Label loop; - bind(loop); - movptr(Address(obj, index, Address::times_8, hdr_size_in_bytes - (1*BytesPerWord)), - t1_zero); - NOT_LP64(movptr(Address(obj, index, Address::times_8, hdr_size_in_bytes - (2*BytesPerWord)), - t1_zero);) - decrement(index); - jcc(Assembler::notZero, loop); + if (!(UseTLAB && ZeroTLAB && is_tlab_allocated)) { + // clear rest of allocated space + const Register t1_zero = t1; + const Register index = t2; + const int threshold = 6 * BytesPerWord; // approximate break even point for code size (see comments below) + if (var_size_in_bytes != noreg) { + mov(index, var_size_in_bytes); + initialize_body(obj, index, hdr_size_in_bytes, t1_zero); + } else if (con_size_in_bytes <= threshold) { + // use explicit null stores + // code size = 2 + 3*n bytes (n = number of fields to clear) + xorptr(t1_zero, t1_zero); // use t1_zero reg to clear memory (shorter code) + for (int i = hdr_size_in_bytes; i < con_size_in_bytes; i += BytesPerWord) + movptr(Address(obj, i), t1_zero); + } else if (con_size_in_bytes > hdr_size_in_bytes) { + // use loop to null out the fields + // code size = 16 bytes for even n (n = number of fields to clear) + // initialize last object field first if odd number of fields + xorptr(t1_zero, t1_zero); // use t1_zero reg to clear memory (shorter code) + movptr(index, (con_size_in_bytes - hdr_size_in_bytes) >> 3); + // initialize last object field if constant size is odd + if (((con_size_in_bytes - hdr_size_in_bytes) & 4) != 0) + movptr(Address(obj, con_size_in_bytes - (1*BytesPerWord)), t1_zero); + // initialize remaining object fields: rdx is a multiple of 2 + { Label loop; + bind(loop); + movptr(Address(obj, index, Address::times_8, hdr_size_in_bytes - (1*BytesPerWord)), + t1_zero); + NOT_LP64(movptr(Address(obj, index, Address::times_8, hdr_size_in_bytes - (2*BytesPerWord)), + t1_zero);) + decrement(index); + jcc(Assembler::notZero, loop); + } } } diff --git a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.hpp index 5695dad2251..829db55b196 100644 --- a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.hpp @@ -65,7 +65,8 @@ Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise int con_size_in_bytes, // object size in bytes if known at compile time Register t1, // temp register - Register t2 // temp register + Register t2, // temp register + bool is_tlab_allocated // the object was allocated in a TLAB; relevant for the implementation of ZeroTLAB ); // allocation of fixed-size objects diff --git a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp index c977465cfc5..1d057e20adf 100644 --- a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp @@ -1040,7 +1040,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ tlab_allocate(obj, obj_size, 0, t1, t2, slow_path); - __ initialize_object(obj, klass, obj_size, 0, t1, t2); + __ initialize_object(obj, klass, obj_size, 0, t1, t2, /* is_tlab_allocated */ true); __ verify_oop(obj); __ pop(rbx); __ pop(rdi); @@ -1053,7 +1053,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ eden_allocate(obj, obj_size, 0, t1, slow_path); __ incr_allocated_bytes(thread, obj_size, 0); - __ initialize_object(obj, klass, obj_size, 0, t1, t2); + __ initialize_object(obj, klass, obj_size, 0, t1, t2, /* is_tlab_allocated */ false); __ verify_oop(obj); __ pop(rbx); __ pop(rdi); @@ -1169,7 +1169,9 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ andptr(t1, Klass::_lh_header_size_mask); __ subptr(arr_size, t1); // body length __ addptr(t1, obj); // body start - __ initialize_body(t1, arr_size, 0, t2); + if (!ZeroTLAB) { + __ initialize_body(t1, arr_size, 0, t2); + } __ verify_oop(obj); __ ret(0); diff --git a/hotspot/src/cpu/x86/vm/globals_x86.hpp b/hotspot/src/cpu/x86/vm/globals_x86.hpp index 57dc051ab5f..1596645f00c 100644 --- a/hotspot/src/cpu/x86/vm/globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, 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 @@ -184,9 +184,18 @@ define_pd_global(bool, PreserveFramePointer, false); product(bool, UseCountTrailingZerosInstruction, false, \ "Use count trailing zeros instruction") \ \ + product(bool, UseSSE42Intrinsics, false, \ + "SSE4.2 versions of intrinsics") \ + \ product(bool, UseBMI1Instructions, false, \ "Use BMI1 instructions") \ \ product(bool, UseBMI2Instructions, false, \ - "Use BMI2 instructions") + "Use BMI2 instructions") \ + \ + diagnostic(bool, UseLibmSinIntrinsic, true, \ + "Use Libm Sin Intrinsic") \ + \ + diagnostic(bool, UseLibmCosIntrinsic, true, \ + "Use Libm Cos Intrinsic") #endif // CPU_X86_VM_GLOBALS_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.cpp deleted file mode 100644 index c91580ae124..00000000000 --- a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "asm/macroAssembler.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "interpreter/interp_masm.hpp" -#include "interpreter/templateInterpreterGenerator.hpp" - -#define __ _masm-> - -// Abstract method entry -// Attempt to execute abstract method. Throw exception -address TemplateInterpreterGenerator::generate_abstract_entry(void) { - - address entry_point = __ pc(); - - // abstract method entry - - // pop return address, reset last_sp to NULL - __ empty_expression_stack(); - __ restore_bcp(); // rsi must be correct for exception handler (was destroyed) - __ restore_locals(); // make sure locals pointer is correct as well (was destroyed) - - // throw exception - __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); - // the call_VM checks for exception, so we should never return here. - __ should_not_reach_here(); - - return entry_point; -} diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp deleted file mode 100644 index 872abcc2b99..00000000000 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "asm/macroAssembler.hpp" -#include "interpreter/bytecodeHistogram.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "interpreter/interp_masm.hpp" -#include "interpreter/templateInterpreterGenerator.hpp" -#include "interpreter/templateTable.hpp" -#include "oops/arrayOop.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "prims/methodHandles.hpp" -#include "runtime/arguments.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/timer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#ifdef COMPILER1 -#include "c1/c1_Runtime1.hpp" -#endif - -#define __ _masm-> - -//------------------------------------------------------------------------------------------------------------------------ - -address AbstractInterpreterGenerator::generate_slow_signature_handler() { - address entry = __ pc(); - // rbx,: method - // rcx: temporary - // rdi: pointer to locals - // rsp: end of copied parameters area - __ mov(rcx, rsp); - __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), rbx, rdi, rcx); - __ ret(0); - return entry; -} - - -address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { - - // rbx,: Method* - // rcx: scratrch - // rsi: sender sp - - if (!InlineIntrinsics) return NULL; // Generate a vanilla entry - - address entry_point = __ pc(); - - // These don't need a safepoint check because they aren't virtually - // callable. We won't enter these intrinsics from compiled code. - // If in the future we added an intrinsic which was virtually callable - // we'd have to worry about how to safepoint so that this code is used. - - // mathematical functions inlined by compiler - // (interpreter must provide identical implementation - // in order to avoid monotonicity bugs when switching - // from interpreter to compiler in the middle of some - // computation) - // - // stack: [ ret adr ] <-- rsp - // [ lo(arg) ] - // [ hi(arg) ] - // - - // Note: For JDK 1.2 StrictMath doesn't exist and Math.sin/cos/sqrt are - // native methods. Interpreter::method_kind(...) does a check for - // native methods first before checking for intrinsic methods and - // thus will never select this entry point. Make sure it is not - // called accidentally since the SharedRuntime entry points will - // not work for JDK 1.2. - // - // We no longer need to check for JDK 1.2 since it's EOL'ed. - // The following check existed in pre 1.6 implementation, - // if (Universe::is_jdk12x_version()) { - // __ should_not_reach_here(); - // } - // Universe::is_jdk12x_version() always returns false since - // the JDK version is not yet determined when this method is called. - // This method is called during interpreter_init() whereas - // JDK version is only determined when universe2_init() is called. - - // Note: For JDK 1.3 StrictMath exists and Math.sin/cos/sqrt are - // java methods. Interpreter::method_kind(...) will select - // this entry point for the corresponding methods in JDK 1.3. - // get argument - __ fld_d(Address(rsp, 1*wordSize)); - switch (kind) { - case Interpreter::java_lang_math_sin : - __ trigfunc('s'); - break; - case Interpreter::java_lang_math_cos : - __ trigfunc('c'); - break; - case Interpreter::java_lang_math_tan : - __ trigfunc('t'); - break; - case Interpreter::java_lang_math_sqrt: - __ fsqrt(); - break; - case Interpreter::java_lang_math_abs: - __ fabs(); - break; - case Interpreter::java_lang_math_log: - __ subptr(rsp, 2 * wordSize); - __ fstp_d(Address(rsp, 0)); - if (VM_Version::supports_sse2()) { - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog()))); - } - else { - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dlog))); - } - __ addptr(rsp, 2 * wordSize); - break; - case Interpreter::java_lang_math_log10: - __ flog10(); - // Store to stack to convert 80bit precision back to 64bits - __ push_fTOS(); - __ pop_fTOS(); - break; - case Interpreter::java_lang_math_pow: - __ fld_d(Address(rsp, 3*wordSize)); // second argument - __ subptr(rsp, 4 * wordSize); - __ fstp_d(Address(rsp, 0)); - __ fstp_d(Address(rsp, 2 * wordSize)); - if (VM_Version::supports_sse2()) { - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dpow()))); - } else { - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dpow))); - } - __ addptr(rsp, 4 * wordSize); - break; - case Interpreter::java_lang_math_exp: - __ subptr(rsp, 2*wordSize); - __ fstp_d(Address(rsp, 0)); - if (VM_Version::supports_sse2()) { - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dexp()))); - } else { - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dexp))); - } - __ addptr(rsp, 2*wordSize); - break; - default : - ShouldNotReachHere(); - } - - // return double result in xmm0 for interpreter and compilers. - if (UseSSE >= 2) { - __ subptr(rsp, 2*wordSize); - __ fstp_d(Address(rsp, 0)); - __ movdbl(xmm0, Address(rsp, 0)); - __ addptr(rsp, 2*wordSize); - } - - // done, result in FPU ST(0) or XMM0 - __ pop(rdi); // get return address - __ mov(rsp, rsi); // set sp to sender sp - __ jmp(rdi); - - return entry_point; -} diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp deleted file mode 100644 index ed2a8c13240..00000000000 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "asm/macroAssembler.hpp" -#include "interpreter/bytecodeHistogram.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "interpreter/interp_masm.hpp" -#include "interpreter/templateInterpreterGenerator.hpp" -#include "interpreter/templateTable.hpp" -#include "oops/arrayOop.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "prims/methodHandles.hpp" -#include "runtime/arguments.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/timer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#ifdef COMPILER1 -#include "c1/c1_Runtime1.hpp" -#endif - -#define __ _masm-> - -#ifdef _WIN64 -address AbstractInterpreterGenerator::generate_slow_signature_handler() { - address entry = __ pc(); - - // rbx: method - // r14: pointer to locals - // c_rarg3: first stack arg - wordSize - __ mov(c_rarg3, rsp); - // adjust rsp - __ subptr(rsp, 4 * wordSize); - __ call_VM(noreg, - CAST_FROM_FN_PTR(address, - InterpreterRuntime::slow_signature_handler), - rbx, r14, c_rarg3); - - // rax: result handler - - // Stack layout: - // rsp: 3 integer or float args (if static first is unused) - // 1 float/double identifiers - // return address - // stack args - // garbage - // expression stack bottom - // bcp (NULL) - // ... - - // Do FP first so we can use c_rarg3 as temp - __ movl(c_rarg3, Address(rsp, 3 * wordSize)); // float/double identifiers - - for ( int i= 0; i < Argument::n_int_register_parameters_c-1; i++ ) { - XMMRegister floatreg = as_XMMRegister(i+1); - Label isfloatordouble, isdouble, next; - - __ testl(c_rarg3, 1 << (i*2)); // Float or Double? - __ jcc(Assembler::notZero, isfloatordouble); - - // Do Int register here - switch ( i ) { - case 0: - __ movl(rscratch1, Address(rbx, Method::access_flags_offset())); - __ testl(rscratch1, JVM_ACC_STATIC); - __ cmovptr(Assembler::zero, c_rarg1, Address(rsp, 0)); - break; - case 1: - __ movptr(c_rarg2, Address(rsp, wordSize)); - break; - case 2: - __ movptr(c_rarg3, Address(rsp, 2 * wordSize)); - break; - default: - break; - } - - __ jmp (next); - - __ bind(isfloatordouble); - __ testl(c_rarg3, 1 << ((i*2)+1)); // Double? - __ jcc(Assembler::notZero, isdouble); - -// Do Float Here - __ movflt(floatreg, Address(rsp, i * wordSize)); - __ jmp(next); - -// Do Double here - __ bind(isdouble); - __ movdbl(floatreg, Address(rsp, i * wordSize)); - - __ bind(next); - } - - - // restore rsp - __ addptr(rsp, 4 * wordSize); - - __ ret(0); - - return entry; -} -#else -address AbstractInterpreterGenerator::generate_slow_signature_handler() { - address entry = __ pc(); - - // rbx: method - // r14: pointer to locals - // c_rarg3: first stack arg - wordSize - __ mov(c_rarg3, rsp); - // adjust rsp - __ subptr(rsp, 14 * wordSize); - __ call_VM(noreg, - CAST_FROM_FN_PTR(address, - InterpreterRuntime::slow_signature_handler), - rbx, r14, c_rarg3); - - // rax: result handler - - // Stack layout: - // rsp: 5 integer args (if static first is unused) - // 1 float/double identifiers - // 8 double args - // return address - // stack args - // garbage - // expression stack bottom - // bcp (NULL) - // ... - - // Do FP first so we can use c_rarg3 as temp - __ movl(c_rarg3, Address(rsp, 5 * wordSize)); // float/double identifiers - - for (int i = 0; i < Argument::n_float_register_parameters_c; i++) { - const XMMRegister r = as_XMMRegister(i); - - Label d, done; - - __ testl(c_rarg3, 1 << i); - __ jcc(Assembler::notZero, d); - __ movflt(r, Address(rsp, (6 + i) * wordSize)); - __ jmp(done); - __ bind(d); - __ movdbl(r, Address(rsp, (6 + i) * wordSize)); - __ bind(done); - } - - // Now handle integrals. Only do c_rarg1 if not static. - __ movl(c_rarg3, Address(rbx, Method::access_flags_offset())); - __ testl(c_rarg3, JVM_ACC_STATIC); - __ cmovptr(Assembler::zero, c_rarg1, Address(rsp, 0)); - - __ movptr(c_rarg2, Address(rsp, wordSize)); - __ movptr(c_rarg3, Address(rsp, 2 * wordSize)); - __ movptr(c_rarg4, Address(rsp, 3 * wordSize)); - __ movptr(c_rarg5, Address(rsp, 4 * wordSize)); - - // restore rsp - __ addptr(rsp, 14 * wordSize); - - __ ret(0); - - return entry; -} -#endif - - -// -// Various method entries -// - -address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { - - // rbx,: Method* - // rcx: scratrch - // r13: sender sp - - if (!InlineIntrinsics) return NULL; // Generate a vanilla entry - - address entry_point = __ pc(); - - // These don't need a safepoint check because they aren't virtually - // callable. We won't enter these intrinsics from compiled code. - // If in the future we added an intrinsic which was virtually callable - // we'd have to worry about how to safepoint so that this code is used. - - // mathematical functions inlined by compiler - // (interpreter must provide identical implementation - // in order to avoid monotonicity bugs when switching - // from interpreter to compiler in the middle of some - // computation) - // - // stack: [ ret adr ] <-- rsp - // [ lo(arg) ] - // [ hi(arg) ] - // - - // Note: For JDK 1.2 StrictMath doesn't exist and Math.sin/cos/sqrt are - // native methods. Interpreter::method_kind(...) does a check for - // native methods first before checking for intrinsic methods and - // thus will never select this entry point. Make sure it is not - // called accidentally since the SharedRuntime entry points will - // not work for JDK 1.2. - // - // We no longer need to check for JDK 1.2 since it's EOL'ed. - // The following check existed in pre 1.6 implementation, - // if (Universe::is_jdk12x_version()) { - // __ should_not_reach_here(); - // } - // Universe::is_jdk12x_version() always returns false since - // the JDK version is not yet determined when this method is called. - // This method is called during interpreter_init() whereas - // JDK version is only determined when universe2_init() is called. - - // Note: For JDK 1.3 StrictMath exists and Math.sin/cos/sqrt are - // java methods. Interpreter::method_kind(...) will select - // this entry point for the corresponding methods in JDK 1.3. - // get argument - - if (kind == Interpreter::java_lang_math_sqrt) { - __ sqrtsd(xmm0, Address(rsp, wordSize)); - } else if (kind == Interpreter::java_lang_math_exp) { - __ movdbl(xmm0, Address(rsp, wordSize)); - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dexp()))); - } else if (kind == Interpreter::java_lang_math_log) { - __ movdbl(xmm0, Address(rsp, wordSize)); - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog()))); - } else if (kind == Interpreter::java_lang_math_pow) { - __ movdbl(xmm1, Address(rsp, wordSize)); - __ movdbl(xmm0, Address(rsp, 3 * wordSize)); - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dpow()))); - } else { - __ fld_d(Address(rsp, wordSize)); - switch (kind) { - case Interpreter::java_lang_math_sin : - __ trigfunc('s'); - break; - case Interpreter::java_lang_math_cos : - __ trigfunc('c'); - break; - case Interpreter::java_lang_math_tan : - __ trigfunc('t'); - break; - case Interpreter::java_lang_math_abs: - __ fabs(); - break; - case Interpreter::java_lang_math_log10: - __ flog10(); - break; - default : - ShouldNotReachHere(); - } - - // return double result in xmm0 for interpreter and compilers. - __ subptr(rsp, 2*wordSize); - // Round to 64bit precision - __ fstp_d(Address(rsp, 0)); - __ movdbl(xmm0, Address(rsp, 0)); - __ addptr(rsp, 2*wordSize); - } - - - __ pop(rax); - __ mov(rsp, r13); - __ jmp(rax); - - return entry_point; -} diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_libm_x86_32.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_libm_x86_32.cpp new file mode 100644 index 00000000000..923e8fc39b5 --- /dev/null +++ b/hotspot/src/cpu/x86/vm/macroAssembler_libm_x86_32.cpp @@ -0,0 +1,4571 @@ +/* + * Copyright (c) 2015, Intel Corporation. + * Intel Math Library (LIBM) Source Code + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "asm/assembler.inline.hpp" +#include "runtime/stubRoutines.hpp" +#include "macroAssembler_x86.hpp" + +#ifdef _MSC_VER +#define ALIGNED_(x) __declspec(align(x)) +#else +#define ALIGNED_(x) __attribute__ ((aligned(x))) +#endif + +// The 32 bit code is at most SSE2 compliant + +/******************************************************************************/ +// ALGORITHM DESCRIPTION - EXP() +// --------------------- +// +// Description: +// Let K = 64 (table size). +// x x/log(2) n +// e = 2 = 2 * T[j] * (1 + P(y)) +// where +// x = m*log(2)/K + y, y in [-log(2)/K..log(2)/K] +// m = n*K + j, m,n,j - signed integer, j in [-K/2..K/2] +// j/K +// values of 2 are tabulated as T[j] = T_hi[j] ( 1 + T_lo[j]). +// +// P(y) is a minimax polynomial approximation of exp(x)-1 +// on small interval [-log(2)/K..log(2)/K] (were calculated by Maple V). +// +// To avoid problems with arithmetic overflow and underflow, +// n n1 n2 +// value of 2 is safely computed as 2 * 2 where n1 in [-BIAS/2..BIAS/2] +// where BIAS is a value of exponent bias. +// +// Special cases: +// exp(NaN) = NaN +// exp(+INF) = +INF +// exp(-INF) = 0 +// exp(x) = 1 for subnormals +// for finite argument, only exp(0)=1 is exact +// For IEEE double +// if x > 709.782712893383973096 then exp(x) overflow +// if x < -745.133219101941108420 then exp(x) underflow +// +/******************************************************************************/ + +ALIGNED_(16) juint _static_const_table[] = +{ + 0x00000000UL, 0xfff00000UL, 0x00000000UL, 0xfff00000UL, 0xffffffc0UL, + 0x00000000UL, 0xffffffc0UL, 0x00000000UL, 0x0000ffc0UL, 0x00000000UL, + 0x0000ffc0UL, 0x00000000UL, 0x00000000UL, 0x43380000UL, 0x00000000UL, + 0x43380000UL, 0x652b82feUL, 0x40571547UL, 0x652b82feUL, 0x40571547UL, + 0xfefa0000UL, 0x3f862e42UL, 0xfefa0000UL, 0x3f862e42UL, 0xbc9e3b3aUL, + 0x3d1cf79aUL, 0xbc9e3b3aUL, 0x3d1cf79aUL, 0xfffffffeUL, 0x3fdfffffUL, + 0xfffffffeUL, 0x3fdfffffUL, 0xe3289860UL, 0x3f56c15cUL, 0x555b9e25UL, + 0x3fa55555UL, 0xc090cf0fUL, 0x3f811115UL, 0x55548ba1UL, 0x3fc55555UL, + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x0e03754dUL, + 0x3cad7bbfUL, 0x3e778060UL, 0x00002c9aUL, 0x3567f613UL, 0x3c8cd252UL, + 0xd3158574UL, 0x000059b0UL, 0x61e6c861UL, 0x3c60f74eUL, 0x18759bc8UL, + 0x00008745UL, 0x5d837b6cUL, 0x3c979aa6UL, 0x6cf9890fUL, 0x0000b558UL, + 0x702f9cd1UL, 0x3c3ebe3dUL, 0x32d3d1a2UL, 0x0000e3ecUL, 0x1e63bcd8UL, + 0x3ca3516eUL, 0xd0125b50UL, 0x00011301UL, 0x26f0387bUL, 0x3ca4c554UL, + 0xaea92ddfUL, 0x0001429aUL, 0x62523fb6UL, 0x3ca95153UL, 0x3c7d517aUL, + 0x000172b8UL, 0x3f1353bfUL, 0x3c8b898cUL, 0xeb6fcb75UL, 0x0001a35bUL, + 0x3e3a2f5fUL, 0x3c9aecf7UL, 0x3168b9aaUL, 0x0001d487UL, 0x44a6c38dUL, + 0x3c8a6f41UL, 0x88628cd6UL, 0x0002063bUL, 0xe3a8a894UL, 0x3c968efdUL, + 0x6e756238UL, 0x0002387aUL, 0x981fe7f2UL, 0x3c80472bUL, 0x65e27cddUL, + 0x00026b45UL, 0x6d09ab31UL, 0x3c82f7e1UL, 0xf51fdee1UL, 0x00029e9dUL, + 0x720c0ab3UL, 0x3c8b3782UL, 0xa6e4030bUL, 0x0002d285UL, 0x4db0abb6UL, + 0x3c834d75UL, 0x0a31b715UL, 0x000306feUL, 0x5dd3f84aUL, 0x3c8fdd39UL, + 0xb26416ffUL, 0x00033c08UL, 0xcc187d29UL, 0x3ca12f8cUL, 0x373aa9caUL, + 0x000371a7UL, 0x738b5e8bUL, 0x3ca7d229UL, 0x34e59ff6UL, 0x0003a7dbUL, + 0xa72a4c6dUL, 0x3c859f48UL, 0x4c123422UL, 0x0003dea6UL, 0x259d9205UL, + 0x3ca8b846UL, 0x21f72e29UL, 0x0004160aUL, 0x60c2ac12UL, 0x3c4363edUL, + 0x6061892dUL, 0x00044e08UL, 0xdaa10379UL, 0x3c6ecce1UL, 0xb5c13cd0UL, + 0x000486a2UL, 0xbb7aafb0UL, 0x3c7690ceUL, 0xd5362a27UL, 0x0004bfdaUL, + 0x9b282a09UL, 0x3ca083ccUL, 0x769d2ca6UL, 0x0004f9b2UL, 0xc1aae707UL, + 0x3ca509b0UL, 0x569d4f81UL, 0x0005342bUL, 0x18fdd78eUL, 0x3c933505UL, + 0x36b527daUL, 0x00056f47UL, 0xe21c5409UL, 0x3c9063e1UL, 0xdd485429UL, + 0x0005ab07UL, 0x2b64c035UL, 0x3c9432e6UL, 0x15ad2148UL, 0x0005e76fUL, + 0x99f08c0aUL, 0x3ca01284UL, 0xb03a5584UL, 0x0006247eUL, 0x0073dc06UL, + 0x3c99f087UL, 0x82552224UL, 0x00066238UL, 0x0da05571UL, 0x3c998d4dUL, + 0x667f3bccUL, 0x0006a09eUL, 0x86ce4786UL, 0x3ca52bb9UL, 0x3c651a2eUL, + 0x0006dfb2UL, 0x206f0dabUL, 0x3ca32092UL, 0xe8ec5f73UL, 0x00071f75UL, + 0x8e17a7a6UL, 0x3ca06122UL, 0x564267c8UL, 0x00075febUL, 0x461e9f86UL, + 0x3ca244acUL, 0x73eb0186UL, 0x0007a114UL, 0xabd66c55UL, 0x3c65ebe1UL, + 0x36cf4e62UL, 0x0007e2f3UL, 0xbbff67d0UL, 0x3c96fe9fUL, 0x994cce12UL, + 0x00082589UL, 0x14c801dfUL, 0x3c951f14UL, 0x9b4492ecUL, 0x000868d9UL, + 0xc1f0eab4UL, 0x3c8db72fUL, 0x422aa0dbUL, 0x0008ace5UL, 0x59f35f44UL, + 0x3c7bf683UL, 0x99157736UL, 0x0008f1aeUL, 0x9c06283cUL, 0x3ca360baUL, + 0xb0cdc5e4UL, 0x00093737UL, 0x20f962aaUL, 0x3c95e8d1UL, 0x9fde4e4fUL, + 0x00097d82UL, 0x2b91ce27UL, 0x3c71affcUL, 0x82a3f090UL, 0x0009c491UL, + 0x589a2ebdUL, 0x3c9b6d34UL, 0x7b5de564UL, 0x000a0c66UL, 0x9ab89880UL, + 0x3c95277cUL, 0xb23e255cUL, 0x000a5503UL, 0x6e735ab3UL, 0x3c846984UL, + 0x5579fdbfUL, 0x000a9e6bUL, 0x92cb3387UL, 0x3c8c1a77UL, 0x995ad3adUL, + 0x000ae89fUL, 0xdc2d1d96UL, 0x3ca22466UL, 0xb84f15faUL, 0x000b33a2UL, + 0xb19505aeUL, 0x3ca1112eUL, 0xf2fb5e46UL, 0x000b7f76UL, 0x0a5fddcdUL, + 0x3c74ffd7UL, 0x904bc1d2UL, 0x000bcc1eUL, 0x30af0cb3UL, 0x3c736eaeUL, + 0xdd85529cUL, 0x000c199bUL, 0xd10959acUL, 0x3c84e08fUL, 0x2e57d14bUL, + 0x000c67f1UL, 0x6c921968UL, 0x3c676b2cUL, 0xdcef9069UL, 0x000cb720UL, + 0x36df99b3UL, 0x3c937009UL, 0x4a07897bUL, 0x000d072dUL, 0xa63d07a7UL, + 0x3c74a385UL, 0xdcfba487UL, 0x000d5818UL, 0xd5c192acUL, 0x3c8e5a50UL, + 0x03db3285UL, 0x000da9e6UL, 0x1c4a9792UL, 0x3c98bb73UL, 0x337b9b5eUL, + 0x000dfc97UL, 0x603a88d3UL, 0x3c74b604UL, 0xe78b3ff6UL, 0x000e502eUL, + 0x92094926UL, 0x3c916f27UL, 0xa2a490d9UL, 0x000ea4afUL, 0x41aa2008UL, + 0x3c8ec3bcUL, 0xee615a27UL, 0x000efa1bUL, 0x31d185eeUL, 0x3c8a64a9UL, + 0x5b6e4540UL, 0x000f5076UL, 0x4d91cd9dUL, 0x3c77893bUL, 0x819e90d8UL, + 0x000fa7c1UL, 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x7ff00000UL, + 0x00000000UL, 0x00000000UL, 0xffffffffUL, 0x7fefffffUL, 0x00000000UL, + 0x00100000UL +}; + +//registers, +// input: (rbp + 8) +// scratch: xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 +// rax, rdx, rcx, rbx (tmp) + +// Code generated by Intel C compiler for LIBM library + +void MacroAssembler::fast_exp(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register tmp) { + Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; + Label L_2TAG_PACKET_4_0_2, L_2TAG_PACKET_5_0_2, L_2TAG_PACKET_6_0_2, L_2TAG_PACKET_7_0_2; + Label L_2TAG_PACKET_8_0_2, L_2TAG_PACKET_9_0_2, L_2TAG_PACKET_10_0_2, L_2TAG_PACKET_11_0_2; + Label L_2TAG_PACKET_12_0_2, L_2TAG_PACKET_13_0_2, B1_3, B1_5, start; + + assert_different_registers(tmp, eax, ecx, edx); + jmp(start); + address static_const_table = (address)_static_const_table; + + bind(start); + subl(rsp, 120); + movl(Address(rsp, 64), tmp); + lea(tmp, ExternalAddress(static_const_table)); + movdqu(xmm0, Address(rsp, 128)); + unpcklpd(xmm0, xmm0); + movdqu(xmm1, Address(tmp, 64)); // 0x652b82feUL, 0x40571547UL, 0x652b82feUL, 0x40571547UL + movdqu(xmm6, Address(tmp, 48)); // 0x00000000UL, 0x43380000UL, 0x00000000UL, 0x43380000UL + movdqu(xmm2, Address(tmp, 80)); // 0xfefa0000UL, 0x3f862e42UL, 0xfefa0000UL, 0x3f862e42UL + movdqu(xmm3, Address(tmp, 96)); // 0xbc9e3b3aUL, 0x3d1cf79aUL, 0xbc9e3b3aUL, 0x3d1cf79aUL + pextrw(eax, xmm0, 3); + andl(eax, 32767); + movl(edx, 16527); + subl(edx, eax); + subl(eax, 15504); + orl(edx, eax); + cmpl(edx, INT_MIN); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_0_0_2); + mulpd(xmm1, xmm0); + addpd(xmm1, xmm6); + movapd(xmm7, xmm1); + subpd(xmm1, xmm6); + mulpd(xmm2, xmm1); + movdqu(xmm4, Address(tmp, 128)); // 0xe3289860UL, 0x3f56c15cUL, 0x555b9e25UL, 0x3fa55555UL + mulpd(xmm3, xmm1); + movdqu(xmm5, Address(tmp, 144)); // 0xc090cf0fUL, 0x3f811115UL, 0x55548ba1UL, 0x3fc55555UL + subpd(xmm0, xmm2); + movdl(eax, xmm7); + movl(ecx, eax); + andl(ecx, 63); + shll(ecx, 4); + sarl(eax, 6); + movl(edx, eax); + movdqu(xmm6, Address(tmp, 16)); // 0xffffffc0UL, 0x00000000UL, 0xffffffc0UL, 0x00000000UL + pand(xmm7, xmm6); + movdqu(xmm6, Address(tmp, 32)); // 0x0000ffc0UL, 0x00000000UL, 0x0000ffc0UL, 0x00000000UL + paddq(xmm7, xmm6); + psllq(xmm7, 46); + subpd(xmm0, xmm3); + movdqu(xmm2, Address(tmp, ecx, Address::times_1, 160)); + mulpd(xmm4, xmm0); + movapd(xmm6, xmm0); + movapd(xmm1, xmm0); + mulpd(xmm6, xmm6); + mulpd(xmm0, xmm6); + addpd(xmm5, xmm4); + mulsd(xmm0, xmm6); + mulpd(xmm6, Address(tmp, 112)); // 0xfffffffeUL, 0x3fdfffffUL, 0xfffffffeUL, 0x3fdfffffUL + addsd(xmm1, xmm2); + unpckhpd(xmm2, xmm2); + mulpd(xmm0, xmm5); + addsd(xmm1, xmm0); + por(xmm2, xmm7); + unpckhpd(xmm0, xmm0); + addsd(xmm0, xmm1); + addsd(xmm0, xmm6); + addl(edx, 894); + cmpl(edx, 1916); + jcc (Assembler::above, L_2TAG_PACKET_1_0_2); + mulsd(xmm0, xmm2); + addsd(xmm0, xmm2); + jmp(L_2TAG_PACKET_2_0_2); + + bind(L_2TAG_PACKET_1_0_2); + fnstcw(Address(rsp, 24)); + movzwl(edx, Address(rsp, 24)); + orl(edx, 768); + movw(Address(rsp, 28), edx); + fldcw(Address(rsp, 28)); + movl(edx, eax); + sarl(eax, 1); + subl(edx, eax); + movdqu(xmm6, Address(tmp, 0)); // 0x00000000UL, 0xfff00000UL, 0x00000000UL, 0xfff00000UL + pandn(xmm6, xmm2); + addl(eax, 1023); + movdl(xmm3, eax); + psllq(xmm3, 52); + por(xmm6, xmm3); + addl(edx, 1023); + movdl(xmm4, edx); + psllq(xmm4, 52); + movsd(Address(rsp, 8), xmm0); + fld_d(Address(rsp, 8)); + movsd(Address(rsp, 16), xmm6); + fld_d(Address(rsp, 16)); + fmula(1); + faddp(1); + movsd(Address(rsp, 8), xmm4); + fld_d(Address(rsp, 8)); + fmulp(1); + fstp_d(Address(rsp, 8)); + movsd(xmm0,Address(rsp, 8)); + fldcw(Address(rsp, 24)); + pextrw(ecx, xmm0, 3); + andl(ecx, 32752); + cmpl(ecx, 32752); + jcc(Assembler::greaterEqual, L_2TAG_PACKET_3_0_2); + cmpl(ecx, 0); + jcc(Assembler::equal, L_2TAG_PACKET_4_0_2); + jmp(L_2TAG_PACKET_2_0_2); + cmpl(ecx, INT_MIN); + jcc(Assembler::less, L_2TAG_PACKET_3_0_2); + cmpl(ecx, -1064950997); + jcc(Assembler::less, L_2TAG_PACKET_2_0_2); + jcc(Assembler::greater, L_2TAG_PACKET_4_0_2); + movl(edx, Address(rsp, 128)); + cmpl(edx ,-17155601); + jcc(Assembler::less, L_2TAG_PACKET_2_0_2); + jmp(L_2TAG_PACKET_4_0_2); + + bind(L_2TAG_PACKET_3_0_2); + movl(edx, 14); + jmp(L_2TAG_PACKET_5_0_2); + + bind(L_2TAG_PACKET_4_0_2); + movl(edx, 15); + + bind(L_2TAG_PACKET_5_0_2); + movsd(Address(rsp, 0), xmm0); + movsd(xmm0, Address(rsp, 128)); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_7_0_2); + cmpl(eax, 2146435072); + jcc(Assembler::greaterEqual, L_2TAG_PACKET_8_0_2); + movl(eax, Address(rsp, 132)); + cmpl(eax, INT_MIN); + jcc(Assembler::greaterEqual, L_2TAG_PACKET_9_0_2); + movsd(xmm0, Address(tmp, 1208)); // 0xffffffffUL, 0x7fefffffUL + mulsd(xmm0, xmm0); + movl(edx, 14); + jmp(L_2TAG_PACKET_5_0_2); + + bind(L_2TAG_PACKET_9_0_2); + movsd(xmm0, Address(tmp, 1216)); + mulsd(xmm0, xmm0); + movl(edx, 15); + jmp(L_2TAG_PACKET_5_0_2); + + bind(L_2TAG_PACKET_8_0_2); + movl(edx, Address(rsp, 128)); + cmpl(eax, 2146435072); + jcc(Assembler::above, L_2TAG_PACKET_10_0_2); + cmpl(edx, 0); + jcc(Assembler::notEqual, L_2TAG_PACKET_10_0_2); + movl(eax, Address(rsp, 132)); + cmpl(eax, 2146435072); + jcc(Assembler::notEqual, L_2TAG_PACKET_11_0_2); + movsd(xmm0, Address(tmp, 1192)); // 0x00000000UL, 0x7ff00000UL + jmp(L_2TAG_PACKET_2_0_2); + + bind(L_2TAG_PACKET_11_0_2); + movsd(xmm0, Address(tmp, 1200)); // 0x00000000UL, 0x00000000UL + jmp(L_2TAG_PACKET_2_0_2); + + bind(L_2TAG_PACKET_10_0_2); + movsd(xmm0, Address(rsp, 128)); + addsd(xmm0, xmm0); + jmp(L_2TAG_PACKET_2_0_2); + + bind(L_2TAG_PACKET_0_0_2); + movl(eax, Address(rsp, 132)); + andl(eax, 2147483647); + cmpl(eax, 1083179008); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_7_0_2); + movsd(xmm0, Address(rsp, 128)); + addsd(xmm0, Address(tmp, 1184)); // 0x00000000UL, 0x3ff00000UL + jmp(L_2TAG_PACKET_2_0_2); + + bind(L_2TAG_PACKET_2_0_2); + movsd(Address(rsp, 48), xmm0); + fld_d(Address(rsp, 48)); + + bind(L_2TAG_PACKET_6_0_2); + movl(tmp, Address(rsp, 64)); +} + +/******************************************************************************/ +// ALGORITHM DESCRIPTION - LOG() +// --------------------- +// +// x=2^k * mx, mx in [1,2) +// +// Get B~1/mx based on the output of rcpss instruction (B0) +// B = int((B0*2^7+0.5))/2^7 +// +// Reduced argument: r=B*mx-1.0 (computed accurately in high and low parts) +// +// Result: k*log(2) - log(B) + p(r) if |x-1| >= small value (2^-6) and +// p(r) is a degree 7 polynomial +// -log(B) read from data table (high, low parts) +// Result is formed from high and low parts +// +// Special cases: +// log(NaN) = quiet NaN, and raise invalid exception +// log(+INF) = that INF +// log(0) = -INF with divide-by-zero exception raised +// log(1) = +0 +// log(x) = NaN with invalid exception raised if x < -0, including -INF +// +/******************************************************************************/ + +ALIGNED_(16) juint _static_const_table_log[] = +{ + 0xfefa3800UL, 0x3fe62e42UL, 0x93c76730UL, 0x3d2ef357UL, 0xaa241800UL, + 0x3fe5ee82UL, 0x0cda46beUL, 0x3d220238UL, 0x5c364800UL, 0x3fe5af40UL, + 0xac10c9fbUL, 0x3d2dfa63UL, 0x26bb8c00UL, 0x3fe5707aUL, 0xff3303ddUL, + 0x3d09980bUL, 0x26867800UL, 0x3fe5322eUL, 0x5d257531UL, 0x3d05ccc4UL, + 0x835a5000UL, 0x3fe4f45aUL, 0x6d93b8fbUL, 0xbd2e6c51UL, 0x6f970c00UL, + 0x3fe4b6fdUL, 0xed4c541cUL, 0x3cef7115UL, 0x27e8a400UL, 0x3fe47a15UL, + 0xf94d60aaUL, 0xbd22cb6aUL, 0xf2f92400UL, 0x3fe43d9fUL, 0x481051f7UL, + 0xbcfd984fUL, 0x2125cc00UL, 0x3fe4019cUL, 0x30f0c74cUL, 0xbd26ce79UL, + 0x0c36c000UL, 0x3fe3c608UL, 0x7cfe13c2UL, 0xbd02b736UL, 0x17197800UL, + 0x3fe38ae2UL, 0xbb5569a4UL, 0xbd218b7aUL, 0xad9d8c00UL, 0x3fe35028UL, + 0x9527e6acUL, 0x3d10b83fUL, 0x44340800UL, 0x3fe315daUL, 0xc5a0ed9cUL, + 0xbd274e93UL, 0x57b0e000UL, 0x3fe2dbf5UL, 0x07b9dc11UL, 0xbd17a6e5UL, + 0x6d0ec000UL, 0x3fe2a278UL, 0xe797882dUL, 0x3d206d2bUL, 0x1134dc00UL, + 0x3fe26962UL, 0x05226250UL, 0xbd0b61f1UL, 0xd8bebc00UL, 0x3fe230b0UL, + 0x6e48667bUL, 0x3d12fc06UL, 0x5fc61800UL, 0x3fe1f863UL, 0xc9fe81d3UL, + 0xbd2a7242UL, 0x49ae6000UL, 0x3fe1c078UL, 0xed70e667UL, 0x3cccacdeUL, + 0x40f23c00UL, 0x3fe188eeUL, 0xf8ab4650UL, 0x3d14cc4eUL, 0xf6f29800UL, + 0x3fe151c3UL, 0xa293ae49UL, 0xbd2edd97UL, 0x23c75c00UL, 0x3fe11af8UL, + 0xbb9ddcb2UL, 0xbd258647UL, 0x8611cc00UL, 0x3fe0e489UL, 0x07801742UL, + 0x3d1c2998UL, 0xe2d05400UL, 0x3fe0ae76UL, 0x887e7e27UL, 0x3d1f486bUL, + 0x0533c400UL, 0x3fe078bfUL, 0x41edf5fdUL, 0x3d268122UL, 0xbe760400UL, + 0x3fe04360UL, 0xe79539e0UL, 0xbd04c45fUL, 0xe5b20800UL, 0x3fe00e5aUL, + 0xb1727b1cUL, 0xbd053ba3UL, 0xaf7a4800UL, 0x3fdfb358UL, 0x3c164935UL, + 0x3d0085faUL, 0xee031800UL, 0x3fdf4aa7UL, 0x6f014a8bUL, 0x3d12cde5UL, + 0x56b41000UL, 0x3fdee2a1UL, 0x5a470251UL, 0x3d2f27f4UL, 0xc3ddb000UL, + 0x3fde7b42UL, 0x5372bd08UL, 0xbd246550UL, 0x1a272800UL, 0x3fde148aUL, + 0x07322938UL, 0xbd1326b2UL, 0x484c9800UL, 0x3fddae75UL, 0x60dc616aUL, + 0xbd1ea42dUL, 0x46def800UL, 0x3fdd4902UL, 0xe9a767a8UL, 0x3d235bafUL, + 0x18064800UL, 0x3fdce42fUL, 0x3ec7a6b0UL, 0xbd0797c3UL, 0xc7455800UL, + 0x3fdc7ff9UL, 0xc15249aeUL, 0xbd29b6ddUL, 0x693fa000UL, 0x3fdc1c60UL, + 0x7fe8e180UL, 0x3d2cec80UL, 0x1b80e000UL, 0x3fdbb961UL, 0xf40a666dUL, + 0x3d27d85bUL, 0x04462800UL, 0x3fdb56faUL, 0x2d841995UL, 0x3d109525UL, + 0x5248d000UL, 0x3fdaf529UL, 0x52774458UL, 0xbd217cc5UL, 0x3c8ad800UL, + 0x3fda93edUL, 0xbea77a5dUL, 0x3d1e36f2UL, 0x0224f800UL, 0x3fda3344UL, + 0x7f9d79f5UL, 0x3d23c645UL, 0xea15f000UL, 0x3fd9d32bUL, 0x10d0c0b0UL, + 0xbd26279eUL, 0x43135800UL, 0x3fd973a3UL, 0xa502d9f0UL, 0xbd152313UL, + 0x635bf800UL, 0x3fd914a8UL, 0x2ee6307dUL, 0xbd1766b5UL, 0xa88b3000UL, + 0x3fd8b639UL, 0xe5e70470UL, 0xbd205ae1UL, 0x776dc800UL, 0x3fd85855UL, + 0x3333778aUL, 0x3d2fd56fUL, 0x3bd81800UL, 0x3fd7fafaUL, 0xc812566aUL, + 0xbd272090UL, 0x687cf800UL, 0x3fd79e26UL, 0x2efd1778UL, 0x3d29ec7dUL, + 0x76c67800UL, 0x3fd741d8UL, 0x49dc60b3UL, 0x3d2d8b09UL, 0xe6af1800UL, + 0x3fd6e60eUL, 0x7c222d87UL, 0x3d172165UL, 0x3e9c6800UL, 0x3fd68ac8UL, + 0x2756eba0UL, 0x3d20a0d3UL, 0x0b3ab000UL, 0x3fd63003UL, 0xe731ae00UL, + 0xbd2db623UL, 0xdf596000UL, 0x3fd5d5bdUL, 0x08a465dcUL, 0xbd0a0b2aUL, + 0x53c8d000UL, 0x3fd57bf7UL, 0xee5d40efUL, 0x3d1fadedUL, 0x0738a000UL, + 0x3fd522aeUL, 0x8164c759UL, 0x3d2ebe70UL, 0x9e173000UL, 0x3fd4c9e0UL, + 0x1b0ad8a4UL, 0xbd2e2089UL, 0xc271c800UL, 0x3fd4718dUL, 0x0967d675UL, + 0xbd2f27ceUL, 0x23d5e800UL, 0x3fd419b4UL, 0xec90e09dUL, 0x3d08e436UL, + 0x77333000UL, 0x3fd3c252UL, 0xb606bd5cUL, 0x3d183b54UL, 0x76be1000UL, + 0x3fd36b67UL, 0xb0f177c8UL, 0x3d116ecdUL, 0xe1d36000UL, 0x3fd314f1UL, + 0xd3213cb8UL, 0xbd28e27aUL, 0x7cdc9000UL, 0x3fd2bef0UL, 0x4a5004f4UL, + 0x3d2a9cfaUL, 0x1134d800UL, 0x3fd26962UL, 0xdf5bb3b6UL, 0x3d2c93c1UL, + 0x6d0eb800UL, 0x3fd21445UL, 0xba46baeaUL, 0x3d0a87deUL, 0x635a6800UL, + 0x3fd1bf99UL, 0x5147bdb7UL, 0x3d2ca6edUL, 0xcbacf800UL, 0x3fd16b5cUL, + 0xf7a51681UL, 0x3d2b9acdUL, 0x8227e800UL, 0x3fd1178eUL, 0x63a5f01cUL, + 0xbd2c210eUL, 0x67616000UL, 0x3fd0c42dUL, 0x163ceae9UL, 0x3d27188bUL, + 0x604d5800UL, 0x3fd07138UL, 0x16ed4e91UL, 0x3cf89cdbUL, 0x5626c800UL, + 0x3fd01eaeUL, 0x1485e94aUL, 0xbd16f08cUL, 0x6cb3b000UL, 0x3fcf991cUL, + 0xca0cdf30UL, 0x3d1bcbecUL, 0xe4dd0000UL, 0x3fcef5adUL, 0x65bb8e11UL, + 0xbcca2115UL, 0xffe71000UL, 0x3fce530eUL, 0x6041f430UL, 0x3cc21227UL, + 0xb0d49000UL, 0x3fcdb13dUL, 0xf715b035UL, 0xbd2aff2aUL, 0xf2656000UL, + 0x3fcd1037UL, 0x75b6f6e4UL, 0xbd084a7eUL, 0xc6f01000UL, 0x3fcc6ffbUL, + 0xc5962bd2UL, 0xbcf1ec72UL, 0x383be000UL, 0x3fcbd087UL, 0x595412b6UL, + 0xbd2d4bc4UL, 0x575bd000UL, 0x3fcb31d8UL, 0x4eace1aaUL, 0xbd0c358dUL, + 0x3c8ae000UL, 0x3fca93edUL, 0x50562169UL, 0xbd287243UL, 0x07089000UL, + 0x3fc9f6c4UL, 0x6865817aUL, 0x3d29904dUL, 0xdcf70000UL, 0x3fc95a5aUL, + 0x58a0ff6fUL, 0x3d07f228UL, 0xeb390000UL, 0x3fc8beafUL, 0xaae92cd1UL, + 0xbd073d54UL, 0x6551a000UL, 0x3fc823c1UL, 0x9a631e83UL, 0x3d1e0ddbUL, + 0x85445000UL, 0x3fc7898dUL, 0x70914305UL, 0xbd1c6610UL, 0x8b757000UL, + 0x3fc6f012UL, 0xe59c21e1UL, 0xbd25118dUL, 0xbe8c1000UL, 0x3fc6574eUL, + 0x2c3c2e78UL, 0x3d19cf8bUL, 0x6b544000UL, 0x3fc5bf40UL, 0xeb68981cUL, + 0xbd127023UL, 0xe4a1b000UL, 0x3fc527e5UL, 0xe5697dc7UL, 0x3d2633e8UL, + 0x8333b000UL, 0x3fc4913dUL, 0x54fdb678UL, 0x3d258379UL, 0xa5993000UL, + 0x3fc3fb45UL, 0x7e6a354dUL, 0xbd2cd1d8UL, 0xb0159000UL, 0x3fc365fcUL, + 0x234b7289UL, 0x3cc62fa8UL, 0x0c868000UL, 0x3fc2d161UL, 0xcb81b4a1UL, + 0x3d039d6cUL, 0x2a49c000UL, 0x3fc23d71UL, 0x8fd3df5cUL, 0x3d100d23UL, + 0x7e23f000UL, 0x3fc1aa2bUL, 0x44389934UL, 0x3d2ca78eUL, 0x8227e000UL, + 0x3fc1178eUL, 0xce2d07f2UL, 0x3d21ef78UL, 0xb59e4000UL, 0x3fc08598UL, + 0x7009902cUL, 0xbd27e5ddUL, 0x39dbe000UL, 0x3fbfe891UL, 0x4fa10afdUL, + 0xbd2534d6UL, 0x830a2000UL, 0x3fbec739UL, 0xafe645e0UL, 0xbd2dc068UL, + 0x63844000UL, 0x3fbda727UL, 0x1fa71733UL, 0x3d1a8940UL, 0x01bc4000UL, + 0x3fbc8858UL, 0xc65aacd3UL, 0x3d2646d1UL, 0x8dad6000UL, 0x3fbb6ac8UL, + 0x2bf768e5UL, 0xbd139080UL, 0x40b1c000UL, 0x3fba4e76UL, 0xb94407c8UL, + 0xbd0e42b6UL, 0x5d594000UL, 0x3fb9335eUL, 0x3abd47daUL, 0x3d23115cUL, + 0x2f40e000UL, 0x3fb8197eUL, 0xf96ffdf7UL, 0x3d0f80dcUL, 0x0aeac000UL, + 0x3fb700d3UL, 0xa99ded32UL, 0x3cec1e8dUL, 0x4d97a000UL, 0x3fb5e95aUL, + 0x3c5d1d1eUL, 0xbd2c6906UL, 0x5d208000UL, 0x3fb4d311UL, 0x82f4e1efUL, + 0xbcf53a25UL, 0xa7d1e000UL, 0x3fb3bdf5UL, 0xa5db4ed7UL, 0x3d2cc85eUL, + 0xa4472000UL, 0x3fb2aa04UL, 0xae9c697dUL, 0xbd20b6e8UL, 0xd1466000UL, + 0x3fb1973bUL, 0x560d9e9bUL, 0xbd25325dUL, 0xb59e4000UL, 0x3fb08598UL, + 0x7009902cUL, 0xbd17e5ddUL, 0xc006c000UL, 0x3faeea31UL, 0x4fc93b7bUL, + 0xbd0e113eUL, 0xcdddc000UL, 0x3faccb73UL, 0x47d82807UL, 0xbd1a68f2UL, + 0xd0fb0000UL, 0x3faaaef2UL, 0x353bb42eUL, 0x3d20fc1aUL, 0x149fc000UL, + 0x3fa894aaUL, 0xd05a267dUL, 0xbd197995UL, 0xf2d4c000UL, 0x3fa67c94UL, + 0xec19afa2UL, 0xbd029efbUL, 0xd42e0000UL, 0x3fa466aeUL, 0x75bdfd28UL, + 0xbd2c1673UL, 0x2f8d0000UL, 0x3fa252f3UL, 0xe021b67bUL, 0x3d283e9aUL, + 0x89e74000UL, 0x3fa0415dUL, 0x5cf1d753UL, 0x3d0111c0UL, 0xec148000UL, + 0x3f9c63d2UL, 0x3f9eb2f3UL, 0x3d2578c6UL, 0x28c90000UL, 0x3f984925UL, + 0x325a0c34UL, 0xbd2aa0baUL, 0x25980000UL, 0x3f9432a9UL, 0x928637feUL, + 0x3d098139UL, 0x58938000UL, 0x3f902056UL, 0x06e2f7d2UL, 0xbd23dc5bUL, + 0xa3890000UL, 0x3f882448UL, 0xda74f640UL, 0xbd275577UL, 0x75890000UL, + 0x3f801015UL, 0x999d2be8UL, 0xbd10c76bUL, 0x59580000UL, 0x3f700805UL, + 0xcb31c67bUL, 0x3d2166afUL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x80000000UL, 0xfefa3800UL, 0x3fa62e42UL, 0x93c76730UL, 0x3ceef357UL, + 0x92492492UL, 0x3fc24924UL, 0x00000000UL, 0xbfd00000UL, 0x3d6fb175UL, + 0xbfc5555eUL, 0x55555555UL, 0x3fd55555UL, 0x9999999aUL, 0x3fc99999UL, + 0x00000000UL, 0xbfe00000UL, 0x00000000UL, 0xffffe000UL, 0x00000000UL, + 0xffffe000UL +}; +//registers, +// input: xmm0 +// scratch: xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 +// rax, rdx, rcx, rbx (tmp) + +void MacroAssembler::fast_log(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register tmp) { + Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; + Label L_2TAG_PACKET_4_0_2, L_2TAG_PACKET_5_0_2, L_2TAG_PACKET_6_0_2, L_2TAG_PACKET_7_0_2; + Label L_2TAG_PACKET_8_0_2, L_2TAG_PACKET_9_0_2; + Label L_2TAG_PACKET_10_0_2, start; + + assert_different_registers(tmp, eax, ecx, edx); + jmp(start); + address static_const_table = (address)_static_const_table_log; + + bind(start); + subl(rsp, 104); + movl(Address(rsp, 40), tmp); + lea(tmp, ExternalAddress(static_const_table)); + xorpd(xmm2, xmm2); + movl(eax, 16368); + pinsrw(xmm2, eax, 3); + xorpd(xmm3, xmm3); + movl(edx, 30704); + pinsrw(xmm3, edx, 3); + movsd(xmm0, Address(rsp, 112)); + movapd(xmm1, xmm0); + movl(ecx, 32768); + movdl(xmm4, ecx); + movsd(xmm5, Address(tmp, 2128)); // 0x00000000UL, 0xffffe000UL + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + psllq(xmm0, 5); + movl(ecx, 16352); + psrlq(xmm0, 34); + rcpss(xmm0, xmm0); + psllq(xmm1, 12); + pshufd(xmm6, xmm5, 228); + psrlq(xmm1, 12); + subl(eax, 16); + cmpl(eax, 32736); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_0_0_2); + + bind(L_2TAG_PACKET_1_0_2); + paddd(xmm0, xmm4); + por(xmm1, xmm3); + movdl(edx, xmm0); + psllq(xmm0, 29); + pand(xmm5, xmm1); + pand(xmm0, xmm6); + subsd(xmm1, xmm5); + mulpd(xmm5, xmm0); + andl(eax, 32752); + subl(eax, ecx); + cvtsi2sdl(xmm7, eax); + mulsd(xmm1, xmm0); + movsd(xmm6, Address(tmp, 2064)); // 0xfefa3800UL, 0x3fa62e42UL + movdqu(xmm3, Address(tmp, 2080)); // 0x92492492UL, 0x3fc24924UL, 0x00000000UL, 0xbfd00000UL + subsd(xmm5, xmm2); + andl(edx, 16711680); + shrl(edx, 12); + movdqu(xmm0, Address(tmp, edx)); + movdqu(xmm4, Address(tmp, 2096)); // 0x3d6fb175UL, 0xbfc5555eUL, 0x55555555UL, 0x3fd55555UL + addsd(xmm1, xmm5); + movdqu(xmm2, Address(tmp, 2112)); // 0x9999999aUL, 0x3fc99999UL, 0x00000000UL, 0xbfe00000UL + mulsd(xmm6, xmm7); + pshufd(xmm5, xmm1, 68); + mulsd(xmm7, Address(tmp, 2072)); // 0x93c76730UL, 0x3ceef357UL, 0x92492492UL, 0x3fc24924UL + mulsd(xmm3, xmm1); + addsd(xmm0, xmm6); + mulpd(xmm4, xmm5); + mulpd(xmm5, xmm5); + pshufd(xmm6, xmm0, 228); + addsd(xmm0, xmm1); + addpd(xmm4, xmm2); + mulpd(xmm3, xmm5); + subsd(xmm6, xmm0); + mulsd(xmm4, xmm1); + pshufd(xmm2, xmm0, 238); + addsd(xmm1, xmm6); + mulsd(xmm5, xmm5); + addsd(xmm7, xmm2); + addpd(xmm4, xmm3); + addsd(xmm1, xmm7); + mulpd(xmm4, xmm5); + addsd(xmm1, xmm4); + pshufd(xmm5, xmm4, 238); + addsd(xmm1, xmm5); + addsd(xmm0, xmm1); + jmp(L_2TAG_PACKET_2_0_2); + + bind(L_2TAG_PACKET_0_0_2); + movsd(xmm0, Address(rsp, 112)); + movdqu(xmm1, xmm0); + addl(eax, 16); + cmpl(eax, 32768); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_3_0_2); + cmpl(eax, 16); + jcc(Assembler::below, L_2TAG_PACKET_4_0_2); + + bind(L_2TAG_PACKET_5_0_2); + addsd(xmm0, xmm0); + jmp(L_2TAG_PACKET_2_0_2); + + bind(L_2TAG_PACKET_6_0_2); + jcc(Assembler::above, L_2TAG_PACKET_5_0_2); + cmpl(edx, 0); + jcc(Assembler::above, L_2TAG_PACKET_5_0_2); + jmp(L_2TAG_PACKET_7_0_2); + + bind(L_2TAG_PACKET_3_0_2); + movdl(edx, xmm1); + psrlq(xmm1, 32); + movdl(ecx, xmm1); + addl(ecx, ecx); + cmpl(ecx, -2097152); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_6_0_2); + orl(edx, ecx); + cmpl(edx, 0); + jcc(Assembler::equal, L_2TAG_PACKET_8_0_2); + + bind(L_2TAG_PACKET_7_0_2); + xorpd(xmm1, xmm1); + xorpd(xmm0, xmm0); + movl(eax, 32752); + pinsrw(xmm1, eax, 3); + movl(edx, 3); + mulsd(xmm0, xmm1); + + bind(L_2TAG_PACKET_9_0_2); + movsd(Address(rsp, 0), xmm0); + movsd(xmm0, Address(rsp, 112)); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_10_0_2); + + bind(L_2TAG_PACKET_8_0_2); + xorpd(xmm1, xmm1); + xorpd(xmm0, xmm0); + movl(eax, 49136); + pinsrw(xmm0, eax, 3); + divsd(xmm0, xmm1); + movl(edx, 2); + jmp(L_2TAG_PACKET_9_0_2); + + bind(L_2TAG_PACKET_4_0_2); + movdl(edx, xmm1); + psrlq(xmm1, 32); + movdl(ecx, xmm1); + orl(edx, ecx); + cmpl(edx, 0); + jcc(Assembler::equal, L_2TAG_PACKET_8_0_2); + xorpd(xmm1, xmm1); + movl(eax, 18416); + pinsrw(xmm1, eax, 3); + mulsd(xmm0, xmm1); + movapd(xmm1, xmm0); + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + psllq(xmm0, 5); + movl(ecx, 18416); + psrlq(xmm0, 34); + rcpss(xmm0, xmm0); + psllq(xmm1, 12); + pshufd(xmm6, xmm5, 228); + psrlq(xmm1, 12); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_2_0_2); + movsd(Address(rsp, 24), xmm0); + fld_d(Address(rsp, 24)); + + bind(L_2TAG_PACKET_10_0_2); + movl(tmp, Address(rsp, 40)); +} + +/******************************************************************************/ +// ALGORITHM DESCRIPTION - POW() +// --------------------- +// +// Let x=2^k * mx, mx in [1,2) +// +// log2(x) calculation: +// +// Get B~1/mx based on the output of rcpps instruction (B0) +// B = int((B0*LH*2^9+0.5))/2^9 +// LH is a short approximation for log2(e) +// +// Reduced argument, scaled by LH: +// r=B*mx-LH (computed accurately in high and low parts) +// +// log2(x) result: k - log2(B) + p(r) +// p(r) is a degree 8 polynomial +// -log2(B) read from data table (high, low parts) +// log2(x) is formed from high and low parts +// For |x| in [1-1/32, 1+1/16), a slower but more accurate computation +// based om the same table design is performed. +// +// Main path is taken if | floor(log2(|log2(|x|)|) + floor(log2|y|) | < 8, +// to filter out all potential OF/UF cases. +// exp2(y*log2(x)) is computed using an 8-bit index table and a degree 5 +// polynomial +// +// Special cases: +// pow(-0,y) = -INF and raises the divide-by-zero exception for y an odd +// integer < 0. +// pow(-0,y) = +INF and raises the divide-by-zero exception for y < 0 and +// not an odd integer. +// pow(-0,y) = -0 for y an odd integer > 0. +// pow(-0,y) = +0 for y > 0 and not an odd integer. +// pow(-1,-INF) = NaN. +// pow(+1,y) = NaN for any y, even a NaN. +// pow(x,-0) = 1 for any x, even a NaN. +// pow(x,y) = a NaN and raises the invalid exception for finite x < 0 and +// finite non-integer y. +// pow(x,-INF) = +INF for |x|<1. +// pow(x,-INF) = +0 for |x|>1. +// pow(x,+INF) = +0 for |x|<1. +// pow(x,+INF) = +INF for |x|>1. +// pow(-INF,y) = -0 for y an odd integer < 0. +// pow(-INF,y) = +0 for y < 0 and not an odd integer. +// pow(-INF,y) = -INF for y an odd integer > 0. +// pow(-INF,y) = +INF for y > 0 and not an odd integer. +// pow(+INF,y) = +0 for y <0. +// pow(+INF,y) = +INF for y >0. +// +/******************************************************************************/ + +ALIGNED_(16) juint _static_const_table_pow[] = +{ + 0x00000000UL, 0xbfd61a00UL, 0x00000000UL, 0xbf5dabe1UL, 0xf8000000UL, + 0xffffffffUL, 0x00000000UL, 0xfffff800UL, 0x00000000UL, 0x3ff00000UL, + 0x00000000UL, 0x00000000UL, 0x20000000UL, 0x3feff00aUL, 0x96621f95UL, + 0x3e5b1856UL, 0xe0000000UL, 0x3fefe019UL, 0xe5916f9eUL, 0xbe325278UL, + 0x00000000UL, 0x3fefd02fUL, 0x859a1062UL, 0x3e595fb7UL, 0xc0000000UL, + 0x3fefc049UL, 0xb245f18fUL, 0xbe529c38UL, 0xe0000000UL, 0x3fefb069UL, + 0xad2880a7UL, 0xbe501230UL, 0x60000000UL, 0x3fefa08fUL, 0xc8e72420UL, + 0x3e597bd1UL, 0x80000000UL, 0x3fef90baUL, 0xc30c4500UL, 0xbe5d6c75UL, + 0xe0000000UL, 0x3fef80eaUL, 0x02c63f43UL, 0x3e2e1318UL, 0xc0000000UL, + 0x3fef7120UL, 0xb3d4ccccUL, 0xbe44c52aUL, 0x00000000UL, 0x3fef615cUL, + 0xdbd91397UL, 0xbe4e7d6cUL, 0xa0000000UL, 0x3fef519cUL, 0x65c5cd68UL, + 0xbe522dc8UL, 0xa0000000UL, 0x3fef41e2UL, 0x46d1306cUL, 0xbe5a840eUL, + 0xe0000000UL, 0x3fef322dUL, 0xd2980e94UL, 0x3e5071afUL, 0xa0000000UL, + 0x3fef227eUL, 0x773abadeUL, 0xbe5891e5UL, 0xa0000000UL, 0x3fef12d4UL, + 0xdc6bf46bUL, 0xbe5cccbeUL, 0xe0000000UL, 0x3fef032fUL, 0xbc7247faUL, + 0xbe2bab83UL, 0x80000000UL, 0x3feef390UL, 0xbcaa1e46UL, 0xbe53bb3bUL, + 0x60000000UL, 0x3feee3f6UL, 0x5f6c682dUL, 0xbe54c619UL, 0x80000000UL, + 0x3feed461UL, 0x5141e368UL, 0xbe4b6d86UL, 0xe0000000UL, 0x3feec4d1UL, + 0xec678f76UL, 0xbe369af6UL, 0x80000000UL, 0x3feeb547UL, 0x41301f55UL, + 0xbe2d4312UL, 0x60000000UL, 0x3feea5c2UL, 0x676da6bdUL, 0xbe4d8dd0UL, + 0x60000000UL, 0x3fee9642UL, 0x57a891c4UL, 0x3e51f991UL, 0xa0000000UL, + 0x3fee86c7UL, 0xe4eb491eUL, 0x3e579bf9UL, 0x20000000UL, 0x3fee7752UL, + 0xfddc4a2cUL, 0xbe3356e6UL, 0xc0000000UL, 0x3fee67e1UL, 0xd75b5bf1UL, + 0xbe449531UL, 0x80000000UL, 0x3fee5876UL, 0xbd423b8eUL, 0x3df54fe4UL, + 0x60000000UL, 0x3fee4910UL, 0x330e51b9UL, 0x3e54289cUL, 0x80000000UL, + 0x3fee39afUL, 0x8651a95fUL, 0xbe55aad6UL, 0xa0000000UL, 0x3fee2a53UL, + 0x5e98c708UL, 0xbe2fc4a9UL, 0xe0000000UL, 0x3fee1afcUL, 0x0989328dUL, + 0x3e23958cUL, 0x40000000UL, 0x3fee0babUL, 0xee642abdUL, 0xbe425dd8UL, + 0xa0000000UL, 0x3fedfc5eUL, 0xc394d236UL, 0x3e526362UL, 0x20000000UL, + 0x3feded17UL, 0xe104aa8eUL, 0x3e4ce247UL, 0xc0000000UL, 0x3fedddd4UL, + 0x265a9be4UL, 0xbe5bb77aUL, 0x40000000UL, 0x3fedce97UL, 0x0ecac52fUL, + 0x3e4a7cb1UL, 0xe0000000UL, 0x3fedbf5eUL, 0x124cb3b8UL, 0x3e257024UL, + 0x80000000UL, 0x3fedb02bUL, 0xe6d4febeUL, 0xbe2033eeUL, 0x20000000UL, + 0x3feda0fdUL, 0x39cca00eUL, 0xbe3ddabcUL, 0xc0000000UL, 0x3fed91d3UL, + 0xef8a552aUL, 0xbe543390UL, 0x40000000UL, 0x3fed82afUL, 0xb8e85204UL, + 0x3e513850UL, 0xe0000000UL, 0x3fed738fUL, 0x3d59fe08UL, 0xbe5db728UL, + 0x40000000UL, 0x3fed6475UL, 0x3aa7ead1UL, 0x3e58804bUL, 0xc0000000UL, + 0x3fed555fUL, 0xf8a35ba9UL, 0xbe5298b0UL, 0x00000000UL, 0x3fed464fUL, + 0x9a88dd15UL, 0x3e5a8cdbUL, 0x40000000UL, 0x3fed3743UL, 0xb0b0a190UL, + 0x3e598635UL, 0x80000000UL, 0x3fed283cUL, 0xe2113295UL, 0xbe5c1119UL, + 0x80000000UL, 0x3fed193aUL, 0xafbf1728UL, 0xbe492e9cUL, 0x60000000UL, + 0x3fed0a3dUL, 0xe4a4ccf3UL, 0x3e19b90eUL, 0x20000000UL, 0x3fecfb45UL, + 0xba3cbeb8UL, 0x3e406b50UL, 0xc0000000UL, 0x3fecec51UL, 0x110f7dddUL, + 0x3e0d6806UL, 0x40000000UL, 0x3fecdd63UL, 0x7dd7d508UL, 0xbe5a8943UL, + 0x80000000UL, 0x3fecce79UL, 0x9b60f271UL, 0xbe50676aUL, 0x80000000UL, + 0x3fecbf94UL, 0x0b9ad660UL, 0x3e59174fUL, 0x60000000UL, 0x3fecb0b4UL, + 0x00823d9cUL, 0x3e5bbf72UL, 0x20000000UL, 0x3feca1d9UL, 0x38a6ec89UL, + 0xbe4d38f9UL, 0x80000000UL, 0x3fec9302UL, 0x3a0b7d8eUL, 0x3e53dbfdUL, + 0xc0000000UL, 0x3fec8430UL, 0xc6826b34UL, 0xbe27c5c9UL, 0xc0000000UL, + 0x3fec7563UL, 0x0c706381UL, 0xbe593653UL, 0x60000000UL, 0x3fec669bUL, + 0x7df34ec7UL, 0x3e461ab5UL, 0xe0000000UL, 0x3fec57d7UL, 0x40e5e7e8UL, + 0xbe5c3daeUL, 0x00000000UL, 0x3fec4919UL, 0x5602770fUL, 0xbe55219dUL, + 0xc0000000UL, 0x3fec3a5eUL, 0xec7911ebUL, 0x3e5a5d25UL, 0x60000000UL, + 0x3fec2ba9UL, 0xb39ea225UL, 0xbe53c00bUL, 0x80000000UL, 0x3fec1cf8UL, + 0x967a212eUL, 0x3e5a8ddfUL, 0x60000000UL, 0x3fec0e4cUL, 0x580798bdUL, + 0x3e5f53abUL, 0x00000000UL, 0x3febffa5UL, 0xb8282df6UL, 0xbe46b874UL, + 0x20000000UL, 0x3febf102UL, 0xe33a6729UL, 0x3e54963fUL, 0x00000000UL, + 0x3febe264UL, 0x3b53e88aUL, 0xbe3adce1UL, 0x60000000UL, 0x3febd3caUL, + 0xc2585084UL, 0x3e5cde9fUL, 0x80000000UL, 0x3febc535UL, 0xa335c5eeUL, + 0xbe39fd9cUL, 0x20000000UL, 0x3febb6a5UL, 0x7325b04dUL, 0x3e42ba15UL, + 0x60000000UL, 0x3feba819UL, 0x1564540fUL, 0x3e3a9f35UL, 0x40000000UL, + 0x3feb9992UL, 0x83fff592UL, 0xbe5465ceUL, 0xa0000000UL, 0x3feb8b0fUL, + 0xb9da63d3UL, 0xbe4b1a0aUL, 0x80000000UL, 0x3feb7c91UL, 0x6d6f1ea4UL, + 0x3e557657UL, 0x00000000UL, 0x3feb6e18UL, 0x5e80a1bfUL, 0x3e4ddbb6UL, + 0x00000000UL, 0x3feb5fa3UL, 0x1c9eacb5UL, 0x3e592877UL, 0xa0000000UL, + 0x3feb5132UL, 0x6d40beb3UL, 0xbe51858cUL, 0xa0000000UL, 0x3feb42c6UL, + 0xd740c67bUL, 0x3e427ad2UL, 0x40000000UL, 0x3feb345fUL, 0xa3e0cceeUL, + 0xbe5c2fc4UL, 0x40000000UL, 0x3feb25fcUL, 0x8e752b50UL, 0xbe3da3c2UL, + 0xc0000000UL, 0x3feb179dUL, 0xa892e7deUL, 0x3e1fb481UL, 0xc0000000UL, + 0x3feb0943UL, 0x21ed71e9UL, 0xbe365206UL, 0x20000000UL, 0x3feafaeeUL, + 0x0e1380a3UL, 0x3e5c5b7bUL, 0x20000000UL, 0x3feaec9dUL, 0x3c3d640eUL, + 0xbe5dbbd0UL, 0x60000000UL, 0x3feade50UL, 0x8f97a715UL, 0x3e3a8ec5UL, + 0x20000000UL, 0x3fead008UL, 0x23ab2839UL, 0x3e2fe98aUL, 0x40000000UL, + 0x3feac1c4UL, 0xf4bbd50fUL, 0x3e54d8f6UL, 0xe0000000UL, 0x3feab384UL, + 0x14757c4dUL, 0xbe48774cUL, 0xc0000000UL, 0x3feaa549UL, 0x7c7b0eeaUL, + 0x3e5b51bbUL, 0x20000000UL, 0x3fea9713UL, 0xf56f7013UL, 0x3e386200UL, + 0xe0000000UL, 0x3fea88e0UL, 0xbe428ebeUL, 0xbe514af5UL, 0xe0000000UL, + 0x3fea7ab2UL, 0x8d0e4496UL, 0x3e4f9165UL, 0x60000000UL, 0x3fea6c89UL, + 0xdbacc5d5UL, 0xbe5c063bUL, 0x20000000UL, 0x3fea5e64UL, 0x3f19d970UL, + 0xbe5a0c8cUL, 0x20000000UL, 0x3fea5043UL, 0x09ea3e6bUL, 0x3e5065dcUL, + 0x80000000UL, 0x3fea4226UL, 0x78df246cUL, 0x3e5e05f6UL, 0x40000000UL, + 0x3fea340eUL, 0x4057d4a0UL, 0x3e431b2bUL, 0x40000000UL, 0x3fea25faUL, + 0x82867bb5UL, 0x3e4b76beUL, 0xa0000000UL, 0x3fea17eaUL, 0x9436f40aUL, + 0xbe5aad39UL, 0x20000000UL, 0x3fea09dfUL, 0x4b5253b3UL, 0x3e46380bUL, + 0x00000000UL, 0x3fe9fbd8UL, 0x8fc52466UL, 0xbe386f9bUL, 0x20000000UL, + 0x3fe9edd5UL, 0x22d3f344UL, 0xbe538347UL, 0x60000000UL, 0x3fe9dfd6UL, + 0x1ac33522UL, 0x3e5dbc53UL, 0x00000000UL, 0x3fe9d1dcUL, 0xeabdff1dUL, + 0x3e40fc0cUL, 0xe0000000UL, 0x3fe9c3e5UL, 0xafd30e73UL, 0xbe585e63UL, + 0xe0000000UL, 0x3fe9b5f3UL, 0xa52f226aUL, 0xbe43e8f9UL, 0x20000000UL, + 0x3fe9a806UL, 0xecb8698dUL, 0xbe515b36UL, 0x80000000UL, 0x3fe99a1cUL, + 0xf2b4e89dUL, 0x3e48b62bUL, 0x20000000UL, 0x3fe98c37UL, 0x7c9a88fbUL, + 0x3e44414cUL, 0x00000000UL, 0x3fe97e56UL, 0xda015741UL, 0xbe5d13baUL, + 0xe0000000UL, 0x3fe97078UL, 0x5fdace06UL, 0x3e51b947UL, 0x00000000UL, + 0x3fe962a0UL, 0x956ca094UL, 0x3e518785UL, 0x40000000UL, 0x3fe954cbUL, + 0x01164c1dUL, 0x3e5d5b57UL, 0xc0000000UL, 0x3fe946faUL, 0xe63b3767UL, + 0xbe4f84e7UL, 0x40000000UL, 0x3fe9392eUL, 0xe57cc2a9UL, 0x3e34eda3UL, + 0xe0000000UL, 0x3fe92b65UL, 0x8c75b544UL, 0x3e5766a0UL, 0xc0000000UL, + 0x3fe91da1UL, 0x37d1d087UL, 0xbe5e2ab1UL, 0x80000000UL, 0x3fe90fe1UL, + 0xa953dc20UL, 0x3e5fa1f3UL, 0x80000000UL, 0x3fe90225UL, 0xdbd3f369UL, + 0x3e47d6dbUL, 0xa0000000UL, 0x3fe8f46dUL, 0x1c9be989UL, 0xbe5e2b0aUL, + 0xa0000000UL, 0x3fe8e6b9UL, 0x3c93d76aUL, 0x3e5c8618UL, 0xe0000000UL, + 0x3fe8d909UL, 0x2182fc9aUL, 0xbe41aa9eUL, 0x20000000UL, 0x3fe8cb5eUL, + 0xe6b3539dUL, 0xbe530d19UL, 0x60000000UL, 0x3fe8bdb6UL, 0x49e58cc3UL, + 0xbe3bb374UL, 0xa0000000UL, 0x3fe8b012UL, 0xa7cfeb8fUL, 0x3e56c412UL, + 0x00000000UL, 0x3fe8a273UL, 0x8d52bc19UL, 0x3e1429b8UL, 0x60000000UL, + 0x3fe894d7UL, 0x4dc32c6cUL, 0xbe48604cUL, 0xc0000000UL, 0x3fe8873fUL, + 0x0c868e56UL, 0xbe564ee5UL, 0x00000000UL, 0x3fe879acUL, 0x56aee828UL, + 0x3e5e2fd8UL, 0x60000000UL, 0x3fe86c1cUL, 0x7ceab8ecUL, 0x3e493365UL, + 0xc0000000UL, 0x3fe85e90UL, 0x78d4dadcUL, 0xbe4f7f25UL, 0x00000000UL, + 0x3fe85109UL, 0x0ccd8280UL, 0x3e31e7a2UL, 0x40000000UL, 0x3fe84385UL, + 0x34ba4e15UL, 0x3e328077UL, 0x80000000UL, 0x3fe83605UL, 0xa670975aUL, + 0xbe53eee5UL, 0xa0000000UL, 0x3fe82889UL, 0xf61b77b2UL, 0xbe43a20aUL, + 0xa0000000UL, 0x3fe81b11UL, 0x13e6643bUL, 0x3e5e5fe5UL, 0xc0000000UL, + 0x3fe80d9dUL, 0x82cc94e8UL, 0xbe5ff1f9UL, 0xa0000000UL, 0x3fe8002dUL, + 0x8a0c9c5dUL, 0xbe42b0e7UL, 0x60000000UL, 0x3fe7f2c1UL, 0x22a16f01UL, + 0x3e5d9ea0UL, 0x20000000UL, 0x3fe7e559UL, 0xc38cd451UL, 0x3e506963UL, + 0xc0000000UL, 0x3fe7d7f4UL, 0x9902bc71UL, 0x3e4503d7UL, 0x40000000UL, + 0x3fe7ca94UL, 0xdef2a3c0UL, 0x3e3d98edUL, 0xa0000000UL, 0x3fe7bd37UL, + 0xed49abb0UL, 0x3e24c1ffUL, 0xe0000000UL, 0x3fe7afdeUL, 0xe3b0be70UL, + 0xbe40c467UL, 0x00000000UL, 0x3fe7a28aUL, 0xaf9f193cUL, 0xbe5dff6cUL, + 0xe0000000UL, 0x3fe79538UL, 0xb74cf6b6UL, 0xbe258ed0UL, 0xa0000000UL, + 0x3fe787ebUL, 0x1d9127c7UL, 0x3e345fb0UL, 0x40000000UL, 0x3fe77aa2UL, + 0x1028c21dUL, 0xbe4619bdUL, 0xa0000000UL, 0x3fe76d5cUL, 0x7cb0b5e4UL, + 0x3e40f1a2UL, 0xe0000000UL, 0x3fe7601aUL, 0x2b1bc4adUL, 0xbe32e8bbUL, + 0xe0000000UL, 0x3fe752dcUL, 0x6839f64eUL, 0x3e41f57bUL, 0xc0000000UL, + 0x3fe745a2UL, 0xc4121f7eUL, 0xbe52c40aUL, 0x60000000UL, 0x3fe7386cUL, + 0xd6852d72UL, 0xbe5c4e6bUL, 0xc0000000UL, 0x3fe72b39UL, 0x91d690f7UL, + 0xbe57f88fUL, 0xe0000000UL, 0x3fe71e0aUL, 0x627a2159UL, 0xbe4425d5UL, + 0xc0000000UL, 0x3fe710dfUL, 0x50a54033UL, 0x3e422b7eUL, 0x60000000UL, + 0x3fe703b8UL, 0x3b0b5f91UL, 0x3e5d3857UL, 0xe0000000UL, 0x3fe6f694UL, + 0x84d628a2UL, 0xbe51f090UL, 0x00000000UL, 0x3fe6e975UL, 0x306d8894UL, + 0xbe414d83UL, 0xe0000000UL, 0x3fe6dc58UL, 0x30bf24aaUL, 0xbe4650caUL, + 0x80000000UL, 0x3fe6cf40UL, 0xd4628d69UL, 0xbe5db007UL, 0xc0000000UL, + 0x3fe6c22bUL, 0xa2aae57bUL, 0xbe31d279UL, 0xc0000000UL, 0x3fe6b51aUL, + 0x860edf7eUL, 0xbe2d4c4aUL, 0x80000000UL, 0x3fe6a80dUL, 0xf3559341UL, + 0xbe5f7e98UL, 0xe0000000UL, 0x3fe69b03UL, 0xa885899eUL, 0xbe5c2011UL, + 0xe0000000UL, 0x3fe68dfdUL, 0x2bdc6d37UL, 0x3e224a82UL, 0xa0000000UL, + 0x3fe680fbUL, 0xc12ad1b9UL, 0xbe40cf56UL, 0x00000000UL, 0x3fe673fdUL, + 0x1bcdf659UL, 0xbdf52f2dUL, 0x00000000UL, 0x3fe66702UL, 0x5df10408UL, + 0x3e5663e0UL, 0xc0000000UL, 0x3fe65a0aUL, 0xa4070568UL, 0xbe40b12fUL, + 0x00000000UL, 0x3fe64d17UL, 0x71c54c47UL, 0x3e5f5e8bUL, 0x00000000UL, + 0x3fe64027UL, 0xbd4b7e83UL, 0x3e42ead6UL, 0xa0000000UL, 0x3fe6333aUL, + 0x61598bd2UL, 0xbe4c48d4UL, 0xc0000000UL, 0x3fe62651UL, 0x6f538d61UL, + 0x3e548401UL, 0xa0000000UL, 0x3fe6196cUL, 0x14344120UL, 0xbe529af6UL, + 0x00000000UL, 0x3fe60c8bUL, 0x5982c587UL, 0xbe3e1e4fUL, 0x00000000UL, + 0x3fe5ffadUL, 0xfe51d4eaUL, 0xbe4c897aUL, 0x80000000UL, 0x3fe5f2d2UL, + 0xfd46ebe1UL, 0x3e552e00UL, 0xa0000000UL, 0x3fe5e5fbUL, 0xa4695699UL, + 0x3e5ed471UL, 0x60000000UL, 0x3fe5d928UL, 0x80d118aeUL, 0x3e456b61UL, + 0xa0000000UL, 0x3fe5cc58UL, 0x304c330bUL, 0x3e54dc29UL, 0x80000000UL, + 0x3fe5bf8cUL, 0x0af2dedfUL, 0xbe3aa9bdUL, 0xe0000000UL, 0x3fe5b2c3UL, + 0x15fc9258UL, 0xbe479a37UL, 0xc0000000UL, 0x3fe5a5feUL, 0x9292c7eaUL, + 0x3e188650UL, 0x20000000UL, 0x3fe5993dUL, 0x33b4d380UL, 0x3e5d6d93UL, + 0x20000000UL, 0x3fe58c7fUL, 0x02fd16c7UL, 0x3e2fe961UL, 0xa0000000UL, + 0x3fe57fc4UL, 0x4a05edb6UL, 0xbe4d55b4UL, 0xa0000000UL, 0x3fe5730dUL, + 0x3d443abbUL, 0xbe5e6954UL, 0x00000000UL, 0x3fe5665aUL, 0x024acfeaUL, + 0x3e50e61bUL, 0x00000000UL, 0x3fe559aaUL, 0xcc9edd09UL, 0xbe325403UL, + 0x60000000UL, 0x3fe54cfdUL, 0x1fe26950UL, 0x3e5d500eUL, 0x60000000UL, + 0x3fe54054UL, 0x6c5ae164UL, 0xbe4a79b4UL, 0xc0000000UL, 0x3fe533aeUL, + 0x154b0287UL, 0xbe401571UL, 0xa0000000UL, 0x3fe5270cUL, 0x0673f401UL, + 0xbe56e56bUL, 0xe0000000UL, 0x3fe51a6dUL, 0x751b639cUL, 0x3e235269UL, + 0xa0000000UL, 0x3fe50dd2UL, 0x7c7b2bedUL, 0x3ddec887UL, 0xc0000000UL, + 0x3fe5013aUL, 0xafab4e17UL, 0x3e5e7575UL, 0x60000000UL, 0x3fe4f4a6UL, + 0x2e308668UL, 0x3e59aed6UL, 0x80000000UL, 0x3fe4e815UL, 0xf33e2a76UL, + 0xbe51f184UL, 0xe0000000UL, 0x3fe4db87UL, 0x839f3e3eUL, 0x3e57db01UL, + 0xc0000000UL, 0x3fe4cefdUL, 0xa9eda7bbUL, 0x3e535e0fUL, 0x00000000UL, + 0x3fe4c277UL, 0x2a8f66a5UL, 0x3e5ce451UL, 0xc0000000UL, 0x3fe4b5f3UL, + 0x05192456UL, 0xbe4e8518UL, 0xc0000000UL, 0x3fe4a973UL, 0x4aa7cd1dUL, + 0x3e46784aUL, 0x40000000UL, 0x3fe49cf7UL, 0x8e23025eUL, 0xbe5749f2UL, + 0x00000000UL, 0x3fe4907eUL, 0x18d30215UL, 0x3e360f39UL, 0x20000000UL, + 0x3fe48408UL, 0x63dcf2f3UL, 0x3e5e00feUL, 0xc0000000UL, 0x3fe47795UL, + 0x46182d09UL, 0xbe5173d9UL, 0xa0000000UL, 0x3fe46b26UL, 0x8f0e62aaUL, + 0xbe48f281UL, 0xe0000000UL, 0x3fe45ebaUL, 0x5775c40cUL, 0xbe56aad4UL, + 0x60000000UL, 0x3fe45252UL, 0x0fe25f69UL, 0x3e48bd71UL, 0x40000000UL, + 0x3fe445edUL, 0xe9989ec5UL, 0x3e590d97UL, 0x80000000UL, 0x3fe4398bUL, + 0xb3d9ffe3UL, 0x3e479dbcUL, 0x20000000UL, 0x3fe42d2dUL, 0x388e4d2eUL, + 0xbe5eed80UL, 0xe0000000UL, 0x3fe420d1UL, 0x6f797c18UL, 0x3e554b4cUL, + 0x20000000UL, 0x3fe4147aUL, 0x31048bb4UL, 0xbe5b1112UL, 0x80000000UL, + 0x3fe40825UL, 0x2efba4f9UL, 0x3e48ebc7UL, 0x40000000UL, 0x3fe3fbd4UL, + 0x50201119UL, 0x3e40b701UL, 0x40000000UL, 0x3fe3ef86UL, 0x0a4db32cUL, + 0x3e551de8UL, 0xa0000000UL, 0x3fe3e33bUL, 0x0c9c148bUL, 0xbe50c1f6UL, + 0x20000000UL, 0x3fe3d6f4UL, 0xc9129447UL, 0x3e533fa0UL, 0x00000000UL, + 0x3fe3cab0UL, 0xaae5b5a0UL, 0xbe22b68eUL, 0x20000000UL, 0x3fe3be6fUL, + 0x02305e8aUL, 0xbe54fc08UL, 0x60000000UL, 0x3fe3b231UL, 0x7f908258UL, + 0x3e57dc05UL, 0x00000000UL, 0x3fe3a5f7UL, 0x1a09af78UL, 0x3e08038bUL, + 0xe0000000UL, 0x3fe399bfUL, 0x490643c1UL, 0xbe5dbe42UL, 0xe0000000UL, + 0x3fe38d8bUL, 0x5e8ad724UL, 0xbe3c2b72UL, 0x20000000UL, 0x3fe3815bUL, + 0xc67196b6UL, 0x3e1713cfUL, 0xa0000000UL, 0x3fe3752dUL, 0x6182e429UL, + 0xbe3ec14cUL, 0x40000000UL, 0x3fe36903UL, 0xab6eb1aeUL, 0x3e5a2cc5UL, + 0x40000000UL, 0x3fe35cdcUL, 0xfe5dc064UL, 0xbe5c5878UL, 0x40000000UL, + 0x3fe350b8UL, 0x0ba6b9e4UL, 0x3e51619bUL, 0x80000000UL, 0x3fe34497UL, + 0x857761aaUL, 0x3e5fff53UL, 0x00000000UL, 0x3fe3387aUL, 0xf872d68cUL, + 0x3e484f4dUL, 0xa0000000UL, 0x3fe32c5fUL, 0x087e97c2UL, 0x3e52842eUL, + 0x80000000UL, 0x3fe32048UL, 0x73d6d0c0UL, 0xbe503edfUL, 0x80000000UL, + 0x3fe31434UL, 0x0c1456a1UL, 0xbe5f72adUL, 0xa0000000UL, 0x3fe30823UL, + 0x83a1a4d5UL, 0xbe5e65ccUL, 0xe0000000UL, 0x3fe2fc15UL, 0x855a7390UL, + 0xbe506438UL, 0x40000000UL, 0x3fe2f00bUL, 0xa2898287UL, 0x3e3d22a2UL, + 0xe0000000UL, 0x3fe2e403UL, 0x8b56f66fUL, 0xbe5aa5fdUL, 0x80000000UL, + 0x3fe2d7ffUL, 0x52db119aUL, 0x3e3a2e3dUL, 0x60000000UL, 0x3fe2cbfeUL, + 0xe2ddd4c0UL, 0xbe586469UL, 0x40000000UL, 0x3fe2c000UL, 0x6b01bf10UL, + 0x3e352b9dUL, 0x40000000UL, 0x3fe2b405UL, 0xb07a1cdfUL, 0x3e5c5cdaUL, + 0x80000000UL, 0x3fe2a80dUL, 0xc7b5f868UL, 0xbe5668b3UL, 0xc0000000UL, + 0x3fe29c18UL, 0x185edf62UL, 0xbe563d66UL, 0x00000000UL, 0x3fe29027UL, + 0xf729e1ccUL, 0x3e59a9a0UL, 0x80000000UL, 0x3fe28438UL, 0x6433c727UL, + 0xbe43cc89UL, 0x00000000UL, 0x3fe2784dUL, 0x41782631UL, 0xbe30750cUL, + 0xa0000000UL, 0x3fe26c64UL, 0x914911b7UL, 0xbe58290eUL, 0x40000000UL, + 0x3fe2607fUL, 0x3dcc73e1UL, 0xbe4269cdUL, 0x00000000UL, 0x3fe2549dUL, + 0x2751bf70UL, 0xbe5a6998UL, 0xc0000000UL, 0x3fe248bdUL, 0x4248b9fbUL, + 0xbe4ddb00UL, 0x80000000UL, 0x3fe23ce1UL, 0xf35cf82fUL, 0x3e561b71UL, + 0x60000000UL, 0x3fe23108UL, 0x8e481a2dUL, 0x3e518fb9UL, 0x60000000UL, + 0x3fe22532UL, 0x5ab96edcUL, 0xbe5fafc5UL, 0x40000000UL, 0x3fe2195fUL, + 0x80943911UL, 0xbe07f819UL, 0x40000000UL, 0x3fe20d8fUL, 0x386f2d6cUL, + 0xbe54ba8bUL, 0x40000000UL, 0x3fe201c2UL, 0xf29664acUL, 0xbe5eb815UL, + 0x20000000UL, 0x3fe1f5f8UL, 0x64f03390UL, 0x3e5e320cUL, 0x20000000UL, + 0x3fe1ea31UL, 0x747ff696UL, 0x3e5ef0a5UL, 0x40000000UL, 0x3fe1de6dUL, + 0x3e9ceb51UL, 0xbe5f8d27UL, 0x20000000UL, 0x3fe1d2acUL, 0x4ae0b55eUL, + 0x3e5faa21UL, 0x20000000UL, 0x3fe1c6eeUL, 0x28569a5eUL, 0x3e598a4fUL, + 0x20000000UL, 0x3fe1bb33UL, 0x54b33e07UL, 0x3e46130aUL, 0x20000000UL, + 0x3fe1af7bUL, 0x024f1078UL, 0xbe4dbf93UL, 0x00000000UL, 0x3fe1a3c6UL, + 0xb0783bfaUL, 0x3e419248UL, 0xe0000000UL, 0x3fe19813UL, 0x2f02b836UL, + 0x3e4e02b7UL, 0xc0000000UL, 0x3fe18c64UL, 0x28dec9d4UL, 0x3e09064fUL, + 0x80000000UL, 0x3fe180b8UL, 0x45cbf406UL, 0x3e5b1f46UL, 0x40000000UL, + 0x3fe1750fUL, 0x03d9964cUL, 0x3e5b0a79UL, 0x00000000UL, 0x3fe16969UL, + 0x8b5b882bUL, 0xbe238086UL, 0xa0000000UL, 0x3fe15dc5UL, 0x73bad6f8UL, + 0xbdf1fca4UL, 0x20000000UL, 0x3fe15225UL, 0x5385769cUL, 0x3e5e8d76UL, + 0xa0000000UL, 0x3fe14687UL, 0x1676dc6bUL, 0x3e571d08UL, 0x20000000UL, + 0x3fe13aedUL, 0xa8c41c7fUL, 0xbe598a25UL, 0x60000000UL, 0x3fe12f55UL, + 0xc4e1aaf0UL, 0x3e435277UL, 0xa0000000UL, 0x3fe123c0UL, 0x403638e1UL, + 0xbe21aa7cUL, 0xc0000000UL, 0x3fe1182eUL, 0x557a092bUL, 0xbdd0116bUL, + 0xc0000000UL, 0x3fe10c9fUL, 0x7d779f66UL, 0x3e4a61baUL, 0xc0000000UL, + 0x3fe10113UL, 0x2b09c645UL, 0xbe5d586eUL, 0x20000000UL, 0x3fe0ea04UL, + 0xea2cad46UL, 0x3e5aa97cUL, 0x20000000UL, 0x3fe0d300UL, 0x23190e54UL, + 0x3e50f1a7UL, 0xa0000000UL, 0x3fe0bc07UL, 0x1379a5a6UL, 0xbe51619dUL, + 0x60000000UL, 0x3fe0a51aUL, 0x926a3d4aUL, 0x3e5cf019UL, 0xa0000000UL, + 0x3fe08e38UL, 0xa8c24358UL, 0x3e35241eUL, 0x20000000UL, 0x3fe07762UL, + 0x24317e7aUL, 0x3e512cfaUL, 0x00000000UL, 0x3fe06097UL, 0xfd9cf274UL, + 0xbe55bef3UL, 0x00000000UL, 0x3fe049d7UL, 0x3689b49dUL, 0xbe36d26dUL, + 0x40000000UL, 0x3fe03322UL, 0xf72ef6c4UL, 0xbe54cd08UL, 0xa0000000UL, + 0x3fe01c78UL, 0x23702d2dUL, 0xbe5900bfUL, 0x00000000UL, 0x3fe005daUL, + 0x3f59c14cUL, 0x3e57d80bUL, 0x40000000UL, 0x3fdfde8dUL, 0xad67766dUL, + 0xbe57fad4UL, 0x40000000UL, 0x3fdfb17cUL, 0x644f4ae7UL, 0x3e1ee43bUL, + 0x40000000UL, 0x3fdf8481UL, 0x903234d2UL, 0x3e501a86UL, 0x40000000UL, + 0x3fdf579cUL, 0xafe9e509UL, 0xbe267c3eUL, 0x00000000UL, 0x3fdf2acdUL, + 0xb7dfda0bUL, 0xbe48149bUL, 0x40000000UL, 0x3fdefe13UL, 0x3b94305eUL, + 0x3e5f4ea7UL, 0x80000000UL, 0x3fded16fUL, 0x5d95da61UL, 0xbe55c198UL, + 0x00000000UL, 0x3fdea4e1UL, 0x406960c9UL, 0xbdd99a19UL, 0x00000000UL, + 0x3fde7868UL, 0xd22f3539UL, 0x3e470c78UL, 0x80000000UL, 0x3fde4c04UL, + 0x83eec535UL, 0xbe3e1232UL, 0x40000000UL, 0x3fde1fb6UL, 0x3dfbffcbUL, + 0xbe4b7d71UL, 0x40000000UL, 0x3fddf37dUL, 0x7e1be4e0UL, 0xbe5b8f8fUL, + 0x40000000UL, 0x3fddc759UL, 0x46dae887UL, 0xbe350458UL, 0x80000000UL, + 0x3fdd9b4aUL, 0xed6ecc49UL, 0xbe5f0045UL, 0x80000000UL, 0x3fdd6f50UL, + 0x2e9e883cUL, 0x3e2915daUL, 0x80000000UL, 0x3fdd436bUL, 0xf0bccb32UL, + 0x3e4a68c9UL, 0x80000000UL, 0x3fdd179bUL, 0x9bbfc779UL, 0xbe54a26aUL, + 0x00000000UL, 0x3fdcebe0UL, 0x7cea33abUL, 0x3e43c6b7UL, 0x40000000UL, + 0x3fdcc039UL, 0xe740fd06UL, 0x3e5526c2UL, 0x40000000UL, 0x3fdc94a7UL, + 0x9eadeb1aUL, 0xbe396d8dUL, 0xc0000000UL, 0x3fdc6929UL, 0xf0a8f95aUL, + 0xbe5c0ab2UL, 0x80000000UL, 0x3fdc3dc0UL, 0x6ee2693bUL, 0x3e0992e6UL, + 0xc0000000UL, 0x3fdc126bUL, 0x5ac6b581UL, 0xbe2834b6UL, 0x40000000UL, + 0x3fdbe72bUL, 0x8cc226ffUL, 0x3e3596a6UL, 0x00000000UL, 0x3fdbbbffUL, + 0xf92a74bbUL, 0x3e3c5813UL, 0x00000000UL, 0x3fdb90e7UL, 0x479664c0UL, + 0xbe50d644UL, 0x00000000UL, 0x3fdb65e3UL, 0x5004975bUL, 0xbe55258fUL, + 0x00000000UL, 0x3fdb3af3UL, 0xe4b23194UL, 0xbe588407UL, 0xc0000000UL, + 0x3fdb1016UL, 0xe65d4d0aUL, 0x3e527c26UL, 0x80000000UL, 0x3fdae54eUL, + 0x814fddd6UL, 0x3e5962a2UL, 0x40000000UL, 0x3fdaba9aUL, 0xe19d0913UL, + 0xbe562f4eUL, 0x80000000UL, 0x3fda8ff9UL, 0x43cfd006UL, 0xbe4cfdebUL, + 0x40000000UL, 0x3fda656cUL, 0x686f0a4eUL, 0x3e5e47a8UL, 0xc0000000UL, + 0x3fda3af2UL, 0x7200d410UL, 0x3e5e1199UL, 0xc0000000UL, 0x3fda108cUL, + 0xabd2266eUL, 0x3e5ee4d1UL, 0x40000000UL, 0x3fd9e63aUL, 0x396f8f2cUL, + 0x3e4dbffbUL, 0x00000000UL, 0x3fd9bbfbUL, 0xe32b25ddUL, 0x3e5c3a54UL, + 0x40000000UL, 0x3fd991cfUL, 0x431e4035UL, 0xbe457925UL, 0x80000000UL, + 0x3fd967b6UL, 0x7bed3dd3UL, 0x3e40c61dUL, 0x00000000UL, 0x3fd93db1UL, + 0xd7449365UL, 0x3e306419UL, 0x80000000UL, 0x3fd913beUL, 0x1746e791UL, + 0x3e56fcfcUL, 0x40000000UL, 0x3fd8e9dfUL, 0xf3a9028bUL, 0xbe5041b9UL, + 0xc0000000UL, 0x3fd8c012UL, 0x56840c50UL, 0xbe26e20aUL, 0x40000000UL, + 0x3fd89659UL, 0x19763102UL, 0xbe51f466UL, 0x80000000UL, 0x3fd86cb2UL, + 0x7032de7cUL, 0xbe4d298aUL, 0x80000000UL, 0x3fd8431eUL, 0xdeb39fabUL, + 0xbe4361ebUL, 0x40000000UL, 0x3fd8199dUL, 0x5d01cbe0UL, 0xbe5425b3UL, + 0x80000000UL, 0x3fd7f02eUL, 0x3ce99aa9UL, 0x3e146fa8UL, 0x80000000UL, + 0x3fd7c6d2UL, 0xd1a262b9UL, 0xbe5a1a69UL, 0xc0000000UL, 0x3fd79d88UL, + 0x8606c236UL, 0x3e423a08UL, 0x80000000UL, 0x3fd77451UL, 0x8fd1e1b7UL, + 0x3e5a6a63UL, 0xc0000000UL, 0x3fd74b2cUL, 0xe491456aUL, 0x3e42c1caUL, + 0x40000000UL, 0x3fd7221aUL, 0x4499a6d7UL, 0x3e36a69aUL, 0x00000000UL, + 0x3fd6f91aUL, 0x5237df94UL, 0xbe0f8f02UL, 0x00000000UL, 0x3fd6d02cUL, + 0xb6482c6eUL, 0xbe5abcf7UL, 0x00000000UL, 0x3fd6a750UL, 0x1919fd61UL, + 0xbe57ade2UL, 0x00000000UL, 0x3fd67e86UL, 0xaa7a994dUL, 0xbe3f3fbdUL, + 0x00000000UL, 0x3fd655ceUL, 0x67db014cUL, 0x3e33c550UL, 0x00000000UL, + 0x3fd62d28UL, 0xa82856b7UL, 0xbe1409d1UL, 0xc0000000UL, 0x3fd60493UL, + 0x1e6a300dUL, 0x3e55d899UL, 0x80000000UL, 0x3fd5dc11UL, 0x1222bd5cUL, + 0xbe35bfc0UL, 0xc0000000UL, 0x3fd5b3a0UL, 0x6e8dc2d3UL, 0x3e5d4d79UL, + 0x00000000UL, 0x3fd58b42UL, 0xe0e4ace6UL, 0xbe517303UL, 0x80000000UL, + 0x3fd562f4UL, 0xb306e0a8UL, 0x3e5edf0fUL, 0xc0000000UL, 0x3fd53ab8UL, + 0x6574bc54UL, 0x3e5ee859UL, 0x80000000UL, 0x3fd5128eUL, 0xea902207UL, + 0x3e5f6188UL, 0xc0000000UL, 0x3fd4ea75UL, 0x9f911d79UL, 0x3e511735UL, + 0x80000000UL, 0x3fd4c26eUL, 0xf9c77397UL, 0xbe5b1643UL, 0x40000000UL, + 0x3fd49a78UL, 0x15fc9258UL, 0x3e479a37UL, 0x80000000UL, 0x3fd47293UL, + 0xd5a04dd9UL, 0xbe426e56UL, 0xc0000000UL, 0x3fd44abfUL, 0xe04042f5UL, + 0x3e56f7c6UL, 0x40000000UL, 0x3fd422fdUL, 0x1d8bf2c8UL, 0x3e5d8810UL, + 0x00000000UL, 0x3fd3fb4cUL, 0x88a8ddeeUL, 0xbe311454UL, 0xc0000000UL, + 0x3fd3d3abUL, 0x3e3b5e47UL, 0xbe5d1b72UL, 0x40000000UL, 0x3fd3ac1cUL, + 0xc2ab5d59UL, 0x3e31b02bUL, 0xc0000000UL, 0x3fd3849dUL, 0xd4e34b9eUL, + 0x3e51cb2fUL, 0x40000000UL, 0x3fd35d30UL, 0x177204fbUL, 0xbe2b8cd7UL, + 0x80000000UL, 0x3fd335d3UL, 0xfcd38c82UL, 0xbe4356e1UL, 0x80000000UL, + 0x3fd30e87UL, 0x64f54accUL, 0xbe4e6224UL, 0x00000000UL, 0x3fd2e74cUL, + 0xaa7975d9UL, 0x3e5dc0feUL, 0x80000000UL, 0x3fd2c021UL, 0x516dab3fUL, + 0xbe50ffa3UL, 0x40000000UL, 0x3fd29907UL, 0x2bfb7313UL, 0x3e5674a2UL, + 0xc0000000UL, 0x3fd271fdUL, 0x0549fc99UL, 0x3e385d29UL, 0xc0000000UL, + 0x3fd24b04UL, 0x55b63073UL, 0xbe500c6dUL, 0x00000000UL, 0x3fd2241cUL, + 0x3f91953aUL, 0x3e389977UL, 0xc0000000UL, 0x3fd1fd43UL, 0xa1543f71UL, + 0xbe3487abUL, 0xc0000000UL, 0x3fd1d67bUL, 0x4ec8867cUL, 0x3df6a2dcUL, + 0x00000000UL, 0x3fd1afc4UL, 0x4328e3bbUL, 0x3e41d9c0UL, 0x80000000UL, + 0x3fd1891cUL, 0x2e1cda84UL, 0x3e3bdd87UL, 0x40000000UL, 0x3fd16285UL, + 0x4b5331aeUL, 0xbe53128eUL, 0x00000000UL, 0x3fd13bfeUL, 0xb9aec164UL, + 0xbe52ac98UL, 0xc0000000UL, 0x3fd11586UL, 0xd91e1316UL, 0xbe350630UL, + 0x80000000UL, 0x3fd0ef1fUL, 0x7cacc12cUL, 0x3e3f5219UL, 0x40000000UL, + 0x3fd0c8c8UL, 0xbce277b7UL, 0x3e3d30c0UL, 0x00000000UL, 0x3fd0a281UL, + 0x2a63447dUL, 0xbe541377UL, 0x80000000UL, 0x3fd07c49UL, 0xfac483b5UL, + 0xbe5772ecUL, 0xc0000000UL, 0x3fd05621UL, 0x36b8a570UL, 0xbe4fd4bdUL, + 0xc0000000UL, 0x3fd03009UL, 0xbae505f7UL, 0xbe450388UL, 0x80000000UL, + 0x3fd00a01UL, 0x3e35aeadUL, 0xbe5430fcUL, 0x80000000UL, 0x3fcfc811UL, + 0x707475acUL, 0x3e38806eUL, 0x80000000UL, 0x3fcf7c3fUL, 0xc91817fcUL, + 0xbe40cceaUL, 0x80000000UL, 0x3fcf308cUL, 0xae05d5e9UL, 0xbe4919b8UL, + 0x80000000UL, 0x3fcee4f8UL, 0xae6cc9e6UL, 0xbe530b94UL, 0x00000000UL, + 0x3fce9983UL, 0x1efe3e8eUL, 0x3e57747eUL, 0x00000000UL, 0x3fce4e2dUL, + 0xda78d9bfUL, 0xbe59a608UL, 0x00000000UL, 0x3fce02f5UL, 0x8abe2c2eUL, + 0x3e4a35adUL, 0x00000000UL, 0x3fcdb7dcUL, 0x1495450dUL, 0xbe0872ccUL, + 0x80000000UL, 0x3fcd6ce1UL, 0x86ee0ba0UL, 0xbe4f59a0UL, 0x00000000UL, + 0x3fcd2205UL, 0xe81ca888UL, 0x3e5402c3UL, 0x00000000UL, 0x3fccd747UL, + 0x3b4424b9UL, 0x3e5dfdc3UL, 0x80000000UL, 0x3fcc8ca7UL, 0xd305b56cUL, + 0x3e202da6UL, 0x00000000UL, 0x3fcc4226UL, 0x399a6910UL, 0xbe482a1cUL, + 0x80000000UL, 0x3fcbf7c2UL, 0x747f7938UL, 0xbe587372UL, 0x80000000UL, + 0x3fcbad7cUL, 0x6fc246a0UL, 0x3e50d83dUL, 0x00000000UL, 0x3fcb6355UL, + 0xee9e9be5UL, 0xbe5c35bdUL, 0x80000000UL, 0x3fcb194aUL, 0x8416c0bcUL, + 0x3e546d4fUL, 0x00000000UL, 0x3fcacf5eUL, 0x49f7f08fUL, 0x3e56da76UL, + 0x00000000UL, 0x3fca858fUL, 0x5dc30de2UL, 0x3e5f390cUL, 0x00000000UL, + 0x3fca3bdeUL, 0x950583b6UL, 0xbe5e4169UL, 0x80000000UL, 0x3fc9f249UL, + 0x33631553UL, 0x3e52aeb1UL, 0x00000000UL, 0x3fc9a8d3UL, 0xde8795a6UL, + 0xbe59a504UL, 0x00000000UL, 0x3fc95f79UL, 0x076bf41eUL, 0x3e5122feUL, + 0x80000000UL, 0x3fc9163cUL, 0x2914c8e7UL, 0x3e3dd064UL, 0x00000000UL, + 0x3fc8cd1dUL, 0x3a30eca3UL, 0xbe21b4aaUL, 0x80000000UL, 0x3fc8841aUL, + 0xb2a96650UL, 0xbe575444UL, 0x80000000UL, 0x3fc83b34UL, 0x2376c0cbUL, + 0xbe2a74c7UL, 0x80000000UL, 0x3fc7f26bUL, 0xd8a0b653UL, 0xbe5181b6UL, + 0x00000000UL, 0x3fc7a9bfUL, 0x32257882UL, 0xbe4a78b4UL, 0x00000000UL, + 0x3fc7612fUL, 0x1eee8bd9UL, 0xbe1bfe9dUL, 0x80000000UL, 0x3fc718bbUL, + 0x0c603cc4UL, 0x3e36fdc9UL, 0x80000000UL, 0x3fc6d064UL, 0x3728b8cfUL, + 0xbe1e542eUL, 0x80000000UL, 0x3fc68829UL, 0xc79a4067UL, 0x3e5c380fUL, + 0x00000000UL, 0x3fc6400bUL, 0xf69eac69UL, 0x3e550a84UL, 0x80000000UL, + 0x3fc5f808UL, 0xb7a780a4UL, 0x3e5d9224UL, 0x80000000UL, 0x3fc5b022UL, + 0xad9dfb1eUL, 0xbe55242fUL, 0x00000000UL, 0x3fc56858UL, 0x659b18beUL, + 0xbe4bfda3UL, 0x80000000UL, 0x3fc520a9UL, 0x66ee3631UL, 0xbe57d769UL, + 0x80000000UL, 0x3fc4d916UL, 0x1ec62819UL, 0x3e2427f7UL, 0x80000000UL, + 0x3fc4919fUL, 0xdec25369UL, 0xbe435431UL, 0x00000000UL, 0x3fc44a44UL, + 0xa8acfc4bUL, 0xbe3c62e8UL, 0x00000000UL, 0x3fc40304UL, 0xcf1d3eabUL, + 0xbdfba29fUL, 0x80000000UL, 0x3fc3bbdfUL, 0x79aba3eaUL, 0xbdf1b7c8UL, + 0x80000000UL, 0x3fc374d6UL, 0xb8d186daUL, 0xbe5130cfUL, 0x80000000UL, + 0x3fc32de8UL, 0x9d74f152UL, 0x3e2285b6UL, 0x00000000UL, 0x3fc2e716UL, + 0x50ae7ca9UL, 0xbe503920UL, 0x80000000UL, 0x3fc2a05eUL, 0x6caed92eUL, + 0xbe533924UL, 0x00000000UL, 0x3fc259c2UL, 0x9cb5034eUL, 0xbe510e31UL, + 0x80000000UL, 0x3fc21340UL, 0x12c4d378UL, 0xbe540b43UL, 0x80000000UL, + 0x3fc1ccd9UL, 0xcc418706UL, 0x3e59887aUL, 0x00000000UL, 0x3fc1868eUL, + 0x921f4106UL, 0xbe528e67UL, 0x80000000UL, 0x3fc1405cUL, 0x3969441eUL, + 0x3e5d8051UL, 0x00000000UL, 0x3fc0fa46UL, 0xd941ef5bUL, 0x3e5f9079UL, + 0x80000000UL, 0x3fc0b44aUL, 0x5a3e81b2UL, 0xbe567691UL, 0x00000000UL, + 0x3fc06e69UL, 0x9d66afe7UL, 0xbe4d43fbUL, 0x00000000UL, 0x3fc028a2UL, + 0x0a92a162UL, 0xbe52f394UL, 0x00000000UL, 0x3fbfc5eaUL, 0x209897e5UL, + 0x3e529e37UL, 0x00000000UL, 0x3fbf3ac5UL, 0x8458bd7bUL, 0x3e582831UL, + 0x00000000UL, 0x3fbeafd5UL, 0xb8d8b4b8UL, 0xbe486b4aUL, 0x00000000UL, + 0x3fbe2518UL, 0xe0a3b7b6UL, 0x3e5bafd2UL, 0x00000000UL, 0x3fbd9a90UL, + 0x2bf2710eUL, 0x3e383b2bUL, 0x00000000UL, 0x3fbd103cUL, 0x73eb6ab7UL, + 0xbe56d78dUL, 0x00000000UL, 0x3fbc861bUL, 0x32ceaff5UL, 0xbe32dc5aUL, + 0x00000000UL, 0x3fbbfc2eUL, 0xbee04cb7UL, 0xbe4a71a4UL, 0x00000000UL, + 0x3fbb7274UL, 0x35ae9577UL, 0x3e38142fUL, 0x00000000UL, 0x3fbae8eeUL, + 0xcbaddab4UL, 0xbe5490f0UL, 0x00000000UL, 0x3fba5f9aUL, 0x95ce1114UL, + 0x3e597c71UL, 0x00000000UL, 0x3fb9d67aUL, 0x6d7c0f78UL, 0x3e3abc2dUL, + 0x00000000UL, 0x3fb94d8dUL, 0x2841a782UL, 0xbe566cbcUL, 0x00000000UL, + 0x3fb8c4d2UL, 0x6ed429c6UL, 0xbe3cfff9UL, 0x00000000UL, 0x3fb83c4aUL, + 0xe4a49fbbUL, 0xbe552964UL, 0x00000000UL, 0x3fb7b3f4UL, 0x2193d81eUL, + 0xbe42fa72UL, 0x00000000UL, 0x3fb72bd0UL, 0xdd70c122UL, 0x3e527a8cUL, + 0x00000000UL, 0x3fb6a3dfUL, 0x03108a54UL, 0xbe450393UL, 0x00000000UL, + 0x3fb61c1fUL, 0x30ff7954UL, 0x3e565840UL, 0x00000000UL, 0x3fb59492UL, + 0xdedd460cUL, 0xbe5422b5UL, 0x00000000UL, 0x3fb50d36UL, 0x950f9f45UL, + 0xbe5313f6UL, 0x00000000UL, 0x3fb4860bUL, 0x582cdcb1UL, 0x3e506d39UL, + 0x00000000UL, 0x3fb3ff12UL, 0x7216d3a6UL, 0x3e4aa719UL, 0x00000000UL, + 0x3fb3784aUL, 0x57a423fdUL, 0x3e5a9b9fUL, 0x00000000UL, 0x3fb2f1b4UL, + 0x7a138b41UL, 0xbe50b418UL, 0x00000000UL, 0x3fb26b4eUL, 0x2fbfd7eaUL, + 0x3e23a53eUL, 0x00000000UL, 0x3fb1e519UL, 0x18913ccbUL, 0x3e465fc1UL, + 0x00000000UL, 0x3fb15f15UL, 0x7ea24e21UL, 0x3e042843UL, 0x00000000UL, + 0x3fb0d941UL, 0x7c6d9c77UL, 0x3e59f61eUL, 0x00000000UL, 0x3fb0539eUL, + 0x114efd44UL, 0x3e4ccab7UL, 0x00000000UL, 0x3faf9c56UL, 0x1777f657UL, + 0x3e552f65UL, 0x00000000UL, 0x3fae91d2UL, 0xc317b86aUL, 0xbe5a61e0UL, + 0x00000000UL, 0x3fad87acUL, 0xb7664efbUL, 0xbe41f64eUL, 0x00000000UL, + 0x3fac7de6UL, 0x5d3d03a9UL, 0x3e0807a0UL, 0x00000000UL, 0x3fab7480UL, + 0x743c38ebUL, 0xbe3726e1UL, 0x00000000UL, 0x3faa6b78UL, 0x06a253f1UL, + 0x3e5ad636UL, 0x00000000UL, 0x3fa962d0UL, 0xa35f541bUL, 0x3e5a187aUL, + 0x00000000UL, 0x3fa85a88UL, 0x4b86e446UL, 0xbe508150UL, 0x00000000UL, + 0x3fa7529cUL, 0x2589cacfUL, 0x3e52938aUL, 0x00000000UL, 0x3fa64b10UL, + 0xaf6b11f2UL, 0xbe3454cdUL, 0x00000000UL, 0x3fa543e2UL, 0x97506fefUL, + 0xbe5fdec5UL, 0x00000000UL, 0x3fa43d10UL, 0xe75f7dd9UL, 0xbe388dd3UL, + 0x00000000UL, 0x3fa3369cUL, 0xa4139632UL, 0xbdea5177UL, 0x00000000UL, + 0x3fa23086UL, 0x352d6f1eUL, 0xbe565ad6UL, 0x00000000UL, 0x3fa12accUL, + 0x77449eb7UL, 0xbe50d5c7UL, 0x00000000UL, 0x3fa0256eUL, 0x7478da78UL, + 0x3e404724UL, 0x00000000UL, 0x3f9e40dcUL, 0xf59cef7fUL, 0xbe539d0aUL, + 0x00000000UL, 0x3f9c3790UL, 0x1511d43cUL, 0x3e53c2c8UL, 0x00000000UL, + 0x3f9a2f00UL, 0x9b8bff3cUL, 0xbe43b3e1UL, 0x00000000UL, 0x3f982724UL, + 0xad1e22a5UL, 0x3e46f0bdUL, 0x00000000UL, 0x3f962000UL, 0x130d9356UL, + 0x3e475ba0UL, 0x00000000UL, 0x3f941994UL, 0x8f86f883UL, 0xbe513d0bUL, + 0x00000000UL, 0x3f9213dcUL, 0x914d0dc8UL, 0xbe534335UL, 0x00000000UL, + 0x3f900ed8UL, 0x2d73e5e7UL, 0xbe22ba75UL, 0x00000000UL, 0x3f8c1510UL, + 0xc5b7d70eUL, 0x3e599c5dUL, 0x00000000UL, 0x3f880de0UL, 0x8a27857eUL, + 0xbe3d28c8UL, 0x00000000UL, 0x3f840810UL, 0xda767328UL, 0x3e531b3dUL, + 0x00000000UL, 0x3f8003b0UL, 0x77bacaf3UL, 0xbe5f04e3UL, 0x00000000UL, + 0x3f780150UL, 0xdf4b0720UL, 0x3e5a8bffUL, 0x00000000UL, 0x3f6ffc40UL, + 0x34c48e71UL, 0xbe3fcd99UL, 0x00000000UL, 0x3f5ff6c0UL, 0x1ad218afUL, + 0xbe4c78a7UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x80000000UL, + 0x00000000UL, 0xfffff800UL, 0x00000000UL, 0xfffff800UL, 0x00000000UL, + 0x3ff72000UL, 0x161bb241UL, 0xbf5dabe1UL, 0x6dc96112UL, 0xbf836578UL, + 0xee241472UL, 0xbf9b0301UL, 0x9f95985aUL, 0xbfb528dbUL, 0xb3841d2aUL, + 0xbfd619b6UL, 0x518775e3UL, 0x3f9004f2UL, 0xac8349bbUL, 0x3fa76c9bUL, + 0x486ececcUL, 0x3fc4635eUL, 0x161bb241UL, 0xbf5dabe1UL, 0x9f95985aUL, + 0xbfb528dbUL, 0xf8b5787dUL, 0x3ef2531eUL, 0x486ececbUL, 0x3fc4635eUL, + 0x412055ccUL, 0xbdd61bb2UL, 0x00000000UL, 0xfffffff8UL, 0x00000000UL, + 0xffffffffUL, 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x3b700000UL, + 0xfa5abcbfUL, 0x3ff00b1aUL, 0xa7609f71UL, 0xbc84f6b2UL, 0xa9fb3335UL, + 0x3ff0163dUL, 0x9ab8cdb7UL, 0x3c9b6129UL, 0x143b0281UL, 0x3ff02168UL, + 0x0fc54eb6UL, 0xbc82bf31UL, 0x3e778061UL, 0x3ff02c9aUL, 0x535b085dUL, + 0xbc719083UL, 0x2e11bbccUL, 0x3ff037d4UL, 0xeeade11aUL, 0x3c656811UL, + 0xe86e7f85UL, 0x3ff04315UL, 0x1977c96eUL, 0xbc90a31cUL, 0x72f654b1UL, + 0x3ff04e5fUL, 0x3aa0d08cUL, 0x3c84c379UL, 0xd3158574UL, 0x3ff059b0UL, + 0xa475b465UL, 0x3c8d73e2UL, 0x0e3c1f89UL, 0x3ff0650aUL, 0x5799c397UL, + 0xbc95cb7bUL, 0x29ddf6deUL, 0x3ff0706bUL, 0xe2b13c27UL, 0xbc8c91dfUL, + 0x2b72a836UL, 0x3ff07bd4UL, 0x54458700UL, 0x3c832334UL, 0x18759bc8UL, + 0x3ff08745UL, 0x4bb284ffUL, 0x3c6186beUL, 0xf66607e0UL, 0x3ff092bdUL, + 0x800a3fd1UL, 0xbc968063UL, 0xcac6f383UL, 0x3ff09e3eUL, 0x18316136UL, + 0x3c914878UL, 0x9b1f3919UL, 0x3ff0a9c7UL, 0x873d1d38UL, 0x3c85d16cUL, + 0x6cf9890fUL, 0x3ff0b558UL, 0x4adc610bUL, 0x3c98a62eUL, 0x45e46c85UL, + 0x3ff0c0f1UL, 0x06d21cefUL, 0x3c94f989UL, 0x2b7247f7UL, 0x3ff0cc92UL, + 0x16e24f71UL, 0x3c901edcUL, 0x23395decUL, 0x3ff0d83bUL, 0xe43f316aUL, + 0xbc9bc14dUL, 0x32d3d1a2UL, 0x3ff0e3ecUL, 0x27c57b52UL, 0x3c403a17UL, + 0x5fdfa9c5UL, 0x3ff0efa5UL, 0xbc54021bUL, 0xbc949db9UL, 0xaffed31bUL, + 0x3ff0fb66UL, 0xc44ebd7bUL, 0xbc6b9bedUL, 0x28d7233eUL, 0x3ff10730UL, + 0x1692fdd5UL, 0x3c8d46ebUL, 0xd0125b51UL, 0x3ff11301UL, 0x39449b3aUL, + 0xbc96c510UL, 0xab5e2ab6UL, 0x3ff11edbUL, 0xf703fb72UL, 0xbc9ca454UL, + 0xc06c31ccUL, 0x3ff12abdUL, 0xb36ca5c7UL, 0xbc51b514UL, 0x14f204abUL, + 0x3ff136a8UL, 0xba48dcf0UL, 0xbc67108fUL, 0xaea92de0UL, 0x3ff1429aUL, + 0x9af1369eUL, 0xbc932fbfUL, 0x934f312eUL, 0x3ff14e95UL, 0x39bf44abUL, + 0xbc8b91e8UL, 0xc8a58e51UL, 0x3ff15a98UL, 0xb9eeab0aUL, 0x3c82406aUL, + 0x5471c3c2UL, 0x3ff166a4UL, 0x82ea1a32UL, 0x3c58f23bUL, 0x3c7d517bUL, + 0x3ff172b8UL, 0xb9d78a76UL, 0xbc819041UL, 0x8695bbc0UL, 0x3ff17ed4UL, + 0xe2ac5a64UL, 0x3c709e3fUL, 0x388c8deaUL, 0x3ff18af9UL, 0xd1970f6cUL, + 0xbc911023UL, 0x58375d2fUL, 0x3ff19726UL, 0x85f17e08UL, 0x3c94aaddUL, + 0xeb6fcb75UL, 0x3ff1a35bUL, 0x7b4968e4UL, 0x3c8e5b4cUL, 0xf8138a1cUL, + 0x3ff1af99UL, 0xa4b69280UL, 0x3c97bf85UL, 0x84045cd4UL, 0x3ff1bbe0UL, + 0x352ef607UL, 0xbc995386UL, 0x95281c6bUL, 0x3ff1c82fUL, 0x8010f8c9UL, + 0x3c900977UL, 0x3168b9aaUL, 0x3ff1d487UL, 0x00a2643cUL, 0x3c9e016eUL, + 0x5eb44027UL, 0x3ff1e0e7UL, 0x088cb6deUL, 0xbc96fdd8UL, 0x22fcd91dUL, + 0x3ff1ed50UL, 0x027bb78cUL, 0xbc91df98UL, 0x8438ce4dUL, 0x3ff1f9c1UL, + 0xa097af5cUL, 0xbc9bf524UL, 0x88628cd6UL, 0x3ff2063bUL, 0x814a8495UL, + 0x3c8dc775UL, 0x3578a819UL, 0x3ff212beUL, 0x2cfcaac9UL, 0x3c93592dUL, + 0x917ddc96UL, 0x3ff21f49UL, 0x9494a5eeUL, 0x3c82a97eUL, 0xa27912d1UL, + 0x3ff22bddUL, 0x5577d69fUL, 0x3c8d34fbUL, 0x6e756238UL, 0x3ff2387aUL, + 0xb6c70573UL, 0x3c99b07eUL, 0xfb82140aUL, 0x3ff2451fUL, 0x911ca996UL, + 0x3c8acfccUL, 0x4fb2a63fUL, 0x3ff251ceUL, 0xbef4f4a4UL, 0x3c8ac155UL, + 0x711ece75UL, 0x3ff25e85UL, 0x4ac31b2cUL, 0x3c93e1a2UL, 0x65e27cddUL, + 0x3ff26b45UL, 0x9940e9d9UL, 0x3c82bd33UL, 0x341ddf29UL, 0x3ff2780eUL, + 0x05f9e76cUL, 0x3c9e067cUL, 0xe1f56381UL, 0x3ff284dfUL, 0x8c3f0d7eUL, + 0xbc9a4c3aUL, 0x7591bb70UL, 0x3ff291baUL, 0x28401cbdUL, 0xbc82cc72UL, + 0xf51fdee1UL, 0x3ff29e9dUL, 0xafad1255UL, 0x3c8612e8UL, 0x66d10f13UL, + 0x3ff2ab8aUL, 0x191690a7UL, 0xbc995743UL, 0xd0dad990UL, 0x3ff2b87fUL, + 0xd6381aa4UL, 0xbc410adcUL, 0x39771b2fUL, 0x3ff2c57eUL, 0xa6eb5124UL, + 0xbc950145UL, 0xa6e4030bUL, 0x3ff2d285UL, 0x54db41d5UL, 0x3c900247UL, + 0x1f641589UL, 0x3ff2df96UL, 0xfbbce198UL, 0x3c9d16cfUL, 0xa93e2f56UL, + 0x3ff2ecafUL, 0x45d52383UL, 0x3c71ca0fUL, 0x4abd886bUL, 0x3ff2f9d2UL, + 0x532bda93UL, 0xbc653c55UL, 0x0a31b715UL, 0x3ff306feUL, 0xd23182e4UL, + 0x3c86f46aUL, 0xedeeb2fdUL, 0x3ff31432UL, 0xf3f3fcd1UL, 0x3c8959a3UL, + 0xfc4cd831UL, 0x3ff32170UL, 0x8e18047cUL, 0x3c8a9ce7UL, 0x3ba8ea32UL, + 0x3ff32eb8UL, 0x3cb4f318UL, 0xbc9c45e8UL, 0xb26416ffUL, 0x3ff33c08UL, + 0x843659a6UL, 0x3c932721UL, 0x66e3fa2dUL, 0x3ff34962UL, 0x930881a4UL, + 0xbc835a75UL, 0x5f929ff1UL, 0x3ff356c5UL, 0x5c4e4628UL, 0xbc8b5ceeUL, + 0xa2de883bUL, 0x3ff36431UL, 0xa06cb85eUL, 0xbc8c3144UL, 0x373aa9cbUL, + 0x3ff371a7UL, 0xbf42eae2UL, 0xbc963aeaUL, 0x231e754aUL, 0x3ff37f26UL, + 0x9eceb23cUL, 0xbc99f5caUL, 0x6d05d866UL, 0x3ff38caeUL, 0x3c9904bdUL, + 0xbc9e958dUL, 0x1b7140efUL, 0x3ff39a40UL, 0xfc8e2934UL, 0xbc99a9a5UL, + 0x34e59ff7UL, 0x3ff3a7dbUL, 0xd661f5e3UL, 0xbc75e436UL, 0xbfec6cf4UL, + 0x3ff3b57fUL, 0xe26fff18UL, 0x3c954c66UL, 0xc313a8e5UL, 0x3ff3c32dUL, + 0x375d29c3UL, 0xbc9efff8UL, 0x44ede173UL, 0x3ff3d0e5UL, 0x8c284c71UL, + 0x3c7fe8d0UL, 0x4c123422UL, 0x3ff3dea6UL, 0x11f09ebcUL, 0x3c8ada09UL, + 0xdf1c5175UL, 0x3ff3ec70UL, 0x7b8c9bcaUL, 0xbc8af663UL, 0x04ac801cUL, + 0x3ff3fa45UL, 0xf956f9f3UL, 0xbc97d023UL, 0xc367a024UL, 0x3ff40822UL, + 0xb6f4d048UL, 0x3c8bddf8UL, 0x21f72e2aUL, 0x3ff4160aUL, 0x1c309278UL, + 0xbc5ef369UL, 0x2709468aUL, 0x3ff423fbUL, 0xc0b314ddUL, 0xbc98462dUL, + 0xd950a897UL, 0x3ff431f5UL, 0xe35f7999UL, 0xbc81c7ddUL, 0x3f84b9d4UL, + 0x3ff43ffaUL, 0x9704c003UL, 0x3c8880beUL, 0x6061892dUL, 0x3ff44e08UL, + 0x04ef80d0UL, 0x3c489b7aUL, 0x42a7d232UL, 0x3ff45c20UL, 0x82fb1f8eUL, + 0xbc686419UL, 0xed1d0057UL, 0x3ff46a41UL, 0xd1648a76UL, 0x3c9c944bUL, + 0x668b3237UL, 0x3ff4786dUL, 0xed445733UL, 0xbc9c20f0UL, 0xb5c13cd0UL, + 0x3ff486a2UL, 0xb69062f0UL, 0x3c73c1a3UL, 0xe192aed2UL, 0x3ff494e1UL, + 0x5e499ea0UL, 0xbc83b289UL, 0xf0d7d3deUL, 0x3ff4a32aUL, 0xf3d1be56UL, + 0x3c99cb62UL, 0xea6db7d7UL, 0x3ff4b17dUL, 0x7f2897f0UL, 0xbc8125b8UL, + 0xd5362a27UL, 0x3ff4bfdaUL, 0xafec42e2UL, 0x3c7d4397UL, 0xb817c114UL, + 0x3ff4ce41UL, 0x690abd5dUL, 0x3c905e29UL, 0x99fddd0dUL, 0x3ff4dcb2UL, + 0xbc6a7833UL, 0x3c98ecdbUL, 0x81d8abffUL, 0x3ff4eb2dUL, 0x2e5d7a52UL, + 0xbc95257dUL, 0x769d2ca7UL, 0x3ff4f9b2UL, 0xd25957e3UL, 0xbc94b309UL, + 0x7f4531eeUL, 0x3ff50841UL, 0x49b7465fUL, 0x3c7a249bUL, 0xa2cf6642UL, + 0x3ff516daUL, 0x69bd93efUL, 0xbc8f7685UL, 0xe83f4eefUL, 0x3ff5257dUL, + 0x43efef71UL, 0xbc7c998dUL, 0x569d4f82UL, 0x3ff5342bUL, 0x1db13cadUL, + 0xbc807abeUL, 0xf4f6ad27UL, 0x3ff542e2UL, 0x192d5f7eUL, 0x3c87926dUL, + 0xca5d920fUL, 0x3ff551a4UL, 0xefede59bUL, 0xbc8d689cUL, 0xdde910d2UL, + 0x3ff56070UL, 0x168eebf0UL, 0xbc90fb6eUL, 0x36b527daUL, 0x3ff56f47UL, + 0x011d93adUL, 0x3c99bb2cUL, 0xdbe2c4cfUL, 0x3ff57e27UL, 0x8a57b9c4UL, + 0xbc90b98cUL, 0xd497c7fdUL, 0x3ff58d12UL, 0x5b9a1de8UL, 0x3c8295e1UL, + 0x27ff07ccUL, 0x3ff59c08UL, 0xe467e60fUL, 0xbc97e2ceUL, 0xdd485429UL, + 0x3ff5ab07UL, 0x054647adUL, 0x3c96324cUL, 0xfba87a03UL, 0x3ff5ba11UL, + 0x4c233e1aUL, 0xbc9b77a1UL, 0x8a5946b7UL, 0x3ff5c926UL, 0x816986a2UL, + 0x3c3c4b1bUL, 0x90998b93UL, 0x3ff5d845UL, 0xa8b45643UL, 0xbc9cd6a7UL, + 0x15ad2148UL, 0x3ff5e76fUL, 0x3080e65eUL, 0x3c9ba6f9UL, 0x20dceb71UL, + 0x3ff5f6a3UL, 0xe3cdcf92UL, 0xbc89eaddUL, 0xb976dc09UL, 0x3ff605e1UL, + 0x9b56de47UL, 0xbc93e242UL, 0xe6cdf6f4UL, 0x3ff6152aUL, 0x4ab84c27UL, + 0x3c9e4b3eUL, 0xb03a5585UL, 0x3ff6247eUL, 0x7e40b497UL, 0xbc9383c1UL, + 0x1d1929fdUL, 0x3ff633ddUL, 0xbeb964e5UL, 0x3c984710UL, 0x34ccc320UL, + 0x3ff64346UL, 0x759d8933UL, 0xbc8c483cUL, 0xfebc8fb7UL, 0x3ff652b9UL, + 0xc9a73e09UL, 0xbc9ae3d5UL, 0x82552225UL, 0x3ff66238UL, 0x87591c34UL, + 0xbc9bb609UL, 0xc70833f6UL, 0x3ff671c1UL, 0x586c6134UL, 0xbc8e8732UL, + 0xd44ca973UL, 0x3ff68155UL, 0x44f73e65UL, 0x3c6038aeUL, 0xb19e9538UL, + 0x3ff690f4UL, 0x9aeb445dUL, 0x3c8804bdUL, 0x667f3bcdUL, 0x3ff6a09eUL, + 0x13b26456UL, 0xbc9bdd34UL, 0xfa75173eUL, 0x3ff6b052UL, 0x2c9a9d0eUL, + 0x3c7a38f5UL, 0x750bdabfUL, 0x3ff6c012UL, 0x67ff0b0dUL, 0xbc728956UL, + 0xddd47645UL, 0x3ff6cfdcUL, 0xb6f17309UL, 0x3c9c7aa9UL, 0x3c651a2fUL, + 0x3ff6dfb2UL, 0x683c88abUL, 0xbc6bbe3aUL, 0x98593ae5UL, 0x3ff6ef92UL, + 0x9e1ac8b2UL, 0xbc90b974UL, 0xf9519484UL, 0x3ff6ff7dUL, 0x25860ef6UL, + 0xbc883c0fUL, 0x66f42e87UL, 0x3ff70f74UL, 0xd45aa65fUL, 0x3c59d644UL, + 0xe8ec5f74UL, 0x3ff71f75UL, 0x86887a99UL, 0xbc816e47UL, 0x86ead08aUL, + 0x3ff72f82UL, 0x2cd62c72UL, 0xbc920aa0UL, 0x48a58174UL, 0x3ff73f9aUL, + 0x6c65d53cUL, 0xbc90a8d9UL, 0x35d7cbfdUL, 0x3ff74fbdUL, 0x618a6e1cUL, + 0x3c9047fdUL, 0x564267c9UL, 0x3ff75febUL, 0x57316dd3UL, 0xbc902459UL, + 0xb1ab6e09UL, 0x3ff77024UL, 0x169147f8UL, 0x3c9b7877UL, 0x4fde5d3fUL, + 0x3ff78069UL, 0x0a02162dUL, 0x3c9866b8UL, 0x38ac1cf6UL, 0x3ff790b9UL, + 0x62aadd3eUL, 0x3c9349a8UL, 0x73eb0187UL, 0x3ff7a114UL, 0xee04992fUL, + 0xbc841577UL, 0x0976cfdbUL, 0x3ff7b17bUL, 0x8468dc88UL, 0xbc9bebb5UL, + 0x0130c132UL, 0x3ff7c1edUL, 0xd1164dd6UL, 0x3c9f124cUL, 0x62ff86f0UL, + 0x3ff7d26aUL, 0xfb72b8b4UL, 0x3c91bddbUL, 0x36cf4e62UL, 0x3ff7e2f3UL, + 0xba15797eUL, 0x3c705d02UL, 0x8491c491UL, 0x3ff7f387UL, 0xcf9311aeUL, + 0xbc807f11UL, 0x543e1a12UL, 0x3ff80427UL, 0x626d972bUL, 0xbc927c86UL, + 0xadd106d9UL, 0x3ff814d2UL, 0x0d151d4dUL, 0x3c946437UL, 0x994cce13UL, + 0x3ff82589UL, 0xd41532d8UL, 0xbc9d4c1dUL, 0x1eb941f7UL, 0x3ff8364cUL, + 0x31df2bd5UL, 0x3c999b9aUL, 0x4623c7adUL, 0x3ff8471aUL, 0xa341cdfbUL, + 0xbc88d684UL, 0x179f5b21UL, 0x3ff857f4UL, 0xf8b216d0UL, 0xbc5ba748UL, + 0x9b4492edUL, 0x3ff868d9UL, 0x9bd4f6baUL, 0xbc9fc6f8UL, 0xd931a436UL, + 0x3ff879caUL, 0xd2db47bdUL, 0x3c85d2d7UL, 0xd98a6699UL, 0x3ff88ac7UL, + 0xf37cb53aUL, 0x3c9994c2UL, 0xa478580fUL, 0x3ff89bd0UL, 0x4475202aUL, + 0x3c9d5395UL, 0x422aa0dbUL, 0x3ff8ace5UL, 0x56864b27UL, 0x3c96e9f1UL, + 0xbad61778UL, 0x3ff8be05UL, 0xfc43446eUL, 0x3c9ecb5eUL, 0x16b5448cUL, + 0x3ff8cf32UL, 0x32e9e3aaUL, 0xbc70d55eUL, 0x5e0866d9UL, 0x3ff8e06aUL, + 0x6fc9b2e6UL, 0xbc97114aUL, 0x99157736UL, 0x3ff8f1aeUL, 0xa2e3976cUL, + 0x3c85cc13UL, 0xd0282c8aUL, 0x3ff902feUL, 0x85fe3fd2UL, 0x3c9592caUL, + 0x0b91ffc6UL, 0x3ff9145bUL, 0x2e582524UL, 0xbc9dd679UL, 0x53aa2fe2UL, + 0x3ff925c3UL, 0xa639db7fUL, 0xbc83455fUL, 0xb0cdc5e5UL, 0x3ff93737UL, + 0x81b57ebcUL, 0xbc675fc7UL, 0x2b5f98e5UL, 0x3ff948b8UL, 0x797d2d99UL, + 0xbc8dc3d6UL, 0xcbc8520fUL, 0x3ff95a44UL, 0x96a5f039UL, 0xbc764b7cUL, + 0x9a7670b3UL, 0x3ff96bddUL, 0x7f19c896UL, 0xbc5ba596UL, 0x9fde4e50UL, + 0x3ff97d82UL, 0x7c1b85d1UL, 0xbc9d185bUL, 0xe47a22a2UL, 0x3ff98f33UL, + 0xa24c78ecUL, 0x3c7cabdaUL, 0x70ca07baUL, 0x3ff9a0f1UL, 0x91cee632UL, + 0xbc9173bdUL, 0x4d53fe0dUL, 0x3ff9b2bbUL, 0x4df6d518UL, 0xbc9dd84eUL, + 0x82a3f090UL, 0x3ff9c491UL, 0xb071f2beUL, 0x3c7c7c46UL, 0x194bb8d5UL, + 0x3ff9d674UL, 0xa3dd8233UL, 0xbc9516beUL, 0x19e32323UL, 0x3ff9e863UL, + 0x78e64c6eUL, 0x3c7824caUL, 0x8d07f29eUL, 0x3ff9fa5eUL, 0xaaf1faceUL, + 0xbc84a9ceUL, 0x7b5de565UL, 0x3ffa0c66UL, 0x5d1cd533UL, 0xbc935949UL, + 0xed8eb8bbUL, 0x3ffa1e7aUL, 0xee8be70eUL, 0x3c9c6618UL, 0xec4a2d33UL, + 0x3ffa309bUL, 0x7ddc36abUL, 0x3c96305cUL, 0x80460ad8UL, 0x3ffa42c9UL, + 0x589fb120UL, 0xbc9aa780UL, 0xb23e255dUL, 0x3ffa5503UL, 0xdb8d41e1UL, + 0xbc9d2f6eUL, 0x8af46052UL, 0x3ffa674aUL, 0x30670366UL, 0x3c650f56UL, + 0x1330b358UL, 0x3ffa799eUL, 0xcac563c7UL, 0x3c9bcb7eUL, 0x53c12e59UL, + 0x3ffa8bfeUL, 0xb2ba15a9UL, 0xbc94f867UL, 0x5579fdbfUL, 0x3ffa9e6bUL, + 0x0ef7fd31UL, 0x3c90fac9UL, 0x21356ebaUL, 0x3ffab0e5UL, 0xdae94545UL, + 0x3c889c31UL, 0xbfd3f37aUL, 0x3ffac36bUL, 0xcae76cd0UL, 0xbc8f9234UL, + 0x3a3c2774UL, 0x3ffad5ffUL, 0xb6b1b8e5UL, 0x3c97ef3bUL, 0x995ad3adUL, + 0x3ffae89fUL, 0x345dcc81UL, 0x3c97a1cdUL, 0xe622f2ffUL, 0x3ffafb4cUL, + 0x0f315ecdUL, 0xbc94b2fcUL, 0x298db666UL, 0x3ffb0e07UL, 0x4c80e425UL, + 0xbc9bdef5UL, 0x6c9a8952UL, 0x3ffb20ceUL, 0x4a0756ccUL, 0x3c94dd02UL, + 0xb84f15fbUL, 0x3ffb33a2UL, 0x3084d708UL, 0xbc62805eUL, 0x15b749b1UL, + 0x3ffb4684UL, 0xe9df7c90UL, 0xbc7f763dUL, 0x8de5593aUL, 0x3ffb5972UL, + 0xbbba6de3UL, 0xbc9c71dfUL, 0x29f1c52aUL, 0x3ffb6c6eUL, 0x52883f6eUL, + 0x3c92a8f3UL, 0xf2fb5e47UL, 0x3ffb7f76UL, 0x7e54ac3bUL, 0xbc75584fUL, + 0xf22749e4UL, 0x3ffb928cUL, 0x54cb65c6UL, 0xbc9b7216UL, 0x30a1064aUL, + 0x3ffba5b0UL, 0x0e54292eUL, 0xbc9efcd3UL, 0xb79a6f1fUL, 0x3ffbb8e0UL, + 0xc9696205UL, 0xbc3f52d1UL, 0x904bc1d2UL, 0x3ffbcc1eUL, 0x7a2d9e84UL, + 0x3c823dd0UL, 0xc3f3a207UL, 0x3ffbdf69UL, 0x60ea5b53UL, 0xbc3c2623UL, + 0x5bd71e09UL, 0x3ffbf2c2UL, 0x3f6b9c73UL, 0xbc9efdcaUL, 0x6141b33dUL, + 0x3ffc0628UL, 0xa1fbca34UL, 0xbc8d8a5aUL, 0xdd85529cUL, 0x3ffc199bUL, + 0x895048ddUL, 0x3c811065UL, 0xd9fa652cUL, 0x3ffc2d1cUL, 0x17c8a5d7UL, + 0xbc96e516UL, 0x5fffd07aUL, 0x3ffc40abUL, 0xe083c60aUL, 0x3c9b4537UL, + 0x78fafb22UL, 0x3ffc5447UL, 0x2493b5afUL, 0x3c912f07UL, 0x2e57d14bUL, + 0x3ffc67f1UL, 0xff483cadUL, 0x3c92884dUL, 0x8988c933UL, 0x3ffc7ba8UL, + 0xbe255559UL, 0xbc8e76bbUL, 0x9406e7b5UL, 0x3ffc8f6dUL, 0x48805c44UL, + 0x3c71acbcUL, 0x5751c4dbUL, 0x3ffca340UL, 0xd10d08f5UL, 0xbc87f2beUL, + 0xdcef9069UL, 0x3ffcb720UL, 0xd1e949dbUL, 0x3c7503cbUL, 0x2e6d1675UL, + 0x3ffccb0fUL, 0x86009092UL, 0xbc7d220fUL, 0x555dc3faUL, 0x3ffcdf0bUL, + 0x53829d72UL, 0xbc8dd83bUL, 0x5b5bab74UL, 0x3ffcf315UL, 0xb86dff57UL, + 0xbc9a08e9UL, 0x4a07897cUL, 0x3ffd072dUL, 0x43797a9cUL, 0xbc9cbc37UL, + 0x2b08c968UL, 0x3ffd1b53UL, 0x219a36eeUL, 0x3c955636UL, 0x080d89f2UL, + 0x3ffd2f87UL, 0x719d8578UL, 0xbc9d487bUL, 0xeacaa1d6UL, 0x3ffd43c8UL, + 0xbf5a1614UL, 0x3c93db53UL, 0xdcfba487UL, 0x3ffd5818UL, 0xd75b3707UL, + 0x3c82ed02UL, 0xe862e6d3UL, 0x3ffd6c76UL, 0x4a8165a0UL, 0x3c5fe87aUL, + 0x16c98398UL, 0x3ffd80e3UL, 0x8beddfe8UL, 0xbc911ec1UL, 0x71ff6075UL, + 0x3ffd955dUL, 0xbb9af6beUL, 0x3c9a052dUL, 0x03db3285UL, 0x3ffda9e6UL, + 0x696db532UL, 0x3c9c2300UL, 0xd63a8315UL, 0x3ffdbe7cUL, 0x926b8be4UL, + 0xbc9b76f1UL, 0xf301b460UL, 0x3ffdd321UL, 0x78f018c3UL, 0x3c92da57UL, + 0x641c0658UL, 0x3ffde7d5UL, 0x8e79ba8fUL, 0xbc9ca552UL, 0x337b9b5fUL, + 0x3ffdfc97UL, 0x4f184b5cUL, 0xbc91a5cdUL, 0x6b197d17UL, 0x3ffe1167UL, + 0xbd5c7f44UL, 0xbc72b529UL, 0x14f5a129UL, 0x3ffe2646UL, 0x817a1496UL, + 0xbc97b627UL, 0x3b16ee12UL, 0x3ffe3b33UL, 0x31fdc68bUL, 0xbc99f4a4UL, + 0xe78b3ff6UL, 0x3ffe502eUL, 0x80a9cc8fUL, 0x3c839e89UL, 0x24676d76UL, + 0x3ffe6539UL, 0x7522b735UL, 0xbc863ff8UL, 0xfbc74c83UL, 0x3ffe7a51UL, + 0xca0c8de2UL, 0x3c92d522UL, 0x77cdb740UL, 0x3ffe8f79UL, 0x80b054b1UL, + 0xbc910894UL, 0xa2a490daUL, 0x3ffea4afUL, 0x179c2893UL, 0xbc9e9c23UL, + 0x867cca6eUL, 0x3ffeb9f4UL, 0x2293e4f2UL, 0x3c94832fUL, 0x2d8e67f1UL, + 0x3ffecf48UL, 0xb411ad8cUL, 0xbc9c93f3UL, 0xa2188510UL, 0x3ffee4aaUL, + 0xa487568dUL, 0x3c91c68dUL, 0xee615a27UL, 0x3ffefa1bUL, 0x86a4b6b0UL, + 0x3c9dc7f4UL, 0x1cb6412aUL, 0x3fff0f9cUL, 0x65181d45UL, 0xbc932200UL, + 0x376bba97UL, 0x3fff252bUL, 0xbf0d8e43UL, 0x3c93a1a5UL, 0x48dd7274UL, + 0x3fff3ac9UL, 0x3ed837deUL, 0xbc795a5aUL, 0x5b6e4540UL, 0x3fff5076UL, + 0x2dd8a18bUL, 0x3c99d3e1UL, 0x798844f8UL, 0x3fff6632UL, 0x3539343eUL, + 0x3c9fa37bUL, 0xad9cbe14UL, 0x3fff7bfdUL, 0xd006350aUL, 0xbc9dbb12UL, + 0x02243c89UL, 0x3fff91d8UL, 0xa779f689UL, 0xbc612ea8UL, 0x819e90d8UL, + 0x3fffa7c1UL, 0xf3a5931eUL, 0x3c874853UL, 0x3692d514UL, 0x3fffbdbaUL, + 0x15098eb6UL, 0xbc796773UL, 0x2b8f71f1UL, 0x3fffd3c2UL, 0x966579e7UL, + 0x3c62eb74UL, 0x6b2a23d9UL, 0x3fffe9d9UL, 0x7442fde3UL, 0x3c74a603UL, + 0xe78a6731UL, 0x3f55d87fUL, 0xd704a0c0UL, 0x3fac6b08UL, 0x6fba4e77UL, + 0x3f83b2abUL, 0xff82c58fUL, 0x3fcebfbdUL, 0xfefa39efUL, 0x3fe62e42UL, + 0x00000000UL, 0x00000000UL, 0xfefa39efUL, 0x3fe62e42UL, 0xfefa39efUL, + 0xbfe62e42UL, 0xf8000000UL, 0xffffffffUL, 0xf8000000UL, 0xffffffffUL, + 0x00000000UL, 0x80000000UL, 0x00000000UL, 0x00000000UL + +}; + +//registers, +// input: xmm0, xmm1 +// scratch: xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 +// eax, edx, ecx, ebx + +// Code generated by Intel C compiler for LIBM library + +void MacroAssembler::fast_pow(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register tmp) { + Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; + Label L_2TAG_PACKET_4_0_2, L_2TAG_PACKET_5_0_2, L_2TAG_PACKET_6_0_2, L_2TAG_PACKET_7_0_2; + Label L_2TAG_PACKET_8_0_2, L_2TAG_PACKET_9_0_2, L_2TAG_PACKET_10_0_2, L_2TAG_PACKET_11_0_2; + Label L_2TAG_PACKET_12_0_2, L_2TAG_PACKET_13_0_2, L_2TAG_PACKET_14_0_2, L_2TAG_PACKET_15_0_2; + Label L_2TAG_PACKET_16_0_2, L_2TAG_PACKET_17_0_2, L_2TAG_PACKET_18_0_2, L_2TAG_PACKET_19_0_2; + Label L_2TAG_PACKET_20_0_2, L_2TAG_PACKET_21_0_2, L_2TAG_PACKET_22_0_2, L_2TAG_PACKET_23_0_2; + Label L_2TAG_PACKET_24_0_2, L_2TAG_PACKET_25_0_2, L_2TAG_PACKET_26_0_2, L_2TAG_PACKET_27_0_2; + Label L_2TAG_PACKET_28_0_2, L_2TAG_PACKET_29_0_2, L_2TAG_PACKET_30_0_2, L_2TAG_PACKET_31_0_2; + Label L_2TAG_PACKET_32_0_2, L_2TAG_PACKET_33_0_2, L_2TAG_PACKET_34_0_2, L_2TAG_PACKET_35_0_2; + Label L_2TAG_PACKET_36_0_2, L_2TAG_PACKET_37_0_2, L_2TAG_PACKET_38_0_2, L_2TAG_PACKET_39_0_2; + Label L_2TAG_PACKET_40_0_2, L_2TAG_PACKET_41_0_2, L_2TAG_PACKET_42_0_2, L_2TAG_PACKET_43_0_2; + Label L_2TAG_PACKET_44_0_2, L_2TAG_PACKET_45_0_2, L_2TAG_PACKET_46_0_2, L_2TAG_PACKET_47_0_2; + Label L_2TAG_PACKET_48_0_2, L_2TAG_PACKET_49_0_2, L_2TAG_PACKET_50_0_2, L_2TAG_PACKET_51_0_2; + Label L_2TAG_PACKET_52_0_2, L_2TAG_PACKET_53_0_2, L_2TAG_PACKET_54_0_2, L_2TAG_PACKET_55_0_2; + Label L_2TAG_PACKET_56_0_2, L_2TAG_PACKET_57_0_2, L_2TAG_PACKET_58_0_2, start; + + assert_different_registers(tmp, eax, ecx, edx); + + address static_const_table_pow = (address)_static_const_table_pow; + + bind(start); + subl(rsp, 120); + movl(Address(rsp, 64), tmp); + lea(tmp, ExternalAddress(static_const_table_pow)); + movsd(xmm0, Address(rsp, 128)); + movsd(xmm1, Address(rsp, 136)); + xorpd(xmm2, xmm2); + movl(eax, 16368); + pinsrw(xmm2, eax, 3); + movl(ecx, 1069088768); + movdl(xmm7, ecx); + movsd(Address(rsp, 16), xmm1); + xorpd(xmm1, xmm1); + movl(edx, 30704); + pinsrw(xmm1, edx, 3); + movsd(Address(rsp, 8), xmm0); + movdqu(xmm3, xmm0); + movl(edx, 8192); + movdl(xmm4, edx); + movdqu(xmm6, Address(tmp, 8240)); + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + psllq(xmm0, 5); + movsd(xmm2, Address(tmp, 8256)); + psrlq(xmm0, 34); + movl(edx, eax); + andl(edx, 32752); + subl(edx, 16368); + movl(ecx, edx); + sarl(edx, 31); + addl(ecx, edx); + xorl(ecx, edx); + rcpss(xmm0, xmm0); + psllq(xmm3, 12); + addl(ecx, 16); + bsrl(ecx, ecx); + psrlq(xmm3, 12); + movl(Address(rsp, 24), rsi); + subl(eax, 16); + cmpl(eax, 32736); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_0_0_2); + movl(rsi, 0); + + bind(L_2TAG_PACKET_1_0_2); + mulss(xmm0, xmm7); + movl(edx, -1); + subl(ecx, 4); + shll(edx); + movdl(xmm5, edx); + por(xmm3, xmm1); + subl(eax, 16351); + cmpl(eax, 1); + jcc(Assembler::belowEqual, L_2TAG_PACKET_2_0_2); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + pand(xmm5, xmm3); + + bind(L_2TAG_PACKET_3_0_2); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + subl(eax, 1); + sarl(eax, 4); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + + bind(L_2TAG_PACKET_4_0_2); + mulsd(xmm3, xmm0); + movdqu(xmm1, Address(tmp, 8272)); + subsd(xmm5, xmm2); + movdqu(xmm4, Address(tmp, 8288)); + movl(ecx, eax); + sarl(eax, 31); + addl(ecx, eax); + xorl(eax, ecx); + addl(eax, 1); + bsrl(eax, eax); + unpcklpd(xmm5, xmm3); + movdqu(xmm6, Address(tmp, 8304)); + addsd(xmm3, xmm5); + andl(edx, 16760832); + shrl(edx, 10); + addpd(xmm5, Address(tmp, edx, Address::times_1, -3616)); + movdqu(xmm0, Address(tmp, 8320)); + pshufd(xmm2, xmm3, 68); + mulsd(xmm3, xmm3); + mulpd(xmm1, xmm2); + mulpd(xmm4, xmm2); + addsd(xmm5, xmm7); + mulsd(xmm2, xmm3); + addpd(xmm6, xmm1); + mulsd(xmm3, xmm3); + addpd(xmm0, xmm4); + movsd(xmm1, Address(rsp, 16)); + movzwl(ecx, Address(rsp, 22)); + pshufd(xmm7, xmm5, 238); + movsd(xmm4, Address(tmp, 8368)); + mulpd(xmm6, xmm2); + pshufd(xmm3, xmm3, 68); + mulpd(xmm0, xmm2); + shll(eax, 4); + subl(eax, 15872); + andl(ecx, 32752); + addl(eax, ecx); + mulpd(xmm3, xmm6); + cmpl(eax, 624); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_5_0_2); + xorpd(xmm6, xmm6); + movl(edx, 17080); + pinsrw(xmm6, edx, 3); + movdqu(xmm2, xmm1); + pand(xmm4, xmm1); + subsd(xmm1, xmm4); + mulsd(xmm4, xmm5); + addsd(xmm0, xmm7); + mulsd(xmm1, xmm5); + movdqu(xmm7, xmm6); + addsd(xmm6, xmm4); + addpd(xmm3, xmm0); + movdl(edx, xmm6); + subsd(xmm6, xmm7); + pshufd(xmm0, xmm3, 238); + subsd(xmm4, xmm6); + addsd(xmm0, xmm3); + movl(ecx, edx); + andl(edx, 255); + addl(edx, edx); + movdqu(xmm5, Address(tmp, edx, Address::times_8, 8384)); + addsd(xmm4, xmm1); + mulsd(xmm2, xmm0); + movdqu(xmm7, Address(tmp, 12480)); + movdqu(xmm3, Address(tmp, 12496)); + shll(ecx, 12); + xorl(ecx, rsi); + andl(ecx, -1048576); + movdl(xmm6, ecx); + addsd(xmm2, xmm4); + movsd(xmm1, Address(tmp, 12512)); + pshufd(xmm0, xmm2, 68); + pshufd(xmm4, xmm2, 68); + mulpd(xmm0, xmm0); + movl(rsi, Address(rsp, 24)); + mulpd(xmm7, xmm4); + pshufd(xmm6, xmm6, 17); + mulsd(xmm1, xmm2); + mulsd(xmm0, xmm0); + paddd(xmm5, xmm6); + addpd(xmm3, xmm7); + mulsd(xmm1, xmm5); + pshufd(xmm6, xmm5, 238); + mulpd(xmm0, xmm3); + addsd(xmm1, xmm6); + pshufd(xmm3, xmm0, 238); + mulsd(xmm0, xmm5); + mulsd(xmm3, xmm5); + addsd(xmm0, xmm1); + addsd(xmm0, xmm3); + addsd(xmm0, xmm5); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_7_0_2); + movsd(xmm0, Address(rsp, 128)); + movsd(xmm1, Address(rsp, 136)); + mulsd(xmm0, xmm1); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_0_0_2); + addl(eax, 16); + movl(edx, 32752); + andl(edx, eax); + cmpl(edx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_8_0_2); + testl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_9_0_2); + + bind(L_2TAG_PACKET_10_0_2); + movl(ecx, Address(rsp, 16)); + xorl(edx, edx); + testl(ecx, ecx); + movl(ecx, 1); + cmovl(Assembler::notEqual, edx, ecx); + orl(edx, Address(rsp, 20)); + cmpl(edx, 1072693248); + jcc(Assembler::equal, L_2TAG_PACKET_7_0_2); + movsd(xmm0, Address(rsp, 8)); + movsd(xmm3, Address(rsp, 8)); + movdl(edx, xmm3); + psrlq(xmm3, 32); + movdl(ecx, xmm3); + orl(edx, ecx); + cmpl(edx, 0); + jcc(Assembler::equal, L_2TAG_PACKET_11_0_2); + xorpd(xmm3, xmm3); + movl(eax, 18416); + pinsrw(xmm3, eax, 3); + mulsd(xmm0, xmm3); + xorpd(xmm2, xmm2); + movl(eax, 16368); + pinsrw(xmm2, eax, 3); + movdqu(xmm3, xmm0); + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + movl(ecx, 18416); + psllq(xmm0, 5); + movsd(xmm2, Address(tmp, 8256)); + psrlq(xmm0, 34); + rcpss(xmm0, xmm0); + psllq(xmm3, 12); + movdqu(xmm6, Address(tmp, 8240)); + psrlq(xmm3, 12); + mulss(xmm0, xmm7); + movl(edx, -1024); + movdl(xmm5, edx); + por(xmm3, xmm1); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + pand(xmm5, xmm3); + movl(rsi, 0); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + andl(eax, 32752); + subl(eax, 18416); + sarl(eax, 4); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + jmp(L_2TAG_PACKET_4_0_2); + + bind(L_2TAG_PACKET_12_0_2); + movl(ecx, Address(rsp, 16)); + xorl(edx, edx); + testl(ecx, ecx); + movl(ecx, 1); + cmovl(Assembler::notEqual, edx, ecx); + orl(edx, Address(rsp, 20)); + cmpl(edx, 1072693248); + jcc(Assembler::equal, L_2TAG_PACKET_7_0_2); + movsd(xmm0, Address(rsp, 8)); + movsd(xmm3, Address(rsp, 8)); + movdl(edx, xmm3); + psrlq(xmm3, 32); + movdl(ecx, xmm3); + orl(edx, ecx); + cmpl(edx, 0); + jcc(Assembler::equal, L_2TAG_PACKET_11_0_2); + xorpd(xmm3, xmm3); + movl(eax, 18416); + pinsrw(xmm3, eax, 3); + mulsd(xmm0, xmm3); + xorpd(xmm2, xmm2); + movl(eax, 16368); + pinsrw(xmm2, eax, 3); + movdqu(xmm3, xmm0); + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + movl(ecx, 18416); + psllq(xmm0, 5); + movsd(xmm2, Address(tmp, 8256)); + psrlq(xmm0, 34); + rcpss(xmm0, xmm0); + psllq(xmm3, 12); + movdqu(xmm6, Address(tmp, 8240)); + psrlq(xmm3, 12); + mulss(xmm0, xmm7); + movl(edx, -1024); + movdl(xmm5, edx); + por(xmm3, xmm1); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + pand(xmm5, xmm3); + movl(rsi, INT_MIN); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + andl(eax, 32752); + subl(eax, 18416); + sarl(eax, 4); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + jmp(L_2TAG_PACKET_4_0_2); + + bind(L_2TAG_PACKET_5_0_2); + cmpl(eax, 0); + jcc(Assembler::less, L_2TAG_PACKET_13_0_2); + cmpl(eax, 752); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_14_0_2); + + bind(L_2TAG_PACKET_15_0_2); + addsd(xmm0, xmm7); + movsd(xmm2, Address(tmp, 12544)); + addpd(xmm3, xmm0); + xorpd(xmm6, xmm6); + movl(eax, 17080); + pinsrw(xmm6, eax, 3); + pshufd(xmm0, xmm3, 238); + addsd(xmm0, xmm3); + movdqu(xmm3, xmm5); + addsd(xmm5, xmm0); + movdqu(xmm4, xmm2); + subsd(xmm3, xmm5); + movdqu(xmm7, xmm5); + pand(xmm5, xmm2); + movdqu(xmm2, xmm1); + pand(xmm4, xmm1); + subsd(xmm7, xmm5); + addsd(xmm0, xmm3); + subsd(xmm1, xmm4); + mulsd(xmm4, xmm5); + addsd(xmm0, xmm7); + mulsd(xmm2, xmm0); + movdqu(xmm7, xmm6); + mulsd(xmm1, xmm5); + addsd(xmm6, xmm4); + movdl(eax, xmm6); + subsd(xmm6, xmm7); + addsd(xmm2, xmm1); + movdqu(xmm7, Address(tmp, 12480)); + movdqu(xmm3, Address(tmp, 12496)); + subsd(xmm4, xmm6); + pextrw(edx, xmm6, 3); + movl(ecx, eax); + andl(eax, 255); + addl(eax, eax); + movdqu(xmm5, Address(tmp, eax, Address::times_8, 8384)); + addsd(xmm2, xmm4); + sarl(ecx, 8); + movl(eax, ecx); + sarl(ecx, 1); + subl(eax, ecx); + shll(ecx, 20); + xorl(ecx, rsi); + movdl(xmm6, ecx); + movsd(xmm1, Address(tmp, 12512)); + andl(edx, 32767); + cmpl(edx, 16529); + jcc(Assembler::above, L_2TAG_PACKET_14_0_2); + pshufd(xmm0, xmm2, 68); + pshufd(xmm4, xmm2, 68); + mulpd(xmm0, xmm0); + mulpd(xmm7, xmm4); + pshufd(xmm6, xmm6, 17); + mulsd(xmm1, xmm2); + mulsd(xmm0, xmm0); + paddd(xmm5, xmm6); + addpd(xmm3, xmm7); + mulsd(xmm1, xmm5); + pshufd(xmm6, xmm5, 238); + mulpd(xmm0, xmm3); + addsd(xmm1, xmm6); + pshufd(xmm3, xmm0, 238); + mulsd(xmm0, xmm5); + mulsd(xmm3, xmm5); + shll(eax, 4); + xorpd(xmm4, xmm4); + addl(eax, 16368); + pinsrw(xmm4, eax, 3); + addsd(xmm0, xmm1); + movl(rsi, Address(rsp, 24)); + addsd(xmm0, xmm3); + movdqu(xmm1, xmm0); + addsd(xmm0, xmm5); + mulsd(xmm0, xmm4); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_16_0_2); + cmpl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_18_0_2); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_8_0_2); + movsd(xmm1, Address(rsp, 16)); + movsd(xmm0, Address(rsp, 8)); + movdqu(xmm2, xmm0); + movdl(eax, xmm2); + psrlq(xmm2, 20); + movdl(edx, xmm2); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_19_0_2); + addsd(xmm0, xmm0); + movdl(eax, xmm1); + psrlq(xmm1, 32); + movdl(edx, xmm1); + movl(ecx, edx); + addl(edx, edx); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_20_0_2); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_20_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + movl(edx, 29); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_22_0_2); + movsd(xmm0, Address(rsp, 16)); + addpd(xmm0, xmm0); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_19_0_2); + movdl(eax, xmm1); + movdqu(xmm2, xmm1); + psrlq(xmm1, 32); + movdl(edx, xmm1); + movl(ecx, edx); + addl(edx, edx); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_23_0_2); + pextrw(eax, xmm2, 3); + andl(eax, 32752); + cmpl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_24_0_2); + movdl(eax, xmm2); + psrlq(xmm2, 20); + movdl(edx, xmm2); + orl(eax, edx); + jcc(Assembler::notEqual, L_2TAG_PACKET_22_0_2); + + bind(L_2TAG_PACKET_24_0_2); + pextrw(eax, xmm0, 3); + testl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_25_0_2); + testl(ecx, INT_MIN); + jcc(Assembler::notEqual, L_2TAG_PACKET_26_0_2); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_27_0_2); + movsd(xmm1, Address(rsp, 16)); + movdl(eax, xmm1); + testl(eax, 1); + jcc(Assembler::notEqual, L_2TAG_PACKET_28_0_2); + testl(eax, 2); + jcc(Assembler::notEqual, L_2TAG_PACKET_29_0_2); + jmp(L_2TAG_PACKET_28_0_2); + + bind(L_2TAG_PACKET_25_0_2); + shrl(ecx, 20); + andl(ecx, 2047); + cmpl(ecx, 1075); + jcc(Assembler::above, L_2TAG_PACKET_28_0_2); + jcc(Assembler::equal, L_2TAG_PACKET_30_0_2); + cmpl(ecx, 1074); + jcc(Assembler::above, L_2TAG_PACKET_27_0_2); + cmpl(ecx, 1023); + jcc(Assembler::below, L_2TAG_PACKET_28_0_2); + movsd(xmm1, Address(rsp, 16)); + movl(eax, 17208); + xorpd(xmm3, xmm3); + pinsrw(xmm3, eax, 3); + movdqu(xmm4, xmm3); + addsd(xmm3, xmm1); + subsd(xmm4, xmm3); + addsd(xmm1, xmm4); + pextrw(eax, xmm1, 3); + andl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_28_0_2); + movdl(eax, xmm3); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_28_0_2); + + bind(L_2TAG_PACKET_29_0_2); + movsd(xmm1, Address(rsp, 16)); + pextrw(eax, xmm1, 3); + andl(eax, 32768); + jcc(Assembler::equal, L_2TAG_PACKET_18_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32768); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_28_0_2); + movsd(xmm1, Address(rsp, 16)); + pextrw(eax, xmm1, 3); + andl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_26_0_2); + + bind(L_2TAG_PACKET_31_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32752); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_30_0_2); + movsd(xmm1, Address(rsp, 16)); + movdl(eax, xmm1); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_28_0_2); + jmp(L_2TAG_PACKET_29_0_2); + + bind(L_2TAG_PACKET_32_0_2); + movdl(eax, xmm1); + psrlq(xmm1, 20); + movdl(edx, xmm1); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_33_0_2); + movsd(xmm0, Address(rsp, 16)); + addsd(xmm0, xmm0); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_33_0_2); + movsd(xmm0, Address(rsp, 8)); + pextrw(eax, xmm0, 3); + cmpl(eax, 49136); + jcc(Assembler::notEqual, L_2TAG_PACKET_34_0_2); + movdl(ecx, xmm0); + psrlq(xmm0, 20); + movdl(edx, xmm0); + orl(ecx, edx); + jcc(Assembler::notEqual, L_2TAG_PACKET_34_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32760); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_34_0_2); + movsd(xmm1, Address(rsp, 16)); + andl(eax, 32752); + subl(eax, 16368); + pextrw(edx, xmm1, 3); + xorpd(xmm0, xmm0); + xorl(eax, edx); + andl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_18_0_2); + movl(ecx, 32752); + pinsrw(xmm0, ecx, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_35_0_2); + movdl(eax, xmm1); + cmpl(edx, 17184); + jcc(Assembler::above, L_2TAG_PACKET_36_0_2); + testl(eax, 1); + jcc(Assembler::notEqual, L_2TAG_PACKET_37_0_2); + testl(eax, 2); + jcc(Assembler::equal, L_2TAG_PACKET_38_0_2); + jmp(L_2TAG_PACKET_39_0_2); + + bind(L_2TAG_PACKET_36_0_2); + testl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_38_0_2); + jmp(L_2TAG_PACKET_39_0_2); + + bind(L_2TAG_PACKET_9_0_2); + movsd(xmm2, Address(rsp, 8)); + movdl(eax, xmm2); + psrlq(xmm2, 31); + movdl(ecx, xmm2); + orl(eax, ecx); + jcc(Assembler::equal, L_2TAG_PACKET_11_0_2); + movsd(xmm1, Address(rsp, 16)); + pextrw(edx, xmm1, 3); + movdl(eax, xmm1); + movdqu(xmm2, xmm1); + psrlq(xmm2, 32); + movdl(ecx, xmm2); + addl(ecx, ecx); + orl(ecx, eax); + jcc(Assembler::equal, L_2TAG_PACKET_40_0_2); + andl(edx, 32752); + cmpl(edx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_32_0_2); + cmpl(edx, 17200); + jcc(Assembler::above, L_2TAG_PACKET_38_0_2); + cmpl(edx, 17184); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_35_0_2); + cmpl(edx, 16368); + jcc(Assembler::below, L_2TAG_PACKET_37_0_2); + movl(eax, 17208); + xorpd(xmm2, xmm2); + pinsrw(xmm2, eax, 3); + movdqu(xmm4, xmm2); + addsd(xmm2, xmm1); + subsd(xmm4, xmm2); + addsd(xmm1, xmm4); + pextrw(eax, xmm1, 3); + andl(eax, 32767); + jcc(Assembler::notEqual, L_2TAG_PACKET_37_0_2); + movdl(eax, xmm2); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_38_0_2); + + bind(L_2TAG_PACKET_39_0_2); + xorpd(xmm1, xmm1); + movl(edx, 30704); + pinsrw(xmm1, edx, 3); + movsd(xmm2, Address(tmp, 8256)); + movsd(xmm4, Address(rsp, 8)); + pextrw(eax, xmm4, 3); + movl(edx, 8192); + movdl(xmm4, edx); + andl(eax, 32767); + subl(eax, 16); + jcc(Assembler::less, L_2TAG_PACKET_12_0_2); + movl(edx, eax); + andl(edx, 32752); + subl(edx, 16368); + movl(ecx, edx); + sarl(edx, 31); + addl(ecx, edx); + xorl(ecx, edx); + addl(ecx, 16); + bsrl(ecx, ecx); + movl(rsi, INT_MIN); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_37_0_2); + xorpd(xmm1, xmm1); + movl(eax, 32752); + pinsrw(xmm1, eax, 3); + xorpd(xmm0, xmm0); + mulsd(xmm0, xmm1); + movl(edx, 28); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_38_0_2); + xorpd(xmm1, xmm1); + movl(edx, 30704); + pinsrw(xmm1, edx, 3); + movsd(xmm2, Address(tmp, 8256)); + movsd(xmm4, Address(rsp, 8)); + pextrw(eax, xmm4, 3); + movl(edx, 8192); + movdl(xmm4, edx); + andl(eax, 32767); + subl(eax, 16); + jcc(Assembler::less, L_2TAG_PACKET_10_0_2); + movl(edx, eax); + andl(edx, 32752); + subl(edx, 16368); + movl(ecx, edx); + sarl(edx, 31); + addl(ecx, edx); + xorl(ecx, edx); + addl(ecx, 16); + bsrl(ecx, ecx); + movl(rsi, 0); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_23_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_26_0_2); + xorpd(xmm0, xmm0); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_13_0_2); + addl(eax, 384); + cmpl(eax, 0); + jcc(Assembler::less, L_2TAG_PACKET_41_0_2); + mulsd(xmm5, xmm1); + addsd(xmm0, xmm7); + shrl(rsi, 31); + addpd(xmm3, xmm0); + pshufd(xmm0, xmm3, 238); + addsd(xmm3, xmm0); + movsd(xmm4, Address(tmp, rsi, Address::times_8, 12528)); + mulsd(xmm1, xmm3); + xorpd(xmm0, xmm0); + movl(eax, 16368); + shll(rsi, 15); + orl(eax, rsi); + pinsrw(xmm0, eax, 3); + addsd(xmm5, xmm1); + movl(rsi, Address(rsp, 24)); + mulsd(xmm5, xmm4); + addsd(xmm0, xmm5); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_41_0_2); + movl(rsi, Address(rsp, 24)); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_40_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_42_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + movl(edx, 26); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_11_0_2); + movsd(xmm1, Address(rsp, 16)); + movdqu(xmm2, xmm1); + pextrw(eax, xmm1, 3); + andl(eax, 32752); + cmpl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_43_0_2); + movdl(eax, xmm2); + psrlq(xmm2, 20); + movdl(edx, xmm2); + orl(eax, edx); + jcc(Assembler::notEqual, L_2TAG_PACKET_22_0_2); + + bind(L_2TAG_PACKET_43_0_2); + movdl(eax, xmm1); + psrlq(xmm1, 32); + movdl(edx, xmm1); + movl(ecx, edx); + addl(edx, edx); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_42_0_2); + shrl(edx, 21); + cmpl(edx, 1075); + jcc(Assembler::above, L_2TAG_PACKET_44_0_2); + jcc(Assembler::equal, L_2TAG_PACKET_45_0_2); + cmpl(edx, 1023); + jcc(Assembler::below, L_2TAG_PACKET_44_0_2); + movsd(xmm1, Address(rsp, 16)); + movl(eax, 17208); + xorpd(xmm3, xmm3); + pinsrw(xmm3, eax, 3); + movdqu(xmm4, xmm3); + addsd(xmm3, xmm1); + subsd(xmm4, xmm3); + addsd(xmm1, xmm4); + pextrw(eax, xmm1, 3); + andl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_44_0_2); + movdl(eax, xmm3); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_44_0_2); + + bind(L_2TAG_PACKET_46_0_2); + movsd(xmm0, Address(rsp, 8)); + testl(ecx, INT_MIN); + jcc(Assembler::notEqual, L_2TAG_PACKET_47_0_2); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_45_0_2); + movsd(xmm1, Address(rsp, 16)); + movdl(eax, xmm1); + testl(eax, 1); + jcc(Assembler::notEqual, L_2TAG_PACKET_46_0_2); + + bind(L_2TAG_PACKET_44_0_2); + testl(ecx, INT_MIN); + jcc(Assembler::equal, L_2TAG_PACKET_26_0_2); + xorpd(xmm0, xmm0); + + bind(L_2TAG_PACKET_47_0_2); + movl(eax, 16368); + xorpd(xmm1, xmm1); + pinsrw(xmm1, eax, 3); + divsd(xmm1, xmm0); + movdqu(xmm0, xmm1); + movl(edx, 27); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_14_0_2); + movsd(xmm2, Address(rsp, 8)); + movsd(xmm6, Address(rsp, 16)); + pextrw(eax, xmm2, 3); + pextrw(edx, xmm6, 3); + movl(ecx, 32752); + andl(ecx, edx); + cmpl(ecx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_48_0_2); + andl(eax, 32752); + subl(eax, 16368); + xorl(edx, eax); + testl(edx, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_49_0_2); + + bind(L_2TAG_PACKET_50_0_2); + movl(eax, 32736); + pinsrw(xmm0, eax, 3); + shrl(rsi, 16); + orl(eax, rsi); + pinsrw(xmm1, eax, 3); + movl(rsi, Address(rsp, 24)); + mulsd(xmm0, xmm1); + + bind(L_2TAG_PACKET_17_0_2); + movl(edx, 24); + + bind(L_2TAG_PACKET_21_0_2); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_49_0_2); + movl(eax, 16); + pinsrw(xmm0, eax, 3); + mulsd(xmm0, xmm0); + testl(rsi, INT_MIN); + jcc(Assembler::equal, L_2TAG_PACKET_51_0_2); + movsd(xmm2, Address(tmp, 12560)); + xorpd(xmm0, xmm2); + + bind(L_2TAG_PACKET_51_0_2); + movl(rsi, Address(rsp, 24)); + movl(edx, 25); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_16_0_2); + pextrw(ecx, xmm5, 3); + pextrw(edx, xmm4, 3); + movl(eax, -1); + andl(ecx, 32752); + subl(ecx, 16368); + andl(edx, 32752); + addl(edx, ecx); + movl(ecx, -31); + sarl(edx, 4); + subl(ecx, edx); + jcc(Assembler::lessEqual, L_2TAG_PACKET_52_0_2); + cmpl(ecx, 20); + jcc(Assembler::above, L_2TAG_PACKET_53_0_2); + shll(eax); + + bind(L_2TAG_PACKET_52_0_2); + movdl(xmm0, eax); + psllq(xmm0, 32); + pand(xmm0, xmm5); + subsd(xmm5, xmm0); + addsd(xmm5, xmm1); + mulsd(xmm0, xmm4); + mulsd(xmm5, xmm4); + addsd(xmm0, xmm5); + + bind(L_2TAG_PACKET_53_0_2); + movl(edx, 25); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_2_0_2); + movzwl(ecx, Address(rsp, 22)); + movl(edx, INT_MIN); + movdl(xmm1, edx); + xorpd(xmm7, xmm7); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + paddq(xmm1, xmm3); + pand(xmm5, xmm1); + andl(ecx, 32752); + cmpl(ecx, 16560); + jcc(Assembler::below, L_2TAG_PACKET_3_0_2); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + addl(eax, 16351); + shrl(eax, 4); + subl(eax, 1022); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + movsd(xmm4, Address(tmp, 0)); + mulsd(xmm3, xmm0); + movsd(xmm6, Address(tmp, 0)); + subsd(xmm5, xmm2); + movsd(xmm1, Address(tmp, 8)); + pshufd(xmm2, xmm3, 68); + unpcklpd(xmm5, xmm3); + addsd(xmm3, xmm5); + movsd(xmm0, Address(tmp, 8)); + andl(edx, 16760832); + shrl(edx, 10); + addpd(xmm7, Address(tmp, edx, Address::times_1, -3616)); + mulsd(xmm4, xmm5); + mulsd(xmm0, xmm5); + mulsd(xmm6, xmm2); + mulsd(xmm1, xmm2); + movdqu(xmm2, xmm5); + mulsd(xmm4, xmm5); + addsd(xmm5, xmm0); + movdqu(xmm0, xmm7); + addsd(xmm2, xmm3); + addsd(xmm7, xmm5); + mulsd(xmm6, xmm2); + subsd(xmm0, xmm7); + movdqu(xmm2, xmm7); + addsd(xmm7, xmm4); + addsd(xmm0, xmm5); + subsd(xmm2, xmm7); + addsd(xmm4, xmm2); + pshufd(xmm2, xmm5, 238); + movdqu(xmm5, xmm7); + addsd(xmm7, xmm2); + addsd(xmm4, xmm0); + movdqu(xmm0, Address(tmp, 8272)); + subsd(xmm5, xmm7); + addsd(xmm6, xmm4); + movdqu(xmm4, xmm7); + addsd(xmm5, xmm2); + addsd(xmm7, xmm1); + movdqu(xmm2, Address(tmp, 8336)); + subsd(xmm4, xmm7); + addsd(xmm6, xmm5); + addsd(xmm4, xmm1); + pshufd(xmm5, xmm7, 238); + movdqu(xmm1, xmm7); + addsd(xmm7, xmm5); + subsd(xmm1, xmm7); + addsd(xmm1, xmm5); + movdqu(xmm5, Address(tmp, 8352)); + pshufd(xmm3, xmm3, 68); + addsd(xmm6, xmm4); + addsd(xmm6, xmm1); + movdqu(xmm1, Address(tmp, 8304)); + mulpd(xmm0, xmm3); + mulpd(xmm2, xmm3); + pshufd(xmm4, xmm3, 68); + mulpd(xmm3, xmm3); + addpd(xmm0, xmm1); + addpd(xmm5, xmm2); + mulsd(xmm4, xmm3); + movsd(xmm2, Address(tmp, 16)); + mulpd(xmm3, xmm3); + movsd(xmm1, Address(rsp, 16)); + movzwl(ecx, Address(rsp, 22)); + mulpd(xmm0, xmm4); + pextrw(eax, xmm7, 3); + mulpd(xmm5, xmm4); + mulpd(xmm0, xmm3); + movsd(xmm4, Address(tmp, 8376)); + pand(xmm2, xmm7); + addsd(xmm5, xmm6); + subsd(xmm7, xmm2); + addpd(xmm5, xmm0); + andl(eax, 32752); + subl(eax, 16368); + andl(ecx, 32752); + cmpl(ecx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_48_0_2); + addl(ecx, eax); + cmpl(ecx, 16576); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_54_0_2); + pshufd(xmm0, xmm5, 238); + pand(xmm4, xmm1); + movdqu(xmm3, xmm1); + addsd(xmm5, xmm0); + subsd(xmm1, xmm4); + xorpd(xmm6, xmm6); + movl(edx, 17080); + pinsrw(xmm6, edx, 3); + addsd(xmm7, xmm5); + mulsd(xmm4, xmm2); + mulsd(xmm1, xmm2); + movdqu(xmm5, xmm6); + mulsd(xmm3, xmm7); + addsd(xmm6, xmm4); + addsd(xmm1, xmm3); + movdqu(xmm7, Address(tmp, 12480)); + movdl(edx, xmm6); + subsd(xmm6, xmm5); + movdqu(xmm3, Address(tmp, 12496)); + movsd(xmm2, Address(tmp, 12512)); + subsd(xmm4, xmm6); + movl(ecx, edx); + andl(edx, 255); + addl(edx, edx); + movdqu(xmm5, Address(tmp, edx, Address::times_8, 8384)); + addsd(xmm4, xmm1); + pextrw(edx, xmm6, 3); + shrl(ecx, 8); + movl(eax, ecx); + shrl(ecx, 1); + subl(eax, ecx); + shll(ecx, 20); + movdl(xmm6, ecx); + pshufd(xmm0, xmm4, 68); + pshufd(xmm1, xmm4, 68); + mulpd(xmm0, xmm0); + mulpd(xmm7, xmm1); + pshufd(xmm6, xmm6, 17); + mulsd(xmm2, xmm4); + andl(edx, 32767); + cmpl(edx, 16529); + jcc(Assembler::above, L_2TAG_PACKET_14_0_2); + mulsd(xmm0, xmm0); + paddd(xmm5, xmm6); + addpd(xmm3, xmm7); + mulsd(xmm2, xmm5); + pshufd(xmm6, xmm5, 238); + mulpd(xmm0, xmm3); + addsd(xmm2, xmm6); + pshufd(xmm3, xmm0, 238); + addl(eax, 1023); + shll(eax, 20); + orl(eax, rsi); + movdl(xmm4, eax); + mulsd(xmm0, xmm5); + mulsd(xmm3, xmm5); + addsd(xmm0, xmm2); + psllq(xmm4, 32); + addsd(xmm0, xmm3); + movdqu(xmm1, xmm0); + addsd(xmm0, xmm5); + movl(rsi, Address(rsp, 24)); + mulsd(xmm0, xmm4); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_16_0_2); + cmpl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_55_0_2); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_48_0_2); + movl(rsi, Address(rsp, 24)); + + bind(L_2TAG_PACKET_56_0_2); + movsd(xmm0, Address(rsp, 8)); + movsd(xmm1, Address(rsp, 16)); + addsd(xmm1, xmm1); + xorpd(xmm2, xmm2); + movl(eax, 49136); + pinsrw(xmm2, eax, 3); + addsd(xmm2, xmm0); + pextrw(eax, xmm2, 3); + cmpl(eax, 0); + jcc(Assembler::notEqual, L_2TAG_PACKET_57_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32760); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_57_0_2); + movdl(edx, xmm1); + movdqu(xmm3, xmm1); + psrlq(xmm3, 20); + movdl(ecx, xmm3); + orl(ecx, edx); + jcc(Assembler::equal, L_2TAG_PACKET_58_0_2); + addsd(xmm1, xmm1); + movdqu(xmm0, xmm1); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_58_0_2); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + pextrw(edx, xmm1, 3); + xorpd(xmm0, xmm0); + subl(eax, 16368); + xorl(eax, edx); + testl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_18_0_2); + movl(edx, 32752); + pinsrw(xmm0, edx, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_54_0_2); + pextrw(eax, xmm1, 3); + pextrw(ecx, xmm2, 3); + xorl(eax, ecx); + testl(eax, 32768); + jcc(Assembler::equal, L_2TAG_PACKET_50_0_2); + jmp(L_2TAG_PACKET_49_0_2); + + bind(L_2TAG_PACKET_6_0_2); + movl(tmp, Address(rsp, 64)); + +} + +/******************************************************************************/ +// ALGORITHM DESCRIPTION - SIN() +// --------------------- +// +// 1. RANGE REDUCTION +// +// We perform an initial range reduction from X to r with +// +// X =~= N * pi/32 + r +// +// so that |r| <= pi/64 + epsilon. We restrict inputs to those +// where |N| <= 932560. Beyond this, the range reduction is +// insufficiently accurate. For extremely small inputs, +// denormalization can occur internally, impacting performance. +// This means that the main path is actually only taken for +// 2^-252 <= |X| < 90112. +// +// To avoid branches, we perform the range reduction to full +// accuracy each time. +// +// X - N * (P_1 + P_2 + P_3) +// +// where P_1 and P_2 are 32-bit numbers (so multiplication by N +// is exact) and P_3 is a 53-bit number. Together, these +// approximate pi well enough for all cases in the restricted +// range. +// +// The main reduction sequence is: +// +// y = 32/pi * x +// N = integer(y) +// (computed by adding and subtracting off SHIFTER) +// +// m_1 = N * P_1 +// m_2 = N * P_2 +// r_1 = x - m_1 +// r = r_1 - m_2 +// (this r can be used for most of the calculation) +// +// c_1 = r_1 - r +// m_3 = N * P_3 +// c_2 = c_1 - m_2 +// c = c_2 - m_3 +// +// 2. MAIN ALGORITHM +// +// The algorithm uses a table lookup based on B = M * pi / 32 +// where M = N mod 64. The stored values are: +// sigma closest power of 2 to cos(B) +// C_hl 53-bit cos(B) - sigma +// S_hi + S_lo 2 * 53-bit sin(B) +// +// The computation is organized as follows: +// +// sin(B + r + c) = [sin(B) + sigma * r] + +// r * (cos(B) - sigma) + +// sin(B) * [cos(r + c) - 1] + +// cos(B) * [sin(r + c) - r] +// +// which is approximately: +// +// [S_hi + sigma * r] + +// C_hl * r + +// S_lo + S_hi * [(cos(r) - 1) - r * c] + +// (C_hl + sigma) * [(sin(r) - r) + c] +// +// and this is what is actually computed. We separate this sum +// into four parts: +// +// hi + med + pols + corr +// +// where +// +// hi = S_hi + sigma r +// med = C_hl * r +// pols = S_hi * (cos(r) - 1) + (C_hl + sigma) * (sin(r) - r) +// corr = S_lo + c * ((C_hl + sigma) - S_hi * r) +// +// 3. POLYNOMIAL +// +// The polynomial S_hi * (cos(r) - 1) + (C_hl + sigma) * +// (sin(r) - r) can be rearranged freely, since it is quite +// small, so we exploit parallelism to the fullest. +// +// psc4 = SC_4 * r_1 +// msc4 = psc4 * r +// r2 = r * r +// msc2 = SC_2 * r2 +// r4 = r2 * r2 +// psc3 = SC_3 + msc4 +// psc1 = SC_1 + msc2 +// msc3 = r4 * psc3 +// sincospols = psc1 + msc3 +// pols = sincospols * +// +// +// 4. CORRECTION TERM +// +// This is where the "c" component of the range reduction is +// taken into account; recall that just "r" is used for most of +// the calculation. +// +// -c = m_3 - c_2 +// -d = S_hi * r - (C_hl + sigma) +// corr = -c * -d + S_lo +// +// 5. COMPENSATED SUMMATIONS +// +// The two successive compensated summations add up the high +// and medium parts, leaving just the low parts to add up at +// the end. +// +// rs = sigma * r +// res_int = S_hi + rs +// k_0 = S_hi - res_int +// k_2 = k_0 + rs +// med = C_hl * r +// res_hi = res_int + med +// k_1 = res_int - res_hi +// k_3 = k_1 + med +// +// 6. FINAL SUMMATION +// +// We now add up all the small parts: +// +// res_lo = pols(hi) + pols(lo) + corr + k_1 + k_3 +// +// Now the overall result is just: +// +// res_hi + res_lo +// +// 7. SMALL ARGUMENTS +// +// If |x| < SNN (SNN meaning the smallest normal number), we +// simply perform 0.1111111 cdots 1111 * x. For SNN <= |x|, we +// do 2^-55 * (2^55 * x - x). +// +// Special cases: +// sin(NaN) = quiet NaN, and raise invalid exception +// sin(INF) = NaN and raise invalid exception +// sin(+/-0) = +/-0 +// +/******************************************************************************/ + +ALIGNED_(8) juint _zero_none[] = +{ + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0xbff00000UL +}; + +ALIGNED_(4) juint __4onpi_d[] = +{ + 0x6dc9c883UL, 0x3ff45f30UL +}; + +ALIGNED_(4) juint _TWO_32H[] = +{ + 0x00000000UL, 0x41f80000UL +}; + +ALIGNED_(4) juint _pi04_3d[] = +{ + 0x54442d00UL, 0x3fe921fbUL, 0x98cc5180UL, 0x3ce84698UL, 0xcbb5bf6cUL, + 0xb9dfc8f8UL +}; + +ALIGNED_(4) juint _pi04_5d[] = +{ + 0x54400000UL, 0x3fe921fbUL, 0x1a600000UL, 0x3dc0b461UL, 0x2e000000UL, + 0x3b93198aUL, 0x25200000UL, 0x396b839aUL, 0x533e63a0UL, 0x37027044UL +}; + +ALIGNED_(4) juint _SCALE[] = +{ + 0x00000000UL, 0x32600000UL +}; + +ALIGNED_(4) juint _zeros[] = +{ + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x80000000UL +}; + +ALIGNED_(4) juint _pi04_2d[] = +{ + 0x54400000UL, 0x3fe921fbUL, 0x1a626331UL, 0x3dc0b461UL +}; + +ALIGNED_(4) juint _TWO_12H[] = +{ + 0x00000000UL, 0x40b80000UL +}; + +ALIGNED_(2) jushort __4onpi_31l[] = +{ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x836e, 0xa2f9, + 0x40d8, 0x0000, 0x0000, 0x0000, 0x2a50, 0x9c88, 0x40b7, 0x0000, 0x0000, 0x0000, + 0xabe8, 0xfe13, 0x4099, 0x0000, 0x0000, 0x0000, 0x6ee0, 0xfa9a, 0x4079, 0x0000, + 0x0000, 0x0000, 0x9580, 0xdb62, 0x4058, 0x0000, 0x0000, 0x0000, 0x1c82, 0xc9e2, + 0x403d, 0x0000, 0x0000, 0x0000, 0xb1c0, 0xff28, 0x4019, 0x0000, 0x0000, 0x0000, + 0xef14, 0xaf7a, 0x3ffe, 0x0000, 0x0000, 0x0000, 0x48dc, 0xc36e, 0x3fdf, 0x0000, + 0x0000, 0x0000, 0x3740, 0xe909, 0x3fbe, 0x0000, 0x0000, 0x0000, 0x924a, 0xb801, + 0x3fa2, 0x0000, 0x0000, 0x0000, 0x3a32, 0xdd41, 0x3f83, 0x0000, 0x0000, 0x0000, + 0x8778, 0x873f, 0x3f62, 0x0000, 0x0000, 0x0000, 0x1298, 0xb1cb, 0x3f44, 0x0000, + 0x0000, 0x0000, 0xa208, 0x9cfb, 0x3f26, 0x0000, 0x0000, 0x0000, 0xbaec, 0xd7d4, + 0x3f06, 0x0000, 0x0000, 0x0000, 0xd338, 0x8909, 0x3ee7, 0x0000, 0x0000, 0x0000, + 0x68b8, 0xe04d, 0x3ec7, 0x0000, 0x0000, 0x0000, 0x4e64, 0xdf90, 0x3eaa, 0x0000, + 0x0000, 0x0000, 0xc1a8, 0xeb1c, 0x3e89, 0x0000, 0x0000, 0x0000, 0x2720, 0xce7d, + 0x3e6a, 0x0000, 0x0000, 0x0000, 0x77b8, 0x8bf1, 0x3e4b, 0x0000, 0x0000, 0x0000, + 0xec7e, 0xe4a0, 0x3e2e, 0x0000, 0x0000, 0x0000, 0xffbc, 0xf12f, 0x3e0f, 0x0000, + 0x0000, 0x0000, 0xfdc0, 0xb301, 0x3deb, 0x0000, 0x0000, 0x0000, 0xc5ac, 0x9788, + 0x3dd1, 0x0000, 0x0000, 0x0000, 0x47da, 0x829b, 0x3db2, 0x0000, 0x0000, 0x0000, + 0xd9e4, 0xa6cf, 0x3d93, 0x0000, 0x0000, 0x0000, 0x36e8, 0xf961, 0x3d73, 0x0000, + 0x0000, 0x0000, 0xf668, 0xf463, 0x3d54, 0x0000, 0x0000, 0x0000, 0x5168, 0xf2ff, + 0x3d35, 0x0000, 0x0000, 0x0000, 0x758e, 0xea4f, 0x3d17, 0x0000, 0x0000, 0x0000, + 0xf17a, 0xebe5, 0x3cf8, 0x0000, 0x0000, 0x0000, 0x9cfa, 0x9e83, 0x3cd9, 0x0000, + 0x0000, 0x0000, 0xa4ba, 0xe294, 0x3cba, 0x0000, 0x0000, 0x0000, 0xd7ec, 0x9afe, + 0x3c9a, 0x0000, 0x0000, 0x0000, 0xae80, 0x8fc6, 0x3c79, 0x0000, 0x0000, 0x0000, + 0x3304, 0x8560, 0x3c5c, 0x0000, 0x0000, 0x0000, 0x6d70, 0xdf8f, 0x3c3b, 0x0000, + 0x0000, 0x0000, 0x3ef0, 0xafc3, 0x3c1e, 0x0000, 0x0000, 0x0000, 0xd0d8, 0x826b, + 0x3bfe, 0x0000, 0x0000, 0x0000, 0x1c80, 0xed4f, 0x3bdd, 0x0000, 0x0000, 0x0000, + 0x730c, 0xb0af, 0x3bc1, 0x0000, 0x0000, 0x0000, 0x6660, 0xc219, 0x3ba2, 0x0000, + 0x0000, 0x0000, 0x940c, 0xabe2, 0x3b83, 0x0000, 0x0000, 0x0000, 0xdffc, 0x8408, + 0x3b64, 0x0000, 0x0000, 0x0000, 0x6b98, 0xc402, 0x3b45, 0x0000, 0x0000, 0x0000, + 0x1818, 0x9cc4, 0x3b26, 0x0000, 0x0000, 0x0000, 0x5390, 0xaab6, 0x3b05, 0x0000, + 0x0000, 0x0000, 0xb070, 0xd464, 0x3ae9, 0x0000, 0x0000, 0x0000, 0x231a, 0x9ef0, + 0x3aca, 0x0000, 0x0000, 0x0000, 0x0670, 0xd1f1, 0x3aaa, 0x0000, 0x0000, 0x0000, + 0x7738, 0xd9f3, 0x3a8a, 0x0000, 0x0000, 0x0000, 0xa834, 0x8092, 0x3a6c, 0x0000, + 0x0000, 0x0000, 0xb45c, 0xce23, 0x3a4d, 0x0000, 0x0000, 0x0000, 0x36e8, 0xb0e5, + 0x3a2d, 0x0000, 0x0000, 0x0000, 0xd156, 0xaf44, 0x3a10, 0x0000, 0x0000, 0x0000, + 0x9f52, 0x8c82, 0x39f1, 0x0000, 0x0000, 0x0000, 0x829c, 0xff83, 0x39d1, 0x0000, + 0x0000, 0x0000, 0x7d06, 0xefc6, 0x39b3, 0x0000, 0x0000, 0x0000, 0x93e0, 0xb0b7, + 0x3992, 0x0000, 0x0000, 0x0000, 0xedde, 0xc193, 0x3975, 0x0000, 0x0000, 0x0000, + 0xbbc0, 0xcf49, 0x3952, 0x0000, 0x0000, 0x0000, 0xbdf0, 0xd63c, 0x3937, 0x0000, + 0x0000, 0x0000, 0x1f34, 0x9f3a, 0x3918, 0x0000, 0x0000, 0x0000, 0x3f8e, 0xe579, + 0x38f9, 0x0000, 0x0000, 0x0000, 0x90c8, 0xc3f8, 0x38d9, 0x0000, 0x0000, 0x0000, + 0x48c0, 0xf8f8, 0x38b7, 0x0000, 0x0000, 0x0000, 0xed56, 0xafa6, 0x389c, 0x0000, + 0x0000, 0x0000, 0x8218, 0xb969, 0x387d, 0x0000, 0x0000, 0x0000, 0x1852, 0xec57, + 0x385e, 0x0000, 0x0000, 0x0000, 0x670c, 0xd674, 0x383e, 0x0000, 0x0000, 0x0000, + 0xad40, 0xc2c4, 0x3820, 0x0000, 0x0000, 0x0000, 0x2e80, 0xa696, 0x3801, 0x0000, + 0x0000, 0x0000, 0xd800, 0xc467, 0x37dc, 0x0000, 0x0000, 0x0000, 0x3c72, 0xc5ae, + 0x37c3, 0x0000, 0x0000, 0x0000, 0xb006, 0xac69, 0x37a4, 0x0000, 0x0000, 0x0000, + 0x34a0, 0x8cdf, 0x3782, 0x0000, 0x0000, 0x0000, 0x9ed2, 0xd25e, 0x3766, 0x0000, + 0x0000, 0x0000, 0x6fec, 0xaaaa, 0x3747, 0x0000, 0x0000, 0x0000, 0x6040, 0xfb5c, + 0x3726, 0x0000, 0x0000, 0x0000, 0x764c, 0xa3fc, 0x3708, 0x0000, 0x0000, 0x0000, + 0xb254, 0x954e, 0x36e9, 0x0000, 0x0000, 0x0000, 0x3e1c, 0xf5dc, 0x36ca, 0x0000, + 0x0000, 0x0000, 0x7b06, 0xc635, 0x36ac, 0x0000, 0x0000, 0x0000, 0xa8ba, 0xd738, + 0x368d, 0x0000, 0x0000, 0x0000, 0x06cc, 0xb24e, 0x366d, 0x0000, 0x0000, 0x0000, + 0x7108, 0xac76, 0x364f, 0x0000, 0x0000, 0x0000, 0x2324, 0xa7cb, 0x3630, 0x0000, + 0x0000, 0x0000, 0xac40, 0xef15, 0x360f, 0x0000, 0x0000, 0x0000, 0xae46, 0xd516, + 0x35f2, 0x0000, 0x0000, 0x0000, 0x615e, 0xe003, 0x35d3, 0x0000, 0x0000, 0x0000, + 0x0cf0, 0xefe7, 0x35b1, 0x0000, 0x0000, 0x0000, 0xfb50, 0xf98c, 0x3595, 0x0000, + 0x0000, 0x0000, 0x0abc, 0xf333, 0x3575, 0x0000, 0x0000, 0x0000, 0xdd60, 0xca3f, + 0x3555, 0x0000, 0x0000, 0x0000, 0x7eb6, 0xd87f, 0x3538, 0x0000, 0x0000, 0x0000, + 0x44f4, 0xb291, 0x3519, 0x0000, 0x0000, 0x0000, 0xff80, 0xc982, 0x34f6, 0x0000, + 0x0000, 0x0000, 0x9de0, 0xd9b8, 0x34db, 0x0000, 0x0000, 0x0000, 0xcd42, 0x9366, + 0x34bc, 0x0000, 0x0000, 0x0000, 0xbef0, 0xfaee, 0x349d, 0x0000, 0x0000, 0x0000, + 0xdac4, 0xb6f1, 0x347d, 0x0000, 0x0000, 0x0000, 0xf140, 0x94de, 0x345d, 0x0000, + 0x0000, 0x0000, 0xa218, 0x8b4b, 0x343e, 0x0000, 0x0000, 0x0000, 0x6380, 0xa135, + 0x341e, 0x0000, 0x0000, 0x0000, 0xb184, 0x8cb2, 0x3402, 0x0000, 0x0000, 0x0000, + 0x196e, 0xdc61, 0x33e3, 0x0000, 0x0000, 0x0000, 0x0c00, 0xde05, 0x33c4, 0x0000, + 0x0000, 0x0000, 0xef9a, 0xbd38, 0x33a5, 0x0000, 0x0000, 0x0000, 0xc1a0, 0xdf00, + 0x3385, 0x0000, 0x0000, 0x0000, 0x1090, 0x9973, 0x3365, 0x0000, 0x0000, 0x0000, + 0x4882, 0x8301, 0x3348, 0x0000, 0x0000, 0x0000, 0x7abe, 0xadc7, 0x3329, 0x0000, + 0x0000, 0x0000, 0x7cba, 0xec2b, 0x330a, 0x0000, 0x0000, 0x0000, 0xa520, 0x8f21, + 0x32e9, 0x0000, 0x0000, 0x0000, 0x710c, 0x8d36, 0x32cc, 0x0000, 0x0000, 0x0000, + 0x5212, 0xc6ed, 0x32ad, 0x0000, 0x0000, 0x0000, 0x7308, 0xfd76, 0x328d, 0x0000, + 0x0000, 0x0000, 0x5014, 0xd548, 0x326f, 0x0000, 0x0000, 0x0000, 0xd3f2, 0xb499, + 0x3250, 0x0000, 0x0000, 0x0000, 0x7f74, 0xa606, 0x3230, 0x0000, 0x0000, 0x0000, + 0xf0a8, 0xd720, 0x3212, 0x0000, 0x0000, 0x0000, 0x185c, 0xe20f, 0x31f2, 0x0000, + 0x0000, 0x0000, 0xa5a8, 0x8738, 0x31d4, 0x0000, 0x0000, 0x0000, 0xdd74, 0xcafb, + 0x31b4, 0x0000, 0x0000, 0x0000, 0x98b6, 0xbd8e, 0x3196, 0x0000, 0x0000, 0x0000, + 0xe9de, 0x977f, 0x3177, 0x0000, 0x0000, 0x0000, 0x67c0, 0x818d, 0x3158, 0x0000, + 0x0000, 0x0000, 0xe52a, 0x9322, 0x3139, 0x0000, 0x0000, 0x0000, 0xe568, 0x9b6c, + 0x3119, 0x0000, 0x0000, 0x0000, 0x2358, 0xaa0a, 0x30fa, 0x0000, 0x0000, 0x0000, + 0xe480, 0xe13b, 0x30d9, 0x0000, 0x0000, 0x0000, 0x3024, 0x90a1, 0x30bd, 0x0000, + 0x0000, 0x0000, 0x9620, 0xda30, 0x309d, 0x0000, 0x0000, 0x0000, 0x898a, 0xb388, + 0x307f, 0x0000, 0x0000, 0x0000, 0xb24c, 0xc891, 0x3060, 0x0000, 0x0000, 0x0000, + 0x8056, 0xf98b, 0x3041, 0x0000, 0x0000, 0x0000, 0x72a4, 0xa1ea, 0x3021, 0x0000, + 0x0000, 0x0000, 0x6af8, 0x9488, 0x3001, 0x0000, 0x0000, 0x0000, 0xe00c, 0xdfcb, + 0x2fe4, 0x0000, 0x0000, 0x0000, 0xeeec, 0xc941, 0x2fc4, 0x0000, 0x0000, 0x0000, + 0x53e0, 0xe70f, 0x2fa4, 0x0000, 0x0000, 0x0000, 0x8f60, 0x9c07, 0x2f85, 0x0000, + 0x0000, 0x0000, 0xb328, 0xc3e7, 0x2f68, 0x0000, 0x0000, 0x0000, 0x9404, 0xf8c7, + 0x2f48, 0x0000, 0x0000, 0x0000, 0x38e0, 0xc99f, 0x2f29, 0x0000, 0x0000, 0x0000, + 0x9778, 0xd984, 0x2f09, 0x0000, 0x0000, 0x0000, 0xe700, 0xd142, 0x2eea, 0x0000, + 0x0000, 0x0000, 0xd904, 0x9443, 0x2ecd, 0x0000, 0x0000, 0x0000, 0xd4ba, 0xae7e, + 0x2eae, 0x0000, 0x0000, 0x0000, 0x8e5e, 0x8524, 0x2e8f, 0x0000, 0x0000, 0x0000, + 0xb550, 0xc9ed, 0x2e6e, 0x0000, 0x0000, 0x0000, 0x53b8, 0x8648, 0x2e51, 0x0000, + 0x0000, 0x0000, 0xdae4, 0x87f9, 0x2e32, 0x0000, 0x0000, 0x0000, 0x2942, 0xd966, + 0x2e13, 0x0000, 0x0000, 0x0000, 0x4f28, 0xcf3c, 0x2df3, 0x0000, 0x0000, 0x0000, + 0xfa40, 0xc4ef, 0x2dd1, 0x0000, 0x0000, 0x0000, 0x4424, 0xbca7, 0x2db5, 0x0000, + 0x0000, 0x0000, 0x2e62, 0xcdc5, 0x2d97, 0x0000, 0x0000, 0x0000, 0xed88, 0x996b, + 0x2d78, 0x0000, 0x0000, 0x0000, 0x7c30, 0xd97d, 0x2d56, 0x0000, 0x0000, 0x0000, + 0xed26, 0xbf6e, 0x2d3a, 0x0000, 0x0000, 0x0000, 0x2918, 0x921b, 0x2d1a, 0x0000, + 0x0000, 0x0000, 0x4e24, 0xe84e, 0x2cfb, 0x0000, 0x0000, 0x0000, 0x6dc0, 0x92ec, + 0x2cdd, 0x0000, 0x0000, 0x0000, 0x4f2c, 0xacf8, 0x2cbd, 0x0000, 0x0000, 0x0000, + 0xc634, 0xf094, 0x2c9e, 0x0000, 0x0000, 0x0000, 0xdc70, 0xe5d3, 0x2c7e, 0x0000, + 0x0000, 0x0000, 0x2180, 0xa600, 0x2c5b, 0x0000, 0x0000, 0x0000, 0x8480, 0xd680, + 0x2c3c, 0x0000, 0x0000, 0x0000, 0x8b24, 0xd63b, 0x2c22, 0x0000, 0x0000, 0x0000, + 0x02e0, 0xaa47, 0x2c00, 0x0000, 0x0000, 0x0000, 0x9ad0, 0xee84, 0x2be3, 0x0000, + 0x0000, 0x0000, 0xf7dc, 0xf699, 0x2bc6, 0x0000, 0x0000, 0x0000, 0xddde, 0xe490, + 0x2ba7, 0x0000, 0x0000, 0x0000, 0x34a0, 0xb4fd, 0x2b85, 0x0000, 0x0000, 0x0000, + 0x91b4, 0x8ef6, 0x2b68, 0x0000, 0x0000, 0x0000, 0xa3e0, 0xa2a7, 0x2b47, 0x0000, + 0x0000, 0x0000, 0xcce4, 0x82b3, 0x2b2a, 0x0000, 0x0000, 0x0000, 0xe4be, 0x8207, + 0x2b0c, 0x0000, 0x0000, 0x0000, 0x1d92, 0xab43, 0x2aed, 0x0000, 0x0000, 0x0000, + 0xe818, 0xf9f6, 0x2acd, 0x0000, 0x0000, 0x0000, 0xff12, 0xba80, 0x2aaf, 0x0000, + 0x0000, 0x0000, 0x5254, 0x8529, 0x2a90, 0x0000, 0x0000, 0x0000, 0x1b88, 0xe032, + 0x2a71, 0x0000, 0x0000, 0x0000, 0x3248, 0xd86d, 0x2a50, 0x0000, 0x0000, 0x0000, + 0x3140, 0xc9d5, 0x2a2e, 0x0000, 0x0000, 0x0000, 0x14e6, 0xbd47, 0x2a14, 0x0000, + 0x0000, 0x0000, 0x5c10, 0xe544, 0x29f4, 0x0000, 0x0000, 0x0000, 0x9f50, 0x90b6, + 0x29d4, 0x0000, 0x0000, 0x0000, 0x9850, 0xab55, 0x29b6, 0x0000, 0x0000, 0x0000, + 0x2750, 0x9d07, 0x2998, 0x0000, 0x0000, 0x0000, 0x6700, 0x8bbb, 0x2973, 0x0000, + 0x0000, 0x0000, 0x5dba, 0xed31, 0x295a, 0x0000, 0x0000, 0x0000, 0x61dc, 0x85fe, + 0x293a, 0x0000, 0x0000, 0x0000, 0x9ba2, 0xd6b4, 0x291c, 0x0000, 0x0000, 0x0000, + 0x2d30, 0xe3a5, 0x28fb, 0x0000, 0x0000, 0x0000, 0x6630, 0xb566, 0x28dd, 0x0000, + 0x0000, 0x0000, 0x5ad4, 0xa829, 0x28bf, 0x0000, 0x0000, 0x0000, 0x89d8, 0xe290, + 0x28a0, 0x0000, 0x0000, 0x0000, 0x3916, 0xc428, 0x2881, 0x0000, 0x0000, 0x0000, + 0x0490, 0xbea4, 0x2860, 0x0000, 0x0000, 0x0000, 0xee06, 0x80ee, 0x2843, 0x0000, + 0x0000, 0x0000, 0xfc00, 0xf327, 0x2820, 0x0000, 0x0000, 0x0000, 0xea40, 0xa871, + 0x2800, 0x0000, 0x0000, 0x0000, 0x63d8, 0x9c26, 0x27e4, 0x0000, 0x0000, 0x0000, + 0x07ba, 0xc0c9, 0x27c7, 0x0000, 0x0000, 0x0000, 0x3fa2, 0x9797, 0x27a8, 0x0000, + 0x0000, 0x0000, 0x21c6, 0xfeca, 0x2789, 0x0000, 0x0000, 0x0000, 0xde40, 0x860d, + 0x2768, 0x0000, 0x0000, 0x0000, 0x9cc8, 0x98ce, 0x2749, 0x0000, 0x0000, 0x0000, + 0x3778, 0xa31c, 0x272a, 0x0000, 0x0000, 0x0000, 0xe778, 0xf6e2, 0x270b, 0x0000, + 0x0000, 0x0000, 0x59b8, 0xf841, 0x26ed, 0x0000, 0x0000, 0x0000, 0x02e0, 0xad04, + 0x26cd, 0x0000, 0x0000, 0x0000, 0x5a92, 0x9380, 0x26b0, 0x0000, 0x0000, 0x0000, + 0xc740, 0x8886, 0x268d, 0x0000, 0x0000, 0x0000, 0x0680, 0xfaf8, 0x266c, 0x0000, + 0x0000, 0x0000, 0xfb60, 0x897f, 0x2653, 0x0000, 0x0000, 0x0000, 0x8760, 0xf903, + 0x2634, 0x0000, 0x0000, 0x0000, 0xad2a, 0xc2c8, 0x2615, 0x0000, 0x0000, 0x0000, + 0x2d86, 0x8aef, 0x25f6, 0x0000, 0x0000, 0x0000, 0x1ef4, 0xe627, 0x25d6, 0x0000, + 0x0000, 0x0000, 0x09e4, 0x8020, 0x25b7, 0x0000, 0x0000, 0x0000, 0x7548, 0xd227, + 0x2598, 0x0000, 0x0000, 0x0000, 0x75dc, 0xfb5b, 0x2579, 0x0000, 0x0000, 0x0000, + 0xea84, 0xc8b6, 0x255a, 0x0000, 0x0000, 0x0000, 0xe4d0, 0x8145, 0x253b, 0x0000, + 0x0000, 0x0000, 0x3640, 0x9768, 0x251c, 0x0000, 0x0000, 0x0000, 0x246a, 0xccec, + 0x24fe, 0x0000, 0x0000, 0x0000, 0x51d0, 0xa075, 0x24dd, 0x0000, 0x0000, 0x0000, + 0x4638, 0xa385, 0x24bf, 0x0000, 0x0000, 0x0000, 0xd788, 0xd776, 0x24a1, 0x0000, + 0x0000, 0x0000, 0x1370, 0x8997, 0x2482, 0x0000, 0x0000, 0x0000, 0x1e88, 0x9b67, + 0x2462, 0x0000, 0x0000, 0x0000, 0x6c08, 0xd975, 0x2444, 0x0000, 0x0000, 0x0000, + 0xfdb0, 0xcfc0, 0x2422, 0x0000, 0x0000, 0x0000, 0x3100, 0xc026, 0x2406, 0x0000, + 0x0000, 0x0000, 0xc5b4, 0xae64, 0x23e6, 0x0000, 0x0000, 0x0000, 0x2280, 0xf687, + 0x23c3, 0x0000, 0x0000, 0x0000, 0x2de0, 0x9006, 0x23a9, 0x0000, 0x0000, 0x0000, + 0x24bc, 0xf631, 0x238a, 0x0000, 0x0000, 0x0000, 0xb8d4, 0xa975, 0x236b, 0x0000, + 0x0000, 0x0000, 0xd9a4, 0xb949, 0x234b, 0x0000, 0x0000, 0x0000, 0xb54e, 0xbd39, + 0x232d, 0x0000, 0x0000, 0x0000, 0x4aac, 0x9a52, 0x230e, 0x0000, 0x0000, 0x0000, + 0xbbbc, 0xd085, 0x22ef, 0x0000, 0x0000, 0x0000, 0xdf18, 0xc633, 0x22cf, 0x0000, + 0x0000, 0x0000, 0x16d0, 0xeca5, 0x22af, 0x0000, 0x0000, 0x0000, 0xf2a0, 0xdf6f, + 0x228e, 0x0000, 0x0000, 0x0000, 0x8c44, 0xe86b, 0x2272, 0x0000, 0x0000, 0x0000, + 0x35c0, 0xbbf4, 0x2253, 0x0000, 0x0000, 0x0000, 0x0c40, 0xdafb, 0x2230, 0x0000, + 0x0000, 0x0000, 0x92dc, 0x9935, 0x2216, 0x0000, 0x0000, 0x0000, 0x0ca0, 0xbda6, + 0x21f3, 0x0000, 0x0000, 0x0000, 0x5958, 0xa6fd, 0x21d6, 0x0000, 0x0000, 0x0000, + 0xa3dc, 0x9d7f, 0x21b9, 0x0000, 0x0000, 0x0000, 0x79dc, 0xfcb5, 0x2199, 0x0000, + 0x0000, 0x0000, 0xf264, 0xcebb, 0x217b, 0x0000, 0x0000, 0x0000, 0x0abe, 0x8308, + 0x215c, 0x0000, 0x0000, 0x0000, 0x30ae, 0xb463, 0x213d, 0x0000, 0x0000, 0x0000, + 0x6228, 0xb040, 0x211c, 0x0000, 0x0000, 0x0000, 0xc9b2, 0xf43b, 0x20ff, 0x0000, + 0x0000, 0x0000, 0x3d8e, 0xa4b3, 0x20e0, 0x0000, 0x0000, 0x0000, 0x84e6, 0x8dab, + 0x20c1, 0x0000, 0x0000, 0x0000, 0xa124, 0x9b74, 0x20a1, 0x0000, 0x0000, 0x0000, + 0xc276, 0xd497, 0x2083, 0x0000, 0x0000, 0x0000, 0x6354, 0xa466, 0x2063, 0x0000, + 0x0000, 0x0000, 0x8654, 0xaf0a, 0x2044, 0x0000, 0x0000, 0x0000, 0x1d20, 0xfa5c, + 0x2024, 0x0000, 0x0000, 0x0000, 0xbcd0, 0xf3f0, 0x2004, 0x0000, 0x0000, 0x0000, + 0xedf0, 0xf0b6, 0x1fe7, 0x0000, 0x0000, 0x0000, 0x45bc, 0x9182, 0x1fc9, 0x0000, + 0x0000, 0x0000, 0xe254, 0xdc85, 0x1faa, 0x0000, 0x0000, 0x0000, 0xb898, 0xe9b1, + 0x1f8a, 0x0000, 0x0000, 0x0000, 0x0ebe, 0xe6f0, 0x1f6c, 0x0000, 0x0000, 0x0000, + 0xa9b8, 0xf584, 0x1f4c, 0x0000, 0x0000, 0x0000, 0x12e8, 0xdf6b, 0x1f2e, 0x0000, + 0x0000, 0x0000, 0x9f9e, 0xcd55, 0x1f0f, 0x0000, 0x0000, 0x0000, 0x05a0, 0xec3a, + 0x1eef, 0x0000, 0x0000, 0x0000, 0xd8e0, 0x96f8, 0x1ed1, 0x0000, 0x0000, 0x0000, + 0x3bd4, 0xccc6, 0x1eb1, 0x0000, 0x0000, 0x0000, 0x4910, 0xb87b, 0x1e93, 0x0000, + 0x0000, 0x0000, 0xbefc, 0xd40b, 0x1e73, 0x0000, 0x0000, 0x0000, 0x317e, 0xa406, + 0x1e55, 0x0000, 0x0000, 0x0000, 0x6bb2, 0xc2b2, 0x1e36, 0x0000, 0x0000, 0x0000, + 0xb87e, 0xbb78, 0x1e17, 0x0000, 0x0000, 0x0000, 0xa03c, 0xdbbd, 0x1df7, 0x0000, + 0x0000, 0x0000, 0x5b6c, 0xe3c8, 0x1dd9, 0x0000, 0x0000, 0x0000, 0x8968, 0xca8e, + 0x1dba, 0x0000, 0x0000, 0x0000, 0xc024, 0xe6ab, 0x1d9a, 0x0000, 0x0000, 0x0000, + 0x4110, 0xd4eb, 0x1d7a, 0x0000, 0x0000, 0x0000, 0xa168, 0xbdb5, 0x1d5d, 0x0000, + 0x0000, 0x0000, 0x012e, 0xa5fa, 0x1d3e, 0x0000, 0x0000, 0x0000, 0x6838, 0x9c1f, + 0x1d1e, 0x0000, 0x0000, 0x0000, 0xa158, 0xaa76, 0x1d00, 0x0000, 0x0000, 0x0000, + 0x090a, 0xbd95, 0x1ce1, 0x0000, 0x0000, 0x0000, 0xf73e, 0x8b6d, 0x1cc2, 0x0000, + 0x0000, 0x0000, 0x5fda, 0xbcbf, 0x1ca3, 0x0000, 0x0000, 0x0000, 0xdbe8, 0xb89f, + 0x1c84, 0x0000, 0x0000, 0x0000, 0x6e4c, 0x96c7, 0x1c64, 0x0000, 0x0000, 0x0000, + 0x19c2, 0xf2a4, 0x1c46, 0x0000, 0x0000, 0x0000, 0xb800, 0xf855, 0x1c1e, 0x0000, + 0x0000, 0x0000, 0x87fc, 0x85ff, 0x1c08, 0x0000, 0x0000, 0x0000, 0x1418, 0x839f, + 0x1be9, 0x0000, 0x0000, 0x0000, 0x6186, 0xd9d8, 0x1bca, 0x0000, 0x0000, 0x0000, + 0xf500, 0xabaa, 0x1ba6, 0x0000, 0x0000, 0x0000, 0x7b36, 0xdafe, 0x1b8c, 0x0000, + 0x0000, 0x0000, 0xf394, 0xe6d8, 0x1b6c, 0x0000, 0x0000, 0x0000, 0x6efc, 0x9e55, + 0x1b4e, 0x0000, 0x0000, 0x0000, 0x5e10, 0xc523, 0x1b2e, 0x0000, 0x0000, 0x0000, + 0x8210, 0xb6f9, 0x1b0d, 0x0000, 0x0000, 0x0000, 0x9ab0, 0x96e3, 0x1af1, 0x0000, + 0x0000, 0x0000, 0x3864, 0x92e7, 0x1ad1, 0x0000, 0x0000, 0x0000, 0x9878, 0xdc65, + 0x1ab1, 0x0000, 0x0000, 0x0000, 0xfa20, 0xd6cb, 0x1a94, 0x0000, 0x0000, 0x0000, + 0x6c00, 0xa4e4, 0x1a70, 0x0000, 0x0000, 0x0000, 0xab40, 0xb41b, 0x1a53, 0x0000, + 0x0000, 0x0000, 0x43a4, 0x8ede, 0x1a37, 0x0000, 0x0000, 0x0000, 0x22e0, 0x9314, + 0x1a15, 0x0000, 0x0000, 0x0000, 0x6170, 0xb949, 0x19f8, 0x0000, 0x0000, 0x0000, + 0x6b00, 0xe056, 0x19d8, 0x0000, 0x0000, 0x0000, 0x9ba8, 0xa94c, 0x19b9, 0x0000, + 0x0000, 0x0000, 0xfaa0, 0xaa16, 0x199b, 0x0000, 0x0000, 0x0000, 0x899a, 0xf627, + 0x197d, 0x0000, 0x0000, 0x0000, 0x9f20, 0xfb70, 0x195d, 0x0000, 0x0000, 0x0000, + 0xa4b8, 0xc176, 0x193e, 0x0000, 0x0000, 0x0000, 0xb21c, 0x85c3, 0x1920, 0x0000, + 0x0000, 0x0000, 0x50d2, 0x9b19, 0x1901, 0x0000, 0x0000, 0x0000, 0xd4b0, 0xb708, + 0x18e0, 0x0000, 0x0000, 0x0000, 0xfb88, 0xf510, 0x18c1, 0x0000, 0x0000, 0x0000, + 0x31ec, 0xdc8d, 0x18a3, 0x0000, 0x0000, 0x0000, 0x3c00, 0xbff9, 0x1885, 0x0000, + 0x0000, 0x0000, 0x5020, 0xc30b, 0x1862, 0x0000, 0x0000, 0x0000, 0xd4f0, 0xda0c, + 0x1844, 0x0000, 0x0000, 0x0000, 0x20d2, 0x99a5, 0x1828, 0x0000, 0x0000, 0x0000, + 0x852e, 0xd159, 0x1809, 0x0000, 0x0000, 0x0000, 0x7cd8, 0x97a1, 0x17e9, 0x0000, + 0x0000, 0x0000, 0x423a, 0x997b, 0x17cb, 0x0000, 0x0000, 0x0000, 0xc1c0, 0xbe7d, + 0x17a8, 0x0000, 0x0000, 0x0000, 0xe8bc, 0xdcdd, 0x178d, 0x0000, 0x0000, 0x0000, + 0x8b28, 0xae06, 0x176e, 0x0000, 0x0000, 0x0000, 0x102e, 0xb8d4, 0x174f, 0x0000, + 0x0000, 0x0000, 0xaa00, 0xaa5c, 0x172f, 0x0000, 0x0000, 0x0000, 0x51f0, 0x9fc0, + 0x170e, 0x0000, 0x0000, 0x0000, 0xf858, 0xe181, 0x16f2, 0x0000, 0x0000, 0x0000, + 0x91a8, 0x8162, 0x16d3, 0x0000, 0x0000, 0x0000, 0x5f40, 0xcb6f, 0x16b1, 0x0000, + 0x0000, 0x0000, 0xbb50, 0xe55f, 0x1693, 0x0000, 0x0000, 0x0000, 0xacd2, 0xd895, + 0x1676, 0x0000, 0x0000, 0x0000, 0xef30, 0x97bf, 0x1654, 0x0000, 0x0000, 0x0000, + 0xf700, 0xb3d7, 0x1633, 0x0000, 0x0000, 0x0000, 0x3454, 0xa7b5, 0x1619, 0x0000, + 0x0000, 0x0000, 0x6b00, 0xa929, 0x15f6, 0x0000, 0x0000, 0x0000, 0x9f04, 0x89f7, + 0x15db, 0x0000, 0x0000, 0x0000, 0xad78, 0xd985, 0x15bc, 0x0000, 0x0000, 0x0000, + 0xa46a, 0xae3f, 0x159d, 0x0000, 0x0000, 0x0000, 0x63a0, 0xd0da, 0x157c, 0x0000, + 0x0000, 0x0000, 0x5e90, 0x817d, 0x155e, 0x0000, 0x0000, 0x0000, 0x1494, 0xb13f, + 0x1540, 0x0000, 0x0000, 0x0000, 0x0090, 0x9c40, 0x1521, 0x0000, 0x0000, 0x0000, + 0xdd70, 0xcc86, 0x1500, 0x0000, 0x0000, 0x0000, 0x64f8, 0xdb6f, 0x14e1, 0x0000, + 0x0000, 0x0000, 0xe22c, 0xac17, 0x14c3, 0x0000, 0x0000, 0x0000, 0x60e0, 0xa9ad, + 0x14a3, 0x0000, 0x0000, 0x0000, 0x4640, 0xd658, 0x1481, 0x0000, 0x0000, 0x0000, + 0x6490, 0xa181, 0x1467, 0x0000, 0x0000, 0x0000, 0x1df4, 0xaaa2, 0x1447, 0x0000, + 0x0000, 0x0000, 0xb94a, 0x8f61, 0x1429, 0x0000, 0x0000, 0x0000, 0x5198, 0x9d83, + 0x1409, 0x0000, 0x0000, 0x0000, 0x0f7a, 0xa818, 0x13eb, 0x0000, 0x0000, 0x0000, + 0xc45e, 0xc06c, 0x13cc, 0x0000, 0x0000, 0x0000, 0x4ec0, 0xfa29, 0x13a8, 0x0000, + 0x0000, 0x0000, 0x6418, 0x8cad, 0x138c, 0x0000, 0x0000, 0x0000, 0xbcc8, 0xe7d1, + 0x136f, 0x0000, 0x0000, 0x0000, 0xc934, 0xf9b0, 0x134f, 0x0000, 0x0000, 0x0000, + 0x6ce0, 0x98df, 0x1331, 0x0000, 0x0000, 0x0000, 0x3516, 0xe5e9, 0x1312, 0x0000, + 0x0000, 0x0000, 0xc6c0, 0xef8b, 0x12ef, 0x0000, 0x0000, 0x0000, 0xaf02, 0x913d, + 0x12d4, 0x0000, 0x0000, 0x0000, 0xd230, 0xe1d5, 0x12b5, 0x0000, 0x0000, 0x0000, + 0xfba8, 0xc232, 0x1295, 0x0000, 0x0000, 0x0000, 0x7ba4, 0xabeb, 0x1277, 0x0000, + 0x0000, 0x0000, 0x6e5c, 0xc692, 0x1258, 0x0000, 0x0000, 0x0000, 0x76a2, 0x9756, + 0x1239, 0x0000, 0x0000, 0x0000, 0xe180, 0xe423, 0x1214, 0x0000, 0x0000, 0x0000, + 0x8c3c, 0x90f8, 0x11fb, 0x0000, 0x0000, 0x0000, 0x9f3c, 0x9fd2, 0x11dc, 0x0000, + 0x0000, 0x0000, 0x53e0, 0xb73e, 0x11bd, 0x0000, 0x0000, 0x0000, 0x45be, 0x88d6, + 0x119e, 0x0000, 0x0000, 0x0000, 0x111a, 0x8bc0, 0x117f, 0x0000, 0x0000, 0x0000, + 0xe26a, 0xd7ff, 0x1160, 0x0000, 0x0000, 0x0000, 0xfb60, 0xdd8d, 0x113f, 0x0000, + 0x0000, 0x0000, 0x9370, 0xc108, 0x1120, 0x0000, 0x0000, 0x0000, 0x9654, 0x8baf, + 0x1103, 0x0000, 0x0000, 0x0000, 0xd6ec, 0xd6b9, 0x10e4, 0x0000, 0x0000, 0x0000, + 0x23e4, 0xd7b7, 0x10c4, 0x0000, 0x0000, 0x0000, 0x1aa6, 0xa847, 0x10a6, 0x0000, + 0x0000, 0x0000, 0xbee6, 0x9fef, 0x1087, 0x0000, 0x0000, 0x0000, 0x26d0, 0xa6eb, + 0x1066, 0x0000, 0x0000, 0x0000, 0x5b86, 0xa880, 0x1049, 0x0000, 0x0000, 0x0000, + 0x125c, 0xd971, 0x1029, 0x0000, 0x0000, 0x0000, 0x1f78, 0x9d18, 0x100a, 0x0000, + 0x0000, 0x0000, 0x0e84, 0xb15b, 0x0feb, 0x0000, 0x0000, 0x0000, 0xd0c0, 0xc150, + 0x0fcc, 0x0000, 0x0000, 0x0000, 0xa330, 0xc40c, 0x0fad, 0x0000, 0x0000, 0x0000, + 0x5202, 0xfc2c, 0x0f8f, 0x0000, 0x0000, 0x0000, 0x3f7c, 0xecf5, 0x0f6f, 0x0000, + 0x0000, 0x0000, 0xef44, 0xfdfd, 0x0f50, 0x0000, 0x0000, 0x0000, 0x3f6c, 0xab1b, + 0x0f31, 0x0000, 0x0000, 0x0000, 0xf658, 0x89ec, 0x0f11, 0x0000, 0x0000, 0x0000, + 0xbfc8, 0x9ba8, 0x0ef4, 0x0000, 0x0000, 0x0000, 0x3d40, 0xbe21, 0x0ed5, 0x0000, + 0x0000, 0x0000, 0xbbc4, 0xc70d, 0x0eb6, 0x0000, 0x0000, 0x0000, 0x5158, 0xdb16, + 0x0e96, 0x0000, 0x0000, 0x0000, 0xb5a8, 0xa8d8, 0x0e78, 0x0000, 0x0000, 0x0000, + 0xcccc, 0xb40e, 0x0e58, 0x0000, 0x0000, 0x0000, 0x448c, 0xcb62, 0x0e3a, 0x0000, + 0x0000, 0x0000, 0xf12a, 0x8aed, 0x0e1b, 0x0000, 0x0000, 0x0000, 0x79d0, 0xc59c, + 0x0dfb, 0x0000, 0x0000, 0x0000, 0x06b4, 0xcdc9, 0x0ddd, 0x0000, 0x0000, 0x0000, + 0xae70, 0xa979, 0x0dbe, 0x0000, 0x0000, 0x0000, 0x317c, 0xa8fb, 0x0d9e, 0x0000, + 0x0000, 0x0000, 0x5fe0, 0x8a50, 0x0d7d, 0x0000, 0x0000, 0x0000, 0x70b6, 0xfdfa, + 0x0d61, 0x0000, 0x0000, 0x0000, 0x1640, 0x9dc7, 0x0d41, 0x0000, 0x0000, 0x0000, + 0x9a9c, 0xdc50, 0x0d23, 0x0000, 0x0000, 0x0000, 0x4fcc, 0x9a9b, 0x0d04, 0x0000, + 0x0000, 0x0000, 0x7e48, 0x8f77, 0x0ce5, 0x0000, 0x0000, 0x0000, 0x84e4, 0xd4b9, + 0x0cc6, 0x0000, 0x0000, 0x0000, 0x84e0, 0xbd10, 0x0ca6, 0x0000, 0x0000, 0x0000, + 0x1b0a, 0xc8d9, 0x0c88, 0x0000, 0x0000, 0x0000, 0x6a48, 0xfc81, 0x0c68, 0x0000, + 0x0000, 0x0000, 0x070a, 0xbef6, 0x0c4a, 0x0000, 0x0000, 0x0000, 0x8a70, 0xf096, + 0x0c2b, 0x0000, 0x0000, 0x0000, 0xecc2, 0xc994, 0x0c0c, 0x0000, 0x0000, 0x0000, + 0x1540, 0x9537, 0x0bea, 0x0000, 0x0000, 0x0000, 0x1b02, 0xab5b, 0x0bce, 0x0000, + 0x0000, 0x0000, 0x5dc0, 0xb0c8, 0x0bad, 0x0000, 0x0000, 0x0000, 0xc928, 0xe034, + 0x0b8f, 0x0000, 0x0000, 0x0000, 0x2d12, 0xb4b0, 0x0b71, 0x0000, 0x0000, 0x0000, + 0x8fc2, 0xbb94, 0x0b52, 0x0000, 0x0000, 0x0000, 0xe236, 0xe22f, 0x0b33, 0x0000, + 0x0000, 0x0000, 0xb97c, 0xbe9e, 0x0b13, 0x0000, 0x0000, 0x0000, 0xe1a6, 0xe16d, + 0x0af5, 0x0000, 0x0000, 0x0000, 0xd330, 0xbaf0, 0x0ad6, 0x0000, 0x0000, 0x0000, + 0xc0bc, 0xbbd0, 0x0ab7, 0x0000, 0x0000, 0x0000, 0x8e66, 0xdd9b, 0x0a98, 0x0000, + 0x0000, 0x0000, 0xc95c, 0xf799, 0x0a79, 0x0000, 0x0000, 0x0000, 0xdac0, 0xbe4c, + 0x0a55, 0x0000, 0x0000, 0x0000, 0xafc0, 0xc378, 0x0a37, 0x0000, 0x0000, 0x0000, + 0xa880, 0xe341, 0x0a19, 0x0000, 0x0000, 0x0000, 0xc242, 0x81f6, 0x09fd, 0x0000, + 0x0000, 0x0000, 0x7470, 0xc777, 0x09de, 0x0000, 0x0000, 0x0000, 0x62bc, 0xb684, + 0x09be, 0x0000, 0x0000, 0x0000, 0x43ac, 0x8c58, 0x099f, 0x0000, 0x0000, 0x0000, + 0xcc3c, 0xf9ac, 0x0981, 0x0000, 0x0000, 0x0000, 0x1526, 0xb670, 0x0962, 0x0000, + 0x0000, 0x0000, 0xc9fe, 0xdf50, 0x0943, 0x0000, 0x0000, 0x0000, 0x6ae6, 0xc065, + 0x0924, 0x0000, 0x0000, 0x0000, 0xb114, 0xcf29, 0x0905, 0x0000, 0x0000, 0x0000, + 0xd388, 0x922a, 0x08e4, 0x0000, 0x0000, 0x0000, 0xcf54, 0xb926, 0x08c7, 0x0000, + 0x0000, 0x0000, 0x3826, 0xe855, 0x08a8, 0x0000, 0x0000, 0x0000, 0xe7c8, 0x829b, + 0x0888, 0x0000, 0x0000, 0x0000, 0x546c, 0xa903, 0x086a, 0x0000, 0x0000, 0x0000, + 0x8768, 0x99cc, 0x0849, 0x0000, 0x0000, 0x0000, 0x00ac, 0xf529, 0x082b, 0x0000, + 0x0000, 0x0000, 0x2658, 0x9f0b, 0x080c, 0x0000, 0x0000, 0x0000, 0xfe5c, 0x9e21, + 0x07ee, 0x0000, 0x0000, 0x0000, 0x6da2, 0x9910, 0x07cf, 0x0000, 0x0000, 0x0000, + 0x9220, 0xf9b3, 0x07b0, 0x0000, 0x0000, 0x0000, 0x3d90, 0xa541, 0x0791, 0x0000, + 0x0000, 0x0000, 0x6e4c, 0xe7cc, 0x0771, 0x0000, 0x0000, 0x0000, 0xa8fa, 0xe80a, + 0x0753, 0x0000, 0x0000, 0x0000, 0x4e14, 0xc3a7, 0x0734, 0x0000, 0x0000, 0x0000, + 0xf7e0, 0xbad9, 0x0712, 0x0000, 0x0000, 0x0000, 0xfea0, 0xeff2, 0x06f5, 0x0000, + 0x0000, 0x0000, 0xcef6, 0xbd48, 0x06d7, 0x0000, 0x0000, 0x0000, 0x7544, 0xf559, + 0x06b7, 0x0000, 0x0000, 0x0000, 0x2388, 0xf655, 0x0698, 0x0000, 0x0000, 0x0000, + 0xe900, 0xad56, 0x0676, 0x0000, 0x0000, 0x0000, 0x2cc0, 0x8437, 0x0659, 0x0000, + 0x0000, 0x0000, 0x3068, 0xc544, 0x063b, 0x0000, 0x0000, 0x0000, 0xdc70, 0xe73c, + 0x061b, 0x0000, 0x0000, 0x0000, 0xee50, 0x9d49, 0x05fc, 0x0000, 0x0000, 0x0000, + 0x93d2, 0x81f6, 0x05df, 0x0000, 0x0000, 0x0000, 0x941c, 0xadff, 0x05bf, 0x0000, + 0x0000, 0x0000, 0x2ce2, 0x8e45, 0x05a1, 0x0000, 0x0000, 0x0000, 0x4a60, 0x95fd, + 0x0581, 0x0000, 0x0000, 0x0000, 0x79f8, 0xb83a, 0x0563, 0x0000, 0x0000, 0x0000, + 0xcb58, 0xa1f5, 0x0543, 0x0000, 0x0000, 0x0000, 0x2a3a, 0xdc36, 0x0525, 0x0000, + 0x0000, 0x0000, 0x14ee, 0x890e, 0x0506, 0x0000, 0x0000, 0x0000, 0x8f20, 0xc432, + 0x04e3, 0x0000, 0x0000, 0x0000, 0x8440, 0xb21d, 0x04c6, 0x0000, 0x0000, 0x0000, + 0x5430, 0xf698, 0x04a7, 0x0000, 0x0000, 0x0000, 0x04ae, 0x8b20, 0x048a, 0x0000, + 0x0000, 0x0000, 0x04d0, 0xe872, 0x046b, 0x0000, 0x0000, 0x0000, 0xc78e, 0x8893, + 0x044c, 0x0000, 0x0000, 0x0000, 0x0f78, 0x9895, 0x042b, 0x0000, 0x0000, 0x0000, + 0x11d4, 0xdf2e, 0x040d, 0x0000, 0x0000, 0x0000, 0xe84c, 0x89d5, 0x03ef, 0x0000, + 0x0000, 0x0000, 0xf7be, 0x8a67, 0x03d0, 0x0000, 0x0000, 0x0000, 0x95d0, 0xc906, + 0x03b1, 0x0000, 0x0000, 0x0000, 0x64ce, 0xd96c, 0x0392, 0x0000, 0x0000, 0x0000, + 0x97ba, 0xa16f, 0x0373, 0x0000, 0x0000, 0x0000, 0x463c, 0xc51a, 0x0354, 0x0000, + 0x0000, 0x0000, 0xef0a, 0xe93e, 0x0335, 0x0000, 0x0000, 0x0000, 0x526a, 0xa466, + 0x0316, 0x0000, 0x0000, 0x0000, 0x4140, 0xa94d, 0x02f5, 0x0000, 0x0000, 0x0000, + 0xb4ec, 0xce68, 0x02d8, 0x0000, 0x0000, 0x0000, 0x4fa2, 0x8490, 0x02b9, 0x0000, + 0x0000, 0x0000, 0x4e60, 0xca98, 0x0298, 0x0000, 0x0000, 0x0000, 0x08dc, 0xe09c, + 0x027a, 0x0000, 0x0000, 0x0000, 0x2b90, 0xc7e3, 0x025c, 0x0000, 0x0000, 0x0000, + 0x5a7c, 0xf8ef, 0x023c, 0x0000, 0x0000, 0x0000, 0x5022, 0x9d58, 0x021e, 0x0000, + 0x0000, 0x0000, 0x553a, 0xe242, 0x01ff, 0x0000, 0x0000, 0x0000, 0x7e6e, 0xb54d, + 0x01e0, 0x0000, 0x0000, 0x0000, 0xd2d4, 0xa88c, 0x01c1, 0x0000, 0x0000, 0x0000, + 0x75b6, 0xfe6d, 0x01a2, 0x0000, 0x0000, 0x0000, 0x3bb2, 0xf04c, 0x0183, 0x0000, + 0x0000, 0x0000, 0xc2d0, 0xc046, 0x0163, 0x0000, 0x0000, 0x0000, 0x250c, 0xf9d6, + 0x0145, 0x0000, 0x0000, 0x0000, 0xb7b4, 0x8a0d, 0x0126, 0x0000, 0x0000, 0x0000, + 0x1a72, 0xe4f5, 0x0107, 0x0000, 0x0000, 0x0000, 0x825c, 0xa9b8, 0x00e8, 0x0000, + 0x0000, 0x0000, 0x6c90, 0xc9ad, 0x00c6, 0x0000, 0x0000, 0x0000, 0x4d00, 0xd1bb, + 0x00aa, 0x0000, 0x0000, 0x0000, 0xa4a0, 0xee01, 0x0087, 0x0000, 0x0000, 0x0000, + 0x89a8, 0xbe9f, 0x006b, 0x0000, 0x0000, 0x0000, 0x038e, 0xc80c, 0x004d, 0x0000, + 0x0000, 0x0000, 0xfe26, 0x8384, 0x002e, 0x0000, 0x0000, 0x0000, 0xcd90, 0xca57, + 0x000e, 0x0000 +}; + +void MacroAssembler::libm_reduce_pi04l(Register eax, Register ecx, Register edx, Register ebx, Register esi, Register edi, Register ebp, Register esp) { + Label B1_1, B1_2, B1_3, B1_4, B1_5, B1_6, B1_7, B1_8, B1_9, B1_10, B1_11, B1_12; + Label B1_13, B1_14, B1_15; + + assert_different_registers(ebx, eax, ecx, edx, esi, edi, ebp, esp); + + address zero_none = (address)_zero_none; + address _4onpi_d = (address)__4onpi_d; + address TWO_32H = (address)_TWO_32H; + address pi04_3d = (address)_pi04_3d; + address pi04_5d = (address)_pi04_5d; + address SCALE = (address)_SCALE; + address zeros = (address)_zeros; + address pi04_2d = (address)_pi04_2d; + address TWO_12H = (address)_TWO_12H; + address _4onpi_31l = (address)__4onpi_31l; + + bind(B1_1); + push(ebp); + movl(ebp, esp); + andl(esp, -16); + push(esi); + push(edi); + push(ebx); + subl(esp, 20); + movzwl(ebx, Address(ebp, 16)); + andl(ebx, 32767); + movl(eax, Address(ebp, 20)); + cmpl(ebx, 16413); + movl(esi, Address(ebp, 24)); + movl(Address(esp, 4), eax); + jcc(Assembler::greaterEqual, B1_8); + + bind(B1_2); + fld_x(Address(ebp, 8)); + fld_d(ExternalAddress(_4onpi_d)); //0x6dc9c883UL, 0x3ff45f30UL + fmul(1); + fstp_x(Address(esp, 8)); + movzwl(ecx, Address(esp, 16)); + negl(ecx); + addl(ecx, 30); + movl(eax, Address(esp, 12)); + shrl(eax); + cmpl(Address(esp, 4), 0); + jcc(Assembler::notEqual, B1_4); + + bind(B1_3); + lea(ecx, Address(eax, 1)); + andl(ecx, -2); + jmp(B1_5); + + bind(B1_4); + movl(ecx, eax); + addl(eax, Address(esp, 4)); + movl(edx, eax); + andl(edx, 1); + addl(ecx, edx); + + bind(B1_5); + fld_d(ExternalAddress(TWO_32H)); //0x00000000UL, 0x41f80000UL + cmpl(ebx, 16400); + movl(Address(esp, 0), ecx); + fild_s(Address(esp, 0)); + jcc(Assembler::greaterEqual, B1_7); + + bind(B1_6); + fld_d(ExternalAddress(pi04_3d)); //0x54442d00UL, 0x3fe921fbUL + fmul(1); + fsubp(3); + fxch(1); + fmul(2); + fld_s(2); + fadd(1); + fsubrp(1); + fld_s(0); + fxch(1); + fsuba(3); + fld_d(ExternalAddress(8 + pi04_3d)); //0x98cc5180UL, 0x3ce84698UL + fmul(3); + fsuba(2); + fxch(1); + fsub(2); + fsubrp(1); + faddp(3); + fld_d(ExternalAddress(16 + pi04_3d)); //0xcbb5bf6cUL, 0xb9dfc8f8UL + fmulp(2); + fld_s(1); + fsubr(1); + fsuba(1); + fxch(2); + fsubp(1); + faddp(2); + fxch(1); + jmp(B1_15); + + bind(B1_7); + fld_d(ExternalAddress(pi04_5d)); //0x54400000UL, 0x3fe921fbUL + fmul(1); + fsubp(3); + fxch(1); + fmul(2); + fld_s(2); + fadd(1); + fsubrp(1); + fld_s(0); + fxch(1); + fsuba(3); + fld_d(ExternalAddress(8 + pi04_5d)); //0x1a600000UL, 0x3dc0b461UL + fmul(3); + fsuba(2); + fxch(1); + fsub(2); + fsubrp(1); + faddp(3); + fld_d(ExternalAddress(16 + pi04_5d)); //0x2e000000UL, 0x3b93198aUL + fmul(2); + fld_s(0); + fsubr(2); + fsuba(2); + fxch(1); + fsubp(2); + fxch(1); + faddp(3); + fld_d(ExternalAddress(24 + pi04_5d)); //0x25200000UL, 0x396b839aUL + fmul(2); + fld_s(0); + fsubr(2); + fsuba(2); + fxch(1); + fsubp(2); + fxch(1); + faddp(3); + fld_d(ExternalAddress(32 + pi04_5d)); //0x533e63a0UL, 0x37027044UL + fmulp(2); + fld_s(1); + fsubr(1); + fsuba(1); + fxch(2); + fsubp(1); + faddp(2); + fxch(1); + jmp(B1_15); + + bind(B1_8); + fld_x(Address(ebp, 8)); + addl(ebx, -16417); + fmul_d(as_Address(ExternalAddress(SCALE))); //0x00000000UL, 0x32600000UL + movl(eax, -2078209981); + imull(ebx); + addl(edx, ebx); + movl(ecx, ebx); + sarl(edx, 4); + sarl(ecx, 31); + subl(edx, ecx); + movl(eax, edx); + shll(eax, 5); + fstp_x(Address(ebp, 8)); + fld_x(Address(ebp, 8)); + subl(eax, edx); + movl(Address(ebp, 8), 0); + subl(ebx, eax); + fld_x(Address(ebp, 8)); + cmpl(ebx, 17); + fsuba(1); + jcc(Assembler::less, B1_10); + + bind(B1_9); + lea(eax, Address(noreg, edx, Address::times_8)); + lea(ecx, Address(eax, edx, Address::times_4)); + incl(edx); + fld_x(Address(_4onpi_31l, RelocationHolder::none).plus_disp(ecx, Address::times_1)); + fmul(2); + fld_x(Address(12 + _4onpi_31l, RelocationHolder::none).plus_disp(ecx, Address::times_1)); + fmul(2); + fld_s(0); + fadd(2); + fsuba(2); + fxch(1); + faddp(2); + fld_s(1); + fadd(1); + fstp_x(Address(esp, 8)); + andl(Address(esp, 8), -16777216); + fld_x(Address(esp, 8)); + fsubp(1); + jmp(B1_11); + + bind(B1_10); + fld_d(ExternalAddress(zeros)); //0x00000000UL, 0x00000000UL + fld_s(0); + + bind(B1_11); + fld_s(0); + lea(eax, Address(noreg, edx, Address::times_8)); + fld_s(3); + lea(edx, Address(eax, edx, Address::times_4)); + fld_x(Address(_4onpi_31l, RelocationHolder::none).plus_disp(edx, Address::times_1)); + fmul(6); + movl(Address(esp, 0), edx); + fadda(2); + fxch(2); + fsuba(3); + fxch(2); + faddp(3); + fxch(2); + faddp(3); + fld_x(Address(12 + _4onpi_31l, RelocationHolder::none).plus_disp(edx, Address::times_1)); + fmula(2); + fld_s(2); + fadd(2); + fld_s(0); + fxch(1); + fsubra(3); + fxch(3); + fchs(); + faddp(4); + fxch(3); + faddp(4); + fxch(2); + fadd(3); + fxch(2); + fmul(5); + fadda(2); + fld_s(4); + fld_x(Address(24 + _4onpi_31l, RelocationHolder::none).plus_disp(edx, Address::times_1)); + fmula(1); + fxch(1); + fadda(4); + fxch(4); + fstp_x(Address(esp, 8)); + movzwl(ebx, Address(esp, 16)); + andl(ebx, 32767); + cmpl(ebx, 16415); + jcc(Assembler::greaterEqual, B1_13); + + bind(B1_12); + negl(ebx); + addl(ebx, 30); + movl(ecx, ebx); + movl(eax, Address(esp, 12)); + shrl(eax); + shll(eax); + movl(Address(esp, 12), eax); + movl(Address(esp, 8), 0); + shrl(eax); + jmp(B1_14); + + bind(B1_13); + negl(ebx); + addl(ebx, 30); + movl(ecx, ebx); + movl(edx, Address(esp, 8)); + shrl(edx); + shll(edx); + negl(ecx); + movl(eax, Address(esp, 12)); + shll(eax); + movl(ecx, ebx); + movl(Address(esp, 8), edx); + shrl(edx); + orl(eax, edx); + + bind(B1_14); + fld_x(Address(esp, 8)); + addl(eax, Address(esp, 4)); + fsubp(3); + fmul(6); + fld_s(4); + movl(edx, eax); + andl(edx, 1); + fadd(3); + movl(ecx, Address(esp, 0)); + fsuba(3); + fxch(3); + faddp(5); + fld_s(1); + fxch(3); + fadd_d(Address(zero_none, RelocationHolder::none).plus_disp(edx, Address::times_8)); + fadda(3); + fsub(3); + faddp(2); + fxch(1); + faddp(4); + fld_s(2); + fadd(2); + fsuba(2); + fxch(3); + faddp(2); + fxch(1); + faddp(3); + fld_s(0); + fadd(2); + fsuba(2); + fxch(1); + faddp(2); + fxch(1); + faddp(2); + fld_s(2); + fld_x(Address(36 + _4onpi_31l, RelocationHolder::none).plus_disp(ecx, Address::times_1)); + fmula(1); + fld_s(1); + fadd(3); + fsuba(3); + fxch(2); + faddp(3); + fxch(2); + faddp(3); + fxch(1); + fmul(4); + fld_s(0); + fadd(2); + fsuba(2); + fxch(1); + faddp(2); + fxch(1); + faddp(2); + fld_s(2); + fld_x(Address(48 + _4onpi_31l, RelocationHolder::none).plus_disp(ecx, Address::times_1)); + fmula(1); + fld_s(1); + fadd(3); + fsuba(3); + fxch(2); + faddp(3); + fxch(2); + faddp(3); + fld_s(3); + fxch(2); + fmul(5); + fld_x(Address(60 + _4onpi_31l, RelocationHolder::none).plus_disp(ecx, Address::times_1)); + fmula(3); + fxch(3); + faddp(1); + fld_s(0); + fadd(2); + fsuba(2); + fxch(1); + faddp(2); + fxch(1); + faddp(3); + fld_s(3); + fxch(2); + fmul(5); + fld_x(Address(72 + _4onpi_31l, RelocationHolder::none).plus_disp(ecx, Address::times_1)); + fmula(3); + fxch(3); + faddp(1); + fld_s(0); + fadd(2); + fsuba(2); + fxch(1); + faddp(2); + fxch(1); + faddp(3); + fxch(1); + fmulp(4); + fld_x(Address(84 + _4onpi_31l, RelocationHolder::none).plus_disp(ecx, Address::times_1)); + fmulp(3); + fxch(2); + faddp(3); + fld_s(2); + fadd(2); + fld_d(ExternalAddress(TWO_32H)); //0x00000000UL, 0x41f80000UL + fmul(1); + fadda(1); + fsubp(1); + fsuba(2); + fxch(3); + faddp(2); + faddp(1); + fld_d(ExternalAddress(pi04_2d)); //0x54400000UL, 0x3fe921fbUL + fld_s(0); + fmul(2); + fxch(2); + fadd(3); + fxch(1); + fmulp(3); + fmul_d(as_Address(ExternalAddress(8 + pi04_2d))); //0x1a626331UL, 0x3dc0b461UL + faddp(1); + + bind(B1_15); + fld_d(ExternalAddress(TWO_12H)); //0x00000000UL, 0x40b80000UL + fld_s(2); + fadd(2); + fmula(1); + fstp_x(Address(esp, 8)); + fld_x(Address(esp, 8)); + fadd(1); + fsubrp(1); + fst_d(Address(esi, 0)); + fsubp(2); + faddp(1); + fstp_d(Address(esi, 8)); + addl(esp, 20); + pop(ebx); + pop(edi); + pop(esi); + movl(esp, ebp); + pop(ebp); + ret(0); +} + +ALIGNED_(16) juint _L_2il0floatpacket_0[] = +{ + 0xffffffffUL, 0x7fffffffUL, 0x00000000UL, 0x00000000UL +}; + +ALIGNED_(16) juint _Pi4Inv[] = +{ + 0x6dc9c883UL, 0x3ff45f30UL +}; + +ALIGNED_(16) juint _Pi4x3[] = +{ + 0x54443000UL, 0xbfe921fbUL, 0x3b39a000UL, 0x3d373dcbUL, 0xe0e68948UL, + 0xba845c06UL +}; + +ALIGNED_(16) juint _Pi4x4[] = +{ + 0x54400000UL, 0xbfe921fbUL, 0x1a600000UL, 0xbdc0b461UL, 0x2e000000UL, + 0xbb93198aUL, 0x252049c1UL, 0xb96b839aUL +}; + +ALIGNED_(16) jushort _SP[] = +{ + 0xaaab, 0xaaaa, 0xaaaa, 0xaaaa, 0xbffc, 0x0000, 0x8887, 0x8888, 0x8888, 0x8888, + 0x3ff8, 0x0000, 0xc527, 0x0d00, 0x00d0, 0xd00d, 0xbff2, 0x0000, 0x45f6, 0xb616, + 0x1d2a, 0xb8ef, 0x3fec, 0x0000, 0x825b, 0x3997, 0x2b3f, 0xd732, 0xbfe5, 0x0000, + 0xbf33, 0x8bb4, 0x2fda, 0xb092, 0x3fde, 0x0000, 0x44a6, 0xed1a, 0x29ef, 0xd73e, + 0xbfd6, 0x0000, 0x8610, 0x307f, 0x62a1, 0xc921, 0x3fce, 0x0000 +}; + +ALIGNED_(16) jushort _CP[] = +{ + 0x0000, 0x0000, 0x0000, 0x8000, 0xbffe, 0x0000, 0xaaa5, 0xaaaa, 0xaaaa, 0xaaaa, + 0x3ffa, 0x0000, 0x9c2f, 0x0b60, 0x60b6, 0xb60b, 0xbff5, 0x0000, 0xf024, 0x0cac, + 0x00d0, 0xd00d, 0x3fef, 0x0000, 0x03fe, 0x3f65, 0x7dbb, 0x93f2, 0xbfe9, 0x0000, + 0xd84d, 0xadee, 0xc698, 0x8f76, 0x3fe2, 0x0000, 0xdaba, 0xfe79, 0xea36, 0xc9c9, + 0xbfda, 0x0000, 0x3ac6, 0x0ba0, 0x07ce, 0xd585, 0x3fd2, 0x0000 +}; + +ALIGNED_(16) juint _ones[] = +{ + 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0xbff00000UL +}; + +void MacroAssembler::libm_sincos_huge(XMMRegister xmm0, XMMRegister xmm1, Register eax, Register ecx, Register edx, Register ebx, Register esi, Register edi, Register ebp, Register esp) { + Label B1_1, B1_2, B1_3, B1_4, B1_5, B1_6, B1_7, B1_8, B1_9, B1_10, B1_11, B1_12; + Label B1_13, B1_14, B1_15, B1_16, B1_17, B1_18, B1_19, B1_20, B1_21, B1_22, B1_23; + Label B1_24, B1_25, B1_26, B1_27, B1_28, B1_29, B1_30, B1_31, B1_32, B1_33, B1_34; + Label B1_35, B1_36, B1_37, B1_38, B1_39, B1_40, B1_41, B1_42, B1_43, B1_44, B1_45, B1_46; + + assert_different_registers(ebx, eax, ecx, edx, esi, edi, ebp, esp); + + address L_2il0floatpacket_0 = (address)_L_2il0floatpacket_0; + address Pi4Inv = (address)_Pi4Inv; + address Pi4x3 = (address)_Pi4x3; + address Pi4x4 = (address)_Pi4x4; + address ones = (address)_ones; + address CP = (address)_CP; + address SP = (address)_SP; + + bind(B1_1); + push(ebp); + movl(ebp, esp); + andl(esp, -64); + push(esi); + push(edi); + push(ebx); + subl(esp, 52); + movl(eax, Address(ebp, 16)); + movl(edx, Address(ebp, 20)); + movl(Address(esp, 32), eax); + movl(Address(esp, 36), edx); + + bind(B1_2); + fnstcw(Address(esp, 30)); + + bind(B1_3); + movsd(xmm1, Address(ebp, 8)); + movl(esi, Address(ebp, 12)); + movl(eax, esi); + andl(eax, 2147483647); + andps(xmm1, ExternalAddress(L_2il0floatpacket_0)); //0xffffffffUL, 0x7fffffffUL, 0x00000000UL, 0x00000000UL + shrl(esi, 31); + movl(Address(esp, 40), eax); + cmpl(eax, 1104150528); + movsd(Address(ebp, 8), xmm1); + jcc(Assembler::aboveEqual, B1_11); + + bind(B1_4); + movsd(xmm0, ExternalAddress(Pi4Inv)); //0x6dc9c883UL, 0x3ff45f30UL + mulsd(xmm0, xmm1); + movzwl(edx, Address(esp, 30)); + movl(eax, edx); + andl(eax, 768); + movsd(Address(esp, 0), xmm0); + cmpl(eax, 768); + jcc(Assembler::equal, B1_42); + + bind(B1_5); + orl(edx, -64768); + movw(Address(esp, 28), edx); + + bind(B1_6); + fldcw(Address(esp, 28)); + + bind(B1_7); + movsd(xmm1, Address(ebp, 8)); + movl(ebx, 1); + + bind(B1_8); + movl(Address(esp, 12), ebx); + movl(ebx, Address(esp, 4)); + movl(eax, ebx); + movl(Address(esp, 8), esi); + movl(esi, ebx); + shrl(esi, 20); + andl(eax, 1048575); + movl(ecx, esi); + orl(eax, 1048576); + negl(ecx); + movl(edx, eax); + addl(ecx, 19); + addl(esi, 13); + movl(Address(esp, 24), ecx); + shrl(edx); + movl(ecx, esi); + shll(eax); + movl(ecx, Address(esp, 24)); + movl(esi, Address(esp, 0)); + shrl(esi); + orl(eax, esi); + cmpl(ebx, 1094713344); + movsd(Address(esp, 16), xmm1); + fld_d(Address(esp, 16)); + cmov32(Assembler::below, eax, edx); + movl(esi, Address(esp, 8)); + lea(edx, Address(eax, 1)); + movl(ebx, edx); + andl(ebx, -2); + movl(Address(esp, 16), ebx); + fild_s(Address(esp, 16)); + movl(ebx, Address(esp, 12)); + cmpl(Address(esp, 40), 1094713344); + jcc(Assembler::aboveEqual, B1_10); + + bind(B1_9); + fld_d(ExternalAddress(Pi4x3)); //0x54443000UL, 0xbfe921fbUL + fmul(1); + faddp(2); + fld_d(ExternalAddress(8 + Pi4x3)); //0x3b39a000UL, 0x3d373dcbUL + fmul(1); + faddp(2); + fld_d(ExternalAddress(16 + Pi4x3)); //0xe0e68948UL, 0xba845c06UL + fmulp(1); + faddp(1); + jmp(B1_17); + + bind(B1_10); + fld_d(ExternalAddress(Pi4x4)); //0x54400000UL, 0xbfe921fbUL + fmul(1); + faddp(2); + fld_d(ExternalAddress(8 + Pi4x4)); //0x1a600000UL, 0xbdc0b461UL + fmul(1); + faddp(2); + fld_d(ExternalAddress(16 + Pi4x4)); //0x2e000000UL, 0xbb93198aUL + fmul(1); + faddp(2); + fld_d(ExternalAddress(24 + Pi4x4)); //0x252049c1UL, 0xb96b839aUL + fmulp(1); + faddp(1); + jmp(B1_17); + + bind(B1_11); + movzwl(edx, Address(esp, 30)); + movl(eax, edx); + andl(eax, 768); + cmpl(eax, 768); + jcc(Assembler::equal, B1_43); + bind(B1_12); + orl(edx, -64768); + movw(Address(esp, 28), edx); + + bind(B1_13); + fldcw(Address(esp, 28)); + + bind(B1_14); + movsd(xmm1, Address(ebp, 8)); + movl(ebx, 1); + + bind(B1_15); + movsd(Address(esp, 16), xmm1); + fld_d(Address(esp, 16)); + addl(esp, -32); + lea(eax, Address(esp, 32)); + fstp_x(Address(esp, 0)); + movl(Address(esp, 12), 0); + movl(Address(esp, 16), eax); + call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlibm_reduce_pi04l()))); + + bind(B1_46); + addl(esp, 32); + + bind(B1_16); + fld_d(Address(esp, 0)); + lea(edx, Address(eax, 1)); + fld_d(Address(esp, 8)); + faddp(1); + + bind(B1_17); + movl(ecx, edx); + addl(eax, 3); + shrl(ecx, 2); + andl(ecx, 1); + shrl(eax, 2); + xorl(esi, ecx); + movl(ecx, Address(esp, 36)); + andl(eax, 1); + andl(ecx, 3); + cmpl(ecx, 3); + jcc(Assembler::notEqual, B1_25); + + bind(B1_18); + fld_x(ExternalAddress(84 + SP)); //0x8610, 0x307f, 0x62 + fld_s(1); + fmul((2)); + testb(edx, 2); + fmula((1)); + fld_x(ExternalAddress(72 + SP)); //0x44a6, 0xed1a, 0x29 + faddp(2); + fmula(1); + fld_x(ExternalAddress(60 + SP)); //0xbf33, 0x8bb4, 0x2f + faddp(2); + fmula(1); + fld_x(ExternalAddress(48 + SP)); //0x825b, 0x3997, 0x2b + faddp(2); + fmula(1); + fld_x(ExternalAddress(36 + SP)); //0x45f6, 0xb616, 0x1d + faddp(2); + fmula(1); + fld_x(ExternalAddress(24 + SP)); //0xc527, 0x0d00, 0x00 + faddp(2); + fmula(1); + fld_x(ExternalAddress(12 + SP)); //0x8887, 0x8888, 0x88 + faddp(2); + fmula(1); + fld_x(ExternalAddress(SP)); //0xaaab, 0xaaaa, 0xaa + faddp(2); + fmula(1); + fld_x(ExternalAddress(84 + CP)); //0x3ac6, 0x0ba0, 0x07 + fmul(1); + fld_x(ExternalAddress(72 + CP)); //0xdaba, 0xfe79, 0xea + faddp(1); + fmul(1); + fld_x(ExternalAddress(62 + CP)); //0xd84d, 0xadee, 0xc6 + faddp(1); + fmul(1); + fld_x(ExternalAddress(48 + CP)); //0x03fe, 0x3f65, 0x7d + faddp(1); + fmul(1); + fld_x(ExternalAddress(36 + CP)); //0xf024, 0x0cac, 0x00 + faddp(1); + fmul(1); + fld_x(ExternalAddress(24 + CP)); //0x9c2f, 0x0b60, 0x60 + faddp(1); + fmul(1); + fld_x(ExternalAddress(12 + CP)); //0xaaa5, 0xaaaa, 0xaa + faddp(1); + fmul(1); + fld_x(ExternalAddress(CP)); //0x0000, 0x0000, 0x00 + faddp(1); + fmulp(1); + fld_d(Address(ones, RelocationHolder::none).plus_disp(esi, Address::times_8)); + fld_d(Address(ones, RelocationHolder::none).plus_disp(eax, Address::times_8)); + jcc(Assembler::equal, B1_22); + + bind(B1_19); + fmulp(4); + testl(ebx, ebx); + fxch(2); + fmul(3); + movl(eax, Address(esp, 2)); + faddp(3); + fxch(2); + fstp_d(Address(eax, 0)); + fmula(1); + faddp(1); + fstp_d(Address(eax, 8)); + jcc(Assembler::equal, B1_21); + + bind(B1_20); + fldcw(Address(esp, 30)); + + bind(B1_21); + addl(esp, 52); + pop(ebx); + pop(edi); + pop(esi); + movl(esp, ebp); + pop(ebp); + ret(0); + + bind(B1_22); + fxch(1); + fmulp(4); + testl(ebx, ebx); + fxch(2); + fmul(3); + movl(eax, Address(esp, 32)); + faddp(3); + fxch(2); + fstp_d(Address(eax, 8)); + fmula(1); + faddp(1); + fstp_d(Address(eax, 0)); + jcc(Assembler::equal, B1_24); + + bind(B1_23); + fldcw(Address(esp, 30)); + + bind(B1_24); + addl(esp, 52); + pop(ebx); + pop(edi); + pop(esi); + movl(esp, ebp); + pop(ebp); + ret(0); + + bind(B1_25); + testb(Address(esp, 36), 2); + jcc(Assembler::equal, B1_33); + + bind(B1_26); + fld_s(0); + testb(edx, 2); + fmul(1); + fld_s(0); + fmul(1); + jcc(Assembler::equal, B1_30); + + bind(B1_27); + fstp_d(2); + fld_x(ExternalAddress(84 + CP)); //0x3ac6, 0x0ba0, 0x07 + testl(ebx, ebx); + fmul(2); + fld_x(ExternalAddress(72 + CP)); //0xdaba, 0xfe79, 0xea + fmul(3); + fld_x(ExternalAddress(60 + CP)); //0xd84d, 0xadee, 0xc6 + movl(eax, Address(rsp, 32)); + faddp(2); + fxch(1); + fmul(3); + fld_x(ExternalAddress(48 + CP)); //0x03fe, 0x3f65, 0x7d + faddp(2); + fxch(1); + fmul(3); + fld_x(ExternalAddress(36 + CP)); //0xf024, 0x0cac, 0x00 + faddp(2); + fxch(1); + fmul(3); + fld_x(ExternalAddress(24 + CP)); //0x9c2f, 0x0b60, 0x60 + faddp(2); + fxch(1); + fmul(3); + fld_x(ExternalAddress(12 + CP)); //0xaaa5, 0xaaaa, 0xaa + faddp(2); + fxch(1); + fmulp(3); + fld_x(ExternalAddress(CP)); //0x0000, 0x0000, 0x00 + faddp(1); + fmulp(1); + faddp(1); + fld_d(Address(ones, RelocationHolder::none).plus_disp(rsi, Address::times_8)); + fmula(1); + faddp(1); + fstp_d(Address(eax, 8)); + jcc(Assembler::equal, B1_29); + + bind(B1_28); + fldcw(Address(esp, 30)); + + bind(B1_29); + addl(esp, 52); + pop(ebx); + pop(edi); + pop(esi); + movl(esp, ebp); + pop(ebp); + ret(0); + + bind(B1_30); + fld_x(ExternalAddress(84 + SP)); //0x8610, 0x307f, 0x62 + testl(ebx, ebx); + fmul(1); + fld_x(ExternalAddress(72 + SP)); //0x44a6, 0xed1a, 0x29 + fmul(2); + fld_x(ExternalAddress(60 + SP)); //0xbf33, 0x8bb4, 0x2f + movl(eax, Address(rsp, 32)); + faddp(2); + fxch(1); + fmul(2); + fld_x(ExternalAddress(48 + SP)); //0x825b, 0x3997, 0x2b + faddp(2); + fxch(1); + fmul(2); + fld_x(ExternalAddress(36 + SP)); //0x45f6, 0xb616, 0x1d + faddp(2); + fxch(1); + fmul(2); + fld_x(ExternalAddress(24 + SP)); //0xc527, 0x0d00, 0x00 + faddp(2); + fxch(1); + fmul(2); + fld_x(ExternalAddress(12 + SP)); //0x8887, 0x8888, 0x88 + faddp(2); + fxch(1); + fmulp(2); + fld_x(ExternalAddress(SP)); //0xaaab, 0xaaaa, 0xaa + faddp(1); + fmulp(2); + faddp(1); + fld_d(Address(ones, RelocationHolder::none).plus_disp(rsi, Address::times_8)); + fmulp(2); + fmul(1); + faddp(1); + fstp_d(Address(eax, 8)); + jcc(Assembler::equal, B1_32); + + bind(B1_31); + fldcw(Address(esp, 30)); + + bind(B1_32); + addl(esp, 52); + pop(ebx); + pop(edi); + pop(esi); + movl(esp, ebp); + pop(ebp); + ret(0); + + bind(B1_33); + testb(Address(esp, 36), 1); + jcc(Assembler::equal, B1_41); + + bind(B1_34); + fld_s(0); + testb(edx, 2); + fmul(1); + fld_s(0); + fmul(1); + jcc(Assembler::equal, B1_38); + + bind(B1_35); + fld_x(ExternalAddress(84 + SP)); //0x8610, 0x307f, 0x62 + testl(ebx, ebx); + fmul(1); + fld_x(ExternalAddress(72 + SP)); //0x44a6, 0xed1a, 0x29 + fmul(2); + fld_x(ExternalAddress(60 + SP)); //0xbf33, 0x8bb4, 0x2f + faddp(2); + fxch(1); + fmul(2); + fld_x(ExternalAddress(48 + SP)); //0x825b, 0x3997, 0x2b + faddp(2); + fxch(1); + fmul(2); + fld_x(ExternalAddress(36 + SP)); //0x45f6, 0xb616, 0x1d + faddp(2); + fxch(1); + fmul(2); + fld_x(ExternalAddress(24 + SP)); //0xc527, 0x0d00, 0x00 + faddp(2); + fxch(1); + fmul(2); + fld_x(ExternalAddress(12 + SP)); //0x8887, 0x8888, 0x88 + faddp(2); + fxch(1); + fmulp(2); + fld_x(ExternalAddress(SP)); //0xaaab, 0xaaaa, 0xaa + faddp(1); + fmulp(2); + faddp(1); + fld_d(Address(ones, RelocationHolder::none).plus_disp(eax, Address::times_8)); + fmulp(2); + fmul(1); + movl(eax, Address(esp, 32)); + faddp(1); + fstp_d(Address(eax, 0)); + jcc(Assembler::equal, B1_37); + + bind(B1_36); + fldcw(Address(esp, 30)); + + bind(B1_37); + addl(esp, 52); + pop(ebx); + pop(edi); + pop(esi); + movl(esp, ebp); + pop(ebp); + ret(0); + + bind(B1_38); + fstp_d(2); + fld_x(ExternalAddress(84 + CP)); //0x3ac6, 0x0ba0, 0x07 + testl(ebx, ebx); + fmul(2); + fld_x(ExternalAddress(72 + CP)); //0xdaba, 0xfe79, 0xea + fmul(3); + fld_x(ExternalAddress(60 + CP)); //0xd84d, 0xadee, 0xc6 + faddp(2); + fxch(1); + fmul(3); + fld_x(ExternalAddress(48 + CP)); //0x03fe, 0x3f65, 0x7d + faddp(2); + fxch(1); + fmul(3); + fld_x(ExternalAddress(36 + CP)); //0xf024, 0x0cac, 0x00 + faddp(2); + fxch(1); + fmul(3); + fld_x(ExternalAddress(24 + CP)); //0x9c2f, 0x0b60, 0x60 + faddp(2); + fxch(1); + fmul(3); + fld_x(ExternalAddress(12 + CP)); //0xaaa5, 0xaaaa, 0xaa + faddp(2); + fxch(1); + fmulp(3); + fld_x(ExternalAddress(CP)); //0x0000, 0x0000, 0x00 + faddp(1); + fmulp(1); + faddp(1); + fld_d(Address(ones, RelocationHolder::none).plus_disp(eax, Address::times_8)); + fmula(1); + movl(eax, Address(esp, 32)); + faddp(1); + fstp_d(Address(eax, 0)); + jcc(Assembler::equal, B1_40); + + bind(B1_39); + fldcw(Address(esp, 30)); + bind(B1_40); + addl(esp, 52); + pop(ebx); + pop(edi); + pop(esi); + movl(esp, ebp); + pop(ebp); + ret(0); + bind(B1_41); + fstp_d(0); + addl(esp, 52); + pop(ebx); + pop(edi); + pop(esi); + movl(esp, ebp); + pop(ebp); + ret(0); + bind(B1_42); + xorl(ebx, ebx); + jmp(B1_8); + bind(B1_43); + xorl(ebx, ebx); + jmp(B1_15); +} + +ALIGNED_(16) juint _static_const_table_sin[] = +{ + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x3ff00000UL, 0x176d6d31UL, 0xbf73b92eUL, + 0xbc29b42cUL, 0x3fb917a6UL, 0xe0000000UL, 0xbc3e2718UL, 0x00000000UL, + 0x3ff00000UL, 0x011469fbUL, 0xbf93ad06UL, 0x3c69a60bUL, 0x3fc8f8b8UL, + 0xc0000000UL, 0xbc626d19UL, 0x00000000UL, 0x3ff00000UL, 0x939d225aUL, + 0xbfa60beaUL, 0x2ed59f06UL, 0x3fd29406UL, 0xa0000000UL, 0xbc75d28dUL, + 0x00000000UL, 0x3ff00000UL, 0x866b95cfUL, 0xbfb37ca1UL, 0xa6aea963UL, + 0x3fd87de2UL, 0xe0000000UL, 0xbc672cedUL, 0x00000000UL, 0x3ff00000UL, + 0x73fa1279UL, 0xbfbe3a68UL, 0x3806f63bUL, 0x3fde2b5dUL, 0x20000000UL, + 0x3c5e0d89UL, 0x00000000UL, 0x3ff00000UL, 0x5bc57974UL, 0xbfc59267UL, + 0x39ae68c8UL, 0x3fe1c73bUL, 0x20000000UL, 0x3c8b25ddUL, 0x00000000UL, + 0x3ff00000UL, 0x53aba2fdUL, 0xbfcd0dfeUL, 0x25091dd6UL, 0x3fe44cf3UL, + 0x20000000UL, 0x3c68076aUL, 0x00000000UL, 0x3ff00000UL, 0x99fcef32UL, + 0x3fca8279UL, 0x667f3bcdUL, 0x3fe6a09eUL, 0x20000000UL, 0xbc8bdd34UL, + 0x00000000UL, 0x3fe00000UL, 0x94247758UL, 0x3fc133ccUL, 0x6b151741UL, + 0x3fe8bc80UL, 0x20000000UL, 0xbc82c5e1UL, 0x00000000UL, 0x3fe00000UL, + 0x9ae68c87UL, 0x3fac73b3UL, 0x290ea1a3UL, 0x3fea9b66UL, 0xe0000000UL, + 0x3c39f630UL, 0x00000000UL, 0x3fe00000UL, 0x7f909c4eUL, 0xbf9d4a2cUL, + 0xf180bdb1UL, 0x3fec38b2UL, 0x80000000UL, 0xbc76e0b1UL, 0x00000000UL, + 0x3fe00000UL, 0x65455a75UL, 0xbfbe0875UL, 0xcf328d46UL, 0x3fed906bUL, + 0x20000000UL, 0x3c7457e6UL, 0x00000000UL, 0x3fe00000UL, 0x76acf82dUL, + 0x3fa4a031UL, 0x56c62ddaUL, 0x3fee9f41UL, 0xe0000000UL, 0x3c8760b1UL, + 0x00000000UL, 0x3fd00000UL, 0x0e5967d5UL, 0xbfac1d1fUL, 0xcff75cb0UL, + 0x3fef6297UL, 0x20000000UL, 0x3c756217UL, 0x00000000UL, 0x3fd00000UL, + 0x0f592f50UL, 0xbf9ba165UL, 0xa3d12526UL, 0x3fefd88dUL, 0x40000000UL, + 0xbc887df6UL, 0x00000000UL, 0x3fc00000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x0f592f50UL, 0x3f9ba165UL, 0xa3d12526UL, 0x3fefd88dUL, + 0x40000000UL, 0xbc887df6UL, 0x00000000UL, 0xbfc00000UL, 0x0e5967d5UL, + 0x3fac1d1fUL, 0xcff75cb0UL, 0x3fef6297UL, 0x20000000UL, 0x3c756217UL, + 0x00000000UL, 0xbfd00000UL, 0x76acf82dUL, 0xbfa4a031UL, 0x56c62ddaUL, + 0x3fee9f41UL, 0xe0000000UL, 0x3c8760b1UL, 0x00000000UL, 0xbfd00000UL, + 0x65455a75UL, 0x3fbe0875UL, 0xcf328d46UL, 0x3fed906bUL, 0x20000000UL, + 0x3c7457e6UL, 0x00000000UL, 0xbfe00000UL, 0x7f909c4eUL, 0x3f9d4a2cUL, + 0xf180bdb1UL, 0x3fec38b2UL, 0x80000000UL, 0xbc76e0b1UL, 0x00000000UL, + 0xbfe00000UL, 0x9ae68c87UL, 0xbfac73b3UL, 0x290ea1a3UL, 0x3fea9b66UL, + 0xe0000000UL, 0x3c39f630UL, 0x00000000UL, 0xbfe00000UL, 0x94247758UL, + 0xbfc133ccUL, 0x6b151741UL, 0x3fe8bc80UL, 0x20000000UL, 0xbc82c5e1UL, + 0x00000000UL, 0xbfe00000UL, 0x99fcef32UL, 0xbfca8279UL, 0x667f3bcdUL, + 0x3fe6a09eUL, 0x20000000UL, 0xbc8bdd34UL, 0x00000000UL, 0xbfe00000UL, + 0x53aba2fdUL, 0x3fcd0dfeUL, 0x25091dd6UL, 0x3fe44cf3UL, 0x20000000UL, + 0x3c68076aUL, 0x00000000UL, 0xbff00000UL, 0x5bc57974UL, 0x3fc59267UL, + 0x39ae68c8UL, 0x3fe1c73bUL, 0x20000000UL, 0x3c8b25ddUL, 0x00000000UL, + 0xbff00000UL, 0x73fa1279UL, 0x3fbe3a68UL, 0x3806f63bUL, 0x3fde2b5dUL, + 0x20000000UL, 0x3c5e0d89UL, 0x00000000UL, 0xbff00000UL, 0x866b95cfUL, + 0x3fb37ca1UL, 0xa6aea963UL, 0x3fd87de2UL, 0xe0000000UL, 0xbc672cedUL, + 0x00000000UL, 0xbff00000UL, 0x939d225aUL, 0x3fa60beaUL, 0x2ed59f06UL, + 0x3fd29406UL, 0xa0000000UL, 0xbc75d28dUL, 0x00000000UL, 0xbff00000UL, + 0x011469fbUL, 0x3f93ad06UL, 0x3c69a60bUL, 0x3fc8f8b8UL, 0xc0000000UL, + 0xbc626d19UL, 0x00000000UL, 0xbff00000UL, 0x176d6d31UL, 0x3f73b92eUL, + 0xbc29b42cUL, 0x3fb917a6UL, 0xe0000000UL, 0xbc3e2718UL, 0x00000000UL, + 0xbff00000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0xbff00000UL, 0x176d6d31UL, + 0x3f73b92eUL, 0xbc29b42cUL, 0xbfb917a6UL, 0xe0000000UL, 0x3c3e2718UL, + 0x00000000UL, 0xbff00000UL, 0x011469fbUL, 0x3f93ad06UL, 0x3c69a60bUL, + 0xbfc8f8b8UL, 0xc0000000UL, 0x3c626d19UL, 0x00000000UL, 0xbff00000UL, + 0x939d225aUL, 0x3fa60beaUL, 0x2ed59f06UL, 0xbfd29406UL, 0xa0000000UL, + 0x3c75d28dUL, 0x00000000UL, 0xbff00000UL, 0x866b95cfUL, 0x3fb37ca1UL, + 0xa6aea963UL, 0xbfd87de2UL, 0xe0000000UL, 0x3c672cedUL, 0x00000000UL, + 0xbff00000UL, 0x73fa1279UL, 0x3fbe3a68UL, 0x3806f63bUL, 0xbfde2b5dUL, + 0x20000000UL, 0xbc5e0d89UL, 0x00000000UL, 0xbff00000UL, 0x5bc57974UL, + 0x3fc59267UL, 0x39ae68c8UL, 0xbfe1c73bUL, 0x20000000UL, 0xbc8b25ddUL, + 0x00000000UL, 0xbff00000UL, 0x53aba2fdUL, 0x3fcd0dfeUL, 0x25091dd6UL, + 0xbfe44cf3UL, 0x20000000UL, 0xbc68076aUL, 0x00000000UL, 0xbff00000UL, + 0x99fcef32UL, 0xbfca8279UL, 0x667f3bcdUL, 0xbfe6a09eUL, 0x20000000UL, + 0x3c8bdd34UL, 0x00000000UL, 0xbfe00000UL, 0x94247758UL, 0xbfc133ccUL, + 0x6b151741UL, 0xbfe8bc80UL, 0x20000000UL, 0x3c82c5e1UL, 0x00000000UL, + 0xbfe00000UL, 0x9ae68c87UL, 0xbfac73b3UL, 0x290ea1a3UL, 0xbfea9b66UL, + 0xe0000000UL, 0xbc39f630UL, 0x00000000UL, 0xbfe00000UL, 0x7f909c4eUL, + 0x3f9d4a2cUL, 0xf180bdb1UL, 0xbfec38b2UL, 0x80000000UL, 0x3c76e0b1UL, + 0x00000000UL, 0xbfe00000UL, 0x65455a75UL, 0x3fbe0875UL, 0xcf328d46UL, + 0xbfed906bUL, 0x20000000UL, 0xbc7457e6UL, 0x00000000UL, 0xbfe00000UL, + 0x76acf82dUL, 0xbfa4a031UL, 0x56c62ddaUL, 0xbfee9f41UL, 0xe0000000UL, + 0xbc8760b1UL, 0x00000000UL, 0xbfd00000UL, 0x0e5967d5UL, 0x3fac1d1fUL, + 0xcff75cb0UL, 0xbfef6297UL, 0x20000000UL, 0xbc756217UL, 0x00000000UL, + 0xbfd00000UL, 0x0f592f50UL, 0x3f9ba165UL, 0xa3d12526UL, 0xbfefd88dUL, + 0x40000000UL, 0x3c887df6UL, 0x00000000UL, 0xbfc00000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0xbff00000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x0f592f50UL, 0xbf9ba165UL, 0xa3d12526UL, + 0xbfefd88dUL, 0x40000000UL, 0x3c887df6UL, 0x00000000UL, 0x3fc00000UL, + 0x0e5967d5UL, 0xbfac1d1fUL, 0xcff75cb0UL, 0xbfef6297UL, 0x20000000UL, + 0xbc756217UL, 0x00000000UL, 0x3fd00000UL, 0x76acf82dUL, 0x3fa4a031UL, + 0x56c62ddaUL, 0xbfee9f41UL, 0xe0000000UL, 0xbc8760b1UL, 0x00000000UL, + 0x3fd00000UL, 0x65455a75UL, 0xbfbe0875UL, 0xcf328d46UL, 0xbfed906bUL, + 0x20000000UL, 0xbc7457e6UL, 0x00000000UL, 0x3fe00000UL, 0x7f909c4eUL, + 0xbf9d4a2cUL, 0xf180bdb1UL, 0xbfec38b2UL, 0x80000000UL, 0x3c76e0b1UL, + 0x00000000UL, 0x3fe00000UL, 0x9ae68c87UL, 0x3fac73b3UL, 0x290ea1a3UL, + 0xbfea9b66UL, 0xe0000000UL, 0xbc39f630UL, 0x00000000UL, 0x3fe00000UL, + 0x94247758UL, 0x3fc133ccUL, 0x6b151741UL, 0xbfe8bc80UL, 0x20000000UL, + 0x3c82c5e1UL, 0x00000000UL, 0x3fe00000UL, 0x99fcef32UL, 0x3fca8279UL, + 0x667f3bcdUL, 0xbfe6a09eUL, 0x20000000UL, 0x3c8bdd34UL, 0x00000000UL, + 0x3fe00000UL, 0x53aba2fdUL, 0xbfcd0dfeUL, 0x25091dd6UL, 0xbfe44cf3UL, + 0x20000000UL, 0xbc68076aUL, 0x00000000UL, 0x3ff00000UL, 0x5bc57974UL, + 0xbfc59267UL, 0x39ae68c8UL, 0xbfe1c73bUL, 0x20000000UL, 0xbc8b25ddUL, + 0x00000000UL, 0x3ff00000UL, 0x73fa1279UL, 0xbfbe3a68UL, 0x3806f63bUL, + 0xbfde2b5dUL, 0x20000000UL, 0xbc5e0d89UL, 0x00000000UL, 0x3ff00000UL, + 0x866b95cfUL, 0xbfb37ca1UL, 0xa6aea963UL, 0xbfd87de2UL, 0xe0000000UL, + 0x3c672cedUL, 0x00000000UL, 0x3ff00000UL, 0x939d225aUL, 0xbfa60beaUL, + 0x2ed59f06UL, 0xbfd29406UL, 0xa0000000UL, 0x3c75d28dUL, 0x00000000UL, + 0x3ff00000UL, 0x011469fbUL, 0xbf93ad06UL, 0x3c69a60bUL, 0xbfc8f8b8UL, + 0xc0000000UL, 0x3c626d19UL, 0x00000000UL, 0x3ff00000UL, 0x176d6d31UL, + 0xbf73b92eUL, 0xbc29b42cUL, 0xbfb917a6UL, 0xe0000000UL, 0x3c3e2718UL, + 0x00000000UL, 0x3ff00000UL, 0x55555555UL, 0xbfc55555UL, 0x00000000UL, + 0xbfe00000UL, 0x11111111UL, 0x3f811111UL, 0x55555555UL, 0x3fa55555UL, + 0x1a01a01aUL, 0xbf2a01a0UL, 0x16c16c17UL, 0xbf56c16cUL, 0xa556c734UL, + 0x3ec71de3UL, 0x1a01a01aUL, 0x3efa01a0UL, 0x1a600000UL, 0x3d90b461UL, + 0x1a600000UL, 0x3d90b461UL, 0x54400000UL, 0x3fb921fbUL, 0x00000000UL, + 0x00000000UL, 0x2e037073UL, 0x3b63198aUL, 0x00000000UL, 0x00000000UL, + 0x6dc9c883UL, 0x40245f30UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x43380000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x43600000UL, + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x3c800000UL, 0x00000000UL, + 0x00000000UL, 0xffffffffUL, 0x3fefffffUL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x80000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x80000000UL, 0x00000000UL, 0x80000000UL, 0x00000000UL, 0x3fe00000UL, + 0x00000000UL, 0x3fe00000UL +}; + +void MacroAssembler::fast_sin(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ebx, Register edx) { + + Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; + Label L_2TAG_PACKET_4_0_2, start; + assert_different_registers(eax, ebx, edx); + address static_const_table_sin = (address)_static_const_table_sin; + + bind(start); + subl(rsp, 120); + movl(Address(rsp, 56), ebx); + lea(ebx, ExternalAddress(static_const_table_sin)); + movsd(xmm0, Address(rsp, 128)); + pextrw(eax, xmm0, 3); + andl(eax, 32767); + subl(eax, 12336); + cmpl(eax, 4293); + jcc(Assembler::above, L_2TAG_PACKET_0_0_2); + movsd(xmm1, Address(ebx, 2160)); + mulsd(xmm1, xmm0); + movsd(xmm5, Address(ebx, 2272)); + movdqu(xmm4, Address(ebx, 2256)); + pand(xmm4, xmm0); + por(xmm5, xmm4); + movsd(xmm3, Address(ebx, 2128)); + movdqu(xmm2, Address(ebx, 2112)); + addpd(xmm1, xmm5); + cvttsd2sil(edx, xmm1); + cvtsi2sdl(xmm1, edx); + mulsd(xmm3, xmm1); + unpcklpd(xmm1, xmm1); + addl(edx, 1865216); + movdqu(xmm4, xmm0); + andl(edx, 63); + movdqu(xmm5, Address(ebx, 2096)); + lea(eax, Address(ebx, 0)); + shll(edx, 5); + addl(eax, edx); + mulpd(xmm2, xmm1); + subsd(xmm0, xmm3); + mulsd(xmm1, Address(ebx, 2144)); + subsd(xmm4, xmm3); + movsd(xmm7, Address(eax, 8)); + unpcklpd(xmm0, xmm0); + movapd(xmm3, xmm4); + subsd(xmm4, xmm2); + mulpd(xmm5, xmm0); + subpd(xmm0, xmm2); + movdqu(xmm6, Address(ebx, 2064)); + mulsd(xmm7, xmm4); + subsd(xmm3, xmm4); + mulpd(xmm5, xmm0); + mulpd(xmm0, xmm0); + subsd(xmm3, xmm2); + movdqu(xmm2, Address(eax, 0)); + subsd(xmm1, xmm3); + movsd(xmm3, Address(eax, 24)); + addsd(xmm2, xmm3); + subsd(xmm7, xmm2); + mulsd(xmm2, xmm4); + mulpd(xmm6, xmm0); + mulsd(xmm3, xmm4); + mulpd(xmm2, xmm0); + mulpd(xmm0, xmm0); + addpd(xmm5, Address(ebx, 2080)); + mulsd(xmm4, Address(eax, 0)); + addpd(xmm6, Address(ebx, 2048)); + mulpd(xmm5, xmm0); + movapd(xmm0, xmm3); + addsd(xmm3, Address(eax, 8)); + mulpd(xmm1, xmm7); + movapd(xmm7, xmm4); + addsd(xmm4, xmm3); + addpd(xmm6, xmm5); + movsd(xmm5, Address(eax, 8)); + subsd(xmm5, xmm3); + subsd(xmm3, xmm4); + addsd(xmm1, Address(eax, 16)); + mulpd(xmm6, xmm2); + addsd(xmm5, xmm0); + addsd(xmm3, xmm7); + addsd(xmm1, xmm5); + addsd(xmm1, xmm3); + addsd(xmm1, xmm6); + unpckhpd(xmm6, xmm6); + addsd(xmm1, xmm6); + addsd(xmm4, xmm1); + movsd(Address(rsp, 0), xmm4); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_0_0_2); + jcc(Assembler::greater, L_2TAG_PACKET_2_0_2); + shrl(eax, 4); + cmpl(eax, 268434685); + jcc(Assembler::notEqual, L_2TAG_PACKET_3_0_2); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_3_0_2); + movsd(xmm3, Address(ebx, 2192)); + mulsd(xmm3, xmm0); + subsd(xmm3, xmm0); + mulsd(xmm3, Address(ebx, 2208)); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_2_0_2); + movl(eax, Address(rsp, 132)); + andl(eax, 2146435072); + cmpl(eax, 2146435072); + jcc(Assembler::equal, L_2TAG_PACKET_4_0_2); + subl(rsp, 32); + movsd(Address(rsp, 0), xmm0); + lea(eax, Address(rsp, 40)); + movl(Address(rsp, 8), eax); + movl(eax, 2); + movl(Address(rsp, 12), eax); + call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlibm_sin_cos_huge()))); + addl(rsp, 32); + fld_d(Address(rsp, 16)); + jmp(L_2TAG_PACKET_1_0_2); + bind(L_2TAG_PACKET_4_0_2); + fld_d(Address(rsp, 128)); + fmul_d(Address(ebx, 2240)); + bind(L_2TAG_PACKET_1_0_2); + movl(ebx, Address(rsp, 56)); +} + +/******************************************************************************/ +// ALGORITHM DESCRIPTION - COS() +// --------------------- +// +// 1. RANGE REDUCTION +// +// We perform an initial range reduction from X to r with +// +// X =~= N * pi/32 + r +// +// so that |r| <= pi/64 + epsilon. We restrict inputs to those +// where |N| <= 932560. Beyond this, the range reduction is +// insufficiently accurate. For extremely small inputs, +// denormalization can occur internally, impacting performance. +// This means that the main path is actually only taken for +// 2^-252 <= |X| < 90112. +// +// To avoid branches, we perform the range reduction to full +// accuracy each time. +// +// X - N * (P_1 + P_2 + P_3) +// +// where P_1 and P_2 are 32-bit numbers (so multiplication by N +// is exact) and P_3 is a 53-bit number. Together, these +// approximate pi well enough for all cases in the restricted +// range. +// +// The main reduction sequence is: +// +// y = 32/pi * x +// N = integer(y) +// (computed by adding and subtracting off SHIFTER) +// +// m_1 = N * P_1 +// m_2 = N * P_2 +// r_1 = x - m_1 +// r = r_1 - m_2 +// (this r can be used for most of the calculation) +// +// c_1 = r_1 - r +// m_3 = N * P_3 +// c_2 = c_1 - m_2 +// c = c_2 - m_3 +// +// 2. MAIN ALGORITHM +// +// The algorithm uses a table lookup based on B = M * pi / 32 +// where M = N mod 64. The stored values are: +// sigma closest power of 2 to cos(B) +// C_hl 53-bit cos(B) - sigma +// S_hi + S_lo 2 * 53-bit sin(B) +// +// The computation is organized as follows: +// +// sin(B + r + c) = [sin(B) + sigma * r] + +// r * (cos(B) - sigma) + +// sin(B) * [cos(r + c) - 1] + +// cos(B) * [sin(r + c) - r] +// +// which is approximately: +// +// [S_hi + sigma * r] + +// C_hl * r + +// S_lo + S_hi * [(cos(r) - 1) - r * c] + +// (C_hl + sigma) * [(sin(r) - r) + c] +// +// and this is what is actually computed. We separate this sum +// into four parts: +// +// hi + med + pols + corr +// +// where +// +// hi = S_hi + sigma r +// med = C_hl * r +// pols = S_hi * (cos(r) - 1) + (C_hl + sigma) * (sin(r) - r) +// corr = S_lo + c * ((C_hl + sigma) - S_hi * r) +// +// 3. POLYNOMIAL +// +// The polynomial S_hi * (cos(r) - 1) + (C_hl + sigma) * +// (sin(r) - r) can be rearranged freely, since it is quite +// small, so we exploit parallelism to the fullest. +// +// psc4 = SC_4 * r_1 +// msc4 = psc4 * r +// r2 = r * r +// msc2 = SC_2 * r2 +// r4 = r2 * r2 +// psc3 = SC_3 + msc4 +// psc1 = SC_1 + msc2 +// msc3 = r4 * psc3 +// sincospols = psc1 + msc3 +// pols = sincospols * +// +// +// 4. CORRECTION TERM +// +// This is where the "c" component of the range reduction is +// taken into account; recall that just "r" is used for most of +// the calculation. +// +// -c = m_3 - c_2 +// -d = S_hi * r - (C_hl + sigma) +// corr = -c * -d + S_lo +// +// 5. COMPENSATED SUMMATIONS +// +// The two successive compensated summations add up the high +// and medium parts, leaving just the low parts to add up at +// the end. +// +// rs = sigma * r +// res_int = S_hi + rs +// k_0 = S_hi - res_int +// k_2 = k_0 + rs +// med = C_hl * r +// res_hi = res_int + med +// k_1 = res_int - res_hi +// k_3 = k_1 + med +// +// 6. FINAL SUMMATION +// +// We now add up all the small parts: +// +// res_lo = pols(hi) + pols(lo) + corr + k_1 + k_3 +// +// Now the overall result is just: +// +// res_hi + res_lo +// +// 7. SMALL ARGUMENTS +// +// Inputs with |X| < 2^-252 are treated specially as +// 1 - |x|. +// +// Special cases: +// cos(NaN) = quiet NaN, and raise invalid exception +// cos(INF) = NaN and raise invalid exception +// cos(0) = 1 +// +/******************************************************************************/ + +ALIGNED_(16) juint _static_const_table_cos[] = +{ + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x3ff00000UL, 0x176d6d31UL, 0xbf73b92eUL, + 0xbc29b42cUL, 0x3fb917a6UL, 0xe0000000UL, 0xbc3e2718UL, 0x00000000UL, + 0x3ff00000UL, 0x011469fbUL, 0xbf93ad06UL, 0x3c69a60bUL, 0x3fc8f8b8UL, + 0xc0000000UL, 0xbc626d19UL, 0x00000000UL, 0x3ff00000UL, 0x939d225aUL, + 0xbfa60beaUL, 0x2ed59f06UL, 0x3fd29406UL, 0xa0000000UL, 0xbc75d28dUL, + 0x00000000UL, 0x3ff00000UL, 0x866b95cfUL, 0xbfb37ca1UL, 0xa6aea963UL, + 0x3fd87de2UL, 0xe0000000UL, 0xbc672cedUL, 0x00000000UL, 0x3ff00000UL, + 0x73fa1279UL, 0xbfbe3a68UL, 0x3806f63bUL, 0x3fde2b5dUL, 0x20000000UL, + 0x3c5e0d89UL, 0x00000000UL, 0x3ff00000UL, 0x5bc57974UL, 0xbfc59267UL, + 0x39ae68c8UL, 0x3fe1c73bUL, 0x20000000UL, 0x3c8b25ddUL, 0x00000000UL, + 0x3ff00000UL, 0x53aba2fdUL, 0xbfcd0dfeUL, 0x25091dd6UL, 0x3fe44cf3UL, + 0x20000000UL, 0x3c68076aUL, 0x00000000UL, 0x3ff00000UL, 0x99fcef32UL, + 0x3fca8279UL, 0x667f3bcdUL, 0x3fe6a09eUL, 0x20000000UL, 0xbc8bdd34UL, + 0x00000000UL, 0x3fe00000UL, 0x94247758UL, 0x3fc133ccUL, 0x6b151741UL, + 0x3fe8bc80UL, 0x20000000UL, 0xbc82c5e1UL, 0x00000000UL, 0x3fe00000UL, + 0x9ae68c87UL, 0x3fac73b3UL, 0x290ea1a3UL, 0x3fea9b66UL, 0xe0000000UL, + 0x3c39f630UL, 0x00000000UL, 0x3fe00000UL, 0x7f909c4eUL, 0xbf9d4a2cUL, + 0xf180bdb1UL, 0x3fec38b2UL, 0x80000000UL, 0xbc76e0b1UL, 0x00000000UL, + 0x3fe00000UL, 0x65455a75UL, 0xbfbe0875UL, 0xcf328d46UL, 0x3fed906bUL, + 0x20000000UL, 0x3c7457e6UL, 0x00000000UL, 0x3fe00000UL, 0x76acf82dUL, + 0x3fa4a031UL, 0x56c62ddaUL, 0x3fee9f41UL, 0xe0000000UL, 0x3c8760b1UL, + 0x00000000UL, 0x3fd00000UL, 0x0e5967d5UL, 0xbfac1d1fUL, 0xcff75cb0UL, + 0x3fef6297UL, 0x20000000UL, 0x3c756217UL, 0x00000000UL, 0x3fd00000UL, + 0x0f592f50UL, 0xbf9ba165UL, 0xa3d12526UL, 0x3fefd88dUL, 0x40000000UL, + 0xbc887df6UL, 0x00000000UL, 0x3fc00000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x0f592f50UL, 0x3f9ba165UL, 0xa3d12526UL, 0x3fefd88dUL, + 0x40000000UL, 0xbc887df6UL, 0x00000000UL, 0xbfc00000UL, 0x0e5967d5UL, + 0x3fac1d1fUL, 0xcff75cb0UL, 0x3fef6297UL, 0x20000000UL, 0x3c756217UL, + 0x00000000UL, 0xbfd00000UL, 0x76acf82dUL, 0xbfa4a031UL, 0x56c62ddaUL, + 0x3fee9f41UL, 0xe0000000UL, 0x3c8760b1UL, 0x00000000UL, 0xbfd00000UL, + 0x65455a75UL, 0x3fbe0875UL, 0xcf328d46UL, 0x3fed906bUL, 0x20000000UL, + 0x3c7457e6UL, 0x00000000UL, 0xbfe00000UL, 0x7f909c4eUL, 0x3f9d4a2cUL, + 0xf180bdb1UL, 0x3fec38b2UL, 0x80000000UL, 0xbc76e0b1UL, 0x00000000UL, + 0xbfe00000UL, 0x9ae68c87UL, 0xbfac73b3UL, 0x290ea1a3UL, 0x3fea9b66UL, + 0xe0000000UL, 0x3c39f630UL, 0x00000000UL, 0xbfe00000UL, 0x94247758UL, + 0xbfc133ccUL, 0x6b151741UL, 0x3fe8bc80UL, 0x20000000UL, 0xbc82c5e1UL, + 0x00000000UL, 0xbfe00000UL, 0x99fcef32UL, 0xbfca8279UL, 0x667f3bcdUL, + 0x3fe6a09eUL, 0x20000000UL, 0xbc8bdd34UL, 0x00000000UL, 0xbfe00000UL, + 0x53aba2fdUL, 0x3fcd0dfeUL, 0x25091dd6UL, 0x3fe44cf3UL, 0x20000000UL, + 0x3c68076aUL, 0x00000000UL, 0xbff00000UL, 0x5bc57974UL, 0x3fc59267UL, + 0x39ae68c8UL, 0x3fe1c73bUL, 0x20000000UL, 0x3c8b25ddUL, 0x00000000UL, + 0xbff00000UL, 0x73fa1279UL, 0x3fbe3a68UL, 0x3806f63bUL, 0x3fde2b5dUL, + 0x20000000UL, 0x3c5e0d89UL, 0x00000000UL, 0xbff00000UL, 0x866b95cfUL, + 0x3fb37ca1UL, 0xa6aea963UL, 0x3fd87de2UL, 0xe0000000UL, 0xbc672cedUL, + 0x00000000UL, 0xbff00000UL, 0x939d225aUL, 0x3fa60beaUL, 0x2ed59f06UL, + 0x3fd29406UL, 0xa0000000UL, 0xbc75d28dUL, 0x00000000UL, 0xbff00000UL, + 0x011469fbUL, 0x3f93ad06UL, 0x3c69a60bUL, 0x3fc8f8b8UL, 0xc0000000UL, + 0xbc626d19UL, 0x00000000UL, 0xbff00000UL, 0x176d6d31UL, 0x3f73b92eUL, + 0xbc29b42cUL, 0x3fb917a6UL, 0xe0000000UL, 0xbc3e2718UL, 0x00000000UL, + 0xbff00000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0xbff00000UL, 0x176d6d31UL, + 0x3f73b92eUL, 0xbc29b42cUL, 0xbfb917a6UL, 0xe0000000UL, 0x3c3e2718UL, + 0x00000000UL, 0xbff00000UL, 0x011469fbUL, 0x3f93ad06UL, 0x3c69a60bUL, + 0xbfc8f8b8UL, 0xc0000000UL, 0x3c626d19UL, 0x00000000UL, 0xbff00000UL, + 0x939d225aUL, 0x3fa60beaUL, 0x2ed59f06UL, 0xbfd29406UL, 0xa0000000UL, + 0x3c75d28dUL, 0x00000000UL, 0xbff00000UL, 0x866b95cfUL, 0x3fb37ca1UL, + 0xa6aea963UL, 0xbfd87de2UL, 0xe0000000UL, 0x3c672cedUL, 0x00000000UL, + 0xbff00000UL, 0x73fa1279UL, 0x3fbe3a68UL, 0x3806f63bUL, 0xbfde2b5dUL, + 0x20000000UL, 0xbc5e0d89UL, 0x00000000UL, 0xbff00000UL, 0x5bc57974UL, + 0x3fc59267UL, 0x39ae68c8UL, 0xbfe1c73bUL, 0x20000000UL, 0xbc8b25ddUL, + 0x00000000UL, 0xbff00000UL, 0x53aba2fdUL, 0x3fcd0dfeUL, 0x25091dd6UL, + 0xbfe44cf3UL, 0x20000000UL, 0xbc68076aUL, 0x00000000UL, 0xbff00000UL, + 0x99fcef32UL, 0xbfca8279UL, 0x667f3bcdUL, 0xbfe6a09eUL, 0x20000000UL, + 0x3c8bdd34UL, 0x00000000UL, 0xbfe00000UL, 0x94247758UL, 0xbfc133ccUL, + 0x6b151741UL, 0xbfe8bc80UL, 0x20000000UL, 0x3c82c5e1UL, 0x00000000UL, + 0xbfe00000UL, 0x9ae68c87UL, 0xbfac73b3UL, 0x290ea1a3UL, 0xbfea9b66UL, + 0xe0000000UL, 0xbc39f630UL, 0x00000000UL, 0xbfe00000UL, 0x7f909c4eUL, + 0x3f9d4a2cUL, 0xf180bdb1UL, 0xbfec38b2UL, 0x80000000UL, 0x3c76e0b1UL, + 0x00000000UL, 0xbfe00000UL, 0x65455a75UL, 0x3fbe0875UL, 0xcf328d46UL, + 0xbfed906bUL, 0x20000000UL, 0xbc7457e6UL, 0x00000000UL, 0xbfe00000UL, + 0x76acf82dUL, 0xbfa4a031UL, 0x56c62ddaUL, 0xbfee9f41UL, 0xe0000000UL, + 0xbc8760b1UL, 0x00000000UL, 0xbfd00000UL, 0x0e5967d5UL, 0x3fac1d1fUL, + 0xcff75cb0UL, 0xbfef6297UL, 0x20000000UL, 0xbc756217UL, 0x00000000UL, + 0xbfd00000UL, 0x0f592f50UL, 0x3f9ba165UL, 0xa3d12526UL, 0xbfefd88dUL, + 0x40000000UL, 0x3c887df6UL, 0x00000000UL, 0xbfc00000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0xbff00000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x0f592f50UL, 0xbf9ba165UL, 0xa3d12526UL, + 0xbfefd88dUL, 0x40000000UL, 0x3c887df6UL, 0x00000000UL, 0x3fc00000UL, + 0x0e5967d5UL, 0xbfac1d1fUL, 0xcff75cb0UL, 0xbfef6297UL, 0x20000000UL, + 0xbc756217UL, 0x00000000UL, 0x3fd00000UL, 0x76acf82dUL, 0x3fa4a031UL, + 0x56c62ddaUL, 0xbfee9f41UL, 0xe0000000UL, 0xbc8760b1UL, 0x00000000UL, + 0x3fd00000UL, 0x65455a75UL, 0xbfbe0875UL, 0xcf328d46UL, 0xbfed906bUL, + 0x20000000UL, 0xbc7457e6UL, 0x00000000UL, 0x3fe00000UL, 0x7f909c4eUL, + 0xbf9d4a2cUL, 0xf180bdb1UL, 0xbfec38b2UL, 0x80000000UL, 0x3c76e0b1UL, + 0x00000000UL, 0x3fe00000UL, 0x9ae68c87UL, 0x3fac73b3UL, 0x290ea1a3UL, + 0xbfea9b66UL, 0xe0000000UL, 0xbc39f630UL, 0x00000000UL, 0x3fe00000UL, + 0x94247758UL, 0x3fc133ccUL, 0x6b151741UL, 0xbfe8bc80UL, 0x20000000UL, + 0x3c82c5e1UL, 0x00000000UL, 0x3fe00000UL, 0x99fcef32UL, 0x3fca8279UL, + 0x667f3bcdUL, 0xbfe6a09eUL, 0x20000000UL, 0x3c8bdd34UL, 0x00000000UL, + 0x3fe00000UL, 0x53aba2fdUL, 0xbfcd0dfeUL, 0x25091dd6UL, 0xbfe44cf3UL, + 0x20000000UL, 0xbc68076aUL, 0x00000000UL, 0x3ff00000UL, 0x5bc57974UL, + 0xbfc59267UL, 0x39ae68c8UL, 0xbfe1c73bUL, 0x20000000UL, 0xbc8b25ddUL, + 0x00000000UL, 0x3ff00000UL, 0x73fa1279UL, 0xbfbe3a68UL, 0x3806f63bUL, + 0xbfde2b5dUL, 0x20000000UL, 0xbc5e0d89UL, 0x00000000UL, 0x3ff00000UL, + 0x866b95cfUL, 0xbfb37ca1UL, 0xa6aea963UL, 0xbfd87de2UL, 0xe0000000UL, + 0x3c672cedUL, 0x00000000UL, 0x3ff00000UL, 0x939d225aUL, 0xbfa60beaUL, + 0x2ed59f06UL, 0xbfd29406UL, 0xa0000000UL, 0x3c75d28dUL, 0x00000000UL, + 0x3ff00000UL, 0x011469fbUL, 0xbf93ad06UL, 0x3c69a60bUL, 0xbfc8f8b8UL, + 0xc0000000UL, 0x3c626d19UL, 0x00000000UL, 0x3ff00000UL, 0x176d6d31UL, + 0xbf73b92eUL, 0xbc29b42cUL, 0xbfb917a6UL, 0xe0000000UL, 0x3c3e2718UL, + 0x00000000UL, 0x3ff00000UL, 0x55555555UL, 0xbfc55555UL, 0x00000000UL, + 0xbfe00000UL, 0x11111111UL, 0x3f811111UL, 0x55555555UL, 0x3fa55555UL, + 0x1a01a01aUL, 0xbf2a01a0UL, 0x16c16c17UL, 0xbf56c16cUL, 0xa556c734UL, + 0x3ec71de3UL, 0x1a01a01aUL, 0x3efa01a0UL, 0x1a600000UL, 0x3d90b461UL, + 0x1a600000UL, 0x3d90b461UL, 0x54400000UL, 0x3fb921fbUL, 0x00000000UL, + 0x00000000UL, 0x2e037073UL, 0x3b63198aUL, 0x00000000UL, 0x00000000UL, + 0x6dc9c883UL, 0x40245f30UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x43380000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x3ff00000UL, + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x80000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x80000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x3fe00000UL, 0x00000000UL, 0x3fe00000UL +}; + +//registers, +// input: (rbp + 8) +// scratch: xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 +// rax, rdx, rcx, rbx (tmp) + +// Code generated by Intel C compiler for LIBM library + +void MacroAssembler::fast_cos(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register tmp) { + Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; + Label L_2TAG_PACKET_4_0_2, L_2TAG_PACKET_5_0_2, L_2TAG_PACKET_6_0_2, L_2TAG_PACKET_7_0_2; + Label L_2TAG_PACKET_8_0_2, L_2TAG_PACKET_9_0_2, L_2TAG_PACKET_10_0_2, L_2TAG_PACKET_11_0_2; + Label L_2TAG_PACKET_12_0_2, L_2TAG_PACKET_13_0_2, B1_3, B1_5, start; + + assert_different_registers(tmp, eax, ecx, edx); + + address static_const_table_cos = (address)_static_const_table_cos; + + bind(start); + subl(rsp, 120); + movl(Address(rsp, 56), tmp); + lea(tmp, ExternalAddress(static_const_table_cos)); + movsd(xmm0, Address(rsp, 128)); + pextrw(eax, xmm0, 3); + andl(eax, 32767); + subl(eax, 12336); + cmpl(eax, 4293); + jcc(Assembler::above, L_2TAG_PACKET_0_0_2); + movsd(xmm1, Address(tmp, 2160)); + mulsd(xmm1, xmm0); + movdqu(xmm5, Address(tmp, 2240)); + movsd(xmm4, Address(tmp, 2224)); + pand(xmm4, xmm0); + por(xmm5, xmm4); + movsd(xmm3, Address(tmp, 2128)); + movdqu(xmm2, Address(tmp, 2112)); + addpd(xmm1, xmm5); + cvttsd2sil(edx, xmm1); + cvtsi2sdl(xmm1, edx); + mulsd(xmm3, xmm1); + unpcklpd(xmm1, xmm1); + addl(edx, 1865232); + movdqu(xmm4, xmm0); + andl(edx, 63); + movdqu(xmm5, Address(tmp, 2096)); + lea(eax, Address(tmp, 0)); + shll(edx, 5); + addl(eax, edx); + mulpd(xmm2, xmm1); + subsd(xmm0, xmm3); + mulsd(xmm1, Address(tmp, 2144)); + subsd(xmm4, xmm3); + movsd(xmm7, Address(eax, 8)); + unpcklpd(xmm0, xmm0); + movapd(xmm3, xmm4); + subsd(xmm4, xmm2); + mulpd(xmm5, xmm0); + subpd(xmm0, xmm2); + movdqu(xmm6, Address(tmp, 2064)); + mulsd(xmm7, xmm4); + subsd(xmm3, xmm4); + mulpd(xmm5, xmm0); + mulpd(xmm0, xmm0); + subsd(xmm3, xmm2); + movdqu(xmm2, Address(eax, 0)); + subsd(xmm1, xmm3); + movsd(xmm3, Address(eax, 24)); + addsd(xmm2, xmm3); + subsd(xmm7, xmm2); + mulsd(xmm2, xmm4); + mulpd(xmm6, xmm0); + mulsd(xmm3, xmm4); + mulpd(xmm2, xmm0); + mulpd(xmm0, xmm0); + addpd(xmm5, Address(tmp, 2080)); + mulsd(xmm4, Address(eax, 0)); + addpd(xmm6, Address(tmp, 2048)); + mulpd(xmm5, xmm0); + movapd(xmm0, xmm3); + addsd(xmm3, Address(eax, 8)); + mulpd(xmm1, xmm7); + movapd(xmm7, xmm4); + addsd(xmm4, xmm3); + addpd(xmm6, xmm5); + movsd(xmm5, Address(eax, 8)); + subsd(xmm5, xmm3); + subsd(xmm3, xmm4); + addsd(xmm1, Address(eax, 16)); + mulpd(xmm6, xmm2); + addsd(xmm5, xmm0); + addsd(xmm3, xmm7); + addsd(xmm1, xmm5); + addsd(xmm1, xmm3); + addsd(xmm1, xmm6); + unpckhpd(xmm6, xmm6); + addsd(xmm1, xmm6); + addsd(xmm4, xmm1); + movsd(Address(rsp, 0), xmm4); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_0_0_2); + jcc(Assembler::greater, L_2TAG_PACKET_2_0_2); + pextrw(eax, xmm0, 3); + andl(eax, 32767); + pinsrw(xmm0, eax, 3); + movsd(xmm1, Address(tmp, 2192)); + subsd(xmm1, xmm0); + movsd(Address(rsp, 0), xmm1); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_2_0_2); + movl(eax, Address(rsp, 132)); + andl(eax, 2146435072); + cmpl(eax, 2146435072); + jcc(Assembler::equal, L_2TAG_PACKET_3_0_2); + subl(rsp, 32); + movsd(Address(rsp, 0), xmm0); + lea(eax, Address(rsp, 40)); + movl(Address(rsp, 8), eax); + movl(eax, 1); + movl(Address(rsp, 12), eax); + call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlibm_sin_cos_huge()))); + addl(rsp, 32); + fld_d(Address(rsp, 8)); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_3_0_2); + fld_d(Address(rsp, 128)); + fmul_d(Address(tmp, 2208)); + + bind(L_2TAG_PACKET_1_0_2); + movl(tmp, Address(rsp, 56)); +} + diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86_libm.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_libm_x86_64.cpp similarity index 53% rename from hotspot/src/cpu/x86/vm/macroAssembler_x86_libm.cpp rename to hotspot/src/cpu/x86/vm/macroAssembler_libm_x86_64.cpp index e94f1d7136f..f2f2211d88b 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86_libm.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_libm_x86_64.cpp @@ -35,7 +35,7 @@ #define ALIGNED_(x) __attribute__ ((aligned(x))) #endif -// The 32 bit and 64 bit code is at most SSE2 compliant +// The 64 bit code is at most SSE2 compliant /******************************************************************************/ // ALGORITHM DESCRIPTION - EXP() @@ -71,8 +71,6 @@ // /******************************************************************************/ -#ifdef _LP64 - ALIGNED_(16) juint _cv[] = { 0x652b82feUL, 0x40571547UL, 0x652b82feUL, 0x40571547UL, 0xfefa0000UL, @@ -411,273 +409,6 @@ void MacroAssembler::fast_exp(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm addq(rsp, 24); } -#endif // _LP64 - -#ifndef _LP64 - -ALIGNED_(16) juint _static_const_table[] = -{ - 0x00000000UL, 0xfff00000UL, 0x00000000UL, 0xfff00000UL, 0xffffffc0UL, - 0x00000000UL, 0xffffffc0UL, 0x00000000UL, 0x0000ffc0UL, 0x00000000UL, - 0x0000ffc0UL, 0x00000000UL, 0x00000000UL, 0x43380000UL, 0x00000000UL, - 0x43380000UL, 0x652b82feUL, 0x40571547UL, 0x652b82feUL, 0x40571547UL, - 0xfefa0000UL, 0x3f862e42UL, 0xfefa0000UL, 0x3f862e42UL, 0xbc9e3b3aUL, - 0x3d1cf79aUL, 0xbc9e3b3aUL, 0x3d1cf79aUL, 0xfffffffeUL, 0x3fdfffffUL, - 0xfffffffeUL, 0x3fdfffffUL, 0xe3289860UL, 0x3f56c15cUL, 0x555b9e25UL, - 0x3fa55555UL, 0xc090cf0fUL, 0x3f811115UL, 0x55548ba1UL, 0x3fc55555UL, - 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x0e03754dUL, - 0x3cad7bbfUL, 0x3e778060UL, 0x00002c9aUL, 0x3567f613UL, 0x3c8cd252UL, - 0xd3158574UL, 0x000059b0UL, 0x61e6c861UL, 0x3c60f74eUL, 0x18759bc8UL, - 0x00008745UL, 0x5d837b6cUL, 0x3c979aa6UL, 0x6cf9890fUL, 0x0000b558UL, - 0x702f9cd1UL, 0x3c3ebe3dUL, 0x32d3d1a2UL, 0x0000e3ecUL, 0x1e63bcd8UL, - 0x3ca3516eUL, 0xd0125b50UL, 0x00011301UL, 0x26f0387bUL, 0x3ca4c554UL, - 0xaea92ddfUL, 0x0001429aUL, 0x62523fb6UL, 0x3ca95153UL, 0x3c7d517aUL, - 0x000172b8UL, 0x3f1353bfUL, 0x3c8b898cUL, 0xeb6fcb75UL, 0x0001a35bUL, - 0x3e3a2f5fUL, 0x3c9aecf7UL, 0x3168b9aaUL, 0x0001d487UL, 0x44a6c38dUL, - 0x3c8a6f41UL, 0x88628cd6UL, 0x0002063bUL, 0xe3a8a894UL, 0x3c968efdUL, - 0x6e756238UL, 0x0002387aUL, 0x981fe7f2UL, 0x3c80472bUL, 0x65e27cddUL, - 0x00026b45UL, 0x6d09ab31UL, 0x3c82f7e1UL, 0xf51fdee1UL, 0x00029e9dUL, - 0x720c0ab3UL, 0x3c8b3782UL, 0xa6e4030bUL, 0x0002d285UL, 0x4db0abb6UL, - 0x3c834d75UL, 0x0a31b715UL, 0x000306feUL, 0x5dd3f84aUL, 0x3c8fdd39UL, - 0xb26416ffUL, 0x00033c08UL, 0xcc187d29UL, 0x3ca12f8cUL, 0x373aa9caUL, - 0x000371a7UL, 0x738b5e8bUL, 0x3ca7d229UL, 0x34e59ff6UL, 0x0003a7dbUL, - 0xa72a4c6dUL, 0x3c859f48UL, 0x4c123422UL, 0x0003dea6UL, 0x259d9205UL, - 0x3ca8b846UL, 0x21f72e29UL, 0x0004160aUL, 0x60c2ac12UL, 0x3c4363edUL, - 0x6061892dUL, 0x00044e08UL, 0xdaa10379UL, 0x3c6ecce1UL, 0xb5c13cd0UL, - 0x000486a2UL, 0xbb7aafb0UL, 0x3c7690ceUL, 0xd5362a27UL, 0x0004bfdaUL, - 0x9b282a09UL, 0x3ca083ccUL, 0x769d2ca6UL, 0x0004f9b2UL, 0xc1aae707UL, - 0x3ca509b0UL, 0x569d4f81UL, 0x0005342bUL, 0x18fdd78eUL, 0x3c933505UL, - 0x36b527daUL, 0x00056f47UL, 0xe21c5409UL, 0x3c9063e1UL, 0xdd485429UL, - 0x0005ab07UL, 0x2b64c035UL, 0x3c9432e6UL, 0x15ad2148UL, 0x0005e76fUL, - 0x99f08c0aUL, 0x3ca01284UL, 0xb03a5584UL, 0x0006247eUL, 0x0073dc06UL, - 0x3c99f087UL, 0x82552224UL, 0x00066238UL, 0x0da05571UL, 0x3c998d4dUL, - 0x667f3bccUL, 0x0006a09eUL, 0x86ce4786UL, 0x3ca52bb9UL, 0x3c651a2eUL, - 0x0006dfb2UL, 0x206f0dabUL, 0x3ca32092UL, 0xe8ec5f73UL, 0x00071f75UL, - 0x8e17a7a6UL, 0x3ca06122UL, 0x564267c8UL, 0x00075febUL, 0x461e9f86UL, - 0x3ca244acUL, 0x73eb0186UL, 0x0007a114UL, 0xabd66c55UL, 0x3c65ebe1UL, - 0x36cf4e62UL, 0x0007e2f3UL, 0xbbff67d0UL, 0x3c96fe9fUL, 0x994cce12UL, - 0x00082589UL, 0x14c801dfUL, 0x3c951f14UL, 0x9b4492ecUL, 0x000868d9UL, - 0xc1f0eab4UL, 0x3c8db72fUL, 0x422aa0dbUL, 0x0008ace5UL, 0x59f35f44UL, - 0x3c7bf683UL, 0x99157736UL, 0x0008f1aeUL, 0x9c06283cUL, 0x3ca360baUL, - 0xb0cdc5e4UL, 0x00093737UL, 0x20f962aaUL, 0x3c95e8d1UL, 0x9fde4e4fUL, - 0x00097d82UL, 0x2b91ce27UL, 0x3c71affcUL, 0x82a3f090UL, 0x0009c491UL, - 0x589a2ebdUL, 0x3c9b6d34UL, 0x7b5de564UL, 0x000a0c66UL, 0x9ab89880UL, - 0x3c95277cUL, 0xb23e255cUL, 0x000a5503UL, 0x6e735ab3UL, 0x3c846984UL, - 0x5579fdbfUL, 0x000a9e6bUL, 0x92cb3387UL, 0x3c8c1a77UL, 0x995ad3adUL, - 0x000ae89fUL, 0xdc2d1d96UL, 0x3ca22466UL, 0xb84f15faUL, 0x000b33a2UL, - 0xb19505aeUL, 0x3ca1112eUL, 0xf2fb5e46UL, 0x000b7f76UL, 0x0a5fddcdUL, - 0x3c74ffd7UL, 0x904bc1d2UL, 0x000bcc1eUL, 0x30af0cb3UL, 0x3c736eaeUL, - 0xdd85529cUL, 0x000c199bUL, 0xd10959acUL, 0x3c84e08fUL, 0x2e57d14bUL, - 0x000c67f1UL, 0x6c921968UL, 0x3c676b2cUL, 0xdcef9069UL, 0x000cb720UL, - 0x36df99b3UL, 0x3c937009UL, 0x4a07897bUL, 0x000d072dUL, 0xa63d07a7UL, - 0x3c74a385UL, 0xdcfba487UL, 0x000d5818UL, 0xd5c192acUL, 0x3c8e5a50UL, - 0x03db3285UL, 0x000da9e6UL, 0x1c4a9792UL, 0x3c98bb73UL, 0x337b9b5eUL, - 0x000dfc97UL, 0x603a88d3UL, 0x3c74b604UL, 0xe78b3ff6UL, 0x000e502eUL, - 0x92094926UL, 0x3c916f27UL, 0xa2a490d9UL, 0x000ea4afUL, 0x41aa2008UL, - 0x3c8ec3bcUL, 0xee615a27UL, 0x000efa1bUL, 0x31d185eeUL, 0x3c8a64a9UL, - 0x5b6e4540UL, 0x000f5076UL, 0x4d91cd9dUL, 0x3c77893bUL, 0x819e90d8UL, - 0x000fa7c1UL, 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x7ff00000UL, - 0x00000000UL, 0x00000000UL, 0xffffffffUL, 0x7fefffffUL, 0x00000000UL, - 0x00100000UL -}; - -//registers, -// input: (rbp + 8) -// scratch: xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 -// rax, rdx, rcx, rbx (tmp) - -// Code generated by Intel C compiler for LIBM library - -void MacroAssembler::fast_exp(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register tmp) { - Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; - Label L_2TAG_PACKET_4_0_2, L_2TAG_PACKET_5_0_2, L_2TAG_PACKET_6_0_2, L_2TAG_PACKET_7_0_2; - Label L_2TAG_PACKET_8_0_2, L_2TAG_PACKET_9_0_2, L_2TAG_PACKET_10_0_2, L_2TAG_PACKET_11_0_2; - Label L_2TAG_PACKET_12_0_2, L_2TAG_PACKET_13_0_2, B1_3, B1_5, start; - - assert_different_registers(tmp, eax, ecx, edx); - jmp(start); - address static_const_table = (address)_static_const_table; - - bind(start); - subl(rsp, 120); - movl(Address(rsp, 64), tmp); - lea(tmp, ExternalAddress(static_const_table)); - movdqu(xmm0, Address(rsp, 128)); - unpcklpd(xmm0, xmm0); - movdqu(xmm1, Address(tmp, 64)); // 0x652b82feUL, 0x40571547UL, 0x652b82feUL, 0x40571547UL - movdqu(xmm6, Address(tmp, 48)); // 0x00000000UL, 0x43380000UL, 0x00000000UL, 0x43380000UL - movdqu(xmm2, Address(tmp, 80)); // 0xfefa0000UL, 0x3f862e42UL, 0xfefa0000UL, 0x3f862e42UL - movdqu(xmm3, Address(tmp, 96)); // 0xbc9e3b3aUL, 0x3d1cf79aUL, 0xbc9e3b3aUL, 0x3d1cf79aUL - pextrw(eax, xmm0, 3); - andl(eax, 32767); - movl(edx, 16527); - subl(edx, eax); - subl(eax, 15504); - orl(edx, eax); - cmpl(edx, INT_MIN); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_0_0_2); - mulpd(xmm1, xmm0); - addpd(xmm1, xmm6); - movapd(xmm7, xmm1); - subpd(xmm1, xmm6); - mulpd(xmm2, xmm1); - movdqu(xmm4, Address(tmp, 128)); // 0xe3289860UL, 0x3f56c15cUL, 0x555b9e25UL, 0x3fa55555UL - mulpd(xmm3, xmm1); - movdqu(xmm5, Address(tmp, 144)); // 0xc090cf0fUL, 0x3f811115UL, 0x55548ba1UL, 0x3fc55555UL - subpd(xmm0, xmm2); - movdl(eax, xmm7); - movl(ecx, eax); - andl(ecx, 63); - shll(ecx, 4); - sarl(eax, 6); - movl(edx, eax); - movdqu(xmm6, Address(tmp, 16)); // 0xffffffc0UL, 0x00000000UL, 0xffffffc0UL, 0x00000000UL - pand(xmm7, xmm6); - movdqu(xmm6, Address(tmp, 32)); // 0x0000ffc0UL, 0x00000000UL, 0x0000ffc0UL, 0x00000000UL - paddq(xmm7, xmm6); - psllq(xmm7, 46); - subpd(xmm0, xmm3); - movdqu(xmm2, Address(tmp, ecx, Address::times_1, 160)); - mulpd(xmm4, xmm0); - movapd(xmm6, xmm0); - movapd(xmm1, xmm0); - mulpd(xmm6, xmm6); - mulpd(xmm0, xmm6); - addpd(xmm5, xmm4); - mulsd(xmm0, xmm6); - mulpd(xmm6, Address(tmp, 112)); // 0xfffffffeUL, 0x3fdfffffUL, 0xfffffffeUL, 0x3fdfffffUL - addsd(xmm1, xmm2); - unpckhpd(xmm2, xmm2); - mulpd(xmm0, xmm5); - addsd(xmm1, xmm0); - por(xmm2, xmm7); - unpckhpd(xmm0, xmm0); - addsd(xmm0, xmm1); - addsd(xmm0, xmm6); - addl(edx, 894); - cmpl(edx, 1916); - jcc (Assembler::above, L_2TAG_PACKET_1_0_2); - mulsd(xmm0, xmm2); - addsd(xmm0, xmm2); - jmp(L_2TAG_PACKET_2_0_2); - - bind(L_2TAG_PACKET_1_0_2); - fnstcw(Address(rsp, 24)); - movzwl(edx, Address(rsp, 24)); - orl(edx, 768); - movw(Address(rsp, 28), edx); - fldcw(Address(rsp, 28)); - movl(edx, eax); - sarl(eax, 1); - subl(edx, eax); - movdqu(xmm6, Address(tmp, 0)); // 0x00000000UL, 0xfff00000UL, 0x00000000UL, 0xfff00000UL - pandn(xmm6, xmm2); - addl(eax, 1023); - movdl(xmm3, eax); - psllq(xmm3, 52); - por(xmm6, xmm3); - addl(edx, 1023); - movdl(xmm4, edx); - psllq(xmm4, 52); - movsd(Address(rsp, 8), xmm0); - fld_d(Address(rsp, 8)); - movsd(Address(rsp, 16), xmm6); - fld_d(Address(rsp, 16)); - fmula(1); - faddp(1); - movsd(Address(rsp, 8), xmm4); - fld_d(Address(rsp, 8)); - fmulp(1); - fstp_d(Address(rsp, 8)); - movsd(xmm0,Address(rsp, 8)); - fldcw(Address(rsp, 24)); - pextrw(ecx, xmm0, 3); - andl(ecx, 32752); - cmpl(ecx, 32752); - jcc(Assembler::greaterEqual, L_2TAG_PACKET_3_0_2); - cmpl(ecx, 0); - jcc(Assembler::equal, L_2TAG_PACKET_4_0_2); - jmp(L_2TAG_PACKET_2_0_2); - cmpl(ecx, INT_MIN); - jcc(Assembler::less, L_2TAG_PACKET_3_0_2); - cmpl(ecx, -1064950997); - jcc(Assembler::less, L_2TAG_PACKET_2_0_2); - jcc(Assembler::greater, L_2TAG_PACKET_4_0_2); - movl(edx, Address(rsp, 128)); - cmpl(edx ,-17155601); - jcc(Assembler::less, L_2TAG_PACKET_2_0_2); - jmp(L_2TAG_PACKET_4_0_2); - - bind(L_2TAG_PACKET_3_0_2); - movl(edx, 14); - jmp(L_2TAG_PACKET_5_0_2); - - bind(L_2TAG_PACKET_4_0_2); - movl(edx, 15); - - bind(L_2TAG_PACKET_5_0_2); - movsd(Address(rsp, 0), xmm0); - movsd(xmm0, Address(rsp, 128)); - fld_d(Address(rsp, 0)); - jmp(L_2TAG_PACKET_6_0_2); - - bind(L_2TAG_PACKET_7_0_2); - cmpl(eax, 2146435072); - jcc(Assembler::greaterEqual, L_2TAG_PACKET_8_0_2); - movl(eax, Address(rsp, 132)); - cmpl(eax, INT_MIN); - jcc(Assembler::greaterEqual, L_2TAG_PACKET_9_0_2); - movsd(xmm0, Address(tmp, 1208)); // 0xffffffffUL, 0x7fefffffUL - mulsd(xmm0, xmm0); - movl(edx, 14); - jmp(L_2TAG_PACKET_5_0_2); - - bind(L_2TAG_PACKET_9_0_2); - movsd(xmm0, Address(tmp, 1216)); - mulsd(xmm0, xmm0); - movl(edx, 15); - jmp(L_2TAG_PACKET_5_0_2); - - bind(L_2TAG_PACKET_8_0_2); - movl(edx, Address(rsp, 128)); - cmpl(eax, 2146435072); - jcc(Assembler::above, L_2TAG_PACKET_10_0_2); - cmpl(edx, 0); - jcc(Assembler::notEqual, L_2TAG_PACKET_10_0_2); - movl(eax, Address(rsp, 132)); - cmpl(eax, 2146435072); - jcc(Assembler::notEqual, L_2TAG_PACKET_11_0_2); - movsd(xmm0, Address(tmp, 1192)); // 0x00000000UL, 0x7ff00000UL - jmp(L_2TAG_PACKET_2_0_2); - - bind(L_2TAG_PACKET_11_0_2); - movsd(xmm0, Address(tmp, 1200)); // 0x00000000UL, 0x00000000UL - jmp(L_2TAG_PACKET_2_0_2); - - bind(L_2TAG_PACKET_10_0_2); - movsd(xmm0, Address(rsp, 128)); - addsd(xmm0, xmm0); - jmp(L_2TAG_PACKET_2_0_2); - - bind(L_2TAG_PACKET_0_0_2); - movl(eax, Address(rsp, 132)); - andl(eax, 2147483647); - cmpl(eax, 1083179008); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_7_0_2); - movsd(xmm0, Address(rsp, 128)); - addsd(xmm0, Address(tmp, 1184)); // 0x00000000UL, 0x3ff00000UL - jmp(L_2TAG_PACKET_2_0_2); - - bind(L_2TAG_PACKET_2_0_2); - movsd(Address(rsp, 48), xmm0); - fld_d(Address(rsp, 48)); - - bind(L_2TAG_PACKET_6_0_2); - movl(tmp, Address(rsp, 64)); -} - -#endif // !_LP64 - /******************************************************************************/ // ALGORITHM DESCRIPTION - LOG() // --------------------- @@ -703,8 +434,6 @@ void MacroAssembler::fast_exp(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm // /******************************************************************************/ -#ifdef _LP64 - ALIGNED_(16) juint _L_tbl[] = { 0xfefa3800UL, 0x3fe62e42UL, 0x93c76730UL, 0x3d2ef357UL, 0xaa241800UL, @@ -1007,298 +736,6 @@ void MacroAssembler::fast_log(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm addq(rsp, 24); } -#endif // _LP64 - -#ifndef _LP64 - -ALIGNED_(16) juint _static_const_table_log[] = -{ - 0xfefa3800UL, 0x3fe62e42UL, 0x93c76730UL, 0x3d2ef357UL, 0xaa241800UL, - 0x3fe5ee82UL, 0x0cda46beUL, 0x3d220238UL, 0x5c364800UL, 0x3fe5af40UL, - 0xac10c9fbUL, 0x3d2dfa63UL, 0x26bb8c00UL, 0x3fe5707aUL, 0xff3303ddUL, - 0x3d09980bUL, 0x26867800UL, 0x3fe5322eUL, 0x5d257531UL, 0x3d05ccc4UL, - 0x835a5000UL, 0x3fe4f45aUL, 0x6d93b8fbUL, 0xbd2e6c51UL, 0x6f970c00UL, - 0x3fe4b6fdUL, 0xed4c541cUL, 0x3cef7115UL, 0x27e8a400UL, 0x3fe47a15UL, - 0xf94d60aaUL, 0xbd22cb6aUL, 0xf2f92400UL, 0x3fe43d9fUL, 0x481051f7UL, - 0xbcfd984fUL, 0x2125cc00UL, 0x3fe4019cUL, 0x30f0c74cUL, 0xbd26ce79UL, - 0x0c36c000UL, 0x3fe3c608UL, 0x7cfe13c2UL, 0xbd02b736UL, 0x17197800UL, - 0x3fe38ae2UL, 0xbb5569a4UL, 0xbd218b7aUL, 0xad9d8c00UL, 0x3fe35028UL, - 0x9527e6acUL, 0x3d10b83fUL, 0x44340800UL, 0x3fe315daUL, 0xc5a0ed9cUL, - 0xbd274e93UL, 0x57b0e000UL, 0x3fe2dbf5UL, 0x07b9dc11UL, 0xbd17a6e5UL, - 0x6d0ec000UL, 0x3fe2a278UL, 0xe797882dUL, 0x3d206d2bUL, 0x1134dc00UL, - 0x3fe26962UL, 0x05226250UL, 0xbd0b61f1UL, 0xd8bebc00UL, 0x3fe230b0UL, - 0x6e48667bUL, 0x3d12fc06UL, 0x5fc61800UL, 0x3fe1f863UL, 0xc9fe81d3UL, - 0xbd2a7242UL, 0x49ae6000UL, 0x3fe1c078UL, 0xed70e667UL, 0x3cccacdeUL, - 0x40f23c00UL, 0x3fe188eeUL, 0xf8ab4650UL, 0x3d14cc4eUL, 0xf6f29800UL, - 0x3fe151c3UL, 0xa293ae49UL, 0xbd2edd97UL, 0x23c75c00UL, 0x3fe11af8UL, - 0xbb9ddcb2UL, 0xbd258647UL, 0x8611cc00UL, 0x3fe0e489UL, 0x07801742UL, - 0x3d1c2998UL, 0xe2d05400UL, 0x3fe0ae76UL, 0x887e7e27UL, 0x3d1f486bUL, - 0x0533c400UL, 0x3fe078bfUL, 0x41edf5fdUL, 0x3d268122UL, 0xbe760400UL, - 0x3fe04360UL, 0xe79539e0UL, 0xbd04c45fUL, 0xe5b20800UL, 0x3fe00e5aUL, - 0xb1727b1cUL, 0xbd053ba3UL, 0xaf7a4800UL, 0x3fdfb358UL, 0x3c164935UL, - 0x3d0085faUL, 0xee031800UL, 0x3fdf4aa7UL, 0x6f014a8bUL, 0x3d12cde5UL, - 0x56b41000UL, 0x3fdee2a1UL, 0x5a470251UL, 0x3d2f27f4UL, 0xc3ddb000UL, - 0x3fde7b42UL, 0x5372bd08UL, 0xbd246550UL, 0x1a272800UL, 0x3fde148aUL, - 0x07322938UL, 0xbd1326b2UL, 0x484c9800UL, 0x3fddae75UL, 0x60dc616aUL, - 0xbd1ea42dUL, 0x46def800UL, 0x3fdd4902UL, 0xe9a767a8UL, 0x3d235bafUL, - 0x18064800UL, 0x3fdce42fUL, 0x3ec7a6b0UL, 0xbd0797c3UL, 0xc7455800UL, - 0x3fdc7ff9UL, 0xc15249aeUL, 0xbd29b6ddUL, 0x693fa000UL, 0x3fdc1c60UL, - 0x7fe8e180UL, 0x3d2cec80UL, 0x1b80e000UL, 0x3fdbb961UL, 0xf40a666dUL, - 0x3d27d85bUL, 0x04462800UL, 0x3fdb56faUL, 0x2d841995UL, 0x3d109525UL, - 0x5248d000UL, 0x3fdaf529UL, 0x52774458UL, 0xbd217cc5UL, 0x3c8ad800UL, - 0x3fda93edUL, 0xbea77a5dUL, 0x3d1e36f2UL, 0x0224f800UL, 0x3fda3344UL, - 0x7f9d79f5UL, 0x3d23c645UL, 0xea15f000UL, 0x3fd9d32bUL, 0x10d0c0b0UL, - 0xbd26279eUL, 0x43135800UL, 0x3fd973a3UL, 0xa502d9f0UL, 0xbd152313UL, - 0x635bf800UL, 0x3fd914a8UL, 0x2ee6307dUL, 0xbd1766b5UL, 0xa88b3000UL, - 0x3fd8b639UL, 0xe5e70470UL, 0xbd205ae1UL, 0x776dc800UL, 0x3fd85855UL, - 0x3333778aUL, 0x3d2fd56fUL, 0x3bd81800UL, 0x3fd7fafaUL, 0xc812566aUL, - 0xbd272090UL, 0x687cf800UL, 0x3fd79e26UL, 0x2efd1778UL, 0x3d29ec7dUL, - 0x76c67800UL, 0x3fd741d8UL, 0x49dc60b3UL, 0x3d2d8b09UL, 0xe6af1800UL, - 0x3fd6e60eUL, 0x7c222d87UL, 0x3d172165UL, 0x3e9c6800UL, 0x3fd68ac8UL, - 0x2756eba0UL, 0x3d20a0d3UL, 0x0b3ab000UL, 0x3fd63003UL, 0xe731ae00UL, - 0xbd2db623UL, 0xdf596000UL, 0x3fd5d5bdUL, 0x08a465dcUL, 0xbd0a0b2aUL, - 0x53c8d000UL, 0x3fd57bf7UL, 0xee5d40efUL, 0x3d1fadedUL, 0x0738a000UL, - 0x3fd522aeUL, 0x8164c759UL, 0x3d2ebe70UL, 0x9e173000UL, 0x3fd4c9e0UL, - 0x1b0ad8a4UL, 0xbd2e2089UL, 0xc271c800UL, 0x3fd4718dUL, 0x0967d675UL, - 0xbd2f27ceUL, 0x23d5e800UL, 0x3fd419b4UL, 0xec90e09dUL, 0x3d08e436UL, - 0x77333000UL, 0x3fd3c252UL, 0xb606bd5cUL, 0x3d183b54UL, 0x76be1000UL, - 0x3fd36b67UL, 0xb0f177c8UL, 0x3d116ecdUL, 0xe1d36000UL, 0x3fd314f1UL, - 0xd3213cb8UL, 0xbd28e27aUL, 0x7cdc9000UL, 0x3fd2bef0UL, 0x4a5004f4UL, - 0x3d2a9cfaUL, 0x1134d800UL, 0x3fd26962UL, 0xdf5bb3b6UL, 0x3d2c93c1UL, - 0x6d0eb800UL, 0x3fd21445UL, 0xba46baeaUL, 0x3d0a87deUL, 0x635a6800UL, - 0x3fd1bf99UL, 0x5147bdb7UL, 0x3d2ca6edUL, 0xcbacf800UL, 0x3fd16b5cUL, - 0xf7a51681UL, 0x3d2b9acdUL, 0x8227e800UL, 0x3fd1178eUL, 0x63a5f01cUL, - 0xbd2c210eUL, 0x67616000UL, 0x3fd0c42dUL, 0x163ceae9UL, 0x3d27188bUL, - 0x604d5800UL, 0x3fd07138UL, 0x16ed4e91UL, 0x3cf89cdbUL, 0x5626c800UL, - 0x3fd01eaeUL, 0x1485e94aUL, 0xbd16f08cUL, 0x6cb3b000UL, 0x3fcf991cUL, - 0xca0cdf30UL, 0x3d1bcbecUL, 0xe4dd0000UL, 0x3fcef5adUL, 0x65bb8e11UL, - 0xbcca2115UL, 0xffe71000UL, 0x3fce530eUL, 0x6041f430UL, 0x3cc21227UL, - 0xb0d49000UL, 0x3fcdb13dUL, 0xf715b035UL, 0xbd2aff2aUL, 0xf2656000UL, - 0x3fcd1037UL, 0x75b6f6e4UL, 0xbd084a7eUL, 0xc6f01000UL, 0x3fcc6ffbUL, - 0xc5962bd2UL, 0xbcf1ec72UL, 0x383be000UL, 0x3fcbd087UL, 0x595412b6UL, - 0xbd2d4bc4UL, 0x575bd000UL, 0x3fcb31d8UL, 0x4eace1aaUL, 0xbd0c358dUL, - 0x3c8ae000UL, 0x3fca93edUL, 0x50562169UL, 0xbd287243UL, 0x07089000UL, - 0x3fc9f6c4UL, 0x6865817aUL, 0x3d29904dUL, 0xdcf70000UL, 0x3fc95a5aUL, - 0x58a0ff6fUL, 0x3d07f228UL, 0xeb390000UL, 0x3fc8beafUL, 0xaae92cd1UL, - 0xbd073d54UL, 0x6551a000UL, 0x3fc823c1UL, 0x9a631e83UL, 0x3d1e0ddbUL, - 0x85445000UL, 0x3fc7898dUL, 0x70914305UL, 0xbd1c6610UL, 0x8b757000UL, - 0x3fc6f012UL, 0xe59c21e1UL, 0xbd25118dUL, 0xbe8c1000UL, 0x3fc6574eUL, - 0x2c3c2e78UL, 0x3d19cf8bUL, 0x6b544000UL, 0x3fc5bf40UL, 0xeb68981cUL, - 0xbd127023UL, 0xe4a1b000UL, 0x3fc527e5UL, 0xe5697dc7UL, 0x3d2633e8UL, - 0x8333b000UL, 0x3fc4913dUL, 0x54fdb678UL, 0x3d258379UL, 0xa5993000UL, - 0x3fc3fb45UL, 0x7e6a354dUL, 0xbd2cd1d8UL, 0xb0159000UL, 0x3fc365fcUL, - 0x234b7289UL, 0x3cc62fa8UL, 0x0c868000UL, 0x3fc2d161UL, 0xcb81b4a1UL, - 0x3d039d6cUL, 0x2a49c000UL, 0x3fc23d71UL, 0x8fd3df5cUL, 0x3d100d23UL, - 0x7e23f000UL, 0x3fc1aa2bUL, 0x44389934UL, 0x3d2ca78eUL, 0x8227e000UL, - 0x3fc1178eUL, 0xce2d07f2UL, 0x3d21ef78UL, 0xb59e4000UL, 0x3fc08598UL, - 0x7009902cUL, 0xbd27e5ddUL, 0x39dbe000UL, 0x3fbfe891UL, 0x4fa10afdUL, - 0xbd2534d6UL, 0x830a2000UL, 0x3fbec739UL, 0xafe645e0UL, 0xbd2dc068UL, - 0x63844000UL, 0x3fbda727UL, 0x1fa71733UL, 0x3d1a8940UL, 0x01bc4000UL, - 0x3fbc8858UL, 0xc65aacd3UL, 0x3d2646d1UL, 0x8dad6000UL, 0x3fbb6ac8UL, - 0x2bf768e5UL, 0xbd139080UL, 0x40b1c000UL, 0x3fba4e76UL, 0xb94407c8UL, - 0xbd0e42b6UL, 0x5d594000UL, 0x3fb9335eUL, 0x3abd47daUL, 0x3d23115cUL, - 0x2f40e000UL, 0x3fb8197eUL, 0xf96ffdf7UL, 0x3d0f80dcUL, 0x0aeac000UL, - 0x3fb700d3UL, 0xa99ded32UL, 0x3cec1e8dUL, 0x4d97a000UL, 0x3fb5e95aUL, - 0x3c5d1d1eUL, 0xbd2c6906UL, 0x5d208000UL, 0x3fb4d311UL, 0x82f4e1efUL, - 0xbcf53a25UL, 0xa7d1e000UL, 0x3fb3bdf5UL, 0xa5db4ed7UL, 0x3d2cc85eUL, - 0xa4472000UL, 0x3fb2aa04UL, 0xae9c697dUL, 0xbd20b6e8UL, 0xd1466000UL, - 0x3fb1973bUL, 0x560d9e9bUL, 0xbd25325dUL, 0xb59e4000UL, 0x3fb08598UL, - 0x7009902cUL, 0xbd17e5ddUL, 0xc006c000UL, 0x3faeea31UL, 0x4fc93b7bUL, - 0xbd0e113eUL, 0xcdddc000UL, 0x3faccb73UL, 0x47d82807UL, 0xbd1a68f2UL, - 0xd0fb0000UL, 0x3faaaef2UL, 0x353bb42eUL, 0x3d20fc1aUL, 0x149fc000UL, - 0x3fa894aaUL, 0xd05a267dUL, 0xbd197995UL, 0xf2d4c000UL, 0x3fa67c94UL, - 0xec19afa2UL, 0xbd029efbUL, 0xd42e0000UL, 0x3fa466aeUL, 0x75bdfd28UL, - 0xbd2c1673UL, 0x2f8d0000UL, 0x3fa252f3UL, 0xe021b67bUL, 0x3d283e9aUL, - 0x89e74000UL, 0x3fa0415dUL, 0x5cf1d753UL, 0x3d0111c0UL, 0xec148000UL, - 0x3f9c63d2UL, 0x3f9eb2f3UL, 0x3d2578c6UL, 0x28c90000UL, 0x3f984925UL, - 0x325a0c34UL, 0xbd2aa0baUL, 0x25980000UL, 0x3f9432a9UL, 0x928637feUL, - 0x3d098139UL, 0x58938000UL, 0x3f902056UL, 0x06e2f7d2UL, 0xbd23dc5bUL, - 0xa3890000UL, 0x3f882448UL, 0xda74f640UL, 0xbd275577UL, 0x75890000UL, - 0x3f801015UL, 0x999d2be8UL, 0xbd10c76bUL, 0x59580000UL, 0x3f700805UL, - 0xcb31c67bUL, 0x3d2166afUL, 0x00000000UL, 0x00000000UL, 0x00000000UL, - 0x80000000UL, 0xfefa3800UL, 0x3fa62e42UL, 0x93c76730UL, 0x3ceef357UL, - 0x92492492UL, 0x3fc24924UL, 0x00000000UL, 0xbfd00000UL, 0x3d6fb175UL, - 0xbfc5555eUL, 0x55555555UL, 0x3fd55555UL, 0x9999999aUL, 0x3fc99999UL, - 0x00000000UL, 0xbfe00000UL, 0x00000000UL, 0xffffe000UL, 0x00000000UL, - 0xffffe000UL -}; -//registers, -// input: xmm0 -// scratch: xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 -// rax, rdx, rcx, rbx (tmp) - -void MacroAssembler::fast_log(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register tmp) { - Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; - Label L_2TAG_PACKET_4_0_2, L_2TAG_PACKET_5_0_2, L_2TAG_PACKET_6_0_2, L_2TAG_PACKET_7_0_2; - Label L_2TAG_PACKET_8_0_2, L_2TAG_PACKET_9_0_2; - Label L_2TAG_PACKET_10_0_2, start; - - assert_different_registers(tmp, eax, ecx, edx); - jmp(start); - address static_const_table = (address)_static_const_table_log; - - bind(start); - subl(rsp, 104); - movl(Address(rsp, 40), tmp); - lea(tmp, ExternalAddress(static_const_table)); - xorpd(xmm2, xmm2); - movl(eax, 16368); - pinsrw(xmm2, eax, 3); - xorpd(xmm3, xmm3); - movl(edx, 30704); - pinsrw(xmm3, edx, 3); - movsd(xmm0, Address(rsp, 112)); - movapd(xmm1, xmm0); - movl(ecx, 32768); - movdl(xmm4, ecx); - movsd(xmm5, Address(tmp, 2128)); // 0x00000000UL, 0xffffe000UL - pextrw(eax, xmm0, 3); - por(xmm0, xmm2); - psllq(xmm0, 5); - movl(ecx, 16352); - psrlq(xmm0, 34); - rcpss(xmm0, xmm0); - psllq(xmm1, 12); - pshufd(xmm6, xmm5, 228); - psrlq(xmm1, 12); - subl(eax, 16); - cmpl(eax, 32736); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_0_0_2); - - bind(L_2TAG_PACKET_1_0_2); - paddd(xmm0, xmm4); - por(xmm1, xmm3); - movdl(edx, xmm0); - psllq(xmm0, 29); - pand(xmm5, xmm1); - pand(xmm0, xmm6); - subsd(xmm1, xmm5); - mulpd(xmm5, xmm0); - andl(eax, 32752); - subl(eax, ecx); - cvtsi2sdl(xmm7, eax); - mulsd(xmm1, xmm0); - movsd(xmm6, Address(tmp, 2064)); // 0xfefa3800UL, 0x3fa62e42UL - movdqu(xmm3, Address(tmp, 2080)); // 0x92492492UL, 0x3fc24924UL, 0x00000000UL, 0xbfd00000UL - subsd(xmm5, xmm2); - andl(edx, 16711680); - shrl(edx, 12); - movdqu(xmm0, Address(tmp, edx)); - movdqu(xmm4, Address(tmp, 2096)); // 0x3d6fb175UL, 0xbfc5555eUL, 0x55555555UL, 0x3fd55555UL - addsd(xmm1, xmm5); - movdqu(xmm2, Address(tmp, 2112)); // 0x9999999aUL, 0x3fc99999UL, 0x00000000UL, 0xbfe00000UL - mulsd(xmm6, xmm7); - pshufd(xmm5, xmm1, 68); - mulsd(xmm7, Address(tmp, 2072)); // 0x93c76730UL, 0x3ceef357UL, 0x92492492UL, 0x3fc24924UL - mulsd(xmm3, xmm1); - addsd(xmm0, xmm6); - mulpd(xmm4, xmm5); - mulpd(xmm5, xmm5); - pshufd(xmm6, xmm0, 228); - addsd(xmm0, xmm1); - addpd(xmm4, xmm2); - mulpd(xmm3, xmm5); - subsd(xmm6, xmm0); - mulsd(xmm4, xmm1); - pshufd(xmm2, xmm0, 238); - addsd(xmm1, xmm6); - mulsd(xmm5, xmm5); - addsd(xmm7, xmm2); - addpd(xmm4, xmm3); - addsd(xmm1, xmm7); - mulpd(xmm4, xmm5); - addsd(xmm1, xmm4); - pshufd(xmm5, xmm4, 238); - addsd(xmm1, xmm5); - addsd(xmm0, xmm1); - jmp(L_2TAG_PACKET_2_0_2); - - bind(L_2TAG_PACKET_0_0_2); - movsd(xmm0, Address(rsp, 112)); - movdqu(xmm1, xmm0); - addl(eax, 16); - cmpl(eax, 32768); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_3_0_2); - cmpl(eax, 16); - jcc(Assembler::below, L_2TAG_PACKET_4_0_2); - - bind(L_2TAG_PACKET_5_0_2); - addsd(xmm0, xmm0); - jmp(L_2TAG_PACKET_2_0_2); - - bind(L_2TAG_PACKET_6_0_2); - jcc(Assembler::above, L_2TAG_PACKET_5_0_2); - cmpl(edx, 0); - jcc(Assembler::above, L_2TAG_PACKET_5_0_2); - jmp(L_2TAG_PACKET_7_0_2); - - bind(L_2TAG_PACKET_3_0_2); - movdl(edx, xmm1); - psrlq(xmm1, 32); - movdl(ecx, xmm1); - addl(ecx, ecx); - cmpl(ecx, -2097152); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_6_0_2); - orl(edx, ecx); - cmpl(edx, 0); - jcc(Assembler::equal, L_2TAG_PACKET_8_0_2); - - bind(L_2TAG_PACKET_7_0_2); - xorpd(xmm1, xmm1); - xorpd(xmm0, xmm0); - movl(eax, 32752); - pinsrw(xmm1, eax, 3); - movl(edx, 3); - mulsd(xmm0, xmm1); - - bind(L_2TAG_PACKET_9_0_2); - movsd(Address(rsp, 0), xmm0); - movsd(xmm0, Address(rsp, 112)); - fld_d(Address(rsp, 0)); - jmp(L_2TAG_PACKET_10_0_2); - - bind(L_2TAG_PACKET_8_0_2); - xorpd(xmm1, xmm1); - xorpd(xmm0, xmm0); - movl(eax, 49136); - pinsrw(xmm0, eax, 3); - divsd(xmm0, xmm1); - movl(edx, 2); - jmp(L_2TAG_PACKET_9_0_2); - - bind(L_2TAG_PACKET_4_0_2); - movdl(edx, xmm1); - psrlq(xmm1, 32); - movdl(ecx, xmm1); - orl(edx, ecx); - cmpl(edx, 0); - jcc(Assembler::equal, L_2TAG_PACKET_8_0_2); - xorpd(xmm1, xmm1); - movl(eax, 18416); - pinsrw(xmm1, eax, 3); - mulsd(xmm0, xmm1); - movapd(xmm1, xmm0); - pextrw(eax, xmm0, 3); - por(xmm0, xmm2); - psllq(xmm0, 5); - movl(ecx, 18416); - psrlq(xmm0, 34); - rcpss(xmm0, xmm0); - psllq(xmm1, 12); - pshufd(xmm6, xmm5, 228); - psrlq(xmm1, 12); - jmp(L_2TAG_PACKET_1_0_2); - - bind(L_2TAG_PACKET_2_0_2); - movsd(Address(rsp, 24), xmm0); - fld_d(Address(rsp, 24)); - - bind(L_2TAG_PACKET_10_0_2); - movl(tmp, Address(rsp, 40)); -} - -#endif // !_LP64 - /******************************************************************************/ // ALGORITHM DESCRIPTION - POW() // --------------------- @@ -1351,7 +788,6 @@ void MacroAssembler::fast_log(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm // /******************************************************************************/ -#ifdef _LP64 ALIGNED_(16) juint _HIGHSIGMASK[] = { 0x00000000UL, 0xfffff800UL, 0x00000000UL, 0xfffff800UL @@ -3109,1749 +2545,1401 @@ void MacroAssembler::fast_pow(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm bind(B1_5); addq(rsp, 40); } -#endif // _LP64 -#ifndef _LP64 +/******************************************************************************/ +// ALGORITHM DESCRIPTION - SIN() +// --------------------- +// +// 1. RANGE REDUCTION +// +// We perform an initial range reduction from X to r with +// +// X =~= N * pi/32 + r +// +// so that |r| <= pi/64 + epsilon. We restrict inputs to those +// where |N| <= 932560. Beyond this, the range reduction is +// insufficiently accurate. For extremely small inputs, +// denormalization can occur internally, impacting performance. +// This means that the main path is actually only taken for +// 2^-252 <= |X| < 90112. +// +// To avoid branches, we perform the range reduction to full +// accuracy each time. +// +// X - N * (P_1 + P_2 + P_3) +// +// where P_1 and P_2 are 32-bit numbers (so multiplication by N +// is exact) and P_3 is a 53-bit number. Together, these +// approximate pi well enough for all cases in the restricted +// range. +// +// The main reduction sequence is: +// +// y = 32/pi * x +// N = integer(y) +// (computed by adding and subtracting off SHIFTER) +// +// m_1 = N * P_1 +// m_2 = N * P_2 +// r_1 = x - m_1 +// r = r_1 - m_2 +// (this r can be used for most of the calculation) +// +// c_1 = r_1 - r +// m_3 = N * P_3 +// c_2 = c_1 - m_2 +// c = c_2 - m_3 +// +// 2. MAIN ALGORITHM +// +// The algorithm uses a table lookup based on B = M * pi / 32 +// where M = N mod 64. The stored values are: +// sigma closest power of 2 to cos(B) +// C_hl 53-bit cos(B) - sigma +// S_hi + S_lo 2 * 53-bit sin(B) +// +// The computation is organized as follows: +// +// sin(B + r + c) = [sin(B) + sigma * r] + +// r * (cos(B) - sigma) + +// sin(B) * [cos(r + c) - 1] + +// cos(B) * [sin(r + c) - r] +// +// which is approximately: +// +// [S_hi + sigma * r] + +// C_hl * r + +// S_lo + S_hi * [(cos(r) - 1) - r * c] + +// (C_hl + sigma) * [(sin(r) - r) + c] +// +// and this is what is actually computed. We separate this sum +// into four parts: +// +// hi + med + pols + corr +// +// where +// +// hi = S_hi + sigma r +// med = C_hl * r +// pols = S_hi * (cos(r) - 1) + (C_hl + sigma) * (sin(r) - r) +// corr = S_lo + c * ((C_hl + sigma) - S_hi * r) +// +// 3. POLYNOMIAL +// +// The polynomial S_hi * (cos(r) - 1) + (C_hl + sigma) * +// (sin(r) - r) can be rearranged freely, since it is quite +// small, so we exploit parallelism to the fullest. +// +// psc4 = SC_4 * r_1 +// msc4 = psc4 * r +// r2 = r * r +// msc2 = SC_2 * r2 +// r4 = r2 * r2 +// psc3 = SC_3 + msc4 +// psc1 = SC_1 + msc2 +// msc3 = r4 * psc3 +// sincospols = psc1 + msc3 +// pols = sincospols * +// +// +// 4. CORRECTION TERM +// +// This is where the "c" component of the range reduction is +// taken into account; recall that just "r" is used for most of +// the calculation. +// +// -c = m_3 - c_2 +// -d = S_hi * r - (C_hl + sigma) +// corr = -c * -d + S_lo +// +// 5. COMPENSATED SUMMATIONS +// +// The two successive compensated summations add up the high +// and medium parts, leaving just the low parts to add up at +// the end. +// +// rs = sigma * r +// res_int = S_hi + rs +// k_0 = S_hi - res_int +// k_2 = k_0 + rs +// med = C_hl * r +// res_hi = res_int + med +// k_1 = res_int - res_hi +// k_3 = k_1 + med +// +// 6. FINAL SUMMATION +// +// We now add up all the small parts: +// +// res_lo = pols(hi) + pols(lo) + corr + k_1 + k_3 +// +// Now the overall result is just: +// +// res_hi + res_lo +// +// 7. SMALL ARGUMENTS +// +// If |x| < SNN (SNN meaning the smallest normal number), we +// simply perform 0.1111111 cdots 1111 * x. For SNN <= |x|, we +// do 2^-55 * (2^55 * x - x). +// +// Special cases: +// sin(NaN) = quiet NaN, and raise invalid exception +// sin(INF) = NaN and raise invalid exception +// sin(+/-0) = +/-0 +// +/******************************************************************************/ -ALIGNED_(16) juint _static_const_table_pow[] = +ALIGNED_(16) juint _ONEHALF[] = { - 0x00000000UL, 0xbfd61a00UL, 0x00000000UL, 0xbf5dabe1UL, 0xf8000000UL, - 0xffffffffUL, 0x00000000UL, 0xfffff800UL, 0x00000000UL, 0x3ff00000UL, - 0x00000000UL, 0x00000000UL, 0x20000000UL, 0x3feff00aUL, 0x96621f95UL, - 0x3e5b1856UL, 0xe0000000UL, 0x3fefe019UL, 0xe5916f9eUL, 0xbe325278UL, - 0x00000000UL, 0x3fefd02fUL, 0x859a1062UL, 0x3e595fb7UL, 0xc0000000UL, - 0x3fefc049UL, 0xb245f18fUL, 0xbe529c38UL, 0xe0000000UL, 0x3fefb069UL, - 0xad2880a7UL, 0xbe501230UL, 0x60000000UL, 0x3fefa08fUL, 0xc8e72420UL, - 0x3e597bd1UL, 0x80000000UL, 0x3fef90baUL, 0xc30c4500UL, 0xbe5d6c75UL, - 0xe0000000UL, 0x3fef80eaUL, 0x02c63f43UL, 0x3e2e1318UL, 0xc0000000UL, - 0x3fef7120UL, 0xb3d4ccccUL, 0xbe44c52aUL, 0x00000000UL, 0x3fef615cUL, - 0xdbd91397UL, 0xbe4e7d6cUL, 0xa0000000UL, 0x3fef519cUL, 0x65c5cd68UL, - 0xbe522dc8UL, 0xa0000000UL, 0x3fef41e2UL, 0x46d1306cUL, 0xbe5a840eUL, - 0xe0000000UL, 0x3fef322dUL, 0xd2980e94UL, 0x3e5071afUL, 0xa0000000UL, - 0x3fef227eUL, 0x773abadeUL, 0xbe5891e5UL, 0xa0000000UL, 0x3fef12d4UL, - 0xdc6bf46bUL, 0xbe5cccbeUL, 0xe0000000UL, 0x3fef032fUL, 0xbc7247faUL, - 0xbe2bab83UL, 0x80000000UL, 0x3feef390UL, 0xbcaa1e46UL, 0xbe53bb3bUL, - 0x60000000UL, 0x3feee3f6UL, 0x5f6c682dUL, 0xbe54c619UL, 0x80000000UL, - 0x3feed461UL, 0x5141e368UL, 0xbe4b6d86UL, 0xe0000000UL, 0x3feec4d1UL, - 0xec678f76UL, 0xbe369af6UL, 0x80000000UL, 0x3feeb547UL, 0x41301f55UL, - 0xbe2d4312UL, 0x60000000UL, 0x3feea5c2UL, 0x676da6bdUL, 0xbe4d8dd0UL, - 0x60000000UL, 0x3fee9642UL, 0x57a891c4UL, 0x3e51f991UL, 0xa0000000UL, - 0x3fee86c7UL, 0xe4eb491eUL, 0x3e579bf9UL, 0x20000000UL, 0x3fee7752UL, - 0xfddc4a2cUL, 0xbe3356e6UL, 0xc0000000UL, 0x3fee67e1UL, 0xd75b5bf1UL, - 0xbe449531UL, 0x80000000UL, 0x3fee5876UL, 0xbd423b8eUL, 0x3df54fe4UL, - 0x60000000UL, 0x3fee4910UL, 0x330e51b9UL, 0x3e54289cUL, 0x80000000UL, - 0x3fee39afUL, 0x8651a95fUL, 0xbe55aad6UL, 0xa0000000UL, 0x3fee2a53UL, - 0x5e98c708UL, 0xbe2fc4a9UL, 0xe0000000UL, 0x3fee1afcUL, 0x0989328dUL, - 0x3e23958cUL, 0x40000000UL, 0x3fee0babUL, 0xee642abdUL, 0xbe425dd8UL, - 0xa0000000UL, 0x3fedfc5eUL, 0xc394d236UL, 0x3e526362UL, 0x20000000UL, - 0x3feded17UL, 0xe104aa8eUL, 0x3e4ce247UL, 0xc0000000UL, 0x3fedddd4UL, - 0x265a9be4UL, 0xbe5bb77aUL, 0x40000000UL, 0x3fedce97UL, 0x0ecac52fUL, - 0x3e4a7cb1UL, 0xe0000000UL, 0x3fedbf5eUL, 0x124cb3b8UL, 0x3e257024UL, - 0x80000000UL, 0x3fedb02bUL, 0xe6d4febeUL, 0xbe2033eeUL, 0x20000000UL, - 0x3feda0fdUL, 0x39cca00eUL, 0xbe3ddabcUL, 0xc0000000UL, 0x3fed91d3UL, - 0xef8a552aUL, 0xbe543390UL, 0x40000000UL, 0x3fed82afUL, 0xb8e85204UL, - 0x3e513850UL, 0xe0000000UL, 0x3fed738fUL, 0x3d59fe08UL, 0xbe5db728UL, - 0x40000000UL, 0x3fed6475UL, 0x3aa7ead1UL, 0x3e58804bUL, 0xc0000000UL, - 0x3fed555fUL, 0xf8a35ba9UL, 0xbe5298b0UL, 0x00000000UL, 0x3fed464fUL, - 0x9a88dd15UL, 0x3e5a8cdbUL, 0x40000000UL, 0x3fed3743UL, 0xb0b0a190UL, - 0x3e598635UL, 0x80000000UL, 0x3fed283cUL, 0xe2113295UL, 0xbe5c1119UL, - 0x80000000UL, 0x3fed193aUL, 0xafbf1728UL, 0xbe492e9cUL, 0x60000000UL, - 0x3fed0a3dUL, 0xe4a4ccf3UL, 0x3e19b90eUL, 0x20000000UL, 0x3fecfb45UL, - 0xba3cbeb8UL, 0x3e406b50UL, 0xc0000000UL, 0x3fecec51UL, 0x110f7dddUL, - 0x3e0d6806UL, 0x40000000UL, 0x3fecdd63UL, 0x7dd7d508UL, 0xbe5a8943UL, - 0x80000000UL, 0x3fecce79UL, 0x9b60f271UL, 0xbe50676aUL, 0x80000000UL, - 0x3fecbf94UL, 0x0b9ad660UL, 0x3e59174fUL, 0x60000000UL, 0x3fecb0b4UL, - 0x00823d9cUL, 0x3e5bbf72UL, 0x20000000UL, 0x3feca1d9UL, 0x38a6ec89UL, - 0xbe4d38f9UL, 0x80000000UL, 0x3fec9302UL, 0x3a0b7d8eUL, 0x3e53dbfdUL, - 0xc0000000UL, 0x3fec8430UL, 0xc6826b34UL, 0xbe27c5c9UL, 0xc0000000UL, - 0x3fec7563UL, 0x0c706381UL, 0xbe593653UL, 0x60000000UL, 0x3fec669bUL, - 0x7df34ec7UL, 0x3e461ab5UL, 0xe0000000UL, 0x3fec57d7UL, 0x40e5e7e8UL, - 0xbe5c3daeUL, 0x00000000UL, 0x3fec4919UL, 0x5602770fUL, 0xbe55219dUL, - 0xc0000000UL, 0x3fec3a5eUL, 0xec7911ebUL, 0x3e5a5d25UL, 0x60000000UL, - 0x3fec2ba9UL, 0xb39ea225UL, 0xbe53c00bUL, 0x80000000UL, 0x3fec1cf8UL, - 0x967a212eUL, 0x3e5a8ddfUL, 0x60000000UL, 0x3fec0e4cUL, 0x580798bdUL, - 0x3e5f53abUL, 0x00000000UL, 0x3febffa5UL, 0xb8282df6UL, 0xbe46b874UL, - 0x20000000UL, 0x3febf102UL, 0xe33a6729UL, 0x3e54963fUL, 0x00000000UL, - 0x3febe264UL, 0x3b53e88aUL, 0xbe3adce1UL, 0x60000000UL, 0x3febd3caUL, - 0xc2585084UL, 0x3e5cde9fUL, 0x80000000UL, 0x3febc535UL, 0xa335c5eeUL, - 0xbe39fd9cUL, 0x20000000UL, 0x3febb6a5UL, 0x7325b04dUL, 0x3e42ba15UL, - 0x60000000UL, 0x3feba819UL, 0x1564540fUL, 0x3e3a9f35UL, 0x40000000UL, - 0x3feb9992UL, 0x83fff592UL, 0xbe5465ceUL, 0xa0000000UL, 0x3feb8b0fUL, - 0xb9da63d3UL, 0xbe4b1a0aUL, 0x80000000UL, 0x3feb7c91UL, 0x6d6f1ea4UL, - 0x3e557657UL, 0x00000000UL, 0x3feb6e18UL, 0x5e80a1bfUL, 0x3e4ddbb6UL, - 0x00000000UL, 0x3feb5fa3UL, 0x1c9eacb5UL, 0x3e592877UL, 0xa0000000UL, - 0x3feb5132UL, 0x6d40beb3UL, 0xbe51858cUL, 0xa0000000UL, 0x3feb42c6UL, - 0xd740c67bUL, 0x3e427ad2UL, 0x40000000UL, 0x3feb345fUL, 0xa3e0cceeUL, - 0xbe5c2fc4UL, 0x40000000UL, 0x3feb25fcUL, 0x8e752b50UL, 0xbe3da3c2UL, - 0xc0000000UL, 0x3feb179dUL, 0xa892e7deUL, 0x3e1fb481UL, 0xc0000000UL, - 0x3feb0943UL, 0x21ed71e9UL, 0xbe365206UL, 0x20000000UL, 0x3feafaeeUL, - 0x0e1380a3UL, 0x3e5c5b7bUL, 0x20000000UL, 0x3feaec9dUL, 0x3c3d640eUL, - 0xbe5dbbd0UL, 0x60000000UL, 0x3feade50UL, 0x8f97a715UL, 0x3e3a8ec5UL, - 0x20000000UL, 0x3fead008UL, 0x23ab2839UL, 0x3e2fe98aUL, 0x40000000UL, - 0x3feac1c4UL, 0xf4bbd50fUL, 0x3e54d8f6UL, 0xe0000000UL, 0x3feab384UL, - 0x14757c4dUL, 0xbe48774cUL, 0xc0000000UL, 0x3feaa549UL, 0x7c7b0eeaUL, - 0x3e5b51bbUL, 0x20000000UL, 0x3fea9713UL, 0xf56f7013UL, 0x3e386200UL, - 0xe0000000UL, 0x3fea88e0UL, 0xbe428ebeUL, 0xbe514af5UL, 0xe0000000UL, - 0x3fea7ab2UL, 0x8d0e4496UL, 0x3e4f9165UL, 0x60000000UL, 0x3fea6c89UL, - 0xdbacc5d5UL, 0xbe5c063bUL, 0x20000000UL, 0x3fea5e64UL, 0x3f19d970UL, - 0xbe5a0c8cUL, 0x20000000UL, 0x3fea5043UL, 0x09ea3e6bUL, 0x3e5065dcUL, - 0x80000000UL, 0x3fea4226UL, 0x78df246cUL, 0x3e5e05f6UL, 0x40000000UL, - 0x3fea340eUL, 0x4057d4a0UL, 0x3e431b2bUL, 0x40000000UL, 0x3fea25faUL, - 0x82867bb5UL, 0x3e4b76beUL, 0xa0000000UL, 0x3fea17eaUL, 0x9436f40aUL, - 0xbe5aad39UL, 0x20000000UL, 0x3fea09dfUL, 0x4b5253b3UL, 0x3e46380bUL, - 0x00000000UL, 0x3fe9fbd8UL, 0x8fc52466UL, 0xbe386f9bUL, 0x20000000UL, - 0x3fe9edd5UL, 0x22d3f344UL, 0xbe538347UL, 0x60000000UL, 0x3fe9dfd6UL, - 0x1ac33522UL, 0x3e5dbc53UL, 0x00000000UL, 0x3fe9d1dcUL, 0xeabdff1dUL, - 0x3e40fc0cUL, 0xe0000000UL, 0x3fe9c3e5UL, 0xafd30e73UL, 0xbe585e63UL, - 0xe0000000UL, 0x3fe9b5f3UL, 0xa52f226aUL, 0xbe43e8f9UL, 0x20000000UL, - 0x3fe9a806UL, 0xecb8698dUL, 0xbe515b36UL, 0x80000000UL, 0x3fe99a1cUL, - 0xf2b4e89dUL, 0x3e48b62bUL, 0x20000000UL, 0x3fe98c37UL, 0x7c9a88fbUL, - 0x3e44414cUL, 0x00000000UL, 0x3fe97e56UL, 0xda015741UL, 0xbe5d13baUL, - 0xe0000000UL, 0x3fe97078UL, 0x5fdace06UL, 0x3e51b947UL, 0x00000000UL, - 0x3fe962a0UL, 0x956ca094UL, 0x3e518785UL, 0x40000000UL, 0x3fe954cbUL, - 0x01164c1dUL, 0x3e5d5b57UL, 0xc0000000UL, 0x3fe946faUL, 0xe63b3767UL, - 0xbe4f84e7UL, 0x40000000UL, 0x3fe9392eUL, 0xe57cc2a9UL, 0x3e34eda3UL, - 0xe0000000UL, 0x3fe92b65UL, 0x8c75b544UL, 0x3e5766a0UL, 0xc0000000UL, - 0x3fe91da1UL, 0x37d1d087UL, 0xbe5e2ab1UL, 0x80000000UL, 0x3fe90fe1UL, - 0xa953dc20UL, 0x3e5fa1f3UL, 0x80000000UL, 0x3fe90225UL, 0xdbd3f369UL, - 0x3e47d6dbUL, 0xa0000000UL, 0x3fe8f46dUL, 0x1c9be989UL, 0xbe5e2b0aUL, - 0xa0000000UL, 0x3fe8e6b9UL, 0x3c93d76aUL, 0x3e5c8618UL, 0xe0000000UL, - 0x3fe8d909UL, 0x2182fc9aUL, 0xbe41aa9eUL, 0x20000000UL, 0x3fe8cb5eUL, - 0xe6b3539dUL, 0xbe530d19UL, 0x60000000UL, 0x3fe8bdb6UL, 0x49e58cc3UL, - 0xbe3bb374UL, 0xa0000000UL, 0x3fe8b012UL, 0xa7cfeb8fUL, 0x3e56c412UL, - 0x00000000UL, 0x3fe8a273UL, 0x8d52bc19UL, 0x3e1429b8UL, 0x60000000UL, - 0x3fe894d7UL, 0x4dc32c6cUL, 0xbe48604cUL, 0xc0000000UL, 0x3fe8873fUL, - 0x0c868e56UL, 0xbe564ee5UL, 0x00000000UL, 0x3fe879acUL, 0x56aee828UL, - 0x3e5e2fd8UL, 0x60000000UL, 0x3fe86c1cUL, 0x7ceab8ecUL, 0x3e493365UL, - 0xc0000000UL, 0x3fe85e90UL, 0x78d4dadcUL, 0xbe4f7f25UL, 0x00000000UL, - 0x3fe85109UL, 0x0ccd8280UL, 0x3e31e7a2UL, 0x40000000UL, 0x3fe84385UL, - 0x34ba4e15UL, 0x3e328077UL, 0x80000000UL, 0x3fe83605UL, 0xa670975aUL, - 0xbe53eee5UL, 0xa0000000UL, 0x3fe82889UL, 0xf61b77b2UL, 0xbe43a20aUL, - 0xa0000000UL, 0x3fe81b11UL, 0x13e6643bUL, 0x3e5e5fe5UL, 0xc0000000UL, - 0x3fe80d9dUL, 0x82cc94e8UL, 0xbe5ff1f9UL, 0xa0000000UL, 0x3fe8002dUL, - 0x8a0c9c5dUL, 0xbe42b0e7UL, 0x60000000UL, 0x3fe7f2c1UL, 0x22a16f01UL, - 0x3e5d9ea0UL, 0x20000000UL, 0x3fe7e559UL, 0xc38cd451UL, 0x3e506963UL, - 0xc0000000UL, 0x3fe7d7f4UL, 0x9902bc71UL, 0x3e4503d7UL, 0x40000000UL, - 0x3fe7ca94UL, 0xdef2a3c0UL, 0x3e3d98edUL, 0xa0000000UL, 0x3fe7bd37UL, - 0xed49abb0UL, 0x3e24c1ffUL, 0xe0000000UL, 0x3fe7afdeUL, 0xe3b0be70UL, - 0xbe40c467UL, 0x00000000UL, 0x3fe7a28aUL, 0xaf9f193cUL, 0xbe5dff6cUL, - 0xe0000000UL, 0x3fe79538UL, 0xb74cf6b6UL, 0xbe258ed0UL, 0xa0000000UL, - 0x3fe787ebUL, 0x1d9127c7UL, 0x3e345fb0UL, 0x40000000UL, 0x3fe77aa2UL, - 0x1028c21dUL, 0xbe4619bdUL, 0xa0000000UL, 0x3fe76d5cUL, 0x7cb0b5e4UL, - 0x3e40f1a2UL, 0xe0000000UL, 0x3fe7601aUL, 0x2b1bc4adUL, 0xbe32e8bbUL, - 0xe0000000UL, 0x3fe752dcUL, 0x6839f64eUL, 0x3e41f57bUL, 0xc0000000UL, - 0x3fe745a2UL, 0xc4121f7eUL, 0xbe52c40aUL, 0x60000000UL, 0x3fe7386cUL, - 0xd6852d72UL, 0xbe5c4e6bUL, 0xc0000000UL, 0x3fe72b39UL, 0x91d690f7UL, - 0xbe57f88fUL, 0xe0000000UL, 0x3fe71e0aUL, 0x627a2159UL, 0xbe4425d5UL, - 0xc0000000UL, 0x3fe710dfUL, 0x50a54033UL, 0x3e422b7eUL, 0x60000000UL, - 0x3fe703b8UL, 0x3b0b5f91UL, 0x3e5d3857UL, 0xe0000000UL, 0x3fe6f694UL, - 0x84d628a2UL, 0xbe51f090UL, 0x00000000UL, 0x3fe6e975UL, 0x306d8894UL, - 0xbe414d83UL, 0xe0000000UL, 0x3fe6dc58UL, 0x30bf24aaUL, 0xbe4650caUL, - 0x80000000UL, 0x3fe6cf40UL, 0xd4628d69UL, 0xbe5db007UL, 0xc0000000UL, - 0x3fe6c22bUL, 0xa2aae57bUL, 0xbe31d279UL, 0xc0000000UL, 0x3fe6b51aUL, - 0x860edf7eUL, 0xbe2d4c4aUL, 0x80000000UL, 0x3fe6a80dUL, 0xf3559341UL, - 0xbe5f7e98UL, 0xe0000000UL, 0x3fe69b03UL, 0xa885899eUL, 0xbe5c2011UL, - 0xe0000000UL, 0x3fe68dfdUL, 0x2bdc6d37UL, 0x3e224a82UL, 0xa0000000UL, - 0x3fe680fbUL, 0xc12ad1b9UL, 0xbe40cf56UL, 0x00000000UL, 0x3fe673fdUL, - 0x1bcdf659UL, 0xbdf52f2dUL, 0x00000000UL, 0x3fe66702UL, 0x5df10408UL, - 0x3e5663e0UL, 0xc0000000UL, 0x3fe65a0aUL, 0xa4070568UL, 0xbe40b12fUL, - 0x00000000UL, 0x3fe64d17UL, 0x71c54c47UL, 0x3e5f5e8bUL, 0x00000000UL, - 0x3fe64027UL, 0xbd4b7e83UL, 0x3e42ead6UL, 0xa0000000UL, 0x3fe6333aUL, - 0x61598bd2UL, 0xbe4c48d4UL, 0xc0000000UL, 0x3fe62651UL, 0x6f538d61UL, - 0x3e548401UL, 0xa0000000UL, 0x3fe6196cUL, 0x14344120UL, 0xbe529af6UL, - 0x00000000UL, 0x3fe60c8bUL, 0x5982c587UL, 0xbe3e1e4fUL, 0x00000000UL, - 0x3fe5ffadUL, 0xfe51d4eaUL, 0xbe4c897aUL, 0x80000000UL, 0x3fe5f2d2UL, - 0xfd46ebe1UL, 0x3e552e00UL, 0xa0000000UL, 0x3fe5e5fbUL, 0xa4695699UL, - 0x3e5ed471UL, 0x60000000UL, 0x3fe5d928UL, 0x80d118aeUL, 0x3e456b61UL, - 0xa0000000UL, 0x3fe5cc58UL, 0x304c330bUL, 0x3e54dc29UL, 0x80000000UL, - 0x3fe5bf8cUL, 0x0af2dedfUL, 0xbe3aa9bdUL, 0xe0000000UL, 0x3fe5b2c3UL, - 0x15fc9258UL, 0xbe479a37UL, 0xc0000000UL, 0x3fe5a5feUL, 0x9292c7eaUL, - 0x3e188650UL, 0x20000000UL, 0x3fe5993dUL, 0x33b4d380UL, 0x3e5d6d93UL, - 0x20000000UL, 0x3fe58c7fUL, 0x02fd16c7UL, 0x3e2fe961UL, 0xa0000000UL, - 0x3fe57fc4UL, 0x4a05edb6UL, 0xbe4d55b4UL, 0xa0000000UL, 0x3fe5730dUL, - 0x3d443abbUL, 0xbe5e6954UL, 0x00000000UL, 0x3fe5665aUL, 0x024acfeaUL, - 0x3e50e61bUL, 0x00000000UL, 0x3fe559aaUL, 0xcc9edd09UL, 0xbe325403UL, - 0x60000000UL, 0x3fe54cfdUL, 0x1fe26950UL, 0x3e5d500eUL, 0x60000000UL, - 0x3fe54054UL, 0x6c5ae164UL, 0xbe4a79b4UL, 0xc0000000UL, 0x3fe533aeUL, - 0x154b0287UL, 0xbe401571UL, 0xa0000000UL, 0x3fe5270cUL, 0x0673f401UL, - 0xbe56e56bUL, 0xe0000000UL, 0x3fe51a6dUL, 0x751b639cUL, 0x3e235269UL, - 0xa0000000UL, 0x3fe50dd2UL, 0x7c7b2bedUL, 0x3ddec887UL, 0xc0000000UL, - 0x3fe5013aUL, 0xafab4e17UL, 0x3e5e7575UL, 0x60000000UL, 0x3fe4f4a6UL, - 0x2e308668UL, 0x3e59aed6UL, 0x80000000UL, 0x3fe4e815UL, 0xf33e2a76UL, - 0xbe51f184UL, 0xe0000000UL, 0x3fe4db87UL, 0x839f3e3eUL, 0x3e57db01UL, - 0xc0000000UL, 0x3fe4cefdUL, 0xa9eda7bbUL, 0x3e535e0fUL, 0x00000000UL, - 0x3fe4c277UL, 0x2a8f66a5UL, 0x3e5ce451UL, 0xc0000000UL, 0x3fe4b5f3UL, - 0x05192456UL, 0xbe4e8518UL, 0xc0000000UL, 0x3fe4a973UL, 0x4aa7cd1dUL, - 0x3e46784aUL, 0x40000000UL, 0x3fe49cf7UL, 0x8e23025eUL, 0xbe5749f2UL, - 0x00000000UL, 0x3fe4907eUL, 0x18d30215UL, 0x3e360f39UL, 0x20000000UL, - 0x3fe48408UL, 0x63dcf2f3UL, 0x3e5e00feUL, 0xc0000000UL, 0x3fe47795UL, - 0x46182d09UL, 0xbe5173d9UL, 0xa0000000UL, 0x3fe46b26UL, 0x8f0e62aaUL, - 0xbe48f281UL, 0xe0000000UL, 0x3fe45ebaUL, 0x5775c40cUL, 0xbe56aad4UL, - 0x60000000UL, 0x3fe45252UL, 0x0fe25f69UL, 0x3e48bd71UL, 0x40000000UL, - 0x3fe445edUL, 0xe9989ec5UL, 0x3e590d97UL, 0x80000000UL, 0x3fe4398bUL, - 0xb3d9ffe3UL, 0x3e479dbcUL, 0x20000000UL, 0x3fe42d2dUL, 0x388e4d2eUL, - 0xbe5eed80UL, 0xe0000000UL, 0x3fe420d1UL, 0x6f797c18UL, 0x3e554b4cUL, - 0x20000000UL, 0x3fe4147aUL, 0x31048bb4UL, 0xbe5b1112UL, 0x80000000UL, - 0x3fe40825UL, 0x2efba4f9UL, 0x3e48ebc7UL, 0x40000000UL, 0x3fe3fbd4UL, - 0x50201119UL, 0x3e40b701UL, 0x40000000UL, 0x3fe3ef86UL, 0x0a4db32cUL, - 0x3e551de8UL, 0xa0000000UL, 0x3fe3e33bUL, 0x0c9c148bUL, 0xbe50c1f6UL, - 0x20000000UL, 0x3fe3d6f4UL, 0xc9129447UL, 0x3e533fa0UL, 0x00000000UL, - 0x3fe3cab0UL, 0xaae5b5a0UL, 0xbe22b68eUL, 0x20000000UL, 0x3fe3be6fUL, - 0x02305e8aUL, 0xbe54fc08UL, 0x60000000UL, 0x3fe3b231UL, 0x7f908258UL, - 0x3e57dc05UL, 0x00000000UL, 0x3fe3a5f7UL, 0x1a09af78UL, 0x3e08038bUL, - 0xe0000000UL, 0x3fe399bfUL, 0x490643c1UL, 0xbe5dbe42UL, 0xe0000000UL, - 0x3fe38d8bUL, 0x5e8ad724UL, 0xbe3c2b72UL, 0x20000000UL, 0x3fe3815bUL, - 0xc67196b6UL, 0x3e1713cfUL, 0xa0000000UL, 0x3fe3752dUL, 0x6182e429UL, - 0xbe3ec14cUL, 0x40000000UL, 0x3fe36903UL, 0xab6eb1aeUL, 0x3e5a2cc5UL, - 0x40000000UL, 0x3fe35cdcUL, 0xfe5dc064UL, 0xbe5c5878UL, 0x40000000UL, - 0x3fe350b8UL, 0x0ba6b9e4UL, 0x3e51619bUL, 0x80000000UL, 0x3fe34497UL, - 0x857761aaUL, 0x3e5fff53UL, 0x00000000UL, 0x3fe3387aUL, 0xf872d68cUL, - 0x3e484f4dUL, 0xa0000000UL, 0x3fe32c5fUL, 0x087e97c2UL, 0x3e52842eUL, - 0x80000000UL, 0x3fe32048UL, 0x73d6d0c0UL, 0xbe503edfUL, 0x80000000UL, - 0x3fe31434UL, 0x0c1456a1UL, 0xbe5f72adUL, 0xa0000000UL, 0x3fe30823UL, - 0x83a1a4d5UL, 0xbe5e65ccUL, 0xe0000000UL, 0x3fe2fc15UL, 0x855a7390UL, - 0xbe506438UL, 0x40000000UL, 0x3fe2f00bUL, 0xa2898287UL, 0x3e3d22a2UL, - 0xe0000000UL, 0x3fe2e403UL, 0x8b56f66fUL, 0xbe5aa5fdUL, 0x80000000UL, - 0x3fe2d7ffUL, 0x52db119aUL, 0x3e3a2e3dUL, 0x60000000UL, 0x3fe2cbfeUL, - 0xe2ddd4c0UL, 0xbe586469UL, 0x40000000UL, 0x3fe2c000UL, 0x6b01bf10UL, - 0x3e352b9dUL, 0x40000000UL, 0x3fe2b405UL, 0xb07a1cdfUL, 0x3e5c5cdaUL, - 0x80000000UL, 0x3fe2a80dUL, 0xc7b5f868UL, 0xbe5668b3UL, 0xc0000000UL, - 0x3fe29c18UL, 0x185edf62UL, 0xbe563d66UL, 0x00000000UL, 0x3fe29027UL, - 0xf729e1ccUL, 0x3e59a9a0UL, 0x80000000UL, 0x3fe28438UL, 0x6433c727UL, - 0xbe43cc89UL, 0x00000000UL, 0x3fe2784dUL, 0x41782631UL, 0xbe30750cUL, - 0xa0000000UL, 0x3fe26c64UL, 0x914911b7UL, 0xbe58290eUL, 0x40000000UL, - 0x3fe2607fUL, 0x3dcc73e1UL, 0xbe4269cdUL, 0x00000000UL, 0x3fe2549dUL, - 0x2751bf70UL, 0xbe5a6998UL, 0xc0000000UL, 0x3fe248bdUL, 0x4248b9fbUL, - 0xbe4ddb00UL, 0x80000000UL, 0x3fe23ce1UL, 0xf35cf82fUL, 0x3e561b71UL, - 0x60000000UL, 0x3fe23108UL, 0x8e481a2dUL, 0x3e518fb9UL, 0x60000000UL, - 0x3fe22532UL, 0x5ab96edcUL, 0xbe5fafc5UL, 0x40000000UL, 0x3fe2195fUL, - 0x80943911UL, 0xbe07f819UL, 0x40000000UL, 0x3fe20d8fUL, 0x386f2d6cUL, - 0xbe54ba8bUL, 0x40000000UL, 0x3fe201c2UL, 0xf29664acUL, 0xbe5eb815UL, - 0x20000000UL, 0x3fe1f5f8UL, 0x64f03390UL, 0x3e5e320cUL, 0x20000000UL, - 0x3fe1ea31UL, 0x747ff696UL, 0x3e5ef0a5UL, 0x40000000UL, 0x3fe1de6dUL, - 0x3e9ceb51UL, 0xbe5f8d27UL, 0x20000000UL, 0x3fe1d2acUL, 0x4ae0b55eUL, - 0x3e5faa21UL, 0x20000000UL, 0x3fe1c6eeUL, 0x28569a5eUL, 0x3e598a4fUL, - 0x20000000UL, 0x3fe1bb33UL, 0x54b33e07UL, 0x3e46130aUL, 0x20000000UL, - 0x3fe1af7bUL, 0x024f1078UL, 0xbe4dbf93UL, 0x00000000UL, 0x3fe1a3c6UL, - 0xb0783bfaUL, 0x3e419248UL, 0xe0000000UL, 0x3fe19813UL, 0x2f02b836UL, - 0x3e4e02b7UL, 0xc0000000UL, 0x3fe18c64UL, 0x28dec9d4UL, 0x3e09064fUL, - 0x80000000UL, 0x3fe180b8UL, 0x45cbf406UL, 0x3e5b1f46UL, 0x40000000UL, - 0x3fe1750fUL, 0x03d9964cUL, 0x3e5b0a79UL, 0x00000000UL, 0x3fe16969UL, - 0x8b5b882bUL, 0xbe238086UL, 0xa0000000UL, 0x3fe15dc5UL, 0x73bad6f8UL, - 0xbdf1fca4UL, 0x20000000UL, 0x3fe15225UL, 0x5385769cUL, 0x3e5e8d76UL, - 0xa0000000UL, 0x3fe14687UL, 0x1676dc6bUL, 0x3e571d08UL, 0x20000000UL, - 0x3fe13aedUL, 0xa8c41c7fUL, 0xbe598a25UL, 0x60000000UL, 0x3fe12f55UL, - 0xc4e1aaf0UL, 0x3e435277UL, 0xa0000000UL, 0x3fe123c0UL, 0x403638e1UL, - 0xbe21aa7cUL, 0xc0000000UL, 0x3fe1182eUL, 0x557a092bUL, 0xbdd0116bUL, - 0xc0000000UL, 0x3fe10c9fUL, 0x7d779f66UL, 0x3e4a61baUL, 0xc0000000UL, - 0x3fe10113UL, 0x2b09c645UL, 0xbe5d586eUL, 0x20000000UL, 0x3fe0ea04UL, - 0xea2cad46UL, 0x3e5aa97cUL, 0x20000000UL, 0x3fe0d300UL, 0x23190e54UL, - 0x3e50f1a7UL, 0xa0000000UL, 0x3fe0bc07UL, 0x1379a5a6UL, 0xbe51619dUL, - 0x60000000UL, 0x3fe0a51aUL, 0x926a3d4aUL, 0x3e5cf019UL, 0xa0000000UL, - 0x3fe08e38UL, 0xa8c24358UL, 0x3e35241eUL, 0x20000000UL, 0x3fe07762UL, - 0x24317e7aUL, 0x3e512cfaUL, 0x00000000UL, 0x3fe06097UL, 0xfd9cf274UL, - 0xbe55bef3UL, 0x00000000UL, 0x3fe049d7UL, 0x3689b49dUL, 0xbe36d26dUL, - 0x40000000UL, 0x3fe03322UL, 0xf72ef6c4UL, 0xbe54cd08UL, 0xa0000000UL, - 0x3fe01c78UL, 0x23702d2dUL, 0xbe5900bfUL, 0x00000000UL, 0x3fe005daUL, - 0x3f59c14cUL, 0x3e57d80bUL, 0x40000000UL, 0x3fdfde8dUL, 0xad67766dUL, - 0xbe57fad4UL, 0x40000000UL, 0x3fdfb17cUL, 0x644f4ae7UL, 0x3e1ee43bUL, - 0x40000000UL, 0x3fdf8481UL, 0x903234d2UL, 0x3e501a86UL, 0x40000000UL, - 0x3fdf579cUL, 0xafe9e509UL, 0xbe267c3eUL, 0x00000000UL, 0x3fdf2acdUL, - 0xb7dfda0bUL, 0xbe48149bUL, 0x40000000UL, 0x3fdefe13UL, 0x3b94305eUL, - 0x3e5f4ea7UL, 0x80000000UL, 0x3fded16fUL, 0x5d95da61UL, 0xbe55c198UL, - 0x00000000UL, 0x3fdea4e1UL, 0x406960c9UL, 0xbdd99a19UL, 0x00000000UL, - 0x3fde7868UL, 0xd22f3539UL, 0x3e470c78UL, 0x80000000UL, 0x3fde4c04UL, - 0x83eec535UL, 0xbe3e1232UL, 0x40000000UL, 0x3fde1fb6UL, 0x3dfbffcbUL, - 0xbe4b7d71UL, 0x40000000UL, 0x3fddf37dUL, 0x7e1be4e0UL, 0xbe5b8f8fUL, - 0x40000000UL, 0x3fddc759UL, 0x46dae887UL, 0xbe350458UL, 0x80000000UL, - 0x3fdd9b4aUL, 0xed6ecc49UL, 0xbe5f0045UL, 0x80000000UL, 0x3fdd6f50UL, - 0x2e9e883cUL, 0x3e2915daUL, 0x80000000UL, 0x3fdd436bUL, 0xf0bccb32UL, - 0x3e4a68c9UL, 0x80000000UL, 0x3fdd179bUL, 0x9bbfc779UL, 0xbe54a26aUL, - 0x00000000UL, 0x3fdcebe0UL, 0x7cea33abUL, 0x3e43c6b7UL, 0x40000000UL, - 0x3fdcc039UL, 0xe740fd06UL, 0x3e5526c2UL, 0x40000000UL, 0x3fdc94a7UL, - 0x9eadeb1aUL, 0xbe396d8dUL, 0xc0000000UL, 0x3fdc6929UL, 0xf0a8f95aUL, - 0xbe5c0ab2UL, 0x80000000UL, 0x3fdc3dc0UL, 0x6ee2693bUL, 0x3e0992e6UL, - 0xc0000000UL, 0x3fdc126bUL, 0x5ac6b581UL, 0xbe2834b6UL, 0x40000000UL, - 0x3fdbe72bUL, 0x8cc226ffUL, 0x3e3596a6UL, 0x00000000UL, 0x3fdbbbffUL, - 0xf92a74bbUL, 0x3e3c5813UL, 0x00000000UL, 0x3fdb90e7UL, 0x479664c0UL, - 0xbe50d644UL, 0x00000000UL, 0x3fdb65e3UL, 0x5004975bUL, 0xbe55258fUL, - 0x00000000UL, 0x3fdb3af3UL, 0xe4b23194UL, 0xbe588407UL, 0xc0000000UL, - 0x3fdb1016UL, 0xe65d4d0aUL, 0x3e527c26UL, 0x80000000UL, 0x3fdae54eUL, - 0x814fddd6UL, 0x3e5962a2UL, 0x40000000UL, 0x3fdaba9aUL, 0xe19d0913UL, - 0xbe562f4eUL, 0x80000000UL, 0x3fda8ff9UL, 0x43cfd006UL, 0xbe4cfdebUL, - 0x40000000UL, 0x3fda656cUL, 0x686f0a4eUL, 0x3e5e47a8UL, 0xc0000000UL, - 0x3fda3af2UL, 0x7200d410UL, 0x3e5e1199UL, 0xc0000000UL, 0x3fda108cUL, - 0xabd2266eUL, 0x3e5ee4d1UL, 0x40000000UL, 0x3fd9e63aUL, 0x396f8f2cUL, - 0x3e4dbffbUL, 0x00000000UL, 0x3fd9bbfbUL, 0xe32b25ddUL, 0x3e5c3a54UL, - 0x40000000UL, 0x3fd991cfUL, 0x431e4035UL, 0xbe457925UL, 0x80000000UL, - 0x3fd967b6UL, 0x7bed3dd3UL, 0x3e40c61dUL, 0x00000000UL, 0x3fd93db1UL, - 0xd7449365UL, 0x3e306419UL, 0x80000000UL, 0x3fd913beUL, 0x1746e791UL, - 0x3e56fcfcUL, 0x40000000UL, 0x3fd8e9dfUL, 0xf3a9028bUL, 0xbe5041b9UL, - 0xc0000000UL, 0x3fd8c012UL, 0x56840c50UL, 0xbe26e20aUL, 0x40000000UL, - 0x3fd89659UL, 0x19763102UL, 0xbe51f466UL, 0x80000000UL, 0x3fd86cb2UL, - 0x7032de7cUL, 0xbe4d298aUL, 0x80000000UL, 0x3fd8431eUL, 0xdeb39fabUL, - 0xbe4361ebUL, 0x40000000UL, 0x3fd8199dUL, 0x5d01cbe0UL, 0xbe5425b3UL, - 0x80000000UL, 0x3fd7f02eUL, 0x3ce99aa9UL, 0x3e146fa8UL, 0x80000000UL, - 0x3fd7c6d2UL, 0xd1a262b9UL, 0xbe5a1a69UL, 0xc0000000UL, 0x3fd79d88UL, - 0x8606c236UL, 0x3e423a08UL, 0x80000000UL, 0x3fd77451UL, 0x8fd1e1b7UL, - 0x3e5a6a63UL, 0xc0000000UL, 0x3fd74b2cUL, 0xe491456aUL, 0x3e42c1caUL, - 0x40000000UL, 0x3fd7221aUL, 0x4499a6d7UL, 0x3e36a69aUL, 0x00000000UL, - 0x3fd6f91aUL, 0x5237df94UL, 0xbe0f8f02UL, 0x00000000UL, 0x3fd6d02cUL, - 0xb6482c6eUL, 0xbe5abcf7UL, 0x00000000UL, 0x3fd6a750UL, 0x1919fd61UL, - 0xbe57ade2UL, 0x00000000UL, 0x3fd67e86UL, 0xaa7a994dUL, 0xbe3f3fbdUL, - 0x00000000UL, 0x3fd655ceUL, 0x67db014cUL, 0x3e33c550UL, 0x00000000UL, - 0x3fd62d28UL, 0xa82856b7UL, 0xbe1409d1UL, 0xc0000000UL, 0x3fd60493UL, - 0x1e6a300dUL, 0x3e55d899UL, 0x80000000UL, 0x3fd5dc11UL, 0x1222bd5cUL, - 0xbe35bfc0UL, 0xc0000000UL, 0x3fd5b3a0UL, 0x6e8dc2d3UL, 0x3e5d4d79UL, - 0x00000000UL, 0x3fd58b42UL, 0xe0e4ace6UL, 0xbe517303UL, 0x80000000UL, - 0x3fd562f4UL, 0xb306e0a8UL, 0x3e5edf0fUL, 0xc0000000UL, 0x3fd53ab8UL, - 0x6574bc54UL, 0x3e5ee859UL, 0x80000000UL, 0x3fd5128eUL, 0xea902207UL, - 0x3e5f6188UL, 0xc0000000UL, 0x3fd4ea75UL, 0x9f911d79UL, 0x3e511735UL, - 0x80000000UL, 0x3fd4c26eUL, 0xf9c77397UL, 0xbe5b1643UL, 0x40000000UL, - 0x3fd49a78UL, 0x15fc9258UL, 0x3e479a37UL, 0x80000000UL, 0x3fd47293UL, - 0xd5a04dd9UL, 0xbe426e56UL, 0xc0000000UL, 0x3fd44abfUL, 0xe04042f5UL, - 0x3e56f7c6UL, 0x40000000UL, 0x3fd422fdUL, 0x1d8bf2c8UL, 0x3e5d8810UL, - 0x00000000UL, 0x3fd3fb4cUL, 0x88a8ddeeUL, 0xbe311454UL, 0xc0000000UL, - 0x3fd3d3abUL, 0x3e3b5e47UL, 0xbe5d1b72UL, 0x40000000UL, 0x3fd3ac1cUL, - 0xc2ab5d59UL, 0x3e31b02bUL, 0xc0000000UL, 0x3fd3849dUL, 0xd4e34b9eUL, - 0x3e51cb2fUL, 0x40000000UL, 0x3fd35d30UL, 0x177204fbUL, 0xbe2b8cd7UL, - 0x80000000UL, 0x3fd335d3UL, 0xfcd38c82UL, 0xbe4356e1UL, 0x80000000UL, - 0x3fd30e87UL, 0x64f54accUL, 0xbe4e6224UL, 0x00000000UL, 0x3fd2e74cUL, - 0xaa7975d9UL, 0x3e5dc0feUL, 0x80000000UL, 0x3fd2c021UL, 0x516dab3fUL, - 0xbe50ffa3UL, 0x40000000UL, 0x3fd29907UL, 0x2bfb7313UL, 0x3e5674a2UL, - 0xc0000000UL, 0x3fd271fdUL, 0x0549fc99UL, 0x3e385d29UL, 0xc0000000UL, - 0x3fd24b04UL, 0x55b63073UL, 0xbe500c6dUL, 0x00000000UL, 0x3fd2241cUL, - 0x3f91953aUL, 0x3e389977UL, 0xc0000000UL, 0x3fd1fd43UL, 0xa1543f71UL, - 0xbe3487abUL, 0xc0000000UL, 0x3fd1d67bUL, 0x4ec8867cUL, 0x3df6a2dcUL, - 0x00000000UL, 0x3fd1afc4UL, 0x4328e3bbUL, 0x3e41d9c0UL, 0x80000000UL, - 0x3fd1891cUL, 0x2e1cda84UL, 0x3e3bdd87UL, 0x40000000UL, 0x3fd16285UL, - 0x4b5331aeUL, 0xbe53128eUL, 0x00000000UL, 0x3fd13bfeUL, 0xb9aec164UL, - 0xbe52ac98UL, 0xc0000000UL, 0x3fd11586UL, 0xd91e1316UL, 0xbe350630UL, - 0x80000000UL, 0x3fd0ef1fUL, 0x7cacc12cUL, 0x3e3f5219UL, 0x40000000UL, - 0x3fd0c8c8UL, 0xbce277b7UL, 0x3e3d30c0UL, 0x00000000UL, 0x3fd0a281UL, - 0x2a63447dUL, 0xbe541377UL, 0x80000000UL, 0x3fd07c49UL, 0xfac483b5UL, - 0xbe5772ecUL, 0xc0000000UL, 0x3fd05621UL, 0x36b8a570UL, 0xbe4fd4bdUL, - 0xc0000000UL, 0x3fd03009UL, 0xbae505f7UL, 0xbe450388UL, 0x80000000UL, - 0x3fd00a01UL, 0x3e35aeadUL, 0xbe5430fcUL, 0x80000000UL, 0x3fcfc811UL, - 0x707475acUL, 0x3e38806eUL, 0x80000000UL, 0x3fcf7c3fUL, 0xc91817fcUL, - 0xbe40cceaUL, 0x80000000UL, 0x3fcf308cUL, 0xae05d5e9UL, 0xbe4919b8UL, - 0x80000000UL, 0x3fcee4f8UL, 0xae6cc9e6UL, 0xbe530b94UL, 0x00000000UL, - 0x3fce9983UL, 0x1efe3e8eUL, 0x3e57747eUL, 0x00000000UL, 0x3fce4e2dUL, - 0xda78d9bfUL, 0xbe59a608UL, 0x00000000UL, 0x3fce02f5UL, 0x8abe2c2eUL, - 0x3e4a35adUL, 0x00000000UL, 0x3fcdb7dcUL, 0x1495450dUL, 0xbe0872ccUL, - 0x80000000UL, 0x3fcd6ce1UL, 0x86ee0ba0UL, 0xbe4f59a0UL, 0x00000000UL, - 0x3fcd2205UL, 0xe81ca888UL, 0x3e5402c3UL, 0x00000000UL, 0x3fccd747UL, - 0x3b4424b9UL, 0x3e5dfdc3UL, 0x80000000UL, 0x3fcc8ca7UL, 0xd305b56cUL, - 0x3e202da6UL, 0x00000000UL, 0x3fcc4226UL, 0x399a6910UL, 0xbe482a1cUL, - 0x80000000UL, 0x3fcbf7c2UL, 0x747f7938UL, 0xbe587372UL, 0x80000000UL, - 0x3fcbad7cUL, 0x6fc246a0UL, 0x3e50d83dUL, 0x00000000UL, 0x3fcb6355UL, - 0xee9e9be5UL, 0xbe5c35bdUL, 0x80000000UL, 0x3fcb194aUL, 0x8416c0bcUL, - 0x3e546d4fUL, 0x00000000UL, 0x3fcacf5eUL, 0x49f7f08fUL, 0x3e56da76UL, - 0x00000000UL, 0x3fca858fUL, 0x5dc30de2UL, 0x3e5f390cUL, 0x00000000UL, - 0x3fca3bdeUL, 0x950583b6UL, 0xbe5e4169UL, 0x80000000UL, 0x3fc9f249UL, - 0x33631553UL, 0x3e52aeb1UL, 0x00000000UL, 0x3fc9a8d3UL, 0xde8795a6UL, - 0xbe59a504UL, 0x00000000UL, 0x3fc95f79UL, 0x076bf41eUL, 0x3e5122feUL, - 0x80000000UL, 0x3fc9163cUL, 0x2914c8e7UL, 0x3e3dd064UL, 0x00000000UL, - 0x3fc8cd1dUL, 0x3a30eca3UL, 0xbe21b4aaUL, 0x80000000UL, 0x3fc8841aUL, - 0xb2a96650UL, 0xbe575444UL, 0x80000000UL, 0x3fc83b34UL, 0x2376c0cbUL, - 0xbe2a74c7UL, 0x80000000UL, 0x3fc7f26bUL, 0xd8a0b653UL, 0xbe5181b6UL, - 0x00000000UL, 0x3fc7a9bfUL, 0x32257882UL, 0xbe4a78b4UL, 0x00000000UL, - 0x3fc7612fUL, 0x1eee8bd9UL, 0xbe1bfe9dUL, 0x80000000UL, 0x3fc718bbUL, - 0x0c603cc4UL, 0x3e36fdc9UL, 0x80000000UL, 0x3fc6d064UL, 0x3728b8cfUL, - 0xbe1e542eUL, 0x80000000UL, 0x3fc68829UL, 0xc79a4067UL, 0x3e5c380fUL, - 0x00000000UL, 0x3fc6400bUL, 0xf69eac69UL, 0x3e550a84UL, 0x80000000UL, - 0x3fc5f808UL, 0xb7a780a4UL, 0x3e5d9224UL, 0x80000000UL, 0x3fc5b022UL, - 0xad9dfb1eUL, 0xbe55242fUL, 0x00000000UL, 0x3fc56858UL, 0x659b18beUL, - 0xbe4bfda3UL, 0x80000000UL, 0x3fc520a9UL, 0x66ee3631UL, 0xbe57d769UL, - 0x80000000UL, 0x3fc4d916UL, 0x1ec62819UL, 0x3e2427f7UL, 0x80000000UL, - 0x3fc4919fUL, 0xdec25369UL, 0xbe435431UL, 0x00000000UL, 0x3fc44a44UL, - 0xa8acfc4bUL, 0xbe3c62e8UL, 0x00000000UL, 0x3fc40304UL, 0xcf1d3eabUL, - 0xbdfba29fUL, 0x80000000UL, 0x3fc3bbdfUL, 0x79aba3eaUL, 0xbdf1b7c8UL, - 0x80000000UL, 0x3fc374d6UL, 0xb8d186daUL, 0xbe5130cfUL, 0x80000000UL, - 0x3fc32de8UL, 0x9d74f152UL, 0x3e2285b6UL, 0x00000000UL, 0x3fc2e716UL, - 0x50ae7ca9UL, 0xbe503920UL, 0x80000000UL, 0x3fc2a05eUL, 0x6caed92eUL, - 0xbe533924UL, 0x00000000UL, 0x3fc259c2UL, 0x9cb5034eUL, 0xbe510e31UL, - 0x80000000UL, 0x3fc21340UL, 0x12c4d378UL, 0xbe540b43UL, 0x80000000UL, - 0x3fc1ccd9UL, 0xcc418706UL, 0x3e59887aUL, 0x00000000UL, 0x3fc1868eUL, - 0x921f4106UL, 0xbe528e67UL, 0x80000000UL, 0x3fc1405cUL, 0x3969441eUL, - 0x3e5d8051UL, 0x00000000UL, 0x3fc0fa46UL, 0xd941ef5bUL, 0x3e5f9079UL, - 0x80000000UL, 0x3fc0b44aUL, 0x5a3e81b2UL, 0xbe567691UL, 0x00000000UL, - 0x3fc06e69UL, 0x9d66afe7UL, 0xbe4d43fbUL, 0x00000000UL, 0x3fc028a2UL, - 0x0a92a162UL, 0xbe52f394UL, 0x00000000UL, 0x3fbfc5eaUL, 0x209897e5UL, - 0x3e529e37UL, 0x00000000UL, 0x3fbf3ac5UL, 0x8458bd7bUL, 0x3e582831UL, - 0x00000000UL, 0x3fbeafd5UL, 0xb8d8b4b8UL, 0xbe486b4aUL, 0x00000000UL, - 0x3fbe2518UL, 0xe0a3b7b6UL, 0x3e5bafd2UL, 0x00000000UL, 0x3fbd9a90UL, - 0x2bf2710eUL, 0x3e383b2bUL, 0x00000000UL, 0x3fbd103cUL, 0x73eb6ab7UL, - 0xbe56d78dUL, 0x00000000UL, 0x3fbc861bUL, 0x32ceaff5UL, 0xbe32dc5aUL, - 0x00000000UL, 0x3fbbfc2eUL, 0xbee04cb7UL, 0xbe4a71a4UL, 0x00000000UL, - 0x3fbb7274UL, 0x35ae9577UL, 0x3e38142fUL, 0x00000000UL, 0x3fbae8eeUL, - 0xcbaddab4UL, 0xbe5490f0UL, 0x00000000UL, 0x3fba5f9aUL, 0x95ce1114UL, - 0x3e597c71UL, 0x00000000UL, 0x3fb9d67aUL, 0x6d7c0f78UL, 0x3e3abc2dUL, - 0x00000000UL, 0x3fb94d8dUL, 0x2841a782UL, 0xbe566cbcUL, 0x00000000UL, - 0x3fb8c4d2UL, 0x6ed429c6UL, 0xbe3cfff9UL, 0x00000000UL, 0x3fb83c4aUL, - 0xe4a49fbbUL, 0xbe552964UL, 0x00000000UL, 0x3fb7b3f4UL, 0x2193d81eUL, - 0xbe42fa72UL, 0x00000000UL, 0x3fb72bd0UL, 0xdd70c122UL, 0x3e527a8cUL, - 0x00000000UL, 0x3fb6a3dfUL, 0x03108a54UL, 0xbe450393UL, 0x00000000UL, - 0x3fb61c1fUL, 0x30ff7954UL, 0x3e565840UL, 0x00000000UL, 0x3fb59492UL, - 0xdedd460cUL, 0xbe5422b5UL, 0x00000000UL, 0x3fb50d36UL, 0x950f9f45UL, - 0xbe5313f6UL, 0x00000000UL, 0x3fb4860bUL, 0x582cdcb1UL, 0x3e506d39UL, - 0x00000000UL, 0x3fb3ff12UL, 0x7216d3a6UL, 0x3e4aa719UL, 0x00000000UL, - 0x3fb3784aUL, 0x57a423fdUL, 0x3e5a9b9fUL, 0x00000000UL, 0x3fb2f1b4UL, - 0x7a138b41UL, 0xbe50b418UL, 0x00000000UL, 0x3fb26b4eUL, 0x2fbfd7eaUL, - 0x3e23a53eUL, 0x00000000UL, 0x3fb1e519UL, 0x18913ccbUL, 0x3e465fc1UL, - 0x00000000UL, 0x3fb15f15UL, 0x7ea24e21UL, 0x3e042843UL, 0x00000000UL, - 0x3fb0d941UL, 0x7c6d9c77UL, 0x3e59f61eUL, 0x00000000UL, 0x3fb0539eUL, - 0x114efd44UL, 0x3e4ccab7UL, 0x00000000UL, 0x3faf9c56UL, 0x1777f657UL, - 0x3e552f65UL, 0x00000000UL, 0x3fae91d2UL, 0xc317b86aUL, 0xbe5a61e0UL, - 0x00000000UL, 0x3fad87acUL, 0xb7664efbUL, 0xbe41f64eUL, 0x00000000UL, - 0x3fac7de6UL, 0x5d3d03a9UL, 0x3e0807a0UL, 0x00000000UL, 0x3fab7480UL, - 0x743c38ebUL, 0xbe3726e1UL, 0x00000000UL, 0x3faa6b78UL, 0x06a253f1UL, - 0x3e5ad636UL, 0x00000000UL, 0x3fa962d0UL, 0xa35f541bUL, 0x3e5a187aUL, - 0x00000000UL, 0x3fa85a88UL, 0x4b86e446UL, 0xbe508150UL, 0x00000000UL, - 0x3fa7529cUL, 0x2589cacfUL, 0x3e52938aUL, 0x00000000UL, 0x3fa64b10UL, - 0xaf6b11f2UL, 0xbe3454cdUL, 0x00000000UL, 0x3fa543e2UL, 0x97506fefUL, - 0xbe5fdec5UL, 0x00000000UL, 0x3fa43d10UL, 0xe75f7dd9UL, 0xbe388dd3UL, - 0x00000000UL, 0x3fa3369cUL, 0xa4139632UL, 0xbdea5177UL, 0x00000000UL, - 0x3fa23086UL, 0x352d6f1eUL, 0xbe565ad6UL, 0x00000000UL, 0x3fa12accUL, - 0x77449eb7UL, 0xbe50d5c7UL, 0x00000000UL, 0x3fa0256eUL, 0x7478da78UL, - 0x3e404724UL, 0x00000000UL, 0x3f9e40dcUL, 0xf59cef7fUL, 0xbe539d0aUL, - 0x00000000UL, 0x3f9c3790UL, 0x1511d43cUL, 0x3e53c2c8UL, 0x00000000UL, - 0x3f9a2f00UL, 0x9b8bff3cUL, 0xbe43b3e1UL, 0x00000000UL, 0x3f982724UL, - 0xad1e22a5UL, 0x3e46f0bdUL, 0x00000000UL, 0x3f962000UL, 0x130d9356UL, - 0x3e475ba0UL, 0x00000000UL, 0x3f941994UL, 0x8f86f883UL, 0xbe513d0bUL, - 0x00000000UL, 0x3f9213dcUL, 0x914d0dc8UL, 0xbe534335UL, 0x00000000UL, - 0x3f900ed8UL, 0x2d73e5e7UL, 0xbe22ba75UL, 0x00000000UL, 0x3f8c1510UL, - 0xc5b7d70eUL, 0x3e599c5dUL, 0x00000000UL, 0x3f880de0UL, 0x8a27857eUL, - 0xbe3d28c8UL, 0x00000000UL, 0x3f840810UL, 0xda767328UL, 0x3e531b3dUL, - 0x00000000UL, 0x3f8003b0UL, 0x77bacaf3UL, 0xbe5f04e3UL, 0x00000000UL, - 0x3f780150UL, 0xdf4b0720UL, 0x3e5a8bffUL, 0x00000000UL, 0x3f6ffc40UL, - 0x34c48e71UL, 0xbe3fcd99UL, 0x00000000UL, 0x3f5ff6c0UL, 0x1ad218afUL, - 0xbe4c78a7UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x80000000UL, - 0x00000000UL, 0xfffff800UL, 0x00000000UL, 0xfffff800UL, 0x00000000UL, - 0x3ff72000UL, 0x161bb241UL, 0xbf5dabe1UL, 0x6dc96112UL, 0xbf836578UL, - 0xee241472UL, 0xbf9b0301UL, 0x9f95985aUL, 0xbfb528dbUL, 0xb3841d2aUL, - 0xbfd619b6UL, 0x518775e3UL, 0x3f9004f2UL, 0xac8349bbUL, 0x3fa76c9bUL, - 0x486ececcUL, 0x3fc4635eUL, 0x161bb241UL, 0xbf5dabe1UL, 0x9f95985aUL, - 0xbfb528dbUL, 0xf8b5787dUL, 0x3ef2531eUL, 0x486ececbUL, 0x3fc4635eUL, - 0x412055ccUL, 0xbdd61bb2UL, 0x00000000UL, 0xfffffff8UL, 0x00000000UL, - 0xffffffffUL, 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x3b700000UL, - 0xfa5abcbfUL, 0x3ff00b1aUL, 0xa7609f71UL, 0xbc84f6b2UL, 0xa9fb3335UL, - 0x3ff0163dUL, 0x9ab8cdb7UL, 0x3c9b6129UL, 0x143b0281UL, 0x3ff02168UL, - 0x0fc54eb6UL, 0xbc82bf31UL, 0x3e778061UL, 0x3ff02c9aUL, 0x535b085dUL, - 0xbc719083UL, 0x2e11bbccUL, 0x3ff037d4UL, 0xeeade11aUL, 0x3c656811UL, - 0xe86e7f85UL, 0x3ff04315UL, 0x1977c96eUL, 0xbc90a31cUL, 0x72f654b1UL, - 0x3ff04e5fUL, 0x3aa0d08cUL, 0x3c84c379UL, 0xd3158574UL, 0x3ff059b0UL, - 0xa475b465UL, 0x3c8d73e2UL, 0x0e3c1f89UL, 0x3ff0650aUL, 0x5799c397UL, - 0xbc95cb7bUL, 0x29ddf6deUL, 0x3ff0706bUL, 0xe2b13c27UL, 0xbc8c91dfUL, - 0x2b72a836UL, 0x3ff07bd4UL, 0x54458700UL, 0x3c832334UL, 0x18759bc8UL, - 0x3ff08745UL, 0x4bb284ffUL, 0x3c6186beUL, 0xf66607e0UL, 0x3ff092bdUL, - 0x800a3fd1UL, 0xbc968063UL, 0xcac6f383UL, 0x3ff09e3eUL, 0x18316136UL, - 0x3c914878UL, 0x9b1f3919UL, 0x3ff0a9c7UL, 0x873d1d38UL, 0x3c85d16cUL, - 0x6cf9890fUL, 0x3ff0b558UL, 0x4adc610bUL, 0x3c98a62eUL, 0x45e46c85UL, - 0x3ff0c0f1UL, 0x06d21cefUL, 0x3c94f989UL, 0x2b7247f7UL, 0x3ff0cc92UL, - 0x16e24f71UL, 0x3c901edcUL, 0x23395decUL, 0x3ff0d83bUL, 0xe43f316aUL, - 0xbc9bc14dUL, 0x32d3d1a2UL, 0x3ff0e3ecUL, 0x27c57b52UL, 0x3c403a17UL, - 0x5fdfa9c5UL, 0x3ff0efa5UL, 0xbc54021bUL, 0xbc949db9UL, 0xaffed31bUL, - 0x3ff0fb66UL, 0xc44ebd7bUL, 0xbc6b9bedUL, 0x28d7233eUL, 0x3ff10730UL, - 0x1692fdd5UL, 0x3c8d46ebUL, 0xd0125b51UL, 0x3ff11301UL, 0x39449b3aUL, - 0xbc96c510UL, 0xab5e2ab6UL, 0x3ff11edbUL, 0xf703fb72UL, 0xbc9ca454UL, - 0xc06c31ccUL, 0x3ff12abdUL, 0xb36ca5c7UL, 0xbc51b514UL, 0x14f204abUL, - 0x3ff136a8UL, 0xba48dcf0UL, 0xbc67108fUL, 0xaea92de0UL, 0x3ff1429aUL, - 0x9af1369eUL, 0xbc932fbfUL, 0x934f312eUL, 0x3ff14e95UL, 0x39bf44abUL, - 0xbc8b91e8UL, 0xc8a58e51UL, 0x3ff15a98UL, 0xb9eeab0aUL, 0x3c82406aUL, - 0x5471c3c2UL, 0x3ff166a4UL, 0x82ea1a32UL, 0x3c58f23bUL, 0x3c7d517bUL, - 0x3ff172b8UL, 0xb9d78a76UL, 0xbc819041UL, 0x8695bbc0UL, 0x3ff17ed4UL, - 0xe2ac5a64UL, 0x3c709e3fUL, 0x388c8deaUL, 0x3ff18af9UL, 0xd1970f6cUL, - 0xbc911023UL, 0x58375d2fUL, 0x3ff19726UL, 0x85f17e08UL, 0x3c94aaddUL, - 0xeb6fcb75UL, 0x3ff1a35bUL, 0x7b4968e4UL, 0x3c8e5b4cUL, 0xf8138a1cUL, - 0x3ff1af99UL, 0xa4b69280UL, 0x3c97bf85UL, 0x84045cd4UL, 0x3ff1bbe0UL, - 0x352ef607UL, 0xbc995386UL, 0x95281c6bUL, 0x3ff1c82fUL, 0x8010f8c9UL, - 0x3c900977UL, 0x3168b9aaUL, 0x3ff1d487UL, 0x00a2643cUL, 0x3c9e016eUL, - 0x5eb44027UL, 0x3ff1e0e7UL, 0x088cb6deUL, 0xbc96fdd8UL, 0x22fcd91dUL, - 0x3ff1ed50UL, 0x027bb78cUL, 0xbc91df98UL, 0x8438ce4dUL, 0x3ff1f9c1UL, - 0xa097af5cUL, 0xbc9bf524UL, 0x88628cd6UL, 0x3ff2063bUL, 0x814a8495UL, - 0x3c8dc775UL, 0x3578a819UL, 0x3ff212beUL, 0x2cfcaac9UL, 0x3c93592dUL, - 0x917ddc96UL, 0x3ff21f49UL, 0x9494a5eeUL, 0x3c82a97eUL, 0xa27912d1UL, - 0x3ff22bddUL, 0x5577d69fUL, 0x3c8d34fbUL, 0x6e756238UL, 0x3ff2387aUL, - 0xb6c70573UL, 0x3c99b07eUL, 0xfb82140aUL, 0x3ff2451fUL, 0x911ca996UL, - 0x3c8acfccUL, 0x4fb2a63fUL, 0x3ff251ceUL, 0xbef4f4a4UL, 0x3c8ac155UL, - 0x711ece75UL, 0x3ff25e85UL, 0x4ac31b2cUL, 0x3c93e1a2UL, 0x65e27cddUL, - 0x3ff26b45UL, 0x9940e9d9UL, 0x3c82bd33UL, 0x341ddf29UL, 0x3ff2780eUL, - 0x05f9e76cUL, 0x3c9e067cUL, 0xe1f56381UL, 0x3ff284dfUL, 0x8c3f0d7eUL, - 0xbc9a4c3aUL, 0x7591bb70UL, 0x3ff291baUL, 0x28401cbdUL, 0xbc82cc72UL, - 0xf51fdee1UL, 0x3ff29e9dUL, 0xafad1255UL, 0x3c8612e8UL, 0x66d10f13UL, - 0x3ff2ab8aUL, 0x191690a7UL, 0xbc995743UL, 0xd0dad990UL, 0x3ff2b87fUL, - 0xd6381aa4UL, 0xbc410adcUL, 0x39771b2fUL, 0x3ff2c57eUL, 0xa6eb5124UL, - 0xbc950145UL, 0xa6e4030bUL, 0x3ff2d285UL, 0x54db41d5UL, 0x3c900247UL, - 0x1f641589UL, 0x3ff2df96UL, 0xfbbce198UL, 0x3c9d16cfUL, 0xa93e2f56UL, - 0x3ff2ecafUL, 0x45d52383UL, 0x3c71ca0fUL, 0x4abd886bUL, 0x3ff2f9d2UL, - 0x532bda93UL, 0xbc653c55UL, 0x0a31b715UL, 0x3ff306feUL, 0xd23182e4UL, - 0x3c86f46aUL, 0xedeeb2fdUL, 0x3ff31432UL, 0xf3f3fcd1UL, 0x3c8959a3UL, - 0xfc4cd831UL, 0x3ff32170UL, 0x8e18047cUL, 0x3c8a9ce7UL, 0x3ba8ea32UL, - 0x3ff32eb8UL, 0x3cb4f318UL, 0xbc9c45e8UL, 0xb26416ffUL, 0x3ff33c08UL, - 0x843659a6UL, 0x3c932721UL, 0x66e3fa2dUL, 0x3ff34962UL, 0x930881a4UL, - 0xbc835a75UL, 0x5f929ff1UL, 0x3ff356c5UL, 0x5c4e4628UL, 0xbc8b5ceeUL, - 0xa2de883bUL, 0x3ff36431UL, 0xa06cb85eUL, 0xbc8c3144UL, 0x373aa9cbUL, - 0x3ff371a7UL, 0xbf42eae2UL, 0xbc963aeaUL, 0x231e754aUL, 0x3ff37f26UL, - 0x9eceb23cUL, 0xbc99f5caUL, 0x6d05d866UL, 0x3ff38caeUL, 0x3c9904bdUL, - 0xbc9e958dUL, 0x1b7140efUL, 0x3ff39a40UL, 0xfc8e2934UL, 0xbc99a9a5UL, - 0x34e59ff7UL, 0x3ff3a7dbUL, 0xd661f5e3UL, 0xbc75e436UL, 0xbfec6cf4UL, - 0x3ff3b57fUL, 0xe26fff18UL, 0x3c954c66UL, 0xc313a8e5UL, 0x3ff3c32dUL, - 0x375d29c3UL, 0xbc9efff8UL, 0x44ede173UL, 0x3ff3d0e5UL, 0x8c284c71UL, - 0x3c7fe8d0UL, 0x4c123422UL, 0x3ff3dea6UL, 0x11f09ebcUL, 0x3c8ada09UL, - 0xdf1c5175UL, 0x3ff3ec70UL, 0x7b8c9bcaUL, 0xbc8af663UL, 0x04ac801cUL, - 0x3ff3fa45UL, 0xf956f9f3UL, 0xbc97d023UL, 0xc367a024UL, 0x3ff40822UL, - 0xb6f4d048UL, 0x3c8bddf8UL, 0x21f72e2aUL, 0x3ff4160aUL, 0x1c309278UL, - 0xbc5ef369UL, 0x2709468aUL, 0x3ff423fbUL, 0xc0b314ddUL, 0xbc98462dUL, - 0xd950a897UL, 0x3ff431f5UL, 0xe35f7999UL, 0xbc81c7ddUL, 0x3f84b9d4UL, - 0x3ff43ffaUL, 0x9704c003UL, 0x3c8880beUL, 0x6061892dUL, 0x3ff44e08UL, - 0x04ef80d0UL, 0x3c489b7aUL, 0x42a7d232UL, 0x3ff45c20UL, 0x82fb1f8eUL, - 0xbc686419UL, 0xed1d0057UL, 0x3ff46a41UL, 0xd1648a76UL, 0x3c9c944bUL, - 0x668b3237UL, 0x3ff4786dUL, 0xed445733UL, 0xbc9c20f0UL, 0xb5c13cd0UL, - 0x3ff486a2UL, 0xb69062f0UL, 0x3c73c1a3UL, 0xe192aed2UL, 0x3ff494e1UL, - 0x5e499ea0UL, 0xbc83b289UL, 0xf0d7d3deUL, 0x3ff4a32aUL, 0xf3d1be56UL, - 0x3c99cb62UL, 0xea6db7d7UL, 0x3ff4b17dUL, 0x7f2897f0UL, 0xbc8125b8UL, - 0xd5362a27UL, 0x3ff4bfdaUL, 0xafec42e2UL, 0x3c7d4397UL, 0xb817c114UL, - 0x3ff4ce41UL, 0x690abd5dUL, 0x3c905e29UL, 0x99fddd0dUL, 0x3ff4dcb2UL, - 0xbc6a7833UL, 0x3c98ecdbUL, 0x81d8abffUL, 0x3ff4eb2dUL, 0x2e5d7a52UL, - 0xbc95257dUL, 0x769d2ca7UL, 0x3ff4f9b2UL, 0xd25957e3UL, 0xbc94b309UL, - 0x7f4531eeUL, 0x3ff50841UL, 0x49b7465fUL, 0x3c7a249bUL, 0xa2cf6642UL, - 0x3ff516daUL, 0x69bd93efUL, 0xbc8f7685UL, 0xe83f4eefUL, 0x3ff5257dUL, - 0x43efef71UL, 0xbc7c998dUL, 0x569d4f82UL, 0x3ff5342bUL, 0x1db13cadUL, - 0xbc807abeUL, 0xf4f6ad27UL, 0x3ff542e2UL, 0x192d5f7eUL, 0x3c87926dUL, - 0xca5d920fUL, 0x3ff551a4UL, 0xefede59bUL, 0xbc8d689cUL, 0xdde910d2UL, - 0x3ff56070UL, 0x168eebf0UL, 0xbc90fb6eUL, 0x36b527daUL, 0x3ff56f47UL, - 0x011d93adUL, 0x3c99bb2cUL, 0xdbe2c4cfUL, 0x3ff57e27UL, 0x8a57b9c4UL, - 0xbc90b98cUL, 0xd497c7fdUL, 0x3ff58d12UL, 0x5b9a1de8UL, 0x3c8295e1UL, - 0x27ff07ccUL, 0x3ff59c08UL, 0xe467e60fUL, 0xbc97e2ceUL, 0xdd485429UL, - 0x3ff5ab07UL, 0x054647adUL, 0x3c96324cUL, 0xfba87a03UL, 0x3ff5ba11UL, - 0x4c233e1aUL, 0xbc9b77a1UL, 0x8a5946b7UL, 0x3ff5c926UL, 0x816986a2UL, - 0x3c3c4b1bUL, 0x90998b93UL, 0x3ff5d845UL, 0xa8b45643UL, 0xbc9cd6a7UL, - 0x15ad2148UL, 0x3ff5e76fUL, 0x3080e65eUL, 0x3c9ba6f9UL, 0x20dceb71UL, - 0x3ff5f6a3UL, 0xe3cdcf92UL, 0xbc89eaddUL, 0xb976dc09UL, 0x3ff605e1UL, - 0x9b56de47UL, 0xbc93e242UL, 0xe6cdf6f4UL, 0x3ff6152aUL, 0x4ab84c27UL, - 0x3c9e4b3eUL, 0xb03a5585UL, 0x3ff6247eUL, 0x7e40b497UL, 0xbc9383c1UL, - 0x1d1929fdUL, 0x3ff633ddUL, 0xbeb964e5UL, 0x3c984710UL, 0x34ccc320UL, - 0x3ff64346UL, 0x759d8933UL, 0xbc8c483cUL, 0xfebc8fb7UL, 0x3ff652b9UL, - 0xc9a73e09UL, 0xbc9ae3d5UL, 0x82552225UL, 0x3ff66238UL, 0x87591c34UL, - 0xbc9bb609UL, 0xc70833f6UL, 0x3ff671c1UL, 0x586c6134UL, 0xbc8e8732UL, - 0xd44ca973UL, 0x3ff68155UL, 0x44f73e65UL, 0x3c6038aeUL, 0xb19e9538UL, - 0x3ff690f4UL, 0x9aeb445dUL, 0x3c8804bdUL, 0x667f3bcdUL, 0x3ff6a09eUL, - 0x13b26456UL, 0xbc9bdd34UL, 0xfa75173eUL, 0x3ff6b052UL, 0x2c9a9d0eUL, - 0x3c7a38f5UL, 0x750bdabfUL, 0x3ff6c012UL, 0x67ff0b0dUL, 0xbc728956UL, - 0xddd47645UL, 0x3ff6cfdcUL, 0xb6f17309UL, 0x3c9c7aa9UL, 0x3c651a2fUL, - 0x3ff6dfb2UL, 0x683c88abUL, 0xbc6bbe3aUL, 0x98593ae5UL, 0x3ff6ef92UL, - 0x9e1ac8b2UL, 0xbc90b974UL, 0xf9519484UL, 0x3ff6ff7dUL, 0x25860ef6UL, - 0xbc883c0fUL, 0x66f42e87UL, 0x3ff70f74UL, 0xd45aa65fUL, 0x3c59d644UL, - 0xe8ec5f74UL, 0x3ff71f75UL, 0x86887a99UL, 0xbc816e47UL, 0x86ead08aUL, - 0x3ff72f82UL, 0x2cd62c72UL, 0xbc920aa0UL, 0x48a58174UL, 0x3ff73f9aUL, - 0x6c65d53cUL, 0xbc90a8d9UL, 0x35d7cbfdUL, 0x3ff74fbdUL, 0x618a6e1cUL, - 0x3c9047fdUL, 0x564267c9UL, 0x3ff75febUL, 0x57316dd3UL, 0xbc902459UL, - 0xb1ab6e09UL, 0x3ff77024UL, 0x169147f8UL, 0x3c9b7877UL, 0x4fde5d3fUL, - 0x3ff78069UL, 0x0a02162dUL, 0x3c9866b8UL, 0x38ac1cf6UL, 0x3ff790b9UL, - 0x62aadd3eUL, 0x3c9349a8UL, 0x73eb0187UL, 0x3ff7a114UL, 0xee04992fUL, - 0xbc841577UL, 0x0976cfdbUL, 0x3ff7b17bUL, 0x8468dc88UL, 0xbc9bebb5UL, - 0x0130c132UL, 0x3ff7c1edUL, 0xd1164dd6UL, 0x3c9f124cUL, 0x62ff86f0UL, - 0x3ff7d26aUL, 0xfb72b8b4UL, 0x3c91bddbUL, 0x36cf4e62UL, 0x3ff7e2f3UL, - 0xba15797eUL, 0x3c705d02UL, 0x8491c491UL, 0x3ff7f387UL, 0xcf9311aeUL, - 0xbc807f11UL, 0x543e1a12UL, 0x3ff80427UL, 0x626d972bUL, 0xbc927c86UL, - 0xadd106d9UL, 0x3ff814d2UL, 0x0d151d4dUL, 0x3c946437UL, 0x994cce13UL, - 0x3ff82589UL, 0xd41532d8UL, 0xbc9d4c1dUL, 0x1eb941f7UL, 0x3ff8364cUL, - 0x31df2bd5UL, 0x3c999b9aUL, 0x4623c7adUL, 0x3ff8471aUL, 0xa341cdfbUL, - 0xbc88d684UL, 0x179f5b21UL, 0x3ff857f4UL, 0xf8b216d0UL, 0xbc5ba748UL, - 0x9b4492edUL, 0x3ff868d9UL, 0x9bd4f6baUL, 0xbc9fc6f8UL, 0xd931a436UL, - 0x3ff879caUL, 0xd2db47bdUL, 0x3c85d2d7UL, 0xd98a6699UL, 0x3ff88ac7UL, - 0xf37cb53aUL, 0x3c9994c2UL, 0xa478580fUL, 0x3ff89bd0UL, 0x4475202aUL, - 0x3c9d5395UL, 0x422aa0dbUL, 0x3ff8ace5UL, 0x56864b27UL, 0x3c96e9f1UL, - 0xbad61778UL, 0x3ff8be05UL, 0xfc43446eUL, 0x3c9ecb5eUL, 0x16b5448cUL, - 0x3ff8cf32UL, 0x32e9e3aaUL, 0xbc70d55eUL, 0x5e0866d9UL, 0x3ff8e06aUL, - 0x6fc9b2e6UL, 0xbc97114aUL, 0x99157736UL, 0x3ff8f1aeUL, 0xa2e3976cUL, - 0x3c85cc13UL, 0xd0282c8aUL, 0x3ff902feUL, 0x85fe3fd2UL, 0x3c9592caUL, - 0x0b91ffc6UL, 0x3ff9145bUL, 0x2e582524UL, 0xbc9dd679UL, 0x53aa2fe2UL, - 0x3ff925c3UL, 0xa639db7fUL, 0xbc83455fUL, 0xb0cdc5e5UL, 0x3ff93737UL, - 0x81b57ebcUL, 0xbc675fc7UL, 0x2b5f98e5UL, 0x3ff948b8UL, 0x797d2d99UL, - 0xbc8dc3d6UL, 0xcbc8520fUL, 0x3ff95a44UL, 0x96a5f039UL, 0xbc764b7cUL, - 0x9a7670b3UL, 0x3ff96bddUL, 0x7f19c896UL, 0xbc5ba596UL, 0x9fde4e50UL, - 0x3ff97d82UL, 0x7c1b85d1UL, 0xbc9d185bUL, 0xe47a22a2UL, 0x3ff98f33UL, - 0xa24c78ecUL, 0x3c7cabdaUL, 0x70ca07baUL, 0x3ff9a0f1UL, 0x91cee632UL, - 0xbc9173bdUL, 0x4d53fe0dUL, 0x3ff9b2bbUL, 0x4df6d518UL, 0xbc9dd84eUL, - 0x82a3f090UL, 0x3ff9c491UL, 0xb071f2beUL, 0x3c7c7c46UL, 0x194bb8d5UL, - 0x3ff9d674UL, 0xa3dd8233UL, 0xbc9516beUL, 0x19e32323UL, 0x3ff9e863UL, - 0x78e64c6eUL, 0x3c7824caUL, 0x8d07f29eUL, 0x3ff9fa5eUL, 0xaaf1faceUL, - 0xbc84a9ceUL, 0x7b5de565UL, 0x3ffa0c66UL, 0x5d1cd533UL, 0xbc935949UL, - 0xed8eb8bbUL, 0x3ffa1e7aUL, 0xee8be70eUL, 0x3c9c6618UL, 0xec4a2d33UL, - 0x3ffa309bUL, 0x7ddc36abUL, 0x3c96305cUL, 0x80460ad8UL, 0x3ffa42c9UL, - 0x589fb120UL, 0xbc9aa780UL, 0xb23e255dUL, 0x3ffa5503UL, 0xdb8d41e1UL, - 0xbc9d2f6eUL, 0x8af46052UL, 0x3ffa674aUL, 0x30670366UL, 0x3c650f56UL, - 0x1330b358UL, 0x3ffa799eUL, 0xcac563c7UL, 0x3c9bcb7eUL, 0x53c12e59UL, - 0x3ffa8bfeUL, 0xb2ba15a9UL, 0xbc94f867UL, 0x5579fdbfUL, 0x3ffa9e6bUL, - 0x0ef7fd31UL, 0x3c90fac9UL, 0x21356ebaUL, 0x3ffab0e5UL, 0xdae94545UL, - 0x3c889c31UL, 0xbfd3f37aUL, 0x3ffac36bUL, 0xcae76cd0UL, 0xbc8f9234UL, - 0x3a3c2774UL, 0x3ffad5ffUL, 0xb6b1b8e5UL, 0x3c97ef3bUL, 0x995ad3adUL, - 0x3ffae89fUL, 0x345dcc81UL, 0x3c97a1cdUL, 0xe622f2ffUL, 0x3ffafb4cUL, - 0x0f315ecdUL, 0xbc94b2fcUL, 0x298db666UL, 0x3ffb0e07UL, 0x4c80e425UL, - 0xbc9bdef5UL, 0x6c9a8952UL, 0x3ffb20ceUL, 0x4a0756ccUL, 0x3c94dd02UL, - 0xb84f15fbUL, 0x3ffb33a2UL, 0x3084d708UL, 0xbc62805eUL, 0x15b749b1UL, - 0x3ffb4684UL, 0xe9df7c90UL, 0xbc7f763dUL, 0x8de5593aUL, 0x3ffb5972UL, - 0xbbba6de3UL, 0xbc9c71dfUL, 0x29f1c52aUL, 0x3ffb6c6eUL, 0x52883f6eUL, - 0x3c92a8f3UL, 0xf2fb5e47UL, 0x3ffb7f76UL, 0x7e54ac3bUL, 0xbc75584fUL, - 0xf22749e4UL, 0x3ffb928cUL, 0x54cb65c6UL, 0xbc9b7216UL, 0x30a1064aUL, - 0x3ffba5b0UL, 0x0e54292eUL, 0xbc9efcd3UL, 0xb79a6f1fUL, 0x3ffbb8e0UL, - 0xc9696205UL, 0xbc3f52d1UL, 0x904bc1d2UL, 0x3ffbcc1eUL, 0x7a2d9e84UL, - 0x3c823dd0UL, 0xc3f3a207UL, 0x3ffbdf69UL, 0x60ea5b53UL, 0xbc3c2623UL, - 0x5bd71e09UL, 0x3ffbf2c2UL, 0x3f6b9c73UL, 0xbc9efdcaUL, 0x6141b33dUL, - 0x3ffc0628UL, 0xa1fbca34UL, 0xbc8d8a5aUL, 0xdd85529cUL, 0x3ffc199bUL, - 0x895048ddUL, 0x3c811065UL, 0xd9fa652cUL, 0x3ffc2d1cUL, 0x17c8a5d7UL, - 0xbc96e516UL, 0x5fffd07aUL, 0x3ffc40abUL, 0xe083c60aUL, 0x3c9b4537UL, - 0x78fafb22UL, 0x3ffc5447UL, 0x2493b5afUL, 0x3c912f07UL, 0x2e57d14bUL, - 0x3ffc67f1UL, 0xff483cadUL, 0x3c92884dUL, 0x8988c933UL, 0x3ffc7ba8UL, - 0xbe255559UL, 0xbc8e76bbUL, 0x9406e7b5UL, 0x3ffc8f6dUL, 0x48805c44UL, - 0x3c71acbcUL, 0x5751c4dbUL, 0x3ffca340UL, 0xd10d08f5UL, 0xbc87f2beUL, - 0xdcef9069UL, 0x3ffcb720UL, 0xd1e949dbUL, 0x3c7503cbUL, 0x2e6d1675UL, - 0x3ffccb0fUL, 0x86009092UL, 0xbc7d220fUL, 0x555dc3faUL, 0x3ffcdf0bUL, - 0x53829d72UL, 0xbc8dd83bUL, 0x5b5bab74UL, 0x3ffcf315UL, 0xb86dff57UL, - 0xbc9a08e9UL, 0x4a07897cUL, 0x3ffd072dUL, 0x43797a9cUL, 0xbc9cbc37UL, - 0x2b08c968UL, 0x3ffd1b53UL, 0x219a36eeUL, 0x3c955636UL, 0x080d89f2UL, - 0x3ffd2f87UL, 0x719d8578UL, 0xbc9d487bUL, 0xeacaa1d6UL, 0x3ffd43c8UL, - 0xbf5a1614UL, 0x3c93db53UL, 0xdcfba487UL, 0x3ffd5818UL, 0xd75b3707UL, - 0x3c82ed02UL, 0xe862e6d3UL, 0x3ffd6c76UL, 0x4a8165a0UL, 0x3c5fe87aUL, - 0x16c98398UL, 0x3ffd80e3UL, 0x8beddfe8UL, 0xbc911ec1UL, 0x71ff6075UL, - 0x3ffd955dUL, 0xbb9af6beUL, 0x3c9a052dUL, 0x03db3285UL, 0x3ffda9e6UL, - 0x696db532UL, 0x3c9c2300UL, 0xd63a8315UL, 0x3ffdbe7cUL, 0x926b8be4UL, - 0xbc9b76f1UL, 0xf301b460UL, 0x3ffdd321UL, 0x78f018c3UL, 0x3c92da57UL, - 0x641c0658UL, 0x3ffde7d5UL, 0x8e79ba8fUL, 0xbc9ca552UL, 0x337b9b5fUL, - 0x3ffdfc97UL, 0x4f184b5cUL, 0xbc91a5cdUL, 0x6b197d17UL, 0x3ffe1167UL, - 0xbd5c7f44UL, 0xbc72b529UL, 0x14f5a129UL, 0x3ffe2646UL, 0x817a1496UL, - 0xbc97b627UL, 0x3b16ee12UL, 0x3ffe3b33UL, 0x31fdc68bUL, 0xbc99f4a4UL, - 0xe78b3ff6UL, 0x3ffe502eUL, 0x80a9cc8fUL, 0x3c839e89UL, 0x24676d76UL, - 0x3ffe6539UL, 0x7522b735UL, 0xbc863ff8UL, 0xfbc74c83UL, 0x3ffe7a51UL, - 0xca0c8de2UL, 0x3c92d522UL, 0x77cdb740UL, 0x3ffe8f79UL, 0x80b054b1UL, - 0xbc910894UL, 0xa2a490daUL, 0x3ffea4afUL, 0x179c2893UL, 0xbc9e9c23UL, - 0x867cca6eUL, 0x3ffeb9f4UL, 0x2293e4f2UL, 0x3c94832fUL, 0x2d8e67f1UL, - 0x3ffecf48UL, 0xb411ad8cUL, 0xbc9c93f3UL, 0xa2188510UL, 0x3ffee4aaUL, - 0xa487568dUL, 0x3c91c68dUL, 0xee615a27UL, 0x3ffefa1bUL, 0x86a4b6b0UL, - 0x3c9dc7f4UL, 0x1cb6412aUL, 0x3fff0f9cUL, 0x65181d45UL, 0xbc932200UL, - 0x376bba97UL, 0x3fff252bUL, 0xbf0d8e43UL, 0x3c93a1a5UL, 0x48dd7274UL, - 0x3fff3ac9UL, 0x3ed837deUL, 0xbc795a5aUL, 0x5b6e4540UL, 0x3fff5076UL, - 0x2dd8a18bUL, 0x3c99d3e1UL, 0x798844f8UL, 0x3fff6632UL, 0x3539343eUL, - 0x3c9fa37bUL, 0xad9cbe14UL, 0x3fff7bfdUL, 0xd006350aUL, 0xbc9dbb12UL, - 0x02243c89UL, 0x3fff91d8UL, 0xa779f689UL, 0xbc612ea8UL, 0x819e90d8UL, - 0x3fffa7c1UL, 0xf3a5931eUL, 0x3c874853UL, 0x3692d514UL, 0x3fffbdbaUL, - 0x15098eb6UL, 0xbc796773UL, 0x2b8f71f1UL, 0x3fffd3c2UL, 0x966579e7UL, - 0x3c62eb74UL, 0x6b2a23d9UL, 0x3fffe9d9UL, 0x7442fde3UL, 0x3c74a603UL, - 0xe78a6731UL, 0x3f55d87fUL, 0xd704a0c0UL, 0x3fac6b08UL, 0x6fba4e77UL, - 0x3f83b2abUL, 0xff82c58fUL, 0x3fcebfbdUL, 0xfefa39efUL, 0x3fe62e42UL, - 0x00000000UL, 0x00000000UL, 0xfefa39efUL, 0x3fe62e42UL, 0xfefa39efUL, - 0xbfe62e42UL, 0xf8000000UL, 0xffffffffUL, 0xf8000000UL, 0xffffffffUL, - 0x00000000UL, 0x80000000UL, 0x00000000UL, 0x00000000UL - + 0x00000000UL, 0x3fe00000UL, 0x00000000UL, 0x3fe00000UL }; -//registers, -// input: xmm0, xmm1 -// scratch: xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 -// eax, edx, ecx, ebx +ALIGNED_(16) juint _P_2[] = +{ + 0x1a600000UL, 0x3d90b461UL, 0x1a600000UL, 0x3d90b461UL +}; -// Code generated by Intel C compiler for LIBM library +ALIGNED_(16) juint _SC_4[] = +{ + 0xa556c734UL, 0x3ec71de3UL, 0x1a01a01aUL, 0x3efa01a0UL +}; -void MacroAssembler::fast_pow(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register tmp) { - Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; - Label L_2TAG_PACKET_4_0_2, L_2TAG_PACKET_5_0_2, L_2TAG_PACKET_6_0_2, L_2TAG_PACKET_7_0_2; - Label L_2TAG_PACKET_8_0_2, L_2TAG_PACKET_9_0_2, L_2TAG_PACKET_10_0_2, L_2TAG_PACKET_11_0_2; - Label L_2TAG_PACKET_12_0_2, L_2TAG_PACKET_13_0_2, L_2TAG_PACKET_14_0_2, L_2TAG_PACKET_15_0_2; - Label L_2TAG_PACKET_16_0_2, L_2TAG_PACKET_17_0_2, L_2TAG_PACKET_18_0_2, L_2TAG_PACKET_19_0_2; - Label L_2TAG_PACKET_20_0_2, L_2TAG_PACKET_21_0_2, L_2TAG_PACKET_22_0_2, L_2TAG_PACKET_23_0_2; - Label L_2TAG_PACKET_24_0_2, L_2TAG_PACKET_25_0_2, L_2TAG_PACKET_26_0_2, L_2TAG_PACKET_27_0_2; - Label L_2TAG_PACKET_28_0_2, L_2TAG_PACKET_29_0_2, L_2TAG_PACKET_30_0_2, L_2TAG_PACKET_31_0_2; - Label L_2TAG_PACKET_32_0_2, L_2TAG_PACKET_33_0_2, L_2TAG_PACKET_34_0_2, L_2TAG_PACKET_35_0_2; - Label L_2TAG_PACKET_36_0_2, L_2TAG_PACKET_37_0_2, L_2TAG_PACKET_38_0_2, L_2TAG_PACKET_39_0_2; - Label L_2TAG_PACKET_40_0_2, L_2TAG_PACKET_41_0_2, L_2TAG_PACKET_42_0_2, L_2TAG_PACKET_43_0_2; - Label L_2TAG_PACKET_44_0_2, L_2TAG_PACKET_45_0_2, L_2TAG_PACKET_46_0_2, L_2TAG_PACKET_47_0_2; - Label L_2TAG_PACKET_48_0_2, L_2TAG_PACKET_49_0_2, L_2TAG_PACKET_50_0_2, L_2TAG_PACKET_51_0_2; - Label L_2TAG_PACKET_52_0_2, L_2TAG_PACKET_53_0_2, L_2TAG_PACKET_54_0_2, L_2TAG_PACKET_55_0_2; - Label L_2TAG_PACKET_56_0_2, L_2TAG_PACKET_57_0_2, L_2TAG_PACKET_58_0_2, start; +ALIGNED_(16) juint _Ctable[] = +{ + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x3ff00000UL, 0x176d6d31UL, 0xbf73b92eUL, + 0xbc29b42cUL, 0x3fb917a6UL, 0xe0000000UL, 0xbc3e2718UL, 0x00000000UL, + 0x3ff00000UL, 0x011469fbUL, 0xbf93ad06UL, 0x3c69a60bUL, 0x3fc8f8b8UL, + 0xc0000000UL, 0xbc626d19UL, 0x00000000UL, 0x3ff00000UL, 0x939d225aUL, + 0xbfa60beaUL, 0x2ed59f06UL, 0x3fd29406UL, 0xa0000000UL, 0xbc75d28dUL, + 0x00000000UL, 0x3ff00000UL, 0x866b95cfUL, 0xbfb37ca1UL, 0xa6aea963UL, + 0x3fd87de2UL, 0xe0000000UL, 0xbc672cedUL, 0x00000000UL, 0x3ff00000UL, + 0x73fa1279UL, 0xbfbe3a68UL, 0x3806f63bUL, 0x3fde2b5dUL, 0x20000000UL, + 0x3c5e0d89UL, 0x00000000UL, 0x3ff00000UL, 0x5bc57974UL, 0xbfc59267UL, + 0x39ae68c8UL, 0x3fe1c73bUL, 0x20000000UL, 0x3c8b25ddUL, 0x00000000UL, + 0x3ff00000UL, 0x53aba2fdUL, 0xbfcd0dfeUL, 0x25091dd6UL, 0x3fe44cf3UL, + 0x20000000UL, 0x3c68076aUL, 0x00000000UL, 0x3ff00000UL, 0x99fcef32UL, + 0x3fca8279UL, 0x667f3bcdUL, 0x3fe6a09eUL, 0x20000000UL, 0xbc8bdd34UL, + 0x00000000UL, 0x3fe00000UL, 0x94247758UL, 0x3fc133ccUL, 0x6b151741UL, + 0x3fe8bc80UL, 0x20000000UL, 0xbc82c5e1UL, 0x00000000UL, 0x3fe00000UL, + 0x9ae68c87UL, 0x3fac73b3UL, 0x290ea1a3UL, 0x3fea9b66UL, 0xe0000000UL, + 0x3c39f630UL, 0x00000000UL, 0x3fe00000UL, 0x7f909c4eUL, 0xbf9d4a2cUL, + 0xf180bdb1UL, 0x3fec38b2UL, 0x80000000UL, 0xbc76e0b1UL, 0x00000000UL, + 0x3fe00000UL, 0x65455a75UL, 0xbfbe0875UL, 0xcf328d46UL, 0x3fed906bUL, + 0x20000000UL, 0x3c7457e6UL, 0x00000000UL, 0x3fe00000UL, 0x76acf82dUL, + 0x3fa4a031UL, 0x56c62ddaUL, 0x3fee9f41UL, 0xe0000000UL, 0x3c8760b1UL, + 0x00000000UL, 0x3fd00000UL, 0x0e5967d5UL, 0xbfac1d1fUL, 0xcff75cb0UL, + 0x3fef6297UL, 0x20000000UL, 0x3c756217UL, 0x00000000UL, 0x3fd00000UL, + 0x0f592f50UL, 0xbf9ba165UL, 0xa3d12526UL, 0x3fefd88dUL, 0x40000000UL, + 0xbc887df6UL, 0x00000000UL, 0x3fc00000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x0f592f50UL, 0x3f9ba165UL, 0xa3d12526UL, 0x3fefd88dUL, + 0x40000000UL, 0xbc887df6UL, 0x00000000UL, 0xbfc00000UL, 0x0e5967d5UL, + 0x3fac1d1fUL, 0xcff75cb0UL, 0x3fef6297UL, 0x20000000UL, 0x3c756217UL, + 0x00000000UL, 0xbfd00000UL, 0x76acf82dUL, 0xbfa4a031UL, 0x56c62ddaUL, + 0x3fee9f41UL, 0xe0000000UL, 0x3c8760b1UL, 0x00000000UL, 0xbfd00000UL, + 0x65455a75UL, 0x3fbe0875UL, 0xcf328d46UL, 0x3fed906bUL, 0x20000000UL, + 0x3c7457e6UL, 0x00000000UL, 0xbfe00000UL, 0x7f909c4eUL, 0x3f9d4a2cUL, + 0xf180bdb1UL, 0x3fec38b2UL, 0x80000000UL, 0xbc76e0b1UL, 0x00000000UL, + 0xbfe00000UL, 0x9ae68c87UL, 0xbfac73b3UL, 0x290ea1a3UL, 0x3fea9b66UL, + 0xe0000000UL, 0x3c39f630UL, 0x00000000UL, 0xbfe00000UL, 0x94247758UL, + 0xbfc133ccUL, 0x6b151741UL, 0x3fe8bc80UL, 0x20000000UL, 0xbc82c5e1UL, + 0x00000000UL, 0xbfe00000UL, 0x99fcef32UL, 0xbfca8279UL, 0x667f3bcdUL, + 0x3fe6a09eUL, 0x20000000UL, 0xbc8bdd34UL, 0x00000000UL, 0xbfe00000UL, + 0x53aba2fdUL, 0x3fcd0dfeUL, 0x25091dd6UL, 0x3fe44cf3UL, 0x20000000UL, + 0x3c68076aUL, 0x00000000UL, 0xbff00000UL, 0x5bc57974UL, 0x3fc59267UL, + 0x39ae68c8UL, 0x3fe1c73bUL, 0x20000000UL, 0x3c8b25ddUL, 0x00000000UL, + 0xbff00000UL, 0x73fa1279UL, 0x3fbe3a68UL, 0x3806f63bUL, 0x3fde2b5dUL, + 0x20000000UL, 0x3c5e0d89UL, 0x00000000UL, 0xbff00000UL, 0x866b95cfUL, + 0x3fb37ca1UL, 0xa6aea963UL, 0x3fd87de2UL, 0xe0000000UL, 0xbc672cedUL, + 0x00000000UL, 0xbff00000UL, 0x939d225aUL, 0x3fa60beaUL, 0x2ed59f06UL, + 0x3fd29406UL, 0xa0000000UL, 0xbc75d28dUL, 0x00000000UL, 0xbff00000UL, + 0x011469fbUL, 0x3f93ad06UL, 0x3c69a60bUL, 0x3fc8f8b8UL, 0xc0000000UL, + 0xbc626d19UL, 0x00000000UL, 0xbff00000UL, 0x176d6d31UL, 0x3f73b92eUL, + 0xbc29b42cUL, 0x3fb917a6UL, 0xe0000000UL, 0xbc3e2718UL, 0x00000000UL, + 0xbff00000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0xbff00000UL, 0x176d6d31UL, + 0x3f73b92eUL, 0xbc29b42cUL, 0xbfb917a6UL, 0xe0000000UL, 0x3c3e2718UL, + 0x00000000UL, 0xbff00000UL, 0x011469fbUL, 0x3f93ad06UL, 0x3c69a60bUL, + 0xbfc8f8b8UL, 0xc0000000UL, 0x3c626d19UL, 0x00000000UL, 0xbff00000UL, + 0x939d225aUL, 0x3fa60beaUL, 0x2ed59f06UL, 0xbfd29406UL, 0xa0000000UL, + 0x3c75d28dUL, 0x00000000UL, 0xbff00000UL, 0x866b95cfUL, 0x3fb37ca1UL, + 0xa6aea963UL, 0xbfd87de2UL, 0xe0000000UL, 0x3c672cedUL, 0x00000000UL, + 0xbff00000UL, 0x73fa1279UL, 0x3fbe3a68UL, 0x3806f63bUL, 0xbfde2b5dUL, + 0x20000000UL, 0xbc5e0d89UL, 0x00000000UL, 0xbff00000UL, 0x5bc57974UL, + 0x3fc59267UL, 0x39ae68c8UL, 0xbfe1c73bUL, 0x20000000UL, 0xbc8b25ddUL, + 0x00000000UL, 0xbff00000UL, 0x53aba2fdUL, 0x3fcd0dfeUL, 0x25091dd6UL, + 0xbfe44cf3UL, 0x20000000UL, 0xbc68076aUL, 0x00000000UL, 0xbff00000UL, + 0x99fcef32UL, 0xbfca8279UL, 0x667f3bcdUL, 0xbfe6a09eUL, 0x20000000UL, + 0x3c8bdd34UL, 0x00000000UL, 0xbfe00000UL, 0x94247758UL, 0xbfc133ccUL, + 0x6b151741UL, 0xbfe8bc80UL, 0x20000000UL, 0x3c82c5e1UL, 0x00000000UL, + 0xbfe00000UL, 0x9ae68c87UL, 0xbfac73b3UL, 0x290ea1a3UL, 0xbfea9b66UL, + 0xe0000000UL, 0xbc39f630UL, 0x00000000UL, 0xbfe00000UL, 0x7f909c4eUL, + 0x3f9d4a2cUL, 0xf180bdb1UL, 0xbfec38b2UL, 0x80000000UL, 0x3c76e0b1UL, + 0x00000000UL, 0xbfe00000UL, 0x65455a75UL, 0x3fbe0875UL, 0xcf328d46UL, + 0xbfed906bUL, 0x20000000UL, 0xbc7457e6UL, 0x00000000UL, 0xbfe00000UL, + 0x76acf82dUL, 0xbfa4a031UL, 0x56c62ddaUL, 0xbfee9f41UL, 0xe0000000UL, + 0xbc8760b1UL, 0x00000000UL, 0xbfd00000UL, 0x0e5967d5UL, 0x3fac1d1fUL, + 0xcff75cb0UL, 0xbfef6297UL, 0x20000000UL, 0xbc756217UL, 0x00000000UL, + 0xbfd00000UL, 0x0f592f50UL, 0x3f9ba165UL, 0xa3d12526UL, 0xbfefd88dUL, + 0x40000000UL, 0x3c887df6UL, 0x00000000UL, 0xbfc00000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0xbff00000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x0f592f50UL, 0xbf9ba165UL, 0xa3d12526UL, + 0xbfefd88dUL, 0x40000000UL, 0x3c887df6UL, 0x00000000UL, 0x3fc00000UL, + 0x0e5967d5UL, 0xbfac1d1fUL, 0xcff75cb0UL, 0xbfef6297UL, 0x20000000UL, + 0xbc756217UL, 0x00000000UL, 0x3fd00000UL, 0x76acf82dUL, 0x3fa4a031UL, + 0x56c62ddaUL, 0xbfee9f41UL, 0xe0000000UL, 0xbc8760b1UL, 0x00000000UL, + 0x3fd00000UL, 0x65455a75UL, 0xbfbe0875UL, 0xcf328d46UL, 0xbfed906bUL, + 0x20000000UL, 0xbc7457e6UL, 0x00000000UL, 0x3fe00000UL, 0x7f909c4eUL, + 0xbf9d4a2cUL, 0xf180bdb1UL, 0xbfec38b2UL, 0x80000000UL, 0x3c76e0b1UL, + 0x00000000UL, 0x3fe00000UL, 0x9ae68c87UL, 0x3fac73b3UL, 0x290ea1a3UL, + 0xbfea9b66UL, 0xe0000000UL, 0xbc39f630UL, 0x00000000UL, 0x3fe00000UL, + 0x94247758UL, 0x3fc133ccUL, 0x6b151741UL, 0xbfe8bc80UL, 0x20000000UL, + 0x3c82c5e1UL, 0x00000000UL, 0x3fe00000UL, 0x99fcef32UL, 0x3fca8279UL, + 0x667f3bcdUL, 0xbfe6a09eUL, 0x20000000UL, 0x3c8bdd34UL, 0x00000000UL, + 0x3fe00000UL, 0x53aba2fdUL, 0xbfcd0dfeUL, 0x25091dd6UL, 0xbfe44cf3UL, + 0x20000000UL, 0xbc68076aUL, 0x00000000UL, 0x3ff00000UL, 0x5bc57974UL, + 0xbfc59267UL, 0x39ae68c8UL, 0xbfe1c73bUL, 0x20000000UL, 0xbc8b25ddUL, + 0x00000000UL, 0x3ff00000UL, 0x73fa1279UL, 0xbfbe3a68UL, 0x3806f63bUL, + 0xbfde2b5dUL, 0x20000000UL, 0xbc5e0d89UL, 0x00000000UL, 0x3ff00000UL, + 0x866b95cfUL, 0xbfb37ca1UL, 0xa6aea963UL, 0xbfd87de2UL, 0xe0000000UL, + 0x3c672cedUL, 0x00000000UL, 0x3ff00000UL, 0x939d225aUL, 0xbfa60beaUL, + 0x2ed59f06UL, 0xbfd29406UL, 0xa0000000UL, 0x3c75d28dUL, 0x00000000UL, + 0x3ff00000UL, 0x011469fbUL, 0xbf93ad06UL, 0x3c69a60bUL, 0xbfc8f8b8UL, + 0xc0000000UL, 0x3c626d19UL, 0x00000000UL, 0x3ff00000UL, 0x176d6d31UL, + 0xbf73b92eUL, 0xbc29b42cUL, 0xbfb917a6UL, 0xe0000000UL, 0x3c3e2718UL, + 0x00000000UL, 0x3ff00000UL +}; - assert_different_registers(tmp, eax, ecx, edx); +ALIGNED_(16) juint _SC_2[] = +{ + 0x11111111UL, 0x3f811111UL, 0x55555555UL, 0x3fa55555UL +}; - address static_const_table_pow = (address)_static_const_table_pow; +ALIGNED_(16) juint _SC_3[] = +{ + 0x1a01a01aUL, 0xbf2a01a0UL, 0x16c16c17UL, 0xbf56c16cUL +}; + +ALIGNED_(16) juint _SC_1[] = +{ + 0x55555555UL, 0xbfc55555UL, 0x00000000UL, 0xbfe00000UL +}; + +ALIGNED_(16) juint _PI_INV_TABLE[] = +{ + 0x00000000UL, 0x00000000UL, 0xa2f9836eUL, 0x4e441529UL, 0xfc2757d1UL, + 0xf534ddc0UL, 0xdb629599UL, 0x3c439041UL, 0xfe5163abUL, 0xdebbc561UL, + 0xb7246e3aUL, 0x424dd2e0UL, 0x06492eeaUL, 0x09d1921cUL, 0xfe1deb1cUL, + 0xb129a73eUL, 0xe88235f5UL, 0x2ebb4484UL, 0xe99c7026UL, 0xb45f7e41UL, + 0x3991d639UL, 0x835339f4UL, 0x9c845f8bUL, 0xbdf9283bUL, 0x1ff897ffUL, + 0xde05980fUL, 0xef2f118bUL, 0x5a0a6d1fUL, 0x6d367ecfUL, 0x27cb09b7UL, + 0x4f463f66UL, 0x9e5fea2dUL, 0x7527bac7UL, 0xebe5f17bUL, 0x3d0739f7UL, + 0x8a5292eaUL, 0x6bfb5fb1UL, 0x1f8d5d08UL, 0x56033046UL, 0xfc7b6babUL, + 0xf0cfbc21UL +}; + +ALIGNED_(8) juint _PI_4[] = +{ + 0x40000000UL, 0x3fe921fbUL, 0x18469899UL, 0x3e64442dUL +}; + +ALIGNED_(8) juint _PI32INV[] = +{ + 0x6dc9c883UL, 0x40245f30UL +}; + +ALIGNED_(8) juint _SHIFTER[] = +{ + 0x00000000UL, 0x43380000UL +}; + +ALIGNED_(8) juint _SIGN_MASK[] = +{ + 0x00000000UL, 0x80000000UL +}; + +ALIGNED_(8) juint _P_3[] = +{ + 0x2e037073UL, 0x3b63198aUL +}; + +ALIGNED_(8) juint _ALL_ONES[] = +{ + 0xffffffffUL, 0x3fefffffUL +}; + +ALIGNED_(8) juint _TWO_POW_55[] = +{ + 0x00000000UL, 0x43600000UL +}; + +ALIGNED_(8) juint _TWO_POW_M55[] = +{ + 0x00000000UL, 0x3c800000ULL +}; + +ALIGNED_(8) juint _P_1[] = +{ + 0x54400000UL, 0x3fb921fbUL +}; + +ALIGNED_(8) juint _NEG_ZERO[] = +{ + 0x00000000UL, 0x80000000UL +}; + +void MacroAssembler::fast_sin(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ebx, Register ecx, Register edx, Register tmp1, Register tmp2, Register tmp3, Register tmp4) { + Label L_2TAG_PACKET_0_0_1, L_2TAG_PACKET_1_0_1, L_2TAG_PACKET_2_0_1, L_2TAG_PACKET_3_0_1; + Label L_2TAG_PACKET_4_0_1, L_2TAG_PACKET_5_0_1, L_2TAG_PACKET_6_0_1, L_2TAG_PACKET_7_0_1; + Label L_2TAG_PACKET_8_0_1, L_2TAG_PACKET_9_0_1, L_2TAG_PACKET_10_0_1, L_2TAG_PACKET_11_0_1; + Label L_2TAG_PACKET_13_0_1, L_2TAG_PACKET_14_0_1; + Label L_2TAG_PACKET_12_0_1, B1_1, B1_2, B1_4, start; + + assert_different_registers(tmp1, tmp2, tmp3, tmp4, eax, ebx, ecx, edx); + address ONEHALF = (address)_ONEHALF; + address P_2 = (address)_P_2; + address SC_4 = (address)_SC_4; + address Ctable = (address)_Ctable; + address SC_2 = (address)_SC_2; + address SC_3 = (address)_SC_3; + address SC_1 = (address)_SC_1; + address PI_INV_TABLE = (address)_PI_INV_TABLE; + address PI_4 = (address)_PI_4; + address PI32INV = (address)_PI32INV; + address SHIFTER = (address)_SHIFTER; + address SIGN_MASK = (address)_SIGN_MASK; + address P_3 = (address)_P_3; + address ALL_ONES = (address)_ALL_ONES; + address TWO_POW_55 = (address)_TWO_POW_55; + address TWO_POW_M55 = (address)_TWO_POW_M55; + address P_1 = (address)_P_1; + address NEG_ZERO = (address)_NEG_ZERO; bind(start); - subl(rsp, 120); - movl(Address(rsp, 64), tmp); - lea(tmp, ExternalAddress(static_const_table_pow)); - movsd(xmm0, Address(rsp, 128)); - movsd(xmm1, Address(rsp, 136)); - xorpd(xmm2, xmm2); - movl(eax, 16368); - pinsrw(xmm2, eax, 3); - movl(ecx, 1069088768); - movdl(xmm7, ecx); - movsd(Address(rsp, 16), xmm1); - xorpd(xmm1, xmm1); - movl(edx, 30704); - pinsrw(xmm1, edx, 3); + push(rbx); + subq(rsp, 16); movsd(Address(rsp, 8), xmm0); - movdqu(xmm3, xmm0); - movl(edx, 8192); - movdl(xmm4, edx); - movdqu(xmm6, Address(tmp, 8240)); - pextrw(eax, xmm0, 3); - por(xmm0, xmm2); - psllq(xmm0, 5); - movsd(xmm2, Address(tmp, 8256)); - psrlq(xmm0, 34); - movl(edx, eax); - andl(edx, 32752); - subl(edx, 16368); - movl(ecx, edx); - sarl(edx, 31); - addl(ecx, edx); - xorl(ecx, edx); - rcpss(xmm0, xmm0); - psllq(xmm3, 12); - addl(ecx, 16); - bsrl(ecx, ecx); - psrlq(xmm3, 12); - movl(Address(rsp, 24), rsi); - subl(eax, 16); - cmpl(eax, 32736); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_0_0_2); - movl(rsi, 0); - - bind(L_2TAG_PACKET_1_0_2); - mulss(xmm0, xmm7); - movl(edx, -1); - subl(ecx, 4); - shll(edx); - movdl(xmm5, edx); - por(xmm3, xmm1); - subl(eax, 16351); - cmpl(eax, 1); - jcc(Assembler::belowEqual, L_2TAG_PACKET_2_0_2); - paddd(xmm0, xmm4); - psllq(xmm5, 32); - movdl(edx, xmm0); - psllq(xmm0, 29); - pand(xmm5, xmm3); - - bind(L_2TAG_PACKET_3_0_2); - pand(xmm0, xmm6); - subsd(xmm3, xmm5); - subl(eax, 1); - sarl(eax, 4); - cvtsi2sdl(xmm7, eax); - mulpd(xmm5, xmm0); - - bind(L_2TAG_PACKET_4_0_2); - mulsd(xmm3, xmm0); - movdqu(xmm1, Address(tmp, 8272)); - subsd(xmm5, xmm2); - movdqu(xmm4, Address(tmp, 8288)); - movl(ecx, eax); - sarl(eax, 31); - addl(ecx, eax); - xorl(eax, ecx); - addl(eax, 1); - bsrl(eax, eax); - unpcklpd(xmm5, xmm3); - movdqu(xmm6, Address(tmp, 8304)); - addsd(xmm3, xmm5); - andl(edx, 16760832); - shrl(edx, 10); - addpd(xmm5, Address(tmp, edx, Address::times_1, -3616)); - movdqu(xmm0, Address(tmp, 8320)); - pshufd(xmm2, xmm3, 68); - mulsd(xmm3, xmm3); - mulpd(xmm1, xmm2); - mulpd(xmm4, xmm2); - addsd(xmm5, xmm7); - mulsd(xmm2, xmm3); - addpd(xmm6, xmm1); - mulsd(xmm3, xmm3); - addpd(xmm0, xmm4); - movsd(xmm1, Address(rsp, 16)); - movzwl(ecx, Address(rsp, 22)); - pshufd(xmm7, xmm5, 238); - movsd(xmm4, Address(tmp, 8368)); - mulpd(xmm6, xmm2); - pshufd(xmm3, xmm3, 68); - mulpd(xmm0, xmm2); - shll(eax, 4); - subl(eax, 15872); - andl(ecx, 32752); - addl(eax, ecx); - mulpd(xmm3, xmm6); - cmpl(eax, 624); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_5_0_2); - xorpd(xmm6, xmm6); - movl(edx, 17080); - pinsrw(xmm6, edx, 3); - movdqu(xmm2, xmm1); - pand(xmm4, xmm1); - subsd(xmm1, xmm4); - mulsd(xmm4, xmm5); - addsd(xmm0, xmm7); - mulsd(xmm1, xmm5); - movdqu(xmm7, xmm6); - addsd(xmm6, xmm4); - addpd(xmm3, xmm0); - movdl(edx, xmm6); - subsd(xmm6, xmm7); - pshufd(xmm0, xmm3, 238); - subsd(xmm4, xmm6); - addsd(xmm0, xmm3); - movl(ecx, edx); - andl(edx, 255); - addl(edx, edx); - movdqu(xmm5, Address(tmp, edx, Address::times_8, 8384)); - addsd(xmm4, xmm1); - mulsd(xmm2, xmm0); - movdqu(xmm7, Address(tmp, 12480)); - movdqu(xmm3, Address(tmp, 12496)); - shll(ecx, 12); - xorl(ecx, rsi); - andl(ecx, -1048576); - movdl(xmm6, ecx); - addsd(xmm2, xmm4); - movsd(xmm1, Address(tmp, 12512)); - pshufd(xmm0, xmm2, 68); - pshufd(xmm4, xmm2, 68); - mulpd(xmm0, xmm0); - movl(rsi, Address(rsp, 24)); - mulpd(xmm7, xmm4); - pshufd(xmm6, xmm6, 17); - mulsd(xmm1, xmm2); - mulsd(xmm0, xmm0); - paddd(xmm5, xmm6); - addpd(xmm3, xmm7); - mulsd(xmm1, xmm5); - pshufd(xmm6, xmm5, 238); - mulpd(xmm0, xmm3); - addsd(xmm1, xmm6); - pshufd(xmm3, xmm0, 238); - mulsd(xmm0, xmm5); - mulsd(xmm3, xmm5); - addsd(xmm0, xmm1); - addsd(xmm0, xmm3); - addsd(xmm0, xmm5); - movsd(Address(rsp, 0), xmm0); - fld_d(Address(rsp, 0)); - jmp(L_2TAG_PACKET_6_0_2); - - bind(L_2TAG_PACKET_7_0_2); - movsd(xmm0, Address(rsp, 128)); - movsd(xmm1, Address(rsp, 136)); - mulsd(xmm0, xmm1); - movsd(Address(rsp, 0), xmm0); - fld_d(Address(rsp, 0)); - jmp(L_2TAG_PACKET_6_0_2); - - bind(L_2TAG_PACKET_0_0_2); - addl(eax, 16); - movl(edx, 32752); - andl(edx, eax); - cmpl(edx, 32752); - jcc(Assembler::equal, L_2TAG_PACKET_8_0_2); - testl(eax, 32768); - jcc(Assembler::notEqual, L_2TAG_PACKET_9_0_2); - - bind(L_2TAG_PACKET_10_0_2); - movl(ecx, Address(rsp, 16)); - xorl(edx, edx); - testl(ecx, ecx); - movl(ecx, 1); - cmovl(Assembler::notEqual, edx, ecx); - orl(edx, Address(rsp, 20)); - cmpl(edx, 1072693248); - jcc(Assembler::equal, L_2TAG_PACKET_7_0_2); - movsd(xmm0, Address(rsp, 8)); - movsd(xmm3, Address(rsp, 8)); - movdl(edx, xmm3); - psrlq(xmm3, 32); - movdl(ecx, xmm3); - orl(edx, ecx); - cmpl(edx, 0); - jcc(Assembler::equal, L_2TAG_PACKET_11_0_2); - xorpd(xmm3, xmm3); - movl(eax, 18416); - pinsrw(xmm3, eax, 3); - mulsd(xmm0, xmm3); - xorpd(xmm2, xmm2); - movl(eax, 16368); - pinsrw(xmm2, eax, 3); - movdqu(xmm3, xmm0); - pextrw(eax, xmm0, 3); - por(xmm0, xmm2); - movl(ecx, 18416); - psllq(xmm0, 5); - movsd(xmm2, Address(tmp, 8256)); - psrlq(xmm0, 34); - rcpss(xmm0, xmm0); - psllq(xmm3, 12); - movdqu(xmm6, Address(tmp, 8240)); - psrlq(xmm3, 12); - mulss(xmm0, xmm7); - movl(edx, -1024); - movdl(xmm5, edx); - por(xmm3, xmm1); - paddd(xmm0, xmm4); - psllq(xmm5, 32); - movdl(edx, xmm0); - psllq(xmm0, 29); - pand(xmm5, xmm3); - movl(rsi, 0); - pand(xmm0, xmm6); - subsd(xmm3, xmm5); - andl(eax, 32752); - subl(eax, 18416); - sarl(eax, 4); - cvtsi2sdl(xmm7, eax); - mulpd(xmm5, xmm0); - jmp(L_2TAG_PACKET_4_0_2); - - bind(L_2TAG_PACKET_12_0_2); - movl(ecx, Address(rsp, 16)); - xorl(edx, edx); - testl(ecx, ecx); - movl(ecx, 1); - cmovl(Assembler::notEqual, edx, ecx); - orl(edx, Address(rsp, 20)); - cmpl(edx, 1072693248); - jcc(Assembler::equal, L_2TAG_PACKET_7_0_2); - movsd(xmm0, Address(rsp, 8)); - movsd(xmm3, Address(rsp, 8)); - movdl(edx, xmm3); - psrlq(xmm3, 32); - movdl(ecx, xmm3); - orl(edx, ecx); - cmpl(edx, 0); - jcc(Assembler::equal, L_2TAG_PACKET_11_0_2); - xorpd(xmm3, xmm3); - movl(eax, 18416); - pinsrw(xmm3, eax, 3); - mulsd(xmm0, xmm3); - xorpd(xmm2, xmm2); - movl(eax, 16368); - pinsrw(xmm2, eax, 3); - movdqu(xmm3, xmm0); - pextrw(eax, xmm0, 3); - por(xmm0, xmm2); - movl(ecx, 18416); - psllq(xmm0, 5); - movsd(xmm2, Address(tmp, 8256)); - psrlq(xmm0, 34); - rcpss(xmm0, xmm0); - psllq(xmm3, 12); - movdqu(xmm6, Address(tmp, 8240)); - psrlq(xmm3, 12); - mulss(xmm0, xmm7); - movl(edx, -1024); - movdl(xmm5, edx); - por(xmm3, xmm1); - paddd(xmm0, xmm4); - psllq(xmm5, 32); - movdl(edx, xmm0); - psllq(xmm0, 29); - pand(xmm5, xmm3); - movl(rsi, INT_MIN); - pand(xmm0, xmm6); - subsd(xmm3, xmm5); - andl(eax, 32752); - subl(eax, 18416); - sarl(eax, 4); - cvtsi2sdl(xmm7, eax); - mulpd(xmm5, xmm0); - jmp(L_2TAG_PACKET_4_0_2); - - bind(L_2TAG_PACKET_5_0_2); - cmpl(eax, 0); - jcc(Assembler::less, L_2TAG_PACKET_13_0_2); - cmpl(eax, 752); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_14_0_2); - - bind(L_2TAG_PACKET_15_0_2); - addsd(xmm0, xmm7); - movsd(xmm2, Address(tmp, 12544)); - addpd(xmm3, xmm0); - xorpd(xmm6, xmm6); - movl(eax, 17080); - pinsrw(xmm6, eax, 3); - pshufd(xmm0, xmm3, 238); - addsd(xmm0, xmm3); - movdqu(xmm3, xmm5); - addsd(xmm5, xmm0); - movdqu(xmm4, xmm2); - subsd(xmm3, xmm5); - movdqu(xmm7, xmm5); - pand(xmm5, xmm2); - movdqu(xmm2, xmm1); - pand(xmm4, xmm1); - subsd(xmm7, xmm5); - addsd(xmm0, xmm3); - subsd(xmm1, xmm4); - mulsd(xmm4, xmm5); - addsd(xmm0, xmm7); - mulsd(xmm2, xmm0); - movdqu(xmm7, xmm6); - mulsd(xmm1, xmm5); - addsd(xmm6, xmm4); - movdl(eax, xmm6); - subsd(xmm6, xmm7); - addsd(xmm2, xmm1); - movdqu(xmm7, Address(tmp, 12480)); - movdqu(xmm3, Address(tmp, 12496)); - subsd(xmm4, xmm6); - pextrw(edx, xmm6, 3); - movl(ecx, eax); - andl(eax, 255); - addl(eax, eax); - movdqu(xmm5, Address(tmp, eax, Address::times_8, 8384)); - addsd(xmm2, xmm4); - sarl(ecx, 8); - movl(eax, ecx); - sarl(ecx, 1); - subl(eax, ecx); - shll(ecx, 20); - xorl(ecx, rsi); - movdl(xmm6, ecx); - movsd(xmm1, Address(tmp, 12512)); - andl(edx, 32767); - cmpl(edx, 16529); - jcc(Assembler::above, L_2TAG_PACKET_14_0_2); - pshufd(xmm0, xmm2, 68); - pshufd(xmm4, xmm2, 68); - mulpd(xmm0, xmm0); - mulpd(xmm7, xmm4); - pshufd(xmm6, xmm6, 17); - mulsd(xmm1, xmm2); - mulsd(xmm0, xmm0); - paddd(xmm5, xmm6); - addpd(xmm3, xmm7); - mulsd(xmm1, xmm5); - pshufd(xmm6, xmm5, 238); - mulpd(xmm0, xmm3); - addsd(xmm1, xmm6); - pshufd(xmm3, xmm0, 238); - mulsd(xmm0, xmm5); - mulsd(xmm3, xmm5); - shll(eax, 4); - xorpd(xmm4, xmm4); - addl(eax, 16368); - pinsrw(xmm4, eax, 3); - addsd(xmm0, xmm1); - movl(rsi, Address(rsp, 24)); - addsd(xmm0, xmm3); - movdqu(xmm1, xmm0); - addsd(xmm0, xmm5); - mulsd(xmm0, xmm4); - pextrw(eax, xmm0, 3); - andl(eax, 32752); - jcc(Assembler::equal, L_2TAG_PACKET_16_0_2); - cmpl(eax, 32752); - jcc(Assembler::equal, L_2TAG_PACKET_17_0_2); - - bind(L_2TAG_PACKET_18_0_2); - movsd(Address(rsp, 0), xmm0); - fld_d(Address(rsp, 0)); - jmp(L_2TAG_PACKET_6_0_2); - - bind(L_2TAG_PACKET_8_0_2); - movsd(xmm1, Address(rsp, 16)); - movsd(xmm0, Address(rsp, 8)); - movdqu(xmm2, xmm0); - movdl(eax, xmm2); - psrlq(xmm2, 20); - movdl(edx, xmm2); - orl(eax, edx); - jcc(Assembler::equal, L_2TAG_PACKET_19_0_2); - addsd(xmm0, xmm0); - movdl(eax, xmm1); - psrlq(xmm1, 32); - movdl(edx, xmm1); - movl(ecx, edx); - addl(edx, edx); - orl(eax, edx); - jcc(Assembler::equal, L_2TAG_PACKET_20_0_2); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_20_0_2); - xorpd(xmm0, xmm0); - movl(eax, 16368); - pinsrw(xmm0, eax, 3); - movl(edx, 29); - jmp(L_2TAG_PACKET_21_0_2); - - bind(L_2TAG_PACKET_22_0_2); - movsd(xmm0, Address(rsp, 16)); - addpd(xmm0, xmm0); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_19_0_2); - movdl(eax, xmm1); - movdqu(xmm2, xmm1); - psrlq(xmm1, 32); - movdl(edx, xmm1); - movl(ecx, edx); - addl(edx, edx); - orl(eax, edx); - jcc(Assembler::equal, L_2TAG_PACKET_23_0_2); - pextrw(eax, xmm2, 3); - andl(eax, 32752); - cmpl(eax, 32752); - jcc(Assembler::notEqual, L_2TAG_PACKET_24_0_2); - movdl(eax, xmm2); - psrlq(xmm2, 20); - movdl(edx, xmm2); - orl(eax, edx); - jcc(Assembler::notEqual, L_2TAG_PACKET_22_0_2); - - bind(L_2TAG_PACKET_24_0_2); - pextrw(eax, xmm0, 3); - testl(eax, 32768); - jcc(Assembler::notEqual, L_2TAG_PACKET_25_0_2); - testl(ecx, INT_MIN); - jcc(Assembler::notEqual, L_2TAG_PACKET_26_0_2); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_27_0_2); - movsd(xmm1, Address(rsp, 16)); - movdl(eax, xmm1); - testl(eax, 1); - jcc(Assembler::notEqual, L_2TAG_PACKET_28_0_2); - testl(eax, 2); - jcc(Assembler::notEqual, L_2TAG_PACKET_29_0_2); - jmp(L_2TAG_PACKET_28_0_2); - - bind(L_2TAG_PACKET_25_0_2); - shrl(ecx, 20); - andl(ecx, 2047); - cmpl(ecx, 1075); - jcc(Assembler::above, L_2TAG_PACKET_28_0_2); - jcc(Assembler::equal, L_2TAG_PACKET_30_0_2); - cmpl(ecx, 1074); - jcc(Assembler::above, L_2TAG_PACKET_27_0_2); - cmpl(ecx, 1023); - jcc(Assembler::below, L_2TAG_PACKET_28_0_2); - movsd(xmm1, Address(rsp, 16)); - movl(eax, 17208); - xorpd(xmm3, xmm3); - pinsrw(xmm3, eax, 3); - movdqu(xmm4, xmm3); - addsd(xmm3, xmm1); + movl(eax, Address(rsp, 12)); + movq(xmm1, ExternalAddress(PI32INV)); //0x6dc9c883UL, 0x40245f30UL + movq(xmm2, ExternalAddress(SHIFTER)); //0x00000000UL, 0x43380000UL + andl(eax, 2147418112); + subl(eax, 808452096); + cmpl(eax, 281346048); + jcc(Assembler::above, L_2TAG_PACKET_0_0_1); + mulsd(xmm1, xmm0); + movdqu(xmm5, ExternalAddress(ONEHALF)); //0x00000000UL, 0x3fe00000UL, 0x00000000UL, 0x3fe00000UL + movq(xmm4, ExternalAddress(SIGN_MASK)); //0x00000000UL, 0x80000000UL + pand(xmm4, xmm0); + por(xmm5, xmm4); + addpd(xmm1, xmm5); + cvttsd2sil(edx, xmm1); + cvtsi2sdl(xmm1, edx); + movdqu(xmm6, ExternalAddress(P_2)); //0x1a600000UL, 0x3d90b461UL, 0x1a600000UL, 0x3d90b461UL + mov64(r8, 0x3fb921fb54400000); + movdq(xmm3, r8); + movdqu(xmm5, ExternalAddress(SC_4)); //0xa556c734UL, 0x3ec71de3UL, 0x1a01a01aUL, 0x3efa01a0UL + pshufd(xmm4, xmm0, 68); + mulsd(xmm3, xmm1); + movddup(xmm1, xmm1); + andl(edx, 63); + shll(edx, 5); + lea(rax, ExternalAddress(Ctable)); + addq(rax, rdx); + mulpd(xmm6, xmm1); + mulsd(xmm1, ExternalAddress(P_3)); //0x2e037073UL, 0x3b63198aUL subsd(xmm4, xmm3); - addsd(xmm1, xmm4); - pextrw(eax, xmm1, 3); - andl(eax, 32752); - jcc(Assembler::notEqual, L_2TAG_PACKET_28_0_2); - movdl(eax, xmm3); - andl(eax, 1); - jcc(Assembler::equal, L_2TAG_PACKET_28_0_2); - - bind(L_2TAG_PACKET_29_0_2); - movsd(xmm1, Address(rsp, 16)); - pextrw(eax, xmm1, 3); - andl(eax, 32768); - jcc(Assembler::equal, L_2TAG_PACKET_18_0_2); - xorpd(xmm0, xmm0); - movl(eax, 32768); - pinsrw(xmm0, eax, 3); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_28_0_2); - movsd(xmm1, Address(rsp, 16)); - pextrw(eax, xmm1, 3); - andl(eax, 32768); - jcc(Assembler::notEqual, L_2TAG_PACKET_26_0_2); - - bind(L_2TAG_PACKET_31_0_2); - xorpd(xmm0, xmm0); - movl(eax, 32752); - pinsrw(xmm0, eax, 3); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_30_0_2); - movsd(xmm1, Address(rsp, 16)); - movdl(eax, xmm1); - andl(eax, 1); - jcc(Assembler::equal, L_2TAG_PACKET_28_0_2); - jmp(L_2TAG_PACKET_29_0_2); - - bind(L_2TAG_PACKET_32_0_2); - movdl(eax, xmm1); - psrlq(xmm1, 20); - movdl(edx, xmm1); - orl(eax, edx); - jcc(Assembler::equal, L_2TAG_PACKET_33_0_2); - movsd(xmm0, Address(rsp, 16)); - addsd(xmm0, xmm0); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_33_0_2); - movsd(xmm0, Address(rsp, 8)); - pextrw(eax, xmm0, 3); - cmpl(eax, 49136); - jcc(Assembler::notEqual, L_2TAG_PACKET_34_0_2); - movdl(ecx, xmm0); - psrlq(xmm0, 20); - movdl(edx, xmm0); - orl(ecx, edx); - jcc(Assembler::notEqual, L_2TAG_PACKET_34_0_2); - xorpd(xmm0, xmm0); - movl(eax, 32760); - pinsrw(xmm0, eax, 3); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_34_0_2); - movsd(xmm1, Address(rsp, 16)); - andl(eax, 32752); - subl(eax, 16368); - pextrw(edx, xmm1, 3); - xorpd(xmm0, xmm0); - xorl(eax, edx); - andl(eax, 32768); - jcc(Assembler::notEqual, L_2TAG_PACKET_18_0_2); - movl(ecx, 32752); - pinsrw(xmm0, ecx, 3); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_35_0_2); - movdl(eax, xmm1); - cmpl(edx, 17184); - jcc(Assembler::above, L_2TAG_PACKET_36_0_2); - testl(eax, 1); - jcc(Assembler::notEqual, L_2TAG_PACKET_37_0_2); - testl(eax, 2); - jcc(Assembler::equal, L_2TAG_PACKET_38_0_2); - jmp(L_2TAG_PACKET_39_0_2); - - bind(L_2TAG_PACKET_36_0_2); - testl(eax, 1); - jcc(Assembler::equal, L_2TAG_PACKET_38_0_2); - jmp(L_2TAG_PACKET_39_0_2); - - bind(L_2TAG_PACKET_9_0_2); - movsd(xmm2, Address(rsp, 8)); - movdl(eax, xmm2); - psrlq(xmm2, 31); - movdl(ecx, xmm2); - orl(eax, ecx); - jcc(Assembler::equal, L_2TAG_PACKET_11_0_2); - movsd(xmm1, Address(rsp, 16)); - pextrw(edx, xmm1, 3); - movdl(eax, xmm1); - movdqu(xmm2, xmm1); - psrlq(xmm2, 32); - movdl(ecx, xmm2); - addl(ecx, ecx); - orl(ecx, eax); - jcc(Assembler::equal, L_2TAG_PACKET_40_0_2); - andl(edx, 32752); - cmpl(edx, 32752); - jcc(Assembler::equal, L_2TAG_PACKET_32_0_2); - cmpl(edx, 17200); - jcc(Assembler::above, L_2TAG_PACKET_38_0_2); - cmpl(edx, 17184); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_35_0_2); - cmpl(edx, 16368); - jcc(Assembler::below, L_2TAG_PACKET_37_0_2); - movl(eax, 17208); - xorpd(xmm2, xmm2); - pinsrw(xmm2, eax, 3); - movdqu(xmm4, xmm2); - addsd(xmm2, xmm1); - subsd(xmm4, xmm2); - addsd(xmm1, xmm4); - pextrw(eax, xmm1, 3); - andl(eax, 32767); - jcc(Assembler::notEqual, L_2TAG_PACKET_37_0_2); - movdl(eax, xmm2); - andl(eax, 1); - jcc(Assembler::equal, L_2TAG_PACKET_38_0_2); - - bind(L_2TAG_PACKET_39_0_2); - xorpd(xmm1, xmm1); - movl(edx, 30704); - pinsrw(xmm1, edx, 3); - movsd(xmm2, Address(tmp, 8256)); - movsd(xmm4, Address(rsp, 8)); - pextrw(eax, xmm4, 3); - movl(edx, 8192); - movdl(xmm4, edx); - andl(eax, 32767); - subl(eax, 16); - jcc(Assembler::less, L_2TAG_PACKET_12_0_2); - movl(edx, eax); - andl(edx, 32752); - subl(edx, 16368); - movl(ecx, edx); - sarl(edx, 31); - addl(ecx, edx); - xorl(ecx, edx); - addl(ecx, 16); - bsrl(ecx, ecx); - movl(rsi, INT_MIN); - jmp(L_2TAG_PACKET_1_0_2); - - bind(L_2TAG_PACKET_37_0_2); - xorpd(xmm1, xmm1); - movl(eax, 32752); - pinsrw(xmm1, eax, 3); - xorpd(xmm0, xmm0); - mulsd(xmm0, xmm1); - movl(edx, 28); - jmp(L_2TAG_PACKET_21_0_2); - - bind(L_2TAG_PACKET_38_0_2); - xorpd(xmm1, xmm1); - movl(edx, 30704); - pinsrw(xmm1, edx, 3); - movsd(xmm2, Address(tmp, 8256)); - movsd(xmm4, Address(rsp, 8)); - pextrw(eax, xmm4, 3); - movl(edx, 8192); - movdl(xmm4, edx); - andl(eax, 32767); - subl(eax, 16); - jcc(Assembler::less, L_2TAG_PACKET_10_0_2); - movl(edx, eax); - andl(edx, 32752); - subl(edx, 16368); - movl(ecx, edx); - sarl(edx, 31); - addl(ecx, edx); - xorl(ecx, edx); - addl(ecx, 16); - bsrl(ecx, ecx); - movl(rsi, 0); - jmp(L_2TAG_PACKET_1_0_2); - - bind(L_2TAG_PACKET_23_0_2); - xorpd(xmm0, xmm0); - movl(eax, 16368); - pinsrw(xmm0, eax, 3); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_26_0_2); - xorpd(xmm0, xmm0); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_13_0_2); - addl(eax, 384); - cmpl(eax, 0); - jcc(Assembler::less, L_2TAG_PACKET_41_0_2); - mulsd(xmm5, xmm1); - addsd(xmm0, xmm7); - shrl(rsi, 31); - addpd(xmm3, xmm0); - pshufd(xmm0, xmm3, 238); - addsd(xmm3, xmm0); - movsd(xmm4, Address(tmp, rsi, Address::times_8, 12528)); - mulsd(xmm1, xmm3); - xorpd(xmm0, xmm0); - movl(eax, 16368); - shll(rsi, 15); - orl(eax, rsi); - pinsrw(xmm0, eax, 3); - addsd(xmm5, xmm1); - movl(rsi, Address(rsp, 24)); - mulsd(xmm5, xmm4); - addsd(xmm0, xmm5); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_41_0_2); - movl(rsi, Address(rsp, 24)); - xorpd(xmm0, xmm0); - movl(eax, 16368); - pinsrw(xmm0, eax, 3); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_40_0_2); - xorpd(xmm0, xmm0); - movl(eax, 16368); - pinsrw(xmm0, eax, 3); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_42_0_2); - xorpd(xmm0, xmm0); - movl(eax, 16368); - pinsrw(xmm0, eax, 3); - movl(edx, 26); - jmp(L_2TAG_PACKET_21_0_2); - - bind(L_2TAG_PACKET_11_0_2); - movsd(xmm1, Address(rsp, 16)); - movdqu(xmm2, xmm1); - pextrw(eax, xmm1, 3); - andl(eax, 32752); - cmpl(eax, 32752); - jcc(Assembler::notEqual, L_2TAG_PACKET_43_0_2); - movdl(eax, xmm2); - psrlq(xmm2, 20); - movdl(edx, xmm2); - orl(eax, edx); - jcc(Assembler::notEqual, L_2TAG_PACKET_22_0_2); - - bind(L_2TAG_PACKET_43_0_2); - movdl(eax, xmm1); - psrlq(xmm1, 32); - movdl(edx, xmm1); - movl(ecx, edx); - addl(edx, edx); - orl(eax, edx); - jcc(Assembler::equal, L_2TAG_PACKET_42_0_2); - shrl(edx, 21); - cmpl(edx, 1075); - jcc(Assembler::above, L_2TAG_PACKET_44_0_2); - jcc(Assembler::equal, L_2TAG_PACKET_45_0_2); - cmpl(edx, 1023); - jcc(Assembler::below, L_2TAG_PACKET_44_0_2); - movsd(xmm1, Address(rsp, 16)); - movl(eax, 17208); - xorpd(xmm3, xmm3); - pinsrw(xmm3, eax, 3); - movdqu(xmm4, xmm3); - addsd(xmm3, xmm1); - subsd(xmm4, xmm3); - addsd(xmm1, xmm4); - pextrw(eax, xmm1, 3); - andl(eax, 32752); - jcc(Assembler::notEqual, L_2TAG_PACKET_44_0_2); - movdl(eax, xmm3); - andl(eax, 1); - jcc(Assembler::equal, L_2TAG_PACKET_44_0_2); - - bind(L_2TAG_PACKET_46_0_2); - movsd(xmm0, Address(rsp, 8)); - testl(ecx, INT_MIN); - jcc(Assembler::notEqual, L_2TAG_PACKET_47_0_2); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_45_0_2); - movsd(xmm1, Address(rsp, 16)); - movdl(eax, xmm1); - testl(eax, 1); - jcc(Assembler::notEqual, L_2TAG_PACKET_46_0_2); - - bind(L_2TAG_PACKET_44_0_2); - testl(ecx, INT_MIN); - jcc(Assembler::equal, L_2TAG_PACKET_26_0_2); - xorpd(xmm0, xmm0); - - bind(L_2TAG_PACKET_47_0_2); - movl(eax, 16368); - xorpd(xmm1, xmm1); - pinsrw(xmm1, eax, 3); - divsd(xmm1, xmm0); - movdqu(xmm0, xmm1); - movl(edx, 27); - jmp(L_2TAG_PACKET_21_0_2); - - bind(L_2TAG_PACKET_14_0_2); - movsd(xmm2, Address(rsp, 8)); - movsd(xmm6, Address(rsp, 16)); - pextrw(eax, xmm2, 3); - pextrw(edx, xmm6, 3); - movl(ecx, 32752); - andl(ecx, edx); - cmpl(ecx, 32752); - jcc(Assembler::equal, L_2TAG_PACKET_48_0_2); - andl(eax, 32752); - subl(eax, 16368); - xorl(edx, eax); - testl(edx, 32768); - jcc(Assembler::notEqual, L_2TAG_PACKET_49_0_2); - - bind(L_2TAG_PACKET_50_0_2); - movl(eax, 32736); - pinsrw(xmm0, eax, 3); - shrl(rsi, 16); - orl(eax, rsi); - pinsrw(xmm1, eax, 3); - movl(rsi, Address(rsp, 24)); - mulsd(xmm0, xmm1); - - bind(L_2TAG_PACKET_17_0_2); - movl(edx, 24); - - bind(L_2TAG_PACKET_21_0_2); - movsd(Address(rsp, 0), xmm0); - fld_d(Address(rsp, 0)); - jmp(L_2TAG_PACKET_6_0_2); - - bind(L_2TAG_PACKET_49_0_2); - movl(eax, 16); - pinsrw(xmm0, eax, 3); - mulsd(xmm0, xmm0); - testl(rsi, INT_MIN); - jcc(Assembler::equal, L_2TAG_PACKET_51_0_2); - movsd(xmm2, Address(tmp, 12560)); - xorpd(xmm0, xmm2); - - bind(L_2TAG_PACKET_51_0_2); - movl(rsi, Address(rsp, 24)); - movl(edx, 25); - jmp(L_2TAG_PACKET_21_0_2); - - bind(L_2TAG_PACKET_16_0_2); - pextrw(ecx, xmm5, 3); - pextrw(edx, xmm4, 3); - movl(eax, -1); - andl(ecx, 32752); - subl(ecx, 16368); - andl(edx, 32752); - addl(edx, ecx); - movl(ecx, -31); - sarl(edx, 4); - subl(ecx, edx); - jcc(Assembler::lessEqual, L_2TAG_PACKET_52_0_2); - cmpl(ecx, 20); - jcc(Assembler::above, L_2TAG_PACKET_53_0_2); - shll(eax); - - bind(L_2TAG_PACKET_52_0_2); - movdl(xmm0, eax); - psllq(xmm0, 32); - pand(xmm0, xmm5); - subsd(xmm5, xmm0); - addsd(xmm5, xmm1); - mulsd(xmm0, xmm4); - mulsd(xmm5, xmm4); - addsd(xmm0, xmm5); - - bind(L_2TAG_PACKET_53_0_2); - movl(edx, 25); - jmp(L_2TAG_PACKET_21_0_2); - - bind(L_2TAG_PACKET_2_0_2); - movzwl(ecx, Address(rsp, 22)); - movl(edx, INT_MIN); - movdl(xmm1, edx); - xorpd(xmm7, xmm7); - paddd(xmm0, xmm4); - psllq(xmm5, 32); - movdl(edx, xmm0); - psllq(xmm0, 29); - paddq(xmm1, xmm3); - pand(xmm5, xmm1); - andl(ecx, 32752); - cmpl(ecx, 16560); - jcc(Assembler::below, L_2TAG_PACKET_3_0_2); - pand(xmm0, xmm6); - subsd(xmm3, xmm5); - addl(eax, 16351); - shrl(eax, 4); - subl(eax, 1022); - cvtsi2sdl(xmm7, eax); + movq(xmm7, Address(rax, 8)); + subsd(xmm0, xmm3); + movddup(xmm3, xmm4); + subsd(xmm4, xmm6); + pshufd(xmm0, xmm0, 68); + movdqu(xmm2, Address(rax, 0)); mulpd(xmm5, xmm0); - movsd(xmm4, Address(tmp, 0)); - mulsd(xmm3, xmm0); - movsd(xmm6, Address(tmp, 0)); - subsd(xmm5, xmm2); - movsd(xmm1, Address(tmp, 8)); - pshufd(xmm2, xmm3, 68); - unpcklpd(xmm5, xmm3); - addsd(xmm3, xmm5); - movsd(xmm0, Address(tmp, 8)); - andl(edx, 16760832); - shrl(edx, 10); - addpd(xmm7, Address(tmp, edx, Address::times_1, -3616)); - mulsd(xmm4, xmm5); - mulsd(xmm0, xmm5); - mulsd(xmm6, xmm2); - mulsd(xmm1, xmm2); - movdqu(xmm2, xmm5); - mulsd(xmm4, xmm5); - addsd(xmm5, xmm0); - movdqu(xmm0, xmm7); + subpd(xmm0, xmm6); + mulsd(xmm7, xmm4); + subsd(xmm3, xmm4); + mulpd(xmm5, xmm0); + mulpd(xmm0, xmm0); + subsd(xmm3, xmm6); + movdqu(xmm6, ExternalAddress(SC_2)); //0x11111111UL, 0x3f811111UL, 0x55555555UL, 0x3fa55555UL + subsd(xmm1, xmm3); + movq(xmm3, Address(rax, 24)); addsd(xmm2, xmm3); - addsd(xmm7, xmm5); - mulsd(xmm6, xmm2); - subsd(xmm0, xmm7); - movdqu(xmm2, xmm7); - addsd(xmm7, xmm4); - addsd(xmm0, xmm5); - subsd(xmm2, xmm7); - addsd(xmm4, xmm2); - pshufd(xmm2, xmm5, 238); - movdqu(xmm5, xmm7); - addsd(xmm7, xmm2); - addsd(xmm4, xmm0); - movdqu(xmm0, Address(tmp, 8272)); - subsd(xmm5, xmm7); - addsd(xmm6, xmm4); - movdqu(xmm4, xmm7); - addsd(xmm5, xmm2); - addsd(xmm7, xmm1); - movdqu(xmm2, Address(tmp, 8336)); - subsd(xmm4, xmm7); - addsd(xmm6, xmm5); - addsd(xmm4, xmm1); - pshufd(xmm5, xmm7, 238); - movdqu(xmm1, xmm7); - addsd(xmm7, xmm5); - subsd(xmm1, xmm7); - addsd(xmm1, xmm5); - movdqu(xmm5, Address(tmp, 8352)); - pshufd(xmm3, xmm3, 68); - addsd(xmm6, xmm4); - addsd(xmm6, xmm1); - movdqu(xmm1, Address(tmp, 8304)); - mulpd(xmm0, xmm3); - mulpd(xmm2, xmm3); - pshufd(xmm4, xmm3, 68); - mulpd(xmm3, xmm3); - addpd(xmm0, xmm1); - addpd(xmm5, xmm2); - mulsd(xmm4, xmm3); - movsd(xmm2, Address(tmp, 16)); - mulpd(xmm3, xmm3); - movsd(xmm1, Address(rsp, 16)); - movzwl(ecx, Address(rsp, 22)); - mulpd(xmm0, xmm4); - pextrw(eax, xmm7, 3); - mulpd(xmm5, xmm4); - mulpd(xmm0, xmm3); - movsd(xmm4, Address(tmp, 8376)); - pand(xmm2, xmm7); - addsd(xmm5, xmm6); subsd(xmm7, xmm2); - addpd(xmm5, xmm0); - andl(eax, 32752); - subl(eax, 16368); - andl(ecx, 32752); - cmpl(ecx, 32752); - jcc(Assembler::equal, L_2TAG_PACKET_48_0_2); - addl(ecx, eax); - cmpl(ecx, 16576); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_54_0_2); - pshufd(xmm0, xmm5, 238); - pand(xmm4, xmm1); - movdqu(xmm3, xmm1); - addsd(xmm5, xmm0); - subsd(xmm1, xmm4); - xorpd(xmm6, xmm6); - movl(edx, 17080); - pinsrw(xmm6, edx, 3); - addsd(xmm7, xmm5); - mulsd(xmm4, xmm2); - mulsd(xmm1, xmm2); - movdqu(xmm5, xmm6); - mulsd(xmm3, xmm7); - addsd(xmm6, xmm4); - addsd(xmm1, xmm3); - movdqu(xmm7, Address(tmp, 12480)); - movdl(edx, xmm6); - subsd(xmm6, xmm5); - movdqu(xmm3, Address(tmp, 12496)); - movsd(xmm2, Address(tmp, 12512)); - subsd(xmm4, xmm6); - movl(ecx, edx); - andl(edx, 255); - addl(edx, edx); - movdqu(xmm5, Address(tmp, edx, Address::times_8, 8384)); - addsd(xmm4, xmm1); - pextrw(edx, xmm6, 3); - shrl(ecx, 8); - movl(eax, ecx); - shrl(ecx, 1); - subl(eax, ecx); - shll(ecx, 20); - movdl(xmm6, ecx); - pshufd(xmm0, xmm4, 68); - pshufd(xmm1, xmm4, 68); - mulpd(xmm0, xmm0); - mulpd(xmm7, xmm1); - pshufd(xmm6, xmm6, 17); mulsd(xmm2, xmm4); - andl(edx, 32767); - cmpl(edx, 16529); - jcc(Assembler::above, L_2TAG_PACKET_14_0_2); - mulsd(xmm0, xmm0); - paddd(xmm5, xmm6); - addpd(xmm3, xmm7); - mulsd(xmm2, xmm5); - pshufd(xmm6, xmm5, 238); - mulpd(xmm0, xmm3); - addsd(xmm2, xmm6); - pshufd(xmm3, xmm0, 238); - addl(eax, 1023); - shll(eax, 20); - orl(eax, rsi); - movdl(xmm4, eax); - mulsd(xmm0, xmm5); - mulsd(xmm3, xmm5); - addsd(xmm0, xmm2); - psllq(xmm4, 32); - addsd(xmm0, xmm3); - movdqu(xmm1, xmm0); - addsd(xmm0, xmm5); - movl(rsi, Address(rsp, 24)); - mulsd(xmm0, xmm4); + mulpd(xmm6, xmm0); + mulsd(xmm3, xmm4); + mulpd(xmm2, xmm0); + mulpd(xmm0, xmm0); + addpd(xmm5, ExternalAddress(SC_3)); //0x1a01a01aUL, 0xbf2a01a0UL, 0x16c16c17UL, 0xbf56c16cUL + mulsd(xmm4, Address(rax, 0)); + addpd(xmm6, ExternalAddress(SC_1)); //0x55555555UL, 0xbfc55555UL, 0x00000000UL, 0xbfe00000UL + mulpd(xmm5, xmm0); + movdqu(xmm0, xmm3); + addsd(xmm3, Address(rax, 8)); + mulpd(xmm1, xmm7); + movdqu(xmm7, xmm4); + addsd(xmm4, xmm3); + addpd(xmm6, xmm5); + movq(xmm5, Address(rax, 8)); + subsd(xmm5, xmm3); + subsd(xmm3, xmm4); + addsd(xmm1, Address(rax, 16)); + mulpd(xmm6, xmm2); + addsd(xmm5, xmm0); + addsd(xmm3, xmm7); + addsd(xmm1, xmm5); + addsd(xmm1, xmm3); + addsd(xmm1, xmm6); + unpckhpd(xmm6, xmm6); + movdqu(xmm0, xmm4); + addsd(xmm1, xmm6); + addsd(xmm0, xmm1); + jmp(B1_4); + + bind(L_2TAG_PACKET_0_0_1); + jcc(Assembler::greater, L_2TAG_PACKET_1_0_1); + shrl(eax, 20); + cmpl(eax, 3325); + jcc(Assembler::notEqual, L_2TAG_PACKET_2_0_1); + mulsd(xmm0, ExternalAddress(ALL_ONES)); //0xffffffffUL, 0x3fefffffUL + jmp(B1_4); + + bind(L_2TAG_PACKET_2_0_1); + movq(xmm3, ExternalAddress(TWO_POW_55)); //0x00000000UL, 0x43600000UL + mulsd(xmm3, xmm0); + subsd(xmm3, xmm0); + mulsd(xmm3, ExternalAddress(TWO_POW_M55)); //0x00000000UL, 0x3c800000UL + jmp(B1_4); + + bind(L_2TAG_PACKET_1_0_1); pextrw(eax, xmm0, 3); andl(eax, 32752); - jcc(Assembler::equal, L_2TAG_PACKET_16_0_2); cmpl(eax, 32752); - jcc(Assembler::equal, L_2TAG_PACKET_17_0_2); + jcc(Assembler::equal, L_2TAG_PACKET_3_0_1); + pextrw(ecx, xmm0, 3); + andl(ecx, 32752); + subl(ecx, 16224); + shrl(ecx, 7); + andl(ecx, 65532); + lea(r11, ExternalAddress(PI_INV_TABLE)); + addq(rcx, r11); + movdq(rax, xmm0); + movl(r10, Address(rcx, 20)); + movl(r8, Address(rcx, 24)); + movl(edx, eax); + shrq(rax, 21); + orl(eax, INT_MIN); + shrl(eax, 11); + movl(r9, r10); + imulq(r10, rdx); + imulq(r9, rax); + imulq(r8, rax); + movl(rsi, Address(rcx, 16)); + movl(rdi, Address(rcx, 12)); + movl(r11, r10); + shrq(r10, 32); + addq(r9, r10); + addq(r11, r8); + movl(r8, r11); + shrq(r11, 32); + addq(r9, r11); + movl(r10, rsi); + imulq(rsi, rdx); + imulq(r10, rax); + movl(r11, rdi); + imulq(rdi, rdx); + movl(ebx, rsi); + shrq(rsi, 32); + addq(r9, rbx); + movl(ebx, r9); + shrq(r9, 32); + addq(r10, rsi); + addq(r10, r9); + shlq(rbx, 32); + orq(r8, rbx); + imulq(r11, rax); + movl(r9, Address(rcx, 8)); + movl(rsi, Address(rcx, 4)); + movl(ebx, rdi); + shrq(rdi, 32); + addq(r10, rbx); + movl(ebx, r10); + shrq(r10, 32); + addq(r11, rdi); + addq(r11, r10); + movq(rdi, r9); + imulq(r9, rdx); + imulq(rdi, rax); + movl(r10, r9); + shrq(r9, 32); + addq(r11, r10); + movl(r10, r11); + shrq(r11, 32); + addq(rdi, r9); + addq(rdi, r11); + movq(r9, rsi); + imulq(rsi, rdx); + imulq(r9, rax); + shlq(r10, 32); + orq(r10, rbx); + movl(eax, Address(rcx, 0)); + movl(r11, rsi); + shrq(rsi, 32); + addq(rdi, r11); + movl(r11, rdi); + shrq(rdi, 32); + addq(r9, rsi); + addq(r9, rdi); + imulq(rdx, rax); + pextrw(ebx, xmm0, 3); + lea(rdi, ExternalAddress(PI_INV_TABLE)); + subq(rcx, rdi); + addl(ecx, ecx); + addl(ecx, ecx); + addl(ecx, ecx); + addl(ecx, 19); + movl(rsi, 32768); + andl(rsi, ebx); + shrl(ebx, 4); + andl(ebx, 2047); + subl(ebx, 1023); + subl(ecx, ebx); + addq(r9, rdx); + movl(edx, ecx); + addl(edx, 32); + cmpl(ecx, 1); + jcc(Assembler::less, L_2TAG_PACKET_4_0_1); + negl(ecx); + addl(ecx, 29); + shll(r9); + movl(rdi, r9); + andl(r9, 536870911); + testl(r9, 268435456); + jcc(Assembler::notEqual, L_2TAG_PACKET_5_0_1); + shrl(r9); + movl(ebx, 0); + shlq(r9, 32); + orq(r9, r11); - bind(L_2TAG_PACKET_55_0_2); - movsd(Address(rsp, 0), xmm0); - fld_d(Address(rsp, 0)); - jmp(L_2TAG_PACKET_6_0_2); + bind(L_2TAG_PACKET_6_0_1); - bind(L_2TAG_PACKET_48_0_2); - movl(rsi, Address(rsp, 24)); + bind(L_2TAG_PACKET_7_0_1); - bind(L_2TAG_PACKET_56_0_2); - movsd(xmm0, Address(rsp, 8)); - movsd(xmm1, Address(rsp, 16)); - addsd(xmm1, xmm1); - xorpd(xmm2, xmm2); - movl(eax, 49136); - pinsrw(xmm2, eax, 3); - addsd(xmm2, xmm0); - pextrw(eax, xmm2, 3); - cmpl(eax, 0); - jcc(Assembler::notEqual, L_2TAG_PACKET_57_0_2); + cmpq(r9, 0); + jcc(Assembler::equal, L_2TAG_PACKET_8_0_1); + + bind(L_2TAG_PACKET_9_0_1); + bsrq(r11, r9); + movl(ecx, 29); + subl(ecx, r11); + jcc(Assembler::lessEqual, L_2TAG_PACKET_10_0_1); + shlq(r9); + movq(rax, r10); + shlq(r10); + addl(edx, ecx); + negl(ecx); + addl(ecx, 64); + shrq(rax); + shrq(r8); + orq(r9, rax); + orq(r10, r8); + + bind(L_2TAG_PACKET_11_0_1); + cvtsi2sdq(xmm0, r9); + shrq(r10, 1); + cvtsi2sdq(xmm3, r10); + xorpd(xmm4, xmm4); + shll(edx, 4); + negl(edx); + addl(edx, 16368); + orl(edx, rsi); + xorl(edx, ebx); + pinsrw(xmm4, edx, 3); + movq(xmm2, ExternalAddress(PI_4)); //0x40000000UL, 0x3fe921fbUL, 0x18469899UL, 0x3e64442dUL + movq(xmm6, ExternalAddress(8 + PI_4)); //0x3fe921fbUL, 0x18469899UL, 0x3e64442dUL + xorpd(xmm5, xmm5); + subl(edx, 1008); + pinsrw(xmm5, edx, 3); + mulsd(xmm0, xmm4); + shll(rsi, 16); + sarl(rsi, 31); + mulsd(xmm3, xmm5); + movdqu(xmm1, xmm0); + mulsd(xmm0, xmm2); + shrl(rdi, 29); + addsd(xmm1, xmm3); + mulsd(xmm3, xmm2); + addl(rdi, rsi); + xorl(rdi, rsi); + mulsd(xmm6, xmm1); + movl(eax, rdi); + addsd(xmm6, xmm3); + movdqu(xmm2, xmm0); + addsd(xmm0, xmm6); + subsd(xmm2, xmm0); + addsd(xmm6, xmm2); + + bind(L_2TAG_PACKET_12_0_1); + movq(xmm1, ExternalAddress(PI32INV)); //0x6dc9c883UL, 0x40245f30UL + mulsd(xmm1, xmm0); + movq(xmm5, ExternalAddress(ONEHALF)); //0x00000000UL, 0x3fe00000UL, 0x00000000UL, 0x3fe00000UL + movq(xmm4, ExternalAddress(SIGN_MASK)); //0x00000000UL, 0x80000000UL + pand(xmm4, xmm0); + por(xmm5, xmm4); + addpd(xmm1, xmm5); + cvttsd2sil(edx, xmm1); + cvtsi2sdl(xmm1, edx); + movq(xmm3, ExternalAddress(P_1)); //0x54400000UL, 0x3fb921fbUL + movdqu(xmm2, ExternalAddress(P_2)); //0x1a600000UL, 0x3d90b461UL, 0x1a600000UL, 0x3d90b461UL + mulsd(xmm3, xmm1); + unpcklpd(xmm1, xmm1); + shll(eax, 3); + addl(edx, 1865216); + movdqu(xmm4, xmm0); + addl(edx, eax); + andl(edx, 63); + movdqu(xmm5, ExternalAddress(SC_4)); //0x54400000UL, 0x3fb921fbUL + lea(rax, ExternalAddress(Ctable)); + shll(edx, 5); + addq(rax, rdx); + mulpd(xmm2, xmm1); + subsd(xmm0, xmm3); + mulsd(xmm1, ExternalAddress(P_3)); //0x2e037073UL, 0x3b63198aUL + subsd(xmm4, xmm3); + movq(xmm7, Address(rax, 8)); + unpcklpd(xmm0, xmm0); + movdqu(xmm3, xmm4); + subsd(xmm4, xmm2); + mulpd(xmm5, xmm0); + subpd(xmm0, xmm2); + mulsd(xmm7, xmm4); + subsd(xmm3, xmm4); + mulpd(xmm5, xmm0); + mulpd(xmm0, xmm0); + subsd(xmm3, xmm2); + movdqu(xmm2, Address(rax, 0)); + subsd(xmm1, xmm3); + movq(xmm3, Address(rax, 24)); + addsd(xmm2, xmm3); + subsd(xmm7, xmm2); + subsd(xmm1, xmm6); + movdqu(xmm6, ExternalAddress(SC_2)); //0x11111111UL, 0x3f811111UL, 0x55555555UL, 0x3fa55555UL + mulsd(xmm2, xmm4); + mulpd(xmm6, xmm0); + mulsd(xmm3, xmm4); + mulpd(xmm2, xmm0); + mulpd(xmm0, xmm0); + addpd(xmm5, ExternalAddress(SC_3)); //0x1a01a01aUL, 0xbf2a01a0UL, 0x16c16c17UL, 0xbf56c16cUL + mulsd(xmm4, Address(rax, 0)); + addpd(xmm6, ExternalAddress(SC_1)); //0x55555555UL, 0xbfc55555UL, 0x00000000UL, 0xbfe00000UL + mulpd(xmm5, xmm0); + movdqu(xmm0, xmm3); + addsd(xmm3, Address(rax, 8)); + mulpd(xmm1, xmm7); + movdqu(xmm7, xmm4); + addsd(xmm4, xmm3); + addpd(xmm6, xmm5); + movq(xmm5, Address(rax, 8)); + subsd(xmm5, xmm3); + subsd(xmm3, xmm4); + addsd(xmm1, Address(rax, 16)); + mulpd(xmm6, xmm2); + addsd(xmm5, xmm0); + addsd(xmm3, xmm7); + addsd(xmm1, xmm5); + addsd(xmm1, xmm3); + addsd(xmm1, xmm6); + unpckhpd(xmm6, xmm6); + movdqu(xmm0, xmm4); + addsd(xmm1, xmm6); + addsd(xmm0, xmm1); + jmp(B1_4); + + bind(L_2TAG_PACKET_8_0_1); + addl(edx, 64); + movq(r9, r10); + movq(r10, r8); + movl(r8, 0); + cmpq(r9, 0); + jcc(Assembler::notEqual, L_2TAG_PACKET_9_0_1); + addl(edx, 64); + movq(r9, r10); + movq(r10, r8); + cmpq(r9, 0); + jcc(Assembler::notEqual, L_2TAG_PACKET_9_0_1); xorpd(xmm0, xmm0); - movl(eax, 32760); - pinsrw(xmm0, eax, 3); - jmp(L_2TAG_PACKET_18_0_2); + xorpd(xmm6, xmm6); + jmp(L_2TAG_PACKET_12_0_1); - bind(L_2TAG_PACKET_57_0_2); - movdl(edx, xmm1); - movdqu(xmm3, xmm1); - psrlq(xmm3, 20); - movdl(ecx, xmm3); - orl(ecx, edx); - jcc(Assembler::equal, L_2TAG_PACKET_58_0_2); - addsd(xmm1, xmm1); - movdqu(xmm0, xmm1); - jmp(L_2TAG_PACKET_18_0_2); + bind(L_2TAG_PACKET_10_0_1); + jcc(Assembler::equal, L_2TAG_PACKET_11_0_1); + negl(ecx); + shrq(r10); + movq(rax, r9); + shrq(r9); + subl(edx, ecx); + negl(ecx); + addl(ecx, 64); + shlq(rax); + orq(r10, rax); + jmp(L_2TAG_PACKET_11_0_1); - bind(L_2TAG_PACKET_58_0_2); - pextrw(eax, xmm0, 3); - andl(eax, 32752); - pextrw(edx, xmm1, 3); - xorpd(xmm0, xmm0); - subl(eax, 16368); - xorl(eax, edx); - testl(eax, 32768); - jcc(Assembler::notEqual, L_2TAG_PACKET_18_0_2); - movl(edx, 32752); - pinsrw(xmm0, edx, 3); - jmp(L_2TAG_PACKET_18_0_2); + bind(L_2TAG_PACKET_4_0_1); + negl(ecx); + shlq(r9, 32); + orq(r9, r11); + shlq(r9); + movq(rdi, r9); + testl(r9, INT_MIN); + jcc(Assembler::notEqual, L_2TAG_PACKET_13_0_1); + shrl(r9); + movl(ebx, 0); + shrq(rdi, 3); + jmp(L_2TAG_PACKET_7_0_1); - bind(L_2TAG_PACKET_54_0_2); - pextrw(eax, xmm1, 3); - pextrw(ecx, xmm2, 3); - xorl(eax, ecx); - testl(eax, 32768); - jcc(Assembler::equal, L_2TAG_PACKET_50_0_2); - jmp(L_2TAG_PACKET_49_0_2); + bind(L_2TAG_PACKET_5_0_1); + shrl(r9); + movl(ebx, 536870912); + shrl(ebx); + shlq(r9, 32); + orq(r9, r11); + shlq(rbx, 32); + addl(rdi, 536870912); + movl(rcx, 0); + movl(r11, 0); + subq(rcx, r8); + sbbq(r11, r10); + sbbq(rbx, r9); + movq(r8, rcx); + movq(r10, r11); + movq(r9, rbx); + movl(ebx, 32768); + jmp(L_2TAG_PACKET_6_0_1); - bind(L_2TAG_PACKET_6_0_2); - movl(tmp, Address(rsp, 64)); + bind(L_2TAG_PACKET_13_0_1); + shrl(r9); + mov64(rbx, 0x100000000); + shrq(rbx); + movl(rcx, 0); + movl(r11, 0); + subq(rcx, r8); + sbbq(r11, r10); + sbbq(rbx, r9); + movq(r8, rcx); + movq(r10, r11); + movq(r9, rbx); + movl(ebx, 32768); + shrq(rdi, 3); + addl(rdi, 536870912); + jmp(L_2TAG_PACKET_7_0_1); + bind(L_2TAG_PACKET_3_0_1); + movq(xmm0, Address(rsp, 8)); + mulsd(xmm0, ExternalAddress(NEG_ZERO)); //0x00000000UL, 0x80000000UL + movq(Address(rsp, 0), xmm0); + + bind(L_2TAG_PACKET_14_0_1); + + bind(B1_4); + addq(rsp, 16); + pop(rbx); } -#endif // !_LP64 +/******************************************************************************/ +// ALGORITHM DESCRIPTION - COS() +// --------------------- +// +// 1. RANGE REDUCTION +// +// We perform an initial range reduction from X to r with +// +// X =~= N * pi/32 + r +// +// so that |r| <= pi/64 + epsilon. We restrict inputs to those +// where |N| <= 932560. Beyond this, the range reduction is +// insufficiently accurate. For extremely small inputs, +// denormalization can occur internally, impacting performance. +// This means that the main path is actually only taken for +// 2^-252 <= |X| < 90112. +// +// To avoid branches, we perform the range reduction to full +// accuracy each time. +// +// X - N * (P_1 + P_2 + P_3) +// +// where P_1 and P_2 are 32-bit numbers (so multiplication by N +// is exact) and P_3 is a 53-bit number. Together, these +// approximate pi well enough for all cases in the restricted +// range. +// +// The main reduction sequence is: +// +// y = 32/pi * x +// N = integer(y) +// (computed by adding and subtracting off SHIFTER) +// +// m_1 = N * P_1 +// m_2 = N * P_2 +// r_1 = x - m_1 +// r = r_1 - m_2 +// (this r can be used for most of the calculation) +// +// c_1 = r_1 - r +// m_3 = N * P_3 +// c_2 = c_1 - m_2 +// c = c_2 - m_3 +// +// 2. MAIN ALGORITHM +// +// The algorithm uses a table lookup based on B = M * pi / 32 +// where M = N mod 64. The stored values are: +// sigma closest power of 2 to cos(B) +// C_hl 53-bit cos(B) - sigma +// S_hi + S_lo 2 * 53-bit sin(B) +// +// The computation is organized as follows: +// +// sin(B + r + c) = [sin(B) + sigma * r] + +// r * (cos(B) - sigma) + +// sin(B) * [cos(r + c) - 1] + +// cos(B) * [sin(r + c) - r] +// +// which is approximately: +// +// [S_hi + sigma * r] + +// C_hl * r + +// S_lo + S_hi * [(cos(r) - 1) - r * c] + +// (C_hl + sigma) * [(sin(r) - r) + c] +// +// and this is what is actually computed. We separate this sum +// into four parts: +// +// hi + med + pols + corr +// +// where +// +// hi = S_hi + sigma r +// med = C_hl * r +// pols = S_hi * (cos(r) - 1) + (C_hl + sigma) * (sin(r) - r) +// corr = S_lo + c * ((C_hl + sigma) - S_hi * r) +// +// 3. POLYNOMIAL +// +// The polynomial S_hi * (cos(r) - 1) + (C_hl + sigma) * +// (sin(r) - r) can be rearranged freely, since it is quite +// small, so we exploit parallelism to the fullest. +// +// psc4 = SC_4 * r_1 +// msc4 = psc4 * r +// r2 = r * r +// msc2 = SC_2 * r2 +// r4 = r2 * r2 +// psc3 = SC_3 + msc4 +// psc1 = SC_1 + msc2 +// msc3 = r4 * psc3 +// sincospols = psc1 + msc3 +// pols = sincospols * +// +// +// 4. CORRECTION TERM +// +// This is where the "c" component of the range reduction is +// taken into account; recall that just "r" is used for most of +// the calculation. +// +// -c = m_3 - c_2 +// -d = S_hi * r - (C_hl + sigma) +// corr = -c * -d + S_lo +// +// 5. COMPENSATED SUMMATIONS +// +// The two successive compensated summations add up the high +// and medium parts, leaving just the low parts to add up at +// the end. +// +// rs = sigma * r +// res_int = S_hi + rs +// k_0 = S_hi - res_int +// k_2 = k_0 + rs +// med = C_hl * r +// res_hi = res_int + med +// k_1 = res_int - res_hi +// k_3 = k_1 + med +// +// 6. FINAL SUMMATION +// +// We now add up all the small parts: +// +// res_lo = pols(hi) + pols(lo) + corr + k_1 + k_3 +// +// Now the overall result is just: +// +// res_hi + res_lo +// +// 7. SMALL ARGUMENTS +// +// Inputs with |X| < 2^-252 are treated specially as +// 1 - |x|. +// +// Special cases: +// cos(NaN) = quiet NaN, and raise invalid exception +// cos(INF) = NaN and raise invalid exception +// cos(0) = 1 +// +/******************************************************************************/ + +ALIGNED_(8) juint _ONE[] = +{ + 0x00000000UL, 0x3ff00000UL +}; + +void MacroAssembler::fast_cos(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register r8, Register r9, Register r10, Register r11) { + Label L_2TAG_PACKET_0_0_1, L_2TAG_PACKET_1_0_1, L_2TAG_PACKET_2_0_1, L_2TAG_PACKET_3_0_1; + Label L_2TAG_PACKET_4_0_1, L_2TAG_PACKET_5_0_1, L_2TAG_PACKET_6_0_1, L_2TAG_PACKET_7_0_1; + Label L_2TAG_PACKET_8_0_1, L_2TAG_PACKET_9_0_1, L_2TAG_PACKET_10_0_1, L_2TAG_PACKET_11_0_1; + Label L_2TAG_PACKET_12_0_1, L_2TAG_PACKET_13_0_1, B1_2, B1_3, B1_4, B1_5, start; + + assert_different_registers(r8, r9, r10, r11, eax, ecx, edx); + + address ONEHALF = (address)_ONEHALF; + address P_2 = (address)_P_2; + address SC_4 = (address)_SC_4; + address Ctable = (address)_Ctable; + address SC_2 = (address)_SC_2; + address SC_3 = (address)_SC_3; + address SC_1 = (address)_SC_1; + address PI_INV_TABLE = (address)_PI_INV_TABLE; + address PI_4 = (address)_PI_4; + address PI32INV = (address)_PI32INV; + address SIGN_MASK = (address)_SIGN_MASK; + address P_1 = (address)_P_1; + address P_3 = (address)_P_3; + address ONE = (address)_ONE; + address NEG_ZERO = (address)_NEG_ZERO; + + bind(start); + push(rbx); + subq(rsp, 16); + movsd(Address(rsp, 8), xmm0); + + bind(B1_2); + movl(eax, Address(rsp, 12)); + movq(xmm1, ExternalAddress(PI32INV)); //0x6dc9c883UL, 0x40245f30UL + andl(eax, 2147418112); + subl(eax, 808452096); + cmpl(eax, 281346048); + jcc(Assembler::above, L_2TAG_PACKET_0_0_1); + mulsd(xmm1, xmm0); + movdqu(xmm5, ExternalAddress(ONEHALF)); //0x00000000UL, 0x3fe00000UL, 0x00000000UL, 0x3fe00000UL + movq(xmm4, ExternalAddress(SIGN_MASK)); //0x00000000UL, 0x80000000UL + pand(xmm4, xmm0); + por(xmm5, xmm4); + addpd(xmm1, xmm5); + cvttsd2sil(edx, xmm1); + cvtsi2sdl(xmm1, edx); + movdqu(xmm2, ExternalAddress(P_2)); //0x1a600000UL, 0x3d90b461UL, 0x1a600000UL, 0x3d90b461UL + movq(xmm3, ExternalAddress(P_1)); //0x54400000UL, 0x3fb921fbUL + mulsd(xmm3, xmm1); + unpcklpd(xmm1, xmm1); + addq(rdx, 1865232); + movdqu(xmm4, xmm0); + andq(rdx, 63); + movdqu(xmm5, ExternalAddress(SC_4)); //0xa556c734UL, 0x3ec71de3UL, 0x1a01a01aUL, 0x3efa01a0UL + lea(rax, ExternalAddress(Ctable)); + shlq(rdx, 5); + addq(rax, rdx); + mulpd(xmm2, xmm1); + subsd(xmm0, xmm3); + mulsd(xmm1, ExternalAddress(P_3)); //0x2e037073UL, 0x3b63198aUL + subsd(xmm4, xmm3); + movq(xmm7, Address(rax, 8)); + unpcklpd(xmm0, xmm0); + movdqu(xmm3, xmm4); + subsd(xmm4, xmm2); + mulpd(xmm5, xmm0); + subpd(xmm0, xmm2); + movdqu(xmm6, ExternalAddress(SC_2)); //0x11111111UL, 0x3f811111UL, 0x55555555UL, 0x3fa55555UL + mulsd(xmm7, xmm4); + subsd(xmm3, xmm4); + mulpd(xmm5, xmm0); + mulpd(xmm0, xmm0); + subsd(xmm3, xmm2); + movdqu(xmm2, Address(rax, 0)); + subsd(xmm1, xmm3); + movq(xmm3, Address(rax, 24)); + addsd(xmm2, xmm3); + subsd(xmm7, xmm2); + mulsd(xmm2, xmm4); + mulpd(xmm6, xmm0); + mulsd(xmm3, xmm4); + mulpd(xmm2, xmm0); + mulpd(xmm0, xmm0); + addpd(xmm5, ExternalAddress(SC_3)); //0x1a01a01aUL, 0xbf2a01a0UL, 0x16c16c17UL, 0xbf56c16cUL + mulsd(xmm4, Address(rax, 0)); + addpd(xmm6, ExternalAddress(SC_1)); //0x55555555UL, 0xbfc55555UL, 0x00000000UL, 0xbfe00000UL + mulpd(xmm5, xmm0); + movdqu(xmm0, xmm3); + addsd(xmm3, Address(rax, 8)); + mulpd(xmm1, xmm7); + movdqu(xmm7, xmm4); + addsd(xmm4, xmm3); + addpd(xmm6, xmm5); + movq(xmm5, Address(rax, 8)); + subsd(xmm5, xmm3); + subsd(xmm3, xmm4); + addsd(xmm1, Address(rax, 16)); + mulpd(xmm6, xmm2); + addsd(xmm0, xmm5); + addsd(xmm3, xmm7); + addsd(xmm0, xmm1); + addsd(xmm0, xmm3); + addsd(xmm0, xmm6); + unpckhpd(xmm6, xmm6); + addsd(xmm0, xmm6); + addsd(xmm0, xmm4); + jmp(B1_4); + + bind(L_2TAG_PACKET_0_0_1); + jcc(Assembler::greater, L_2TAG_PACKET_1_0_1); + pextrw(eax, xmm0, 3); + andl(eax, 32767); + pinsrw(xmm0, eax, 3); + movq(xmm1, ExternalAddress(ONE)); //0x00000000UL, 0x3ff00000UL + subsd(xmm1, xmm0); + movdqu(xmm0, xmm1); + jmp(B1_4); + + bind(L_2TAG_PACKET_1_0_1); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + cmpl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_2_0_1); + pextrw(ecx, xmm0, 3); + andl(ecx, 32752); + subl(ecx, 16224); + shrl(ecx, 7); + andl(ecx, 65532); + lea(r11, ExternalAddress(PI_INV_TABLE)); + addq(rcx, r11); + movdq(rax, xmm0); + movl(r10, Address(rcx, 20)); + movl(r8, Address(rcx, 24)); + movl(edx, eax); + shrq(rax, 21); + orl(eax, INT_MIN); + shrl(eax, 11); + movl(r9, r10); + imulq(r10, rdx); + imulq(r9, rax); + imulq(r8, rax); + movl(rsi, Address(rcx, 16)); + movl(rdi, Address(rcx, 12)); + movl(r11, r10); + shrq(r10, 32); + addq(r9, r10); + addq(r11, r8); + movl(r8, r11); + shrq(r11, 32); + addq(r9, r11); + movl(r10, rsi); + imulq(rsi, rdx); + imulq(r10, rax); + movl(r11, rdi); + imulq(rdi, rdx); + movl(rbx, rsi); + shrq(rsi, 32); + addq(r9, rbx); + movl(rbx, r9); + shrq(r9, 32); + addq(r10, rsi); + addq(r10, r9); + shlq(rbx, 32); + orq(r8, rbx); + imulq(r11, rax); + movl(r9, Address(rcx, 8)); + movl(rsi, Address(rcx, 4)); + movl(rbx, rdi); + shrq(rdi, 32); + addq(r10, rbx); + movl(rbx, r10); + shrq(r10, 32); + addq(r11, rdi); + addq(r11, r10); + movq(rdi, r9); + imulq(r9, rdx); + imulq(rdi, rax); + movl(r10, r9); + shrq(r9, 32); + addq(r11, r10); + movl(r10, r11); + shrq(r11, 32); + addq(rdi, r9); + addq(rdi, r11); + movq(r9, rsi); + imulq(rsi, rdx); + imulq(r9, rax); + shlq(r10, 32); + orq(r10, rbx); + movl(eax, Address(rcx, 0)); + movl(r11, rsi); + shrq(rsi, 32); + addq(rdi, r11); + movl(r11, rdi); + shrq(rdi, 32); + addq(r9, rsi); + addq(r9, rdi); + imulq(rdx, rax); + pextrw(rbx, xmm0, 3); + lea(rdi, ExternalAddress(PI_INV_TABLE)); + subq(rcx, rdi); + addl(ecx, ecx); + addl(ecx, ecx); + addl(ecx, ecx); + addl(ecx, 19); + movl(rsi, 32768); + andl(rsi, rbx); + shrl(rbx, 4); + andl(rbx, 2047); + subl(rbx, 1023); + subl(ecx, rbx); + addq(r9, rdx); + movl(edx, ecx); + addl(edx, 32); + cmpl(ecx, 1); + jcc(Assembler::less, L_2TAG_PACKET_3_0_1); + negl(ecx); + addl(ecx, 29); + shll(r9); + movl(rdi, r9); + andl(r9, 536870911); + testl(r9, 268435456); + jcc(Assembler::notEqual, L_2TAG_PACKET_4_0_1); + shrl(r9); + movl(rbx, 0); + shlq(r9, 32); + orq(r9, r11); + + bind(L_2TAG_PACKET_5_0_1); + + bind(L_2TAG_PACKET_6_0_1); + cmpq(r9, 0); + jcc(Assembler::equal, L_2TAG_PACKET_7_0_1); + + bind(L_2TAG_PACKET_8_0_1); + bsrq(r11, r9); + movl(ecx, 29); + subl(ecx, r11); + jcc(Assembler::lessEqual, L_2TAG_PACKET_9_0_1); + shlq(r9); + movq(rax, r10); + shlq(r10); + addl(edx, ecx); + negl(ecx); + addl(ecx, 64); + shrq(rax); + shrq(r8); + orq(r9, rax); + orq(r10, r8); + + bind(L_2TAG_PACKET_10_0_1); + cvtsi2sdq(xmm0, r9); + shrq(r10, 1); + cvtsi2sdq(xmm3, r10); + xorpd(xmm4, xmm4); + shll(edx, 4); + negl(edx); + addl(edx, 16368); + orl(edx, rsi); + xorl(edx, rbx); + pinsrw(xmm4, edx, 3); + movq(xmm2, ExternalAddress(PI_4)); //0x40000000UL, 0x3fe921fbUL, 0x18469899UL, 0x3e64442dUL + movq(xmm6, ExternalAddress(8 + PI_4)); //0x3fe921fbUL, 0x18469899UL, 0x3e64442dUL + xorpd(xmm5, xmm5); + subl(edx, 1008); + pinsrw(xmm5, edx, 3); + mulsd(xmm0, xmm4); + shll(rsi, 16); + sarl(rsi, 31); + mulsd(xmm3, xmm5); + movdqu(xmm1, xmm0); + mulsd(xmm0, xmm2); + shrl(rdi, 29); + addsd(xmm1, xmm3); + mulsd(xmm3, xmm2); + addl(rdi, rsi); + xorl(rdi, rsi); + mulsd(xmm6, xmm1); + movl(eax, rdi); + addsd(xmm6, xmm3); + movdqu(xmm2, xmm0); + addsd(xmm0, xmm6); + subsd(xmm2, xmm0); + addsd(xmm6, xmm2); + + bind(L_2TAG_PACKET_11_0_1); + movq(xmm1, ExternalAddress(PI32INV)); //0x6dc9c883UL, 0x40245f30UL + mulsd(xmm1, xmm0); + movq(xmm5, ExternalAddress(ONEHALF)); //0x00000000UL, 0x3fe00000UL, 0x00000000UL, 0x3fe00000UL + movq(xmm4, ExternalAddress(SIGN_MASK)); //0x00000000UL, 0x80000000UL + pand(xmm4, xmm0); + por(xmm5, xmm4); + addpd(xmm1, xmm5); + cvttsd2siq(rdx, xmm1); + cvtsi2sdq(xmm1, rdx); + movq(xmm3, ExternalAddress(P_1)); //0x54400000UL, 0x3fb921fbUL + movdqu(xmm2, ExternalAddress(P_2)); //0x1a600000UL, 0x3d90b461UL, 0x1a600000UL, 0x3d90b461UL + mulsd(xmm3, xmm1); + unpcklpd(xmm1, xmm1); + shll(eax, 3); + addl(edx, 1865232); + movdqu(xmm4, xmm0); + addl(edx, eax); + andl(edx, 63); + movdqu(xmm5, ExternalAddress(SC_4)); //0xa556c734UL, 0x3ec71de3UL, 0x1a01a01aUL, 0x3efa01a0UL + lea(rax, ExternalAddress(Ctable)); + shll(edx, 5); + addq(rax, rdx); + mulpd(xmm2, xmm1); + subsd(xmm0, xmm3); + mulsd(xmm1, ExternalAddress(P_3)); //0x2e037073UL, 0x3b63198aUL + subsd(xmm4, xmm3); + movq(xmm7, Address(rax, 8)); + unpcklpd(xmm0, xmm0); + movdqu(xmm3, xmm4); + subsd(xmm4, xmm2); + mulpd(xmm5, xmm0); + subpd(xmm0, xmm2); + mulsd(xmm7, xmm4); + subsd(xmm3, xmm4); + mulpd(xmm5, xmm0); + mulpd(xmm0, xmm0); + subsd(xmm3, xmm2); + movdqu(xmm2, Address(rax, 0)); + subsd(xmm1, xmm3); + movq(xmm3, Address(rax, 24)); + addsd(xmm2, xmm3); + subsd(xmm7, xmm2); + subsd(xmm1, xmm6); + movdqu(xmm6, ExternalAddress(SC_2)); //0x11111111UL, 0x3f811111UL, 0x55555555UL, 0x3fa55555UL + mulsd(xmm2, xmm4); + mulpd(xmm6, xmm0); + mulsd(xmm3, xmm4); + mulpd(xmm2, xmm0); + mulpd(xmm0, xmm0); + addpd(xmm5, ExternalAddress(SC_3)); //0x1a01a01aUL, 0xbf2a01a0UL, 0x16c16c17UL, 0xbf56c16cUL + mulsd(xmm4, Address(rax, 0)); + addpd(xmm6, ExternalAddress(SC_1)); //0x55555555UL, 0xbfc55555UL, 0x00000000UL, 0xbfe00000UL + mulpd(xmm5, xmm0); + movdqu(xmm0, xmm3); + addsd(xmm3, Address(rax, 8)); + mulpd(xmm1, xmm7); + movdqu(xmm7, xmm4); + addsd(xmm4, xmm3); + addpd(xmm6, xmm5); + movq(xmm5, Address(rax, 8)); + subsd(xmm5, xmm3); + subsd(xmm3, xmm4); + addsd(xmm1, Address(rax, 16)); + mulpd(xmm6, xmm2); + addsd(xmm5, xmm0); + addsd(xmm3, xmm7); + addsd(xmm1, xmm5); + addsd(xmm1, xmm3); + addsd(xmm1, xmm6); + unpckhpd(xmm6, xmm6); + movdqu(xmm0, xmm4); + addsd(xmm1, xmm6); + addsd(xmm0, xmm1); + jmp(B1_4); + + bind(L_2TAG_PACKET_7_0_1); + addl(edx, 64); + movq(r9, r10); + movq(r10, r8); + movl(r8, 0); + cmpq(r9, 0); + jcc(Assembler::notEqual, L_2TAG_PACKET_8_0_1); + addl(edx, 64); + movq(r9, r10); + movq(r10, r8); + cmpq(r9, 0); + jcc(Assembler::notEqual, L_2TAG_PACKET_8_0_1); + xorpd(xmm0, xmm0); + xorpd(xmm6, xmm6); + jmp(L_2TAG_PACKET_11_0_1); + + bind(L_2TAG_PACKET_9_0_1); + jcc(Assembler::equal, L_2TAG_PACKET_10_0_1); + negl(ecx); + shrq(r10); + movq(rax, r9); + shrq(r9); + subl(edx, ecx); + negl(ecx); + addl(ecx, 64); + shlq(rax); + orq(r10, rax); + jmp(L_2TAG_PACKET_10_0_1); + bind(L_2TAG_PACKET_3_0_1); + negl(ecx); + shlq(r9, 32); + orq(r9, r11); + shlq(r9); + movq(rdi, r9); + testl(r9, INT_MIN); + jcc(Assembler::notEqual, L_2TAG_PACKET_12_0_1); + shrl(r9); + movl(rbx, 0); + shrq(rdi, 3); + jmp(L_2TAG_PACKET_6_0_1); + + bind(L_2TAG_PACKET_4_0_1); + shrl(r9); + movl(rbx, 536870912); + shrl(rbx); + shlq(r9, 32); + orq(r9, r11); + shlq(rbx, 32); + addl(rdi, 536870912); + movl(rcx, 0); + movl(r11, 0); + subq(rcx, r8); + sbbq(r11, r10); + sbbq(rbx, r9); + movq(r8, rcx); + movq(r10, r11); + movq(r9, rbx); + movl(rbx, 32768); + jmp(L_2TAG_PACKET_5_0_1); + + bind(L_2TAG_PACKET_12_0_1); + shrl(r9); + mov64(rbx, 0x100000000); + shrq(rbx); + movl(rcx, 0); + movl(r11, 0); + subq(rcx, r8); + sbbq(r11, r10); + sbbq(rbx, r9); + movq(r8, rcx); + movq(r10, r11); + movq(r9, rbx); + movl(rbx, 32768); + shrq(rdi, 3); + addl(rdi, 536870912); + jmp(L_2TAG_PACKET_6_0_1); + + bind(L_2TAG_PACKET_2_0_1); + movsd(xmm0, Address(rsp, 8)); + mulsd(xmm0, ExternalAddress(NEG_ZERO)); //0x00000000UL, 0x80000000UL + movq(Address(rsp, 0), xmm0); + + bind(L_2TAG_PACKET_13_0_1); + + bind(B1_4); + addq(rsp, 16); + pop(rbx); +} diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index 4381e8aa849..4aafe4a8341 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -972,6 +972,15 @@ void MacroAssembler::addss(XMMRegister dst, AddressLiteral src) { } } +void MacroAssembler::addpd(XMMRegister dst, AddressLiteral src) { + if (reachable(src)) { + Assembler::addpd(dst, as_Address(src)); + } else { + lea(rscratch1, src); + Assembler::addpd(dst, Address(rscratch1, 0)); + } +} + void MacroAssembler::align(int modulus) { align(modulus, offset()); } @@ -5417,7 +5426,7 @@ Register MacroAssembler::tlab_refill(Label& retry, Label& try_eden, Label& slow_case) { Register top = rax; - Register t1 = rcx; + Register t1 = rcx; // object size Register t2 = rsi; Register thread_reg = NOT_LP64(rdi) LP64_ONLY(r15_thread); assert_different_registers(top, thread_reg, t1, t2, /* preserve: */ rbx, rdx); @@ -5513,12 +5522,76 @@ Register MacroAssembler::tlab_refill(Label& retry, addptr(top, t1); subptr(top, (int32_t)ThreadLocalAllocBuffer::alignment_reserve_in_bytes()); movptr(Address(thread_reg, in_bytes(JavaThread::tlab_end_offset())), top); + + if (ZeroTLAB) { + // This is a fast TLAB refill, therefore the GC is not notified of it. + // So compiled code must fill the new TLAB with zeroes. + movptr(top, Address(thread_reg, in_bytes(JavaThread::tlab_start_offset()))); + zero_memory(top, t1, 0, t2); + } + verify_tlab(); jmp(retry); return thread_reg; // for use by caller } +// Preserves the contents of address, destroys the contents length_in_bytes and temp. +void MacroAssembler::zero_memory(Register address, Register length_in_bytes, int offset_in_bytes, Register temp) { + assert(address != length_in_bytes && address != temp && temp != length_in_bytes, "registers must be different"); + assert((offset_in_bytes & (BytesPerWord - 1)) == 0, "offset must be a multiple of BytesPerWord"); + Label done; + + testptr(length_in_bytes, length_in_bytes); + jcc(Assembler::zero, done); + + // initialize topmost word, divide index by 2, check if odd and test if zero + // note: for the remaining code to work, index must be a multiple of BytesPerWord +#ifdef ASSERT + { + Label L; + testptr(length_in_bytes, BytesPerWord - 1); + jcc(Assembler::zero, L); + stop("length must be a multiple of BytesPerWord"); + bind(L); + } +#endif + Register index = length_in_bytes; + xorptr(temp, temp); // use _zero reg to clear memory (shorter code) + if (UseIncDec) { + shrptr(index, 3); // divide by 8/16 and set carry flag if bit 2 was set + } else { + shrptr(index, 2); // use 2 instructions to avoid partial flag stall + shrptr(index, 1); + } +#ifndef _LP64 + // index could have not been a multiple of 8 (i.e., bit 2 was set) + { + Label even; + // note: if index was a multiple of 8, then it cannot + // be 0 now otherwise it must have been 0 before + // => if it is even, we don't need to check for 0 again + jcc(Assembler::carryClear, even); + // clear topmost word (no jump would be needed if conditional assignment worked here) + movptr(Address(address, index, Address::times_8, offset_in_bytes - 0*BytesPerWord), temp); + // index could be 0 now, must check again + jcc(Assembler::zero, done); + bind(even); + } +#endif // !_LP64 + // initialize remaining object fields: index is a multiple of 2 now + { + Label loop; + bind(loop); + movptr(Address(address, index, Address::times_8, offset_in_bytes - 1*BytesPerWord), temp); + NOT_LP64(movptr(Address(address, index, Address::times_8, offset_in_bytes - 2*BytesPerWord), temp);) + decrement(index); + jcc(Assembler::notZero, loop); + } + + bind(done); +} + void MacroAssembler::incr_allocated_bytes(Register thread, Register var_size_in_bytes, int con_size_in_bytes, @@ -5730,34 +5803,22 @@ void MacroAssembler::trigfunc(char trig, int num_fpu_regs_in_use) { } Label slow_case, done; + if (trig == 't') { + ExternalAddress pi4_adr = (address)&pi_4; + if (reachable(pi4_adr)) { + // x ?<= pi/4 + fld_d(pi4_adr); + fld_s(1); // Stack: X PI/4 X + fabs(); // Stack: |X| PI/4 X + fcmp(tmp); + jcc(Assembler::above, slow_case); - ExternalAddress pi4_adr = (address)&pi_4; - if (reachable(pi4_adr)) { - // x ?<= pi/4 - fld_d(pi4_adr); - fld_s(1); // Stack: X PI/4 X - fabs(); // Stack: |X| PI/4 X - fcmp(tmp); - jcc(Assembler::above, slow_case); - - // fastest case: -pi/4 <= x <= pi/4 - switch(trig) { - case 's': - fsin(); - break; - case 'c': - fcos(); - break; - case 't': + // fastest case: -pi/4 <= x <= pi/4 ftan(); - break; - default: - assert(false, "bad intrinsic"); - break; - } - jmp(done); - } + jmp(done); + } + } // slow case: runtime call bind(slow_case); @@ -5790,7 +5851,6 @@ void MacroAssembler::trigfunc(char trig, int num_fpu_regs_in_use) { } } - // Look up the method for a megamorphic invokeinterface call. // The target method is determined by . // The receiver klass is in recv_klass. diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp index bb5782820f0..95931ad2b24 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp @@ -522,6 +522,8 @@ class MacroAssembler: public Assembler { Label& slow_case // continuation point if fast allocation fails ); Register tlab_refill(Label& retry_tlab, Label& try_eden, Label& slow_case); // returns TLS address + void zero_memory(Register address, Register length_in_bytes, int offset_in_bytes, Register temp); + void incr_allocated_bytes(Register thread, Register var_size_in_bytes, int con_size_in_bytes, Register t1 = noreg); @@ -865,6 +867,7 @@ class MacroAssembler: public Assembler { void andpd(XMMRegister dst, Address src) { Assembler::andpd(dst, src); } void andpd(XMMRegister dst, AddressLiteral src); + void andpd(XMMRegister dst, XMMRegister src) { Assembler::andpd(dst, src); } void andps(XMMRegister dst, XMMRegister src) { Assembler::andps(dst, src); } void andps(XMMRegister dst, Address src) { Assembler::andps(dst, src); } @@ -900,10 +903,6 @@ class MacroAssembler: public Assembler { void ldmxcsr(Address src) { Assembler::ldmxcsr(src); } void ldmxcsr(AddressLiteral src); - // compute pow(x,y) and exp(x) with x86 instructions. Don't cover - // all corner cases and may result in NaN and require fallback to a - // runtime call. - void fast_pow(); void fast_exp(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register rax, Register rcx, Register rdx, Register tmp); @@ -911,11 +910,32 @@ class MacroAssembler: public Assembler { void fast_log(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register rax, Register rcx, Register rdx, Register tmp1 LP64_ONLY(COMMA Register tmp2)); + void fast_pow(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register rax, Register rcx, Register rdx NOT_LP64(COMMA Register tmp) LP64_ONLY(COMMA Register tmp1) LP64_ONLY(COMMA Register tmp2) LP64_ONLY(COMMA Register tmp3) LP64_ONLY(COMMA Register tmp4)); + void fast_sin(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, + XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, + Register rax, Register rbx LP64_ONLY(COMMA Register rcx), Register rdx + LP64_ONLY(COMMA Register tmp1) LP64_ONLY(COMMA Register tmp2) + LP64_ONLY(COMMA Register tmp3) LP64_ONLY(COMMA Register tmp4)); + + void fast_cos(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, + XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, + Register rax, Register rcx, Register rdx NOT_LP64(COMMA Register tmp) + LP64_ONLY(COMMA Register r8) LP64_ONLY(COMMA Register r9) + LP64_ONLY(COMMA Register r10) LP64_ONLY(COMMA Register r11)); + +#ifndef _LP64 + void libm_sincos_huge(XMMRegister xmm0, XMMRegister xmm1, Register eax, Register ecx, + Register edx, Register ebx, Register esi, Register edi, + Register ebp, Register esp); + void libm_reduce_pi04l(Register eax, Register ecx, Register edx, Register ebx, + Register esi, Register edi, Register ebp, Register esp); +#endif + void increase_precision(); void restore_precision(); @@ -944,6 +964,10 @@ public: void addss(XMMRegister dst, Address src) { Assembler::addss(dst, src); } void addss(XMMRegister dst, AddressLiteral src); + void addpd(XMMRegister dst, XMMRegister src) { Assembler::addpd(dst, src); } + void addpd(XMMRegister dst, Address src) { Assembler::addpd(dst, src); } + void addpd(XMMRegister dst, AddressLiteral src); + void divsd(XMMRegister dst, XMMRegister src) { Assembler::divsd(dst, src); } void divsd(XMMRegister dst, Address src) { Assembler::divsd(dst, src); } void divsd(XMMRegister dst, AddressLiteral src); diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp index 2125d7aa9fb..ede8f752139 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp @@ -1271,7 +1271,7 @@ static void save_or_restore_arguments(MacroAssembler* masm, } } -// Check GC_locker::needs_gc and enter the runtime if it's true. This +// Check GCLocker::needs_gc and enter the runtime if it's true. This // keeps a new JNI critical region from starting until a GC has been // forced. Save down any oops in registers and describe them in an // OopMap. @@ -1284,9 +1284,9 @@ static void check_needs_gc_for_critical_native(MacroAssembler* masm, OopMapSet* oop_maps, VMRegPair* in_regs, BasicType* in_sig_bt) { - __ block_comment("check GC_locker::needs_gc"); + __ block_comment("check GCLocker::needs_gc"); Label cont; - __ cmp8(ExternalAddress((address)GC_locker::needs_gc_address()), false); + __ cmp8(ExternalAddress((address)GCLocker::needs_gc_address()), false); __ jcc(Assembler::equal, cont); // Save down any incoming oops and call into the runtime to halt for a GC @@ -1469,14 +1469,14 @@ static void gen_special_dispatch(MacroAssembler* masm, // GetPrimtiveArrayCritical and disallow the use of any other JNI // functions. The wrapper is expected to unpack the arguments before // passing them to the callee and perform checks before and after the -// native call to ensure that they GC_locker +// native call to ensure that they GCLocker // lock_critical/unlock_critical semantics are followed. Some other // parts of JNI setup are skipped like the tear down of the JNI handle // block and the check for pending exceptions it's impossible for them // to be thrown. // // They are roughly structured like this: -// if (GC_locker::needs_gc()) +// if (GCLocker::needs_gc()) // SharedRuntime::block_for_jni_critical(); // tranistion to thread_in_native // unpack arrray arguments and call native entry point diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp index e4cb8c6ce18..db89a73fce1 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp @@ -1416,7 +1416,7 @@ static void save_or_restore_arguments(MacroAssembler* masm, } -// Check GC_locker::needs_gc and enter the runtime if it's true. This +// Check GCLocker::needs_gc and enter the runtime if it's true. This // keeps a new JNI critical region from starting until a GC has been // forced. Save down any oops in registers and describe them in an // OopMap. @@ -1428,9 +1428,9 @@ static void check_needs_gc_for_critical_native(MacroAssembler* masm, OopMapSet* oop_maps, VMRegPair* in_regs, BasicType* in_sig_bt) { - __ block_comment("check GC_locker::needs_gc"); + __ block_comment("check GCLocker::needs_gc"); Label cont; - __ cmp8(ExternalAddress((address)GC_locker::needs_gc_address()), false); + __ cmp8(ExternalAddress((address)GCLocker::needs_gc_address()), false); __ jcc(Assembler::equal, cont); // Save down any incoming oops and call into the runtime to halt for a GC @@ -1795,14 +1795,14 @@ static void gen_special_dispatch(MacroAssembler* masm, // GetPrimtiveArrayCritical and disallow the use of any other JNI // functions. The wrapper is expected to unpack the arguments before // passing them to the callee and perform checks before and after the -// native call to ensure that they GC_locker +// native call to ensure that they GCLocker // lock_critical/unlock_critical semantics are followed. Some other // parts of JNI setup are skipped like the tear down of the JNI handle // block and the check for pending exceptions it's impossible for them // to be thrown. // // They are roughly structured like this: -// if (GC_locker::needs_gc()) +// if (GCLocker::needs_gc()) // SharedRuntime::block_for_jni_critical(); // tranistion to thread_in_native // unpack arrray arguments and call native entry point diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp index 5ac5593f1c9..894e4cb3319 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp @@ -2102,22 +2102,6 @@ class StubGenerator: public StubCodeGenerator { __ flog10(); __ ret(0); } - { - StubCodeMark mark(this, "StubRoutines", "sin"); - StubRoutines::_intrinsic_sin = (double (*)(double)) __ pc(); - - __ fld_d(Address(rsp, 4)); - __ trigfunc('s'); - __ ret(0); - } - { - StubCodeMark mark(this, "StubRoutines", "cos"); - StubRoutines::_intrinsic_cos = (double (*)(double)) __ pc(); - - __ fld_d(Address(rsp, 4)); - __ trigfunc('c'); - __ ret(0); - } { StubCodeMark mark(this, "StubRoutines", "tan"); StubRoutines::_intrinsic_tan = (double (*)(double)) __ pc(); @@ -2802,8 +2786,7 @@ class StubGenerator: public StubCodeGenerator { const Register to = rdx; // destination array address const Register key = rcx; // key array address const Register counter = rdi; // counter byte array initialized from initvector array address - - // and left with the results of the last encryption block + // and updated with the incremented counter in the end const Register len_reg = rbx; const Register pos = rax; @@ -2829,10 +2812,7 @@ class StubGenerator: public StubCodeGenerator { __ movptr(from , from_param); __ movptr(to , to_param); - //__ movptr(key, key_param); - //__ movptr(counter, rvec_param); __ movptr(len_reg , len_param); - //__ movptr(pos, 0); // Use the partially used encrpyted counter from last invocation Label L_exit_preLoop, L_preLoop_start; @@ -3007,8 +2987,8 @@ class StubGenerator: public StubCodeGenerator { __ subptr(len_reg, AESBlockSize); __ jmp(L_singleBlockLoopTop[k]); - __ BIND(L_processTail_insr[k]); - __ addptr(pos, len_reg); + __ BIND(L_processTail_insr[k]); // Process the tail part of the input array + __ addptr(pos, len_reg); // 1. Insert bytes from src array into xmm_from0 register __ testptr(len_reg, 8); __ jcc(Assembler::zero, L_processTail_4_insr[k]); __ subptr(pos,8); @@ -3035,11 +3015,11 @@ class StubGenerator: public StubCodeGenerator { __ BIND(L_processTail_exit_insr[k]); __ movptr(saved_encCounter_start, saved_counter_param); - __ movdqu(Address(saved_encCounter_start, 0), xmm_result0); - __ pxor(xmm_result0, xmm_from0); + __ movdqu(Address(saved_encCounter_start, 0), xmm_result0); // 2. Perform pxor of the encrypted counter and plaintext Bytes. + __ pxor(xmm_result0, xmm_from0); // Also the encrypted counter is saved for next invocation. __ testptr(len_reg, 8); - __ jcc(Assembler::zero, L_processTail_4_extr[k]); + __ jcc(Assembler::zero, L_processTail_4_extr[k]); // 3. Extract bytes from xmm_result0 into the dest. array __ pextrd(Address(to, pos), xmm_result0, 0); __ pextrd(Address(to, pos, Address::times_1, 4), xmm_result0, 1); __ psrldq(xmm_result0, 8); @@ -3445,6 +3425,76 @@ class StubGenerator: public StubCodeGenerator { } + address generate_libm_reduce_pi04l() { + address start = __ pc(); + + BLOCK_COMMENT("Entry:"); + __ libm_reduce_pi04l(rax, rcx, rdx, rbx, rsi, rdi, rbp, rsp); + + return start; + + } + + address generate_libm_sin_cos_huge() { + address start = __ pc(); + + const XMMRegister x0 = xmm0; + const XMMRegister x1 = xmm1; + + BLOCK_COMMENT("Entry:"); + __ libm_sincos_huge(x0, x1, rax, rcx, rdx, rbx, rsi, rdi, rbp, rsp); + + return start; + + } + + address generate_libmSin() { + address start = __ pc(); + + const XMMRegister x0 = xmm0; + const XMMRegister x1 = xmm1; + const XMMRegister x2 = xmm2; + const XMMRegister x3 = xmm3; + + const XMMRegister x4 = xmm4; + const XMMRegister x5 = xmm5; + const XMMRegister x6 = xmm6; + const XMMRegister x7 = xmm7; + + BLOCK_COMMENT("Entry:"); + __ enter(); // required for proper stackwalking of RuntimeStub frame + __ fast_sin(x0, x1, x2, x3, x4, x5, x6, x7, rax, rbx, rdx); + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + + return start; + + } + + address generate_libmCos() { + address start = __ pc(); + + const XMMRegister x0 = xmm0; + const XMMRegister x1 = xmm1; + const XMMRegister x2 = xmm2; + const XMMRegister x3 = xmm3; + + const XMMRegister x4 = xmm4; + const XMMRegister x5 = xmm5; + const XMMRegister x6 = xmm6; + const XMMRegister x7 = xmm7; + + const Register tmp = rbx; + + BLOCK_COMMENT("Entry:"); + __ enter(); // required for proper stackwalking of RuntimeStub frame + __ fast_cos(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp); + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + + return start; + + } // Safefetch stubs. void generate_safefetch(const char* name, int size, address* entry, @@ -3673,6 +3723,16 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::_dexp = generate_libmExp(); StubRoutines::_dlog = generate_libmLog(); StubRoutines::_dpow = generate_libmPow(); + if (UseLibmSinIntrinsic || UseLibmCosIntrinsic) { + StubRoutines::_dlibm_reduce_pi04l = generate_libm_reduce_pi04l(); + StubRoutines::_dlibm_sin_cos_huge = generate_libm_sin_cos_huge(); + } + if (UseLibmSinIntrinsic) { + StubRoutines::_dsin = generate_libmSin(); + } + if (UseLibmCosIntrinsic) { + StubRoutines::_dcos = generate_libmCos(); + } } } diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index b3eb330ac9b..db518d804db 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp @@ -2986,32 +2986,6 @@ class StubGenerator: public StubCodeGenerator { __ addq(rsp, 8); __ ret(0); } - { - StubCodeMark mark(this, "StubRoutines", "sin"); - StubRoutines::_intrinsic_sin = (double (*)(double)) __ pc(); - - __ subq(rsp, 8); - __ movdbl(Address(rsp, 0), xmm0); - __ fld_d(Address(rsp, 0)); - __ trigfunc('s'); - __ fstp_d(Address(rsp, 0)); - __ movdbl(xmm0, Address(rsp, 0)); - __ addq(rsp, 8); - __ ret(0); - } - { - StubCodeMark mark(this, "StubRoutines", "cos"); - StubRoutines::_intrinsic_cos = (double (*)(double)) __ pc(); - - __ subq(rsp, 8); - __ movdbl(Address(rsp, 0), xmm0); - __ fld_d(Address(rsp, 0)); - __ trigfunc('c'); - __ fstp_d(Address(rsp, 0)); - __ movdbl(xmm0, Address(rsp, 0)); - __ addq(rsp, 8); - __ ret(0); - } { StubCodeMark mark(this, "StubRoutines", "tan"); StubRoutines::_intrinsic_tan = (double (*)(double)) __ pc(); @@ -3752,7 +3726,7 @@ class StubGenerator: public StubCodeGenerator { const Register to = c_rarg1; // destination array address const Register key = c_rarg2; // key array address const Register counter = c_rarg3; // counter byte array initialized from counter array address - // and left with the results of the last encryption block + // and updated with the incremented counter in the end #ifndef _WIN64 const Register len_reg = c_rarg4; const Register saved_encCounter_start = c_rarg5; @@ -3967,8 +3941,8 @@ class StubGenerator: public StubCodeGenerator { __ addptr(pos, AESBlockSize); __ subptr(len_reg, AESBlockSize); __ jmp(L_singleBlockLoopTop[k]); - __ BIND(L_processTail_insr[k]); - __ addptr(pos, len_reg); + __ BIND(L_processTail_insr[k]); // Process the tail part of the input array + __ addptr(pos, len_reg); // 1. Insert bytes from src array into xmm_from0 register __ testptr(len_reg, 8); __ jcc(Assembler::zero, L_processTail_4_insr[k]); __ subptr(pos,8); @@ -3993,11 +3967,11 @@ class StubGenerator: public StubCodeGenerator { __ pinsrb(xmm_from0, Address(from, pos), 0); __ BIND(L_processTail_exit_insr[k]); - __ movdqu(Address(saved_encCounter_start, 0), xmm_result0); - __ pxor(xmm_result0, xmm_from0); + __ movdqu(Address(saved_encCounter_start, 0), xmm_result0); // 2. Perform pxor of the encrypted counter and plaintext Bytes. + __ pxor(xmm_result0, xmm_from0); // Also the encrypted counter is saved for next invocation. __ testptr(len_reg, 8); - __ jcc(Assembler::zero, L_processTail_4_extr[k]); + __ jcc(Assembler::zero, L_processTail_4_extr[k]); // 3. Extract bytes from xmm_result0 into the dest. array __ pextrq(Address(to, pos), xmm_result0, 0); __ psrldq(xmm_result0, 8); __ addptr(pos, 8); @@ -4640,6 +4614,92 @@ class StubGenerator: public StubCodeGenerator { #endif __ fast_pow(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp1, tmp2, tmp3, tmp4); +#ifdef _WIN64 + // restore xmm regs belonging to calling function + __ movdqu(xmm6, Address(rsp, 0)); + __ movdqu(xmm7, Address(rsp, 2 * wordSize)); + __ addptr(rsp, 4 * wordSize); +#endif + + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + + return start; + + } + + address generate_libmSin() { + address start = __ pc(); + + const XMMRegister x0 = xmm0; + const XMMRegister x1 = xmm1; + const XMMRegister x2 = xmm2; + const XMMRegister x3 = xmm3; + + const XMMRegister x4 = xmm4; + const XMMRegister x5 = xmm5; + const XMMRegister x6 = xmm6; + const XMMRegister x7 = xmm7; + + const Register tmp1 = r8; + const Register tmp2 = r9; + const Register tmp3 = r10; + const Register tmp4 = r11; + + BLOCK_COMMENT("Entry:"); + __ enter(); // required for proper stackwalking of RuntimeStub frame + +#ifdef _WIN64 + // save the xmm registers which must be preserved 6-7 + __ subptr(rsp, 4 * wordSize); + __ movdqu(Address(rsp, 0), xmm6); + __ movdqu(Address(rsp, 2 * wordSize), xmm7); +#endif + __ fast_sin(x0, x1, x2, x3, x4, x5, x6, x7, rax, rbx, rcx, rdx, tmp1, tmp2, tmp3, tmp4); + +#ifdef _WIN64 + // restore xmm regs belonging to calling function + __ movdqu(xmm6, Address(rsp, 0)); + __ movdqu(xmm7, Address(rsp, 2 * wordSize)); + __ addptr(rsp, 4 * wordSize); +#endif + + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + + return start; + + } + + address generate_libmCos() { + address start = __ pc(); + + const XMMRegister x0 = xmm0; + const XMMRegister x1 = xmm1; + const XMMRegister x2 = xmm2; + const XMMRegister x3 = xmm3; + + const XMMRegister x4 = xmm4; + const XMMRegister x5 = xmm5; + const XMMRegister x6 = xmm6; + const XMMRegister x7 = xmm7; + + const Register tmp1 = r8; + const Register tmp2 = r9; + const Register tmp3 = r10; + const Register tmp4 = r11; + + BLOCK_COMMENT("Entry:"); + __ enter(); // required for proper stackwalking of RuntimeStub frame + +#ifdef _WIN64 + // save the xmm registers which must be preserved 6-7 + __ subptr(rsp, 4 * wordSize); + __ movdqu(Address(rsp, 0), xmm6); + __ movdqu(Address(rsp, 2 * wordSize), xmm7); +#endif + __ fast_cos(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp1, tmp2, tmp3, tmp4); + #ifdef _WIN64 // restore xmm regs belonging to calling function __ movdqu(xmm6, Address(rsp, 0)); @@ -4849,6 +4909,12 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::_dexp = generate_libmExp(); StubRoutines::_dlog = generate_libmLog(); StubRoutines::_dpow = generate_libmPow(); + if (UseLibmSinIntrinsic) { + StubRoutines::_dsin = generate_libmSin(); + } + if (UseLibmCosIntrinsic) { + StubRoutines::_dcos = generate_libmCos(); + } } } diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp index c1ea0223389..17f76e8f876 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp @@ -30,7 +30,7 @@ // extend it. enum platform_dependent_constants { - code_size1 = 9000, // simply increase if too small (assembler will crash if too small) + code_size1 = 20000, // simply increase if too small (assembler will crash if too small) code_size2 = 33800 // simply increase if too small (assembler will crash if too small) }; diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp index 6f39276dc05..b4750ff4f90 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp @@ -32,7 +32,7 @@ static bool returns_to_call_stub(address return_pc) { return return_pc == _call_stub_return_address; } enum platform_dependent_constants { - code_size1 = 19000, // simply increase if too small (assembler will crash if too small) + code_size1 = 30000, // simply increase if too small (assembler will crash if too small) code_size2 = 35000 // simply increase if too small (assembler will crash if too small) }; diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp index db047dfd0d4..eb155c20be9 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,6 +49,17 @@ #define __ _masm-> +// Size of interpreter code. Increase if too small. Interpreter will +// fail with a guarantee ("not enough space for interpreter generation"); +// if too small. +// Run with +PrintInterpreter to get the VM to print out the size. +// Max size with JVMTI +#ifdef AMD64 +int TemplateInterpreter::InterpreterCodeSize = 256 * 1024; +#else +int TemplateInterpreter::InterpreterCodeSize = 224 * 1024; +#endif // AMD64 + // Global Register Names static const Register rbcp = LP64_ONLY(r13) NOT_LP64(rsi); static const Register rlocals = LP64_ONLY(r14) NOT_LP64(rdi); @@ -57,6 +68,7 @@ const int method_offset = frame::interpreter_frame_method_offset * wordSize; const int bcp_offset = frame::interpreter_frame_bcp_offset * wordSize; const int locals_offset = frame::interpreter_frame_locals_offset * wordSize; + //----------------------------------------------------------------------------- address TemplateInterpreterGenerator::generate_StackOverflowError_handler() { @@ -778,6 +790,30 @@ address TemplateInterpreterGenerator::generate_Reference_get_entry(void) { return NULL; } +// TODO: rather than touching all pages, check against stack_overflow_limit and bang yellow page to +// generate exception. Windows might need this to map the shadow pages though. +void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) { + // Quick & dirty stack overflow checking: bang the stack & handle trap. + // Note that we do the banging after the frame is setup, since the exception + // handling code expects to find a valid interpreter frame on the stack. + // Doing the banging earlier fails if the caller frame is not an interpreter + // frame. + // (Also, the exception throwing code expects to unlock any synchronized + // method receiever, so do the banging after locking the receiver.) + + // Bang each page in the shadow zone. We can't assume it's been done for + // an interpreter frame with greater than a page of locals, so each page + // needs to be checked. Only true for non-native. + if (UseStackBanging) { + const int page_size = os::vm_page_size(); + const int n_shadow_pages = ((int)JavaThread::stack_shadow_zone_size()) / page_size; + const int start_page = native_call ? n_shadow_pages : 1; + for (int pages = start_page; pages <= n_shadow_pages; pages++) { + __ bang_stack_with_offset(pages*page_size); + } + } +} + // Interpreter stub for calling a native method. (asm interpreter) // This sets up a somewhat different looking stack for calling the // native method than the typical interpreter frame setup. @@ -1304,6 +1340,27 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { return entry_point; } +// Abstract method entry +// Attempt to execute abstract method. Throw exception +address TemplateInterpreterGenerator::generate_abstract_entry(void) { + + address entry_point = __ pc(); + + // abstract method entry + + // pop return address, reset last_sp to NULL + __ empty_expression_stack(); + __ restore_bcp(); // rsi must be correct for exception handler (was destroyed) + __ restore_locals(); // make sure locals pointer is correct as well (was destroyed) + + // throw exception + __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); + // the call_VM checks for exception, so we should never return here. + __ should_not_reach_here(); + + return entry_point; +} + // // Generic interpreted method entry to (asm) interpreter // diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp index c3496b3f4ce..f5c286ec784 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -26,12 +26,26 @@ #include "asm/macroAssembler.hpp" #include "interpreter/interp_masm.hpp" #include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" #include "interpreter/templateInterpreterGenerator.hpp" #include "runtime/arguments.hpp" +#include "runtime/sharedRuntime.hpp" #define __ _masm-> +address TemplateInterpreterGenerator::generate_slow_signature_handler() { + address entry = __ pc(); + // rbx,: method + // rcx: temporary + // rdi: pointer to locals + // rsp: end of copied parameters area + __ mov(rcx, rsp); + __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), rbx, rdi, rcx); + __ ret(0); + return entry; +} + /** * Method entry for static native methods: * int java.util.zip.CRC32.update(int crc, int b) @@ -301,3 +315,105 @@ address TemplateInterpreterGenerator::generate_Double_doubleToRawLongBits_entry( return NULL; } + +address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { + + // rbx,: Method* + // rcx: scratrch + // rsi: sender sp + + if (!InlineIntrinsics) return NULL; // Generate a vanilla entry + + address entry_point = __ pc(); + + // These don't need a safepoint check because they aren't virtually + // callable. We won't enter these intrinsics from compiled code. + // If in the future we added an intrinsic which was virtually callable + // we'd have to worry about how to safepoint so that this code is used. + + // mathematical functions inlined by compiler + // (interpreter must provide identical implementation + // in order to avoid monotonicity bugs when switching + // from interpreter to compiler in the middle of some + // computation) + // + // stack: [ ret adr ] <-- rsp + // [ lo(arg) ] + // [ hi(arg) ] + // + + __ fld_d(Address(rsp, 1*wordSize)); + switch (kind) { + case Interpreter::java_lang_math_sin : + __ trigfunc('s'); + break; + case Interpreter::java_lang_math_cos : + __ trigfunc('c'); + break; + case Interpreter::java_lang_math_tan : + __ trigfunc('t'); + break; + case Interpreter::java_lang_math_sqrt: + __ fsqrt(); + break; + case Interpreter::java_lang_math_abs: + __ fabs(); + break; + case Interpreter::java_lang_math_log: + __ subptr(rsp, 2 * wordSize); + __ fstp_d(Address(rsp, 0)); + if (VM_Version::supports_sse2()) { + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog()))); + } + else { + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dlog))); + } + __ addptr(rsp, 2 * wordSize); + break; + case Interpreter::java_lang_math_log10: + __ flog10(); + // Store to stack to convert 80bit precision back to 64bits + __ push_fTOS(); + __ pop_fTOS(); + break; + case Interpreter::java_lang_math_pow: + __ fld_d(Address(rsp, 3*wordSize)); // second argument + __ subptr(rsp, 4 * wordSize); + __ fstp_d(Address(rsp, 0)); + __ fstp_d(Address(rsp, 2 * wordSize)); + if (VM_Version::supports_sse2()) { + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dpow()))); + } else { + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dpow))); + } + __ addptr(rsp, 4 * wordSize); + break; + case Interpreter::java_lang_math_exp: + __ subptr(rsp, 2*wordSize); + __ fstp_d(Address(rsp, 0)); + if (VM_Version::supports_sse2()) { + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dexp()))); + } else { + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dexp))); + } + __ addptr(rsp, 2*wordSize); + break; + default : + ShouldNotReachHere(); + } + + // return double result in xmm0 for interpreter and compilers. + if (UseSSE >= 2) { + __ subptr(rsp, 2*wordSize); + __ fstp_d(Address(rsp, 0)); + __ movdbl(xmm0, Address(rsp, 0)); + __ addptr(rsp, 2*wordSize); + } + + // done, result in FPU ST(0) or XMM0 + __ pop(rdi); // get return address + __ mov(rsp, rsi); // set sp to sender sp + __ jmp(rdi); + + return entry_point; +} diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp index e645a9ffe7e..3345cfee795 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, 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 @@ -26,11 +26,155 @@ #include "asm/macroAssembler.hpp" #include "interpreter/interp_masm.hpp" #include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" #include "interpreter/templateInterpreterGenerator.hpp" #include "runtime/arguments.hpp" #define __ _masm-> +#ifdef _WIN64 +address TemplateInterpreterGenerator::generate_slow_signature_handler() { + address entry = __ pc(); + + // rbx: method + // r14: pointer to locals + // c_rarg3: first stack arg - wordSize + __ mov(c_rarg3, rsp); + // adjust rsp + __ subptr(rsp, 4 * wordSize); + __ call_VM(noreg, + CAST_FROM_FN_PTR(address, + InterpreterRuntime::slow_signature_handler), + rbx, r14, c_rarg3); + + // rax: result handler + + // Stack layout: + // rsp: 3 integer or float args (if static first is unused) + // 1 float/double identifiers + // return address + // stack args + // garbage + // expression stack bottom + // bcp (NULL) + // ... + + // Do FP first so we can use c_rarg3 as temp + __ movl(c_rarg3, Address(rsp, 3 * wordSize)); // float/double identifiers + + for ( int i= 0; i < Argument::n_int_register_parameters_c-1; i++ ) { + XMMRegister floatreg = as_XMMRegister(i+1); + Label isfloatordouble, isdouble, next; + + __ testl(c_rarg3, 1 << (i*2)); // Float or Double? + __ jcc(Assembler::notZero, isfloatordouble); + + // Do Int register here + switch ( i ) { + case 0: + __ movl(rscratch1, Address(rbx, Method::access_flags_offset())); + __ testl(rscratch1, JVM_ACC_STATIC); + __ cmovptr(Assembler::zero, c_rarg1, Address(rsp, 0)); + break; + case 1: + __ movptr(c_rarg2, Address(rsp, wordSize)); + break; + case 2: + __ movptr(c_rarg3, Address(rsp, 2 * wordSize)); + break; + default: + break; + } + + __ jmp (next); + + __ bind(isfloatordouble); + __ testl(c_rarg3, 1 << ((i*2)+1)); // Double? + __ jcc(Assembler::notZero, isdouble); + +// Do Float Here + __ movflt(floatreg, Address(rsp, i * wordSize)); + __ jmp(next); + +// Do Double here + __ bind(isdouble); + __ movdbl(floatreg, Address(rsp, i * wordSize)); + + __ bind(next); + } + + + // restore rsp + __ addptr(rsp, 4 * wordSize); + + __ ret(0); + + return entry; +} +#else +address TemplateInterpreterGenerator::generate_slow_signature_handler() { + address entry = __ pc(); + + // rbx: method + // r14: pointer to locals + // c_rarg3: first stack arg - wordSize + __ mov(c_rarg3, rsp); + // adjust rsp + __ subptr(rsp, 14 * wordSize); + __ call_VM(noreg, + CAST_FROM_FN_PTR(address, + InterpreterRuntime::slow_signature_handler), + rbx, r14, c_rarg3); + + // rax: result handler + + // Stack layout: + // rsp: 5 integer args (if static first is unused) + // 1 float/double identifiers + // 8 double args + // return address + // stack args + // garbage + // expression stack bottom + // bcp (NULL) + // ... + + // Do FP first so we can use c_rarg3 as temp + __ movl(c_rarg3, Address(rsp, 5 * wordSize)); // float/double identifiers + + for (int i = 0; i < Argument::n_float_register_parameters_c; i++) { + const XMMRegister r = as_XMMRegister(i); + + Label d, done; + + __ testl(c_rarg3, 1 << i); + __ jcc(Assembler::notZero, d); + __ movflt(r, Address(rsp, (6 + i) * wordSize)); + __ jmp(done); + __ bind(d); + __ movdbl(r, Address(rsp, (6 + i) * wordSize)); + __ bind(done); + } + + // Now handle integrals. Only do c_rarg1 if not static. + __ movl(c_rarg3, Address(rbx, Method::access_flags_offset())); + __ testl(c_rarg3, JVM_ACC_STATIC); + __ cmovptr(Assembler::zero, c_rarg1, Address(rsp, 0)); + + __ movptr(c_rarg2, Address(rsp, wordSize)); + __ movptr(c_rarg3, Address(rsp, 2 * wordSize)); + __ movptr(c_rarg4, Address(rsp, 3 * wordSize)); + __ movptr(c_rarg5, Address(rsp, 4 * wordSize)); + + // restore rsp + __ addptr(rsp, 14 * wordSize); + + __ ret(0); + + return entry; +} +#endif // __WIN64 + /** * Method entry for static native methods: * int java.util.zip.CRC32.update(int crc, int b) @@ -193,3 +337,84 @@ address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(Abstract return NULL; } + +// +// Various method entries +// + +address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { + + // rbx,: Method* + // rcx: scratrch + // r13: sender sp + + if (!InlineIntrinsics) return NULL; // Generate a vanilla entry + + address entry_point = __ pc(); + + // These don't need a safepoint check because they aren't virtually + // callable. We won't enter these intrinsics from compiled code. + // If in the future we added an intrinsic which was virtually callable + // we'd have to worry about how to safepoint so that this code is used. + + // mathematical functions inlined by compiler + // (interpreter must provide identical implementation + // in order to avoid monotonicity bugs when switching + // from interpreter to compiler in the middle of some + // computation) + // + // stack: [ ret adr ] <-- rsp + // [ lo(arg) ] + // [ hi(arg) ] + // + + + if (kind == Interpreter::java_lang_math_sqrt) { + __ sqrtsd(xmm0, Address(rsp, wordSize)); + } else if (kind == Interpreter::java_lang_math_exp) { + __ movdbl(xmm0, Address(rsp, wordSize)); + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dexp()))); + } else if (kind == Interpreter::java_lang_math_log) { + __ movdbl(xmm0, Address(rsp, wordSize)); + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog()))); + } else if (kind == Interpreter::java_lang_math_pow) { + __ movdbl(xmm1, Address(rsp, wordSize)); + __ movdbl(xmm0, Address(rsp, 3 * wordSize)); + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dpow()))); + } else { + __ fld_d(Address(rsp, wordSize)); + switch (kind) { + case Interpreter::java_lang_math_sin : + __ trigfunc('s'); + break; + case Interpreter::java_lang_math_cos : + __ trigfunc('c'); + break; + case Interpreter::java_lang_math_tan : + __ trigfunc('t'); + break; + case Interpreter::java_lang_math_abs: + __ fabs(); + break; + case Interpreter::java_lang_math_log10: + __ flog10(); + break; + default : + ShouldNotReachHere(); + } + + // return double result in xmm0 for interpreter and compilers. + __ subptr(rsp, 2*wordSize); + // Round to 64bit precision + __ fstp_d(Address(rsp, 0)); + __ movdbl(xmm0, Address(rsp, 0)); + __ addptr(rsp, 2*wordSize); + } + + + __ pop(rax); + __ mov(rsp, r13); + __ jmp(rax); + + return entry_point; +} diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp index d31b0e5acd2..8756b51e899 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp @@ -671,7 +671,7 @@ void VM_Version::get_processor_features() { } // --AES-CTR ends-- } - } else if (UseAES || UseAESIntrinsics) { + } else if (UseAES || UseAESIntrinsics || UseAESCTRIntrinsics) { if (UseAES && !FLAG_IS_DEFAULT(UseAES)) { warning("AES instructions are not available on this CPU"); FLAG_SET_DEFAULT(UseAES, false); @@ -707,16 +707,6 @@ void VM_Version::get_processor_features() { FLAG_SET_DEFAULT(UseCRC32Intrinsics, false); } - if (UseAESIntrinsics) { - if (FLAG_IS_DEFAULT(UseAESCTRIntrinsics)) { - UseAESCTRIntrinsics = true; - } - } else if (UseAESCTRIntrinsics) { - if (!FLAG_IS_DEFAULT(UseAESCTRIntrinsics)) - warning("AES/CTR intrinsics are not available on this CPU"); - FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); - } - if (supports_sse4_2()) { if (FLAG_IS_DEFAULT(UseCRC32CIntrinsics)) { UseCRC32CIntrinsics = true; diff --git a/hotspot/src/cpu/x86/vm/x86.ad b/hotspot/src/cpu/x86/vm/x86.ad index 28d25cca76b..a316b914a52 100644 --- a/hotspot/src/cpu/x86/vm/x86.ad +++ b/hotspot/src/cpu/x86/vm/x86.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2011, 2016, 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 @@ -1711,6 +1711,14 @@ const bool Matcher::match_rule_supported(int opcode) { if (UseAVX < 1 || UseAVX > 2) ret_value = false; break; + case Op_StrIndexOf: + if (!UseSSE42Intrinsics) + ret_value = false; + break; + case Op_StrIndexOfChar: + if (!(UseSSE > 4)) + ret_value = false; + break; } return ret_value; // Per default match rules are supported. diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad index cebd468acb6..f684cd5b5cd 100644 --- a/hotspot/src/cpu/x86/vm/x86_32.ad +++ b/hotspot/src/cpu/x86/vm/x86_32.ad @@ -968,14 +968,15 @@ static int vec_stack_to_stack_helper(CodeBuffer *cbuf, bool do_size, int src_off case Op_VecS: calc_size = 3+src_offset_size + 3+dst_offset_size; break; - case Op_VecD: + case Op_VecD: { calc_size = 3+src_offset_size + 3+dst_offset_size; - src_offset += 4; - dst_offset += 4; - src_offset_size = (src_offset == 0) ? 0 : ((src_offset < 0x80) ? 1 : 4); - dst_offset_size = (dst_offset == 0) ? 0 : ((dst_offset < 0x80) ? 1 : 4); + int tmp_src_offset = src_offset + 4; + int tmp_dst_offset = dst_offset + 4; + src_offset_size = (tmp_src_offset == 0) ? 0 : ((tmp_src_offset < 0x80) ? 1 : 4); + dst_offset_size = (tmp_dst_offset == 0) ? 0 : ((tmp_dst_offset < 0x80) ? 1 : 4); calc_size += 3+src_offset_size + 3+dst_offset_size; break; + } case Op_VecX: case Op_VecY: case Op_VecZ: @@ -1009,6 +1010,7 @@ static int vec_stack_to_stack_helper(CodeBuffer *cbuf, bool do_size, int src_off __ vmovdqu(xmm0, Address(rsp, src_offset)); __ vmovdqu(Address(rsp, dst_offset), xmm0); __ vmovdqu(xmm0, Address(rsp, -32)); + break; case Op_VecZ: __ evmovdqul(Address(rsp, -64), xmm0, 2); __ evmovdqul(xmm0, Address(rsp, src_offset), 2); @@ -1019,7 +1021,7 @@ static int vec_stack_to_stack_helper(CodeBuffer *cbuf, bool do_size, int src_off ShouldNotReachHere(); } int size = __ offset() - offset; - assert(size == calc_size, "incorrect size calculattion"); + assert(size == calc_size, "incorrect size calculation"); return size; #ifndef PRODUCT } else if (!do_size) { @@ -1049,6 +1051,7 @@ static int vec_stack_to_stack_helper(CodeBuffer *cbuf, bool do_size, int src_off "vmovdqu [rsp + #%d], xmm0\n\t" "vmovdqu xmm0, [rsp - #32]", src_offset, dst_offset); + break; case Op_VecZ: st->print("vmovdqu [rsp - #64], xmm0\t# 512-bit mem-mem spill\n\t" "vmovdqu xmm0, [rsp + #%d]\n\t" @@ -9791,48 +9794,6 @@ instruct modD_reg(regD dst, regD src0, regD src1, eAXRegI rax, eFlagsReg cr) %{ ins_pipe( pipe_slow ); %} -instruct sinDPR_reg(regDPR1 dst, regDPR1 src) %{ - predicate (UseSSE<=1); - match(Set dst (SinD src)); - ins_cost(1800); - format %{ "DSIN $dst" %} - opcode(0xD9, 0xFE); - ins_encode( OpcP, OpcS ); - ins_pipe( pipe_slow ); -%} - -instruct sinD_reg(regD dst, eFlagsReg cr) %{ - predicate (UseSSE>=2); - match(Set dst (SinD dst)); - effect(KILL cr); // Push_{Src|Result}D() uses "{SUB|ADD} ESP,8" - ins_cost(1800); - format %{ "DSIN $dst" %} - opcode(0xD9, 0xFE); - ins_encode( Push_SrcD(dst), OpcP, OpcS, Push_ResultD(dst) ); - ins_pipe( pipe_slow ); -%} - -instruct cosDPR_reg(regDPR1 dst, regDPR1 src) %{ - predicate (UseSSE<=1); - match(Set dst (CosD src)); - ins_cost(1800); - format %{ "DCOS $dst" %} - opcode(0xD9, 0xFF); - ins_encode( OpcP, OpcS ); - ins_pipe( pipe_slow ); -%} - -instruct cosD_reg(regD dst, eFlagsReg cr) %{ - predicate (UseSSE>=2); - match(Set dst (CosD dst)); - effect(KILL cr); // Push_{Src|Result}D() uses "{SUB|ADD} ESP,8" - ins_cost(1800); - format %{ "DCOS $dst" %} - opcode(0xD9, 0xFF); - ins_encode( Push_SrcD(dst), OpcP, OpcS, Push_ResultD(dst) ); - ins_pipe( pipe_slow ); -%} - instruct tanDPR_reg(regDPR1 dst, regDPR1 src) %{ predicate (UseSSE<=1); match(Set dst(TanD src)); diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad index 9def843e07e..455354834ea 100644 --- a/hotspot/src/cpu/x86/vm/x86_64.ad +++ b/hotspot/src/cpu/x86/vm/x86_64.ad @@ -1079,6 +1079,7 @@ static void vec_stack_to_stack_helper(CodeBuffer *cbuf, int src_offset, __ vmovdqu(xmm0, Address(rsp, src_offset)); __ vmovdqu(Address(rsp, dst_offset), xmm0); __ vmovdqu(xmm0, Address(rsp, -32)); + break; case Op_VecZ: __ evmovdqul(Address(rsp, -64), xmm0, 2); __ evmovdqul(xmm0, Address(rsp, src_offset), 2); @@ -9819,24 +9820,6 @@ instruct cmpD_imm(rRegI dst, regD src, immD con, rFlagsReg cr) %{ %} // -----------Trig and Trancendental Instructions------------------------------ -instruct cosD_reg(regD dst) %{ - match(Set dst (CosD dst)); - - format %{ "dcos $dst\n\t" %} - opcode(0xD9, 0xFF); - ins_encode( Push_SrcXD(dst), OpcP, OpcS, Push_ResultXD(dst) ); - ins_pipe( pipe_slow ); -%} - -instruct sinD_reg(regD dst) %{ - match(Set dst (SinD dst)); - - format %{ "dsin $dst\n\t" %} - opcode(0xD9, 0xFE); - ins_encode( Push_SrcXD(dst), OpcP, OpcS, Push_ResultXD(dst) ); - ins_pipe( pipe_slow ); -%} - instruct tanD_reg(regD dst) %{ match(Set dst (TanD dst)); diff --git a/hotspot/src/cpu/zero/vm/abstractInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/abstractInterpreter_zero.cpp new file mode 100644 index 00000000000..de1a9584aeb --- /dev/null +++ b/hotspot/src/cpu/zero/vm/abstractInterpreter_zero.cpp @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "interpreter/bytecodeInterpreter.hpp" +#include "interpreter/cppInterpreter.hpp" +#include "runtime/frame.inline.hpp" +#include "utilities/globalDefinitions.hpp" + +bool AbstractInterpreter::can_be_compiled(methodHandle m) { + return true; +} + +int AbstractInterpreter::BasicType_as_index(BasicType type) { + int i = 0; + switch (type) { + case T_BOOLEAN: i = 0; break; + case T_CHAR : i = 1; break; + case T_BYTE : i = 2; break; + case T_SHORT : i = 3; break; + case T_INT : i = 4; break; + case T_LONG : i = 5; break; + case T_VOID : i = 6; break; + case T_FLOAT : i = 7; break; + case T_DOUBLE : i = 8; break; + case T_OBJECT : i = 9; break; + case T_ARRAY : i = 9; break; + default : ShouldNotReachHere(); + } + assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers, + "index out of bounds"); + return i; +} + +// Deoptimization helpers + +int AbstractInterpreter::size_activation(int max_stack, + int tempcount, + int extra_args, + int moncount, + int callee_param_count, + int callee_locals, + bool is_top_frame) { + int header_words = InterpreterFrame::header_words; + int monitor_words = moncount * frame::interpreter_frame_monitor_size(); + int stack_words = is_top_frame ? max_stack : tempcount; + int callee_extra_locals = callee_locals - callee_param_count; + + return header_words + monitor_words + stack_words + callee_extra_locals; +} + +void AbstractInterpreter::layout_activation(Method* method, + int tempcount, + int popframe_extra_args, + int moncount, + int caller_actual_parameters, + int callee_param_count, + int callee_locals, + frame* caller, + frame* interpreter_frame, + bool is_top_frame, + bool is_bottom_frame) { + assert(popframe_extra_args == 0, "what to do?"); + assert(!is_top_frame || (!callee_locals && !callee_param_count), + "top frame should have no caller"); + + // This code must exactly match what InterpreterFrame::build + // does (the full InterpreterFrame::build, that is, not the + // one that creates empty frames for the deoptimizer). + // + // interpreter_frame will be filled in. It's size is determined by + // a previous call to the size_activation() method, + // + // Note that tempcount is the current size of the expression + // stack. For top most frames we will allocate a full sized + // expression stack and not the trimmed version that non-top + // frames have. + + int monitor_words = moncount * frame::interpreter_frame_monitor_size(); + intptr_t *locals = interpreter_frame->fp() + method->max_locals(); + interpreterState istate = interpreter_frame->get_interpreterState(); + intptr_t *monitor_base = (intptr_t*) istate; + intptr_t *stack_base = monitor_base - monitor_words; + intptr_t *stack = stack_base - tempcount - 1; + + BytecodeInterpreter::layout_interpreterState(istate, + caller, + NULL, + method, + locals, + stack, + stack_base, + monitor_base, + NULL, + is_top_frame); +} + +// Helper for (runtime) stack overflow checks + +int AbstractInterpreter::size_top_interpreter_activation(Method* method) { + return 0; +} diff --git a/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp index e632d821792..2290f59d1b1 100644 --- a/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright 2008 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -25,7 +25,6 @@ #include "precompiled.hpp" #include "asm/assembler.hpp" -#include "interp_masm_zero.hpp" #include "interpreter/bytecodeInterpreter.hpp" #include "interpreter/bytecodeInterpreter.inline.hpp" #include "interpreter/interpreter.hpp" @@ -33,8 +32,6 @@ #include "oops/methodData.hpp" #include "oops/method.hpp" #include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" #include "runtime/deoptimization.hpp" #include "runtime/frame.inline.hpp" #include "runtime/sharedRuntime.hpp" @@ -68,4 +65,40 @@ const char *BytecodeInterpreter::name_of_field_at_address(address addr) { return NULL; } +void BytecodeInterpreter::layout_interpreterState(interpreterState istate, + frame* caller, + frame* current, + Method* method, + intptr_t* locals, + intptr_t* stack, + intptr_t* stack_base, + intptr_t* monitor_base, + intptr_t* frame_bottom, + bool is_top_frame) { + istate->set_locals(locals); + istate->set_method(method); + istate->set_self_link(istate); + istate->set_prev_link(NULL); + // thread will be set by a hacky repurposing of frame::patch_pc() + // bcp will be set by vframeArrayElement::unpack_on_stack() + istate->set_constants(method->constants()->cache()); + istate->set_msg(BytecodeInterpreter::method_resume); + istate->set_bcp_advance(0); + istate->set_oop_temp(NULL); + istate->set_mdx(NULL); + if (caller->is_interpreted_frame()) { + interpreterState prev = caller->get_interpreterState(); + prev->set_callee(method); + if (*prev->bcp() == Bytecodes::_invokeinterface) + prev->set_bcp_advance(5); + else + prev->set_bcp_advance(3); + } + istate->set_callee(NULL); + istate->set_monitor_base((BasicObjectLock *) monitor_base); + istate->set_stack_base(stack_base); + istate->set_stack(stack); + istate->set_stack_limit(stack_base - method->max_stack() - 1); +} + #endif // CC_INTERP diff --git a/hotspot/src/cpu/zero/vm/interpreter_zero.cpp b/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.cpp similarity index 56% rename from hotspot/src/cpu/zero/vm/interpreter_zero.cpp rename to hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.cpp index 4675ecb4db1..2a10782bddd 100644 --- a/hotspot/src/cpu/zero/vm/interpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.cpp @@ -27,32 +27,12 @@ #include "asm/assembler.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/cppInterpreterGenerator.hpp" -#include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" -#include "interpreter/templateTable.hpp" -#include "oops/arrayOop.hpp" -#include "oops/methodData.hpp" #include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "prims/methodHandles.hpp" #include "runtime/arguments.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/timer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#ifdef COMPILER1 -#include "c1/c1_Runtime1.hpp" -#endif -#ifdef CC_INTERP #include "interpreter/cppInterpreter.hpp" -#endif -address AbstractInterpreterGenerator::generate_slow_signature_handler() { +address CppInterpreterGenerator::generate_slow_signature_handler() { _masm->advance(1); return (address) InterpreterRuntime::slow_signature_handler; } @@ -70,6 +50,44 @@ address CppInterpreterGenerator::generate_abstract_entry() { return generate_entry((address) ShouldNotCallThisEntry()); } -bool AbstractInterpreter::can_be_compiled(methodHandle m) { - return true; +address CppInterpreterGenerator::generate_empty_entry() { + if (!UseFastEmptyMethods) + return NULL; + + return generate_entry((address) CppInterpreter::empty_entry); +} + +address CppInterpreterGenerator::generate_accessor_entry() { + if (!UseFastAccessorMethods) + return NULL; + + return generate_entry((address) CppInterpreter::accessor_entry); +} + +address CppInterpreterGenerator::generate_Reference_get_entry(void) { +#if INCLUDE_ALL_GCS + if (UseG1GC) { + // We need to generate have a routine that generates code to: + // * load the value in the referent field + // * passes that value to the pre-barrier. + // + // In the case of G1 this will record the value of the + // referent in an SATB buffer if marking is active. + // This will cause concurrent marking to mark the referent + // field as live. + Unimplemented(); + } +#endif // INCLUDE_ALL_GCS + + // If G1 is not enabled then attempt to go through the normal entry point + // Reference.get could be instrumented by jvmti + return NULL; +} + +address CppInterpreterGenerator::generate_native_entry(bool synchronized) { + return generate_entry((address) CppInterpreter::native_entry); +} + +address CppInterpreterGenerator::generate_normal_entry(bool synchronized) { + return generate_entry((address) CppInterpreter::normal_entry); } diff --git a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp index 1bb7809ea43..387733de06d 100644 --- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -747,92 +747,6 @@ InterpreterFrame *InterpreterFrame::build(Method* const method, TRAPS) { return (InterpreterFrame *) fp; } -int AbstractInterpreter::BasicType_as_index(BasicType type) { - int i = 0; - switch (type) { - case T_BOOLEAN: i = 0; break; - case T_CHAR : i = 1; break; - case T_BYTE : i = 2; break; - case T_SHORT : i = 3; break; - case T_INT : i = 4; break; - case T_LONG : i = 5; break; - case T_VOID : i = 6; break; - case T_FLOAT : i = 7; break; - case T_DOUBLE : i = 8; break; - case T_OBJECT : i = 9; break; - case T_ARRAY : i = 9; break; - default : ShouldNotReachHere(); - } - assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers, - "index out of bounds"); - return i; -} - -BasicType CppInterpreter::result_type_of(Method* method) { - BasicType t; - switch (method->result_index()) { - case 0 : t = T_BOOLEAN; break; - case 1 : t = T_CHAR; break; - case 2 : t = T_BYTE; break; - case 3 : t = T_SHORT; break; - case 4 : t = T_INT; break; - case 5 : t = T_LONG; break; - case 6 : t = T_VOID; break; - case 7 : t = T_FLOAT; break; - case 8 : t = T_DOUBLE; break; - case 9 : t = T_OBJECT; break; - default: ShouldNotReachHere(); - } - assert(AbstractInterpreter::BasicType_as_index(t) == method->result_index(), - "out of step with AbstractInterpreter::BasicType_as_index"); - return t; -} - -address CppInterpreterGenerator::generate_empty_entry() { - if (!UseFastEmptyMethods) - return NULL; - - return generate_entry((address) CppInterpreter::empty_entry); -} - -address CppInterpreterGenerator::generate_accessor_entry() { - if (!UseFastAccessorMethods) - return NULL; - - return generate_entry((address) CppInterpreter::accessor_entry); -} - -address CppInterpreterGenerator::generate_Reference_get_entry(void) { -#if INCLUDE_ALL_GCS - if (UseG1GC) { - // We need to generate have a routine that generates code to: - // * load the value in the referent field - // * passes that value to the pre-barrier. - // - // In the case of G1 this will record the value of the - // referent in an SATB buffer if marking is active. - // This will cause concurrent marking to mark the referent - // field as live. - Unimplemented(); - } -#endif // INCLUDE_ALL_GCS - - // If G1 is not enabled then attempt to go through the normal entry point - // Reference.get could be instrumented by jvmti - return NULL; -} - -address CppInterpreterGenerator::generate_native_entry(bool synchronized) { - return generate_entry((address) CppInterpreter::native_entry); -} - -address CppInterpreterGenerator::generate_normal_entry(bool synchronized) { - return generate_entry((address) CppInterpreter::normal_entry); -} - - -// Deoptimization helpers - InterpreterFrame *InterpreterFrame::build(int size, TRAPS) { ZeroStack *stack = ((JavaThread *) THREAD)->zero_stack(); @@ -858,101 +772,24 @@ InterpreterFrame *InterpreterFrame::build(int size, TRAPS) { return (InterpreterFrame *) fp; } -int AbstractInterpreter::size_activation(int max_stack, - int tempcount, - int extra_args, - int moncount, - int callee_param_count, - int callee_locals, - bool is_top_frame) { - int header_words = InterpreterFrame::header_words; - int monitor_words = moncount * frame::interpreter_frame_monitor_size(); - int stack_words = is_top_frame ? max_stack : tempcount; - int callee_extra_locals = callee_locals - callee_param_count; - - return header_words + monitor_words + stack_words + callee_extra_locals; -} - -void AbstractInterpreter::layout_activation(Method* method, - int tempcount, - int popframe_extra_args, - int moncount, - int caller_actual_parameters, - int callee_param_count, - int callee_locals, - frame* caller, - frame* interpreter_frame, - bool is_top_frame, - bool is_bottom_frame) { - assert(popframe_extra_args == 0, "what to do?"); - assert(!is_top_frame || (!callee_locals && !callee_param_count), - "top frame should have no caller"); - - // This code must exactly match what InterpreterFrame::build - // does (the full InterpreterFrame::build, that is, not the - // one that creates empty frames for the deoptimizer). - // - // interpreter_frame will be filled in. It's size is determined by - // a previous call to the size_activation() method, - // - // Note that tempcount is the current size of the expression - // stack. For top most frames we will allocate a full sized - // expression stack and not the trimmed version that non-top - // frames have. - - int monitor_words = moncount * frame::interpreter_frame_monitor_size(); - intptr_t *locals = interpreter_frame->fp() + method->max_locals(); - interpreterState istate = interpreter_frame->get_interpreterState(); - intptr_t *monitor_base = (intptr_t*) istate; - intptr_t *stack_base = monitor_base - monitor_words; - intptr_t *stack = stack_base - tempcount - 1; - - BytecodeInterpreter::layout_interpreterState(istate, - caller, - NULL, - method, - locals, - stack, - stack_base, - monitor_base, - NULL, - is_top_frame); -} - -void BytecodeInterpreter::layout_interpreterState(interpreterState istate, - frame* caller, - frame* current, - Method* method, - intptr_t* locals, - intptr_t* stack, - intptr_t* stack_base, - intptr_t* monitor_base, - intptr_t* frame_bottom, - bool is_top_frame) { - istate->set_locals(locals); - istate->set_method(method); - istate->set_self_link(istate); - istate->set_prev_link(NULL); - // thread will be set by a hacky repurposing of frame::patch_pc() - // bcp will be set by vframeArrayElement::unpack_on_stack() - istate->set_constants(method->constants()->cache()); - istate->set_msg(BytecodeInterpreter::method_resume); - istate->set_bcp_advance(0); - istate->set_oop_temp(NULL); - istate->set_mdx(NULL); - if (caller->is_interpreted_frame()) { - interpreterState prev = caller->get_interpreterState(); - prev->set_callee(method); - if (*prev->bcp() == Bytecodes::_invokeinterface) - prev->set_bcp_advance(5); - else - prev->set_bcp_advance(3); +BasicType CppInterpreter::result_type_of(Method* method) { + BasicType t; + switch (method->result_index()) { + case 0 : t = T_BOOLEAN; break; + case 1 : t = T_CHAR; break; + case 2 : t = T_BYTE; break; + case 3 : t = T_SHORT; break; + case 4 : t = T_INT; break; + case 5 : t = T_LONG; break; + case 6 : t = T_VOID; break; + case 7 : t = T_FLOAT; break; + case 8 : t = T_DOUBLE; break; + case 9 : t = T_OBJECT; break; + default: ShouldNotReachHere(); } - istate->set_callee(NULL); - istate->set_monitor_base((BasicObjectLock *) monitor_base); - istate->set_stack_base(stack_base); - istate->set_stack(stack); - istate->set_stack_limit(stack_base - method->max_stack() - 1); + assert(AbstractInterpreter::BasicType_as_index(t) == method->result_index(), + "out of step with AbstractInterpreter::BasicType_as_index"); + return t; } address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { @@ -964,12 +801,6 @@ address CppInterpreter::deopt_entry(TosState state, int length) { return NULL; } -// Helper for (runtime) stack overflow checks - -int AbstractInterpreter::size_top_interpreter_activation(Method* method) { - return 0; -} - // Helper for figuring out if frames are interpreter frames bool CppInterpreter::contains(address pc) { diff --git a/hotspot/src/cpu/zero/vm/stack_zero.cpp b/hotspot/src/cpu/zero/vm/stack_zero.cpp index 747199f5492..1acb96e97ec 100644 --- a/hotspot/src/cpu/zero/vm/stack_zero.cpp +++ b/hotspot/src/cpu/zero/vm/stack_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -25,9 +25,16 @@ #include "precompiled.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "runtime/thread.hpp" #include "stack_zero.hpp" #include "stack_zero.inline.hpp" +// Inlined causes circular inclusion with thread.hpp +ZeroStack::ZeroStack() + : _base(NULL), _top(NULL), _sp(NULL) { + _shadow_pages_size = JavaThread::stack_shadow_zone_size(); + } + int ZeroStack::suggest_size(Thread *thread) const { assert(needs_setup(), "already set up"); int abi_available = abi_stack_available(thread); diff --git a/hotspot/src/cpu/zero/vm/stack_zero.hpp b/hotspot/src/cpu/zero/vm/stack_zero.hpp index df1ea7235c8..6048cf2ac83 100644 --- a/hotspot/src/cpu/zero/vm/stack_zero.hpp +++ b/hotspot/src/cpu/zero/vm/stack_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -38,10 +38,7 @@ class ZeroStack { int _shadow_pages_size; // how much ABI stack must we keep free? public: - ZeroStack() - : _base(NULL), _top(NULL), _sp(NULL) { - _shadow_pages_size = JavaThread::stack_shadow_zone_size(); - } + ZeroStack(); bool needs_setup() const { return _base == NULL; diff --git a/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp b/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp index 7123098dfbb..02d12e8e96d 100644 --- a/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp +++ b/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -49,11 +49,10 @@ inline void ZeroStack::overflow_check(int required_words, TRAPS) { // value can be negative. inline int ZeroStack::abi_stack_available(Thread *thread) const { guarantee(Thread::current() == thread, "should run in the same thread"); - assert(thread->stack_size() - - (thread->stack_base() - (address) &stack_used + - JavaThread::stack_guard_zone_size() + JavaThread::stack_shadow_zone_size()) == - (address)&stack_used - thread->stack_overflow_limit(), "sanity"); - return (address)&stack_used - stack_overflow_limit(); + int stack_used = thread->stack_base() - (address) &stack_used + + (JavaThread::stack_guard_zone_size() + JavaThread::stack_shadow_zone_size()); + int stack_free = thread->stack_size() - stack_used; + return stack_free; } #endif // CPU_ZERO_VM_STACK_ZERO_INLINE_HPP diff --git a/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c index 84154be4eb0..c12f82d1bf6 100644 --- a/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c +++ b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c @@ -171,6 +171,7 @@ lib_info* add_lib_info_fd(struct ps_prochandle* ph, const char* libname, int fd, if (strlen(libname) >= sizeof(newlib->name)) { print_debug("libname %s too long\n", libname); + free(newlib); return NULL; } strcpy(newlib->name, libname); diff --git a/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.c b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.c index b8ba361b8a9..b84c6505997 100644 --- a/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.c +++ b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.c @@ -217,6 +217,7 @@ lib_info* add_lib_info_fd(struct ps_prochandle* ph, const char* libname, int fd, if (strlen(libname) >= sizeof(newlib->name)) { print_debug("libname %s too long\n", libname); + free(newlib); return NULL; } strcpy(newlib->name, libname); diff --git a/hotspot/src/jdk.vm.ci/share/classes/META-INF/services/jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory b/hotspot/src/jdk.vm.ci/share/classes/META-INF/services/jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory new file mode 100644 index 00000000000..fe3a4573058 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/META-INF/services/jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory @@ -0,0 +1,3 @@ +jdk.vm.ci.hotspot.aarch64.AArch64HotSpotJVMCIBackendFactory +jdk.vm.ci.hotspot.amd64.AMD64HotSpotJVMCIBackendFactory +jdk.vm.ci.hotspot.sparc.SPARCHotSpotJVMCIBackendFactory diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CallingConvention.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CallingConvention.java index 6161619548b..240b4be1423 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CallingConvention.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CallingConvention.java @@ -34,35 +34,9 @@ import jdk.vm.ci.meta.Value; public class CallingConvention { /** - * Constants denoting the type of a call for which a calling convention is requested. + * Marker interface denoting the type of a call for which a calling convention is requested. */ - public enum Type { - /** - * A request for the outgoing argument locations at a call site to Java code. - */ - JavaCall(true), - - /** - * A request for the incoming argument locations. - */ - JavaCallee(false), - - /** - * A request for the outgoing argument locations at a call site to external native code that - * complies with the platform ABI. - */ - NativeCall(true); - - /** - * Determines if this is a request for the outgoing argument locations at a call site. - */ - public final boolean out; - - public static final Type[] VALUES = values(); - - private Type(boolean out) { - this.out = out; - } + public interface Type { } /** diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java index e4f3cae3bee..7e836d22f21 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java @@ -22,12 +22,8 @@ */ package jdk.vm.ci.code; -import jdk.vm.ci.code.CompilationResult.Call; -import jdk.vm.ci.code.CompilationResult.DataPatch; -import jdk.vm.ci.code.CompilationResult.Mark; -import jdk.vm.ci.code.DataSection.Data; -import jdk.vm.ci.meta.Constant; -import jdk.vm.ci.meta.JavaConstant; +import jdk.vm.ci.code.site.Call; +import jdk.vm.ci.code.site.Mark; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.SpeculationLog; @@ -41,7 +37,7 @@ public interface CodeCacheProvider { * default implementation of the method. * * @param method a method implemented by the installed code - * @param compResult the compilation result to be added + * @param compiledCode the compiled code to be added * @param log the speculation log to be used * @param installedCode a predefined {@link InstalledCode} object to use as a reference to the * installed code. If {@code null}, a new {@link InstalledCode} object will be @@ -49,8 +45,8 @@ public interface CodeCacheProvider { * @return a reference to the ready-to-run code * @throws BailoutException if the code installation failed */ - default InstalledCode addCode(ResolvedJavaMethod method, CompilationResult compResult, SpeculationLog log, InstalledCode installedCode) { - return installCode(new CompilationRequest(method), compResult, installedCode, log, false); + default InstalledCode addCode(ResolvedJavaMethod method, CompiledCode compiledCode, SpeculationLog log, InstalledCode installedCode) { + return installCode(method, compiledCode, installedCode, log, false); } /** @@ -59,21 +55,20 @@ public interface CodeCacheProvider { * * @param method a method implemented by the installed code and for which the installed code * becomes the default implementation - * @param compResult the compilation result to be added + * @param compiledCode the compiled code to be added * @return a reference to the ready-to-run code * @throws BailoutException if the code installation failed */ - default InstalledCode setDefaultCode(ResolvedJavaMethod method, CompilationResult compResult) { - return installCode(new CompilationRequest(method), compResult, null, null, true); + default InstalledCode setDefaultCode(ResolvedJavaMethod method, CompiledCode compiledCode) { + return installCode(method, compiledCode, null, null, true); } /** * Installs code based on a given compilation result. * - * @param compRequest details of the method compiled to produce {@code compResult} or - * {@code null} if the input to {@code compResult} was not a - * {@link ResolvedJavaMethod} - * @param compResult the compilation result to be added + * @param method the method compiled to produce {@code compiledCode} or {@code null} if the + * input to {@code compResult} was not a {@link ResolvedJavaMethod} + * @param compiledCode the compiled code to be added * @param installedCode a pre-allocated {@link InstalledCode} object to use as a reference to * the installed code. If {@code null}, a new {@link InstalledCode} object will be * created. @@ -85,7 +80,7 @@ public interface CodeCacheProvider { * @return a reference to the compiled and ready-to-run installed code * @throws BailoutException if the code installation failed */ - InstalledCode installCode(CompilationRequest compRequest, CompilationResult compResult, InstalledCode installedCode, SpeculationLog log, boolean isDefault); + InstalledCode installCode(ResolvedJavaMethod method, CompiledCode compiledCode, InstalledCode installedCode, SpeculationLog log, boolean isDefault); /** * Invalidates {@code installedCode} such that {@link InvalidInstalledCodeException} will be @@ -121,19 +116,6 @@ public interface CodeCacheProvider { */ int getMinimumOutgoingSize(); - /** - * Determines if a {@link DataPatch} should be created for a given primitive constant that is - * part of a {@link CompilationResult}. A data patch is always created for an object constant. - */ - boolean needsDataPatch(JavaConstant constant); - - /** - * Create a {@link Data} item for one or more {@link Constant Constants}, that can be used in a - * {@link DataPatch}. If more than one {@link Constant} is given, then they are tightly packed - * into a single {@link Data} item. - */ - Data createDataItem(Constant... constants); - /** * Gets a description of the target architecture. */ diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java index a138a30dca2..9cde2e53bee 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java @@ -417,7 +417,7 @@ public class CodeUtil { /** * Create a calling convention from a {@link ResolvedJavaMethod}. */ - public static CallingConvention getCallingConvention(CodeCacheProvider codeCache, CallingConvention.Type type, ResolvedJavaMethod method, boolean stackOnly) { + public static CallingConvention getCallingConvention(CodeCacheProvider codeCache, CallingConvention.Type type, ResolvedJavaMethod method) { Signature sig = method.getSignature(); JavaType retType = sig.getReturnType(null); int sigCount = sig.getParameterCount(false); @@ -434,6 +434,6 @@ public class CodeUtil { } RegisterConfig registerConfig = codeCache.getRegisterConfig(); - return registerConfig.getCallingConvention(type, retType, argTypes, codeCache.getTarget(), stackOnly); + return registerConfig.getCallingConvention(type, retType, argTypes, codeCache.getTarget()); } } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequestResult.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequestResult.java new file mode 100644 index 00000000000..fcde020b7d9 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequestResult.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.vm.ci.code; + +/** + * Simple class to provide information about the result of a compile request. + */ +public final class CompilationRequestResult { + + /** + * A user readable description of the failure. + */ + private final String failureMessage; + + /** + * Whether this is a transient failure where retrying would help. + */ + private final boolean retry; + + /** + * Number of bytecodes inlined into the compilation, exclusive of the bytecodes in the root + * method. + */ + private final int inlinedBytecodes; + + private CompilationRequestResult(String failureMessage, boolean retry, int inlinedBytecodes) { + this.failureMessage = failureMessage; + this.retry = retry; + this.inlinedBytecodes = inlinedBytecodes; + } + + public static CompilationRequestResult success(int inlinedBytecodes) { + return new CompilationRequestResult(null, true, inlinedBytecodes); + } + + public static CompilationRequestResult failure(String failureMessage, boolean retry) { + return new CompilationRequestResult(failureMessage, retry, 0); + } + + public String getFailureMessage() { + return failureMessage; + } + + public boolean getRetry() { + return retry; + } + + public int getInlinedBytecodes() { + return inlinedBytecodes; + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationResult.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationResult.java deleted file mode 100644 index b8c5ff4843a..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationResult.java +++ /dev/null @@ -1,1078 +0,0 @@ -/* - * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.code; - -import static java.util.Collections.emptyList; -import static java.util.Collections.unmodifiableList; -import static jdk.vm.ci.meta.MetaUtil.identityHashCodeString; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import jdk.vm.ci.meta.Assumptions.Assumption; -import jdk.vm.ci.meta.InvokeTarget; -import jdk.vm.ci.meta.JavaConstant; -import jdk.vm.ci.meta.MetaUtil; -import jdk.vm.ci.meta.ResolvedJavaMethod; -import jdk.vm.ci.meta.VMConstant; - -/** - * Represents the output from compiling a method, including the compiled machine code, associated - * data and references, relocation information, deoptimization information, etc. - */ -public class CompilationResult { - - /** - * Represents a code position with associated additional information. - */ - public abstract static class Site { - - /** - * The position (or offset) of this site with respect to the start of the target method. - */ - public final int pcOffset; - - public Site(int pos) { - this.pcOffset = pos; - } - - @Override - public final int hashCode() { - throw new UnsupportedOperationException("hashCode"); - } - - @Override - public String toString() { - return identityHashCodeString(this); - } - - @Override - public abstract boolean equals(Object obj); - } - - /** - * Represents an infopoint with associated debug info. Note that safepoints are also infopoints. - */ - public static class Infopoint extends Site implements Comparable { - - public final DebugInfo debugInfo; - - public final InfopointReason reason; - - public Infopoint(int pcOffset, DebugInfo debugInfo, InfopointReason reason) { - super(pcOffset); - this.debugInfo = debugInfo; - this.reason = reason; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(pcOffset); - sb.append("[]"); - appendDebugInfo(sb, debugInfo); - return sb.toString(); - } - - @Override - public int compareTo(Infopoint o) { - if (pcOffset < o.pcOffset) { - return -1; - } else if (pcOffset > o.pcOffset) { - return 1; - } - return this.reason.compareTo(o.reason); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj != null && obj.getClass() == getClass()) { - Infopoint that = (Infopoint) obj; - if (this.pcOffset == that.pcOffset && Objects.equals(this.debugInfo, that.debugInfo) && Objects.equals(this.reason, that.reason)) { - return true; - } - } - return false; - } - } - - public enum MetaSpaceAccessType { - Move, - Store, // store only works for compressed oops (memory <- 32bit value). Compressed oops is - // not supported using AOT. TODO: Look at HotSpotStoreConstantOp - Compare; // HotSpotCompareMemoryConstantOp, HotSpotCompareConstantOp - - private MetaSpaceAccessType() { - } - } - - /** - * Represents a meta space pointer access in the code. - */ - public static final class MetaSpaceAccess extends Infopoint { - - /** - * Metaspace reference. - */ - public final Object reference; // Object here is a HotSpotResolvedObjectType or a - // HotSpotMetaSpaceConstant - - public final MetaSpaceAccessType type; - - /** - * Instruction size. - */ - public final int instructionSize; - - public MetaSpaceAccess(Object reference, int instructionSize, MetaSpaceAccessType type, int pcOffset, DebugInfo debugInfo) { - super(pcOffset, debugInfo, InfopointReason.METASPACE_ACCESS); - this.type = type; - this.reference = reference; - this.instructionSize = instructionSize; - } - } - - /** - * Represents a call in the code. - */ - public static final class Call extends Infopoint { - - /** - * The target of the call. - */ - public final InvokeTarget target; - - /** - * The size of the call instruction. - */ - public final int size; - - /** - * Specifies if this call is direct or indirect. A direct call has an immediate operand - * encoding the absolute or relative (to the call itself) address of the target. An indirect - * call has a register or memory operand specifying the target address of the call. - */ - public final boolean direct; - - public Call(InvokeTarget target, int pcOffset, int size, boolean direct, DebugInfo debugInfo) { - super(pcOffset, debugInfo, InfopointReason.CALL); - this.size = size; - this.target = target; - this.direct = direct; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof Call && super.equals(obj)) { - Call that = (Call) obj; - if (this.size == that.size && this.direct == that.direct && Objects.equals(this.target, that.target)) { - return true; - } - } - return false; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(pcOffset); - sb.append('['); - sb.append(target); - sb.append(']'); - - if (debugInfo != null) { - appendDebugInfo(sb, debugInfo); - } - - return sb.toString(); - } - } - - /** - * Represents some external data that is referenced by the code. - */ - public abstract static class Reference { - - @Override - public abstract int hashCode(); - - @Override - public abstract boolean equals(Object obj); - } - - public static final class ConstantReference extends Reference { - - private final VMConstant constant; - - public ConstantReference(VMConstant constant) { - this.constant = constant; - } - - public VMConstant getConstant() { - return constant; - } - - @Override - public String toString() { - return constant.toString(); - } - - @Override - public int hashCode() { - return constant.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof ConstantReference) { - ConstantReference that = (ConstantReference) obj; - return Objects.equals(this.constant, that.constant); - } - return false; - } - } - - public static final class DataSectionReference extends Reference { - - private boolean initialized; - private int offset; - - public DataSectionReference() { - // will be set after the data section layout is fixed - offset = 0xDEADDEAD; - } - - public int getOffset() { - assert initialized; - - return offset; - } - - public void setOffset(int offset) { - assert !initialized; - initialized = true; - - this.offset = offset; - } - - @Override - public int hashCode() { - return offset; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof DataSectionReference) { - DataSectionReference that = (DataSectionReference) obj; - return this.offset == that.offset; - } - return false; - } - - @Override - public String toString() { - if (initialized) { - return String.format("DataSection[0x%x]", offset); - } else { - return "DataSection[?]"; - } - } - } - - /** - * Represents a code site that references some data. The associated data can be either a - * {@link DataSectionReference reference} to the data section, or it may be an inlined - * {@link JavaConstant} that needs to be patched. - */ - public static final class DataPatch extends Site { - - public Reference reference; - public Object note; - - public DataPatch(int pcOffset, Reference reference) { - super(pcOffset); - this.reference = reference; - this.note = null; - } - - public DataPatch(int pcOffset, Reference reference, Object note) { - super(pcOffset); - this.reference = reference; - this.note = note; - } - - @Override - public String toString() { - if (note != null) { - return String.format("%d[, note: %s]", pcOffset, reference.toString(), note.toString()); - } else { - return String.format("%d[]", pcOffset, reference.toString()); - } - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof DataPatch) { - DataPatch that = (DataPatch) obj; - if (this.pcOffset == that.pcOffset && Objects.equals(this.reference, that.reference) && Objects.equals(this.note, that.note)) { - return true; - } - } - return false; - } - } - - /** - * Provides extra information about instructions or data at specific positions in - * {@link CompilationResult#getTargetCode()}. This is optional information that can be used to - * enhance a disassembly of the code. - */ - public abstract static class CodeAnnotation { - - public final int position; - - public CodeAnnotation(int position) { - this.position = position; - } - - @Override - public final int hashCode() { - throw new UnsupportedOperationException("hashCode"); - } - - @Override - public String toString() { - return identityHashCodeString(this); - } - - @Override - public abstract boolean equals(Object obj); - } - - /** - * A string comment about one or more instructions at a specific position in the code. - */ - public static final class CodeComment extends CodeAnnotation { - - public final String value; - - public CodeComment(int position, String comment) { - super(position); - this.value = comment; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof CodeComment) { - CodeComment that = (CodeComment) obj; - if (this.position == that.position && this.value.equals(that.value)) { - return true; - } - } - return false; - } - - @Override - public String toString() { - return getClass().getSimpleName() + "@" + position + ": " + value; - } - } - - /** - * Describes a table of signed offsets embedded in the code. The offsets are relative to the - * starting address of the table. This type of table maybe generated when translating a - * multi-way branch based on a key value from a dense value set (e.g. the {@code tableswitch} - * JVM instruction). - * - * The table is indexed by the contiguous range of integers from {@link #low} to {@link #high} - * inclusive. - */ - public static final class JumpTable extends CodeAnnotation { - - /** - * The low value in the key range (inclusive). - */ - public final int low; - - /** - * The high value in the key range (inclusive). - */ - public final int high; - - /** - * The size (in bytes) of each table entry. - */ - public final int entrySize; - - public JumpTable(int position, int low, int high, int entrySize) { - super(position); - this.low = low; - this.high = high; - this.entrySize = entrySize; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof JumpTable) { - JumpTable that = (JumpTable) obj; - if (this.position == that.position && this.entrySize == that.entrySize && this.low == that.low && this.high == that.high) { - return true; - } - } - return false; - } - - @Override - public String toString() { - return getClass().getSimpleName() + "@" + position + ": [" + low + " .. " + high + "]"; - } - } - - /** - * Represents exception handler information for a specific code position. It includes the catch - * code position as well as the caught exception type. - */ - public static final class ExceptionHandler extends Site { - - public final int handlerPos; - - ExceptionHandler(int pcOffset, int handlerPos) { - super(pcOffset); - this.handlerPos = handlerPos; - } - - @Override - public String toString() { - return String.format("%d[]", pcOffset, handlerPos); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof ExceptionHandler) { - ExceptionHandler that = (ExceptionHandler) obj; - if (this.pcOffset == that.pcOffset && this.handlerPos == that.handlerPos) { - return true; - } - } - return false; - } - } - - /** - * Represents a mark in the machine code that can be used by the runtime for its own purposes. A - * mark can reference other marks. - */ - public static final class Mark extends Site { - - public final Object id; - - public Mark(int pcOffset, Object id) { - super(pcOffset); - this.id = id; - } - - @Override - public String toString() { - if (id == null) { - return String.format("%d[]", pcOffset); - } else if (id instanceof Integer) { - return String.format("%d[]", pcOffset, Integer.toHexString((Integer) id)); - } else { - return String.format("%d[]", pcOffset, id.toString()); - } - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof Mark) { - Mark that = (Mark) obj; - if (this.pcOffset == that.pcOffset && Objects.equals(this.id, that.id)) { - return true; - } - } - return false; - } - } - - /** - * Specifies whether this compilation is a {@code +ImmutableCode} {@code +GeneratePIC} - * compilation. - */ - private final boolean isImmutablePIC; - - private boolean closed; - - private int entryBCI = -1; - - private final DataSection dataSection = new DataSection(); - - private final List infopoints = new ArrayList<>(); - private final List dataPatches = new ArrayList<>(); - private final List exceptionHandlers = new ArrayList<>(); - private final List marks = new ArrayList<>(); - - private int totalFrameSize = -1; - private int customStackAreaOffset = -1; - - private final String name; - - /** - * The buffer containing the emitted machine code. - */ - private byte[] targetCode; - - /** - * The leading number of bytes in {@link #targetCode} containing the emitted machine code. - */ - private int targetCodeSize; - - private ArrayList annotations; - - private Assumption[] assumptions; - - /** - * The list of the methods whose bytecodes were used as input to the compilation. If - * {@code null}, then the compilation did not record method dependencies. Otherwise, the first - * element of this array is the root method of the compilation. - */ - private ResolvedJavaMethod[] methods; - - private int bytecodeSize; - - private boolean hasUnsafeAccess; - - public CompilationResult() { - this(null); - } - - public CompilationResult(String name) { - this.name = name; - this.isImmutablePIC = false; - } - - public CompilationResult(boolean isImmutablePIC) { - this.name = null; - this.isImmutablePIC = isImmutablePIC; - } - - @Override - public int hashCode() { - // CompilationResult instances should not be used as hash map keys - throw new UnsupportedOperationException("hashCode"); - } - - @Override - public String toString() { - if (methods != null) { - return getClass().getName() + "[" + methods[0].format("%H.%n(%p)%r") + "]"; - } - return identityHashCodeString(this); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj != null && obj.getClass() == getClass()) { - CompilationResult that = (CompilationResult) obj; - // @formatter:off - if (this.entryBCI == that.entryBCI && - this.customStackAreaOffset == that.customStackAreaOffset && - this.totalFrameSize == that.totalFrameSize && - this.targetCodeSize == that.targetCodeSize && - Objects.equals(this.name, that.name) && - Objects.equals(this.annotations, that.annotations) && - Objects.equals(this.dataSection, that.dataSection) && - Objects.equals(this.exceptionHandlers, that.exceptionHandlers) && - Objects.equals(this.dataPatches, that.dataPatches) && - Objects.equals(this.infopoints, that.infopoints) && - Objects.equals(this.marks, that.marks) && - Arrays.equals(this.assumptions, that.assumptions) && - Arrays.equals(targetCode, that.targetCode)) { - return true; - } - // @formatter:on - } - return false; - } - - /** - * @return true is this is a {@code +ImmutableCode} {@code +GeneratePIC} compilation, false - * otherwise. - */ - public boolean isImmutablePIC() { - return isImmutablePIC; - } - - /** - * @return the entryBCI - */ - public int getEntryBCI() { - return entryBCI; - } - - /** - * @param entryBCI the entryBCI to set - */ - public void setEntryBCI(int entryBCI) { - checkOpen(); - this.entryBCI = entryBCI; - } - - /** - * Sets the assumptions made during compilation. - */ - public void setAssumptions(Assumption[] assumptions) { - checkOpen(); - this.assumptions = assumptions; - } - - /** - * Gets the assumptions made during compilation. - * - * The caller must not modify the contents of the returned array. - */ - public Assumption[] getAssumptions() { - return assumptions; - } - - /** - * Sets the methods whose bytecodes were used as input to the compilation. - * - * @param rootMethod the root method of the compilation - * @param inlinedMethods the methods inlined during compilation - */ - public void setMethods(ResolvedJavaMethod rootMethod, Collection inlinedMethods) { - checkOpen(); - assert rootMethod != null; - assert inlinedMethods != null; - if (inlinedMethods.contains(rootMethod)) { - methods = inlinedMethods.toArray(new ResolvedJavaMethod[inlinedMethods.size()]); - for (int i = 0; i < methods.length; i++) { - if (methods[i].equals(rootMethod)) { - if (i != 0) { - ResolvedJavaMethod tmp = methods[0]; - methods[0] = methods[i]; - methods[i] = tmp; - } - break; - } - } - } else { - methods = new ResolvedJavaMethod[1 + inlinedMethods.size()]; - methods[0] = rootMethod; - int i = 1; - for (ResolvedJavaMethod m : inlinedMethods) { - methods[i++] = m; - } - } - } - - /** - * Gets the methods whose bytecodes were used as input to the compilation. - * - * The caller must not modify the contents of the returned array. - * - * @return {@code null} if the compilation did not record method dependencies otherwise the - * methods whose bytecodes were used as input to the compilation with the first element - * being the root method of the compilation - */ - public ResolvedJavaMethod[] getMethods() { - return methods; - } - - public void setBytecodeSize(int bytecodeSize) { - checkOpen(); - this.bytecodeSize = bytecodeSize; - } - - public int getBytecodeSize() { - return bytecodeSize; - } - - public DataSection getDataSection() { - return dataSection; - } - - /** - * The total frame size of the method in bytes. This includes the return address pushed onto the - * stack, if any. - * - * @return the frame size - */ - public int getTotalFrameSize() { - assert totalFrameSize != -1 : "frame size not yet initialized!"; - return totalFrameSize; - } - - /** - * Sets the total frame size in bytes. This includes the return address pushed onto the stack, - * if any. - * - * @param size the size of the frame in bytes - */ - public void setTotalFrameSize(int size) { - checkOpen(); - totalFrameSize = size; - } - - /** - * Sets the machine that has been generated by the compiler. - * - * @param code the machine code generated - * @param size the size of the machine code - */ - public void setTargetCode(byte[] code, int size) { - checkOpen(); - targetCode = code; - targetCodeSize = size; - } - - /** - * Records a data patch in the code section. The data patch can refer to something in the - * {@link DataSectionReference data section} or directly to an {@link ConstantReference inlined - * constant}. - * - * @param codePos The position in the code that needs to be patched. - * @param ref The reference that should be inserted in the code. - */ - public void recordDataPatch(int codePos, Reference ref) { - checkOpen(); - assert codePos >= 0 && ref != null; - dataPatches.add(new DataPatch(codePos, ref)); - } - - /** - * Records a data patch in the code section. The data patch can refer to something in the - * {@link DataSectionReference data section} or directly to an {@link ConstantReference inlined - * constant}. - * - * @param codePos The position in the code that needs to be patched. - * @param ref The reference that should be inserted in the code. - * @param note The note attached to data patch for use by post-processing tools - */ - public void recordDataPatchWithNote(int codePos, Reference ref, Object note) { - assert codePos >= 0 && ref != null; - dataPatches.add(new DataPatch(codePos, ref, note)); - } - - /** - * Records metaspace access. - */ - public void recordMetaspaceAccess(Object reference, int instructionSize, MetaSpaceAccessType type, int codePos, DebugInfo debugInfo) { - final MetaSpaceAccess metaspace = new MetaSpaceAccess(reference, instructionSize, type, codePos, debugInfo); - addInfopoint(metaspace); - } - - /** - * Records a call in the code array. - * - * @param codePos the position of the call in the code array - * @param size the size of the call instruction - * @param target the being called - * @param debugInfo the debug info for the call - * @param direct specifies if this is a {@linkplain Call#direct direct} call - */ - public void recordCall(int codePos, int size, InvokeTarget target, DebugInfo debugInfo, boolean direct) { - checkOpen(); - final Call call = new Call(target, codePos, size, direct, debugInfo); - addInfopoint(call); - } - - /** - * Records an exception handler for this method. - * - * @param codePos the position in the code that is covered by the handler - * @param handlerPos the position of the handler - */ - public void recordExceptionHandler(int codePos, int handlerPos) { - checkOpen(); - assert validateExceptionHandlerAdd(codePos, handlerPos) : String.format("Duplicate exception handler for pc 0x%x handlerPos 0x%x", codePos, handlerPos); - exceptionHandlers.add(new ExceptionHandler(codePos, handlerPos)); - } - - /** - * Validate if the exception handler for codePos already exists and handlerPos is different. - * - * @param codePos - * @param handlerPos - * @return true if the validation is successful - */ - private boolean validateExceptionHandlerAdd(int codePos, int handlerPos) { - ExceptionHandler exHandler = getExceptionHandlerForCodePos(codePos); - return exHandler == null || exHandler.handlerPos == handlerPos; - } - - /** - * Returns the first ExceptionHandler which matches codePos. - * - * @param codePos position to search for - * @return first matching ExceptionHandler - */ - private ExceptionHandler getExceptionHandlerForCodePos(int codePos) { - for (ExceptionHandler h : exceptionHandlers) { - if (h.pcOffset == codePos) { - return h; - } - } - return null; - } - - /** - * Records an infopoint in the code array. - * - * @param codePos the position of the infopoint in the code array - * @param debugInfo the debug info for the infopoint - */ - public void recordInfopoint(int codePos, DebugInfo debugInfo, InfopointReason reason) { - addInfopoint(new Infopoint(codePos, debugInfo, reason)); - } - - /** - * Records a custom infopoint in the code section. - * - * Compiler implementations can use this method to record non-standard infopoints, which are not - * handled by dedicated methods like {@link #recordCall}. - * - * @param infopoint the infopoint to record, usually a derived class from {@link Infopoint} - */ - public void addInfopoint(Infopoint infopoint) { - checkOpen(); - infopoints.add(infopoint); - } - - /** - * Records an instruction mark within this method. - * - * @param codePos the position in the code that is covered by the handler - * @param markId the identifier for this mark - */ - public Mark recordMark(int codePos, Object markId) { - checkOpen(); - Mark mark = new Mark(codePos, markId); - marks.add(mark); - return mark; - } - - /** - * Offset in bytes for the custom stack area (relative to sp). - * - * @return the offset in bytes - */ - public int getCustomStackAreaOffset() { - return customStackAreaOffset; - } - - /** - * @see #getCustomStackAreaOffset() - * @param offset - */ - public void setCustomStackAreaOffset(int offset) { - checkOpen(); - customStackAreaOffset = offset; - } - - /** - * @return the machine code generated for this method - */ - public byte[] getTargetCode() { - return targetCode; - } - - /** - * @return the size of the machine code generated for this method - */ - public int getTargetCodeSize() { - return targetCodeSize; - } - - /** - * @return the code annotations or {@code null} if there are none - */ - public List getAnnotations() { - if (annotations == null) { - return Collections.emptyList(); - } - return annotations; - } - - public void addAnnotation(CodeAnnotation annotation) { - checkOpen(); - assert annotation != null; - if (annotations == null) { - annotations = new ArrayList<>(); - } - annotations.add(annotation); - } - - private static void appendDebugInfo(StringBuilder sb, DebugInfo info) { - if (info != null) { - ReferenceMap refMap = info.getReferenceMap(); - if (refMap != null) { - sb.append(refMap.toString()); - sb.append(']'); - } - RegisterSaveLayout calleeSaveInfo = info.getCalleeSaveInfo(); - if (calleeSaveInfo != null) { - sb.append(" callee-save-info["); - String sep = ""; - for (Map.Entry e : calleeSaveInfo.registersToSlots(true).entrySet()) { - sb.append(sep).append(e.getKey()).append("->").append(e.getValue()); - sep = ", "; - } - sb.append(']'); - } - BytecodePosition codePos = info.getBytecodePosition(); - if (codePos != null) { - MetaUtil.appendLocation(sb.append(" "), codePos.getMethod(), codePos.getBCI()); - if (info.hasFrame()) { - sb.append(" #locals=").append(info.frame().numLocals).append(" #expr=").append(info.frame().numStack); - if (info.frame().numLocks > 0) { - sb.append(" #locks=").append(info.frame().numLocks); - } - } - } - } - } - - /** - * @return the list of infopoints, sorted by {@link Site#pcOffset} - */ - public List getInfopoints() { - if (infopoints.isEmpty()) { - return emptyList(); - } - return unmodifiableList(infopoints); - } - - /** - * @return the list of data references - */ - public List getDataPatches() { - if (dataPatches.isEmpty()) { - return emptyList(); - } - return unmodifiableList(dataPatches); - } - - /** - * @return the list of exception handlers - */ - public List getExceptionHandlers() { - if (exceptionHandlers.isEmpty()) { - return emptyList(); - } - return unmodifiableList(exceptionHandlers); - } - - /** - * @return the list of marks - */ - public List getMarks() { - if (marks.isEmpty()) { - return emptyList(); - } - return unmodifiableList(marks); - } - - public String getName() { - return name; - } - - public void setHasUnsafeAccess(boolean hasUnsafeAccess) { - checkOpen(); - this.hasUnsafeAccess = hasUnsafeAccess; - } - - public boolean hasUnsafeAccess() { - return hasUnsafeAccess; - } - - /** - * Clears the information in this object pertaining to generating code. That is, the - * {@linkplain #getMarks() marks}, {@linkplain #getInfopoints() infopoints}, - * {@linkplain #getExceptionHandlers() exception handlers}, {@linkplain #getDataPatches() data - * patches} and {@linkplain #getAnnotations() annotations} recorded in this object are cleared. - */ - public void resetForEmittingCode() { - checkOpen(); - infopoints.clear(); - dataPatches.clear(); - exceptionHandlers.clear(); - marks.clear(); - dataSection.clear(); - if (annotations != null) { - annotations.clear(); - } - } - - private void checkOpen() { - if (closed) { - throw new IllegalStateException(); - } - } - - /** - * Closes this compilation result to future updates. - */ - public void close() { - if (closed) { - throw new IllegalStateException("Cannot re-close compilation result " + this); - } - dataSection.close(); - closed = true; - } -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompiledCode.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompiledCode.java new file mode 100644 index 00000000000..214bcbfaafe --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompiledCode.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.vm.ci.code; + +/** + * The output from compiling a method. + */ +public interface CompiledCode { +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/DataSection.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/DataSection.java deleted file mode 100644 index c397cd1c0fb..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/DataSection.java +++ /dev/null @@ -1,331 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.code; - -import static jdk.vm.ci.meta.MetaUtil.identityHashCodeString; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Objects; -import java.util.function.Consumer; - -import jdk.vm.ci.code.CompilationResult.DataPatch; -import jdk.vm.ci.code.CompilationResult.DataSectionReference; -import jdk.vm.ci.code.DataSection.Data; -import jdk.vm.ci.meta.SerializableConstant; - -public final class DataSection implements Iterable { - - @FunctionalInterface - public interface DataBuilder { - - void emit(ByteBuffer buffer, Consumer patch); - - static DataBuilder raw(byte[] data) { - return (buffer, patch) -> buffer.put(data); - } - - static DataBuilder serializable(SerializableConstant c) { - return (buffer, patch) -> c.serialize(buffer); - } - - static DataBuilder zero(int size) { - switch (size) { - case 1: - return (buffer, patch) -> buffer.put((byte) 0); - case 2: - return (buffer, patch) -> buffer.putShort((short) 0); - case 4: - return (buffer, patch) -> buffer.putInt(0); - case 8: - return (buffer, patch) -> buffer.putLong(0L); - default: - return (buffer, patch) -> { - int rest = size; - while (rest > 8) { - buffer.putLong(0L); - rest -= 8; - } - while (rest > 0) { - buffer.put((byte) 0); - rest--; - } - }; - } - } - } - - public static final class Data { - - private int alignment; - private final int size; - private final DataBuilder builder; - - private DataSectionReference ref; - - public Data(int alignment, int size, DataBuilder builder) { - this.alignment = alignment; - this.size = size; - this.builder = builder; - - // initialized in DataSection.insertData(Data) - ref = null; - } - - public void updateAlignment(int newAlignment) { - if (newAlignment == alignment) { - return; - } - alignment = lcm(alignment, newAlignment); - } - - public int getAlignment() { - return alignment; - } - - public int getSize() { - return size; - } - - public DataBuilder getBuilder() { - return builder; - } - - @Override - public int hashCode() { - // Data instances should not be used as hash map keys - throw new UnsupportedOperationException("hashCode"); - } - - @Override - public String toString() { - return identityHashCodeString(this); - } - - @Override - public boolean equals(Object obj) { - assert ref != null; - if (obj == this) { - return true; - } - if (obj instanceof Data) { - Data that = (Data) obj; - if (this.alignment == that.alignment && this.size == that.size && this.ref.equals(that.ref)) { - return true; - } - } - return false; - } - } - - private final ArrayList dataItems = new ArrayList<>(); - - private boolean closed; - private int sectionAlignment; - private int sectionSize; - - @Override - public int hashCode() { - // DataSection instances should not be used as hash map keys - throw new UnsupportedOperationException("hashCode"); - } - - @Override - public String toString() { - return identityHashCodeString(this); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof DataSection) { - DataSection that = (DataSection) obj; - if (this.closed == that.closed && this.sectionAlignment == that.sectionAlignment && this.sectionSize == that.sectionSize && Objects.equals(this.dataItems, that.dataItems)) { - return true; - } - } - return false; - } - - /** - * Inserts a {@link Data} item into the data section. If the item is already in the data - * section, the same {@link DataSectionReference} is returned. - * - * @param data the {@link Data} item to be inserted - * @return a unique {@link DataSectionReference} identifying the {@link Data} item - */ - public DataSectionReference insertData(Data data) { - checkOpen(); - synchronized (data) { - if (data.ref == null) { - data.ref = new DataSectionReference(); - dataItems.add(data); - } - return data.ref; - } - } - - /** - * Transfers all {@link Data} from the provided other {@link DataSection} to this - * {@link DataSection}, and empties the other section. - */ - public void addAll(DataSection other) { - checkOpen(); - other.checkOpen(); - - for (Data data : other.dataItems) { - assert data.ref != null; - dataItems.add(data); - } - other.dataItems.clear(); - } - - /** - * Determines if this object has been {@link #close() closed}. - */ - public boolean closed() { - return closed; - } - - /** - * Computes the layout of the data section and closes this object to further updates. - * - * This must be called exactly once. - */ - void close() { - checkOpen(); - closed = true; - - // simple heuristic: put items with larger alignment requirement first - dataItems.sort((a, b) -> a.alignment - b.alignment); - - int position = 0; - int alignment = 1; - for (Data d : dataItems) { - alignment = lcm(alignment, d.alignment); - position = align(position, d.alignment); - - d.ref.setOffset(position); - position += d.size; - } - - sectionAlignment = alignment; - sectionSize = position; - } - - /** - * Gets the size of the data section. - * - * This must only be called once this object has been {@linkplain #closed() closed}. - */ - public int getSectionSize() { - checkClosed(); - return sectionSize; - } - - /** - * Gets the minimum alignment requirement of the data section. - * - * This must only be called once this object has been {@linkplain #closed() closed}. - */ - public int getSectionAlignment() { - checkClosed(); - return sectionAlignment; - } - - /** - * Builds the data section into a given buffer. - * - * This must only be called once this object has been {@linkplain #closed() closed}. - * - * @param buffer the {@link ByteBuffer} where the data section should be built. The buffer must - * hold at least {@link #getSectionSize()} bytes. - * @param patch a {@link Consumer} to receive {@link DataPatch data patches} for relocations in - * the data section - */ - public void buildDataSection(ByteBuffer buffer, Consumer patch) { - checkClosed(); - for (Data d : dataItems) { - buffer.position(d.ref.getOffset()); - d.builder.emit(buffer, patch); - } - } - - public Data findData(DataSectionReference ref) { - for (Data d : dataItems) { - if (d.ref == ref) { - return d; - } - } - return null; - } - - public Iterator iterator() { - return dataItems.iterator(); - } - - public static int lcm(int x, int y) { - if (x == 0) { - return y; - } else if (y == 0) { - return x; - } - - int a = Math.max(x, y); - int b = Math.min(x, y); - while (b > 0) { - int tmp = a % b; - a = b; - b = tmp; - } - - int gcd = a; - return x * y / gcd; - } - - private static int align(int position, int alignment) { - return ((position + alignment - 1) / alignment) * alignment; - } - - private void checkClosed() { - if (!closed) { - throw new IllegalStateException(); - } - } - - private void checkOpen() { - if (closed) { - throw new IllegalStateException(); - } - } - - public void clear() { - checkOpen(); - this.dataItems.clear(); - this.sectionAlignment = 0; - this.sectionSize = 0; - } -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java index f942b723dbc..4a6d44c4e51 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java @@ -57,9 +57,8 @@ public interface RegisterConfig { * @param returnType the return type (can be null for methods returning {@code void}) * @param parameterTypes the types of the arguments of the call * @param target the target platform - * @param stackOnly ignore registers */ - CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly); + CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target); /** * Gets the ordered set of registers that are can be used to pass parameters according to a diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/package-info.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/package-info.java index 63f1ea5df74..8183f89b22d 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/package-info.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/package-info.java @@ -1,26 +1,29 @@ /* - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. DO NOT ALTER OR - * REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * This code is free software; you can redistribute it and/or modify it under the terms of the GNU - * General Public License version 2 only, as published by the Free Software Foundation. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. * - * This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License version 2 for more details (a copy is included in the LICENSE file that + * 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. + * 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. + * 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 that defines the interface between a Java application that wants to install code and the runtime. * The runtime provides in implementation of the {@link jdk.vm.ci.code.CodeCacheProvider} interface. - * The method {@link jdk.vm.ci.code.CodeCacheProvider#addCode(jdk.vm.ci.meta.ResolvedJavaMethod, CompilationResult, jdk.vm.ci.meta.SpeculationLog, InstalledCode)} + * The method {@link jdk.vm.ci.code.CodeCacheProvider#addCode(jdk.vm.ci.meta.ResolvedJavaMethod, CompiledCode, jdk.vm.ci.meta.SpeculationLog, InstalledCode)} * can be used to install code. */ package jdk.vm.ci.code; diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Call.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Call.java new file mode 100644 index 00000000000..c323b055a35 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Call.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.vm.ci.code.site; + +import java.util.Objects; + +import jdk.vm.ci.code.DebugInfo; +import jdk.vm.ci.meta.InvokeTarget; + +/** + * Represents a call in the code. + */ +public final class Call extends Infopoint { + + /** + * The target of the call. + */ + public final InvokeTarget target; + + /** + * The size of the call instruction. + */ + public final int size; + + /** + * Specifies if this call is direct or indirect. A direct call has an immediate operand encoding + * the absolute or relative (to the call itself) address of the target. An indirect call has a + * register or memory operand specifying the target address of the call. + */ + public final boolean direct; + + public Call(InvokeTarget target, int pcOffset, int size, boolean direct, DebugInfo debugInfo) { + super(pcOffset, debugInfo, InfopointReason.CALL); + this.size = size; + this.target = target; + this.direct = direct; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof Call && super.equals(obj)) { + Call that = (Call) obj; + if (this.size == that.size && this.direct == that.direct && Objects.equals(this.target, that.target)) { + return true; + } + } + return false; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(pcOffset); + sb.append('['); + sb.append(target); + sb.append(']'); + + if (debugInfo != null) { + appendDebugInfo(sb, debugInfo); + } + + return sb.toString(); + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ConstantReference.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ConstantReference.java new file mode 100644 index 00000000000..59f0a1e6a55 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ConstantReference.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.vm.ci.code.site; + +import java.util.Objects; + +import jdk.vm.ci.meta.VMConstant; + +public final class ConstantReference extends Reference { + + private final VMConstant constant; + + public ConstantReference(VMConstant constant) { + this.constant = constant; + } + + public VMConstant getConstant() { + return constant; + } + + @Override + public String toString() { + return constant.toString(); + } + + @Override + public int hashCode() { + return constant.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof ConstantReference) { + ConstantReference that = (ConstantReference) obj; + return Objects.equals(this.constant, that.constant); + } + return false; + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataPatch.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataPatch.java new file mode 100644 index 00000000000..45941aac9a0 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataPatch.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.vm.ci.code.site; + +import java.util.Objects; + +import jdk.vm.ci.meta.JavaConstant; + +/** + * Represents a code site that references some data. The associated data can be either a + * {@link DataSectionReference reference} to the data section, or it may be an inlined + * {@link JavaConstant} that needs to be patched. + */ +public final class DataPatch extends Site { + + public Reference reference; + public Object note; + + public DataPatch(int pcOffset, Reference reference) { + super(pcOffset); + this.reference = reference; + this.note = null; + } + + public DataPatch(int pcOffset, Reference reference, Object note) { + super(pcOffset); + this.reference = reference; + this.note = note; + } + + @Override + public String toString() { + if (note != null) { + return String.format("%d[, note: %s]", pcOffset, reference.toString(), note.toString()); + } else { + return String.format("%d[]", pcOffset, reference.toString()); + } + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof DataPatch) { + DataPatch that = (DataPatch) obj; + if (this.pcOffset == that.pcOffset && Objects.equals(this.reference, that.reference) && Objects.equals(this.note, that.note)) { + return true; + } + } + return false; + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataSectionReference.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataSectionReference.java new file mode 100644 index 00000000000..5602c99d4cb --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataSectionReference.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.vm.ci.code.site; + +public final class DataSectionReference extends Reference { + + private boolean initialized; + private int offset; + + public DataSectionReference() { + // will be set after the data section layout is fixed + offset = 0xDEADDEAD; + } + + public int getOffset() { + assert initialized; + + return offset; + } + + public void setOffset(int offset) { + assert !initialized; + initialized = true; + + this.offset = offset; + } + + @Override + public int hashCode() { + return offset; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof DataSectionReference) { + DataSectionReference that = (DataSectionReference) obj; + return this.offset == that.offset; + } + return false; + } + + @Override + public String toString() { + if (initialized) { + return String.format("DataSection[0x%x]", offset); + } else { + return "DataSection[?]"; + } + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ExceptionHandler.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ExceptionHandler.java new file mode 100644 index 00000000000..3f9f73f3867 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ExceptionHandler.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.vm.ci.code.site; + +/** + * Represents exception handler information for a specific code position. It includes the catch code + * position as well as the caught exception type. + */ +public final class ExceptionHandler extends Site { + + public final int handlerPos; + + public ExceptionHandler(int pcOffset, int handlerPos) { + super(pcOffset); + this.handlerPos = handlerPos; + } + + @Override + public String toString() { + return String.format("%d[]", pcOffset, handlerPos); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof ExceptionHandler) { + ExceptionHandler that = (ExceptionHandler) obj; + if (this.pcOffset == that.pcOffset && this.handlerPos == that.handlerPos) { + return true; + } + } + return false; + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Infopoint.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Infopoint.java new file mode 100644 index 00000000000..c59c006a680 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Infopoint.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.vm.ci.code.site; + +import java.util.Map; +import java.util.Objects; + +import jdk.vm.ci.code.BytecodePosition; +import jdk.vm.ci.code.DebugInfo; +import jdk.vm.ci.code.ReferenceMap; +import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.RegisterSaveLayout; +import jdk.vm.ci.meta.MetaUtil; + +/** + * Represents an infopoint with associated debug info. Note that safepoints are also infopoints. + */ +public class Infopoint extends Site implements Comparable { + + public final DebugInfo debugInfo; + + public final InfopointReason reason; + + public Infopoint(int pcOffset, DebugInfo debugInfo, InfopointReason reason) { + super(pcOffset); + this.debugInfo = debugInfo; + this.reason = reason; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(pcOffset); + sb.append("[]"); + appendDebugInfo(sb, debugInfo); + return sb.toString(); + } + + @Override + public int compareTo(Infopoint o) { + if (pcOffset < o.pcOffset) { + return -1; + } else if (pcOffset > o.pcOffset) { + return 1; + } + return this.reason.compareTo(o.reason); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj != null && obj.getClass() == getClass()) { + Infopoint that = (Infopoint) obj; + if (this.pcOffset == that.pcOffset && Objects.equals(this.debugInfo, that.debugInfo) && Objects.equals(this.reason, that.reason)) { + return true; + } + } + return false; + } + + protected static void appendDebugInfo(StringBuilder sb, DebugInfo info) { + if (info != null) { + ReferenceMap refMap = info.getReferenceMap(); + if (refMap != null) { + sb.append(refMap.toString()); + sb.append(']'); + } + RegisterSaveLayout calleeSaveInfo = info.getCalleeSaveInfo(); + if (calleeSaveInfo != null) { + sb.append(" callee-save-info["); + String sep = ""; + for (Map.Entry e : calleeSaveInfo.registersToSlots(true).entrySet()) { + sb.append(sep).append(e.getKey()).append("->").append(e.getValue()); + sep = ", "; + } + sb.append(']'); + } + BytecodePosition codePos = info.getBytecodePosition(); + if (codePos != null) { + MetaUtil.appendLocation(sb.append(" "), codePos.getMethod(), codePos.getBCI()); + if (info.hasFrame()) { + sb.append(" #locals=").append(info.frame().numLocals).append(" #expr=").append(info.frame().numStack); + if (info.frame().numLocks > 0) { + sb.append(" #locks=").append(info.frame().numLocks); + } + } + } + } + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InfopointReason.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/InfopointReason.java similarity index 91% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InfopointReason.java rename to hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/InfopointReason.java index 317ed96ce7e..6509dbdf69d 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InfopointReason.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/InfopointReason.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, 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 @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.vm.ci.code; +package jdk.vm.ci.code.site; /** * A reason for infopoint insertion. diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Mark.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Mark.java new file mode 100644 index 00000000000..29de0c01334 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Mark.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.vm.ci.code.site; + +import java.util.Objects; + +/** + * Represents a mark in the machine code that can be used by the runtime for its own purposes. A + * mark can reference other marks. + */ +public final class Mark extends Site { + + public final Object id; + + public Mark(int pcOffset, Object id) { + super(pcOffset); + this.id = id; + } + + @Override + public String toString() { + if (id == null) { + return String.format("%d[]", pcOffset); + } else if (id instanceof Integer) { + return String.format("%d[]", pcOffset, Integer.toHexString((Integer) id)); + } else { + return String.format("%d[]", pcOffset, id.toString()); + } + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof Mark) { + Mark that = (Mark) obj; + if (this.pcOffset == that.pcOffset && Objects.equals(this.id, that.id)) { + return true; + } + } + return false; + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/src/jdk/vm/ci/service/ServiceProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Reference.java similarity index 66% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/src/jdk/vm/ci/service/ServiceProvider.java rename to hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Reference.java index 4d8a7f9692b..601d4158a63 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/src/jdk/vm/ci/service/ServiceProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Reference.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -20,20 +20,16 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.vm.ci.service; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; +package jdk.vm.ci.code.site; /** - * Annotates a service provider than can be loaded via {@linkplain Services#load(Class)} or - * {@link Services#loadSingle(Class, boolean)}. + * Represents some external data that is referenced by the code. */ -@Retention(RetentionPolicy.CLASS) -@Target(ElementType.TYPE) -public @interface ServiceProvider { +public abstract class Reference { - Class value(); + @Override + public abstract int hashCode(); + + @Override + public abstract boolean equals(Object obj); } diff --git a/hotspot/src/cpu/zero/vm/interp_masm_zero.cpp b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Site.java similarity index 56% rename from hotspot/src/cpu/zero/vm/interp_masm_zero.cpp rename to hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Site.java index a2e85ede0dd..dbf76c58be0 100644 --- a/hotspot/src/cpu/zero/vm/interp_masm_zero.cpp +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Site.java @@ -1,6 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * Copyright 2009 Red Hat, Inc. + * Copyright (c) 2016, 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 @@ -20,23 +19,35 @@ * 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 jdk.vm.ci.code.site; -#include "precompiled.hpp" -#include "interp_masm_zero.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "oops/arrayOop.hpp" -#include "oops/markOop.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiRedefineClassesTrace.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "runtime/basicLock.hpp" -#include "runtime/biasedLocking.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/thread.inline.hpp" +import static jdk.vm.ci.meta.MetaUtil.identityHashCodeString; -// This file is intentionally empty +/** + * Represents a code position with associated additional information. + */ +public abstract class Site { + + /** + * The position (or offset) of this site with respect to the start of the target method. + */ + public final int pcOffset; + + public Site(int pos) { + this.pcOffset = pos; + } + + @Override + public final int hashCode() { + throw new UnsupportedOperationException("hashCode"); + } + + @Override + public String toString() { + return identityHashCodeString(this); + } + + @Override + public abstract boolean equals(Object obj); +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java index 6981820018b..79caafca05a 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java @@ -41,9 +41,7 @@ import jdk.vm.ci.hotspot.HotSpotVMConfig; import jdk.vm.ci.inittimer.InitTimer; import jdk.vm.ci.meta.ConstantReflectionProvider; import jdk.vm.ci.runtime.JVMCIBackend; -import jdk.vm.ci.service.ServiceProvider; -@ServiceProvider(HotSpotJVMCIBackendFactory.class) public class AArch64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { protected EnumSet computeFeatures(@SuppressWarnings("unused") HotSpotVMConfig config) { @@ -124,8 +122,7 @@ public class AArch64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFac } } - protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection, - StackIntrospection stackIntrospection) { + protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection, StackIntrospection stackIntrospection) { return new JVMCIBackend(metaAccess, codeCache, constantReflection, stackIntrospection); } } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java index 9590d2fcda4..aafee14a145 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java @@ -62,6 +62,7 @@ import jdk.vm.ci.code.RegisterConfig; import jdk.vm.ci.code.StackSlot; import jdk.vm.ci.code.TargetDescription; import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotCallingConventionType; import jdk.vm.ci.hotspot.HotSpotVMConfig; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.JavaKind; @@ -96,6 +97,7 @@ public class AArch64HotSpotRegisterConfig implements RegisterConfig { return allocatable.clone(); } + @Override public Register[] filterAllocatableRegisters(PlatformKind kind, Register[] registers) { ArrayList list = new ArrayList<>(); for (Register reg : registers) { @@ -191,16 +193,19 @@ public class AArch64HotSpotRegisterConfig implements RegisterConfig { } @Override - public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly) { - if (type == Type.NativeCall) { - return callingConvention(nativeGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target) { + HotSpotCallingConventionType hotspotType = (HotSpotCallingConventionType) type; + if (type == HotSpotCallingConventionType.NativeCall) { + return callingConvention(nativeGeneralParameterRegisters, returnType, parameterTypes, hotspotType, target); } // On x64, parameter locations are the same whether viewed // from the caller or callee perspective - return callingConvention(javaGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + return callingConvention(javaGeneralParameterRegisters, returnType, parameterTypes, hotspotType, target); } + @Override public Register[] getCallingConventionRegisters(Type type, JavaKind kind) { + HotSpotCallingConventionType hotspotType = (HotSpotCallingConventionType) type; switch (kind) { case Boolean: case Byte: @@ -209,7 +214,7 @@ public class AArch64HotSpotRegisterConfig implements RegisterConfig { case Int: case Long: case Object: - return type == Type.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters; + return hotspotType == HotSpotCallingConventionType.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters; case Float: case Double: return simdParameterRegisters; @@ -218,7 +223,7 @@ public class AArch64HotSpotRegisterConfig implements RegisterConfig { } } - private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, Type type, TargetDescription target, boolean stackOnly) { + private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, HotSpotCallingConventionType type, TargetDescription target) { AllocatableValue[] locations = new AllocatableValue[parameterTypes.length]; int currentGeneral = 0; @@ -236,14 +241,14 @@ public class AArch64HotSpotRegisterConfig implements RegisterConfig { case Int: case Long: case Object: - if (!stackOnly && currentGeneral < generalParameterRegisters.length) { + if (currentGeneral < generalParameterRegisters.length) { Register register = generalParameterRegisters[currentGeneral++]; locations[i] = register.asValue(target.getLIRKind(kind)); } break; case Float: case Double: - if (!stackOnly && currentSIMD < simdParameterRegisters.length) { + if (currentSIMD < simdParameterRegisters.length) { Register register = simdParameterRegisters[currentSIMD++]; locations[i] = register.asValue(target.getLIRKind(kind)); } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java index fb6eba20f92..69a31604560 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java @@ -41,9 +41,7 @@ import jdk.vm.ci.hotspot.HotSpotVMConfig; import jdk.vm.ci.inittimer.InitTimer; import jdk.vm.ci.meta.ConstantReflectionProvider; import jdk.vm.ci.runtime.JVMCIBackend; -import jdk.vm.ci.service.ServiceProvider; -@ServiceProvider(HotSpotJVMCIBackendFactory.class) public class AMD64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { protected EnumSet computeFeatures(HotSpotVMConfig config) { diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java index 876263c75ef..1baf7368a96 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java @@ -56,6 +56,7 @@ import jdk.vm.ci.code.RegisterConfig; import jdk.vm.ci.code.StackSlot; import jdk.vm.ci.code.TargetDescription; import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotCallingConventionType; import jdk.vm.ci.hotspot.HotSpotVMConfig; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.JavaKind; @@ -90,6 +91,7 @@ public class AMD64HotSpotRegisterConfig implements RegisterConfig { return allocatable.clone(); } + @Override public Register[] filterAllocatableRegisters(PlatformKind kind, Register[] registers) { ArrayList list = new ArrayList<>(); for (Register reg : registers) { @@ -175,6 +177,7 @@ public class AMD64HotSpotRegisterConfig implements RegisterConfig { return callerSaved; } + @Override public Register[] getCalleeSaveRegisters() { return null; } @@ -190,16 +193,19 @@ public class AMD64HotSpotRegisterConfig implements RegisterConfig { } @Override - public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly) { - if (type == Type.NativeCall) { - return callingConvention(nativeGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target) { + HotSpotCallingConventionType hotspotType = (HotSpotCallingConventionType) type; + if (type == HotSpotCallingConventionType.NativeCall) { + return callingConvention(nativeGeneralParameterRegisters, returnType, parameterTypes, hotspotType, target); } // On x64, parameter locations are the same whether viewed // from the caller or callee perspective - return callingConvention(javaGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + return callingConvention(javaGeneralParameterRegisters, returnType, parameterTypes, hotspotType, target); } + @Override public Register[] getCallingConventionRegisters(Type type, JavaKind kind) { + HotSpotCallingConventionType hotspotType = (HotSpotCallingConventionType) type; switch (kind) { case Boolean: case Byte: @@ -208,7 +214,7 @@ public class AMD64HotSpotRegisterConfig implements RegisterConfig { case Int: case Long: case Object: - return type == Type.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters; + return hotspotType == HotSpotCallingConventionType.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters; case Float: case Double: return xmmParameterRegisters; @@ -217,12 +223,12 @@ public class AMD64HotSpotRegisterConfig implements RegisterConfig { } } - private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, Type type, TargetDescription target, boolean stackOnly) { + private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, HotSpotCallingConventionType type, TargetDescription target) { AllocatableValue[] locations = new AllocatableValue[parameterTypes.length]; int currentGeneral = 0; int currentXMM = 0; - int currentStackOffset = type == Type.NativeCall && needsNativeStackHomeSpace ? generalParameterRegisters.length * target.wordSize : 0; + int currentStackOffset = type == HotSpotCallingConventionType.NativeCall && needsNativeStackHomeSpace ? generalParameterRegisters.length * target.wordSize : 0; for (int i = 0; i < parameterTypes.length; i++) { final JavaKind kind = parameterTypes[i].getJavaKind().getStackKind(); @@ -235,14 +241,14 @@ public class AMD64HotSpotRegisterConfig implements RegisterConfig { case Int: case Long: case Object: - if (!stackOnly && currentGeneral < generalParameterRegisters.length) { + if (currentGeneral < generalParameterRegisters.length) { Register register = generalParameterRegisters[currentGeneral++]; locations[i] = register.asValue(target.getLIRKind(kind)); } break; case Float: case Double: - if (!stackOnly && currentXMM < xmmParameterRegisters.length) { + if (currentXMM < xmmParameterRegisters.length) { Register register = xmmParameterRegisters[currentXMM++]; locations[i] = register.asValue(target.getLIRKind(kind)); } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java index f0f0b05190e..703167d99e3 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java @@ -39,11 +39,9 @@ import jdk.vm.ci.hotspot.HotSpotStackIntrospection; import jdk.vm.ci.hotspot.HotSpotVMConfig; import jdk.vm.ci.inittimer.InitTimer; import jdk.vm.ci.runtime.JVMCIBackend; -import jdk.vm.ci.service.ServiceProvider; import jdk.vm.ci.sparc.SPARC; import jdk.vm.ci.sparc.SPARC.CPUFeature; -@ServiceProvider(HotSpotJVMCIBackendFactory.class) public class SPARCHotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { protected TargetDescription createTarget(HotSpotVMConfig config) { diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java index 58dfcdc3e55..c2c198e8348 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java @@ -22,9 +22,6 @@ */ package jdk.vm.ci.hotspot.sparc; -import static jdk.vm.ci.code.CallingConvention.Type.JavaCall; -import static jdk.vm.ci.code.CallingConvention.Type.JavaCallee; -import static jdk.vm.ci.code.CallingConvention.Type.NativeCall; import static jdk.vm.ci.meta.JavaKind.Void; import static jdk.vm.ci.meta.Value.ILLEGAL; import static jdk.vm.ci.sparc.SPARC.REGISTER_SAFE_AREA_SIZE; @@ -81,6 +78,7 @@ import jdk.vm.ci.code.RegisterConfig; import jdk.vm.ci.code.StackSlot; import jdk.vm.ci.code.TargetDescription; import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotCallingConventionType; import jdk.vm.ci.hotspot.HotSpotVMConfig; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.JavaKind; @@ -107,6 +105,7 @@ public class SPARCHotSpotRegisterConfig implements RegisterConfig { return allocatable.clone(); } + @Override public Register[] filterAllocatableRegisters(PlatformKind kind, Register[] registers) { ArrayList list = new ArrayList<>(); for (Register reg : registers) { @@ -200,17 +199,20 @@ public class SPARCHotSpotRegisterConfig implements RegisterConfig { } @Override - public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly) { - if (type == JavaCall || type == NativeCall) { - return callingConvention(cpuCallerParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target) { + HotSpotCallingConventionType hotspotType = (HotSpotCallingConventionType) type; + if (type == HotSpotCallingConventionType.JavaCall || type == HotSpotCallingConventionType.NativeCall) { + return callingConvention(cpuCallerParameterRegisters, returnType, parameterTypes, hotspotType, target); } - if (type == JavaCallee) { - return callingConvention(cpuCalleeParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + if (type == HotSpotCallingConventionType.JavaCallee) { + return callingConvention(cpuCalleeParameterRegisters, returnType, parameterTypes, hotspotType, target); } throw JVMCIError.shouldNotReachHere(); } + @Override public Register[] getCallingConventionRegisters(Type type, JavaKind kind) { + HotSpotCallingConventionType hotspotType = (HotSpotCallingConventionType) type; switch (kind) { case Boolean: case Byte: @@ -219,7 +221,7 @@ public class SPARCHotSpotRegisterConfig implements RegisterConfig { case Int: case Long: case Object: - return type == Type.JavaCallee ? cpuCalleeParameterRegisters : cpuCallerParameterRegisters; + return hotspotType == HotSpotCallingConventionType.JavaCallee ? cpuCalleeParameterRegisters : cpuCallerParameterRegisters; case Double: case Float: return fpuFloatParameterRegisters; @@ -228,7 +230,7 @@ public class SPARCHotSpotRegisterConfig implements RegisterConfig { } } - private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, Type type, TargetDescription target, boolean stackOnly) { + private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, HotSpotCallingConventionType type, TargetDescription target) { AllocatableValue[] locations = new AllocatableValue[parameterTypes.length]; int currentGeneral = 0; @@ -246,13 +248,13 @@ public class SPARCHotSpotRegisterConfig implements RegisterConfig { case Int: case Long: case Object: - if (!stackOnly && currentGeneral < generalParameterRegisters.length) { + if (currentGeneral < generalParameterRegisters.length) { Register register = generalParameterRegisters[currentGeneral++]; locations[i] = register.asValue(target.getLIRKind(kind)); } break; case Double: - if (!stackOnly && currentFloating < fpuFloatParameterRegisters.length) { + if (currentFloating < fpuFloatParameterRegisters.length) { if (currentFloating % 2 != 0) { // Make register number even to be a double reg currentFloating++; @@ -263,7 +265,7 @@ public class SPARCHotSpotRegisterConfig implements RegisterConfig { } break; case Float: - if (!stackOnly && currentFloating < fpuFloatParameterRegisters.length) { + if (currentFloating < fpuFloatParameterRegisters.length) { Register register = fpuFloatParameterRegisters[currentFloating++]; locations[i] = register.asValue(target.getLIRKind(kind)); } @@ -287,7 +289,7 @@ public class SPARCHotSpotRegisterConfig implements RegisterConfig { AllocatableValue returnLocation = returnKind == Void ? ILLEGAL : getReturnRegister(returnKind, type).asValue(target.getLIRKind(returnKind.getStackKind())); int outArgSpillArea; - if (type == NativeCall && addNativeRegisterArgumentSlots) { + if (type == HotSpotCallingConventionType.NativeCall && addNativeRegisterArgumentSlots) { // Space for native callee which may spill our outgoing arguments outArgSpillArea = Math.min(locations.length, generalParameterRegisters.length) * target.wordSize; } else { @@ -302,10 +304,10 @@ public class SPARCHotSpotRegisterConfig implements RegisterConfig { @Override public Register getReturnRegister(JavaKind kind) { - return getReturnRegister(kind, JavaCallee); + return getReturnRegister(kind, HotSpotCallingConventionType.JavaCallee); } - private static Register getReturnRegister(JavaKind kind, Type type) { + private static Register getReturnRegister(JavaKind kind, HotSpotCallingConventionType type) { switch (kind) { case Boolean: case Byte: @@ -314,7 +316,7 @@ public class SPARCHotSpotRegisterConfig implements RegisterConfig { case Int: case Long: case Object: - return type == JavaCallee ? i0 : o0; + return type == HotSpotCallingConventionType.JavaCallee ? i0 : o0; case Float: return f0; case Double: diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java index 4f4e7e4e9b9..ef3fd7cf1c5 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java @@ -29,6 +29,7 @@ import static jdk.vm.ci.inittimer.InitTimer.timer; import java.lang.reflect.Constructor; import java.lang.reflect.Method; +import jdk.vm.ci.code.BytecodeFrame; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.code.InvalidInstalledCodeException; import jdk.vm.ci.code.TargetDescription; @@ -316,21 +317,6 @@ final class CompilerToVM { public native int getMetadata(TargetDescription target, HotSpotCompiledCode compiledCode, HotSpotMetaData metaData); - /** - * Notifies the VM of statistics for a completed compilation. - * - * @param id the identifier of the compilation - * @param method the method compiled - * @param osr specifies if the compilation was for on-stack-replacement - * @param processedBytecodes the number of bytecodes processed during the compilation, including - * the bytecodes of all inlined methods - * @param time the amount time spent compiling {@code method} - * @param timeUnitsPerSecond the granularity of the units for the {@code time} value - * @param installedCode the nmethod installed as a result of the compilation - */ - synchronized native void notifyCompilationStatistics(int id, HotSpotResolvedJavaMethodImpl method, boolean osr, int processedBytecodes, long time, long timeUnitsPerSecond, - InstalledCode installedCode); - /** * Resets all compilation statistics. */ @@ -604,4 +590,14 @@ final class CompilerToVM { * @throws IllegalArgumentException if an out of range position is given */ native int methodDataProfileDataSize(long metaspaceMethodData, int position); + + /** + * Return the amount of native stack required for the interpreter frames represented by + * {@code frame}. This is used when emitting the stack banging code to ensure that there is + * enough space for the frames during deoptimization. + * + * @param frame + * @return the number of bytes required for deoptimization of this frame state + */ + native int interpreterFrameSize(BytecodeFrame frame); } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCallingConventionType.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCallingConventionType.java new file mode 100644 index 00000000000..357a4a23050 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCallingConventionType.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2016, 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.vm.ci.hotspot; + +import jdk.vm.ci.code.CallingConvention; +import jdk.vm.ci.code.CallingConvention.Type; + +public enum HotSpotCallingConventionType implements CallingConvention.Type { + /** + * A request for the outgoing argument locations at a call site to Java code. + */ + JavaCall(true), + + /** + * A request for the incoming argument locations. + */ + JavaCallee(false), + + /** + * A request for the outgoing argument locations at a call site to external native code that + * complies with the platform ABI. + */ + NativeCall(true); + + /** + * Determines if this is a request for the outgoing argument locations at a call site. + */ + public final boolean out; + + public static final Type[] VALUES = values(); + + private HotSpotCallingConventionType(boolean out) { + this.out = out; + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java index 6f9770a5c2d..a01a304d2a8 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, 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 @@ -22,30 +22,19 @@ */ package jdk.vm.ci.hotspot; -import static jdk.vm.ci.hotspot.HotSpotCompressedNullConstant.COMPRESSED_NULL; - import java.lang.reflect.Field; import jdk.vm.ci.code.BailoutException; +import jdk.vm.ci.code.BytecodeFrame; import jdk.vm.ci.code.CodeCacheProvider; -import jdk.vm.ci.code.CompilationRequest; -import jdk.vm.ci.code.CompilationResult; -import jdk.vm.ci.code.CompilationResult.Call; -import jdk.vm.ci.code.CompilationResult.ConstantReference; -import jdk.vm.ci.code.CompilationResult.DataPatch; -import jdk.vm.ci.code.CompilationResult.Mark; -import jdk.vm.ci.code.DataSection; -import jdk.vm.ci.code.DataSection.Data; -import jdk.vm.ci.code.DataSection.DataBuilder; +import jdk.vm.ci.code.CompiledCode; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.code.RegisterConfig; import jdk.vm.ci.code.TargetDescription; -import jdk.vm.ci.common.JVMCIError; -import jdk.vm.ci.meta.Constant; -import jdk.vm.ci.meta.JavaConstant; -import jdk.vm.ci.meta.SerializableConstant; +import jdk.vm.ci.code.site.Call; +import jdk.vm.ci.code.site.Mark; +import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.SpeculationLog; -import jdk.vm.ci.meta.VMConstant; /** * HotSpot implementation of {@link CodeCacheProvider}. @@ -113,41 +102,25 @@ public class HotSpotCodeCacheProvider implements CodeCacheProvider { return runtime.getConfig().runtimeCallStackSize; } - private InstalledCode logOrDump(InstalledCode installedCode, CompilationResult compResult) { - ((HotSpotJVMCIRuntime) runtime).notifyInstall(this, installedCode, compResult); + private InstalledCode logOrDump(InstalledCode installedCode, CompiledCode compiledCode) { + ((HotSpotJVMCIRuntime) runtime).notifyInstall(this, installedCode, compiledCode); return installedCode; } - public InstalledCode installCode(CompilationRequest compRequest, CompilationResult compResult, InstalledCode installedCode, SpeculationLog log, boolean isDefault) { - HotSpotResolvedJavaMethod method = compRequest != null ? (HotSpotResolvedJavaMethod) compRequest.getMethod() : null; + public InstalledCode installCode(ResolvedJavaMethod method, CompiledCode compiledCode, InstalledCode installedCode, SpeculationLog log, boolean isDefault) { InstalledCode resultInstalledCode; if (installedCode == null) { if (method == null) { // Must be a stub - resultInstalledCode = new HotSpotRuntimeStub(compResult.getName()); + resultInstalledCode = new HotSpotRuntimeStub(((HotSpotCompiledCode) compiledCode).getName()); } else { - resultInstalledCode = new HotSpotNmethod(method, compResult.getName(), isDefault); + resultInstalledCode = new HotSpotNmethod((HotSpotResolvedJavaMethod) method, ((HotSpotCompiledCode) compiledCode).getName(), isDefault); } } else { resultInstalledCode = installedCode; } - HotSpotCompiledCode compiledCode; - if (method != null) { - final int id; - final long jvmciEnv; - if (compRequest instanceof HotSpotCompilationRequest) { - HotSpotCompilationRequest hsCompRequest = (HotSpotCompilationRequest) compRequest; - id = hsCompRequest.getId(); - jvmciEnv = hsCompRequest.getJvmciEnv(); - } else { - id = method.allocateCompileId(compRequest.getEntryBCI()); - jvmciEnv = 0L; - } - compiledCode = new HotSpotCompiledNmethod(method, compResult, id, jvmciEnv); - } else { - compiledCode = new HotSpotCompiledCode(compResult); - } - int result = runtime.getCompilerToVM().installCode(target, compiledCode, resultInstalledCode, (HotSpotSpeculationLog) log); + + int result = runtime.getCompilerToVM().installCode(target, (HotSpotCompiledCode) compiledCode, resultInstalledCode, (HotSpotSpeculationLog) log); if (result != config.codeInstallResultOk) { String resultDesc = config.getCodeInstallResultDescription(result); if (compiledCode instanceof HotSpotCompiledNmethod) { @@ -163,87 +136,16 @@ public class HotSpotCodeCacheProvider implements CodeCacheProvider { } throw new BailoutException(result != config.codeInstallResultDependenciesFailed, msg); } else { - throw new BailoutException("Error installing %s: %s", compResult.getName(), resultDesc); + throw new BailoutException("Error installing %s: %s", ((HotSpotCompiledCode) compiledCode).getName(), resultDesc); } } - return logOrDump(resultInstalledCode, compResult); + return logOrDump(resultInstalledCode, compiledCode); } public void invalidateInstalledCode(InstalledCode installedCode) { runtime.getCompilerToVM().invalidateInstalledCode(installedCode); } - public boolean needsDataPatch(JavaConstant constant) { - return constant instanceof HotSpotMetaspaceConstant; - } - - private Data createSingleDataItem(Constant constant) { - int size; - DataBuilder builder; - if (constant instanceof VMConstant) { - VMConstant vmConstant = (VMConstant) constant; - boolean compressed; - if (constant instanceof HotSpotConstant) { - HotSpotConstant c = (HotSpotConstant) vmConstant; - compressed = c.isCompressed(); - } else { - throw new JVMCIError(String.valueOf(constant)); - } - - size = compressed ? 4 : target.wordSize; - if (size == 4) { - builder = (buffer, patch) -> { - patch.accept(new DataPatch(buffer.position(), new ConstantReference(vmConstant))); - buffer.putInt(0xDEADDEAD); - }; - } else { - assert size == 8; - builder = (buffer, patch) -> { - patch.accept(new DataPatch(buffer.position(), new ConstantReference(vmConstant))); - buffer.putLong(0xDEADDEADDEADDEADL); - }; - } - } else if (JavaConstant.isNull(constant)) { - boolean compressed = COMPRESSED_NULL.equals(constant); - size = compressed ? 4 : target.wordSize; - builder = DataBuilder.zero(size); - } else if (constant instanceof SerializableConstant) { - SerializableConstant s = (SerializableConstant) constant; - size = s.getSerializedSize(); - builder = DataBuilder.serializable(s); - } else { - throw new JVMCIError(String.valueOf(constant)); - } - - return new Data(size, size, builder); - } - - public Data createDataItem(Constant... constants) { - assert constants.length > 0; - if (constants.length == 1) { - return createSingleDataItem(constants[0]); - } else { - DataBuilder[] builders = new DataBuilder[constants.length]; - int size = 0; - int alignment = 1; - for (int i = 0; i < constants.length; i++) { - Data data = createSingleDataItem(constants[i]); - - assert size % data.getAlignment() == 0 : "invalid alignment in packed constants"; - alignment = DataSection.lcm(alignment, data.getAlignment()); - - builders[i] = data.getBuilder(); - size += data.getSize(); - } - DataBuilder ret = (buffer, patches) -> { - for (DataBuilder b : builders) { - b.emit(buffer, patches); - } - }; - return new Data(alignment, size, ret); - } - } - @Override public TargetDescription getTarget() { return target; @@ -268,20 +170,8 @@ public class HotSpotCodeCacheProvider implements CodeCacheProvider { return runtime.getCompilerToVM().shouldDebugNonSafepoints(); } - /** - * Notifies the VM of statistics for a completed compilation. - * - * @param id the identifier of the compilation - * @param method the method compiled - * @param osr specifies if the compilation was for on-stack-replacement - * @param processedBytecodes the number of bytecodes processed during the compilation, including - * the bytecodes of all inlined methods - * @param time the amount time spent compiling {@code method} - * @param timeUnitsPerSecond the granularity of the units for the {@code time} value - * @param installedCode the nmethod installed as a result of the compilation - */ - public void notifyCompilationStatistics(int id, HotSpotResolvedJavaMethod method, boolean osr, int processedBytecodes, long time, long timeUnitsPerSecond, InstalledCode installedCode) { - runtime.getCompilerToVM().notifyCompilationStatistics(id, (HotSpotResolvedJavaMethodImpl) method, osr, processedBytecodes, time, timeUnitsPerSecond, installedCode); + public int interpreterFrameSize(BytecodeFrame pos) { + return runtime.getCompilerToVM().interpreterFrameSize(pos); } /** diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledCode.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledCode.java index 27236ad771d..5605cdb429d 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledCode.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledCode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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 @@ -22,62 +22,86 @@ */ package jdk.vm.ci.hotspot; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Comparator; -import java.util.EnumMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Stream; -import java.util.stream.Stream.Builder; - import jdk.vm.ci.code.BytecodeFrame; -import jdk.vm.ci.code.CompilationResult; -import jdk.vm.ci.code.CompilationResult.CodeAnnotation; -import jdk.vm.ci.code.CompilationResult.CodeComment; -import jdk.vm.ci.code.CompilationResult.DataPatch; -import jdk.vm.ci.code.CompilationResult.ExceptionHandler; -import jdk.vm.ci.code.CompilationResult.Infopoint; -import jdk.vm.ci.code.CompilationResult.JumpTable; -import jdk.vm.ci.code.CompilationResult.Mark; -import jdk.vm.ci.code.CompilationResult.Site; -import jdk.vm.ci.code.DataSection; -import jdk.vm.ci.code.InfopointReason; -import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.code.CompiledCode; +import jdk.vm.ci.code.site.DataPatch; +import jdk.vm.ci.code.site.Infopoint; +import jdk.vm.ci.code.site.Site; import jdk.vm.ci.meta.Assumptions.Assumption; import jdk.vm.ci.meta.ResolvedJavaMethod; /** - * A {@link CompilationResult} with additional HotSpot-specific information required for installing - * the code in HotSpot's code cache. + * A {@link CompiledCode} with additional HotSpot-specific information required for installing the + * code in HotSpot's code cache. */ -public class HotSpotCompiledCode { +public class HotSpotCompiledCode implements CompiledCode { - public final String name; - public final Site[] sites; - public final ExceptionHandler[] exceptionHandlers; - public final Comment[] comments; - public final Assumption[] assumptions; + /** + * The name of this compilation unit. + */ + protected final String name; - public final byte[] targetCode; - public final int targetCodeSize; + /** + * The buffer containing the emitted machine code. + */ + protected final byte[] targetCode; - public final byte[] dataSection; - public final int dataSectionAlignment; - public final DataPatch[] dataSectionPatches; - public final boolean isImmutablePIC; + /** + * The leading number of bytes in {@link #targetCode} containing the emitted machine code. + */ + protected final int targetCodeSize; - public final int totalFrameSize; - public final int customStackAreaOffset; + /** + * A list of code annotations describing special sites in {@link #targetCode}. + */ + protected final Site[] sites; + + /** + * A list of {@link Assumption} this code relies on. + */ + protected final Assumption[] assumptions; /** * The list of the methods whose bytecodes were used as input to the compilation. If * {@code null}, then the compilation did not record method dependencies. Otherwise, the first * element of this array is the root method of the compilation. */ - public final ResolvedJavaMethod[] methods; + protected final ResolvedJavaMethod[] methods; + + /** + * A list of comments that will be included in code dumps. + */ + protected final Comment[] comments; + + /** + * The data section containing serialized constants for the emitted machine code. + */ + protected final byte[] dataSection; + + /** + * The minimum alignment of the data section. + */ + protected final int dataSectionAlignment; + + /** + * A list of relocations in the {@link #dataSection}. + */ + protected final DataPatch[] dataSectionPatches; + + /** + * A flag determining whether this code is immutable and position independent. + */ + protected final boolean isImmutablePIC; + + /** + * The total size of the stack frame of this compiled method. + */ + protected final int totalFrameSize; + + /** + * Offset in bytes for the custom stack area (relative to sp). + */ + protected final int customStackAreaOffset; public static class Comment { @@ -90,59 +114,38 @@ public class HotSpotCompiledCode { } } - public HotSpotCompiledCode(CompilationResult compResult) { - name = compResult.getName(); - sites = getSortedSites(compResult); - if (compResult.getExceptionHandlers().isEmpty()) { - exceptionHandlers = null; - } else { - exceptionHandlers = compResult.getExceptionHandlers().toArray(new ExceptionHandler[compResult.getExceptionHandlers().size()]); - } - List annotations = compResult.getAnnotations(); - comments = new Comment[annotations.size()]; - if (!annotations.isEmpty()) { - for (int i = 0; i < comments.length; i++) { - CodeAnnotation annotation = annotations.get(i); - String text; - if (annotation instanceof CodeComment) { - CodeComment codeComment = (CodeComment) annotation; - text = codeComment.value; - } else if (annotation instanceof JumpTable) { - JumpTable jumpTable = (JumpTable) annotation; - text = "JumpTable [" + jumpTable.low + " .. " + jumpTable.high + "]"; - } else { - text = annotation.toString(); - } - comments[i] = new Comment(annotation.position, text); - } - } - assumptions = compResult.getAssumptions(); + public HotSpotCompiledCode(String name, byte[] targetCode, int targetCodeSize, Site[] sites, Assumption[] assumptions, ResolvedJavaMethod[] methods, Comment[] comments, byte[] dataSection, + int dataSectionAlignment, DataPatch[] dataSectionPatches, boolean isImmutablePIC, int totalFrameSize, int customStackAreaOffset) { + this.name = name; + this.targetCode = targetCode; + this.targetCodeSize = targetCodeSize; + this.sites = sites; + this.assumptions = assumptions; + this.methods = methods; + + this.comments = comments; + this.dataSection = dataSection; + this.dataSectionAlignment = dataSectionAlignment; + this.dataSectionPatches = dataSectionPatches; + this.isImmutablePIC = isImmutablePIC; + this.totalFrameSize = totalFrameSize; + this.customStackAreaOffset = customStackAreaOffset; + assert validateFrames(); + } - targetCode = compResult.getTargetCode(); - targetCodeSize = compResult.getTargetCodeSize(); + public String getName() { + return name; + } - DataSection data = compResult.getDataSection(); - dataSection = new byte[data.getSectionSize()]; - - ByteBuffer buffer = ByteBuffer.wrap(dataSection).order(ByteOrder.nativeOrder()); - Builder patchBuilder = Stream.builder(); - data.buildDataSection(buffer, patchBuilder); - - dataSectionAlignment = data.getSectionAlignment(); - dataSectionPatches = patchBuilder.build().toArray(len -> new DataPatch[len]); - - isImmutablePIC = compResult.isImmutablePIC(); - - totalFrameSize = compResult.getTotalFrameSize(); - customStackAreaOffset = compResult.getCustomStackAreaOffset(); - - methods = compResult.getMethods(); + @Override + public String toString() { + return name; } /** - * Ensure that all the frames passed into HotSpot are properly formatted with an empty or - * illegal slot following double word slots. + * Ensure that all the frames passed into the VM are properly formatted with an empty or illegal + * slot following double word slots. */ private boolean validateFrames() { for (Site site : sites) { @@ -156,117 +159,4 @@ public class HotSpotCompiledCode { } return true; } - - static class SiteComparator implements Comparator { - - /** - * Defines an order for sorting {@link Infopoint}s based on their - * {@linkplain Infopoint#reason reasons}. This is used to choose which infopoint to preserve - * when multiple infopoints collide on the same PC offset. A negative order value implies a - * non-optional infopoint (i.e., must be preserved). Non-optional infopoints must not - * collide. - */ - static final Map HOTSPOT_INFOPOINT_SORT_ORDER = new EnumMap<>(InfopointReason.class); - static { - HOTSPOT_INFOPOINT_SORT_ORDER.put(InfopointReason.SAFEPOINT, -4); - HOTSPOT_INFOPOINT_SORT_ORDER.put(InfopointReason.CALL, -3); - HOTSPOT_INFOPOINT_SORT_ORDER.put(InfopointReason.IMPLICIT_EXCEPTION, -2); - HOTSPOT_INFOPOINT_SORT_ORDER.put(InfopointReason.METASPACE_ACCESS, 1); - HOTSPOT_INFOPOINT_SORT_ORDER.put(InfopointReason.METHOD_START, 2); - HOTSPOT_INFOPOINT_SORT_ORDER.put(InfopointReason.METHOD_END, 3); - HOTSPOT_INFOPOINT_SORT_ORDER.put(InfopointReason.BYTECODE_POSITION, 4); - } - - static int ord(Infopoint info) { - return HOTSPOT_INFOPOINT_SORT_ORDER.get(info.reason); - } - - static int checkCollision(Infopoint i1, Infopoint i2) { - int o1 = ord(i1); - int o2 = ord(i2); - if (o1 < 0 && o2 < 0) { - throw new JVMCIError("Non-optional infopoints cannot collide: %s and %s", i1, i2); - } - return o1 - o2; - } - - /** - * Records whether any two {@link Infopoint}s had the same {@link Infopoint#pcOffset}. - */ - boolean sawCollidingInfopoints; - - public int compare(Site s1, Site s2) { - if (s1.pcOffset == s2.pcOffset) { - // Marks must come first since patching a call site - // may need to know the mark denoting the call type - // (see uses of CodeInstaller::_next_call_type). - boolean s1IsMark = s1 instanceof Mark; - boolean s2IsMark = s2 instanceof Mark; - if (s1IsMark != s2IsMark) { - return s1IsMark ? -1 : 1; - } - - // Infopoints must group together so put them after - // other Site types. - boolean s1IsInfopoint = s1 instanceof Infopoint; - boolean s2IsInfopoint = s2 instanceof Infopoint; - if (s1IsInfopoint != s2IsInfopoint) { - return s1IsInfopoint ? 1 : -1; - } - - if (s1IsInfopoint) { - sawCollidingInfopoints = true; - return checkCollision((Infopoint) s1, (Infopoint) s2); - } - } - return s1.pcOffset - s2.pcOffset; - } - } - - /** - * HotSpot expects sites to be presented in ascending order of PC (see - * {@code DebugInformationRecorder::add_new_pc_offset}). In addition, it expects - * {@link Infopoint} PCs to be unique. - */ - private static Site[] getSortedSites(CompilationResult target) { - List[] lists = new List[]{target.getInfopoints(), target.getDataPatches(), target.getMarks()}; - int count = 0; - for (List list : lists) { - count += list.size(); - } - Site[] result = new Site[count]; - int pos = 0; - for (List list : lists) { - for (Object elem : list) { - result[pos++] = (Site) elem; - } - } - SiteComparator c = new SiteComparator(); - Arrays.sort(result, c); - if (c.sawCollidingInfopoints) { - Infopoint lastInfopoint = null; - List copy = new ArrayList<>(count); - for (int i = 0; i < count; i++) { - if (result[i] instanceof Infopoint) { - Infopoint info = (Infopoint) result[i]; - if (lastInfopoint == null || lastInfopoint.pcOffset != info.pcOffset) { - lastInfopoint = info; - copy.add(info); - } else { - // Omit this colliding infopoint - assert lastInfopoint.reason.compareTo(info.reason) <= 0; - } - } else { - copy.add(result[i]); - } - } - result = copy.toArray(new Site[copy.size()]); - } - return result; - } - - @Override - public String toString() { - return name; - } } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java index e81f35b5e43..a2038a57341 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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 @@ -22,28 +22,31 @@ */ package jdk.vm.ci.hotspot; -import jdk.vm.ci.code.CompilationResult; +import jdk.vm.ci.code.site.DataPatch; +import jdk.vm.ci.code.site.Site; import jdk.vm.ci.inittimer.SuppressFBWarnings; +import jdk.vm.ci.meta.Assumptions.Assumption; +import jdk.vm.ci.meta.ResolvedJavaMethod; /** * {@link HotSpotCompiledCode} destined for installation as an nmethod. */ public final class HotSpotCompiledNmethod extends HotSpotCompiledCode { - public final HotSpotResolvedJavaMethod method; - public final int entryBCI; + protected final HotSpotResolvedJavaMethod method; + protected final int entryBCI; /** * Compilation identifier. */ - public final int id; + protected final int id; /** * Address of a native {@code JVMCIEnv} object or 0L if no such object exists. */ - public final long jvmciEnv; + protected final long jvmciEnv; - public final boolean hasUnsafeAccess; + protected final boolean hasUnsafeAccess; /** * May be set by VM if code installation fails. It will describe in more detail why installation @@ -51,13 +54,15 @@ public final class HotSpotCompiledNmethod extends HotSpotCompiledCode { */ @SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD", justification = "set by the VM") private String installationFailureMessage; - public HotSpotCompiledNmethod(HotSpotResolvedJavaMethod method, CompilationResult compResult, int id, long jvmciEnv) { - super(compResult); + public HotSpotCompiledNmethod(String name, byte[] targetCode, int targetCodeSize, Site[] sites, Assumption[] assumptions, ResolvedJavaMethod[] methods, Comment[] comments, byte[] dataSection, + int dataSectionAlignment, DataPatch[] dataSectionPatches, boolean isImmutablePIC, int totalFrameSize, int customStackAreaOffset, HotSpotResolvedJavaMethod method, int entryBCI, + int id, long jvmciEnv, boolean hasUnsafeAccess) { + super(name, targetCode, targetCodeSize, sites, assumptions, methods, comments, dataSection, dataSectionAlignment, dataSectionPatches, isImmutablePIC, totalFrameSize, customStackAreaOffset); this.method = method; - this.entryBCI = compResult.getEntryBCI(); + this.entryBCI = entryBCI; this.id = id; this.jvmciEnv = jvmciEnv; - this.hasUnsafeAccess = compResult.hasUnsafeAccess(); + this.hasUnsafeAccess = hasUnsafeAccess; } @Override diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java index ffe53825947..3b720feb38c 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java @@ -27,6 +27,8 @@ import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayIndexScale; import java.lang.reflect.Array; +import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option; import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.ConstantReflectionProvider; import jdk.vm.ci.meta.JavaConstant; @@ -42,11 +44,6 @@ import jdk.vm.ci.meta.ResolvedJavaType; */ public class HotSpotConstantReflectionProvider implements ConstantReflectionProvider, HotSpotProxified { - /** - * Determines whether to treat {@code final} fields with default values as constant. - */ - private static final boolean TrustFinalDefaultFields = HotSpotJVMCIRuntime.getBooleanProperty("TrustFinalDefaultFields", true); - protected final HotSpotJVMCIRuntimeProvider runtime; protected final HotSpotMethodHandleAccessProvider methodHandleAccess; protected final HotSpotMemoryAccessProviderImpl memoryAccess; @@ -249,14 +246,14 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv * Determines if a value read from a {@code final} instance field is considered constant. The * implementation in {@link HotSpotConstantReflectionProvider} returns true if {@code value} is * not the {@link JavaConstant#isDefaultForKind default value} for its kind or if - * {@link #TrustFinalDefaultFields} is true. + * {@link Option#TrustFinalDefaultFields} is true. * * @param value a value read from a {@code final} instance field * @param receiverClass the {@link Object#getClass() class} of object from which the * {@code value} was read */ protected boolean isFinalInstanceFieldValueConstant(JavaConstant value, Class receiverClass) { - return !value.isDefaultForKind() || TrustFinalDefaultFields; + return !value.isDefaultForKind() || Option.TrustFinalDefaultFields.getBoolean(); } /** @@ -359,4 +356,18 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv } return dimensions; } + + @Override + public JavaConstant asJavaClass(ResolvedJavaType type) { + return HotSpotObjectConstantImpl.forObject(((HotSpotResolvedJavaType) type).mirror()); + } + + @Override + public Constant asObjectHub(ResolvedJavaType type) { + if (type instanceof HotSpotResolvedObjectType) { + return ((HotSpotResolvedObjectType) type).klass(); + } else { + throw JVMCIError.unimplemented(); + } + } } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java index 1e242413b63..b1b486721e8 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java @@ -23,17 +23,18 @@ package jdk.vm.ci.hotspot; import jdk.vm.ci.code.CompilationRequest; +import jdk.vm.ci.code.CompilationRequestResult; import jdk.vm.ci.common.JVMCIError; import jdk.vm.ci.runtime.JVMCICompiler; import jdk.vm.ci.runtime.JVMCICompilerFactory; import jdk.vm.ci.runtime.JVMCIRuntime; -import jdk.vm.ci.service.Services; +import jdk.vm.ci.services.Services; final class HotSpotJVMCICompilerConfig { private static class DummyCompilerFactory implements JVMCICompilerFactory, JVMCICompiler { - public void compileMethod(CompilationRequest request) { + public CompilationRequestResult compileMethod(CompilationRequest request) { throw new JVMCIError("no JVMCI compiler selected"); } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java index 4077c0f40f4..88711cc3cb8 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -26,6 +26,7 @@ import static jdk.vm.ci.inittimer.InitTimer.timer; import java.io.IOException; import java.io.OutputStream; +import java.io.PrintStream; import java.lang.reflect.Array; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -37,7 +38,8 @@ import java.util.Objects; import java.util.TreeMap; import jdk.vm.ci.code.Architecture; -import jdk.vm.ci.code.CompilationResult; +import jdk.vm.ci.code.CompilationRequestResult; +import jdk.vm.ci.code.CompiledCode; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.common.JVMCIError; import jdk.vm.ci.inittimer.InitTimer; @@ -48,7 +50,7 @@ import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.runtime.JVMCI; import jdk.vm.ci.runtime.JVMCIBackend; import jdk.vm.ci.runtime.JVMCICompiler; -import jdk.vm.ci.service.Services; +import jdk.vm.ci.services.Services; import jdk.internal.misc.VM; //JaCoCo Exclude @@ -85,19 +87,95 @@ public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider, H } /** - * Gets a boolean value based on a system property {@linkplain VM#getSavedProperty(String) - * saved} at system initialization time. The property name is prefixed with "{@code jvmci.}". - * - * @param name the name of the system property to derive a boolean value from using - * {@link Boolean#parseBoolean(String)} - * @param def the value to return if there is no system property corresponding to {@code name} + * A list of all supported JVMCI options. */ - public static boolean getBooleanProperty(String name, boolean def) { - String value = VM.getSavedProperty("jvmci." + name); - if (value == null) { - return def; + public enum Option { + ImplicitStableValues(boolean.class, true, "Mark well-known stable fields as such."), + // Note: The following one is not used (see InitTimer.ENABLED). + InitTimer(boolean.class, false, "Specifies if initialization timing is enabled."), + PrintConfig(boolean.class, false, "Prints all HotSpotVMConfig fields."), + PrintFlags(boolean.class, false, "Prints all JVMCI flags and exits."), + ShowFlags(boolean.class, false, "Prints all JVMCI flags and continues."), + TraceMethodDataFilter(String.class, null, ""), + TrustFinalDefaultFields(boolean.class, true, "Determines whether to treat final fields with default values as constant."); + + /** + * The prefix for system properties that are JVMCI options. + */ + private static final String JVMCI_OPTION_PROPERTY_PREFIX = "jvmci."; + + /** + * Marker for uninitialized flags. + */ + private static final String UNINITIALIZED = "UNINITIALIZED"; + + private final Class type; + private Object value; + private final Object defaultValue; + private boolean isDefault; + private final String help; + + private Option(Class type, Object defaultValue, String help) { + assert Character.isUpperCase(name().charAt(0)) : "Option name must start with upper-case letter: " + name(); + this.type = type; + this.value = UNINITIALIZED; + this.defaultValue = defaultValue; + this.help = help; + } + + private Object getValue() { + if (value == UNINITIALIZED) { + String propertyValue = VM.getSavedProperty(JVMCI_OPTION_PROPERTY_PREFIX + name()); + if (propertyValue == null) { + this.value = defaultValue; + this.isDefault = true; + } else { + if (type == boolean.class) { + this.value = Boolean.parseBoolean(propertyValue); + } else if (type == String.class) { + this.value = propertyValue; + } else { + throw new JVMCIError("Unexpected option type " + type); + } + this.isDefault = false; + } + // Saved properties should not be interned - let's be sure + assert value != UNINITIALIZED; + } + return value; + } + + /** + * Returns the option's value as boolean. + * + * @return option's value + */ + public boolean getBoolean() { + return (boolean) getValue(); + } + + /** + * Returns the option's value as String. + * + * @return option's value + */ + public String getString() { + return (String) getValue(); + } + + /** + * Prints all option flags to {@code out}. + * + * @param out stream to print to + */ + public static void printFlags(PrintStream out) { + out.println("[List of JVMCI options]"); + for (Option option : values()) { + Object value = option.getValue(); + String assign = option.isDefault ? ":=" : " ="; + out.printf("%9s %-40s %s %-14s %s%n", option.type.getSimpleName(), option, assign, value, option.help); + } } - return Boolean.parseBoolean(value); } public static HotSpotJVMCIBackendFactory findFactory(String architecture) { @@ -164,7 +242,16 @@ public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider, H } metaAccessContext = context; - if (Boolean.valueOf(System.getProperty("jvmci.printconfig"))) { + boolean printFlags = Option.PrintFlags.getBoolean(); + boolean showFlags = Option.ShowFlags.getBoolean(); + if (printFlags || showFlags) { + Option.printFlags(System.out); + if (printFlags) { + System.exit(0); + } + } + + if (Option.PrintConfig.getBoolean()) { printConfig(config, compilerToVm); } @@ -241,8 +328,10 @@ public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider, H * Called from the VM. */ @SuppressWarnings({"unused"}) - private void compileMethod(HotSpotResolvedJavaMethod method, int entryBCI, long jvmciEnv, int id) { - getCompiler().compileMethod(new HotSpotCompilationRequest(method, entryBCI, jvmciEnv, id)); + private CompilationRequestResult compileMethod(HotSpotResolvedJavaMethod method, int entryBCI, long jvmciEnv, int id) { + CompilationRequestResult result = getCompiler().compileMethod(new HotSpotCompilationRequest(method, entryBCI, jvmciEnv, id)); + assert result != null : "compileMethod must always return something"; + return result; } /** @@ -262,11 +351,11 @@ public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider, H * * @param hotSpotCodeCacheProvider * @param installedCode - * @param compResult + * @param compiledCode */ - void notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider, InstalledCode installedCode, CompilationResult compResult) { + void notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider, InstalledCode installedCode, CompiledCode compiledCode) { for (HotSpotVMEventListener vmEventListener : vmEventListeners) { - vmEventListener.notifyInstall(hotSpotCodeCacheProvider, installedCode, compResult); + vmEventListener.notifyInstall(hotSpotCodeCacheProvider, installedCode, compiledCode); } } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java index c6f4dabc0fb..f516412fa6e 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java @@ -29,6 +29,7 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Field; import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option; import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.meta.LocationIdentity; import jdk.vm.ci.meta.MetaAccessProvider; @@ -41,11 +42,6 @@ import jdk.vm.ci.meta.ResolvedJavaType; */ class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField, HotSpotProxified { - /** - * Mark well-known stable fields as such. - */ - private static final boolean ImplicitStableValues = HotSpotJVMCIRuntime.getBooleanProperty("ImplicitStableValues", true); - private final HotSpotResolvedObjectTypeImpl holder; private final String name; private JavaType type; @@ -198,7 +194,7 @@ class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField, HotSpotP return true; } assert getAnnotation(Stable.class) == null; - if (ImplicitStableValues && isImplicitStableField()) { + if (Option.ImplicitStableValues.getBoolean() && isImplicitStableField()) { return true; } return false; diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java index 5999d8c204f..9017ffde58d 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java @@ -37,6 +37,7 @@ import java.util.HashMap; import java.util.Map; import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option; import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.ConstantPool; import jdk.vm.ci.meta.DefaultProfilingInfo; @@ -417,8 +418,6 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp return false; } - private static final String TraceMethodDataFilter = System.getProperty("jvmci.traceMethodDataFilter"); - @Override public ProfilingInfo getProfilingInfo(boolean includeNormal, boolean includeOSR) { ProfilingInfo info; @@ -427,7 +426,8 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp long metaspaceMethodData = UNSAFE.getAddress(metaspaceMethod + config().methodDataOffset); if (metaspaceMethodData != 0) { methodData = new HotSpotMethodData(metaspaceMethodData, this); - if (TraceMethodDataFilter != null && this.format("%H.%n").contains(TraceMethodDataFilter)) { + String methodDataFilter = Option.TraceMethodDataFilter.getString(); + if (methodDataFilter != null && this.format("%H.%n").contains(methodDataFilter)) { System.out.println("Raw method data for " + this.format("%H.%n(%p)") + ":"); System.out.println(methodData.toString()); } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java index 65d92b1d8fd..a87e540f7a1 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java @@ -303,16 +303,6 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem return isLeaf() ? this : null; } - @Override - public JavaConstant getJavaClass() { - return HotSpotObjectConstantImpl.forObject(mirror()); - } - - @Override - public Constant getObjectHub() { - return klass(); - } - @Override public AssumptionResult hasFinalizableSubclass() { assert !isArray(); diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java index 7a8f3e8a633..b8039190175 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java @@ -109,16 +109,6 @@ public final class HotSpotResolvedPrimitiveType extends HotSpotResolvedJavaType return null; } - @Override - public JavaConstant getObjectHub() { - throw JVMCIError.unimplemented(); - } - - @Override - public JavaConstant getJavaClass() { - throw JVMCIError.unimplemented(); - } - @Override public AssumptionResult hasFinalizableSubclass() { return new AssumptionResult<>(false); diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java index d237006dfcb..ae0302b87fb 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java @@ -973,11 +973,12 @@ public class HotSpotVMConfig { @HotSpotVMFlag(name = "UseBlockZeroing", archs = {"sparc"}) @Stable public boolean useBlockZeroing; @HotSpotVMFlag(name = "BlockZeroingLowLimit", archs = {"sparc"}) @Stable public int blockZeroingLowLimit; - // offsets, ... @HotSpotVMFlag(name = "StackShadowPages") @Stable public int stackShadowPages; @HotSpotVMFlag(name = "UseStackBanging") @Stable public boolean useStackBanging; @HotSpotVMConstant(name = "STACK_BIAS") @Stable public int stackBias; + @HotSpotVMField(name = "CompilerToVM::Data::vm_page_size", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int vmPageSize; + // offsets, ... @HotSpotVMField(name = "oopDesc::_mark", type = "markOop", get = HotSpotVMField.Type.OFFSET) @Stable public int markOffset; @HotSpotVMField(name = "oopDesc::_metadata._klass", type = "Klass*", get = HotSpotVMField.Type.OFFSET) @Stable public int hubOffset; diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMEventListener.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMEventListener.java index c9d3db7ef09..c14a32dbffc 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMEventListener.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMEventListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -22,7 +22,7 @@ */ package jdk.vm.ci.hotspot; -import jdk.vm.ci.code.CompilationResult; +import jdk.vm.ci.code.CompiledCode; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.meta.JVMCIMetaAccessContext; import jdk.vm.ci.meta.ResolvedJavaType; @@ -40,9 +40,9 @@ public interface HotSpotVMEventListener { * * @param hotSpotCodeCacheProvider * @param installedCode - * @param compResult + * @param compiledCode */ - default void notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider, InstalledCode installedCode, CompilationResult compResult) { + default void notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider, InstalledCode installedCode, CompiledCode compiledCode) { } /** diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.inittimer/src/jdk/vm/ci/inittimer/InitTimer.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.inittimer/src/jdk/vm/ci/inittimer/InitTimer.java index 921b537bfb1..01fad3d82be 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.inittimer/src/jdk/vm/ci/inittimer/InitTimer.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.inittimer/src/jdk/vm/ci/inittimer/InitTimer.java @@ -65,9 +65,10 @@ public final class InitTimer implements AutoCloseable { } /** - * Specifies if initialization timing is enabled. + * Specifies if initialization timing is enabled. Note: This property cannot use + * {@code HotSpotJVMCIRuntime.Option} since that class is not visible from this package. */ - private static final boolean ENABLED = Boolean.getBoolean("jvmci.inittimer") || Boolean.getBoolean("jvmci.runtime.TimeInit"); + private static final boolean ENABLED = Boolean.getBoolean("jvmci.InitTimer"); public static final AtomicInteger nesting = ENABLED ? new AtomicInteger() : null; public static final String SPACES = " "; diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java index 33cc2a27ebc..f6e2cbb6a7e 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java @@ -160,4 +160,15 @@ public interface ConstantReflectionProvider { * Gets raw memory access. */ MemoryAccessProvider getMemoryAccessProvider(); + + /** + * Gets the runtime representation of the {@link Class} object of this type. + */ + JavaConstant asJavaClass(ResolvedJavaType type); + + /** + * Gets the runtime representation of the "hub" of this type--that is, the closest part of the + * type representation which is typically stored in the object header. + */ + Constant asObjectHub(ResolvedJavaType type); } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java index d46a0fc3dce..3649c267f6b 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java @@ -33,17 +33,6 @@ import jdk.vm.ci.meta.Assumptions.AssumptionResult; * . */ public interface ResolvedJavaType extends JavaType, ModifiersProvider { - /** - * Gets the runtime representation of the Java class object of this type. - */ - JavaConstant getJavaClass(); - - /** - * Gets the runtime representation of the "hub" of this type--that is, the closest part of the - * type representation which is typically stored in the object header. - */ - Constant getObjectHub(); - /** * Checks whether this type has a finalizer method. * diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompiler.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompiler.java index 72a1b53b8f9..8aa5df1bf8c 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompiler.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompiler.java @@ -23,6 +23,7 @@ package jdk.vm.ci.runtime; import jdk.vm.ci.code.CompilationRequest; +import jdk.vm.ci.code.CompilationRequestResult; public interface JVMCICompiler { int INVOCATION_ENTRY_BCI = -1; @@ -31,5 +32,5 @@ public interface JVMCICompiler { * Services a compilation request. This object should compile the method to machine code and * install it in the code cache if the compilation is successful. */ - void compileMethod(CompilationRequest request); + CompilationRequestResult compileMethod(CompilationRequest request); } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service.processor/src/META-INF/services/javax.annotation.processing.Processor b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service.processor/src/META-INF/services/javax.annotation.processing.Processor deleted file mode 100644 index 72506df9cb8..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service.processor/src/META-INF/services/javax.annotation.processing.Processor +++ /dev/null @@ -1 +0,0 @@ -jdk.vm.ci.service.processor.ServiceProviderProcessor diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service.processor/src/jdk/vm/ci/service/processor/ServiceProviderProcessor.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service.processor/src/jdk/vm/ci/service/processor/ServiceProviderProcessor.java deleted file mode 100644 index d8aea467257..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service.processor/src/jdk/vm/ci/service/processor/ServiceProviderProcessor.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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 jdk.vm.ci.service.processor; - -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.util.HashSet; -import java.util.Set; - -import javax.annotation.processing.AbstractProcessor; -import javax.annotation.processing.RoundEnvironment; -import javax.annotation.processing.SupportedAnnotationTypes; -import javax.lang.model.SourceVersion; -import javax.lang.model.element.Element; -import javax.lang.model.element.TypeElement; -import javax.lang.model.type.MirroredTypeException; -import javax.lang.model.type.TypeMirror; -import javax.tools.Diagnostic.Kind; -import javax.tools.FileObject; -import javax.tools.StandardLocation; - -import jdk.vm.ci.service.ServiceProvider; - -@SupportedAnnotationTypes("jdk.vm.ci.service.ServiceProvider") -public class ServiceProviderProcessor extends AbstractProcessor { - - private final Set processed = new HashSet<>(); - - @Override - public SourceVersion getSupportedSourceVersion() { - return SourceVersion.latest(); - } - - private boolean verifyAnnotation(TypeMirror serviceInterface, TypeElement serviceProvider) { - if (!processingEnv.getTypeUtils().isSubtype(serviceProvider.asType(), serviceInterface)) { - String msg = String.format("Service provider class %s must implement service interface %s", serviceProvider.getSimpleName(), serviceInterface); - processingEnv.getMessager().printMessage(Kind.ERROR, msg, serviceProvider); - return false; - } - - return true; - } - - private void processElement(TypeElement serviceProvider) { - if (processed.contains(serviceProvider)) { - return; - } - - processed.add(serviceProvider); - ServiceProvider annotation = serviceProvider.getAnnotation(ServiceProvider.class); - if (annotation != null) { - try { - annotation.value(); - } catch (MirroredTypeException ex) { - TypeMirror serviceInterface = ex.getTypeMirror(); - if (verifyAnnotation(serviceInterface, serviceProvider)) { - String interfaceName = ex.getTypeMirror().toString(); - createProviderFile(serviceProvider, interfaceName); - } - } - } - } - - private void createProviderFile(TypeElement serviceProvider, String interfaceName) { - if (serviceProvider.getNestingKind().isNested()) { - // This is a simplifying constraint that means we don't have to - // processed the qualified name to insert '$' characters at - // the relevant positions. - String msg = String.format("Service provider class %s must be a top level class", serviceProvider.getSimpleName()); - processingEnv.getMessager().printMessage(Kind.ERROR, msg, serviceProvider); - return; - } - - String filename = "META-INF/jvmci.providers/" + serviceProvider.getQualifiedName(); - try { - FileObject file = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT, "", filename, serviceProvider); - PrintWriter writer = new PrintWriter(new OutputStreamWriter(file.openOutputStream(), "UTF-8")); - writer.println(interfaceName); - writer.close(); - } catch (IOException e) { - processingEnv.getMessager().printMessage(Kind.ERROR, e.getMessage(), serviceProvider); - } - } - - @Override - public boolean process(Set annotations, RoundEnvironment roundEnv) { - if (roundEnv.processingOver()) { - return true; - } - - for (Element element : roundEnv.getElementsAnnotatedWith(ServiceProvider.class)) { - assert element.getKind().isClass(); - processElement((TypeElement) element); - } - - return true; - } -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/.checkstyle_checks.xml b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/.checkstyle_checks.xml deleted file mode 100644 index 003d8f7dcb5..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/.checkstyle_checks.xml +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/src/jdk/vm/ci/service/Services.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java similarity index 99% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/src/jdk/vm/ci/service/Services.java rename to hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java index 9a6263a9b99..be4a1cc1afa 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/src/jdk/vm/ci/service/Services.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.vm.ci.service; +package jdk.vm.ci.services; import java.util.Formatter; import java.util.Iterator; diff --git a/hotspot/src/os/aix/vm/attachListener_aix.cpp b/hotspot/src/os/aix/vm/attachListener_aix.cpp index 95f5c871028..cb56efc26f7 100644 --- a/hotspot/src/os/aix/vm/attachListener_aix.cpp +++ b/hotspot/src/os/aix/vm/attachListener_aix.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/c1_globals_aix.hpp b/hotspot/src/os/aix/vm/c1_globals_aix.hpp index 45b57f71954..0d4affd2bab 100644 --- a/hotspot/src/os/aix/vm/c1_globals_aix.hpp +++ b/hotspot/src/os/aix/vm/c1_globals_aix.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/c2_globals_aix.hpp b/hotspot/src/os/aix/vm/c2_globals_aix.hpp index ea63015a513..b42a7051fea 100644 --- a/hotspot/src/os/aix/vm/c2_globals_aix.hpp +++ b/hotspot/src/os/aix/vm/c2_globals_aix.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/decoder_aix.hpp b/hotspot/src/os/aix/vm/decoder_aix.hpp index c415e4b3296..73840ab87e2 100644 --- a/hotspot/src/os/aix/vm/decoder_aix.hpp +++ b/hotspot/src/os/aix/vm/decoder_aix.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013 SAP AG. All rights reserved. + * Copyright (c) 2013 SAP SE. 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 @@ -36,13 +36,15 @@ class AIXDecoder: public AbstractDecoder { virtual bool can_decode_C_frame_in_vm() const { return true; } - virtual bool demangle(const char* symbol, char* buf, int buflen) { return false; } // demangled by getFuncName + virtual bool demangle(const char* symbol, char* buf, int buflen) { return false; } // use AixSymbols::get_function_name to demangle virtual bool decode(address addr, char* buf, int buflen, int* offset, const char* modulepath, bool demangle) { - return (::getFuncName((codeptr_t)addr, buf, buflen, offset, 0, 0, 0, demangle) == 0); + return AixSymbols::get_function_name(addr, buf, buflen, offset, 0, demangle); } virtual bool decode(address addr, char *buf, int buflen, int* offset, const void *base) { ShouldNotReachHere(); return false; } + }; + diff --git a/hotspot/src/os/aix/vm/globals_aix.hpp b/hotspot/src/os/aix/vm/globals_aix.hpp index 51612fae7a6..bfd244eb6fc 100644 --- a/hotspot/src/os/aix/vm/globals_aix.hpp +++ b/hotspot/src/os/aix/vm/globals_aix.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/interfaceSupport_aix.hpp b/hotspot/src/os/aix/vm/interfaceSupport_aix.hpp index 8f32db7b810..a8bb618e287 100644 --- a/hotspot/src/os/aix/vm/interfaceSupport_aix.hpp +++ b/hotspot/src/os/aix/vm/interfaceSupport_aix.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/jsig.c b/hotspot/src/os/aix/vm/jsig.c index d39fbe311eb..001255ab365 100644 --- a/hotspot/src/os/aix/vm/jsig.c +++ b/hotspot/src/os/aix/vm/jsig.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/jvm_aix.cpp b/hotspot/src/os/aix/vm/jvm_aix.cpp index 7a9fb8969b8..d6e9038c4c7 100644 --- a/hotspot/src/os/aix/vm/jvm_aix.cpp +++ b/hotspot/src/os/aix/vm/jvm_aix.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/jvm_aix.h b/hotspot/src/os/aix/vm/jvm_aix.h index 75feef49dc1..e79d2e638fd 100644 --- a/hotspot/src/os/aix/vm/jvm_aix.h +++ b/hotspot/src/os/aix/vm/jvm_aix.h @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/libo4.cpp b/hotspot/src/os/aix/vm/libo4.cpp index d47f70eb8b8..c0c8299aedd 100644 --- a/hotspot/src/os/aix/vm/libo4.cpp +++ b/hotspot/src/os/aix/vm/libo4.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/libo4.hpp b/hotspot/src/os/aix/vm/libo4.hpp index 13bc1856adb..fb920071dfc 100644 --- a/hotspot/src/os/aix/vm/libo4.hpp +++ b/hotspot/src/os/aix/vm/libo4.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/libodm_aix.cpp b/hotspot/src/os/aix/vm/libodm_aix.cpp index e39a97d9f77..af998b84086 100644 --- a/hotspot/src/os/aix/vm/libodm_aix.cpp +++ b/hotspot/src/os/aix/vm/libodm_aix.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2015, 2015 SAP AG. All rights reserved. + * Copyright (c) 2015, 2015 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/libodm_aix.hpp b/hotspot/src/os/aix/vm/libodm_aix.hpp index 908bb2686a4..920b58f746f 100644 --- a/hotspot/src/os/aix/vm/libodm_aix.hpp +++ b/hotspot/src/os/aix/vm/libodm_aix.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2015, 2015 SAP AG. All rights reserved. + * Copyright (c) 2015, 2015 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/libperfstat_aix.cpp b/hotspot/src/os/aix/vm/libperfstat_aix.cpp index afd577ffcbc..388b4052c9e 100644 --- a/hotspot/src/os/aix/vm/libperfstat_aix.cpp +++ b/hotspot/src/os/aix/vm/libperfstat_aix.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/libperfstat_aix.hpp b/hotspot/src/os/aix/vm/libperfstat_aix.hpp index c0da6709061..164f486a2dc 100644 --- a/hotspot/src/os/aix/vm/libperfstat_aix.hpp +++ b/hotspot/src/os/aix/vm/libperfstat_aix.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/loadlib_aix.cpp b/hotspot/src/os/aix/vm/loadlib_aix.cpp index 53e4891442b..8373cc2162e 100644 --- a/hotspot/src/os/aix/vm/loadlib_aix.cpp +++ b/hotspot/src/os/aix/vm/loadlib_aix.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/loadlib_aix.hpp b/hotspot/src/os/aix/vm/loadlib_aix.hpp index b619141cd54..0f5b1489719 100644 --- a/hotspot/src/os/aix/vm/loadlib_aix.hpp +++ b/hotspot/src/os/aix/vm/loadlib_aix.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/misc_aix.cpp b/hotspot/src/os/aix/vm/misc_aix.cpp index 52a26c0f592..f0ccdfbcbab 100644 --- a/hotspot/src/os/aix/vm/misc_aix.cpp +++ b/hotspot/src/os/aix/vm/misc_aix.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2015 SAP AG. All rights reserved. + * Copyright (c) 2015 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/misc_aix.hpp b/hotspot/src/os/aix/vm/misc_aix.hpp index ba38bda137b..fb5fc4c526a 100644 --- a/hotspot/src/os/aix/vm/misc_aix.hpp +++ b/hotspot/src/os/aix/vm/misc_aix.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,6 @@ fputc('\n', stderr); fflush(stderr); \ } \ } -#define ERRBYE(s) { trcVerbose(s); return -1; } #define assert0(b) assert((b), "") #define guarantee0(b) guarantee((b), "") diff --git a/hotspot/src/os/aix/vm/mutex_aix.inline.hpp b/hotspot/src/os/aix/vm/mutex_aix.inline.hpp index 82ae899e14d..ee59295dcba 100644 --- a/hotspot/src/os/aix/vm/mutex_aix.inline.hpp +++ b/hotspot/src/os/aix/vm/mutex_aix.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/osThread_aix.cpp b/hotspot/src/os/aix/vm/osThread_aix.cpp index c2b1f69b291..0b13454ffef 100644 --- a/hotspot/src/os/aix/vm/osThread_aix.cpp +++ b/hotspot/src/os/aix/vm/osThread_aix.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/osThread_aix.hpp b/hotspot/src/os/aix/vm/osThread_aix.hpp index 73d2a336e25..405b2a4b103 100644 --- a/hotspot/src/os/aix/vm/osThread_aix.hpp +++ b/hotspot/src/os/aix/vm/osThread_aix.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp index 43314d7dfac..f63a789b89c 100644 --- a/hotspot/src/os/aix/vm/os_aix.cpp +++ b/hotspot/src/os/aix/vm/os_aix.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 @@ -130,61 +130,10 @@ extern "C" int getargs (procsinfo*, int, char*, int); #define ERROR_MP_VMGETINFO_FAILED 102 #define ERROR_MP_VMGETINFO_CLAIMS_NO_SUPPORT_FOR_64K 103 -// The semantics in this file are thus that codeptr_t is a *real code ptr*. -// This means that any function taking codeptr_t as arguments will assume -// a real codeptr and won't handle function descriptors (eg getFuncName), -// whereas functions taking address as args will deal with function -// descriptors (eg os::dll_address_to_library_name). -typedef unsigned int* codeptr_t; - -// Typedefs for stackslots, stack pointers, pointers to op codes. -typedef unsigned long stackslot_t; -typedef stackslot_t* stackptr_t; - // Query dimensions of the stack of the calling thread. static bool query_stack_dimensions(address* p_stack_base, size_t* p_stack_size); static address resolve_function_descriptor_to_code_pointer(address p); -// Function to check a given stack pointer against given stack limits. -inline bool is_valid_stackpointer(stackptr_t sp, stackptr_t stack_base, size_t stack_size) { - if (((uintptr_t)sp) & 0x7) { - return false; - } - if (sp > stack_base) { - return false; - } - if (sp < (stackptr_t) ((address)stack_base - stack_size)) { - return false; - } - return true; -} - -// Returns true if function is a valid codepointer. -inline bool is_valid_codepointer(codeptr_t p) { - if (!p) { - return false; - } - if (((uintptr_t)p) & 0x3) { - return false; - } - if (LoadedLibraries::find_for_text_address(p, NULL) == NULL) { - return false; - } - return true; -} - -// Macro to check a given stack pointer against given stack limits and to die if test fails. -#define CHECK_STACK_PTR(sp, stack_base, stack_size) { \ - guarantee(is_valid_stackpointer((stackptr_t)(sp), (stackptr_t)(stack_base), stack_size), "Stack Pointer Invalid"); \ -} - -// Macro to check the current stack pointer against given stacklimits. -#define CHECK_CURRENT_STACK_PTR(stack_base, stack_size) { \ - address sp; \ - sp = os::current_stack_pointer(); \ - CHECK_STACK_PTR(sp, stack_base, stack_size); \ -} - static void vmembk_print_on(outputStream* os); //////////////////////////////////////////////////////////////////////////////// @@ -859,9 +808,6 @@ static void *java_start(Thread *thread) { trcVerbose("Thread " UINT64_FORMAT ": stack not in data segment.", (uint64_t) pthread_id); } - // Do some sanity checks. - CHECK_CURRENT_STACK_PTR(thread->stack_base(), thread->stack_size()); - // Try to randomize the cache line index of hot stack frames. // This helps when threads of the same stack traces evict each other's // cache lines. The threads can be either from the same JVM instance, or @@ -1028,9 +974,6 @@ bool os::create_attached_thread(JavaThread* thread) { // initialize floating point control register os::Aix::init_thread_fpu_state(); - // some sanity checks - CHECK_CURRENT_STACK_PTR(thread->stack_base(), thread->stack_size()); - // Initial thread state is RUNNABLE osthread->set_state(RUNNABLE); @@ -1382,32 +1325,7 @@ bool os::dll_address_to_function_name(address addr, char *buf, return false; } - // Go through Decoder::decode to call getFuncName which reads the name from the traceback table. - return Decoder::decode(addr, buf, buflen, offset, demangle); -} - -static int getModuleName(codeptr_t pc, // [in] program counter - char* p_name, size_t namelen, // [out] optional: function name - char* p_errmsg, size_t errmsglen // [out] optional: user provided buffer for error messages - ) { - - if (p_name && namelen > 0) { - *p_name = '\0'; - } - if (p_errmsg && errmsglen > 0) { - *p_errmsg = '\0'; - } - - if (p_name && namelen > 0) { - loaded_module_t lm; - if (LoadedLibraries::find_for_text_address(pc, &lm) != NULL) { - strncpy(p_name, lm.shortname, namelen); - p_name[namelen - 1] = '\0'; - } - return 0; - } - - return -1; + return AixSymbols::get_function_name(addr, buf, buflen, offset, NULL, demangle); } bool os::dll_address_to_library_name(address addr, char* buf, @@ -1425,10 +1343,7 @@ bool os::dll_address_to_library_name(address addr, char* buf, return false; } - if (::getModuleName((codeptr_t) addr, buf, buflen, 0, 0) == 0) { - return true; - } - return false; + return AixSymbols::get_module_name(addr, buf, buflen); } // Loads .dll/.so and in case of error it checks if .dll/.so was built @@ -3827,7 +3742,7 @@ bool os::find(address addr, outputStream* st) { loaded_module_t lm; if (LoadedLibraries::find_for_text_address(addr, &lm) != NULL || LoadedLibraries::find_for_data_address(addr, &lm) != NULL) { - st->print("%s", lm.path); + st->print_cr("%s", lm.path); return true; } diff --git a/hotspot/src/os/aix/vm/os_aix.hpp b/hotspot/src/os/aix/vm/os_aix.hpp index b718d04c52e..cc4337070c8 100644 --- a/hotspot/src/os/aix/vm/os_aix.hpp +++ b/hotspot/src/os/aix/vm/os_aix.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013, 2015 SAP AG. All rights reserved. + * Copyright (c) 2013, 2015 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/os_aix.inline.hpp b/hotspot/src/os/aix/vm/os_aix.inline.hpp index 5d0deea22f7..11c0c3fc5d3 100644 --- a/hotspot/src/os/aix/vm/os_aix.inline.hpp +++ b/hotspot/src/os/aix/vm/os_aix.inline.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -65,7 +65,7 @@ inline void os::pd_split_reserved_memory(char *base, size_t size, } // Bang the shadow pages if they need to be touched to be mapped. -inline void os::bang_stack_shadow_pages() { +inline void os::map_stack_shadow_pages() { } inline void os::dll_unload(void *lib) { diff --git a/hotspot/src/os/aix/vm/perfMemory_aix.cpp b/hotspot/src/os/aix/vm/perfMemory_aix.cpp index 8b8431daf9e..2604a03dae8 100644 --- a/hotspot/src/os/aix/vm/perfMemory_aix.cpp +++ b/hotspot/src/os/aix/vm/perfMemory_aix.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/os/aix/vm/porting_aix.cpp b/hotspot/src/os/aix/vm/porting_aix.cpp index d5e8e881872..c0d54241eaa 100644 --- a/hotspot/src/os/aix/vm/porting_aix.cpp +++ b/hotspot/src/os/aix/vm/porting_aix.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 @@ -23,30 +23,35 @@ */ #include "asm/assembler.hpp" +#include "compiler/disassembler.hpp" #include "loadlib_aix.hpp" #include "memory/allocation.hpp" #include "memory/allocation.inline.hpp" -// For CritSect #include "misc_aix.hpp" #include "porting_aix.hpp" #include "runtime/os.hpp" +#include "runtime/thread.hpp" #include "utilities/debug.hpp" #include #include +#include ////////////////////////////////// // Provide implementation for dladdr based on LoadedLibraries pool and -// traceback table scan (see getFuncName). +// traceback table scan // Search traceback table in stack, // return procedure name from trace back table. #define MAX_FUNC_SEARCH_LEN 0x10000 -// Any PC below this value is considered toast. -#define MINIMUM_VALUE_FOR_PC ((unsigned int*)0x1024) #define PTRDIFF_BYTES(p1,p2) (((ptrdiff_t)p1) - ((ptrdiff_t)p2)) +// Typedefs for stackslots, stack pointers, pointers to op codes. +typedef unsigned long stackslot_t; +typedef stackslot_t* stackptr_t; +typedef unsigned int* codeptr_t; + // Unfortunately, the interface of dladdr makes the implementator // responsible for maintaining memory for function name/library // name. I guess this is because most OS's keep those values as part @@ -91,15 +96,12 @@ class fixed_strings { static fixed_strings dladdr_fixed_strings; -// Given a code pointer, returns the function name and the displacement. -// Function looks for the traceback table at the end of the function. -extern "C" int getFuncName( - codeptr_t pc, // [in] program counter +bool AixSymbols::get_function_name ( + address pc0, // [in] program counter char* p_name, size_t namelen, // [out] optional: function name ("" if not available) int* p_displacement, // [out] optional: displacement (-1 if not available) const struct tbtable** p_tb, // [out] optional: ptr to traceback table to get further // information (NULL if not available) - char* p_errmsg, size_t errmsglen,// [out] optional: user provided buffer for error messages bool demangle // [in] whether to demangle the name ) { struct tbtable* tb = 0; @@ -109,9 +111,6 @@ extern "C" int getFuncName( if (p_name && namelen > 0) { *p_name = '\0'; } - if (p_errmsg && errmsglen > 0) { - *p_errmsg = '\0'; - } if (p_displacement) { *p_displacement = -1; } @@ -119,9 +118,12 @@ extern "C" int getFuncName( *p_tb = NULL; } + codeptr_t pc = (codeptr_t)pc0; + // weed out obvious bogus states - if (pc < MINIMUM_VALUE_FOR_PC) { - ERRBYE("invalid program counter"); + if (pc < (codeptr_t)0x1000) { + trcVerbose("invalid program counter"); + return false; } // We see random but frequent crashes in this function since some months mainly on shutdown @@ -130,7 +132,8 @@ extern "C" int getFuncName( // As the pc cannot be trusted to be anything sensible lets make all reads via SafeFetch. Also // bail if this is not a text address right now. if (!LoadedLibraries::find_for_text_address(pc, NULL)) { - ERRBYE("not a text address"); + trcVerbose("not a text address"); + return false; } // .. (Note that is_readable_pointer returns true if safefetch stubs are not there yet; @@ -138,10 +141,11 @@ extern "C" int getFuncName( // error files than not having a callstack.) #define CHECK_POINTER_READABLE(p) \ if (!MiscUtils::is_readable_pointer(p)) { \ - ERRBYE("pc not readable"); \ + trcVerbose("pc not readable"); \ + return false; \ } - codeptr_t pc2 = pc; + codeptr_t pc2 = (codeptr_t) pc; // Make sure the pointer is word aligned. pc2 = (codeptr_t) align_ptr_up((char*)pc2, 4); @@ -154,7 +158,8 @@ extern "C" int getFuncName( pc2++; } if (*pc2 != 0) { - ERRBYE("no traceback table found"); + trcVerbose("no traceback table found"); + return false; } // // Set up addressability to the traceback table @@ -166,7 +171,8 @@ extern "C" int getFuncName( if (tb->tb.lang >= 0xf && tb->tb.lang <= 0xfb) { // Language specifiers, go from 0 (C) to 14 (Objective C). // According to spec, 0xf-0xfa reserved, 0xfb-0xff reserved for ibm. - ERRBYE("no traceback table found"); + trcVerbose("no traceback table found"); + return false; } // Existence of fields in the tbtable extension are contingent upon @@ -188,7 +194,8 @@ extern "C" int getFuncName( // Weed out the cases where we did find the wrong traceback table. if (pc < start_of_procedure) { - ERRBYE("no traceback table found"); + trcVerbose("no traceback table found"); + return false; } // return the displacement @@ -218,23 +225,19 @@ extern "C" int getFuncName( if (p_name && namelen > 0) { if (tb->tb.name_present) { // Copy name from text because it may not be zero terminated. - // 256 is good enough for most cases; do not use large buffers here. - char buf[256]; - const short l = MIN2(*((short*)pc2), sizeof(buf) - 1); + const short l = MIN2(*((short*)pc2), namelen - 1); // Be very careful. int i = 0; char* const p = (char*)pc2 + sizeof(short); while (i < l && MiscUtils::is_readable_pointer(p + i)) { - buf[i] = p[i]; + p_name[i] = p[i]; i++; } - buf[i] = '\0'; - - p_name[0] = '\0'; + p_name[i] = '\0'; // If it is a C++ name, try and demangle it using the Demangle interface (see demangle.h). if (demangle) { char* rest; - Name* const name = Demangle(buf, rest); + Name* const name = Demangle(p_name, rest); if (name) { const char* const demangled_name = name->Text(); if (demangled_name) { @@ -244,24 +247,35 @@ extern "C" int getFuncName( delete name; } } - - // Fallback: if demangling did not work, just provide the unmangled name. - if (p_name[0] == '\0') { - strncpy(p_name, buf, namelen-1); - p_name[namelen-1] = '\0'; - } - } else { strncpy(p_name, "", namelen-1); p_name[namelen-1] = '\0'; } } + // Return traceback table, if user wants it. if (p_tb) { (*p_tb) = tb; } - return 0; + return true; + +} + +bool AixSymbols::get_module_name(address pc, + char* p_name, size_t namelen) { + + if (p_name && namelen > 0) { + p_name[0] = '\0'; + loaded_module_t lm; + if (LoadedLibraries::find_for_text_address(pc, &lm) != NULL) { + strncpy(p_name, lm.shortname, namelen); + p_name[namelen - 1] = '\0'; + return true; + } + } + + return false; } // Special implementation of dladdr for Aix based on LoadedLibraries @@ -341,8 +355,8 @@ int dladdr(void* addr, Dl_info* info) { char funcname[256] = ""; int displacement = 0; - if (getFuncName((codeptr_t) p, funcname, sizeof(funcname), &displacement, - NULL, NULL, 0, false) == 0) { + if (AixSymbols::get_function_name(p, funcname, sizeof(funcname), + &displacement, NULL, true)) { if (funcname[0] != '\0') { const char* const interned = dladdr_fixed_strings.intern(funcname); info->dli_sname = interned; @@ -385,3 +399,414 @@ int dladdr(void* addr, Dl_info* info) { return rc; // error: return 0 [sic] } + +///////////////////////////////////////////////////////////////////////////// +// Native callstack dumping + +// Print the traceback table for one stack frame. +static void print_tbtable (outputStream* st, const struct tbtable* p_tb) { + + if (p_tb == NULL) { + st->print(""); + return; + } + + switch(p_tb->tb.lang) { + case TB_C: st->print("C"); break; + case TB_FORTRAN: st->print("FORTRAN"); break; + case TB_PASCAL: st->print("PASCAL"); break; + case TB_ADA: st->print("ADA"); break; + case TB_PL1: st->print("PL1"); break; + case TB_BASIC: st->print("BASIC"); break; + case TB_LISP: st->print("LISP"); break; + case TB_COBOL: st->print("COBOL"); break; + case TB_MODULA2: st->print("MODULA2"); break; + case TB_CPLUSPLUS: st->print("C++"); break; + case TB_RPG: st->print("RPG"); break; + case TB_PL8: st->print("PL8"); break; + case TB_ASM: st->print("ASM"); break; + case TB_HPJ: st->print("HPJ"); break; + default: st->print("unknown"); + } + st->print(" "); + + if (p_tb->tb.globallink) { + st->print("globallink "); + } + if (p_tb->tb.is_eprol) { + st->print("eprol "); + } + if (p_tb->tb.int_proc) { + st->print("int_proc "); + } + if (p_tb->tb.tocless) { + st->print("tocless "); + } + if (p_tb->tb.fp_present) { + st->print("fp_present "); + } + if (p_tb->tb.int_hndl) { + st->print("interrupt_handler "); + } + if (p_tb->tb.uses_alloca) { + st->print("uses_alloca "); + } + if (p_tb->tb.saves_cr) { + st->print("saves_cr "); + } + if (p_tb->tb.saves_lr) { + st->print("saves_lr "); + } + if (p_tb->tb.stores_bc) { + st->print("stores_bc "); + } + if (p_tb->tb.fixup) { + st->print("fixup "); + } + if (p_tb->tb.fpr_saved > 0) { + st->print("fpr_saved:%d ", p_tb->tb.fpr_saved); + } + if (p_tb->tb.gpr_saved > 0) { + st->print("gpr_saved:%d ", p_tb->tb.gpr_saved); + } + if (p_tb->tb.fixedparms > 0) { + st->print("fixedparms:%d ", p_tb->tb.fixedparms); + } + if (p_tb->tb.floatparms > 0) { + st->print("floatparms:%d ", p_tb->tb.floatparms); + } + if (p_tb->tb.parmsonstk > 0) { + st->print("parmsonstk:%d", p_tb->tb.parmsonstk); + } +} + +// Print information for pc (module, function, displacement, traceback table) +// on one line. +static void print_info_for_pc (outputStream* st, codeptr_t pc, char* buf, + size_t buf_size, bool demangle) { + const struct tbtable* tb = NULL; + int displacement = -1; + + if (!MiscUtils::is_readable_pointer(pc)) { + st->print("(invalid)"); + return; + } + + if (AixSymbols::get_module_name((address)pc, buf, buf_size)) { + st->print("%s", buf); + } else { + st->print("(unknown module)"); + } + st->print("::"); + if (AixSymbols::get_function_name((address)pc, buf, buf_size, + &displacement, &tb, demangle)) { + st->print("%s", buf); + } else { + st->print("(unknown function)"); + } + if (displacement == -1) { + st->print("+?"); + } else { + st->print("+0x%x", displacement); + } + if (tb) { + st->fill_to(64); + st->print(" ("); + print_tbtable(st, tb); + st->print(")"); + } +} + +static void print_stackframe(outputStream* st, stackptr_t sp, char* buf, + size_t buf_size, bool demangle) { + + stackptr_t sp2 = sp; + + // skip backchain + + sp2++; + + // skip crsave + + sp2++; + + // retrieve lrsave. That is the only info I need to get the function/displacement + + codeptr_t lrsave = (codeptr_t) *(sp2); + st->print (PTR64_FORMAT " - " PTR64_FORMAT " ", sp2, lrsave); + + if (lrsave != NULL) { + print_info_for_pc(st, lrsave, buf, buf_size, demangle); + } + +} + +// Function to check a given stack pointer against given stack limits. +static bool is_valid_stackpointer(stackptr_t sp, stackptr_t stack_base, size_t stack_size) { + if (((uintptr_t)sp) & 0x7) { + return false; + } + if (sp > stack_base) { + return false; + } + if (sp < (stackptr_t) ((address)stack_base - stack_size)) { + return false; + } + return true; +} + +// Returns true if function is a valid codepointer. +static bool is_valid_codepointer(codeptr_t p) { + if (!p) { + return false; + } + if (((uintptr_t)p) & 0x3) { + return false; + } + if (LoadedLibraries::find_for_text_address(p, NULL) == NULL) { + return false; + } + return true; +} + +// Function tries to guess if the given combination of stack pointer, stack base +// and stack size is a valid stack frame. +static bool is_valid_frame (stackptr_t p, stackptr_t stack_base, size_t stack_size) { + + if (!is_valid_stackpointer(p, stack_base, stack_size)) { + return false; + } + + // First check - the occurrence of a valid backchain pointer up the stack, followed by a + // valid codeptr, counts as a good candidate. + stackptr_t sp2 = (stackptr_t) *p; + if (is_valid_stackpointer(sp2, stack_base, stack_size) && // found a valid stack pointer in the stack... + ((sp2 - p) > 6) && // ... pointing upwards and not into my frame... + is_valid_codepointer((codeptr_t)(*(sp2 + 2)))) // ... followed by a code pointer after two slots... + { + return true; + } + + return false; +} + +// Try to relocate a stack back chain in a given stack. +// Used in callstack dumping, when the backchain is broken by an overwriter +static stackptr_t try_find_backchain (stackptr_t last_known_good_frame, + stackptr_t stack_base, size_t stack_size) +{ + if (!is_valid_stackpointer(last_known_good_frame, stack_base, stack_size)) { + return NULL; + } + + stackptr_t sp = last_known_good_frame; + + sp += 6; // Omit next fixed frame slots. + while (sp < stack_base) { + if (is_valid_frame(sp, stack_base, stack_size)) { + return sp; + } + sp ++; + } + + return NULL; +} + +static void decode_instructions_at_pc(const char* header, + codeptr_t pc, int num_before, + int num_after, outputStream* st) { + // TODO: PPC port Disassembler::decode(pc, 16, 16, st); +} + + +void AixNativeCallstack::print_callstack_for_context(outputStream* st, const ucontext_t* context, + bool demangle, char* buf, size_t buf_size) { + +#define MAX_CALLSTACK_DEPTH 50 + + unsigned long* sp; + unsigned long* sp_last; + int frame; + + // To print the first frame, use the current value of iar: + // current entry indicated by iar (the current pc) + codeptr_t cur_iar = 0; + stackptr_t cur_sp = 0; + codeptr_t cur_rtoc = 0; + codeptr_t cur_lr = 0; + + const ucontext_t* uc = (const ucontext_t*) context; + + // fallback: use the current context + ucontext_t local_context; + if (!uc) { + if (getcontext(&local_context) == 0) { + uc = &local_context; + } else { + st->print_cr("No context given and getcontext failed. "); + return; + } + } + + cur_iar = (codeptr_t)uc->uc_mcontext.jmp_context.iar; + cur_sp = (stackptr_t)uc->uc_mcontext.jmp_context.gpr[1]; + cur_rtoc = (codeptr_t)uc->uc_mcontext.jmp_context.gpr[2]; + cur_lr = (codeptr_t)uc->uc_mcontext.jmp_context.lr; + + // syntax used here: + // n -------------- <-- stack_base, stack_to + // n-1 | | + // ... | older | + // ... | frames | | + // | | | stack grows downward + // ... | younger | | + // ... | frames | V + // | | + // |------------| <-- cur_sp, current stack ptr + // | | + // | unsused | + // | stack | + // | | + // . . + // . . + // . . + // . . + // | | + // 0 -------------- <-- stack_from + // + + // Retrieve current stack base, size from the current thread. If there is none, + // retrieve it from the OS. + stackptr_t stack_base = NULL; + size_t stack_size = NULL; + Thread* const thread = Thread::current_or_null_safe(); + if (thread) { + stack_base = (stackptr_t) thread->stack_base(); + stack_size = thread->stack_size(); + } else { + stack_base = (stackptr_t) os::current_stack_base(); + stack_size = os::current_stack_size(); + } + + st->print_cr("------ current frame:"); + st->print("iar: " PTR64_FORMAT " ", p2i(cur_iar)); + print_info_for_pc(st, cur_iar, buf, buf_size, demangle); + st->cr(); + + if (cur_iar && MiscUtils::is_readable_pointer(cur_iar)) { + decode_instructions_at_pc( + "Decoded instructions at iar:", + cur_iar, 32, 16, st); + } + + // Print out lr too, which may be interesting if we did jump to some bogus location; + // in those cases the new frame is not built up yet and the caller location is only + // preserved via lr register. + st->print("lr: " PTR64_FORMAT " ", p2i(cur_lr)); + print_info_for_pc(st, cur_lr, buf, buf_size, demangle); + st->cr(); + + if (cur_lr && MiscUtils::is_readable_pointer(cur_lr)) { + decode_instructions_at_pc( + "Decoded instructions at lr:", + cur_lr, 32, 16, st); + } + + // Check and print sp. + st->print("sp: " PTR64_FORMAT " ", p2i(cur_sp)); + if (!is_valid_stackpointer(cur_sp, stack_base, stack_size)) { + st->print("(invalid) "); + goto cleanup; + } else { + st->print("(base - 0x%X) ", PTRDIFF_BYTES(stack_base, cur_sp)); + } + st->cr(); + + // Check and print rtoc. + st->print("rtoc: " PTR64_FORMAT " ", p2i(cur_rtoc)); + if (cur_rtoc == NULL || cur_rtoc == (codeptr_t)-1 || + !MiscUtils::is_readable_pointer(cur_rtoc)) { + st->print("(invalid)"); + } else if (((uintptr_t)cur_rtoc) & 0x7) { + st->print("(unaligned)"); + } + st->cr(); + + st->print_cr("|---stackaddr----| |----lrsave------|: "); + + /// + // Walk callstack. + // + // (if no context was given, use the current stack) + sp = (unsigned long*)(*(unsigned long*)cur_sp); // Stack pointer + sp_last = cur_sp; + + frame = 0; + + while (frame < MAX_CALLSTACK_DEPTH) { + + // Check sp. + bool retry = false; + if (sp == NULL) { + // The backchain pointer was NULL. This normally means the end of the chain. But the + // stack might be corrupted, and it may be worth looking for the stack chain. + if (is_valid_stackpointer(sp_last, stack_base, stack_size) && (stack_base - 0x10) > sp_last) { + // If we are not within 0x10 stackslots of the stack base, we assume that this + // is indeed not the end of the chain but that the stack was corrupted. So lets try to + // find the end of the chain. + st->print_cr("*** back chain pointer is NULL - end of stack or broken backchain ? ***"); + retry = true; + } else { + st->print_cr("*** end of backchain ***"); + goto end_walk_callstack; + } + } else if (!is_valid_stackpointer(sp, stack_base, stack_size)) { + st->print_cr("*** stack pointer invalid - backchain corrupted (" PTR_FORMAT ") ***", p2i(sp)); + retry = true; + } else if (sp < sp_last) { + st->print_cr("invalid stack pointer: " PTR_FORMAT " (not monotone raising)", p2i(sp)); + retry = true; + } + + // If backchain is broken, try to recover, by manually scanning the stack for a pattern + // which looks like a valid stack. + if (retry) { + st->print_cr("trying to recover and find backchain..."); + sp = try_find_backchain(sp_last, stack_base, stack_size); + if (sp) { + st->print_cr("found something which looks like a backchain at " PTR64_FORMAT ", after 0x%x bytes... ", + p2i(sp), PTRDIFF_BYTES(sp, sp_last)); + } else { + st->print_cr("did not find a backchain, giving up."); + goto end_walk_callstack; + } + } + + // Print stackframe. + print_stackframe(st, sp, buf, buf_size, demangle); + st->cr(); + frame ++; + + // Next stack frame and link area. + sp_last = sp; + sp = (unsigned long*)(*sp); + } + + // Prevent endless loops in case of invalid callstacks. + if (frame == MAX_CALLSTACK_DEPTH) { + st->print_cr("...(stopping after %d frames.", MAX_CALLSTACK_DEPTH); + } + +end_walk_callstack: + + st->print_cr("-----------------------"); + +cleanup: + + return; + +} + + + + diff --git a/hotspot/src/os/aix/vm/porting_aix.hpp b/hotspot/src/os/aix/vm/porting_aix.hpp index 6a004df5b8b..8da037cc187 100644 --- a/hotspot/src/os/aix/vm/porting_aix.hpp +++ b/hotspot/src/os/aix/vm/porting_aix.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 @@ -61,24 +61,37 @@ extern "C" #endif int dladdr(void *addr, Dl_info *info); -typedef unsigned int* codeptr_t; - struct tbtable; -// helper function - given a program counter, tries to locate the traceback table and -// returns info from it (like, most importantly, function name, displacement of the -// pc inside the function, and the traceback table itself. -#ifdef __cplusplus -extern "C" -#endif -int getFuncName( - codeptr_t pc, // [in] program counter - char* p_name, size_t namelen, // [out] optional: user provided buffer for the function name - int* p_displacement, // [out] optional: displacement - const struct tbtable** p_tb, // [out] optional: ptr to traceback table to get further information - char* p_errmsg, size_t errmsglen, // [out] optional: user provided buffer for error messages - bool demangle // [in] whether to demangle the name - ); +class AixSymbols { + public: + + // Given a program counter, tries to locate the traceback table and returns info from + // it - e.g. function name, displacement of the pc inside the function, and the traceback + // table itself. + static bool get_function_name ( + address pc, // [in] program counter + char* p_name, size_t namelen, // [out] optional: user provided buffer for the function name + int* p_displacement, // [out] optional: displacement + const struct tbtable** p_tb, // [out] optional: ptr to traceback table to get further information + bool demangle // [in] whether to demangle the name + ); + + // Given a program counter, returns the name of the module (library and module) the pc points to + static bool get_module_name ( + address pc, // [in] program counter + char* p_name, size_t namelen // [out] module name + ); + +}; + +class AixNativeCallstack { + public: + static void print_callstack_for_context(outputStream* st, const ucontext_t* uc, + bool demangle, + char* buf, size_t buf_size); +}; + #endif // OS_AIX_VM_PORTING_AIX_HPP diff --git a/hotspot/src/os/aix/vm/threadCritical_aix.cpp b/hotspot/src/os/aix/vm/threadCritical_aix.cpp index f2d651ff7e8..a5d893ba9f1 100644 --- a/hotspot/src/os/aix/vm/threadCritical_aix.cpp +++ b/hotspot/src/os/aix/vm/threadCritical_aix.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 SAP SE. 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 diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp index 664bd02b904..ca2ec1b1d02 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.cpp +++ b/hotspot/src/os/bsd/vm/os_bsd.cpp @@ -3481,7 +3481,7 @@ jint os::init_2(void) { os::Bsd::min_stack_allowed = MAX2(os::Bsd::min_stack_allowed, JavaThread::stack_guard_zone_size() + JavaThread::stack_shadow_zone_size() + - 2*BytesPerWord COMPILER2_PRESENT(+1) * Bsd::page_size()); + (2*BytesPerWord COMPILER2_PRESENT(+1)) * Bsd::page_size()); size_t threadStackSizeInBytes = ThreadStackSize * K; if (threadStackSizeInBytes != 0 && diff --git a/hotspot/src/os/bsd/vm/os_bsd.inline.hpp b/hotspot/src/os/bsd/vm/os_bsd.inline.hpp index 4a654614c2b..b4a89aa4d8f 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.inline.hpp +++ b/hotspot/src/os/bsd/vm/os_bsd.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, 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 @@ -68,7 +68,7 @@ inline void os::pd_split_reserved_memory(char *base, size_t size, // Bang the shadow pages if they need to be touched to be mapped. -inline void os::bang_stack_shadow_pages() { +inline void os::map_stack_shadow_pages() { } inline void os::dll_unload(void *lib) { diff --git a/hotspot/src/os/linux/vm/os_linux.inline.hpp b/hotspot/src/os/linux/vm/os_linux.inline.hpp index 7559cde3d00..935b7c3ebd0 100644 --- a/hotspot/src/os/linux/vm/os_linux.inline.hpp +++ b/hotspot/src/os/linux/vm/os_linux.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, 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 @@ -60,7 +60,7 @@ inline void os::pd_split_reserved_memory(char *base, size_t size, // Bang the shadow pages if they need to be touched to be mapped. -inline void os::bang_stack_shadow_pages() { +inline void os::map_stack_shadow_pages() { } inline void os::dll_unload(void *lib) { diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 2a88667f34b..ae008b6dbe9 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -819,19 +819,19 @@ static OSThread* create_os_thread(Thread* thread, thread_t thread_id) { void os::Solaris::hotspot_sigmask(Thread* thread) { //Save caller's signal mask sigset_t sigmask; - thr_sigsetmask(SIG_SETMASK, NULL, &sigmask); + pthread_sigmask(SIG_SETMASK, NULL, &sigmask); OSThread *osthread = thread->osthread(); osthread->set_caller_sigmask(sigmask); - thr_sigsetmask(SIG_UNBLOCK, os::Solaris::unblocked_signals(), NULL); + pthread_sigmask(SIG_UNBLOCK, os::Solaris::unblocked_signals(), NULL); if (!ReduceSignalUsage) { if (thread->is_VM_thread()) { // Only the VM thread handles BREAK_SIGNAL ... - thr_sigsetmask(SIG_UNBLOCK, vm_signals(), NULL); + pthread_sigmask(SIG_UNBLOCK, vm_signals(), NULL); } else { // ... all other threads block BREAK_SIGNAL assert(!sigismember(vm_signals(), SIGINT), "SIGINT should not be blocked"); - thr_sigsetmask(SIG_BLOCK, vm_signals(), NULL); + pthread_sigmask(SIG_BLOCK, vm_signals(), NULL); } } } @@ -1188,7 +1188,7 @@ void os::free_thread(OSThread* osthread) { if (Thread::current()->osthread() == osthread) { // Restore caller's signal mask sigset_t sigmask = osthread->caller_sigmask(); - thr_sigsetmask(SIG_SETMASK, &sigmask, NULL); + pthread_sigmask(SIG_SETMASK, &sigmask, NULL); } delete osthread; } @@ -3561,7 +3561,7 @@ void os::Solaris::SR_handler(Thread* thread, ucontext_t* uc) { sigset_t suspend_set; // signals for sigsuspend() // get current set of blocked signals and unblock resume signal - thr_sigsetmask(SIG_BLOCK, NULL, &suspend_set); + pthread_sigmask(SIG_BLOCK, NULL, &suspend_set); sigdelset(&suspend_set, os::Solaris::SIGasync()); sr_semaphore.signal(); @@ -3838,7 +3838,7 @@ static bool call_chained_handler(struct sigaction *actp, int sig, // try to honor the signal mask sigset_t oset; - thr_sigsetmask(SIG_SETMASK, &(actp->sa_mask), &oset); + pthread_sigmask(SIG_SETMASK, &(actp->sa_mask), &oset); // call into the chained handler if (siginfo_flag_set) { @@ -3848,7 +3848,7 @@ static bool call_chained_handler(struct sigaction *actp, int sig, } // restore the signal mask - thr_sigsetmask(SIG_SETMASK, &oset, 0); + pthread_sigmask(SIG_SETMASK, &oset, 0); } // Tell jvm's signal handler the signal is taken care of. return true; @@ -4415,7 +4415,7 @@ jint os::init_2(void) { os::Solaris::min_stack_allowed = MAX2(os::Solaris::min_stack_allowed, JavaThread::stack_guard_zone_size() + JavaThread::stack_shadow_zone_size() + - 2*BytesPerWord COMPILER2_PRESENT(+1) * page_size); + (2*BytesPerWord COMPILER2_PRESENT(+1)) * page_size); size_t threadStackSizeInBytes = ThreadStackSize * K; if (threadStackSizeInBytes != 0 && @@ -5492,7 +5492,7 @@ void Parker::park(bool isAbsolute, jlong time) { // (This allows a debugger to break into the running thread.) sigset_t oldsigs; sigset_t* allowdebug_blocked = os::Solaris::allowdebug_blocked_signals(); - thr_sigsetmask(SIG_BLOCK, allowdebug_blocked, &oldsigs); + pthread_sigmask(SIG_BLOCK, allowdebug_blocked, &oldsigs); #endif OSThreadWaitState osts(thread->osthread(), false /* not Object.wait() */); @@ -5519,7 +5519,7 @@ void Parker::park(bool isAbsolute, jlong time) { status, "cond_timedwait"); #ifdef ASSERT - thr_sigsetmask(SIG_SETMASK, &oldsigs, NULL); + pthread_sigmask(SIG_SETMASK, &oldsigs, NULL); #endif _counter = 0; status = os::Solaris::mutex_unlock(_mutex); @@ -5667,8 +5667,6 @@ bool os::is_headless_jre() { size_t os::write(int fd, const void *buf, unsigned int nBytes) { size_t res; - assert(((JavaThread*)Thread::current())->thread_state() == _thread_in_native, - "Assumed _thread_in_native"); RESTARTABLE((size_t) ::write(fd, buf, (size_t) nBytes), res); return res; } diff --git a/hotspot/src/os/solaris/vm/os_solaris.inline.hpp b/hotspot/src/os/solaris/vm/os_solaris.inline.hpp index 4ececaf1ceb..24f44704470 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.inline.hpp +++ b/hotspot/src/os/solaris/vm/os_solaris.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -61,7 +61,7 @@ inline void os::pd_split_reserved_memory(char *base, size_t size, // Bang the shadow pages if they need to be touched to be mapped. -inline void os::bang_stack_shadow_pages() { +inline void os::map_stack_shadow_pages() { } inline void os::dll_unload(void *lib) { ::dlclose(lib); } diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index 5229d1478bc..f0ab29c3486 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -3318,6 +3318,35 @@ bool os::remove_stack_guard_pages(char* addr, size_t size) { return os::uncommit_memory(addr, size); } +static bool protect_pages_individually(char* addr, size_t bytes, unsigned int p, DWORD *old_status) { + uint count = 0; + bool ret = false; + size_t bytes_remaining = bytes; + char * next_protect_addr = addr; + + // Use VirtualQuery() to get the chunk size. + while (bytes_remaining) { + MEMORY_BASIC_INFORMATION alloc_info; + if (VirtualQuery(next_protect_addr, &alloc_info, sizeof(alloc_info)) == 0) { + return false; + } + + size_t bytes_to_protect = MIN2(bytes_remaining, (size_t)alloc_info.RegionSize); + // We used different API at allocate_pages_individually() based on UseNUMAInterleaving, + // but we don't distinguish here as both cases are protected by same API. + ret = VirtualProtect(next_protect_addr, bytes_to_protect, p, old_status) != 0; + warning("Failed protecting pages individually for chunk #%u", count); + if (!ret) { + return false; + } + + bytes_remaining -= bytes_to_protect; + next_protect_addr += bytes_to_protect; + count++; + } + return ret; +} + // Set protections specified bool os::protect_memory(char* addr, size_t bytes, ProtType prot, bool is_committed) { @@ -3345,7 +3374,25 @@ bool os::protect_memory(char* addr, size_t bytes, ProtType prot, // Pages in the region become guard pages. Any attempt to access a guard page // causes the system to raise a STATUS_GUARD_PAGE exception and turn off // the guard page status. Guard pages thus act as a one-time access alarm. - return VirtualProtect(addr, bytes, p, &old_status) != 0; + bool ret; + if (UseNUMAInterleaving) { + // If UseNUMAInterleaving is enabled, the pages may have been allocated a chunk at a time, + // so we must protect the chunks individually. + ret = protect_pages_individually(addr, bytes, p, &old_status); + } else { + ret = VirtualProtect(addr, bytes, p, &old_status) != 0; + } +#ifdef ASSERT + if (!ret) { + int err = os::get_last_error(); + char buf[256]; + size_t buf_len = os::lasterror(buf, sizeof(buf)); + warning("INFO: os::protect_memory(" PTR_FORMAT ", " SIZE_FORMAT + ") failed; error='%s' (DOS error/errno=%d)", addr, bytes, + buf_len != 0 ? buf : "", err); + } +#endif + return ret; } bool os::guard_memory(char* addr, size_t bytes) { @@ -3768,6 +3815,7 @@ HINSTANCE os::win32::load_Windows_dll(const char* name, char *ebuf, return NULL; } +#define MAXIMUM_THREADS_TO_KEEP (16 * MAXIMUM_WAIT_OBJECTS) #define EXIT_TIMEOUT 300000 /* 5 minutes */ static BOOL CALLBACK init_crit_sect_call(PINIT_ONCE, PVOID pcrit_sect, PVOID*) { @@ -3786,7 +3834,7 @@ int os::win32::exit_process_or_thread(Ept what, int exit_code) { // _endthreadex(). // Should be large enough to avoid blocking the exiting thread due to lack of // a free slot. - static HANDLE handles[MAXIMUM_WAIT_OBJECTS]; + static HANDLE handles[MAXIMUM_THREADS_TO_KEEP]; static int handle_count = 0; static INIT_ONCE init_once_crit_sect = INIT_ONCE_STATIC_INIT; @@ -3800,6 +3848,11 @@ int os::win32::exit_process_or_thread(Ept what, int exit_code) { if (!InitOnceExecuteOnce(&init_once_crit_sect, init_crit_sect_call, &crit_sect, NULL)) { warning("crit_sect initialization failed in %s: %d\n", __FILE__, __LINE__); } else if (OrderAccess::load_acquire(&process_exiting) == 0) { + if (what != EPT_THREAD) { + // Atomically set process_exiting before the critical section + // to increase the visibility between racing threads. + Atomic::cmpxchg((jint)GetCurrentThreadId(), &process_exiting, 0); + } EnterCriticalSection(&crit_sect); if (what == EPT_THREAD && OrderAccess::load_acquire(&process_exiting) == 0) { @@ -3820,14 +3873,14 @@ int os::win32::exit_process_or_thread(Ept what, int exit_code) { // If there's no free slot in the array of the kept handles, we'll have to // wait until at least one thread completes exiting. - if ((handle_count = j) == MAXIMUM_WAIT_OBJECTS) { + if ((handle_count = j) == MAXIMUM_THREADS_TO_KEEP) { // Raise the priority of the oldest exiting thread to increase its chances // to complete sooner. SetThreadPriority(handles[0], THREAD_PRIORITY_ABOVE_NORMAL); res = WaitForMultipleObjects(MAXIMUM_WAIT_OBJECTS, handles, FALSE, EXIT_TIMEOUT); if (res >= WAIT_OBJECT_0 && res < (WAIT_OBJECT_0 + MAXIMUM_WAIT_OBJECTS)) { i = (res - WAIT_OBJECT_0); - handle_count = MAXIMUM_WAIT_OBJECTS - 1; + handle_count = MAXIMUM_THREADS_TO_KEEP - 1; for (; i < handle_count; ++i) { handles[i] = handles[i + 1]; } @@ -3836,7 +3889,7 @@ int os::win32::exit_process_or_thread(Ept what, int exit_code) { (res == WAIT_FAILED ? "failed" : "timed out"), GetLastError(), __FILE__, __LINE__); // Don't keep handles, if we failed waiting for them. - for (i = 0; i < MAXIMUM_WAIT_OBJECTS; ++i) { + for (i = 0; i < MAXIMUM_THREADS_TO_KEEP; ++i) { CloseHandle(handles[i]); } handle_count = 0; @@ -3857,42 +3910,59 @@ int os::win32::exit_process_or_thread(Ept what, int exit_code) { // The current exiting thread has stored its handle in the array, and now // should leave the critical section before calling _endthreadex(). - } else if (what != EPT_THREAD) { - if (handle_count > 0) { - // Before ending the process, make sure all the threads that had called - // _endthreadex() completed. + } else if (what != EPT_THREAD && handle_count > 0) { + jlong start_time, finish_time, timeout_left; + // Before ending the process, make sure all the threads that had called + // _endthreadex() completed. - // Set the priority level of the current thread to the same value as - // the priority level of exiting threads. - // This is to ensure it will be given a fair chance to execute if - // the timeout expires. - hthr = GetCurrentThread(); - SetThreadPriority(hthr, THREAD_PRIORITY_ABOVE_NORMAL); - for (i = 0; i < handle_count; ++i) { - SetThreadPriority(handles[i], THREAD_PRIORITY_ABOVE_NORMAL); + // Set the priority level of the current thread to the same value as + // the priority level of exiting threads. + // This is to ensure it will be given a fair chance to execute if + // the timeout expires. + hthr = GetCurrentThread(); + SetThreadPriority(hthr, THREAD_PRIORITY_ABOVE_NORMAL); + start_time = os::javaTimeNanos(); + finish_time = start_time + ((jlong)EXIT_TIMEOUT * 1000000L); + for (i = 0; ; ) { + int portion_count = handle_count - i; + if (portion_count > MAXIMUM_WAIT_OBJECTS) { + portion_count = MAXIMUM_WAIT_OBJECTS; } - res = WaitForMultipleObjects(handle_count, handles, TRUE, EXIT_TIMEOUT); + for (j = 0; j < portion_count; ++j) { + SetThreadPriority(handles[i + j], THREAD_PRIORITY_ABOVE_NORMAL); + } + timeout_left = (finish_time - start_time) / 1000000L; + if (timeout_left < 0) { + timeout_left = 0; + } + res = WaitForMultipleObjects(portion_count, handles + i, TRUE, timeout_left); if (res == WAIT_FAILED || res == WAIT_TIMEOUT) { warning("WaitForMultipleObjects %s (%u) in %s: %d\n", (res == WAIT_FAILED ? "failed" : "timed out"), GetLastError(), __FILE__, __LINE__); + // Reset portion_count so we close the remaining + // handles due to this error. + portion_count = handle_count - i; } - for (i = 0; i < handle_count; ++i) { - CloseHandle(handles[i]); + for (j = 0; j < portion_count; ++j) { + CloseHandle(handles[i + j]); } - handle_count = 0; + if ((i += portion_count) >= handle_count) { + break; + } + start_time = os::javaTimeNanos(); } - - OrderAccess::release_store(&process_exiting, 1); + handle_count = 0; } LeaveCriticalSection(&crit_sect); } - if (what == EPT_THREAD) { - while (OrderAccess::load_acquire(&process_exiting) != 0) { - // Some other thread is about to call exit(), so we - // don't let the current thread proceed to _endthreadex() + if (OrderAccess::load_acquire(&process_exiting) != 0 && + process_exiting != (jint)GetCurrentThreadId()) { + // Some other thread is about to call exit(), so we + // don't let the current thread proceed to exit() or _endthreadex() + while (true) { SuspendThread(GetCurrentThread()); // Avoid busy-wait loop, if SuspendThread() failed. Sleep(EXIT_TIMEOUT); diff --git a/hotspot/src/os/windows/vm/os_windows.inline.hpp b/hotspot/src/os/windows/vm/os_windows.inline.hpp index 09590cf9ca4..cf4a3005aae 100644 --- a/hotspot/src/os/windows/vm/os_windows.inline.hpp +++ b/hotspot/src/os/windows/vm/os_windows.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -66,7 +66,7 @@ inline int os::readdir_buf_size(const char *path) } // Bang the shadow pages if they need to be touched to be mapped. -inline void os::bang_stack_shadow_pages() { +inline void os::map_stack_shadow_pages() { // Write to each page of our new frame to force OS mapping. // If we decrement stack pointer more than one page // the OS may not map an intervening page into our space diff --git a/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp index d3afeeb399d..5cbb383f4b8 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014, SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 SAP SE. 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 diff --git a/hotspot/src/os_cpu/aix_ppc/vm/globals_aix_ppc.hpp b/hotspot/src/os_cpu/aix_ppc/vm/globals_aix_ppc.hpp index d705c869a16..c730ed269f8 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/globals_aix_ppc.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/globals_aix_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp b/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp index 71eb6ac9536..0c791f15772 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014, SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 SAP SE. 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 diff --git a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp index d89c28fa85b..f109a111047 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,6 +40,7 @@ #include "prims/jniFastGetField.hpp" #include "prims/jvm.h" #include "prims/jvm_misc.hpp" +#include "porting_aix.hpp" #include "runtime/arguments.hpp" #include "runtime/extendedPC.hpp" #include "runtime/frame.inline.hpp" @@ -579,3 +580,9 @@ int os::extra_bang_size_in_bytes() { return 0; } +bool os::platform_print_native_stack(outputStream* st, void* context, char *buf, int buf_size) { + AixNativeCallstack::print_callstack_for_context(st, (const ucontext_t*)context, true, buf, (size_t) buf_size); + return true; +} + + diff --git a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.hpp b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.hpp index 44fa7db3838..569445ed284 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,4 +32,8 @@ // Note: Currently only used in 64 bit Windows implementations static bool register_code_area(char *low, char *high) { return true; } +#define PLATFORM_PRINT_NATIVE_STACK 1 +static bool platform_print_native_stack(outputStream* st, void* context, + char *buf, int buf_size); + #endif // OS_CPU_AIX_PPC_VM_OS_AIX_PPC_HPP diff --git a/hotspot/src/os_cpu/aix_ppc/vm/prefetch_aix_ppc.inline.hpp b/hotspot/src/os_cpu/aix_ppc/vm/prefetch_aix_ppc.inline.hpp index 85c62b6640f..bcbb30d7b92 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/prefetch_aix_ppc.inline.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/prefetch_aix_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.cpp b/hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.cpp index 96a09b2787f..1ac366126db 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.cpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 SAP SE. 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 diff --git a/hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.hpp b/hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.hpp index 2ca7c861cc9..ca649130a7d 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/os_cpu/aix_ppc/vm/vmStructs_aix_ppc.hpp b/hotspot/src/os_cpu/aix_ppc/vm/vmStructs_aix_ppc.hpp index 7a29d8351b0..1dbcb8a7c93 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/vmStructs_aix_ppc.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/vmStructs_aix_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp index d9e1f5d84e0..c40ce1fbe4e 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014, SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 SAP SE. 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 diff --git a/hotspot/src/os_cpu/linux_ppc/vm/globals_linux_ppc.hpp b/hotspot/src/os_cpu/linux_ppc/vm/globals_linux_ppc.hpp index 50174b66d1c..1d995a9ee4c 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/globals_linux_ppc.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/globals_linux_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp b/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp index 9e414dcd805..3def90fefe2 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014, SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 SAP SE. 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 diff --git a/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp b/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp index f9401d13c9b..b7318c22c08 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. 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 diff --git a/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.hpp b/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.hpp index 26bfc14273e..73937ddac4d 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/os_cpu/linux_ppc/vm/prefetch_linux_ppc.inline.hpp b/hotspot/src/os_cpu/linux_ppc/vm/prefetch_linux_ppc.inline.hpp index c3b880f87ac..41d8445382c 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/prefetch_linux_ppc.inline.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/prefetch_linux_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp b/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp index 92661222b07..895fb25d3fa 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 SAP SE. 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 diff --git a/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.hpp b/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.hpp index 237070ec1fe..5caf4f33c16 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/os_cpu/linux_ppc/vm/vmStructs_linux_ppc.hpp b/hotspot/src/os_cpu/linux_ppc/vm/vmStructs_linux_ppc.hpp index d947186ec86..a0adde047d2 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/vmStructs_linux_ppc.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/vmStructs_linux_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/share/tools/hsdis/hsdis.c b/hotspot/src/share/tools/hsdis/hsdis.c index 3d038f1ecd9..8706163981c 100644 --- a/hotspot/src/share/tools/hsdis/hsdis.c +++ b/hotspot/src/share/tools/hsdis/hsdis.c @@ -125,15 +125,15 @@ decode_instructions(void* start_pv, void* end_pv, event_callback_t event_callback_arg, void* event_stream_arg, printf_callback_t printf_callback_arg, void* printf_stream_arg, const char* options) { - decode_instructions_virtual((uintptr_t)start_pv, - (uintptr_t)end_pv, - (unsigned char*)start_pv, - (uintptr_t)end_pv - (uintptr_t)start_pv, - event_callback_arg, - event_stream_arg, - printf_callback_arg, - printf_stream_arg, - options, false); + return decode_instructions_virtual((uintptr_t)start_pv, + (uintptr_t)end_pv, + (unsigned char*)start_pv, + (uintptr_t)end_pv - (uintptr_t)start_pv, + event_callback_arg, + event_stream_arg, + printf_callback_arg, + printf_stream_arg, + options, false); } static void* decode(struct hsdis_app_data* app_data, const char* options) { @@ -212,6 +212,7 @@ static const char* format_insn_close(const char* close, case dis_condjsr: type = "condjsr"; break; case dis_dref: type = "dref"; break; case dis_dref2: type = "dref2"; break; + case dis_noninsn: type = "noninsn"; break; } strcpy(buf, close); diff --git a/hotspot/src/share/vm/adlc/formssel.cpp b/hotspot/src/share/vm/adlc/formssel.cpp index 4e5fe365e52..d408c904c6c 100644 --- a/hotspot/src/share/vm/adlc/formssel.cpp +++ b/hotspot/src/share/vm/adlc/formssel.cpp @@ -4010,7 +4010,6 @@ int MatchRule::is_expensive() const { if( _rChild ) { const char *opType = _rChild->_opType; if( strcmp(opType,"AtanD")==0 || - strcmp(opType,"CosD")==0 || strcmp(opType,"DivD")==0 || strcmp(opType,"DivF")==0 || strcmp(opType,"DivI")==0 || @@ -4018,7 +4017,6 @@ int MatchRule::is_expensive() const { strcmp(opType,"ModD")==0 || strcmp(opType,"ModF")==0 || strcmp(opType,"ModI")==0 || - strcmp(opType,"SinD")==0 || strcmp(opType,"SqrtD")==0 || strcmp(opType,"TanD")==0 || strcmp(opType,"ConvD2F")==0 || diff --git a/hotspot/src/share/vm/asm/codeBuffer.cpp b/hotspot/src/share/vm/asm/codeBuffer.cpp index 30828b69751..0586fbe228b 100644 --- a/hotspot/src/share/vm/asm/codeBuffer.cpp +++ b/hotspot/src/share/vm/asm/codeBuffer.cpp @@ -535,7 +535,7 @@ static void append_oop_references(GrowableArray* oops, Klass* k) { } void CodeBuffer::finalize_oop_references(const methodHandle& mh) { - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; GrowableArray oops; diff --git a/hotspot/src/share/vm/c1/c1_Compilation.cpp b/hotspot/src/share/vm/c1/c1_Compilation.cpp index c8db6252c85..1a102cabe8b 100644 --- a/hotspot/src/share/vm/c1/c1_Compilation.cpp +++ b/hotspot/src/share/vm/c1/c1_Compilation.cpp @@ -420,8 +420,7 @@ void Compilation::install_code(int frame_size) { implicit_exception_table(), compiler(), has_unsafe_access(), - SharedRuntime::is_wide_vector(max_vector_size()), - directive() + SharedRuntime::is_wide_vector(max_vector_size()) ); } diff --git a/hotspot/src/share/vm/c1/c1_Compilation.hpp b/hotspot/src/share/vm/c1/c1_Compilation.hpp index f9f6eca889c..3bc07da9f7d 100644 --- a/hotspot/src/share/vm/c1/c1_Compilation.hpp +++ b/hotspot/src/share/vm/c1/c1_Compilation.hpp @@ -28,6 +28,7 @@ #include "ci/ciEnv.hpp" #include "ci/ciMethodData.hpp" #include "code/exceptionHandlerTable.hpp" +#include "compiler/compilerDirectives.hpp" #include "memory/resourceArea.hpp" #include "runtime/deoptimization.hpp" diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp index 952ce683db7..b2766898d71 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp @@ -1748,10 +1748,6 @@ void GraphBuilder::invoke(Bytecodes::Code code) { const Bytecodes::Code bc_raw = stream()->cur_bc_raw(); assert(declared_signature != NULL, "cannot be null"); - if (!C1PatchInvokeDynamic && Bytecodes::has_optional_appendix(bc_raw) && !will_link) { - BAILOUT("unlinked call site (C1PatchInvokeDynamic is off)"); - } - // we have to make sure the argument size (incl. the receiver) // is correct for compilation (the call would fail later during // linkage anyway) - was bug (gri 7/28/99) @@ -1803,8 +1799,7 @@ void GraphBuilder::invoke(Bytecodes::Code code) { // Push appendix argument (MethodType, CallSite, etc.), if one. bool patch_for_appendix = false; int patching_appendix_arg = 0; - if (C1PatchInvokeDynamic && - (Bytecodes::has_optional_appendix(bc_raw) && (!will_link || PatchALot))) { + if (Bytecodes::has_optional_appendix(bc_raw) && (!will_link || PatchALot)) { Value arg = append(new Constant(new ObjectConstant(compilation()->env()->unloaded_ciinstance()), copy_state_before())); apush(arg); patch_for_appendix = true; diff --git a/hotspot/src/share/vm/c1/c1_LIR.cpp b/hotspot/src/share/vm/c1/c1_LIR.cpp index 8397df6a048..6077c282472 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.cpp +++ b/hotspot/src/share/vm/c1/c1_LIR.cpp @@ -729,8 +729,6 @@ void LIR_OpVisitState::visit(LIR_Op* op) { case lir_tan: - case lir_sin: - case lir_cos: case lir_log10: { assert(op->as_Op2() != NULL, "must be"); LIR_Op2* op2 = (LIR_Op2*)op; @@ -1740,8 +1738,6 @@ const char * LIR_Op::name() const { case lir_rem: s = "rem"; break; case lir_abs: s = "abs"; break; case lir_sqrt: s = "sqrt"; break; - case lir_sin: s = "sin"; break; - case lir_cos: s = "cos"; break; case lir_tan: s = "tan"; break; case lir_log10: s = "log10"; break; case lir_logic_and: s = "logic_and"; break; diff --git a/hotspot/src/share/vm/c1/c1_LIR.hpp b/hotspot/src/share/vm/c1/c1_LIR.hpp index ade1fbd31cc..c5e52dec265 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.hpp +++ b/hotspot/src/share/vm/c1/c1_LIR.hpp @@ -958,8 +958,6 @@ enum LIR_Code { , lir_rem , lir_sqrt , lir_abs - , lir_sin - , lir_cos , lir_tan , lir_log10 , lir_logic_and @@ -2194,8 +2192,6 @@ class LIR_List: public CompilationResourceObj { void abs (LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_abs , from, tmp, to)); } void sqrt(LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_sqrt, from, tmp, to)); } void log10 (LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_log10, from, LIR_OprFact::illegalOpr, to, tmp)); } - void sin (LIR_Opr from, LIR_Opr to, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_Op2(lir_sin , from, tmp1, to, tmp2)); } - void cos (LIR_Opr from, LIR_Opr to, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_Op2(lir_cos , from, tmp1, to, tmp2)); } void tan (LIR_Opr from, LIR_Opr to, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_Op2(lir_tan , from, tmp1, to, tmp2)); } void add (LIR_Opr left, LIR_Opr right, LIR_Opr res) { append(new LIR_Op2(lir_add, left, right, res)); } diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp index 4d016513ee7..7f33a2c4d22 100644 --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp @@ -736,9 +736,7 @@ void LIR_Assembler::emit_op2(LIR_Op2* op) { case lir_abs: case lir_sqrt: - case lir_sin: case lir_tan: - case lir_cos: case lir_log10: intrinsic_op(op->code(), op->in_opr1(), op->in_opr2(), op->result_opr(), op); break; diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp index f474b00d20b..cda969cb4b8 100644 --- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp +++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp @@ -6599,8 +6599,6 @@ void LinearScanStatistic::collect(LinearScan* allocator) { case lir_div_strictfp: case lir_rem: case lir_sqrt: - case lir_sin: - case lir_cos: case lir_abs: case lir_log10: case lir_logic_and: diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index 4896b13752b..92c721575d0 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, 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 @@ -321,6 +321,8 @@ const char* Runtime1::name_for_address(address entry) { FUNCTION_CASE(entry, StubRoutines::dexp()); FUNCTION_CASE(entry, StubRoutines::dlog()); FUNCTION_CASE(entry, StubRoutines::dpow()); + FUNCTION_CASE(entry, StubRoutines::dsin()); + FUNCTION_CASE(entry, StubRoutines::dcos()); #undef FUNCTION_CASE @@ -552,12 +554,11 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t // tracing if (log_is_enabled(Info, exceptions)) { ResourceMark rm; - log_info(exceptions)("Exception <%s> (" INTPTR_FORMAT - ") thrown in compiled method <%s> at PC " INTPTR_FORMAT - " for thread " INTPTR_FORMAT, - exception->print_value_string(), - p2i((address)exception()), - nm->method()->print_value_string(), p2i(pc), p2i(thread)); + stringStream tempst; + tempst.print("compiled method <%s>\n" + " at PC" INTPTR_FORMAT " for thread " INTPTR_FORMAT, + nm->method()->print_value_string(), p2i(pc), p2i(thread)); + Exceptions::log_exception(exception, tempst); } // for AbortVMOnException flag Exceptions::debug_check_abort(exception); @@ -956,16 +957,19 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i constantPoolHandle pool(thread, caller_method->constants()); int index = bytecode.index(); LinkResolver::resolve_invoke(info, Handle(), pool, index, bc, CHECK); - appendix = info.resolved_appendix(); switch (bc) { case Bytecodes::_invokehandle: { int cache_index = ConstantPool::decode_cpcache_index(index, true); assert(cache_index >= 0 && cache_index < pool->cache()->length(), "unexpected cache index"); - pool->cache()->entry_at(cache_index)->set_method_handle(pool, info); + ConstantPoolCacheEntry* cpce = pool->cache()->entry_at(cache_index); + cpce->set_method_handle(pool, info); + appendix = cpce->appendix_if_resolved(pool); // just in case somebody already resolved the entry break; } case Bytecodes::_invokedynamic: { - pool->invokedynamic_cp_cache_entry_at(index)->set_dynamic_call(pool, info); + ConstantPoolCacheEntry* cpce = pool->invokedynamic_cp_cache_entry_at(index); + cpce->set_dynamic_call(pool, info); + appendix = cpce->appendix_if_resolved(pool); // just in case somebody already resolved the entry break; } default: fatal("unexpected bytecode for load_appendix_patching_id"); @@ -1032,6 +1036,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i address copy_buff = stub_location - *byte_skip - *byte_count; address being_initialized_entry = stub_location - *being_initialized_entry_offset; if (TracePatching) { + ttyLocker ttyl; tty->print_cr(" Patching %s at bci %d at address " INTPTR_FORMAT " (%s)", Bytecodes::name(code), bci, p2i(instr_pc), (stub_id == Runtime1::access_field_patching_id) ? "field" : "klass"); nmethod* caller_code = CodeCache::find_nmethod(caller_frame.pc()); diff --git a/hotspot/src/share/vm/c1/c1_globals.hpp b/hotspot/src/share/vm/c1/c1_globals.hpp index 3cdcfc2ed38..ad6548e4928 100644 --- a/hotspot/src/share/vm/c1/c1_globals.hpp +++ b/hotspot/src/share/vm/c1/c1_globals.hpp @@ -341,9 +341,6 @@ develop(bool, PrintCFGToFile, false, \ "print control flow graph to a separate file during compilation") \ \ - diagnostic(bool, C1PatchInvokeDynamic, true, \ - "Patch invokedynamic appendix not known at compile time") \ - \ // Read default values for c1 globals C1_FLAGS(DECLARE_DEVELOPER_FLAG, \ diff --git a/hotspot/src/share/vm/ci/ciEnv.cpp b/hotspot/src/share/vm/ci/ciEnv.cpp index 9c9d7b300c2..2775c6776f5 100644 --- a/hotspot/src/share/vm/ci/ciEnv.cpp +++ b/hotspot/src/share/vm/ci/ciEnv.cpp @@ -38,7 +38,6 @@ #include "code/scopeDesc.hpp" #include "compiler/compileBroker.hpp" #include "compiler/compileLog.hpp" -#include "compiler/compilerDirectives.hpp" #include "compiler/disassembler.hpp" #include "gc/shared/collectedHeap.inline.hpp" #include "interpreter/linkResolver.hpp" @@ -959,7 +958,6 @@ void ciEnv::register_method(ciMethod* target, AbstractCompiler* compiler, bool has_unsafe_access, bool has_wide_vectors, - DirectiveSet* directives, RTMState rtm_state) { VM_ENTRY_MARK; nmethod* nm = NULL; @@ -971,7 +969,7 @@ void ciEnv::register_method(ciMethod* target, // and invalidating our dependencies until we install this method. // No safepoints are allowed. Otherwise, class redefinition can occur in between. MutexLocker ml(Compile_lock); - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; // Change in Jvmti state may invalidate compilation. if (!failing() && jvmti_state_changed()) { @@ -1041,14 +1039,6 @@ void ciEnv::register_method(ciMethod* target, code_buffer->free_blob(); if (nm != NULL) { - bool printnmethods = directives->PrintAssemblyOption || directives->PrintNMethodsOption; - if (printnmethods || PrintDebugInfo || PrintRelocations || PrintDependencies || PrintExceptionHandlers) { - nm->print_nmethod(printnmethods); - } - if (directives->PrintAssemblyOption) { - Disassembler::decode(nm); - } - nm->set_has_unsafe_access(has_unsafe_access); nm->set_has_wide_vectors(has_wide_vectors); #if INCLUDE_RTM_OPT diff --git a/hotspot/src/share/vm/ci/ciEnv.hpp b/hotspot/src/share/vm/ci/ciEnv.hpp index b1a95bd38f6..cd7138d33b2 100644 --- a/hotspot/src/share/vm/ci/ciEnv.hpp +++ b/hotspot/src/share/vm/ci/ciEnv.hpp @@ -32,11 +32,9 @@ #include "code/dependencies.hpp" #include "code/exceptionHandlerTable.hpp" #include "compiler/oopMap.hpp" -#include "compiler/compilerDirectives.hpp" #include "runtime/thread.hpp" class CompileTask; -class DirectiveSet; // ciEnv // @@ -372,7 +370,6 @@ public: AbstractCompiler* compiler, bool has_unsafe_access, bool has_wide_vectors, - DirectiveSet* directives, RTMState rtm_state = NoRTM); diff --git a/hotspot/src/share/vm/ci/ciInstance.hpp b/hotspot/src/share/vm/ci/ciInstance.hpp index acff37f1e71..a33aabbc0ce 100644 --- a/hotspot/src/share/vm/ci/ciInstance.hpp +++ b/hotspot/src/share/vm/ci/ciInstance.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, 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 @@ -39,7 +39,7 @@ class ciInstance : public ciObject { protected: ciInstance(instanceHandle h_i) : ciObject(h_i) { - assert(h_i()->is_instance(), "wrong type"); + assert(h_i()->is_instance_noinline(), "wrong type"); } ciInstance(ciKlass* klass) : ciObject(klass) {} diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp index b0d3234af6e..d55d272842d 100644 --- a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp @@ -174,7 +174,6 @@ public: return 2; } } - bool has_default_methods() { assert(is_loaded(), "must be loaded"); return _has_default_methods; @@ -261,6 +260,11 @@ public: return NULL; } + bool can_be_instantiated() { + assert(is_loaded(), "must be loaded"); + return !is_interface() && !is_abstract(); + } + // Dump the current state of this klass for compilation replay. virtual void dump_replay_data(outputStream* out); }; diff --git a/hotspot/src/share/vm/ci/ciTypeFlow.cpp b/hotspot/src/share/vm/ci/ciTypeFlow.cpp index a1675d17a14..2edfa7d4abe 100644 --- a/hotspot/src/share/vm/ci/ciTypeFlow.cpp +++ b/hotspot/src/share/vm/ci/ciTypeFlow.cpp @@ -2930,7 +2930,7 @@ bool ciTypeFlow::is_dominated_by(int bci, int dom_bci) { } // Dominated[i] is true if block i is dominated by dom_block - int num_blocks = _methodBlocks->num_blocks(); + int num_blocks = block_count(); bool* dominated = NEW_RESOURCE_ARRAY(bool, num_blocks); for (int i = 0; i < num_blocks; ++i) { dominated[i] = true; diff --git a/hotspot/src/share/vm/classfile/altHashing.cpp b/hotspot/src/share/vm/classfile/altHashing.cpp index efa3edb2ca9..326351a6637 100644 --- a/hotspot/src/share/vm/classfile/altHashing.cpp +++ b/hotspot/src/share/vm/classfile/altHashing.cpp @@ -300,4 +300,8 @@ void AltHashing::test_alt_hash() { testMurmur3_32_ByteArray(); testEquivalentHashes(); } + +void AltHashing_test() { + AltHashing::test_alt_hash(); +} #endif // PRODUCT diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index 48bb73b41da..0891794a931 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -863,7 +863,7 @@ void ClassFileParser::parse_interfaces(const ClassFileStream* const stream, initialize_hashtable(interface_names); bool dup = false; { - debug_only(No_Safepoint_Verifier nsv;) + debug_only(NoSafepointVerifier nsv;) for (index = 0; index < itfs_len; index++) { const Klass* const k = _local_interfaces->at(index); const Symbol* const name = InstanceKlass::cast(k)->name(); @@ -1620,7 +1620,7 @@ void ClassFileParser::parse_fields(const ClassFileStream* const cfs, initialize_hashtable(names_and_sigs); bool dup = false; { - debug_only(No_Safepoint_Verifier nsv;) + debug_only(NoSafepointVerifier nsv;) for (AllFieldStream fs(_fields, cp); !fs.done(); fs.next()) { const Symbol* const name = fs.name(); const Symbol* const sig = fs.signature(); @@ -2885,7 +2885,7 @@ void ClassFileParser::parse_methods(const ClassFileStream* const cfs, initialize_hashtable(names_and_sigs); bool dup = false; { - debug_only(No_Safepoint_Verifier nsv;) + debug_only(NoSafepointVerifier nsv;) for (int i = 0; i < length; i++) { const Method* const m = _methods->at(i); // If no duplicates, add name/signature in hashtable names_and_sigs. diff --git a/hotspot/src/share/vm/classfile/classLoader.cpp b/hotspot/src/share/vm/classfile/classLoader.cpp index 8a2597f515e..3881be599a7 100644 --- a/hotspot/src/share/vm/classfile/classLoader.cpp +++ b/hotspot/src/share/vm/classfile/classLoader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -43,6 +43,7 @@ #include "memory/universe.inline.hpp" #include "oops/instanceKlass.hpp" #include "oops/instanceRefKlass.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "oops/symbol.hpp" #include "prims/jvm_misc.hpp" diff --git a/hotspot/src/share/vm/classfile/classLoaderData.cpp b/hotspot/src/share/vm/classfile/classLoaderData.cpp index 7415ab64ba6..31de9b4836f 100644 --- a/hotspot/src/share/vm/classfile/classLoaderData.cpp +++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp @@ -574,9 +574,9 @@ ClassLoaderData* ClassLoaderDataGraph::add(Handle loader, bool is_anonymous, TRA // actual ClassLoaderData object. ClassLoaderData::Dependencies dependencies(CHECK_NULL); - No_Safepoint_Verifier no_safepoints; // we mustn't GC until we've installed the - // ClassLoaderData in the graph since the CLD - // contains unhandled oops + NoSafepointVerifier no_safepoints; // we mustn't GC until we've installed the + // ClassLoaderData in the graph since the CLD + // contains unhandled oops ClassLoaderData* cld = new ClassLoaderData(loader, is_anonymous, dependencies); diff --git a/hotspot/src/share/vm/classfile/classLoaderData.hpp b/hotspot/src/share/vm/classfile/classLoaderData.hpp index 4d4b9d48e41..d208fde85fb 100644 --- a/hotspot/src/share/vm/classfile/classLoaderData.hpp +++ b/hotspot/src/share/vm/classfile/classLoaderData.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -275,9 +275,7 @@ class ClassLoaderData : public CHeapObj { // Used to make sure that this CLD is not unloaded. void set_keep_alive(bool value) { _keep_alive = value; } - unsigned int identity_hash() const { - return _class_loader == NULL ? 0 : _class_loader->identity_hash(); - } + inline unsigned int identity_hash() const; // Used when tracing from klasses. void oops_do(OopClosure* f, KlassClosure* klass_closure, bool must_claim); diff --git a/hotspot/src/share/vm/classfile/classLoaderData.inline.hpp b/hotspot/src/share/vm/classfile/classLoaderData.inline.hpp index 11014f25cbb..2427838890f 100644 --- a/hotspot/src/share/vm/classfile/classLoaderData.inline.hpp +++ b/hotspot/src/share/vm/classfile/classLoaderData.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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 @@ -24,6 +24,11 @@ #include "classfile/classLoaderData.hpp" #include "classfile/javaClasses.hpp" +#include "oops/oop.inline.hpp" + +unsigned int ClassLoaderData::identity_hash() const { + return _class_loader == NULL ? 0 : _class_loader->identity_hash(); +} inline ClassLoaderData* ClassLoaderData::class_loader_data_or_null(oop loader) { if (loader == NULL) { diff --git a/hotspot/src/share/vm/classfile/dictionary.cpp b/hotspot/src/share/vm/classfile/dictionary.cpp index fde1bb4c6c7..6f70ef9b47e 100644 --- a/hotspot/src/share/vm/classfile/dictionary.cpp +++ b/hotspot/src/share/vm/classfile/dictionary.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, 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 @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "classfile/classLoaderData.inline.hpp" #include "classfile/sharedClassUtil.hpp" #include "classfile/dictionary.hpp" #include "classfile/systemDictionary.hpp" @@ -500,6 +501,15 @@ void Dictionary::reorder_dictionary() { } } + +unsigned int ProtectionDomainCacheTable::compute_hash(oop protection_domain) { + return (unsigned int)(protection_domain->identity_hash()); +} + +int ProtectionDomainCacheTable::index_for(oop protection_domain) { + return hash_to_index(compute_hash(protection_domain)); +} + ProtectionDomainCacheTable::ProtectionDomainCacheTable(int table_size) : Hashtable(table_size, sizeof(ProtectionDomainCacheEntry)) { diff --git a/hotspot/src/share/vm/classfile/dictionary.hpp b/hotspot/src/share/vm/classfile/dictionary.hpp index 1f308578220..a77f33717f3 100644 --- a/hotspot/src/share/vm/classfile/dictionary.hpp +++ b/hotspot/src/share/vm/classfile/dictionary.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, 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 @@ -196,14 +196,9 @@ private: return entry; } - static unsigned int compute_hash(oop protection_domain) { - return (unsigned int)(protection_domain->identity_hash()); - } - - int index_for(oop protection_domain) { - return hash_to_index(compute_hash(protection_domain)); - } + static unsigned int compute_hash(oop protection_domain); + int index_for(oop protection_domain); ProtectionDomainCacheEntry* add_entry(int index, unsigned int hash, oop protection_domain); ProtectionDomainCacheEntry* find_entry(int index, oop protection_domain); diff --git a/hotspot/src/share/vm/classfile/javaAssertions.cpp b/hotspot/src/share/vm/classfile/javaAssertions.cpp index 800cdbef2c0..5c3c8c9c0e3 100644 --- a/hotspot/src/share/vm/classfile/javaAssertions.cpp +++ b/hotspot/src/share/vm/classfile/javaAssertions.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,7 @@ #include "classfile/vmSymbols.hpp" #include "memory/allocation.inline.hpp" #include "memory/oopFactory.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/handles.inline.hpp" diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp index b80899d324a..acd365cc025 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.cpp +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp @@ -1524,7 +1524,7 @@ class BacktraceBuilder: public StackObj { objArrayOop _mirrors; typeArrayOop _cprefs; // needed to insulate method name against redefinition int _index; - No_Safepoint_Verifier _nsv; + NoSafepointVerifier _nsv; public: @@ -1583,7 +1583,7 @@ class BacktraceBuilder: public StackObj { void expand(TRAPS) { objArrayHandle old_head(THREAD, _head); - Pause_No_Safepoint_Verifier pnsv(&_nsv); + PauseNoSafepointVerifier pnsv(&_nsv); objArrayOop head = oopFactory::new_objectArray(trace_size, CHECK); objArrayHandle new_head(THREAD, head); @@ -1784,6 +1784,20 @@ void java_lang_Throwable::print_stack_trace(Handle throwable, outputStream* st) } } +/** + * Print the throwable stack trace by calling the Java method java.lang.Throwable.printStackTrace(). + */ +void java_lang_Throwable::java_printStackTrace(Handle throwable, TRAPS) { + assert(throwable->is_a(SystemDictionary::Throwable_klass()), "Throwable instance expected"); + JavaValue result(T_VOID); + JavaCalls::call_virtual(&result, + throwable, + KlassHandle(THREAD, SystemDictionary::Throwable_klass()), + vmSymbols::printStackTrace_name(), + vmSymbols::void_method_signature(), + THREAD); +} + void java_lang_Throwable::fill_in_stack_trace(Handle throwable, const methodHandle& method, TRAPS) { if (!StackTraceInThrowable) return; ResourceMark rm(THREAD); diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp index 3ac5b4191ea..9f7c2d1233a 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.hpp +++ b/hotspot/src/share/vm/classfile/javaClasses.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -60,12 +60,7 @@ class java_lang_String : AllStatic { static Handle basic_create(int length, bool byte_arr, TRAPS); - static void set_coder(oop string, jbyte coder) { - assert(initialized, "Must be initialized"); - if (coder_offset > 0) { - string->byte_field_put(coder_offset, coder); - } - } + static inline void set_coder(oop string, jbyte coder); public: @@ -110,55 +105,15 @@ class java_lang_String : AllStatic { return coder_offset; } - static void set_value_raw(oop string, typeArrayOop buffer) { - assert(initialized, "Must be initialized"); - string->obj_field_put_raw(value_offset, buffer); - } - static void set_value(oop string, typeArrayOop buffer) { - assert(initialized && (value_offset > 0), "Must be initialized"); - string->obj_field_put(value_offset, (oop)buffer); - } - static void set_hash(oop string, unsigned int hash) { - assert(initialized && (hash_offset > 0), "Must be initialized"); - string->int_field_put(hash_offset, hash); - } + static inline void set_value_raw(oop string, typeArrayOop buffer); + static inline void set_value(oop string, typeArrayOop buffer); + static inline void set_hash(oop string, unsigned int hash); // Accessors - static typeArrayOop value(oop java_string) { - assert(initialized && (value_offset > 0), "Must be initialized"); - assert(is_instance(java_string), "must be java_string"); - return (typeArrayOop) java_string->obj_field(value_offset); - } - static unsigned int hash(oop java_string) { - assert(initialized && (hash_offset > 0), "Must be initialized"); - assert(is_instance(java_string), "must be java_string"); - return java_string->int_field(hash_offset); - } - static bool is_latin1(oop java_string) { - assert(initialized, "Must be initialized"); - assert(is_instance(java_string), "must be java_string"); - if (coder_offset > 0) { - jbyte coder = java_string->byte_field(coder_offset); - assert(CompactStrings || coder == CODER_UTF16, "Must be UTF16 without CompactStrings"); - return coder == CODER_LATIN1; - } else { - return false; - } - } - static int length(oop java_string) { - assert(initialized, "Must be initialized"); - assert(is_instance(java_string), "must be java_string"); - typeArrayOop value_array = ((typeArrayOop)java_string->obj_field(value_offset)); - if (value_array == NULL) { - return 0; - } - int arr_length = value_array->length(); - if (!is_latin1(java_string)) { - assert((arr_length & 1) == 0, "should be even for UTF16 string"); - arr_length >>= 1; // convert number of bytes to number of elements - } - return arr_length; - } + static inline typeArrayOop value(oop java_string); + static inline unsigned int hash(oop java_string); + static inline bool is_latin1(oop java_string); + static inline int length(oop java_string); static int utf8_length(oop java_string); // String converters @@ -219,7 +174,7 @@ class java_lang_String : AllStatic { // Testers static bool is_instance(oop obj); - static bool is_instance_inlined(oop obj); + static inline bool is_instance_inlined(oop obj); // Debugging static void print(oop java_string, outputStream* st); @@ -554,6 +509,7 @@ class java_lang_Throwable: AllStatic { // Printing static void print(Handle throwable, outputStream* st); static void print_stack_trace(Handle throwable, outputStream* st); + static void java_printStackTrace(Handle throwable, TRAPS); // Debugging friend class JavaClasses; }; @@ -910,42 +866,19 @@ class java_lang_ref_Reference: AllStatic { static int number_of_fake_oop_fields; // Accessors - static oop referent(oop ref) { - return ref->obj_field(referent_offset); - } - static void set_referent(oop ref, oop value) { - ref->obj_field_put(referent_offset, value); - } - static void set_referent_raw(oop ref, oop value) { - ref->obj_field_put_raw(referent_offset, value); - } - static HeapWord* referent_addr(oop ref) { - return ref->obj_field_addr(referent_offset); - } - static oop next(oop ref) { - return ref->obj_field(next_offset); - } - static void set_next(oop ref, oop value) { - ref->obj_field_put(next_offset, value); - } - static void set_next_raw(oop ref, oop value) { - ref->obj_field_put_raw(next_offset, value); - } - static HeapWord* next_addr(oop ref) { - return ref->obj_field_addr(next_offset); - } - static oop discovered(oop ref) { - return ref->obj_field(discovered_offset); - } - static void set_discovered(oop ref, oop value) { - ref->obj_field_put(discovered_offset, value); - } - static void set_discovered_raw(oop ref, oop value) { - ref->obj_field_put_raw(discovered_offset, value); - } - static HeapWord* discovered_addr(oop ref) { - return ref->obj_field_addr(discovered_offset); - } + static inline oop referent(oop ref); + static inline void set_referent(oop ref, oop value); + static inline void set_referent_raw(oop ref, oop value); + static inline HeapWord* referent_addr(oop ref); + static inline oop next(oop ref); + static inline void set_next(oop ref, oop value); + static inline void set_next_raw(oop ref, oop value); + static inline HeapWord* next_addr(oop ref); + static inline oop discovered(oop ref); + static inline void set_discovered(oop ref, oop value); + static inline void set_discovered_raw(oop ref, oop value); + static inline HeapWord* discovered_addr(oop ref); + // Accessors for statics static oop pending_list_lock(); static oop pending_list(); diff --git a/hotspot/src/share/vm/classfile/javaClasses.inline.hpp b/hotspot/src/share/vm/classfile/javaClasses.inline.hpp index ac35ccb8439..05deb981ba1 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.inline.hpp +++ b/hotspot/src/share/vm/classfile/javaClasses.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,105 @@ #include "oops/oop.inline.hpp" #include "oops/oopsHierarchy.hpp" +void java_lang_String::set_coder(oop string, jbyte coder) { + assert(initialized, "Must be initialized"); + if (coder_offset > 0) { + string->byte_field_put(coder_offset, coder); + } +} + +void java_lang_String::set_value_raw(oop string, typeArrayOop buffer) { + assert(initialized, "Must be initialized"); + string->obj_field_put_raw(value_offset, buffer); +} +void java_lang_String::set_value(oop string, typeArrayOop buffer) { + assert(initialized && (value_offset > 0), "Must be initialized"); + string->obj_field_put(value_offset, (oop)buffer); +} +void java_lang_String::set_hash(oop string, unsigned int hash) { + assert(initialized && (hash_offset > 0), "Must be initialized"); + string->int_field_put(hash_offset, hash); +} + +// Accessors +typeArrayOop java_lang_String::value(oop java_string) { + assert(initialized && (value_offset > 0), "Must be initialized"); + assert(is_instance(java_string), "must be java_string"); + return (typeArrayOop) java_string->obj_field(value_offset); +} +unsigned int java_lang_String::hash(oop java_string) { + assert(initialized && (hash_offset > 0), "Must be initialized"); + assert(is_instance(java_string), "must be java_string"); + return java_string->int_field(hash_offset); +} +bool java_lang_String::is_latin1(oop java_string) { + assert(initialized, "Must be initialized"); + assert(is_instance(java_string), "must be java_string"); + if (coder_offset > 0) { + jbyte coder = java_string->byte_field(coder_offset); + assert(CompactStrings || coder == CODER_UTF16, "Must be UTF16 without CompactStrings"); + return coder == CODER_LATIN1; + } else { + return false; + } +} +int java_lang_String::length(oop java_string) { + assert(initialized, "Must be initialized"); + assert(is_instance(java_string), "must be java_string"); + typeArrayOop value_array = ((typeArrayOop)java_string->obj_field(value_offset)); + if (value_array == NULL) { + return 0; + } + int arr_length = value_array->length(); + if (!is_latin1(java_string)) { + assert((arr_length & 1) == 0, "should be even for UTF16 string"); + arr_length >>= 1; // convert number of bytes to number of elements + } + return arr_length; +} + +bool java_lang_String::is_instance_inlined(oop obj) { + return obj != NULL && obj->klass() == SystemDictionary::String_klass(); +} + +// Accessors +oop java_lang_ref_Reference::referent(oop ref) { + return ref->obj_field(referent_offset); +} +void java_lang_ref_Reference::set_referent(oop ref, oop value) { + ref->obj_field_put(referent_offset, value); +} +void java_lang_ref_Reference::set_referent_raw(oop ref, oop value) { + ref->obj_field_put_raw(referent_offset, value); +} +HeapWord* java_lang_ref_Reference::referent_addr(oop ref) { + return ref->obj_field_addr(referent_offset); +} +oop java_lang_ref_Reference::next(oop ref) { + return ref->obj_field(next_offset); +} +void java_lang_ref_Reference::set_next(oop ref, oop value) { + ref->obj_field_put(next_offset, value); +} +void java_lang_ref_Reference::set_next_raw(oop ref, oop value) { + ref->obj_field_put_raw(next_offset, value); +} +HeapWord* java_lang_ref_Reference::next_addr(oop ref) { + return ref->obj_field_addr(next_offset); +} +oop java_lang_ref_Reference::discovered(oop ref) { + return ref->obj_field(discovered_offset); +} +void java_lang_ref_Reference::set_discovered(oop ref, oop value) { + ref->obj_field_put(discovered_offset, value); +} +void java_lang_ref_Reference::set_discovered_raw(oop ref, oop value) { + ref->obj_field_put_raw(discovered_offset, value); +} +HeapWord* java_lang_ref_Reference::discovered_addr(oop ref) { + return ref->obj_field_addr(discovered_offset); +} + inline void java_lang_invoke_CallSite::set_target_volatile(oop site, oop target) { site->obj_field_put_volatile(_target_offset, target); } @@ -41,10 +140,6 @@ inline void java_lang_invoke_CallSite::set_target(oop site, oop target) { site->obj_field_put(_target_offset, target); } -inline bool java_lang_String::is_instance_inlined(oop obj) { - return obj != NULL && obj->klass() == SystemDictionary::String_klass(); -} - inline bool java_lang_invoke_CallSite::is_instance(oop obj) { return obj != NULL && is_subclass(obj->klass()); } @@ -73,6 +168,9 @@ inline bool java_lang_invoke_DirectMethodHandle::is_instance(oop obj) { return obj != NULL && is_subclass(obj->klass()); } + + + inline int Backtrace::merge_bci_and_version(int bci, int version) { // only store u2 for version, checking for overflow. if (version > USHRT_MAX || version < 0) version = USHRT_MAX; diff --git a/hotspot/src/share/vm/classfile/stringTable.cpp b/hotspot/src/share/vm/classfile/stringTable.cpp index 59a78bbb221..391e21eedab 100644 --- a/hotspot/src/share/vm/classfile/stringTable.cpp +++ b/hotspot/src/share/vm/classfile/stringTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -25,7 +25,7 @@ #include "precompiled.hpp" #include "classfile/altHashing.hpp" #include "classfile/compactHashtable.inline.hpp" -#include "classfile/javaClasses.hpp" +#include "classfile/javaClasses.inline.hpp" #include "classfile/stringTable.hpp" #include "classfile/systemDictionary.hpp" #include "gc/shared/collectedHeap.inline.hpp" @@ -136,7 +136,7 @@ oop StringTable::basic_add(int index_arg, Handle string, jchar* name, assert(java_lang_String::equals(string(), name, len), "string must be properly initialized"); // Cannot hit a safepoint in this function because the "this" pointer can move. - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; // Check if the symbol table has been rehashed, if so, need to recalculate // the hash value and index before second lookup. diff --git a/hotspot/src/share/vm/classfile/symbolTable.cpp b/hotspot/src/share/vm/classfile/symbolTable.cpp index ae5dc8b7c20..93ed78520cb 100644 --- a/hotspot/src/share/vm/classfile/symbolTable.cpp +++ b/hotspot/src/share/vm/classfile/symbolTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -264,7 +264,7 @@ Symbol* SymbolTable::lookup(const Symbol* sym, int begin, int end, TRAPS) { unsigned int hashValue; char* name; { - debug_only(No_Safepoint_Verifier nsv;) + debug_only(NoSafepointVerifier nsv;) name = (char*)sym->base() + begin; len = end - begin; @@ -288,7 +288,7 @@ Symbol* SymbolTable::lookup(const Symbol* sym, int begin, int end, TRAPS) { buffer[i] = name[i]; } // Make sure there is no safepoint in the code above since name can't move. - // We can't include the code in No_Safepoint_Verifier because of the + // We can't include the code in NoSafepointVerifier because of the // ResourceMark. // Grab SymbolTable_lock first. @@ -405,7 +405,7 @@ Symbol* SymbolTable::basic_add(int index_arg, u1 *name, int len, } // Cannot hit a safepoint in this function because the "this" pointer can move. - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; // Check if the symbol table has been rehashed, if so, need to recalculate // the hash value and index. @@ -454,7 +454,7 @@ bool SymbolTable::basic_add(ClassLoaderData* loader_data, const constantPoolHand } // Cannot hit a safepoint in this function because the "this" pointer can move. - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; for (int i=0; irefcount(); + TempNewSymbol ss = abc; + assert(ss->refcount() == abccount, "only one abc"); + assert(ss->refcount() == abc->refcount(), "should match TempNewSymbol"); + + Symbol* efg = SymbolTable::new_symbol("efg", CATCH); + Symbol* hij = SymbolTable::new_symbol("hij", CATCH); + int efgcount = efg->refcount(); + int hijcount = hij->refcount(); + + TempNewSymbol s1 = efg; + TempNewSymbol s2 = hij; + assert(s1->refcount() == efgcount, "one efg"); + assert(s2->refcount() == hijcount, "one hij"); + + // Assignment operator + s1 = s2; + assert(hij->refcount() == hijcount + 1, "should be two hij"); + assert(efg->refcount() == efgcount - 1, "should be no efg"); + + s1 = ss; // s1 is abc + assert(s1->refcount() == abccount + 1, "should be two abc (s1 and ss)"); + assert(hij->refcount() == hijcount, "should only have one hij now (s2)"); + + s1 = s1; // self assignment + assert(s1->refcount() == abccount + 1, "should still be two abc (s1 and ss)"); + + TempNewSymbol s3; + Symbol* klm = SymbolTable::new_symbol("klm", CATCH); + int klmcount = klm->refcount(); + s3 = klm; // assignment + assert(s3->refcount() == klmcount, "only one klm now"); + + Symbol* xyz = SymbolTable::new_symbol("xyz", CATCH); + int xyzcount = xyz->refcount(); + { // inner scope + TempNewSymbol s_inner = xyz; + } + assert(xyz->refcount() == (xyzcount - 1), + "Should have been decremented by dtor in inner scope"); +} +#endif // PRODUCT diff --git a/hotspot/src/share/vm/classfile/symbolTable.hpp b/hotspot/src/share/vm/classfile/symbolTable.hpp index 8f310e70e1b..364a07a8c75 100644 --- a/hotspot/src/share/vm/classfile/symbolTable.hpp +++ b/hotspot/src/share/vm/classfile/symbolTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -42,8 +42,17 @@ class BoolObjectClosure; class outputStream; -// Class to hold a newly created or referenced Symbol* temporarily in scope. -// new_symbol() and lookup() will create a Symbol* if not already in the +// TempNewSymbol acts as a handle class in a handle/body idiom and is +// responsible for proper resource management of the body (which is a Symbol*). +// The body is resource managed by a reference counting scheme. +// TempNewSymbol can therefore be used to properly hold a newly created or referenced +// Symbol* temporarily in scope. +// +// Routines in SymbolTable will initialize the reference count of a Symbol* before +// it becomes "managed" by TempNewSymbol instances. As a handle class, TempNewSymbol +// needs to maintain proper reference counting in context of copy semantics. +// +// In SymbolTable, new_symbol() and lookup() will create a Symbol* if not already in the // symbol table and add to the symbol's reference count. // probe() and lookup_only() will increment the refcount if symbol is found. class TempNewSymbol : public StackObj { @@ -51,25 +60,38 @@ class TempNewSymbol : public StackObj { public: TempNewSymbol() : _temp(NULL) {} - // Creating or looking up a symbol increments the symbol's reference count + + // Conversion from a Symbol* to a TempNewSymbol. + // Does not increment the current reference count. TempNewSymbol(Symbol *s) : _temp(s) {} - // Operator= increments reference count. - void operator=(const TempNewSymbol &s) { - //clear(); //FIXME - _temp = s._temp; - if (_temp !=NULL) _temp->increment_refcount(); + // Copy constructor increments reference count. + TempNewSymbol(const TempNewSymbol& rhs) : _temp(rhs._temp) { + if (_temp != NULL) { + _temp->increment_refcount(); + } } - // Decrement reference counter so it can go away if it's unique - void clear() { if (_temp != NULL) _temp->decrement_refcount(); _temp = NULL; } + // Assignment operator uses a c++ trick called copy and swap idiom. + // rhs is passed by value so within the scope of this method it is a copy. + // At method exit it contains the former value of _temp, triggering the correct refcount + // decrement upon destruction. + void operator=(TempNewSymbol rhs) { + Symbol* tmp = rhs._temp; + rhs._temp = _temp; + _temp = tmp; + } - ~TempNewSymbol() { clear(); } + // Decrement reference counter so it can go away if it's unused + ~TempNewSymbol() { + if (_temp != NULL) { + _temp->decrement_refcount(); + } + } - // Operators so they can be used like Symbols + // Symbol* conversion operators Symbol* operator -> () const { return _temp; } bool operator == (Symbol* o) const { return _temp == o; } - // Sneaky conversion function operator Symbol*() { return _temp; } }; diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp index 420bf3f36b0..ecb451ab481 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.cpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -475,11 +475,11 @@ void SystemDictionary::validate_protection_domain(instanceKlassHandle klass, // Note that we have an entry, and entries can be deleted only during GC, // so we cannot allow GC to occur while we're holding this entry. - // We're using a No_Safepoint_Verifier to catch any place where we + // We're using a NoSafepointVerifier to catch any place where we // might potentially do a GC at all. // Dictionary::do_unloading() asserts that classes in SD are only // unloaded at a safepoint. Anonymous classes are not in SD. - No_Safepoint_Verifier nosafepoint; + NoSafepointVerifier nosafepoint; dictionary()->add_protection_domain(d_index, d_hash, klass, loader_data, protection_domain, THREAD); } @@ -908,11 +908,11 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name, MutexLocker mu(SystemDictionary_lock, THREAD); // Note that we have an entry, and entries can be deleted only during GC, // so we cannot allow GC to occur while we're holding this entry. - // We're using a No_Safepoint_Verifier to catch any place where we + // We're using a NoSafepointVerifier to catch any place where we // might potentially do a GC at all. // Dictionary::do_unloading() asserts that classes in SD are only // unloaded at a safepoint. Anonymous classes are not in SD. - No_Safepoint_Verifier nosafepoint; + NoSafepointVerifier nosafepoint; if (dictionary()->is_valid_protection_domain(d_index, d_hash, name, loader_data, protection_domain)) { @@ -961,11 +961,11 @@ Klass* SystemDictionary::find(Symbol* class_name, { // Note that we have an entry, and entries can be deleted only during GC, // so we cannot allow GC to occur while we're holding this entry. - // We're using a No_Safepoint_Verifier to catch any place where we + // We're using a NoSafepointVerifier to catch any place where we // might potentially do a GC at all. // Dictionary::do_unloading() asserts that classes in SD are only // unloaded at a safepoint. Anonymous classes are not in SD. - No_Safepoint_Verifier nosafepoint; + NoSafepointVerifier nosafepoint; return dictionary()->find(d_index, d_hash, class_name, loader_data, protection_domain, THREAD); } @@ -1974,12 +1974,11 @@ void SystemDictionary::initialize_preloaded_classes(TRAPS) { InstanceKlass::cast(WK_KLASS(Reference_klass))->set_reference_type(REF_OTHER); InstanceRefKlass::update_nonstatic_oop_maps(WK_KLASS(Reference_klass)); - initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(Cleaner_klass), scan, CHECK); + initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(PhantomReference_klass), scan, CHECK); InstanceKlass::cast(WK_KLASS(SoftReference_klass))->set_reference_type(REF_SOFT); InstanceKlass::cast(WK_KLASS(WeakReference_klass))->set_reference_type(REF_WEAK); InstanceKlass::cast(WK_KLASS(FinalReference_klass))->set_reference_type(REF_FINAL); InstanceKlass::cast(WK_KLASS(PhantomReference_klass))->set_reference_type(REF_PHANTOM); - InstanceKlass::cast(WK_KLASS(Cleaner_klass))->set_reference_type(REF_CLEANER); // JSR 292 classes WKID jsr292_group_start = WK_KLASS_ENUM_NAME(MethodHandle_klass); @@ -2211,7 +2210,7 @@ bool SystemDictionary::add_loader_constraint(Symbol* class_name, MutexLocker mu_s(SystemDictionary_lock, THREAD); // Better never do a GC while we're holding these oops - No_Safepoint_Verifier nosafepoint; + NoSafepointVerifier nosafepoint; Klass* klass1 = find_class(d_index1, d_hash1, constraint_name, loader_data1); Klass* klass2 = find_class(d_index2, d_hash2, constraint_name, loader_data2); @@ -2386,6 +2385,7 @@ static methodHandle unpack_method_and_appendix(Handle mname, oop appendix = appendix_box->obj_at(0); if (TraceMethodHandles) { #ifndef PRODUCT + ttyLocker ttyl; tty->print("Linked method=" INTPTR_FORMAT ": ", p2i(m)); m->print(); if (appendix != NULL) { tty->print("appendix = "); appendix->print(); } diff --git a/hotspot/src/share/vm/classfile/systemDictionary.hpp b/hotspot/src/share/vm/classfile/systemDictionary.hpp index b08b4113b75..628895f1e44 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.hpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -128,7 +128,6 @@ class SymbolPropertyTable; do_klass(WeakReference_klass, java_lang_ref_WeakReference, Pre ) \ do_klass(FinalReference_klass, java_lang_ref_FinalReference, Pre ) \ do_klass(PhantomReference_klass, java_lang_ref_PhantomReference, Pre ) \ - do_klass(Cleaner_klass, sun_misc_Cleaner, Pre ) \ do_klass(Finalizer_klass, java_lang_ref_Finalizer, Pre ) \ \ do_klass(Thread_klass, java_lang_Thread, Pre ) \ diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp index 6a49093918a..c2759287c3f 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -2004,7 +2004,7 @@ bool ClassVerifier::is_protected_access(instanceKlassHandle this_class, Symbol* field_name, Symbol* field_sig, bool is_method) { - No_Safepoint_Verifier nosafepoint; + NoSafepointVerifier nosafepoint; // If target class isn't a super class of this class, we don't worry about this case if (!this_class->is_subclass_of(target_class)) { diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index eb27ceb9498..8188ead0ecc 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -82,7 +82,6 @@ template(java_lang_ref_WeakReference, "java/lang/ref/WeakReference") \ template(java_lang_ref_FinalReference, "java/lang/ref/FinalReference") \ template(java_lang_ref_PhantomReference, "java/lang/ref/PhantomReference") \ - template(sun_misc_Cleaner, "sun/misc/Cleaner") \ template(java_lang_ref_Finalizer, "java/lang/ref/Finalizer") \ template(java_lang_reflect_AccessibleObject, "java/lang/reflect/AccessibleObject") \ template(java_lang_reflect_Method, "java/lang/reflect/Method") \ diff --git a/hotspot/src/share/vm/code/codeBlob.cpp b/hotspot/src/share/vm/code/codeBlob.cpp index a0a50cec45d..d90326e9aa5 100644 --- a/hotspot/src/share/vm/code/codeBlob.cpp +++ b/hotspot/src/share/vm/code/codeBlob.cpp @@ -181,6 +181,11 @@ const ImmutableOopMap* CodeBlob::oop_map_for_return_address(address return_addre return oop_maps()->find_map_at_offset((intptr_t) return_address - (intptr_t) code_begin()); } +void CodeBlob::print_code() { + HandleMark hm; + ResourceMark m; + Disassembler::decode(this, tty); +} //---------------------------------------------------------------------------------------------------- // Implementation of BufferBlob diff --git a/hotspot/src/share/vm/code/codeBlob.hpp b/hotspot/src/share/vm/code/codeBlob.hpp index a4a4cab7c8b..4a45f6b96f4 100644 --- a/hotspot/src/share/vm/code/codeBlob.hpp +++ b/hotspot/src/share/vm/code/codeBlob.hpp @@ -196,6 +196,7 @@ class CodeBlob VALUE_OBJ_CLASS_SPEC { void print() const { print_on(tty); } virtual void print_on(outputStream* st) const; virtual void print_value_on(outputStream* st) const; + void print_code(); // Deal with Disassembler, VTune, Forte, JvmtiExport, MemoryService. static void trace_new_stub(CodeBlob* blob, const char* name1, const char* name2 = ""); diff --git a/hotspot/src/share/vm/code/codeCache.cpp b/hotspot/src/share/vm/code/codeCache.cpp index 864f04d8f65..314365dda91 100644 --- a/hotspot/src/share/vm/code/codeCache.cpp +++ b/hotspot/src/share/vm/code/codeCache.cpp @@ -1034,7 +1034,7 @@ int CodeCache::mark_for_deoptimization(DepChange& changes) { // implementor. // nmethod::check_all_dependencies works only correctly, if no safepoint // can happen - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; for (DepChange::ContextStream str(changes, nsv); str.next(); ) { Klass* d = str.klass(); number_of_marked_CodeBlobs += InstanceKlass::cast(d)->mark_dependent_nmethods(changes); diff --git a/hotspot/src/share/vm/code/dependencies.cpp b/hotspot/src/share/vm/code/dependencies.cpp index bdb1292a4aa..097d5f75cae 100644 --- a/hotspot/src/share/vm/code/dependencies.cpp +++ b/hotspot/src/share/vm/code/dependencies.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, 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 @@ -1949,3 +1949,10 @@ void Dependencies::print_statistics() { } } #endif + +CallSiteDepChange::CallSiteDepChange(Handle call_site, Handle method_handle) : + _call_site(call_site), + _method_handle(method_handle) { + assert(_call_site()->is_a(SystemDictionary::CallSite_klass()), "must be"); + assert(_method_handle.is_null() || _method_handle()->is_a(SystemDictionary::MethodHandle_klass()), "must be"); +} diff --git a/hotspot/src/share/vm/code/dependencies.hpp b/hotspot/src/share/vm/code/dependencies.hpp index e9c26011695..b62c6bf12ed 100644 --- a/hotspot/src/share/vm/code/dependencies.hpp +++ b/hotspot/src/share/vm/code/dependencies.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, 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 @@ -59,7 +59,7 @@ class CompileLog; class DepChange; class KlassDepChange; class CallSiteDepChange; -class No_Safepoint_Verifier; +class NoSafepointVerifier; class Dependencies: public ResourceObj { public: @@ -713,7 +713,7 @@ class DepChange : public StackObj { : _changes(changes) { start(); } - ContextStream(DepChange& changes, No_Safepoint_Verifier& nsv) + ContextStream(DepChange& changes, NoSafepointVerifier& nsv) : _changes(changes) // the nsv argument makes it safe to hold oops like _klass { start(); } @@ -767,13 +767,7 @@ class CallSiteDepChange : public DepChange { Handle _method_handle; public: - CallSiteDepChange(Handle call_site, Handle method_handle) - : _call_site(call_site), - _method_handle(method_handle) - { - assert(_call_site() ->is_a(SystemDictionary::CallSite_klass()), "must be"); - assert(_method_handle.is_null() || _method_handle()->is_a(SystemDictionary::MethodHandle_klass()), "must be"); - } + CallSiteDepChange(Handle call_site, Handle method_handle); // What kind of DepChange is this? virtual bool is_call_site_change() const { return true; } diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index 4aa365aa058..7dc841279c6 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -692,7 +692,7 @@ nmethod::nmethod( _native_basic_lock_sp_offset(basic_lock_sp_offset) { { - debug_only(No_Safepoint_Verifier nsv;) + debug_only(NoSafepointVerifier nsv;) assert_locked_or_safepoint(CodeCache_lock); init_defaults(); @@ -796,7 +796,7 @@ nmethod::nmethod( { assert(debug_info->oop_recorder() == code_buffer->oop_recorder(), "shared OR"); { - debug_only(No_Safepoint_Verifier nsv;) + debug_only(NoSafepointVerifier nsv;) assert_locked_or_safepoint(CodeCache_lock); init_defaults(); @@ -1412,7 +1412,7 @@ bool nmethod::make_not_entrant_or_zombie(unsigned int state) { // Make sure neither the nmethod nor the method is flushed in case of a safepoint in code below. nmethodLocker nml(this); methodHandle the_method(method()); - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; // during patching, depending on the nmethod state we must notify the GC that // code has been unloaded, unregistering it. We cannot do this right while @@ -2640,6 +2640,7 @@ address nmethod::continuation_for_implicit_exception(address pc) { ResourceMark rm(thread); CodeBlob* cb = CodeCache::find_blob(pc); assert(cb != NULL && cb == this, ""); + ttyLocker ttyl; tty->print_cr("implicit exception happened at " INTPTR_FORMAT, p2i(pc)); print(); method()->print_codes(); @@ -2961,13 +2962,6 @@ void nmethod::print() const { nul_chk_table_size()); } -void nmethod::print_code() { - HandleMark hm; - ResourceMark m; - Disassembler::decode(this); -} - - #ifndef PRODUCT void nmethod::print_scopes() { diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp index f38ed2edb36..b736fab13ed 100644 --- a/hotspot/src/share/vm/code/nmethod.hpp +++ b/hotspot/src/share/vm/code/nmethod.hpp @@ -704,7 +704,6 @@ public: // printing support void print() const; - void print_code(); void print_relocations() PRODUCT_RETURN; void print_pcs() PRODUCT_RETURN; void print_scopes() PRODUCT_RETURN; diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index 41151324bec..497c0568754 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -227,6 +227,11 @@ bool compileBroker_init() { CompileTaskWrapper::CompileTaskWrapper(CompileTask* task) { CompilerThread* thread = CompilerThread::current(); thread->set_task(task); +#if INCLUDE_JVMCI + if (task->is_blocking() && CompileBroker::compiler(task->comp_level())->is_jvmci()) { + task->set_jvmci_compiler_thread(thread); + } +#endif CompileLog* log = thread->log(); if (log != NULL) task->log_task_start(log); } @@ -245,10 +250,12 @@ CompileTaskWrapper::~CompileTaskWrapper() { MutexLocker notifier(task->lock(), thread); task->mark_complete(); #if INCLUDE_JVMCI - if (CompileBroker::compiler(task->comp_level())->is_jvmci() && - !task->has_waiter()) { - // The waiting thread timed out and thus did not free the task. - free_task = true; + if (CompileBroker::compiler(task->comp_level())->is_jvmci()) { + if (!task->has_waiter()) { + // The waiting thread timed out and thus did not free the task. + free_task = true; + } + task->set_jvmci_compiler_thread(NULL); } #endif if (!free_task) { @@ -375,7 +382,7 @@ CompileTask* CompileQueue::get() { CompileTask* task; { - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; task = CompilationPolicy::policy()->select_task(this); } @@ -1332,11 +1339,56 @@ CompileTask* CompileBroker::create_compile_task(CompileQueue* queue, return new_task; } -// 1 second should be long enough to complete most JVMCI compilations -// and not too long to stall a blocking JVMCI compilation that -// is trying to acquire a lock held by the app thread that submitted the -// compilation. -static const long BLOCKING_JVMCI_COMPILATION_TIMEOUT = 1000; +#if INCLUDE_JVMCI +// The number of milliseconds to wait before checking if the +// JVMCI compiler thread is blocked. +static const long BLOCKING_JVMCI_COMPILATION_WAIT_TIMESLICE = 500; + +// The number of successive times the above check is allowed to +// see a blocked JVMCI compiler thread before unblocking the +// thread waiting for the compilation to finish. +static const int BLOCKING_JVMCI_COMPILATION_WAIT_TO_UNBLOCK_ATTEMPTS = 5; + +/** + * Waits for a JVMCI compiler to complete a given task. This thread + * waits until either the task completes or it sees the JVMCI compiler + * thread is blocked for N consecutive milliseconds where N is + * BLOCKING_JVMCI_COMPILATION_WAIT_TIMESLICE * + * BLOCKING_JVMCI_COMPILATION_WAIT_TO_UNBLOCK_ATTEMPTS. + * + * @return true if this thread needs to free/recycle the task + */ +bool CompileBroker::wait_for_jvmci_completion(CompileTask* task, JavaThread* thread) { + MutexLocker waiter(task->lock(), thread); + int consecutively_blocked = 0; + while (task->lock()->wait(!Mutex::_no_safepoint_check_flag, BLOCKING_JVMCI_COMPILATION_WAIT_TIMESLICE)) { + CompilerThread* jvmci_compiler_thread = task->jvmci_compiler_thread(); + if (jvmci_compiler_thread != NULL) { + JavaThreadState state; + { + // A JVMCI compiler thread should not disappear at this point + // but let's be extra safe. + MutexLocker mu(Threads_lock, thread); + state = jvmci_compiler_thread->thread_state(); + } + if (state == _thread_blocked) { + if (++consecutively_blocked == BLOCKING_JVMCI_COMPILATION_WAIT_TO_UNBLOCK_ATTEMPTS) { + if (PrintCompilation) { + task->print(tty, "wait for blocking compilation timed out"); + } + break; + } + } else { + consecutively_blocked = 0; + } + } else { + // Still waiting on JVMCI compiler queue + } + } + task->clear_waiter(); + return task->is_complete(); +} +#endif /** * Wait for the compilation task to complete. @@ -1356,16 +1408,7 @@ void CompileBroker::wait_for_completion(CompileTask* task) { bool free_task; #if INCLUDE_JVMCI if (compiler(task->comp_level())->is_jvmci()) { - MutexLocker waiter(task->lock(), thread); - // No need to check if compilation has completed - just - // rely on the time out. The JVMCI compiler thread will - // recycle the CompileTask. - task->lock()->wait(!Mutex::_no_safepoint_check_flag, BLOCKING_JVMCI_COMPILATION_TIMEOUT); - // If the compilation completes while has_waiter is true then - // this thread is responsible for freeing the task. Otherwise - // the compiler thread will free the task. - task->clear_waiter(); - free_task = task->is_complete(); + free_task = wait_for_jvmci_completion(task, thread); } else #endif { @@ -1755,6 +1798,8 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) { push_jni_handle_block(); Method* target_handle = task->method(); int compilable = ciEnv::MethodCompilable; + const char* failure_reason = NULL; + const char* retry_message = NULL; AbstractCompiler *comp = compiler(task_level); int system_dictionary_modification_counter; @@ -1774,10 +1819,16 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) { jvmci->compile_method(method, osr_bci, &env); post_compile(thread, task, event, task->code() != NULL, NULL); + + failure_reason = env.failure_reason(); + if (!env.retryable()) { + retry_message = "not retryable"; + compilable = ciEnv::MethodCompilable_not_at_tier; + } + } else #endif // INCLUDE_JVMCI { - NoHandleMark nhm; ThreadToNativeFromVM ttn(thread); @@ -1825,31 +1876,45 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) { compilable = ci_env.compilable(); if (ci_env.failing()) { - task->set_failure_reason(ci_env.failure_reason()); - ci_env.report_failure(ci_env.failure_reason()); - const char* retry_message = ci_env.retry_message(); - if (_compilation_log != NULL) { - _compilation_log->log_failure(thread, task, ci_env.failure_reason(), retry_message); - } - if (PrintCompilation) { - FormatBufferResource msg = retry_message != NULL ? - FormatBufferResource("COMPILE SKIPPED: %s (%s)", ci_env.failure_reason(), retry_message) : - FormatBufferResource("COMPILE SKIPPED: %s", ci_env.failure_reason()); - task->print(tty, msg); - } + failure_reason = ci_env.failure_reason(); + retry_message = ci_env.retry_message(); + ci_env.report_failure(failure_reason); } post_compile(thread, task, event, !ci_env.failing(), &ci_env); } - DirectivesStack::release(directive); + // Remove the JNI handle block after the ciEnv destructor has run in + // the previous block. pop_jni_handle_block(); + if (failure_reason != NULL) { + task->set_failure_reason(failure_reason); + if (_compilation_log != NULL) { + _compilation_log->log_failure(thread, task, failure_reason, retry_message); + } + if (PrintCompilation) { + FormatBufferResource msg = retry_message != NULL ? + FormatBufferResource("COMPILE SKIPPED: %s (%s)", failure_reason, retry_message) : + FormatBufferResource("COMPILE SKIPPED: %s", failure_reason); + task->print(tty, msg); + } + } + methodHandle method(thread, task->method()); DTRACE_METHOD_COMPILE_END_PROBE(method, compiler_name(task_level), task->is_success()); collect_statistics(thread, time, task); + bool printnmethods = directive->PrintAssemblyOption || directive->PrintNMethodsOption; + if (printnmethods || PrintDebugInfo || PrintRelocations || PrintDependencies || PrintExceptionHandlers) { + nmethod* nm = task->code(); + if (nm != NULL) { + nm->print_nmethod(printnmethods); + } + } + DirectivesStack::release(directive); + if (PrintCompilation && PrintCompilation2) { tty->print("%7d ", (int) tty->time_stamp().milliseconds()); // print timestamp tty->print("%4d ", compile_id); // print compilation number diff --git a/hotspot/src/share/vm/compiler/compileBroker.hpp b/hotspot/src/share/vm/compiler/compileBroker.hpp index 448f1f8897d..d74646b8855 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.hpp +++ b/hotspot/src/share/vm/compiler/compileBroker.hpp @@ -233,6 +233,9 @@ class CompileBroker: AllStatic { const char* comment, bool blocking); static void wait_for_completion(CompileTask* task); +#if INCLUDE_JVMCI + static bool wait_for_jvmci_completion(CompileTask* task, JavaThread* thread); +#endif static void invoke_compiler_on_method(CompileTask* task); static void post_compile(CompilerThread* thread, CompileTask* task, EventCompilation& event, bool success, ciEnv* ci_env); diff --git a/hotspot/src/share/vm/compiler/compileTask.cpp b/hotspot/src/share/vm/compiler/compileTask.cpp index a0efba91365..a59aa55c5c4 100644 --- a/hotspot/src/share/vm/compiler/compileTask.cpp +++ b/hotspot/src/share/vm/compiler/compileTask.cpp @@ -91,6 +91,7 @@ void CompileTask::initialize(int compile_id, _osr_bci = osr_bci; _is_blocking = is_blocking; JVMCI_ONLY(_has_waiter = CompileBroker::compiler(comp_level)->is_jvmci();) + JVMCI_ONLY(_jvmci_compiler_thread = NULL;) _comp_level = comp_level; _num_inlined_bytecodes = 0; diff --git a/hotspot/src/share/vm/compiler/compileTask.hpp b/hotspot/src/share/vm/compiler/compileTask.hpp index 17f77b34dee..92f74dc569b 100644 --- a/hotspot/src/share/vm/compiler/compileTask.hpp +++ b/hotspot/src/share/vm/compiler/compileTask.hpp @@ -56,6 +56,8 @@ class CompileTask : public CHeapObj { bool _is_blocking; #if INCLUDE_JVMCI bool _has_waiter; + // Compiler thread for a blocking JVMCI compilation + CompilerThread* _jvmci_compiler_thread; #endif int _comp_level; int _num_inlined_bytecodes; @@ -92,6 +94,12 @@ class CompileTask : public CHeapObj { #if INCLUDE_JVMCI bool has_waiter() const { return _has_waiter; } void clear_waiter() { _has_waiter = false; } + CompilerThread* jvmci_compiler_thread() const { return _jvmci_compiler_thread; } + void set_jvmci_compiler_thread(CompilerThread* t) { + assert(is_blocking(), "must be"); + assert((t == NULL) != (_jvmci_compiler_thread == NULL), "must be"); + _jvmci_compiler_thread = t; + } #endif nmethodLocker* code_handle() const { return _code_handle; } diff --git a/hotspot/src/share/vm/compiler/compilerDirectives.cpp b/hotspot/src/share/vm/compiler/compilerDirectives.cpp index ba35617fc27..28b09f6cb61 100644 --- a/hotspot/src/share/vm/compiler/compilerDirectives.cpp +++ b/hotspot/src/share/vm/compiler/compilerDirectives.cpp @@ -164,20 +164,15 @@ int CompilerDirectives::refcount() { DirectiveSet* CompilerDirectives::get_for(AbstractCompiler *comp) { assert(DirectivesStack_lock->owned_by_self(), ""); - inc_refcount(); // The compiling thread is responsible to decrement this when finished. if (comp == NULL) { // Xint return _c1_store; - } else if (comp->is_c2()) { + } else if (comp->is_c2()) { return _c2_store; - } else if (comp->is_c1()) { + } else { + // use c1_store as default + assert(comp->is_c1() || comp->is_jvmci() || comp->is_shark(), ""); return _c1_store; - } else if (comp->is_shark()) { - return NULL; - } else if (comp->is_jvmci()) { - return NULL; } - ShouldNotReachHere(); - return NULL; } // In the list of disabled intrinsics, the ID of the disabled intrinsics can separated: @@ -459,6 +454,7 @@ DirectiveSet* DirectivesStack::getDefaultDirective(AbstractCompiler* comp) { MutexLockerEx locker(DirectivesStack_lock, Mutex::_no_safepoint_check_flag); assert(_bottom != NULL, "Must never be empty"); + _bottom->inc_refcount(); return _bottom->get_for(comp); } @@ -521,12 +517,13 @@ void DirectivesStack::print(outputStream* st) { } void DirectivesStack::release(DirectiveSet* set) { + assert(set != NULL, "Never NULL"); MutexLockerEx locker(DirectivesStack_lock, Mutex::_no_safepoint_check_flag); if (set->is_exclusive_copy()) { // Old CompilecCmmands forced us to create an exclusive copy delete set; } else { - assert(set->directive() != NULL, ""); + assert(set->directive() != NULL, "Never NULL"); release(set->directive()); } } @@ -553,26 +550,18 @@ DirectiveSet* DirectivesStack::getMatchingDirective(methodHandle method, Abstrac while (dir != NULL) { if (dir->is_default_directive() || dir->match(method)) { match = dir->get_for(comp); - if (match == NULL) { - // temporary workaround for compilers without directives. - if (dir->is_default_directive()) { - // default dir is always enabled - // match c1 store - it contains all common flags even if C1 is unavailable - match = dir->_c1_store; - break; - } - } else { - if (match->EnableOption) { - // The directiveSet for this compile is also enabled -> success - break; - } + assert(match != NULL, "Consistency"); + if (match->EnableOption) { + // The directiveSet for this compile is also enabled -> success + dir->inc_refcount(); + break; } } dir = dir->next(); } } - guarantee(match != NULL, "There should always be a default directive that matches"); + // Check for legacy compile commands update, without DirectivesStack_lock return match->compilecommand_compatibility_init(method); } diff --git a/hotspot/src/share/vm/compiler/directivesParser.cpp b/hotspot/src/share/vm/compiler/directivesParser.cpp index 16720ceb4db..4847e228160 100644 --- a/hotspot/src/share/vm/compiler/directivesParser.cpp +++ b/hotspot/src/share/vm/compiler/directivesParser.cpp @@ -608,7 +608,7 @@ void DirectivesParser::test(const char* text, bool should_pass) { cd.clean_tmp(); } -bool DirectivesParser::test() { +void DirectivesParser::test() { DirectivesParser::test("{}", false); DirectivesParser::test("[]", true); DirectivesParser::test("[{}]", false); @@ -742,8 +742,10 @@ bool DirectivesParser::test() { " }" "\n" " }" "\n" "]" "\n", false); +} - return true; +void DirectivesParser_test() { + DirectivesParser::test(); } #endif diff --git a/hotspot/src/share/vm/compiler/directivesParser.hpp b/hotspot/src/share/vm/compiler/directivesParser.hpp index d0d7eb31388..f62630f7d56 100644 --- a/hotspot/src/share/vm/compiler/directivesParser.hpp +++ b/hotspot/src/share/vm/compiler/directivesParser.hpp @@ -136,7 +136,7 @@ private: #ifndef PRODUCT static void test(const char* json, bool valid); public: - static bool test(); + static void test(); #endif }; diff --git a/hotspot/src/share/vm/compiler/disassembler.cpp b/hotspot/src/share/vm/compiler/disassembler.cpp index 4b15e7c6301..58859784479 100644 --- a/hotspot/src/share/vm/compiler/disassembler.cpp +++ b/hotspot/src/share/vm/compiler/disassembler.cpp @@ -513,6 +513,7 @@ address decode_env::decode_instructions(address start, address end) { void Disassembler::decode(CodeBlob* cb, outputStream* st) { + ttyLocker ttyl; if (!load_library()) return; if (cb->is_nmethod()) { decode((nmethod*)cb, st); @@ -526,12 +527,14 @@ void Disassembler::decode(CodeBlob* cb, outputStream* st) { } void Disassembler::decode(address start, address end, outputStream* st, CodeStrings c) { + ttyLocker ttyl; if (!load_library()) return; decode_env env(CodeCache::find_blob_unsafe(start), st, c); env.decode_instructions(start, end); } void Disassembler::decode(nmethod* nm, outputStream* st) { + ttyLocker ttyl; if (!load_library()) return; decode_env env(nm, st); env.output()->print_cr("----------------------------------------------------------------------"); diff --git a/hotspot/src/share/vm/gc/cms/cmsOopClosures.hpp b/hotspot/src/share/vm/gc/cms/cmsOopClosures.hpp index 2887914b5a4..e85dc681e3b 100644 --- a/hotspot/src/share/vm/gc/cms/cmsOopClosures.hpp +++ b/hotspot/src/share/vm/gc/cms/cmsOopClosures.hpp @@ -37,7 +37,7 @@ class CMSBitMap; class CMSMarkStack; class CMSCollector; class MarkFromRootsClosure; -class Par_MarkFromRootsClosure; +class ParMarkFromRootsClosure; // Decode the oop and call do_oop on it. #define DO_OOP_WORK_DEFN \ @@ -82,14 +82,14 @@ class MarkRefsIntoClosure: public MetadataAwareOopsInGenClosure { virtual void do_oop(narrowOop* p); }; -class Par_MarkRefsIntoClosure: public MetadataAwareOopsInGenClosure { +class ParMarkRefsIntoClosure: public MetadataAwareOopsInGenClosure { private: const MemRegion _span; CMSBitMap* _bitMap; protected: DO_OOP_WORK_DEFN public: - Par_MarkRefsIntoClosure(MemRegion span, CMSBitMap* bitMap); + ParMarkRefsIntoClosure(MemRegion span, CMSBitMap* bitMap); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); }; @@ -141,7 +141,7 @@ class PushAndMarkClosure: public MetadataAwareOopClosure { // synchronization (for instance, via CAS). The marking stack // used in the non-parallel case above is here replaced with // an OopTaskQueue structure to allow efficient work stealing. -class Par_PushAndMarkClosure: public MetadataAwareOopClosure { +class ParPushAndMarkClosure: public MetadataAwareOopClosure { private: CMSCollector* _collector; MemRegion _span; @@ -150,15 +150,15 @@ class Par_PushAndMarkClosure: public MetadataAwareOopClosure { protected: DO_OOP_WORK_DEFN public: - Par_PushAndMarkClosure(CMSCollector* collector, - MemRegion span, - ReferenceProcessor* rp, - CMSBitMap* bit_map, - OopTaskQueue* work_queue); + ParPushAndMarkClosure(CMSCollector* collector, + MemRegion span, + ReferenceProcessor* rp, + CMSBitMap* bit_map, + OopTaskQueue* work_queue); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p) { Par_PushAndMarkClosure::do_oop_work(p); } - inline void do_oop_nv(narrowOop* p) { Par_PushAndMarkClosure::do_oop_work(p); } + inline void do_oop_nv(oop* p) { ParPushAndMarkClosure::do_oop_work(p); } + inline void do_oop_nv(narrowOop* p) { ParPushAndMarkClosure::do_oop_work(p); } }; // The non-parallel version (the parallel version appears further below). @@ -203,25 +203,25 @@ class MarkRefsIntoAndScanClosure: public MetadataAwareOopsInGenClosure { // stack and the bitMap are shared, so access needs to be suitably // synchronized. An OopTaskQueue structure, supporting efficient // work stealing, replaces a CMSMarkStack for storing grey objects. -class Par_MarkRefsIntoAndScanClosure: public MetadataAwareOopsInGenClosure { +class ParMarkRefsIntoAndScanClosure: public MetadataAwareOopsInGenClosure { private: - MemRegion _span; - CMSBitMap* _bit_map; - OopTaskQueue* _work_queue; - const uint _low_water_mark; - Par_PushAndMarkClosure _par_pushAndMarkClosure; + MemRegion _span; + CMSBitMap* _bit_map; + OopTaskQueue* _work_queue; + const uint _low_water_mark; + ParPushAndMarkClosure _parPushAndMarkClosure; protected: DO_OOP_WORK_DEFN public: - Par_MarkRefsIntoAndScanClosure(CMSCollector* collector, + ParMarkRefsIntoAndScanClosure(CMSCollector* collector, MemRegion span, ReferenceProcessor* rp, CMSBitMap* bit_map, OopTaskQueue* work_queue); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p) { Par_MarkRefsIntoAndScanClosure::do_oop_work(p); } - inline void do_oop_nv(narrowOop* p) { Par_MarkRefsIntoAndScanClosure::do_oop_work(p); } + inline void do_oop_nv(oop* p) { ParMarkRefsIntoAndScanClosure::do_oop_work(p); } + inline void do_oop_nv(narrowOop* p) { ParMarkRefsIntoAndScanClosure::do_oop_work(p); } void trim_queue(uint size); }; @@ -261,8 +261,8 @@ class PushOrMarkClosure: public MetadataAwareOopClosure { // A parallel (MT) version of the above. // This closure is used during the concurrent marking phase // following the first checkpoint. Its use is buried in -// the closure Par_MarkFromRootsClosure. -class Par_PushOrMarkClosure: public MetadataAwareOopClosure { +// the closure ParMarkFromRootsClosure. +class ParPushOrMarkClosure: public MetadataAwareOopClosure { private: CMSCollector* _collector; MemRegion _whole_span; @@ -272,23 +272,23 @@ class Par_PushOrMarkClosure: public MetadataAwareOopClosure { CMSMarkStack* _overflow_stack; HeapWord* const _finger; HeapWord** const _global_finger_addr; - Par_MarkFromRootsClosure* const + ParMarkFromRootsClosure* const _parent; protected: DO_OOP_WORK_DEFN public: - Par_PushOrMarkClosure(CMSCollector* cms_collector, - MemRegion span, - CMSBitMap* bit_map, - OopTaskQueue* work_queue, - CMSMarkStack* mark_stack, - HeapWord* finger, - HeapWord** global_finger_addr, - Par_MarkFromRootsClosure* parent); + ParPushOrMarkClosure(CMSCollector* cms_collector, + MemRegion span, + CMSBitMap* bit_map, + OopTaskQueue* work_queue, + CMSMarkStack* mark_stack, + HeapWord* finger, + HeapWord** global_finger_addr, + ParMarkFromRootsClosure* parent); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p) { Par_PushOrMarkClosure::do_oop_work(p); } - inline void do_oop_nv(narrowOop* p) { Par_PushOrMarkClosure::do_oop_work(p); } + inline void do_oop_nv(oop* p) { ParPushOrMarkClosure::do_oop_work(p); } + inline void do_oop_nv(narrowOop* p) { ParPushOrMarkClosure::do_oop_work(p); } // Deal with a stack overflow condition void handle_stack_overflow(HeapWord* lost); diff --git a/hotspot/src/share/vm/gc/cms/cmsOopClosures.inline.hpp b/hotspot/src/share/vm/gc/cms/cmsOopClosures.inline.hpp index 3740795614f..363097543c8 100644 --- a/hotspot/src/share/vm/gc/cms/cmsOopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc/cms/cmsOopClosures.inline.hpp @@ -31,7 +31,7 @@ #include "oops/oop.inline.hpp" // Trim our work_queue so its length is below max at return -inline void Par_MarkRefsIntoAndScanClosure::trim_queue(uint max) { +inline void ParMarkRefsIntoAndScanClosure::trim_queue(uint max) { while (_work_queue->size() > max) { oop newOop; if (_work_queue->pop_local(newOop)) { @@ -40,7 +40,7 @@ inline void Par_MarkRefsIntoAndScanClosure::trim_queue(uint max) { "only grey objects on this stack"); // iterate over the oops in this oop, marking and pushing // the ones in CMS heap (i.e. in _span). - newOop->oop_iterate(&_par_pushAndMarkClosure); + newOop->oop_iterate(&_parPushAndMarkClosure); } } } diff --git a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp index 9d99a44b703..6c9a4ea4fae 100644 --- a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp +++ b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp @@ -576,7 +576,7 @@ void CompactibleFreeListSpace::set_end(HeapWord* value) { } } -class FreeListSpace_DCTOC : public Filtering_DCTOC { +class FreeListSpaceDCTOC : public FilteringDCTOC { CompactibleFreeListSpace* _cfls; CMSCollector* _collector; bool _parallel; @@ -596,21 +596,21 @@ protected: walk_mem_region_with_cl_DECL(FilteringClosure); public: - FreeListSpace_DCTOC(CompactibleFreeListSpace* sp, - CMSCollector* collector, - ExtendedOopClosure* cl, - CardTableModRefBS::PrecisionStyle precision, - HeapWord* boundary, - bool parallel) : - Filtering_DCTOC(sp, cl, precision, boundary), + FreeListSpaceDCTOC(CompactibleFreeListSpace* sp, + CMSCollector* collector, + ExtendedOopClosure* cl, + CardTableModRefBS::PrecisionStyle precision, + HeapWord* boundary, + bool parallel) : + FilteringDCTOC(sp, cl, precision, boundary), _cfls(sp), _collector(collector), _parallel(parallel) {} }; // We de-virtualize the block-related calls below, since we know that our // space is a CompactibleFreeListSpace. -#define FreeListSpace_DCTOC__walk_mem_region_with_cl_DEFN(ClosureType) \ -void FreeListSpace_DCTOC::walk_mem_region_with_cl(MemRegion mr, \ +#define FreeListSpaceDCTOC__walk_mem_region_with_cl_DEFN(ClosureType) \ +void FreeListSpaceDCTOC::walk_mem_region_with_cl(MemRegion mr, \ HeapWord* bottom, \ HeapWord* top, \ ClosureType* cl) { \ @@ -620,10 +620,10 @@ void FreeListSpace_DCTOC::walk_mem_region_with_cl(MemRegion mr, walk_mem_region_with_cl_nopar(mr, bottom, top, cl); \ } \ } \ -void FreeListSpace_DCTOC::walk_mem_region_with_cl_par(MemRegion mr, \ - HeapWord* bottom, \ - HeapWord* top, \ - ClosureType* cl) { \ +void FreeListSpaceDCTOC::walk_mem_region_with_cl_par(MemRegion mr, \ + HeapWord* bottom, \ + HeapWord* top, \ + ClosureType* cl) { \ /* Skip parts that are before "mr", in case "block_start" sent us \ back too far. */ \ HeapWord* mr_start = mr.start(); \ @@ -647,10 +647,10 @@ void FreeListSpace_DCTOC::walk_mem_region_with_cl_par(MemRegion mr, } \ } \ } \ -void FreeListSpace_DCTOC::walk_mem_region_with_cl_nopar(MemRegion mr, \ - HeapWord* bottom, \ - HeapWord* top, \ - ClosureType* cl) { \ +void FreeListSpaceDCTOC::walk_mem_region_with_cl_nopar(MemRegion mr, \ + HeapWord* bottom, \ + HeapWord* top, \ + ClosureType* cl) { \ /* Skip parts that are before "mr", in case "block_start" sent us \ back too far. */ \ HeapWord* mr_start = mr.start(); \ @@ -678,15 +678,15 @@ void FreeListSpace_DCTOC::walk_mem_region_with_cl_nopar(MemRegion mr, // (There are only two of these, rather than N, because the split is due // only to the introduction of the FilteringClosure, a local part of the // impl of this abstraction.) -FreeListSpace_DCTOC__walk_mem_region_with_cl_DEFN(ExtendedOopClosure) -FreeListSpace_DCTOC__walk_mem_region_with_cl_DEFN(FilteringClosure) +FreeListSpaceDCTOC__walk_mem_region_with_cl_DEFN(ExtendedOopClosure) +FreeListSpaceDCTOC__walk_mem_region_with_cl_DEFN(FilteringClosure) DirtyCardToOopClosure* CompactibleFreeListSpace::new_dcto_cl(ExtendedOopClosure* cl, CardTableModRefBS::PrecisionStyle precision, HeapWord* boundary, bool parallel) { - return new FreeListSpace_DCTOC(this, _collector, cl, precision, boundary, parallel); + return new FreeListSpaceDCTOC(this, _collector, cl, precision, boundary, parallel); } @@ -2413,7 +2413,7 @@ void CompactibleFreeListSpace::printFLCensus(size_t sweep_count) const { } /////////////////////////////////////////////////////////////////////////// -// CFLS_LAB +// CompactibleFreeListSpaceLAB /////////////////////////////////////////////////////////////////////////// #define VECTOR_257(x) \ @@ -2432,12 +2432,12 @@ void CompactibleFreeListSpace::printFLCensus(size_t sweep_count) const { // generic OldPLABSize, whose static default is different; if overridden at the // command-line, this will get reinitialized via a call to // modify_initialization() below. -AdaptiveWeightedAverage CFLS_LAB::_blocks_to_claim[] = - VECTOR_257(AdaptiveWeightedAverage(OldPLABWeight, (float)CFLS_LAB::_default_dynamic_old_plab_size)); -size_t CFLS_LAB::_global_num_blocks[] = VECTOR_257(0); -uint CFLS_LAB::_global_num_workers[] = VECTOR_257(0); +AdaptiveWeightedAverage CompactibleFreeListSpaceLAB::_blocks_to_claim[] = + VECTOR_257(AdaptiveWeightedAverage(OldPLABWeight, (float)CompactibleFreeListSpaceLAB::_default_dynamic_old_plab_size)); +size_t CompactibleFreeListSpaceLAB::_global_num_blocks[] = VECTOR_257(0); +uint CompactibleFreeListSpaceLAB::_global_num_workers[] = VECTOR_257(0); -CFLS_LAB::CFLS_LAB(CompactibleFreeListSpace* cfls) : +CompactibleFreeListSpaceLAB::CompactibleFreeListSpaceLAB(CompactibleFreeListSpace* cfls) : _cfls(cfls) { assert(CompactibleFreeListSpace::IndexSetSize == 257, "Modify VECTOR_257() macro above"); @@ -2451,7 +2451,7 @@ CFLS_LAB::CFLS_LAB(CompactibleFreeListSpace* cfls) : static bool _CFLS_LAB_modified = false; -void CFLS_LAB::modify_initialization(size_t n, unsigned wt) { +void CompactibleFreeListSpaceLAB::modify_initialization(size_t n, unsigned wt) { assert(!_CFLS_LAB_modified, "Call only once"); _CFLS_LAB_modified = true; for (size_t i = CompactibleFreeListSpace::IndexSetStart; @@ -2461,7 +2461,7 @@ void CFLS_LAB::modify_initialization(size_t n, unsigned wt) { } } -HeapWord* CFLS_LAB::alloc(size_t word_sz) { +HeapWord* CompactibleFreeListSpaceLAB::alloc(size_t word_sz) { FreeChunk* res; assert(word_sz == _cfls->adjustObjectSize(word_sz), "Error"); if (word_sz >= CompactibleFreeListSpace::IndexSetSize) { @@ -2491,7 +2491,7 @@ HeapWord* CFLS_LAB::alloc(size_t word_sz) { // Get a chunk of blocks of the right size and update related // book-keeping stats -void CFLS_LAB::get_from_global_pool(size_t word_sz, AdaptiveFreeList* fl) { +void CompactibleFreeListSpaceLAB::get_from_global_pool(size_t word_sz, AdaptiveFreeList* fl) { // Get the #blocks we want to claim size_t n_blks = (size_t)_blocks_to_claim[word_sz].average(); assert(n_blks > 0, "Error"); @@ -2525,7 +2525,7 @@ void CFLS_LAB::get_from_global_pool(size_t word_sz, AdaptiveFreeList* _num_blocks[word_sz] += fl->count(); } -void CFLS_LAB::compute_desired_plab_size() { +void CompactibleFreeListSpaceLAB::compute_desired_plab_size() { for (size_t i = CompactibleFreeListSpace::IndexSetStart; i < CompactibleFreeListSpace::IndexSetSize; i += CompactibleFreeListSpace::IndexSetStride) { @@ -2551,7 +2551,7 @@ void CFLS_LAB::compute_desired_plab_size() { // access, one would need to take the FL locks and, // depending on how it is used, stagger access from // parallel threads to reduce contention. -void CFLS_LAB::retire(int tid) { +void CompactibleFreeListSpaceLAB::retire(int tid) { // We run this single threaded with the world stopped; // so no need for locks and such. NOT_PRODUCT(Thread* t = Thread::current();) diff --git a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp index 5c233452a16..c9f9af242be 100644 --- a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp +++ b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp @@ -75,7 +75,7 @@ class CompactibleFreeListSpace: public CompactibleSpace { friend class ConcurrentMarkSweepGeneration; friend class CMSCollector; // Local alloc buffer for promotion into this space. - friend class CFLS_LAB; + friend class CompactibleFreeListSpaceLAB; // Allow scan_and_* functions to call (private) overrides of the auxiliary functions on this class template friend void CompactibleSpace::scan_and_adjust_pointers(SpaceType* space); @@ -662,7 +662,7 @@ class CompactibleFreeListSpace: public CompactibleSpace { // A parallel-GC-thread-local allocation buffer for allocation into a // CompactibleFreeListSpace. -class CFLS_LAB : public CHeapObj { +class CompactibleFreeListSpaceLAB : public CHeapObj { // The space that this buffer allocates into. CompactibleFreeListSpace* _cfls; @@ -686,7 +686,7 @@ public: static const int _default_dynamic_old_plab_size = 16; static const int _default_static_old_plab_size = 50; - CFLS_LAB(CompactibleFreeListSpace* cfls); + CompactibleFreeListSpaceLAB(CompactibleFreeListSpace* cfls); // Allocate and return a block of the given size, or else return NULL. HeapWord* alloc(size_t word_sz); diff --git a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp index 3e335a8e164..f852e9d0017 100644 --- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp @@ -183,7 +183,7 @@ NOT_PRODUCT(CompactibleFreeListSpace* debug_cms_space;) // young-gen collection. class CMSParGCThreadState: public CHeapObj { public: - CFLS_LAB lab; + CompactibleFreeListSpaceLAB lab; PromotionInfo promo; // Constructor. @@ -1110,7 +1110,7 @@ bool ConcurrentMarkSweepGeneration::should_collect(bool full, bool CMSCollector::shouldConcurrentCollect() { if (_full_gc_requested) { - log_trace(gc)("CMSCollector: collect because of explicit gc request (or gc_locker)"); + log_trace(gc)("CMSCollector: collect because of explicit gc request (or GCLocker)"); return true; } @@ -1269,12 +1269,12 @@ void CMSCollector::collect(bool full, { // The following "if" branch is present for defensive reasons. // In the current uses of this interface, it can be replaced with: - // assert(!GC_locker.is_active(), "Can't be called otherwise"); + // assert(!GCLocker.is_active(), "Can't be called otherwise"); // But I am not placing that assert here to allow future // generality in invoking this interface. - if (GC_locker::is_active()) { - // A consistency test for GC_locker - assert(GC_locker::needs_gc(), "Should have been set already"); + if (GCLocker::is_active()) { + // A consistency test for GCLocker + assert(GCLocker::needs_gc(), "Should have been set already"); // Skip this foreground collection, instead // expanding the heap if necessary. // Need the free list locks for the call to free() in compute_new_size() @@ -3272,10 +3272,10 @@ void CMSConcMarkingTask::do_scan_and_mark(int i, CompactibleFreeListSpace* sp) { // Do the marking work within a non-empty span -- // the last argument to the constructor indicates whether the // iteration should be incremental with periodic yields. - Par_MarkFromRootsClosure cl(this, _collector, my_span, - &_collector->_markBitMap, - work_queue(i), - &_collector->_markStack); + ParMarkFromRootsClosure cl(this, _collector, my_span, + &_collector->_markBitMap, + work_queue(i), + &_collector->_markStack); _collector->_markBitMap.iterate(&cl, my_span.start(), my_span.end()); } // else nothing to do for this task } // else nothing to do for this task @@ -3291,7 +3291,7 @@ void CMSConcMarkingTask::do_scan_and_mark(int i, CompactibleFreeListSpace* sp) { pst->all_tasks_completed(); } -class Par_ConcMarkingClosure: public MetadataAwareOopClosure { +class ParConcMarkingClosure: public MetadataAwareOopClosure { private: CMSCollector* _collector; CMSConcMarkingTask* _task; @@ -3302,8 +3302,8 @@ class Par_ConcMarkingClosure: public MetadataAwareOopClosure { protected: DO_OOP_WORK_DEFN public: - Par_ConcMarkingClosure(CMSCollector* collector, CMSConcMarkingTask* task, OopTaskQueue* work_queue, - CMSBitMap* bit_map, CMSMarkStack* overflow_stack): + ParConcMarkingClosure(CMSCollector* collector, CMSConcMarkingTask* task, OopTaskQueue* work_queue, + CMSBitMap* bit_map, CMSMarkStack* overflow_stack): MetadataAwareOopClosure(collector->ref_processor()), _collector(collector), _task(task), @@ -3330,7 +3330,7 @@ class Par_ConcMarkingClosure: public MetadataAwareOopClosure { // already have been initialized (else they would not have // been published), so we do not need to check for // uninitialized objects before pushing here. -void Par_ConcMarkingClosure::do_oop(oop obj) { +void ParConcMarkingClosure::do_oop(oop obj) { assert(obj->is_oop_or_null(true), "Expected an oop or NULL at " PTR_FORMAT, p2i(obj)); HeapWord* addr = (HeapWord*)obj; // Check if oop points into the CMS generation @@ -3366,10 +3366,10 @@ void Par_ConcMarkingClosure::do_oop(oop obj) { } } -void Par_ConcMarkingClosure::do_oop(oop* p) { Par_ConcMarkingClosure::do_oop_work(p); } -void Par_ConcMarkingClosure::do_oop(narrowOop* p) { Par_ConcMarkingClosure::do_oop_work(p); } +void ParConcMarkingClosure::do_oop(oop* p) { ParConcMarkingClosure::do_oop_work(p); } +void ParConcMarkingClosure::do_oop(narrowOop* p) { ParConcMarkingClosure::do_oop_work(p); } -void Par_ConcMarkingClosure::trim_queue(size_t max) { +void ParConcMarkingClosure::trim_queue(size_t max) { while (_work_queue->size() > max) { oop new_oop; if (_work_queue->pop_local(new_oop)) { @@ -3385,7 +3385,7 @@ void Par_ConcMarkingClosure::trim_queue(size_t max) { // Upon stack overflow, we discard (part of) the stack, // remembering the least address amongst those discarded // in CMSCollector's _restart_address. -void Par_ConcMarkingClosure::handle_stack_overflow(HeapWord* lost) { +void ParConcMarkingClosure::handle_stack_overflow(HeapWord* lost) { // We need to do this under a mutex to prevent other // workers from interfering with the work done below. MutexLockerEx ml(_overflow_stack->par_lock(), @@ -3404,7 +3404,7 @@ void CMSConcMarkingTask::do_work_steal(int i) { CMSBitMap* bm = &(_collector->_markBitMap); CMSMarkStack* ovflw = &(_collector->_markStack); int* seed = _collector->hash_seed(i); - Par_ConcMarkingClosure cl(_collector, this, work_q, bm, ovflw); + ParConcMarkingClosure cl(_collector, this, work_q, bm, ovflw); while (true) { cl.trim_queue(0); assert(work_q->size() == 0, "Should have been emptied above"); @@ -4246,7 +4246,7 @@ void CMSParInitialMarkTask::work(uint worker_id) { // ---------- scan from roots -------------- _timer.start(); GenCollectedHeap* gch = GenCollectedHeap::heap(); - Par_MarkRefsIntoClosure par_mri_cl(_collector->_span, &(_collector->_markBitMap)); + ParMarkRefsIntoClosure par_mri_cl(_collector->_span, &(_collector->_markBitMap)); // ---------- young gen roots -------------- { @@ -4312,10 +4312,10 @@ class CMSParRemarkTask: public CMSParMarkTask { private: // ... of dirty cards in old space void do_dirty_card_rescan_tasks(CompactibleFreeListSpace* sp, int i, - Par_MarkRefsIntoAndScanClosure* cl); + ParMarkRefsIntoAndScanClosure* cl); // ... work stealing for the above - void do_work_steal(int i, Par_MarkRefsIntoAndScanClosure* cl, int* seed); + void do_work_steal(int i, ParMarkRefsIntoAndScanClosure* cl, int* seed); }; class RemarkKlassClosure : public KlassClosure { @@ -4361,7 +4361,7 @@ void CMSParMarkTask::work_on_young_gen_roots(uint worker_id, OopsInGenClosure* c } // work_queue(i) is passed to the closure -// Par_MarkRefsIntoAndScanClosure. The "i" parameter +// ParMarkRefsIntoAndScanClosure. The "i" parameter // also is passed to do_dirty_card_rescan_tasks() and to // do_work_steal() to select the i-th task_queue. @@ -4373,7 +4373,7 @@ void CMSParRemarkTask::work(uint worker_id) { // ---------- rescan from roots -------------- _timer.start(); GenCollectedHeap* gch = GenCollectedHeap::heap(); - Par_MarkRefsIntoAndScanClosure par_mrias_cl(_collector, + ParMarkRefsIntoAndScanClosure par_mrias_cl(_collector, _collector->_span, _collector->ref_processor(), &(_collector->_markBitMap), work_queue(worker_id)); @@ -4522,7 +4522,7 @@ CMSParMarkTask::do_young_space_rescan(uint worker_id, void CMSParRemarkTask::do_dirty_card_rescan_tasks( CompactibleFreeListSpace* sp, int i, - Par_MarkRefsIntoAndScanClosure* cl) { + ParMarkRefsIntoAndScanClosure* cl) { // Until all tasks completed: // . claim an unclaimed task // . compute region boundaries corresponding to task claimed @@ -4614,7 +4614,7 @@ CMSParRemarkTask::do_dirty_card_rescan_tasks( // . see if we can share work_queues with ParNew? XXX void -CMSParRemarkTask::do_work_steal(int i, Par_MarkRefsIntoAndScanClosure* cl, +CMSParRemarkTask::do_work_steal(int i, ParMarkRefsIntoAndScanClosure* cl, int* seed) { OopTaskQueue* work_q = work_queue(i); NOT_PRODUCT(int num_steals = 0;) @@ -5832,7 +5832,7 @@ void MarkRefsIntoClosure::do_oop(oop obj) { void MarkRefsIntoClosure::do_oop(oop* p) { MarkRefsIntoClosure::do_oop_work(p); } void MarkRefsIntoClosure::do_oop(narrowOop* p) { MarkRefsIntoClosure::do_oop_work(p); } -Par_MarkRefsIntoClosure::Par_MarkRefsIntoClosure( +ParMarkRefsIntoClosure::ParMarkRefsIntoClosure( MemRegion span, CMSBitMap* bitMap): _span(span), _bitMap(bitMap) @@ -5841,7 +5841,7 @@ Par_MarkRefsIntoClosure::Par_MarkRefsIntoClosure( assert(_bitMap->covers(_span), "_bitMap/_span mismatch"); } -void Par_MarkRefsIntoClosure::do_oop(oop obj) { +void ParMarkRefsIntoClosure::do_oop(oop obj) { // if p points into _span, then mark corresponding bit in _markBitMap assert(obj->is_oop(), "expected an oop"); HeapWord* addr = (HeapWord*)obj; @@ -5851,8 +5851,8 @@ void Par_MarkRefsIntoClosure::do_oop(oop obj) { } } -void Par_MarkRefsIntoClosure::do_oop(oop* p) { Par_MarkRefsIntoClosure::do_oop_work(p); } -void Par_MarkRefsIntoClosure::do_oop(narrowOop* p) { Par_MarkRefsIntoClosure::do_oop_work(p); } +void ParMarkRefsIntoClosure::do_oop(oop* p) { ParMarkRefsIntoClosure::do_oop_work(p); } +void ParMarkRefsIntoClosure::do_oop(narrowOop* p) { ParMarkRefsIntoClosure::do_oop_work(p); } // A variant of the above, used for CMS marking verification. MarkRefsIntoVerifyClosure::MarkRefsIntoVerifyClosure( @@ -5989,10 +5989,10 @@ void MarkRefsIntoAndScanClosure::do_yield_work() { } /////////////////////////////////////////////////////////// -// Par_MarkRefsIntoAndScanClosure: a parallel version of -// MarkRefsIntoAndScanClosure +// ParMarkRefsIntoAndScanClosure: a parallel version of +// MarkRefsIntoAndScanClosure /////////////////////////////////////////////////////////// -Par_MarkRefsIntoAndScanClosure::Par_MarkRefsIntoAndScanClosure( +ParMarkRefsIntoAndScanClosure::ParMarkRefsIntoAndScanClosure( CMSCollector* collector, MemRegion span, ReferenceProcessor* rp, CMSBitMap* bit_map, OopTaskQueue* work_queue): _span(span), @@ -6000,7 +6000,7 @@ Par_MarkRefsIntoAndScanClosure::Par_MarkRefsIntoAndScanClosure( _work_queue(work_queue), _low_water_mark(MIN2((work_queue->max_elems()/4), ((uint)CMSWorkQueueDrainThreshold * ParallelGCThreads))), - _par_pushAndMarkClosure(collector, span, rp, bit_map, work_queue) + _parPushAndMarkClosure(collector, span, rp, bit_map, work_queue) { // FIXME: Should initialize in base class constructor. assert(rp != NULL, "ref_processor shouldn't be NULL"); @@ -6014,7 +6014,7 @@ Par_MarkRefsIntoAndScanClosure::Par_MarkRefsIntoAndScanClosure( // the scan phase whence they are also available for stealing by parallel // threads. Since the marking bit map is shared, updates are // synchronized (via CAS). -void Par_MarkRefsIntoAndScanClosure::do_oop(oop obj) { +void ParMarkRefsIntoAndScanClosure::do_oop(oop obj) { if (obj != NULL) { // Ignore mark word because this could be an already marked oop // that may be chained at the end of the overflow list. @@ -6041,8 +6041,8 @@ void Par_MarkRefsIntoAndScanClosure::do_oop(oop obj) { } } -void Par_MarkRefsIntoAndScanClosure::do_oop(oop* p) { Par_MarkRefsIntoAndScanClosure::do_oop_work(p); } -void Par_MarkRefsIntoAndScanClosure::do_oop(narrowOop* p) { Par_MarkRefsIntoAndScanClosure::do_oop_work(p); } +void ParMarkRefsIntoAndScanClosure::do_oop(oop* p) { ParMarkRefsIntoAndScanClosure::do_oop_work(p); } +void ParMarkRefsIntoAndScanClosure::do_oop(narrowOop* p) { ParMarkRefsIntoAndScanClosure::do_oop_work(p); } // This closure is used to rescan the marked objects on the dirty cards // in the mod union table and the card table proper. @@ -6426,7 +6426,7 @@ void MarkFromRootsClosure::scanOopsInOop(HeapWord* ptr) { assert(_markStack->isEmpty(), "tautology, emphasizing post-condition"); } -Par_MarkFromRootsClosure::Par_MarkFromRootsClosure(CMSConcMarkingTask* task, +ParMarkFromRootsClosure::ParMarkFromRootsClosure(CMSConcMarkingTask* task, CMSCollector* collector, MemRegion span, CMSBitMap* bit_map, OopTaskQueue* work_queue, @@ -6449,7 +6449,7 @@ Par_MarkFromRootsClosure::Par_MarkFromRootsClosure(CMSConcMarkingTask* task, // Should revisit to see if this should be restructured for // greater efficiency. -bool Par_MarkFromRootsClosure::do_bit(size_t offset) { +bool ParMarkFromRootsClosure::do_bit(size_t offset) { if (_skip_bits > 0) { _skip_bits--; return true; @@ -6474,7 +6474,7 @@ bool Par_MarkFromRootsClosure::do_bit(size_t offset) { return true; } -void Par_MarkFromRootsClosure::scan_oops_in_oop(HeapWord* ptr) { +void ParMarkFromRootsClosure::scan_oops_in_oop(HeapWord* ptr) { assert(_bit_map->isMarked(ptr), "expected bit to be set"); // Should we assert that our work queue is empty or // below some drain limit? @@ -6524,12 +6524,12 @@ void Par_MarkFromRootsClosure::scan_oops_in_oop(HeapWord* ptr) { // Note: the local finger doesn't advance while we drain // the stack below, but the global finger sure can and will. HeapWord** gfa = _task->global_finger_addr(); - Par_PushOrMarkClosure pushOrMarkClosure(_collector, - _span, _bit_map, - _work_queue, - _overflow_stack, - _finger, - gfa, this); + ParPushOrMarkClosure pushOrMarkClosure(_collector, + _span, _bit_map, + _work_queue, + _overflow_stack, + _finger, + gfa, this); bool res = _work_queue->push(obj); // overflow could occur here assert(res, "Will hold once we use workqueues"); while (true) { @@ -6557,7 +6557,7 @@ void Par_MarkFromRootsClosure::scan_oops_in_oop(HeapWord* ptr) { // Yield in response to a request from VM Thread or // from mutators. -void Par_MarkFromRootsClosure::do_yield_work() { +void ParMarkFromRootsClosure::do_yield_work() { assert(_task != NULL, "sanity"); _task->yield(); } @@ -6684,14 +6684,14 @@ PushOrMarkClosure::PushOrMarkClosure(CMSCollector* collector, _parent(parent) { } -Par_PushOrMarkClosure::Par_PushOrMarkClosure(CMSCollector* collector, - MemRegion span, - CMSBitMap* bit_map, - OopTaskQueue* work_queue, - CMSMarkStack* overflow_stack, - HeapWord* finger, - HeapWord** global_finger_addr, - Par_MarkFromRootsClosure* parent) : +ParPushOrMarkClosure::ParPushOrMarkClosure(CMSCollector* collector, + MemRegion span, + CMSBitMap* bit_map, + OopTaskQueue* work_queue, + CMSMarkStack* overflow_stack, + HeapWord* finger, + HeapWord** global_finger_addr, + ParMarkFromRootsClosure* parent) : MetadataAwareOopClosure(collector->ref_processor()), _collector(collector), _whole_span(collector->_span), @@ -6729,7 +6729,7 @@ void PushOrMarkClosure::handle_stack_overflow(HeapWord* lost) { // Upon stack overflow, we discard (part of) the stack, // remembering the least address amongst those discarded // in CMSCollector's _restart_address. -void Par_PushOrMarkClosure::handle_stack_overflow(HeapWord* lost) { +void ParPushOrMarkClosure::handle_stack_overflow(HeapWord* lost) { // We need to do this under a mutex to prevent other // workers from interfering with the work done below. MutexLockerEx ml(_overflow_stack->par_lock(), @@ -6776,7 +6776,7 @@ void PushOrMarkClosure::do_oop(oop obj) { void PushOrMarkClosure::do_oop(oop* p) { PushOrMarkClosure::do_oop_work(p); } void PushOrMarkClosure::do_oop(narrowOop* p) { PushOrMarkClosure::do_oop_work(p); } -void Par_PushOrMarkClosure::do_oop(oop obj) { +void ParPushOrMarkClosure::do_oop(oop obj) { // Ignore mark word because we are running concurrent with mutators. assert(obj->is_oop_or_null(true), "Expected an oop or NULL at " PTR_FORMAT, p2i(obj)); HeapWord* addr = (HeapWord*)obj; @@ -6822,8 +6822,8 @@ void Par_PushOrMarkClosure::do_oop(oop obj) { } } -void Par_PushOrMarkClosure::do_oop(oop* p) { Par_PushOrMarkClosure::do_oop_work(p); } -void Par_PushOrMarkClosure::do_oop(narrowOop* p) { Par_PushOrMarkClosure::do_oop_work(p); } +void ParPushOrMarkClosure::do_oop(oop* p) { ParPushOrMarkClosure::do_oop_work(p); } +void ParPushOrMarkClosure::do_oop(narrowOop* p) { ParPushOrMarkClosure::do_oop_work(p); } PushAndMarkClosure::PushAndMarkClosure(CMSCollector* collector, MemRegion span, @@ -6900,11 +6900,11 @@ void PushAndMarkClosure::do_oop(oop obj) { } } -Par_PushAndMarkClosure::Par_PushAndMarkClosure(CMSCollector* collector, - MemRegion span, - ReferenceProcessor* rp, - CMSBitMap* bit_map, - OopTaskQueue* work_queue): +ParPushAndMarkClosure::ParPushAndMarkClosure(CMSCollector* collector, + MemRegion span, + ReferenceProcessor* rp, + CMSBitMap* bit_map, + OopTaskQueue* work_queue): MetadataAwareOopClosure(rp), _collector(collector), _span(span), @@ -6919,7 +6919,7 @@ void PushAndMarkClosure::do_oop(narrowOop* p) { PushAndMarkClosure::do_oop_work( // Grey object rescan during second checkpoint phase -- // the parallel version. -void Par_PushAndMarkClosure::do_oop(oop obj) { +void ParPushAndMarkClosure::do_oop(oop obj) { // In the assert below, we ignore the mark word because // this oop may point to an already visited object that is // on the overflow stack (in which case the mark word has @@ -6959,8 +6959,8 @@ void Par_PushAndMarkClosure::do_oop(oop obj) { } } -void Par_PushAndMarkClosure::do_oop(oop* p) { Par_PushAndMarkClosure::do_oop_work(p); } -void Par_PushAndMarkClosure::do_oop(narrowOop* p) { Par_PushAndMarkClosure::do_oop_work(p); } +void ParPushAndMarkClosure::do_oop(oop* p) { ParPushAndMarkClosure::do_oop_work(p); } +void ParPushAndMarkClosure::do_oop(narrowOop* p) { ParPushAndMarkClosure::do_oop_work(p); } void CMSPrecleanRefsYieldClosure::do_yield_work() { Mutex* bml = _collector->bitMapLock(); diff --git a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp index ead101fce85..29636c60060 100644 --- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp @@ -510,17 +510,17 @@ class CMSCollector: public CHeapObj { friend class ScanMarkedObjectsAgainCarefullyClosure; // for sampling eden friend class SurvivorSpacePrecleanClosure; // --- ditto ------- friend class PushOrMarkClosure; // to access _restart_addr - friend class Par_PushOrMarkClosure; // to access _restart_addr + friend class ParPushOrMarkClosure; // to access _restart_addr friend class MarkFromRootsClosure; // -- ditto -- // ... and for clearing cards - friend class Par_MarkFromRootsClosure; // to access _restart_addr + friend class ParMarkFromRootsClosure; // to access _restart_addr // ... and for clearing cards - friend class Par_ConcMarkingClosure; // to access _restart_addr etc. + friend class ParConcMarkingClosure; // to access _restart_addr etc. friend class MarkFromRootsVerifyClosure; // to access _restart_addr friend class PushAndMarkVerifyClosure; // -- ditto -- friend class MarkRefsIntoAndScanClosure; // to access _overflow_list friend class PushAndMarkClosure; // -- ditto -- - friend class Par_PushAndMarkClosure; // -- ditto -- + friend class ParPushAndMarkClosure; // -- ditto -- friend class CMSKeepAliveClosure; // -- ditto -- friend class CMSDrainMarkingStackClosure; // -- ditto -- friend class CMSInnerParMarkAndPushClosure; // -- ditto -- @@ -1282,7 +1282,7 @@ class MarkFromRootsClosure: public BitMapClosure { // marking from the roots following the first checkpoint. // XXX This should really be a subclass of The serial version // above, but i have not had the time to refactor things cleanly. -class Par_MarkFromRootsClosure: public BitMapClosure { +class ParMarkFromRootsClosure: public BitMapClosure { CMSCollector* _collector; MemRegion _whole_span; MemRegion _span; @@ -1295,11 +1295,11 @@ class Par_MarkFromRootsClosure: public BitMapClosure { HeapWord* _threshold; CMSConcMarkingTask* _task; public: - Par_MarkFromRootsClosure(CMSConcMarkingTask* task, CMSCollector* collector, - MemRegion span, - CMSBitMap* bit_map, - OopTaskQueue* work_queue, - CMSMarkStack* overflow_stack); + ParMarkFromRootsClosure(CMSConcMarkingTask* task, CMSCollector* collector, + MemRegion span, + CMSBitMap* bit_map, + OopTaskQueue* work_queue, + CMSMarkStack* overflow_stack); bool do_bit(size_t offset); inline void do_yield_check(); @@ -1400,8 +1400,8 @@ class ScanMarkedObjectsAgainClosure: public UpwardsObjectClosure { bool _parallel; CMSBitMap* _bit_map; union { - MarkRefsIntoAndScanClosure* _scan_closure; - Par_MarkRefsIntoAndScanClosure* _par_scan_closure; + MarkRefsIntoAndScanClosure* _scan_closure; + ParMarkRefsIntoAndScanClosure* _par_scan_closure; }; public: @@ -1425,7 +1425,7 @@ class ScanMarkedObjectsAgainClosure: public UpwardsObjectClosure { ReferenceProcessor* rp, CMSBitMap* bit_map, OopTaskQueue* work_queue, - Par_MarkRefsIntoAndScanClosure* cl): + ParMarkRefsIntoAndScanClosure* cl): #ifdef ASSERT _collector(collector), _span(span), @@ -1470,7 +1470,7 @@ class MarkFromDirtyCardsClosure: public MemRegionClosure { CompactibleFreeListSpace* space, CMSBitMap* bit_map, OopTaskQueue* work_queue, - Par_MarkRefsIntoAndScanClosure* cl): + ParMarkRefsIntoAndScanClosure* cl): _space(space), _num_dirty_cards(0), _scan_cl(collector, span, collector->ref_processor(), bit_map, diff --git a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.inline.hpp b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.inline.hpp index d2a76256702..97ff69d611c 100644 --- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.inline.hpp +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.inline.hpp @@ -381,7 +381,7 @@ inline void MarkFromRootsClosure::do_yield_check() { } } -inline void Par_MarkFromRootsClosure::do_yield_check() { +inline void ParMarkFromRootsClosure::do_yield_check() { if (ConcurrentMarkSweepThread::should_yield() && !_collector->foregroundGCIsActive()) { do_yield_work(); @@ -392,7 +392,7 @@ inline void PushOrMarkClosure::do_yield_check() { _parent->do_yield_check(); } -inline void Par_PushOrMarkClosure::do_yield_check() { +inline void ParPushOrMarkClosure::do_yield_check() { _parent->do_yield_check(); } diff --git a/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp b/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp index 2cd32b097dc..9918dd00edc 100644 --- a/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp +++ b/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp @@ -455,7 +455,7 @@ void ParScanThreadStateSet::flush() { // Every thread has its own age table. We need to merge // them all into one. - ageTable *local_table = par_scan_state.age_table(); + AgeTable *local_table = par_scan_state.age_table(); _young_gen.age_table()->merge(local_table); // Inform old gen that we're done. @@ -469,7 +469,7 @@ void ParScanThreadStateSet::flush() { // to avoid this by reorganizing the code a bit, I am loathe // to do that unless we find cases where ergo leads to bad // performance. - CFLS_LAB::compute_desired_plab_size(); + CompactibleFreeListSpaceLAB::compute_desired_plab_size(); } } diff --git a/hotspot/src/share/vm/gc/cms/parNewGeneration.hpp b/hotspot/src/share/vm/gc/cms/parNewGeneration.hpp index 428c195f96c..765ea72962e 100644 --- a/hotspot/src/share/vm/gc/cms/parNewGeneration.hpp +++ b/hotspot/src/share/vm/gc/cms/parNewGeneration.hpp @@ -94,7 +94,7 @@ class ParScanThreadState { int _hash_seed; int _thread_num; - ageTable _ageTable; + AgeTable _ageTable; bool _to_space_full; @@ -132,7 +132,7 @@ class ParScanThreadState { ParallelTaskTerminator& term_); public: - ageTable* age_table() {return &_ageTable;} + AgeTable* age_table() {return &_ageTable;} ObjToScanQueue* work_queue() { return _work_queue; } diff --git a/hotspot/src/share/vm/gc/cms/vmCMSOperations.cpp b/hotspot/src/share/vm/gc/cms/vmCMSOperations.cpp index dcdfa854377..e26b3842a9a 100644 --- a/hotspot/src/share/vm/gc/cms/vmCMSOperations.cpp +++ b/hotspot/src/share/vm/gc/cms/vmCMSOperations.cpp @@ -203,7 +203,7 @@ void VM_GenCollectFullConcurrent::doit() { gch->do_full_collection(gch->must_clear_all_soft_refs(), GenCollectedHeap::YoungGen); } // Else no need for a foreground young gc assert((_gc_count_before < gch->total_collections()) || - (GC_locker::is_active() /* gc may have been skipped */ + (GCLocker::is_active() /* gc may have been skipped */ && (_gc_count_before == gch->total_collections())), "total_collections() should be monotonically increasing"); diff --git a/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp b/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp index 3869a648af9..155faa0be5a 100644 --- a/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp +++ b/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp @@ -32,6 +32,72 @@ #include "runtime/safepoint.hpp" #include "runtime/thread.inline.hpp" +// Represents a set of free small integer ids. +class FreeIdSet : public CHeapObj { + enum { + end_of_list = UINT_MAX, + claimed = UINT_MAX - 1 + }; + + uint _size; + Monitor* _mon; + + uint* _ids; + uint _hd; + uint _waiters; + uint _claimed; + +public: + FreeIdSet(uint size, Monitor* mon); + ~FreeIdSet(); + + // Returns an unclaimed parallel id (waiting for one to be released if + // necessary). + uint claim_par_id(); + + void release_par_id(uint id); +}; + +FreeIdSet::FreeIdSet(uint size, Monitor* mon) : + _size(size), _mon(mon), _hd(0), _waiters(0), _claimed(0) +{ + guarantee(size != 0, "must be"); + _ids = NEW_C_HEAP_ARRAY(uint, size, mtGC); + for (uint i = 0; i < size - 1; i++) { + _ids[i] = i+1; + } + _ids[size-1] = end_of_list; // end of list. +} + +FreeIdSet::~FreeIdSet() { + FREE_C_HEAP_ARRAY(uint, _ids); +} + +uint FreeIdSet::claim_par_id() { + MutexLockerEx x(_mon, Mutex::_no_safepoint_check_flag); + while (_hd == end_of_list) { + _waiters++; + _mon->wait(Mutex::_no_safepoint_check_flag); + _waiters--; + } + uint res = _hd; + _hd = _ids[res]; + _ids[res] = claimed; // For debugging. + _claimed++; + return res; +} + +void FreeIdSet::release_par_id(uint id) { + MutexLockerEx x(_mon, Mutex::_no_safepoint_check_flag); + assert(_ids[id] == claimed, "Precondition."); + _ids[id] = _hd; + _hd = id; + _claimed--; + if (_waiters > 0) { + _mon->notify_all(); + } +} + DirtyCardQueue::DirtyCardQueue(DirtyCardQueueSet* qset, bool permanent) : // Dirty card queues are always active, so we create them with their // active field set to true. @@ -103,7 +169,8 @@ void DirtyCardQueueSet::initialize(CardTableEntryClosure* cl, int process_completed_threshold, int max_completed_queue, Mutex* lock, - DirtyCardQueueSet* fl_owner) { + DirtyCardQueueSet* fl_owner, + bool init_free_ids) { _mut_process_closure = cl; PtrQueueSet::initialize(cbl_mon, fl_lock, @@ -112,7 +179,9 @@ void DirtyCardQueueSet::initialize(CardTableEntryClosure* cl, fl_owner); set_buffer_size(G1UpdateBufferSize); _shared_dirty_card_queue.set_lock(lock); - _free_ids = new FreeIdSet(num_par_ids(), _cbl_mon); + if (init_free_ids) { + _free_ids = new FreeIdSet(num_par_ids(), _cbl_mon); + } } void DirtyCardQueueSet::handle_zero_index_for_thread(JavaThread* t) { @@ -120,48 +189,20 @@ void DirtyCardQueueSet::handle_zero_index_for_thread(JavaThread* t) { } bool DirtyCardQueueSet::mut_process_buffer(void** buf) { + guarantee(_free_ids != NULL, "must be"); - // Used to determine if we had already claimed a par_id - // before entering this method. - bool already_claimed = false; + // claim a par id + uint worker_i = _free_ids->claim_par_id(); - // We grab the current JavaThread. - JavaThread* thread = JavaThread::current(); - - // We get the the number of any par_id that this thread - // might have already claimed. - uint worker_i = thread->get_claimed_par_id(); - - // If worker_i is not UINT_MAX then the thread has already claimed - // a par_id. We make note of it using the already_claimed value - if (worker_i != UINT_MAX) { - already_claimed = true; - } else { - - // Otherwise we need to claim a par id - worker_i = _free_ids->claim_par_id(); - - // And store the par_id value in the thread - thread->set_claimed_par_id(worker_i); + bool b = DirtyCardQueue::apply_closure_to_buffer(_mut_process_closure, buf, 0, + _sz, true, worker_i); + if (b) { + Atomic::inc(&_processed_buffers_mut); } - bool b = false; - if (worker_i != UINT_MAX) { - b = DirtyCardQueue::apply_closure_to_buffer(_mut_process_closure, buf, 0, - _sz, true, worker_i); - if (b) Atomic::inc(&_processed_buffers_mut); + // release the id + _free_ids->release_par_id(worker_i); - // If we had not claimed an id before entering the method - // then we must release the id. - if (!already_claimed) { - - // we release the id - _free_ids->release_par_id(worker_i); - - // and set the claimed_id in the thread to UINT_MAX - thread->set_claimed_par_id(UINT_MAX); - } - } return b; } diff --git a/hotspot/src/share/vm/gc/g1/dirtyCardQueue.hpp b/hotspot/src/share/vm/gc/g1/dirtyCardQueue.hpp index f3f9bb18a07..9fa3c3da069 100644 --- a/hotspot/src/share/vm/gc/g1/dirtyCardQueue.hpp +++ b/hotspot/src/share/vm/gc/g1/dirtyCardQueue.hpp @@ -116,7 +116,8 @@ public: int process_completed_threshold, int max_completed_queue, Mutex* lock, - DirtyCardQueueSet* fl_owner = NULL); + DirtyCardQueueSet* fl_owner, + bool init_free_ids = false); // The number of parallel ids that can be claimed to allow collector or // mutator threads to do card-processing work. diff --git a/hotspot/src/share/vm/gc/g1/g1AllocRegion.cpp b/hotspot/src/share/vm/gc/g1/g1AllocRegion.cpp index f7a9c8e8414..f08cd59a059 100644 --- a/hotspot/src/share/vm/gc/g1/g1AllocRegion.cpp +++ b/hotspot/src/share/vm/gc/g1/g1AllocRegion.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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 @@ -277,7 +277,7 @@ HeapRegion* OldGCAllocRegion::release() { // Determine how far we are from the next card boundary. If it is smaller than // the minimum object size we can allocate into, expand into the next card. HeapWord* top = cur->top(); - HeapWord* aligned_top = (HeapWord*)align_ptr_up(top, G1BlockOffsetSharedArray::N_bytes); + HeapWord* aligned_top = (HeapWord*)align_ptr_up(top, BOTConstants::N_bytes); size_t to_allocate_words = pointer_delta(aligned_top, top, HeapWordSize); diff --git a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp index a123477e58e..3a50ee45a6b 100644 --- a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp +++ b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, 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 @@ -35,38 +35,32 @@ ////////////////////////////////////////////////////////////////////// -// G1BlockOffsetSharedArray +// G1BlockOffsetTable ////////////////////////////////////////////////////////////////////// -G1BlockOffsetSharedArray::G1BlockOffsetSharedArray(MemRegion heap, G1RegionToSpaceMapper* storage) : - _reserved(), _end(NULL), _listener(), _offset_array(NULL) { - - _reserved = heap; - _end = NULL; +G1BlockOffsetTable::G1BlockOffsetTable(MemRegion heap, G1RegionToSpaceMapper* storage) : + _reserved(heap), _offset_array(NULL) { MemRegion bot_reserved = storage->reserved(); _offset_array = (u_char*)bot_reserved.start(); - _end = _reserved.end(); - storage->set_mapping_changed_listener(&_listener); - - log_trace(gc, bot)("G1BlockOffsetSharedArray::G1BlockOffsetSharedArray: "); + log_trace(gc, bot)("G1BlockOffsetTable::G1BlockOffsetTable: "); log_trace(gc, bot)(" rs.base(): " PTR_FORMAT " rs.size(): " SIZE_FORMAT " rs end(): " PTR_FORMAT, p2i(bot_reserved.start()), bot_reserved.byte_size(), p2i(bot_reserved.end())); } -bool G1BlockOffsetSharedArray::is_card_boundary(HeapWord* p) const { +bool G1BlockOffsetTable::is_card_boundary(HeapWord* p) const { assert(p >= _reserved.start(), "just checking"); size_t delta = pointer_delta(p, _reserved.start()); - return (delta & right_n_bits(LogN_words)) == (size_t)NoBits; + return (delta & right_n_bits((int)BOTConstants::LogN_words)) == (size_t)NoBits; } #ifdef ASSERT -void G1BlockOffsetSharedArray::check_index(size_t index, const char* msg) const { - assert((index) < (_reserved.word_size() >> LogN_words), +void G1BlockOffsetTable::check_index(size_t index, const char* msg) const { + assert((index) < (_reserved.word_size() >> BOTConstants::LogN_words), "%s - index: " SIZE_FORMAT ", _vs.committed_size: " SIZE_FORMAT, - msg, (index), (_reserved.word_size() >> LogN_words)); + msg, (index), (_reserved.word_size() >> BOTConstants::LogN_words)); assert(G1CollectedHeap::heap()->is_in_exact(address_for_index_raw(index)), "Index " SIZE_FORMAT " corresponding to " PTR_FORMAT " (%u) is not in committed area.", @@ -77,25 +71,19 @@ void G1BlockOffsetSharedArray::check_index(size_t index, const char* msg) const #endif // ASSERT ////////////////////////////////////////////////////////////////////// -// G1BlockOffsetArray +// G1BlockOffsetTablePart ////////////////////////////////////////////////////////////////////// -G1BlockOffsetArray::G1BlockOffsetArray(G1BlockOffsetSharedArray* array, - MemRegion mr) : - G1BlockOffsetTable(mr.start(), mr.end()), - _unallocated_block(_bottom), - _array(array), _gsp(NULL) { - assert(_bottom <= _end, "arguments out of order"); -} - -void G1BlockOffsetArray::set_space(G1OffsetTableContigSpace* sp) { - _gsp = sp; -} +G1BlockOffsetTablePart::G1BlockOffsetTablePart(G1BlockOffsetTable* array, G1ContiguousSpace* gsp) : + _bot(array), + _space(gsp), + _next_offset_threshold(NULL), + _next_offset_index(0) +{ } // The arguments follow the normal convention of denoting // a right-open interval: [start, end) -void -G1BlockOffsetArray:: set_remainder_to_point_to_start(HeapWord* start, HeapWord* end) { +void G1BlockOffsetTablePart:: set_remainder_to_point_to_start(HeapWord* start, HeapWord* end) { if (start >= end) { // The start address is equal to the end address (or to @@ -137,38 +125,37 @@ G1BlockOffsetArray:: set_remainder_to_point_to_start(HeapWord* start, HeapWord* // Move back N (e.g., 8) entries and repeat with the // value of the new entry // - size_t start_card = _array->index_for(start); - size_t end_card = _array->index_for(end-1); - assert(start ==_array->address_for_index(start_card), "Precondition"); - assert(end ==_array->address_for_index(end_card)+N_words, "Precondition"); + size_t start_card = _bot->index_for(start); + size_t end_card = _bot->index_for(end-1); + assert(start ==_bot->address_for_index(start_card), "Precondition"); + assert(end ==_bot->address_for_index(end_card)+BOTConstants::N_words, "Precondition"); set_remainder_to_point_to_start_incl(start_card, end_card); // closed interval } // Unlike the normal convention in this code, the argument here denotes // a closed, inclusive interval: [start_card, end_card], cf set_remainder_to_point_to_start() // above. -void -G1BlockOffsetArray::set_remainder_to_point_to_start_incl(size_t start_card, size_t end_card) { +void G1BlockOffsetTablePart::set_remainder_to_point_to_start_incl(size_t start_card, size_t end_card) { if (start_card > end_card) { return; } - assert(start_card > _array->index_for(_bottom), "Cannot be first card"); - assert(_array->offset_array(start_card-1) <= N_words, + assert(start_card > _bot->index_for(_space->bottom()), "Cannot be first card"); + assert(_bot->offset_array(start_card-1) <= BOTConstants::N_words, "Offset card has an unexpected value"); size_t start_card_for_region = start_card; u_char offset = max_jubyte; - for (int i = 0; i < BlockOffsetArray::N_powers; i++) { + for (uint i = 0; i < BOTConstants::N_powers; i++) { // -1 so that the the card with the actual offset is counted. Another -1 // so that the reach ends in this region and not at the start // of the next. - size_t reach = start_card - 1 + (BlockOffsetArray::power_to_cards_back(i+1) - 1); - offset = N_words + i; + size_t reach = start_card - 1 + (BOTConstants::power_to_cards_back(i+1) - 1); + offset = BOTConstants::N_words + i; if (reach >= end_card) { - _array->set_offset_array(start_card_for_region, end_card, offset); + _bot->set_offset_array(start_card_for_region, end_card, offset); start_card_for_region = reach + 1; break; } - _array->set_offset_array(start_card_for_region, reach, offset); + _bot->set_offset_array(start_card_for_region, reach, offset); start_card_for_region = reach + 1; } assert(start_card_for_region > end_card, "Sanity check"); @@ -178,79 +165,44 @@ G1BlockOffsetArray::set_remainder_to_point_to_start_incl(size_t start_card, size // The card-interval [start_card, end_card] is a closed interval; this // is an expensive check -- use with care and only under protection of // suitable flag. -void G1BlockOffsetArray::check_all_cards(size_t start_card, size_t end_card) const { +void G1BlockOffsetTablePart::check_all_cards(size_t start_card, size_t end_card) const { if (end_card < start_card) { return; } - guarantee(_array->offset_array(start_card) == N_words, "Wrong value in second card"); + guarantee(_bot->offset_array(start_card) == BOTConstants::N_words, "Wrong value in second card"); for (size_t c = start_card + 1; c <= end_card; c++ /* yeah! */) { - u_char entry = _array->offset_array(c); - if (c - start_card > BlockOffsetArray::power_to_cards_back(1)) { - guarantee(entry > N_words, + u_char entry = _bot->offset_array(c); + if (c - start_card > BOTConstants::power_to_cards_back(1)) { + guarantee(entry > BOTConstants::N_words, "Should be in logarithmic region - " "entry: %u, " "_array->offset_array(c): %u, " "N_words: %u", - (uint)entry, (uint)_array->offset_array(c), (uint)N_words); + (uint)entry, (uint)_bot->offset_array(c), BOTConstants::N_words); } - size_t backskip = BlockOffsetArray::entry_to_cards_back(entry); + size_t backskip = BOTConstants::entry_to_cards_back(entry); size_t landing_card = c - backskip; guarantee(landing_card >= (start_card - 1), "Inv"); if (landing_card >= start_card) { - guarantee(_array->offset_array(landing_card) <= entry, + guarantee(_bot->offset_array(landing_card) <= entry, "Monotonicity - landing_card offset: %u, " "entry: %u", - (uint)_array->offset_array(landing_card), (uint)entry); + (uint)_bot->offset_array(landing_card), (uint)entry); } else { guarantee(landing_card == start_card - 1, "Tautology"); // Note that N_words is the maximum offset value - guarantee(_array->offset_array(landing_card) <= N_words, + guarantee(_bot->offset_array(landing_card) <= BOTConstants::N_words, "landing card offset: %u, " "N_words: %u", - (uint)_array->offset_array(landing_card), (uint)N_words); + (uint)_bot->offset_array(landing_card), (uint)BOTConstants::N_words); } } } -HeapWord* G1BlockOffsetArray::block_start_unsafe(const void* addr) { - assert(_bottom <= addr && addr < _end, - "addr must be covered by this Array"); - // Must read this exactly once because it can be modified by parallel - // allocation. - HeapWord* ub = _unallocated_block; - if (BlockOffsetArrayUseUnallocatedBlock && addr >= ub) { - assert(ub < _end, "tautology (see above)"); - return ub; - } - // Otherwise, find the block start using the table. - HeapWord* q = block_at_or_preceding(addr, false, 0); - return forward_to_block_containing_addr(q, addr); -} - -// This duplicates a little code from the above: unavoidable. -HeapWord* -G1BlockOffsetArray::block_start_unsafe_const(const void* addr) const { - assert(_bottom <= addr && addr < _end, - "addr must be covered by this Array"); - // Must read this exactly once because it can be modified by parallel - // allocation. - HeapWord* ub = _unallocated_block; - if (BlockOffsetArrayUseUnallocatedBlock && addr >= ub) { - assert(ub < _end, "tautology (see above)"); - return ub; - } - // Otherwise, find the block start using the table. - HeapWord* q = block_at_or_preceding(addr, false, 0); - HeapWord* n = q + block_size(q); - return forward_to_block_containing_addr_const(q, n, addr); -} - - -HeapWord* -G1BlockOffsetArray::forward_to_block_containing_addr_slow(HeapWord* q, - HeapWord* n, - const void* addr) { +HeapWord* G1BlockOffsetTablePart::forward_to_block_containing_addr_slow(HeapWord* q, + HeapWord* n, + const void* addr) { // We're not in the normal case. We need to handle an important subcase // here: LAB allocation. An allocation previously recorded in the // offset table was actually a lab allocation, and was divided into @@ -260,17 +212,17 @@ G1BlockOffsetArray::forward_to_block_containing_addr_slow(HeapWord* q, // If the fist object's end q is at the card boundary. Start refining // with the corresponding card (the value of the entry will be basically // set to 0). If the object crosses the boundary -- start from the next card. - size_t n_index = _array->index_for(n); - size_t next_index = _array->index_for(n) + !_array->is_card_boundary(n); + size_t n_index = _bot->index_for(n); + size_t next_index = _bot->index_for(n) + !_bot->is_card_boundary(n); // Calculate a consistent next boundary. If "n" is not at the boundary // already, step to the boundary. - HeapWord* next_boundary = _array->address_for_index(n_index) + - (n_index == next_index ? 0 : N_words); - assert(next_boundary <= _array->_end, + HeapWord* next_boundary = _bot->address_for_index(n_index) + + (n_index == next_index ? 0 : BOTConstants::N_words); + assert(next_boundary <= _bot->_reserved.end(), "next_boundary is beyond the end of the covered region " " next_boundary " PTR_FORMAT " _array->_end " PTR_FORMAT, - p2i(next_boundary), p2i(_array->_end)); - if (addr >= gsp()->top()) return gsp()->top(); + p2i(next_boundary), p2i(_bot->_reserved.end())); + if (addr >= _space->top()) return _space->top(); while (next_boundary < addr) { while (n <= next_boundary) { q = n; @@ -280,18 +232,11 @@ G1BlockOffsetArray::forward_to_block_containing_addr_slow(HeapWord* q, } assert(q <= next_boundary && n > next_boundary, "Consequence of loop"); // [q, n) is the block that crosses the boundary. - alloc_block_work2(&next_boundary, &next_index, q, n); + alloc_block_work(&next_boundary, &next_index, q, n); } return forward_to_block_containing_addr_const(q, n, addr); } -// Note that the committed size of the covered space may have changed, -// so the table size might also wish to change. -void G1BlockOffsetArray::resize(size_t new_word_size) { - HeapWord* new_end = _bottom + new_word_size; - _end = new_end; // update _end -} - // // threshold_ // | _index_ @@ -302,8 +247,8 @@ void G1BlockOffsetArray::resize(size_t new_word_size) { // ( ^ ] // block-start // -void G1BlockOffsetArray::alloc_block_work2(HeapWord** threshold_, size_t* index_, - HeapWord* blk_start, HeapWord* blk_end) { +void G1BlockOffsetTablePart::alloc_block_work(HeapWord** threshold_, size_t* index_, + HeapWord* blk_start, HeapWord* blk_end) { // For efficiency, do copy-in/copy-out. HeapWord* threshold = *threshold_; size_t index = *index_; @@ -312,13 +257,13 @@ void G1BlockOffsetArray::alloc_block_work2(HeapWord** threshold_, size_t* index_ "phantom block"); assert(blk_end > threshold, "should be past threshold"); assert(blk_start <= threshold, "blk_start should be at or before threshold"); - assert(pointer_delta(threshold, blk_start) <= N_words, + assert(pointer_delta(threshold, blk_start) <= BOTConstants::N_words, "offset should be <= BlockOffsetSharedArray::N"); assert(G1CollectedHeap::heap()->is_in_reserved(blk_start), "reference must be into the heap"); assert(G1CollectedHeap::heap()->is_in_reserved(blk_end-1), "limit must be within the heap"); - assert(threshold == _array->_reserved.start() + index*N_words, + assert(threshold == _bot->_reserved.start() + index*BOTConstants::N_words, "index must agree with threshold"); DEBUG_ONLY(size_t orig_index = index;) @@ -326,26 +271,26 @@ void G1BlockOffsetArray::alloc_block_work2(HeapWord** threshold_, size_t* index_ // Mark the card that holds the offset into the block. Note // that _next_offset_index and _next_offset_threshold are not // updated until the end of this method. - _array->set_offset_array(index, threshold, blk_start); + _bot->set_offset_array(index, threshold, blk_start); // We need to now mark the subsequent cards that this blk spans. // Index of card on which blk ends. - size_t end_index = _array->index_for(blk_end - 1); + size_t end_index = _bot->index_for(blk_end - 1); // Are there more cards left to be updated? if (index + 1 <= end_index) { - HeapWord* rem_st = _array->address_for_index(index + 1); + HeapWord* rem_st = _bot->address_for_index(index + 1); // Calculate rem_end this way because end_index // may be the last valid index in the covered region. - HeapWord* rem_end = _array->address_for_index(end_index) + N_words; + HeapWord* rem_end = _bot->address_for_index(end_index) + BOTConstants::N_words; set_remainder_to_point_to_start(rem_st, rem_end); } index = end_index + 1; // Calculate threshold_ this way because end_index // may be the last valid index in the covered region. - threshold = _array->address_for_index(end_index) + N_words; + threshold = _bot->address_for_index(end_index) + BOTConstants::N_words; assert(threshold >= blk_end, "Incorrect offset threshold"); // index_ and threshold_ updated here. @@ -355,55 +300,55 @@ void G1BlockOffsetArray::alloc_block_work2(HeapWord** threshold_, size_t* index_ #ifdef ASSERT // The offset can be 0 if the block starts on a boundary. That // is checked by an assertion above. - size_t start_index = _array->index_for(blk_start); - HeapWord* boundary = _array->address_for_index(start_index); - assert((_array->offset_array(orig_index) == 0 && blk_start == boundary) || - (_array->offset_array(orig_index) > 0 && _array->offset_array(orig_index) <= N_words), + size_t start_index = _bot->index_for(blk_start); + HeapWord* boundary = _bot->address_for_index(start_index); + assert((_bot->offset_array(orig_index) == 0 && blk_start == boundary) || + (_bot->offset_array(orig_index) > 0 && _bot->offset_array(orig_index) <= BOTConstants::N_words), "offset array should have been set - " "orig_index offset: %u, " "blk_start: " PTR_FORMAT ", " "boundary: " PTR_FORMAT, - (uint)_array->offset_array(orig_index), + (uint)_bot->offset_array(orig_index), p2i(blk_start), p2i(boundary)); for (size_t j = orig_index + 1; j <= end_index; j++) { - assert(_array->offset_array(j) > 0 && - _array->offset_array(j) <= - (u_char) (N_words+BlockOffsetArray::N_powers-1), + assert(_bot->offset_array(j) > 0 && + _bot->offset_array(j) <= + (u_char) (BOTConstants::N_words+BOTConstants::N_powers-1), "offset array should have been set - " "%u not > 0 OR %u not <= %u", - (uint) _array->offset_array(j), - (uint) _array->offset_array(j), - (uint) (N_words+BlockOffsetArray::N_powers-1)); + (uint) _bot->offset_array(j), + (uint) _bot->offset_array(j), + (uint) (BOTConstants::N_words+BOTConstants::N_powers-1)); } #endif } -void G1BlockOffsetArray::verify() const { - assert(gsp()->bottom() < gsp()->top(), "Only non-empty regions should be verified."); - size_t start_card = _array->index_for(gsp()->bottom()); - size_t end_card = _array->index_for(gsp()->top() - 1); +void G1BlockOffsetTablePart::verify() const { + assert(_space->bottom() < _space->top(), "Only non-empty regions should be verified."); + size_t start_card = _bot->index_for(_space->bottom()); + size_t end_card = _bot->index_for(_space->top() - 1); for (size_t current_card = start_card; current_card < end_card; current_card++) { - u_char entry = _array->offset_array(current_card); - if (entry < N_words) { + u_char entry = _bot->offset_array(current_card); + if (entry < BOTConstants::N_words) { // The entry should point to an object before the current card. Verify that // it is possible to walk from that object in to the current card by just // iterating over the objects following it. - HeapWord* card_address = _array->address_for_index(current_card); + HeapWord* card_address = _bot->address_for_index(current_card); HeapWord* obj_end = card_address - entry; while (obj_end < card_address) { HeapWord* obj = obj_end; size_t obj_size = block_size(obj); obj_end = obj + obj_size; - guarantee(obj_end > obj && obj_end <= gsp()->top(), + guarantee(obj_end > obj && obj_end <= _space->top(), "Invalid object end. obj: " PTR_FORMAT " obj_size: " SIZE_FORMAT " obj_end: " PTR_FORMAT " top: " PTR_FORMAT, - p2i(obj), obj_size, p2i(obj_end), p2i(gsp()->top())); + p2i(obj), obj_size, p2i(obj_end), p2i(_space->top())); } } else { // Because we refine the BOT based on which cards are dirty there is not much we can verify here. // We need to make sure that we are going backwards and that we don't pass the start of the // corresponding heap region. But that is about all we can verify. - size_t backskip = BlockOffsetArray::entry_to_cards_back(entry); + size_t backskip = BOTConstants::entry_to_cards_back(entry); guarantee(backskip >= 1, "Must be going back at least one card."); size_t max_backskip = current_card - start_card; @@ -411,103 +356,66 @@ void G1BlockOffsetArray::verify() const { "Going backwards beyond the start_card. start_card: " SIZE_FORMAT " current_card: " SIZE_FORMAT " backskip: " SIZE_FORMAT, start_card, current_card, backskip); - HeapWord* backskip_address = _array->address_for_index(current_card - backskip); - guarantee(backskip_address >= gsp()->bottom(), + HeapWord* backskip_address = _bot->address_for_index(current_card - backskip); + guarantee(backskip_address >= _space->bottom(), "Going backwards beyond bottom of the region: bottom: " PTR_FORMAT ", backskip_address: " PTR_FORMAT, - p2i(gsp()->bottom()), p2i(backskip_address)); + p2i(_space->bottom()), p2i(backskip_address)); } } } #ifndef PRODUCT void -G1BlockOffsetArray::print_on(outputStream* out) { - size_t from_index = _array->index_for(_bottom); - size_t to_index = _array->index_for(_end); +G1BlockOffsetTablePart::print_on(outputStream* out) { + size_t from_index = _bot->index_for(_space->bottom()); + size_t to_index = _bot->index_for(_space->end()); out->print_cr(">> BOT for area [" PTR_FORMAT "," PTR_FORMAT ") " "cards [" SIZE_FORMAT "," SIZE_FORMAT ")", - p2i(_bottom), p2i(_end), from_index, to_index); + p2i(_space->bottom()), p2i(_space->end()), from_index, to_index); for (size_t i = from_index; i < to_index; ++i) { out->print_cr(" entry " SIZE_FORMAT_W(8) " | " PTR_FORMAT " : %3u", - i, p2i(_array->address_for_index(i)), - (uint) _array->offset_array(i)); + i, p2i(_bot->address_for_index(i)), + (uint) _bot->offset_array(i)); } -} -#endif // !PRODUCT - -////////////////////////////////////////////////////////////////////// -// G1BlockOffsetArrayContigSpace -////////////////////////////////////////////////////////////////////// - -HeapWord* -G1BlockOffsetArrayContigSpace::block_start_unsafe(const void* addr) { - assert(_bottom <= addr && addr < _end, - "addr must be covered by this Array"); - HeapWord* q = block_at_or_preceding(addr, true, _next_offset_index-1); - return forward_to_block_containing_addr(q, addr); -} - -HeapWord* -G1BlockOffsetArrayContigSpace:: -block_start_unsafe_const(const void* addr) const { - assert(_bottom <= addr && addr < _end, - "addr must be covered by this Array"); - HeapWord* q = block_at_or_preceding(addr, true, _next_offset_index-1); - HeapWord* n = q + block_size(q); - return forward_to_block_containing_addr_const(q, n, addr); -} - -G1BlockOffsetArrayContigSpace:: -G1BlockOffsetArrayContigSpace(G1BlockOffsetSharedArray* array, - MemRegion mr) : - G1BlockOffsetArray(array, mr) -{ - _next_offset_threshold = NULL; - _next_offset_index = 0; -} - -HeapWord* G1BlockOffsetArrayContigSpace::initialize_threshold_raw() { - assert(!G1CollectedHeap::heap()->is_in_reserved(_array->_offset_array), - "just checking"); - _next_offset_index = _array->index_for_raw(_bottom); - _next_offset_index++; - _next_offset_threshold = - _array->address_for_index_raw(_next_offset_index); - return _next_offset_threshold; -} - -void G1BlockOffsetArrayContigSpace::zero_bottom_entry_raw() { - assert(!G1CollectedHeap::heap()->is_in_reserved(_array->_offset_array), - "just checking"); - size_t bottom_index = _array->index_for_raw(_bottom); - assert(_array->address_for_index_raw(bottom_index) == _bottom, - "Precondition of call"); - _array->set_offset_array_raw(bottom_index, 0); -} - -HeapWord* G1BlockOffsetArrayContigSpace::initialize_threshold() { - assert(!G1CollectedHeap::heap()->is_in_reserved(_array->_offset_array), - "just checking"); - _next_offset_index = _array->index_for(_bottom); - _next_offset_index++; - _next_offset_threshold = - _array->address_for_index(_next_offset_index); - return _next_offset_threshold; -} - -void G1BlockOffsetArrayContigSpace::set_for_starts_humongous(HeapWord* obj_top, size_t fill_size) { - // The first BOT entry should have offset 0. - reset_bot(); - alloc_block(_bottom, obj_top); - if (fill_size > 0) { - alloc_block(obj_top, fill_size); - } -} - -#ifndef PRODUCT -void G1BlockOffsetArrayContigSpace::print_on(outputStream* out) { - G1BlockOffsetArray::print_on(out); out->print_cr(" next offset threshold: " PTR_FORMAT, p2i(_next_offset_threshold)); out->print_cr(" next offset index: " SIZE_FORMAT, _next_offset_index); } #endif // !PRODUCT + +HeapWord* G1BlockOffsetTablePart::initialize_threshold_raw() { + assert(!G1CollectedHeap::heap()->is_in_reserved(_bot->_offset_array), + "just checking"); + _next_offset_index = _bot->index_for_raw(_space->bottom()); + _next_offset_index++; + _next_offset_threshold = + _bot->address_for_index_raw(_next_offset_index); + return _next_offset_threshold; +} + +void G1BlockOffsetTablePart::zero_bottom_entry_raw() { + assert(!G1CollectedHeap::heap()->is_in_reserved(_bot->_offset_array), + "just checking"); + size_t bottom_index = _bot->index_for_raw(_space->bottom()); + assert(_bot->address_for_index_raw(bottom_index) == _space->bottom(), + "Precondition of call"); + _bot->set_offset_array_raw(bottom_index, 0); +} + +HeapWord* G1BlockOffsetTablePart::initialize_threshold() { + assert(!G1CollectedHeap::heap()->is_in_reserved(_bot->_offset_array), + "just checking"); + _next_offset_index = _bot->index_for(_space->bottom()); + _next_offset_index++; + _next_offset_threshold = + _bot->address_for_index(_next_offset_index); + return _next_offset_threshold; +} + +void G1BlockOffsetTablePart::set_for_starts_humongous(HeapWord* obj_top, size_t fill_size) { + // The first BOT entry should have offset 0. + reset_bot(); + alloc_block(_space->bottom(), obj_top); + if (fill_size > 0) { + alloc_block(obj_top, fill_size); + } +} diff --git a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.hpp b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.hpp index 7c900fb960a..8ee1e6d8b56 100644 --- a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.hpp +++ b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, 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 @@ -26,131 +26,38 @@ #define SHARE_VM_GC_G1_G1BLOCKOFFSETTABLE_HPP #include "gc/g1/g1RegionToSpaceMapper.hpp" +#include "gc/shared/blockOffsetTable.hpp" #include "memory/memRegion.hpp" #include "memory/virtualspace.hpp" #include "utilities/globalDefinitions.hpp" -// The CollectedHeap type requires subtypes to implement a method -// "block_start". For some subtypes, notably generational -// systems using card-table-based write barriers, the efficiency of this -// operation may be important. Implementations of the "BlockOffsetArray" -// class may be useful in providing such efficient implementations. -// -// While generally mirroring the structure of the BOT for GenCollectedHeap, -// the following types are tailored more towards G1's uses; these should, -// however, be merged back into a common BOT to avoid code duplication -// and reduce maintenance overhead. -// -// G1BlockOffsetTable (abstract) -// -- G1BlockOffsetArray (uses G1BlockOffsetSharedArray) -// -- G1BlockOffsetArrayContigSpace -// -// A main impediment to the consolidation of this code might be the -// effect of making some of the block_start*() calls non-const as -// below. Whether that might adversely affect performance optimizations -// that compilers might normally perform in the case of non-G1 -// collectors needs to be carefully investigated prior to any such -// consolidation. - // Forward declarations -class G1BlockOffsetSharedArray; -class G1OffsetTableContigSpace; - -class G1BlockOffsetTable VALUE_OBJ_CLASS_SPEC { - friend class VMStructs; -protected: - // These members describe the region covered by the table. - - // The space this table is covering. - HeapWord* _bottom; // == reserved.start - HeapWord* _end; // End of currently allocated region. - -public: - // Initialize the table to cover the given space. - // The contents of the initial table are undefined. - G1BlockOffsetTable(HeapWord* bottom, HeapWord* end) : - _bottom(bottom), _end(end) - { - assert(_bottom <= _end, "arguments out of order"); - } - - // Note that the committed size of the covered space may have changed, - // so the table size might also wish to change. - virtual void resize(size_t new_word_size) = 0; - - virtual void set_bottom(HeapWord* new_bottom) { - assert(new_bottom <= _end, - "new_bottom (" PTR_FORMAT ") > _end (" PTR_FORMAT ")", - p2i(new_bottom), p2i(_end)); - _bottom = new_bottom; - resize(pointer_delta(_end, _bottom)); - } - - // Requires "addr" to be contained by a block, and returns the address of - // the start of that block. (May have side effects, namely updating of - // shared array entries that "point" too far backwards. This can occur, - // for example, when LAB allocation is used in a space covered by the - // table.) - virtual HeapWord* block_start_unsafe(const void* addr) = 0; - // Same as above, but does not have any of the possible side effects - // discussed above. - virtual HeapWord* block_start_unsafe_const(const void* addr) const = 0; - - // Returns the address of the start of the block containing "addr", or - // else "null" if it is covered by no block. (May have side effects, - // namely updating of shared array entries that "point" too far - // backwards. This can occur, for example, when lab allocation is used - // in a space covered by the table.) - inline HeapWord* block_start(const void* addr); - // Same as above, but does not have any of the possible side effects - // discussed above. - inline HeapWord* block_start_const(const void* addr) const; -}; - -class G1BlockOffsetSharedArrayMappingChangedListener : public G1MappingChangedListener { - public: - virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled) { - // Nothing to do. The BOT is hard-wired to be part of the HeapRegion, and we cannot - // retrieve it here since this would cause firing of several asserts. The code - // executed after commit of a region already needs to do some re-initialization of - // the HeapRegion, so we combine that. - } -}; +class G1BlockOffsetTable; +class G1ContiguousSpace; // This implementation of "G1BlockOffsetTable" divides the covered region // into "N"-word subregions (where "N" = 2^"LogN". An array with an entry // for each such subregion indicates how far back one must go to find the // start of the chunk that includes the first word of the subregion. // -// Each BlockOffsetArray is owned by a Space. However, the actual array -// may be shared by several BlockOffsetArrays; this is useful -// when a single resizable area (such as a generation) is divided up into -// several spaces in which contiguous allocation takes place, -// such as, for example, in G1 or in the train generation.) +// Each G1BlockOffsetTablePart is owned by a G1ContiguousSpace. -// Here is the shared array type. - -class G1BlockOffsetSharedArray: public CHeapObj { - friend class G1BlockOffsetArray; - friend class G1BlockOffsetArrayContigSpace; +class G1BlockOffsetTable: public CHeapObj { + friend class G1BlockOffsetTablePart; friend class VMStructs; private: - G1BlockOffsetSharedArrayMappingChangedListener _listener; - // The reserved region covered by the shared array. + // The reserved region covered by the table. MemRegion _reserved; - // End of the current committed region. - HeapWord* _end; - // Array for keeping offsets for retrieving object start fast given an // address. u_char* _offset_array; // byte array keeping backwards offsets void check_offset(size_t offset, const char* msg) const { - assert(offset <= N_words, + assert(offset <= BOTConstants::N_words, "%s - offset: " SIZE_FORMAT ", N_words: %u", - msg, offset, (uint)N_words); + msg, offset, BOTConstants::N_words); } // Bounds checking accessors: @@ -176,29 +83,18 @@ public: // Return the number of slots needed for an offset array // that covers mem_region_words words. static size_t compute_size(size_t mem_region_words) { - size_t number_of_slots = (mem_region_words / N_words); + size_t number_of_slots = (mem_region_words / BOTConstants::N_words); return ReservedSpace::allocation_align_size_up(number_of_slots); } // Returns how many bytes of the heap a single byte of the BOT corresponds to. static size_t heap_map_factor() { - return N_bytes; + return BOTConstants::N_bytes; } - enum SomePublicConstants { - LogN = 9, - LogN_words = LogN - LogHeapWordSize, - N_bytes = 1 << LogN, - N_words = 1 << LogN_words - }; - - // Initialize the table to cover from "base" to (at least) - // "base + init_word_size". In the future, the table may be expanded - // (see "resize" below) up to the size of "_reserved" (which must be at - // least "init_word_size".) The contents of the initial table are - // undefined; it is the responsibility of the constituent - // G1BlockOffsetTable(s) to initialize cards. - G1BlockOffsetSharedArray(MemRegion heap, G1RegionToSpaceMapper* storage); + // Initialize the Block Offset Table to cover the memory region passed + // in the heap parameter. + G1BlockOffsetTable(MemRegion heap, G1RegionToSpaceMapper* storage); // Return the appropriate index into "_offset_array" for "p". inline size_t index_for(const void* p) const; @@ -209,33 +105,23 @@ public: inline HeapWord* address_for_index(size_t index) const; // Variant of address_for_index that does not check the index for validity. inline HeapWord* address_for_index_raw(size_t index) const { - return _reserved.start() + (index << LogN_words); + return _reserved.start() + (index << BOTConstants::LogN_words); } }; -// And here is the G1BlockOffsetTable subtype that uses the array. - -class G1BlockOffsetArray: public G1BlockOffsetTable { - friend class G1BlockOffsetSharedArray; - friend class G1BlockOffsetArrayContigSpace; +class G1BlockOffsetTablePart VALUE_OBJ_CLASS_SPEC { + friend class G1BlockOffsetTable; friend class VMStructs; private: - enum SomePrivateConstants { - N_words = G1BlockOffsetSharedArray::N_words, - LogN = G1BlockOffsetSharedArray::LogN - }; + // allocation boundary at which offset array must be updated + HeapWord* _next_offset_threshold; + size_t _next_offset_index; // index corresponding to that boundary - // This is the array, which can be shared by several BlockOffsetArray's - // servicing different - G1BlockOffsetSharedArray* _array; + // This is the global BlockOffsetTable. + G1BlockOffsetTable* _bot; // The space that owns this subregion. - G1OffsetTableContigSpace* _gsp; - - // The portion [_unallocated_block, _sp.end()) of the space that - // is a single block known not to contain any objects. - // NOTE: See BlockOffsetArrayUseUnallocatedBlock flag. - HeapWord* _unallocated_block; + G1ContiguousSpace* _space; // Sets the entries // corresponding to the cards starting at "start" and ending at "end" @@ -246,9 +132,12 @@ private: // that is closed: [start_index, end_index] void set_remainder_to_point_to_start_incl(size_t start, size_t end); -protected: - - G1OffsetTableContigSpace* gsp() const { return _gsp; } + // Zero out the entry for _bottom (offset will be zero). Does not check for availability of the + // memory first. + void zero_bottom_entry_raw(); + // Variant of initialize_threshold that does not check for availability of the + // memory first. + HeapWord* initialize_threshold_raw(); inline size_t block_size(const HeapWord* p) const; @@ -263,9 +152,8 @@ protected: // next block (or the end of the space.) Return the address of the // beginning of the block that contains "addr". Does so without side // effects (see, e.g., spec of block_start.) - inline HeapWord* - forward_to_block_containing_addr_const(HeapWord* q, HeapWord* n, - const void* addr) const; + inline HeapWord* forward_to_block_containing_addr_const(HeapWord* q, HeapWord* n, + const void* addr) const; // "q" is a block boundary that is <= "addr"; return the address of the // beginning of the block that contains "addr". May have side effects @@ -288,60 +176,26 @@ protected: // starting at "*threshold_", and for any other indices crossed by the // block. Updates "*threshold_" and "*index_" to correspond to the first // index after the block end. - void alloc_block_work2(HeapWord** threshold_, size_t* index_, - HeapWord* blk_start, HeapWord* blk_end); - -public: - // The space may not have it's bottom and top set yet, which is why the - // region is passed as a parameter. The elements of the array are - // initialized to zero. - G1BlockOffsetArray(G1BlockOffsetSharedArray* array, MemRegion mr); - - // Note: this ought to be part of the constructor, but that would require - // "this" to be passed as a parameter to a member constructor for - // the containing concrete subtype of Space. - // This would be legal C++, but MS VC++ doesn't allow it. - void set_space(G1OffsetTableContigSpace* sp); - - // Resets the covered region to one with the same _bottom as before but - // the "new_word_size". - void resize(size_t new_word_size); - - virtual HeapWord* block_start_unsafe(const void* addr); - virtual HeapWord* block_start_unsafe_const(const void* addr) const; + void alloc_block_work(HeapWord** threshold_, size_t* index_, + HeapWord* blk_start, HeapWord* blk_end); void check_all_cards(size_t left_card, size_t right_card) const; +public: + // The elements of the array are initialized to zero. + G1BlockOffsetTablePart(G1BlockOffsetTable* array, G1ContiguousSpace* gsp); + void verify() const; - virtual void print_on(outputStream* out) PRODUCT_RETURN; -}; - -// A subtype of BlockOffsetArray that takes advantage of the fact -// that its underlying space is a ContiguousSpace, so that its "active" -// region can be more efficiently tracked (than for a non-contiguous space). -class G1BlockOffsetArrayContigSpace: public G1BlockOffsetArray { - friend class VMStructs; - - // allocation boundary at which offset array must be updated - HeapWord* _next_offset_threshold; - size_t _next_offset_index; // index corresponding to that boundary - - // Work function to be called when allocation start crosses the next - // threshold in the contig space. - void alloc_block_work1(HeapWord* blk_start, HeapWord* blk_end) { - alloc_block_work2(&_next_offset_threshold, &_next_offset_index, - blk_start, blk_end); - } - - // Zero out the entry for _bottom (offset will be zero). Does not check for availability of the - // memory first. - void zero_bottom_entry_raw(); - // Variant of initialize_threshold that does not check for availability of the - // memory first. - HeapWord* initialize_threshold_raw(); - public: - G1BlockOffsetArrayContigSpace(G1BlockOffsetSharedArray* array, MemRegion mr); + // Returns the address of the start of the block containing "addr", or + // else "null" if it is covered by no block. (May have side effects, + // namely updating of shared array entries that "point" too far + // backwards. This can occur, for example, when lab allocation is used + // in a space covered by the table.) + inline HeapWord* block_start(const void* addr); + // Same as above, but does not have any of the possible side effects + // discussed above. + inline HeapWord* block_start_const(const void* addr) const; // Initialize the threshold to reflect the first boundary after the // bottom of the covered region. @@ -362,19 +216,16 @@ class G1BlockOffsetArrayContigSpace: public G1BlockOffsetArray { // never exceeds the "_next_offset_threshold". void alloc_block(HeapWord* blk_start, HeapWord* blk_end) { if (blk_end > _next_offset_threshold) { - alloc_block_work1(blk_start, blk_end); + alloc_block_work(&_next_offset_threshold, &_next_offset_index, blk_start, blk_end); } } void alloc_block(HeapWord* blk, size_t size) { alloc_block(blk, blk+size); } - HeapWord* block_start_unsafe(const void* addr); - HeapWord* block_start_unsafe_const(const void* addr) const; - void set_for_starts_humongous(HeapWord* obj_top, size_t fill_size); - virtual void print_on(outputStream* out) PRODUCT_RETURN; + void print_on(outputStream* out) PRODUCT_RETURN; }; #endif // SHARE_VM_GC_G1_G1BLOCKOFFSETTABLE_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.inline.hpp b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.inline.hpp index 202d4e5bb94..f207f2586ba 100644 --- a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, 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 @@ -30,34 +30,36 @@ #include "gc/shared/memset_with_concurrent_readers.hpp" #include "gc/shared/space.hpp" -inline HeapWord* G1BlockOffsetTable::block_start(const void* addr) { - if (addr >= _bottom && addr < _end) { - return block_start_unsafe(addr); +inline HeapWord* G1BlockOffsetTablePart::block_start(const void* addr) { + if (addr >= _space->bottom() && addr < _space->end()) { + HeapWord* q = block_at_or_preceding(addr, true, _next_offset_index-1); + return forward_to_block_containing_addr(q, addr); } else { return NULL; } } -inline HeapWord* -G1BlockOffsetTable::block_start_const(const void* addr) const { - if (addr >= _bottom && addr < _end) { - return block_start_unsafe_const(addr); +inline HeapWord* G1BlockOffsetTablePart::block_start_const(const void* addr) const { + if (addr >= _space->bottom() && addr < _space->end()) { + HeapWord* q = block_at_or_preceding(addr, true, _next_offset_index-1); + HeapWord* n = q + block_size(q); + return forward_to_block_containing_addr_const(q, n, addr); } else { return NULL; } } -u_char G1BlockOffsetSharedArray::offset_array(size_t index) const { +u_char G1BlockOffsetTable::offset_array(size_t index) const { check_index(index, "index out of range"); return _offset_array[index]; } -void G1BlockOffsetSharedArray::set_offset_array(size_t index, u_char offset) { +void G1BlockOffsetTable::set_offset_array(size_t index, u_char offset) { check_index(index, "index out of range"); set_offset_array_raw(index, offset); } -void G1BlockOffsetSharedArray::set_offset_array(size_t index, HeapWord* high, HeapWord* low) { +void G1BlockOffsetTable::set_offset_array(size_t index, HeapWord* high, HeapWord* low) { check_index(index, "index out of range"); assert(high >= low, "addresses out of order"); size_t offset = pointer_delta(high, low); @@ -65,7 +67,7 @@ void G1BlockOffsetSharedArray::set_offset_array(size_t index, HeapWord* high, He set_offset_array(index, (u_char)offset); } -void G1BlockOffsetSharedArray::set_offset_array(size_t left, size_t right, u_char offset) { +void G1BlockOffsetTable::set_offset_array(size_t left, size_t right, u_char offset) { check_index(right, "right index out of range"); assert(left <= right, "indexes out of order"); size_t num_cards = right - left + 1; @@ -73,11 +75,11 @@ void G1BlockOffsetSharedArray::set_offset_array(size_t left, size_t right, u_cha } // Variant of index_for that does not check the index for validity. -inline size_t G1BlockOffsetSharedArray::index_for_raw(const void* p) const { - return pointer_delta((char*)p, _reserved.start(), sizeof(char)) >> LogN; +inline size_t G1BlockOffsetTable::index_for_raw(const void* p) const { + return pointer_delta((char*)p, _reserved.start(), sizeof(char)) >> BOTConstants::LogN; } -inline size_t G1BlockOffsetSharedArray::index_for(const void* p) const { +inline size_t G1BlockOffsetTable::index_for(const void* p) const { char* pc = (char*)p; assert(pc >= (char*)_reserved.start() && pc < (char*)_reserved.end(), @@ -88,8 +90,7 @@ inline size_t G1BlockOffsetSharedArray::index_for(const void* p) const { return result; } -inline HeapWord* -G1BlockOffsetSharedArray::address_for_index(size_t index) const { +inline HeapWord* G1BlockOffsetTable::address_for_index(size_t index) const { check_index(index, "index out of range"); HeapWord* result = address_for_index_raw(index); assert(result >= _reserved.start() && result < _reserved.end(), @@ -99,47 +100,45 @@ G1BlockOffsetSharedArray::address_for_index(size_t index) const { return result; } -inline size_t -G1BlockOffsetArray::block_size(const HeapWord* p) const { - return gsp()->block_size(p); +inline size_t G1BlockOffsetTablePart::block_size(const HeapWord* p) const { + return _space->block_size(p); } -inline HeapWord* -G1BlockOffsetArray::block_at_or_preceding(const void* addr, - bool has_max_index, - size_t max_index) const { - assert(_array->offset_array(0) == 0, "objects can't cross covered areas"); - size_t index = _array->index_for(addr); +inline HeapWord* G1BlockOffsetTablePart::block_at_or_preceding(const void* addr, + bool has_max_index, + size_t max_index) const { + assert(_bot->offset_array(0) == 0, "objects can't cross covered areas"); + size_t index = _bot->index_for(addr); // We must make sure that the offset table entry we use is valid. If // "addr" is past the end, start at the last known one and go forward. if (has_max_index) { index = MIN2(index, max_index); } - HeapWord* q = _array->address_for_index(index); + HeapWord* q = _bot->address_for_index(index); - uint offset = _array->offset_array(index); // Extend u_char to uint. - while (offset >= N_words) { + uint offset = _bot->offset_array(index); // Extend u_char to uint. + while (offset >= BOTConstants::N_words) { // The excess of the offset from N_words indicates a power of Base // to go back by. - size_t n_cards_back = BlockOffsetArray::entry_to_cards_back(offset); - q -= (N_words * n_cards_back); + size_t n_cards_back = BOTConstants::entry_to_cards_back(offset); + q -= (BOTConstants::N_words * n_cards_back); index -= n_cards_back; - offset = _array->offset_array(index); + offset = _bot->offset_array(index); } - assert(offset < N_words, "offset too large"); + assert(offset < BOTConstants::N_words, "offset too large"); q -= offset; return q; } -inline HeapWord* -G1BlockOffsetArray:: -forward_to_block_containing_addr_const(HeapWord* q, HeapWord* n, - const void* addr) const { - if (addr >= gsp()->top()) return gsp()->top(); +inline HeapWord* G1BlockOffsetTablePart::forward_to_block_containing_addr_const(HeapWord* q, HeapWord* n, + const void* addr) const { + if (addr >= _space->top()) return _space->top(); while (n <= addr) { q = n; oop obj = oop(q); - if (obj->klass_or_null() == NULL) return q; + if (obj->klass_or_null() == NULL) { + return q; + } n += block_size(q); } assert(q <= n, "wrong order for q and addr"); @@ -147,10 +146,11 @@ forward_to_block_containing_addr_const(HeapWord* q, HeapWord* n, return q; } -inline HeapWord* -G1BlockOffsetArray::forward_to_block_containing_addr(HeapWord* q, - const void* addr) { - if (oop(q)->klass_or_null() == NULL) return q; +inline HeapWord* G1BlockOffsetTablePart::forward_to_block_containing_addr(HeapWord* q, + const void* addr) { + if (oop(q)->klass_or_null() == NULL) { + return q; + } HeapWord* n = q + block_size(q); // In the normal case, where the query "addr" is a card boundary, and the // offset table chunks are the same size as cards, the block starting at diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp index f8705d626bf..e2ecfaa24f5 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -601,7 +601,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size, return result; } - if (GC_locker::is_active_and_needs_gc()) { + if (GCLocker::is_active_and_needs_gc()) { if (g1_policy()->can_expand_young_list()) { // No need for an ergo verbose message here, // can_expand_young_list() does this when it returns true. @@ -617,7 +617,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size, // returns true). In this case we do not try this GC and // wait until the GCLocker initiated GC is performed, and // then retry the allocation. - if (GC_locker::needs_gc()) { + if (GCLocker::needs_gc()) { should_try_gc = false; } else { // Read the GC count while still holding the Heap_lock. @@ -653,7 +653,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size, // The GCLocker is either active or the GCLocker initiated // GC has not yet been performed. Stall until it is and // then retry the allocation. - GC_locker::stall_until_clear(); + GCLocker::stall_until_clear(); (*gclocker_retry_count_ret) += 1; } @@ -1028,7 +1028,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size, return result; } - if (GC_locker::is_active_and_needs_gc()) { + if (GCLocker::is_active_and_needs_gc()) { should_try_gc = false; } else { // The GCLocker may not be active but the GCLocker initiated @@ -1036,7 +1036,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size, // returns true). In this case we do not try this GC and // wait until the GCLocker initiated GC is performed, and // then retry the allocation. - if (GC_locker::needs_gc()) { + if (GCLocker::needs_gc()) { should_try_gc = false; } else { // Read the GC count while still holding the Heap_lock. @@ -1076,7 +1076,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size, // The GCLocker is either active or the GCLocker initiated // GC has not yet been performed. Stall until it is and // then retry the allocation. - GC_locker::stall_until_clear(); + GCLocker::stall_until_clear(); (*gclocker_retry_count_ret) += 1; } @@ -1211,7 +1211,7 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc, bool clear_all_soft_refs) { assert_at_safepoint(true /* should_be_vm_thread */); - if (GC_locker::check_active_before_gc()) { + if (GCLocker::check_active_before_gc()) { return false; } @@ -1745,7 +1745,7 @@ G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) : _is_alive_closure_stw(this), _ref_processor_cm(NULL), _ref_processor_stw(NULL), - _bot_shared(NULL), + _bot(NULL), _cg1r(NULL), _g1mm(NULL), _refine_cte_cl(NULL), @@ -1906,8 +1906,8 @@ jint G1CollectedHeap::initialize() { // Create storage for the BOT, card table, card counts table (hot card cache) and the bitmaps. G1RegionToSpaceMapper* bot_storage = create_aux_memory_mapper("Block offset table", - G1BlockOffsetSharedArray::compute_size(g1_rs.size() / HeapWordSize), - G1BlockOffsetSharedArray::heap_map_factor()); + G1BlockOffsetTable::compute_size(g1_rs.size() / HeapWordSize), + G1BlockOffsetTable::heap_map_factor()); ReservedSpace cardtable_rs(G1SATBCardTableLoggingModRefBS::compute_size(g1_rs.size() / HeapWordSize)); G1RegionToSpaceMapper* cardtable_storage = @@ -1945,7 +1945,7 @@ jint G1CollectedHeap::initialize() { FreeRegionList::set_unrealistically_long_length(max_regions() + 1); - _bot_shared = new G1BlockOffsetSharedArray(reserved_region(), bot_storage); + _bot = new G1BlockOffsetTable(reserved_region(), bot_storage); { HeapWord* start = _hrm.reserved().start(); @@ -1984,7 +1984,9 @@ jint G1CollectedHeap::initialize() { DirtyCardQ_FL_lock, concurrent_g1_refine()->yellow_zone(), concurrent_g1_refine()->red_zone(), - Shared_DirtyCardQ_lock); + Shared_DirtyCardQ_lock, + NULL, // fl_owner + true); // init_free_ids dirty_card_queue_set().initialize(NULL, // Should never be called by the Java code DirtyCardQ_CBL_mon, @@ -2394,8 +2396,8 @@ void G1CollectedHeap::collect(GCCause::Cause cause) { } if (retry_gc) { - if (GC_locker::is_active_and_needs_gc()) { - GC_locker::stall_until_clear(); + if (GCLocker::is_active_and_needs_gc()) { + GCLocker::stall_until_clear(); } } } @@ -2549,6 +2551,7 @@ HeapRegion* G1CollectedHeap::start_cset_region_for_worker(uint worker_i) { // Previous workers starting region is valid // so let's iterate from there start_ind = (cs_size * (worker_i - 1)) / active_workers; + OrderAccess::loadload(); result = _worker_cset_start_region[worker_i - 1]; } @@ -3533,6 +3536,16 @@ void G1CollectedHeap::register_humongous_regions_with_cset() { cl.flush_rem_set_entries(); } +class VerifyRegionRemSetClosure : public HeapRegionClosure { + public: + bool doHeapRegion(HeapRegion* hr) { + if (!hr->is_archive() && !hr->is_continues_humongous()) { + hr->verify_rem_set(); + } + return false; + } +}; + #ifdef ASSERT class VerifyCSetClosure: public HeapRegionClosure { public: @@ -3627,7 +3640,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { assert_at_safepoint(true /* should_be_vm_thread */); guarantee(!is_gc_active(), "collection is not reentrant"); - if (GC_locker::check_active_before_gc()) { + if (GCLocker::check_active_before_gc()) { return false; } @@ -3722,6 +3735,12 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { increment_total_collections(false /* full gc */); increment_gc_time_stamp(); + if (VerifyRememberedSets) { + log_info(gc, verify)("[Verifying RemSets before GC]"); + VerifyRegionRemSetClosure v_cl; + heap_region_iterate(&v_cl); + } + verify_before_gc(); check_bitmaps("GC Start"); @@ -3926,6 +3945,12 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { // scanning cards (see CR 7039627). increment_gc_time_stamp(); + if (VerifyRememberedSets) { + log_info(gc, verify)("[Verifying RemSets after GC]"); + VerifyRegionRemSetClosure v_cl; + heap_region_iterate(&v_cl); + } + verify_after_gc(); check_bitmaps("GC End"); diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp index 2ba6704bf8d..de5088f1f03 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp @@ -154,7 +154,7 @@ private: uint _expansion_regions; // The block offset table for the G1 heap. - G1BlockOffsetSharedArray* _bot_shared; + G1BlockOffsetTable* _bot; // Tears down the region sets / lists so that they are empty and the // regions on the heap do not belong to a region set / list. The @@ -1008,7 +1008,7 @@ public: void iterate_dirty_card_closure(CardTableEntryClosure* cl, uint worker_i); // The shared block offset table array. - G1BlockOffsetSharedArray* bot_shared() const { return _bot_shared; } + G1BlockOffsetTable* bot() const { return _bot; } // Reference Processing accessors diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap_ext.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap_ext.cpp index 0c04c106aad..a4a9617edb4 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap_ext.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap_ext.cpp @@ -36,5 +36,5 @@ bool G1CollectedHeap::copy_allocation_context_stats(const jint* contexts, HeapRegion* G1CollectedHeap::new_heap_region(uint hrs_index, MemRegion mr) { - return new HeapRegion(hrs_index, bot_shared(), mr); + return new HeapRegion(hrs_index, bot(), mr); } diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp index d742f852a49..530eddb8f74 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp @@ -841,7 +841,7 @@ private: HeapRegion* _recorded_survivor_head; HeapRegion* _recorded_survivor_tail; - ageTable _survivors_age_table; + AgeTable _survivors_age_table; public: uint tenuring_threshold() const { return _tenuring_threshold; } @@ -882,7 +882,7 @@ public: return _recorded_survivor_regions; } - void record_age_table(ageTable* age_table) { + void record_age_table(AgeTable* age_table) { _survivors_age_table.merge(age_table); } diff --git a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp index 9f3ace0705b..47c5328d2b9 100644 --- a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp +++ b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp @@ -50,7 +50,7 @@ class G1ParScanThreadState : public CHeapObj { G1PLABAllocator* _plab_allocator; - ageTable _age_table; + AgeTable _age_table; InCSetState _dest[InCSetState::Num]; // Local tenuring threshold. uint _tenuring_threshold; diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp index 699388513a8..9258d575a95 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, 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 @@ -97,7 +97,7 @@ ScanRSClosure::ScanRSClosure(G1ParPushHeapRSClosure* oc, _worker_i(worker_i), _try_claimed(false) { _g1h = G1CollectedHeap::heap(); - _bot_shared = _g1h->bot_shared(); + _bot = _g1h->bot(); _ct_bs = _g1h->g1_barrier_set(); _block_size = MAX2(G1RSetScanBlockSize, 1); } @@ -109,7 +109,7 @@ void ScanRSClosure::scanCard(size_t index, HeapRegion *r) { // Set the "from" region in the closure. _oc->set_region(r); - MemRegion card_region(_bot_shared->address_for_index(index), G1BlockOffsetSharedArray::N_words); + MemRegion card_region(_bot->address_for_index(index), BOTConstants::N_words); MemRegion pre_gc_allocated(r->bottom(), r->scan_top()); MemRegion mr = pre_gc_allocated.intersection(card_region); if (!mr.is_empty() && !_ct_bs->is_card_claimed(index)) { @@ -153,7 +153,7 @@ bool ScanRSClosure::doHeapRegion(HeapRegion* r) { jump_to_card = hrrs->iter_claimed_next(_block_size); } if (current_card < jump_to_card) continue; - HeapWord* card_start = _g1h->bot_shared()->address_for_index(card_index); + HeapWord* card_start = _g1h->bot()->address_for_index(card_index); HeapRegion* card_region = _g1h->heap_region_containing(card_start); _cards++; diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp index 6c987945a18..8aab4ca498c 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp @@ -36,7 +36,7 @@ class BitMap; class CardTableModRefBS; -class G1BlockOffsetSharedArray; +class G1BlockOffsetTable; class ConcurrentG1Refine; class CodeBlobClosure; class G1CollectedHeap; @@ -171,7 +171,7 @@ class ScanRSClosure : public HeapRegionClosure { G1ParPushHeapRSClosure* _oc; CodeBlobClosure* _code_root_cl; - G1BlockOffsetSharedArray* _bot_shared; + G1BlockOffsetTable* _bot; G1SATBCardTableModRefBS *_ct_bs; double _strong_code_root_scan_time_sec; diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp b/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp index 95b5bccff10..3e092fe8c38 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp @@ -96,7 +96,7 @@ void G1StringDedupQueue::push(uint worker_id, oop java_string) { oop G1StringDedupQueue::pop() { assert(!SafepointSynchronize::is_at_safepoint(), "Must not be at safepoint"); - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; // Try all queues before giving up for (size_t tries = 0; tries < _queue->_nqueues; tries++) { diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupTable.cpp b/hotspot/src/share/vm/gc/g1/g1StringDedupTable.cpp index 16519b4a3e5..47a8f40b460 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupTable.cpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupTable.cpp @@ -299,7 +299,7 @@ unsigned int G1StringDedupTable::hash_code(typeArrayOop value, bool latin1) { void G1StringDedupTable::deduplicate(oop java_string, G1StringDedupStat& stat) { assert(java_lang_String::is_instance(java_string), "Must be a string"); - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; stat.inc_inspected(); diff --git a/hotspot/src/share/vm/gc/g1/heapRegion.cpp b/hotspot/src/share/vm/gc/g1/heapRegion.cpp index 5ba5df6446d..8ade4641c36 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegion.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegion.cpp @@ -153,7 +153,7 @@ void HeapRegion::setup_heap_region_size(size_t initial_heap_size, size_t max_hea } void HeapRegion::reset_after_compaction() { - G1OffsetTableContigSpace::reset_after_compaction(); + G1ContiguousSpace::reset_after_compaction(); // After a compaction the mark bitmap is invalid, so we must // treat all objects as being inside the unmarked area. zero_marked_bytes(); @@ -183,7 +183,6 @@ void HeapRegion::hr_clear(bool par, bool clear_space, bool locked) { } zero_marked_bytes(); - _offsets.resize(HeapRegion::GrainWords); init_top_at_mark_start(); if (clear_space) clear(SpaceDecorator::Mangle); } @@ -219,7 +218,7 @@ void HeapRegion::set_starts_humongous(HeapWord* obj_top, size_t fill_size) { _type.set_starts_humongous(); _humongous_start_region = this; - _offsets.set_for_starts_humongous(obj_top, fill_size); + _bot_part.set_for_starts_humongous(obj_top, fill_size); } void HeapRegion::set_continues_humongous(HeapRegion* first_hr) { @@ -239,9 +238,9 @@ void HeapRegion::clear_humongous() { } HeapRegion::HeapRegion(uint hrm_index, - G1BlockOffsetSharedArray* sharedOffsetArray, + G1BlockOffsetTable* bot, MemRegion mr) : - G1OffsetTableContigSpace(sharedOffsetArray, mr), + G1ContiguousSpace(bot), _hrm_index(hrm_index), _allocation_context(AllocationContext::system()), _humongous_start_region(NULL), @@ -257,7 +256,7 @@ HeapRegion::HeapRegion(uint hrm_index, _rem_set(NULL), _recorded_rs_length(0), _predicted_elapsed_time_ms(0), _predicted_bytes_to_copy(0) { - _rem_set = new HeapRegionRemSet(sharedOffsetArray, this); + _rem_set = new HeapRegionRemSet(bot, this); initialize(mr); } @@ -265,7 +264,7 @@ HeapRegion::HeapRegion(uint hrm_index, void HeapRegion::initialize(MemRegion mr, bool clear_space, bool mangle_space) { assert(_rem_set->is_empty(), "Remembered set must be empty"); - G1OffsetTableContigSpace::initialize(mr, clear_space, mangle_space); + G1ContiguousSpace::initialize(mr, clear_space, mangle_space); hr_clear(false /*par*/, false /*clear_space*/); set_top(bottom()); @@ -600,8 +599,8 @@ void HeapRegion::print_on(outputStream* st) const { p2i(prev_top_at_mark_start()), p2i(next_top_at_mark_start())); } -class VerifyLiveClosure: public OopClosure { -private: +class G1VerificationClosure : public OopClosure { +protected: G1CollectedHeap* _g1h; CardTableModRefBS* _bs; oop _containing_obj; @@ -612,10 +611,10 @@ public: // _vo == UsePrevMarking -> use "prev" marking information, // _vo == UseNextMarking -> use "next" marking information, // _vo == UseMarkWord -> use mark word from object header. - VerifyLiveClosure(G1CollectedHeap* g1h, VerifyOption vo) : + G1VerificationClosure(G1CollectedHeap* g1h, VerifyOption vo) : _g1h(g1h), _bs(barrier_set_cast(g1h->barrier_set())), - _containing_obj(NULL), _failures(false), _n_failures(0), _vo(vo) - { } + _containing_obj(NULL), _failures(false), _n_failures(0), _vo(vo) { + } void set_containing_obj(oop obj) { _containing_obj = obj; @@ -624,9 +623,6 @@ public: bool failures() { return _failures; } int n_failures() { return _n_failures; } - virtual void do_oop(narrowOop* p) { do_oop_work(p); } - virtual void do_oop( oop* p) { do_oop_work(p); } - void print_object(outputStream* out, oop obj) { #ifdef PRODUCT Klass* k = obj->klass(); @@ -636,12 +632,24 @@ public: obj->print_on(out); #endif // PRODUCT } +}; + +class VerifyLiveClosure : public G1VerificationClosure { +public: + VerifyLiveClosure(G1CollectedHeap* g1h, VerifyOption vo) : G1VerificationClosure(g1h, vo) {} + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop(oop* p) { do_oop_work(p); } template void do_oop_work(T* p) { assert(_containing_obj != NULL, "Precondition"); assert(!_g1h->is_obj_dead_cond(_containing_obj, _vo), - "Precondition"); + "Precondition"); + verify_liveness(p); + } + + template + void verify_liveness(T* p) { T heap_oop = oopDesc::load_heap_oop(p); LogHandle(gc, verify) log; if (!oopDesc::is_null(heap_oop)) { @@ -649,7 +657,7 @@ public: bool failed = false; if (!_g1h->is_in_closed_subset(obj) || _g1h->is_obj_dead_cond(obj, _vo)) { MutexLockerEx x(ParGCRareEvent_lock, - Mutex::_no_safepoint_check_flag); + Mutex::_no_safepoint_check_flag); if (!_failures) { log.info("----------"); @@ -658,17 +666,17 @@ public: if (!_g1h->is_in_closed_subset(obj)) { HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p); log.info("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end())); + p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end())); print_object(log.info_stream(), _containing_obj); log.info("points to obj " PTR_FORMAT " not in the heap", p2i(obj)); } else { HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p); - HeapRegion* to = _g1h->heap_region_containing((HeapWord*)obj); + HeapRegion* to = _g1h->heap_region_containing((HeapWord*)obj); log.info("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end())); + p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end())); print_object(log.info_stream(), _containing_obj); log.info("points to dead obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(obj), p2i(to->bottom()), p2i(to->end())); + p2i(obj), p2i(to->bottom()), p2i(to->end())); print_object(log.info_stream(), obj); } log.info("----------"); @@ -676,42 +684,64 @@ public: failed = true; _n_failures++; } + } + } +}; - if (!_g1h->collector_state()->full_collection() || G1VerifyRSetsDuringFullGC) { - HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p); - HeapRegion* to = _g1h->heap_region_containing(obj); - if (from != NULL && to != NULL && - from != to && - !to->is_pinned()) { - jbyte cv_obj = *_bs->byte_for_const(_containing_obj); - jbyte cv_field = *_bs->byte_for_const(p); - const jbyte dirty = CardTableModRefBS::dirty_card_val(); +class VerifyRemSetClosure : public G1VerificationClosure { +public: + VerifyRemSetClosure(G1CollectedHeap* g1h, VerifyOption vo) : G1VerificationClosure(g1h, vo) {} + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop(oop* p) { do_oop_work(p); } - bool is_bad = !(from->is_young() - || to->rem_set()->contains_reference(p) - || !G1HRRSFlushLogBuffersOnVerify && // buffers were not flushed - (_containing_obj->is_objArray() ? - cv_field == dirty - : cv_obj == dirty || cv_field == dirty)); - if (is_bad) { - MutexLockerEx x(ParGCRareEvent_lock, - Mutex::_no_safepoint_check_flag); + template + void do_oop_work(T* p) { + assert(_containing_obj != NULL, "Precondition"); + assert(!_g1h->is_obj_dead_cond(_containing_obj, _vo), + "Precondition"); + verify_remembered_set(p); + } - if (!_failures) { - log.info("----------"); - } - log.info("Missing rem set entry:"); - log.info("Field " PTR_FORMAT " of obj " PTR_FORMAT ", in region " HR_FORMAT, - p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from)); - ResourceMark rm; - _containing_obj->print_on(log.info_stream()); - log.info("points to obj " PTR_FORMAT " in region " HR_FORMAT, p2i(obj), HR_FORMAT_PARAMS(to)); - obj->print_on(log.info_stream()); - log.info("Obj head CTE = %d, field CTE = %d.", cv_obj, cv_field); + template + void verify_remembered_set(T* p) { + T heap_oop = oopDesc::load_heap_oop(p); + LogHandle(gc, verify) log; + if (!oopDesc::is_null(heap_oop)) { + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); + bool failed = false; + HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p); + HeapRegion* to = _g1h->heap_region_containing(obj); + if (from != NULL && to != NULL && + from != to && + !to->is_pinned()) { + jbyte cv_obj = *_bs->byte_for_const(_containing_obj); + jbyte cv_field = *_bs->byte_for_const(p); + const jbyte dirty = CardTableModRefBS::dirty_card_val(); + + bool is_bad = !(from->is_young() + || to->rem_set()->contains_reference(p) + || !G1HRRSFlushLogBuffersOnVerify && // buffers were not flushed + (_containing_obj->is_objArray() ? + cv_field == dirty + : cv_obj == dirty || cv_field == dirty)); + if (is_bad) { + MutexLockerEx x(ParGCRareEvent_lock, + Mutex::_no_safepoint_check_flag); + + if (!_failures) { log.info("----------"); - _failures = true; - if (!failed) _n_failures++; } + log.info("Missing rem set entry:"); + log.info("Field " PTR_FORMAT " of obj " PTR_FORMAT ", in region " HR_FORMAT, + p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from)); + ResourceMark rm; + _containing_obj->print_on(log.info_stream()); + log.info("points to obj " PTR_FORMAT " in region " HR_FORMAT, p2i(obj), HR_FORMAT_PARAMS(to)); + obj->print_on(log.info_stream()); + log.info("Obj head CTE = %d, field CTE = %d.", cv_obj, cv_field); + log.info("----------"); + _failures = true; + if (!failed) _n_failures++; } } } @@ -728,6 +758,7 @@ void HeapRegion::verify(VerifyOption vo, HeapWord* p = bottom(); HeapWord* prev_p = NULL; VerifyLiveClosure vl_cl(g1, vo); + VerifyRemSetClosure vr_cl(g1, vo); bool is_region_humongous = is_humongous(); size_t object_num = 0; while (p < top()) { @@ -753,7 +784,23 @@ void HeapRegion::verify(VerifyOption vo, return; } else { vl_cl.set_containing_obj(obj); - obj->oop_iterate_no_header(&vl_cl); + if (!g1->collector_state()->full_collection() || G1VerifyRSetsDuringFullGC) { + // verify liveness and rem_set + vr_cl.set_containing_obj(obj); + G1Mux2Closure mux(&vl_cl, &vr_cl); + obj->oop_iterate_no_header(&mux); + + if (vr_cl.failures()) { + *failures = true; + } + if (G1MaxVerifyFailures >= 0 && + vr_cl.n_failures() >= G1MaxVerifyFailures) { + return; + } + } else { + // verify only liveness + obj->oop_iterate_no_header(&vl_cl); + } if (vl_cl.failures()) { *failures = true; } @@ -763,7 +810,7 @@ void HeapRegion::verify(VerifyOption vo, } } } else { - log_info(gc, verify)(PTR_FORMAT " no an oop", p2i(obj)); + log_info(gc, verify)(PTR_FORMAT " not an oop", p2i(obj)); *failures = true; return; } @@ -773,7 +820,7 @@ void HeapRegion::verify(VerifyOption vo, } if (!is_young() && !is_empty()) { - _offsets.verify(); + _bot_part.verify(); } if (is_region_humongous) { @@ -797,7 +844,7 @@ void HeapRegion::verify(VerifyOption vo, if (p < the_end) { // Look up top HeapWord* addr_1 = p; - HeapWord* b_start_1 = _offsets.block_start_const(addr_1); + HeapWord* b_start_1 = _bot_part.block_start_const(addr_1); if (b_start_1 != p) { log_info(gc, verify)("BOT look up for top: " PTR_FORMAT " " " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, @@ -809,7 +856,7 @@ void HeapRegion::verify(VerifyOption vo, // Look up top + 1 HeapWord* addr_2 = p + 1; if (addr_2 < the_end) { - HeapWord* b_start_2 = _offsets.block_start_const(addr_2); + HeapWord* b_start_2 = _bot_part.block_start_const(addr_2); if (b_start_2 != p) { log_info(gc, verify)("BOT look up for top + 1: " PTR_FORMAT " " " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, @@ -823,7 +870,7 @@ void HeapRegion::verify(VerifyOption vo, size_t diff = pointer_delta(the_end, p) / 2; HeapWord* addr_3 = p + diff; if (addr_3 < the_end) { - HeapWord* b_start_3 = _offsets.block_start_const(addr_3); + HeapWord* b_start_3 = _bot_part.block_start_const(addr_3); if (b_start_3 != p) { log_info(gc, verify)("BOT look up for top + diff: " PTR_FORMAT " " " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, @@ -835,7 +882,7 @@ void HeapRegion::verify(VerifyOption vo, // Look up end - 1 HeapWord* addr_4 = the_end - 1; - HeapWord* b_start_4 = _offsets.block_start_const(addr_4); + HeapWord* b_start_4 = _bot_part.block_start_const(addr_4); if (b_start_4 != p) { log_info(gc, verify)("BOT look up for end - 1: " PTR_FORMAT " " " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, @@ -853,6 +900,46 @@ void HeapRegion::verify() const { verify(VerifyOption_G1UsePrevMarking, /* failures */ &dummy); } +void HeapRegion::verify_rem_set(VerifyOption vo, bool* failures) const { + G1CollectedHeap* g1 = G1CollectedHeap::heap(); + *failures = false; + HeapWord* p = bottom(); + HeapWord* prev_p = NULL; + VerifyRemSetClosure vr_cl(g1, vo); + while (p < top()) { + oop obj = oop(p); + size_t obj_size = block_size(p); + + if (!g1->is_obj_dead_cond(obj, this, vo)) { + if (obj->is_oop()) { + vr_cl.set_containing_obj(obj); + obj->oop_iterate_no_header(&vr_cl); + + if (vr_cl.failures()) { + *failures = true; + } + if (G1MaxVerifyFailures >= 0 && + vr_cl.n_failures() >= G1MaxVerifyFailures) { + return; + } + } else { + log_info(gc, verify)(PTR_FORMAT " not an oop", p2i(obj)); + *failures = true; + return; + } + } + + prev_p = p; + p += obj_size; + } +} + +void HeapRegion::verify_rem_set() const { + bool failures = false; + verify_rem_set(VerifyOption_G1UsePrevMarking, &failures); + guarantee(!failures, "HeapRegion RemSet verification failed"); +} + void HeapRegion::prepare_for_compaction(CompactPoint* cp) { scan_and_forward(this, cp); } @@ -860,52 +947,41 @@ void HeapRegion::prepare_for_compaction(CompactPoint* cp) { // G1OffsetTableContigSpace code; copied from space.cpp. Hope this can go // away eventually. -void G1OffsetTableContigSpace::clear(bool mangle_space) { +void G1ContiguousSpace::clear(bool mangle_space) { set_top(bottom()); _scan_top = bottom(); CompactibleSpace::clear(mangle_space); reset_bot(); } -void G1OffsetTableContigSpace::set_bottom(HeapWord* new_bottom) { - Space::set_bottom(new_bottom); - _offsets.set_bottom(new_bottom); -} - -void G1OffsetTableContigSpace::set_end(HeapWord* new_end) { - assert(new_end == _bottom + HeapRegion::GrainWords, "set_end should only ever be set to _bottom + HeapRegion::GrainWords"); - Space::set_end(new_end); - _offsets.resize(new_end - bottom()); -} - #ifndef PRODUCT -void G1OffsetTableContigSpace::mangle_unused_area() { +void G1ContiguousSpace::mangle_unused_area() { mangle_unused_area_complete(); } -void G1OffsetTableContigSpace::mangle_unused_area_complete() { +void G1ContiguousSpace::mangle_unused_area_complete() { SpaceMangler::mangle_region(MemRegion(top(), end())); } #endif -void G1OffsetTableContigSpace::print() const { +void G1ContiguousSpace::print() const { print_short(); tty->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")", - p2i(bottom()), p2i(top()), p2i(_offsets.threshold()), p2i(end())); + p2i(bottom()), p2i(top()), p2i(_bot_part.threshold()), p2i(end())); } -HeapWord* G1OffsetTableContigSpace::initialize_threshold() { - return _offsets.initialize_threshold(); +HeapWord* G1ContiguousSpace::initialize_threshold() { + return _bot_part.initialize_threshold(); } -HeapWord* G1OffsetTableContigSpace::cross_threshold(HeapWord* start, +HeapWord* G1ContiguousSpace::cross_threshold(HeapWord* start, HeapWord* end) { - _offsets.alloc_block(start, end); - return _offsets.threshold(); + _bot_part.alloc_block(start, end); + return _bot_part.threshold(); } -HeapWord* G1OffsetTableContigSpace::scan_top() const { +HeapWord* G1ContiguousSpace::scan_top() const { G1CollectedHeap* g1h = G1CollectedHeap::heap(); HeapWord* local_top = top(); OrderAccess::loadload(); @@ -918,7 +994,7 @@ HeapWord* G1OffsetTableContigSpace::scan_top() const { } } -void G1OffsetTableContigSpace::record_timestamp() { +void G1ContiguousSpace::record_timestamp() { G1CollectedHeap* g1h = G1CollectedHeap::heap(); unsigned curr_gc_time_stamp = g1h->get_gc_time_stamp(); @@ -935,17 +1011,17 @@ void G1OffsetTableContigSpace::record_timestamp() { } } -void G1OffsetTableContigSpace::record_retained_region() { +void G1ContiguousSpace::record_retained_region() { // scan_top is the maximum address where it's safe for the next gc to // scan this region. _scan_top = top(); } -void G1OffsetTableContigSpace::safe_object_iterate(ObjectClosure* blk) { +void G1ContiguousSpace::safe_object_iterate(ObjectClosure* blk) { object_iterate(blk); } -void G1OffsetTableContigSpace::object_iterate(ObjectClosure* blk) { +void G1ContiguousSpace::object_iterate(ObjectClosure* blk) { HeapWord* p = bottom(); while (p < top()) { if (block_is_obj(p)) { @@ -955,17 +1031,14 @@ void G1OffsetTableContigSpace::object_iterate(ObjectClosure* blk) { } } -G1OffsetTableContigSpace:: -G1OffsetTableContigSpace(G1BlockOffsetSharedArray* sharedOffsetArray, - MemRegion mr) : - _offsets(sharedOffsetArray, mr), +G1ContiguousSpace::G1ContiguousSpace(G1BlockOffsetTable* bot) : + _bot_part(bot, this), _par_alloc_lock(Mutex::leaf, "OffsetTableContigSpace par alloc lock", true), _gc_time_stamp(0) { - _offsets.set_space(this); } -void G1OffsetTableContigSpace::initialize(MemRegion mr, bool clear_space, bool mangle_space) { +void G1ContiguousSpace::initialize(MemRegion mr, bool clear_space, bool mangle_space) { CompactibleSpace::initialize(mr, clear_space, mangle_space); _top = bottom(); _scan_top = bottom(); diff --git a/hotspot/src/share/vm/gc/g1/heapRegion.hpp b/hotspot/src/share/vm/gc/g1/heapRegion.hpp index 77fa01ce9d2..5c88a476c91 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegion.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegion.hpp @@ -115,12 +115,12 @@ public: // The time stamps are re-initialized to zero at cleanup and at Full GCs. // The current scheme that uses sequential unsigned ints will fail only if we have 4b // evacuation pauses between two cleanups, which is _highly_ unlikely. -class G1OffsetTableContigSpace: public CompactibleSpace { +class G1ContiguousSpace: public CompactibleSpace { friend class VMStructs; HeapWord* volatile _top; HeapWord* volatile _scan_top; protected: - G1BlockOffsetArrayContigSpace _offsets; + G1BlockOffsetTablePart _bot_part; Mutex _par_alloc_lock; volatile unsigned _gc_time_stamp; // When we need to retire an allocation region, while other threads @@ -132,14 +132,13 @@ class G1OffsetTableContigSpace: public CompactibleSpace { HeapWord* _pre_dummy_top; public: - G1OffsetTableContigSpace(G1BlockOffsetSharedArray* sharedOffsetArray, - MemRegion mr); + G1ContiguousSpace(G1BlockOffsetTable* bot); void set_top(HeapWord* value) { _top = value; } HeapWord* top() const { return _top; } protected: - // Reset the G1OffsetTableContigSpace. + // Reset the G1ContiguousSpace. virtual void initialize(MemRegion mr, bool clear_space, bool mangle_space); HeapWord* volatile* top_addr() { return &_top; } @@ -167,9 +166,6 @@ class G1OffsetTableContigSpace: public CompactibleSpace { void object_iterate(ObjectClosure* blk); void safe_object_iterate(ObjectClosure* blk); - void set_bottom(HeapWord* value); - void set_end(HeapWord* value); - void mangle_unused_area() PRODUCT_RETURN; void mangle_unused_area_complete() PRODUCT_RETURN; @@ -213,15 +209,15 @@ class G1OffsetTableContigSpace: public CompactibleSpace { virtual void print() const; void reset_bot() { - _offsets.reset_bot(); + _bot_part.reset_bot(); } void print_bot_on(outputStream* out) { - _offsets.print_on(out); + _bot_part.print_on(out); } }; -class HeapRegion: public G1OffsetTableContigSpace { +class HeapRegion: public G1ContiguousSpace { friend class VMStructs; // Allow scan_and_forward to call (private) overrides for auxiliary functions on this class template @@ -233,8 +229,6 @@ class HeapRegion: public G1OffsetTableContigSpace { // issues.) HeapRegionRemSet* _rem_set; - G1BlockOffsetArrayContigSpace* offsets() { return &_offsets; } - // Auxiliary functions for scan_and_forward support. // See comments for CompactibleSpace for more information. inline HeapWord* scan_limit() const { @@ -330,7 +324,7 @@ class HeapRegion: public G1OffsetTableContigSpace { public: HeapRegion(uint hrm_index, - G1BlockOffsetSharedArray* sharedOffsetArray, + G1BlockOffsetTable* bot, MemRegion mr); // Initializing the HeapRegion not only resets the data structure, but also @@ -751,6 +745,9 @@ class HeapRegion: public G1OffsetTableContigSpace { // Override; it uses the "prev" marking information virtual void verify() const; + + void verify_rem_set(VerifyOption vo, bool *failures) const; + void verify_rem_set() const; }; // HeapRegionClosure is used for iterating over regions. diff --git a/hotspot/src/share/vm/gc/g1/heapRegion.inline.hpp b/hotspot/src/share/vm/gc/g1/heapRegion.inline.hpp index 245bd8ebfdf..2138155fb9d 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegion.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegion.inline.hpp @@ -32,9 +32,9 @@ #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" -inline HeapWord* G1OffsetTableContigSpace::allocate_impl(size_t min_word_size, - size_t desired_word_size, - size_t* actual_size) { +inline HeapWord* G1ContiguousSpace::allocate_impl(size_t min_word_size, + size_t desired_word_size, + size_t* actual_size) { HeapWord* obj = top(); size_t available = pointer_delta(end(), obj); size_t want_to_allocate = MIN2(available, desired_word_size); @@ -49,9 +49,9 @@ inline HeapWord* G1OffsetTableContigSpace::allocate_impl(size_t min_word_size, } } -inline HeapWord* G1OffsetTableContigSpace::par_allocate_impl(size_t min_word_size, - size_t desired_word_size, - size_t* actual_size) { +inline HeapWord* G1ContiguousSpace::par_allocate_impl(size_t min_word_size, + size_t desired_word_size, + size_t* actual_size) { do { HeapWord* obj = top(); size_t available = pointer_delta(end(), obj); @@ -73,22 +73,22 @@ inline HeapWord* G1OffsetTableContigSpace::par_allocate_impl(size_t min_word_siz } while (true); } -inline HeapWord* G1OffsetTableContigSpace::allocate(size_t min_word_size, - size_t desired_word_size, - size_t* actual_size) { +inline HeapWord* G1ContiguousSpace::allocate(size_t min_word_size, + size_t desired_word_size, + size_t* actual_size) { HeapWord* res = allocate_impl(min_word_size, desired_word_size, actual_size); if (res != NULL) { - _offsets.alloc_block(res, *actual_size); + _bot_part.alloc_block(res, *actual_size); } return res; } -inline HeapWord* G1OffsetTableContigSpace::allocate(size_t word_size) { +inline HeapWord* G1ContiguousSpace::allocate(size_t word_size) { size_t temp; return allocate(word_size, word_size, &temp); } -inline HeapWord* G1OffsetTableContigSpace::par_allocate(size_t word_size) { +inline HeapWord* G1ContiguousSpace::par_allocate(size_t word_size) { size_t temp; return par_allocate(word_size, word_size, &temp); } @@ -96,20 +96,20 @@ inline HeapWord* G1OffsetTableContigSpace::par_allocate(size_t word_size) { // Because of the requirement of keeping "_offsets" up to date with the // allocations, we sequentialize these with a lock. Therefore, best if // this is used for larger LAB allocations only. -inline HeapWord* G1OffsetTableContigSpace::par_allocate(size_t min_word_size, - size_t desired_word_size, - size_t* actual_size) { +inline HeapWord* G1ContiguousSpace::par_allocate(size_t min_word_size, + size_t desired_word_size, + size_t* actual_size) { MutexLocker x(&_par_alloc_lock); return allocate(min_word_size, desired_word_size, actual_size); } -inline HeapWord* G1OffsetTableContigSpace::block_start(const void* p) { - return _offsets.block_start(p); +inline HeapWord* G1ContiguousSpace::block_start(const void* p) { + return _bot_part.block_start(p); } inline HeapWord* -G1OffsetTableContigSpace::block_start_const(const void* p) const { - return _offsets.block_start_const(p); +G1ContiguousSpace::block_start_const(const void* p) const { + return _bot_part.block_start_const(p); } inline bool diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp index 0514663b918..30fed52f93c 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp @@ -687,9 +687,9 @@ OtherRegionsTable::do_cleanup_work(HRRSCleanupTask* hrrs_cleanup_task) { _sparse_table.do_cleanup_work(hrrs_cleanup_task); } -HeapRegionRemSet::HeapRegionRemSet(G1BlockOffsetSharedArray* bosa, +HeapRegionRemSet::HeapRegionRemSet(G1BlockOffsetTable* bot, HeapRegion* hr) - : _bosa(bosa), + : _bot(bot), _m(Mutex::leaf, FormatBuffer<128>("HeapRegionRemSet lock #%u", hr->hrm_index()), true, Monitor::_safepoint_check_never), _code_roots(), _other_regions(hr, &_m), _iter_state(Unclaimed), _iter_claimed(0) { reset_for_par_iteration(); @@ -728,8 +728,7 @@ void HeapRegionRemSet::print() { HeapRegionRemSetIterator iter(this); size_t card_index; while (iter.has_next(card_index)) { - HeapWord* card_start = - G1CollectedHeap::heap()->bot_shared()->address_for_index(card_index); + HeapWord* card_start = _bot->address_for_index(card_index); tty->print_cr(" Card " PTR_FORMAT, p2i(card_start)); } if (iter.n_yielded() != occupied()) { @@ -825,7 +824,7 @@ HeapRegionRemSetIterator:: HeapRegionRemSetIterator(HeapRegionRemSet* hrrs) : _hrrs(hrrs), _g1h(G1CollectedHeap::heap()), _coarse_map(&hrrs->_other_regions._coarse_map), - _bosa(hrrs->_bosa), + _bot(hrrs->_bot), _is(Sparse), // Set these values so that we increment to the first region. _coarse_cur_region_index(-1), @@ -852,7 +851,7 @@ bool HeapRegionRemSetIterator::coarse_has_next(size_t& card_index) { _coarse_cur_region_cur_card = 0; HeapWord* r_bot = _g1h->region_at((uint) _coarse_cur_region_index)->bottom(); - _cur_region_card_offset = _bosa->index_for(r_bot); + _cur_region_card_offset = _bot->index_for(r_bot); } else { return false; } @@ -893,7 +892,7 @@ void HeapRegionRemSetIterator::switch_to_prt(PerRegionTable* prt) { _fine_cur_prt = prt; HeapWord* r_bot = _fine_cur_prt->hr()->bottom(); - _cur_region_card_offset = _bosa->index_for(r_bot); + _cur_region_card_offset = _bot->index_for(r_bot); // The bitmap scan for the PRT always scans from _cur_region_cur_card + 1. // To avoid special-casing this start case, and not miss the first bitmap @@ -1001,7 +1000,7 @@ void HeapRegionRemSet::test() { size_t card_index; while (iter.has_next(card_index)) { HeapWord* card_start = - G1CollectedHeap::heap()->bot_shared()->address_for_index(card_index); + G1CollectedHeap::heap()->bot()->address_for_index(card_index); tty->print_cr(" Card " PTR_FORMAT ".", p2i(card_start)); sum++; } diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp index 369d2aaaeed..5a286bc2836 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp @@ -34,7 +34,7 @@ // abstractly, in terms of what the "BlockOffsetTable" in use can parse. class G1CollectedHeap; -class G1BlockOffsetSharedArray; +class G1BlockOffsetTable; class HeapRegion; class HeapRegionRemSetIterator; class PerRegionTable; @@ -174,7 +174,7 @@ class HeapRegionRemSet : public CHeapObj { friend class HeapRegionRemSetIterator; private: - G1BlockOffsetSharedArray* _bosa; + G1BlockOffsetTable* _bot; // A set of code blobs (nmethods) whose code contains pointers into // the region that owns this RSet. @@ -189,7 +189,7 @@ private: volatile size_t _iter_claimed; public: - HeapRegionRemSet(G1BlockOffsetSharedArray* bosa, HeapRegion* hr); + HeapRegionRemSet(G1BlockOffsetTable* bot, HeapRegion* hr); static void setup_remset_size(); @@ -350,7 +350,7 @@ class HeapRegionRemSetIterator : public StackObj { // Local caching of HRRS fields. const BitMap* _coarse_map; - G1BlockOffsetSharedArray* _bosa; + G1BlockOffsetTable* _bot; G1CollectedHeap* _g1h; // The number of cards yielded since initialization. diff --git a/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp b/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp index 1240a43c028..89b5a7f044f 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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 @@ -381,17 +381,17 @@ void FreeRegionList_test() { MemRegion heap(NULL, num_regions_in_test * HeapRegion::GrainWords); // Allocate a fake BOT because the HeapRegion constructor initializes // the BOT. - size_t bot_size = G1BlockOffsetSharedArray::compute_size(heap.word_size()); + size_t bot_size = G1BlockOffsetTable::compute_size(heap.word_size()); HeapWord* bot_data = NEW_C_HEAP_ARRAY(HeapWord, bot_size, mtGC); - ReservedSpace bot_rs(G1BlockOffsetSharedArray::compute_size(heap.word_size())); + ReservedSpace bot_rs(G1BlockOffsetTable::compute_size(heap.word_size())); G1RegionToSpaceMapper* bot_storage = G1RegionToSpaceMapper::create_mapper(bot_rs, bot_rs.size(), os::vm_page_size(), HeapRegion::GrainBytes, - G1BlockOffsetSharedArray::N_bytes, + BOTConstants::N_bytes, mtGC); - G1BlockOffsetSharedArray oa(heap, bot_storage); + G1BlockOffsetTable bot(heap, bot_storage); bot_storage->commit_regions(0, num_regions_in_test); // Set up memory regions for the heap regions. @@ -401,11 +401,11 @@ void FreeRegionList_test() { MemRegion mr3(mr2.end(), HeapRegion::GrainWords); MemRegion mr4(mr3.end(), HeapRegion::GrainWords); - HeapRegion hr0(0, &oa, mr0); - HeapRegion hr1(1, &oa, mr1); - HeapRegion hr2(2, &oa, mr2); - HeapRegion hr3(3, &oa, mr3); - HeapRegion hr4(4, &oa, mr4); + HeapRegion hr0(0, &bot, mr0); + HeapRegion hr1(1, &bot, mr1); + HeapRegion hr2(2, &bot, mr2); + HeapRegion hr3(3, &bot, mr3); + HeapRegion hr4(4, &bot, mr4); l.add_ordered(&hr1); l.add_ordered(&hr0); l.add_ordered(&hr3); diff --git a/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp b/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp index 5be8f6c7891..5026d6ee7ac 100644 --- a/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp +++ b/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp @@ -35,7 +35,7 @@ static_field(HeapRegion, GrainBytes, size_t) \ static_field(HeapRegion, LogOfHRGrainBytes, int) \ \ - nonstatic_field(G1OffsetTableContigSpace, _top, HeapWord* volatile) \ + nonstatic_field(G1ContiguousSpace, _top, HeapWord* volatile) \ \ nonstatic_field(G1HeapRegionTable, _base, address) \ nonstatic_field(G1HeapRegionTable, _length, size_t) \ @@ -75,8 +75,8 @@ \ declare_type(G1CollectedHeap, CollectedHeap) \ \ - declare_type(G1OffsetTableContigSpace, CompactibleSpace) \ - declare_type(HeapRegion, G1OffsetTableContigSpace) \ + declare_type(G1ContiguousSpace, CompactibleSpace) \ + declare_type(HeapRegion, G1ContiguousSpace) \ declare_toplevel_type(HeapRegionManager) \ declare_toplevel_type(HeapRegionSetBase) \ declare_toplevel_type(G1MonitoringSupport) \ diff --git a/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp b/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp index 47d441a1ce4..f00faf5b7d1 100644 --- a/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp +++ b/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp @@ -78,19 +78,22 @@ GCTaskTimeStamp* GCTaskThread::time_stamp_at(uint index) { void GCTaskThread::print_task_time_stamps() { assert(log_is_enabled(Debug, gc, task, time), "Sanity"); - assert(_time_stamps != NULL, "Sanity"); - log_debug(gc, task, time)("GC-Thread %u entries: %d", id(), _time_stamp_index); - for(uint i=0; i<_time_stamp_index; i++) { - GCTaskTimeStamp* time_stamp = time_stamp_at(i); - log_debug(gc, task, time)("\t[ %s " JLONG_FORMAT " " JLONG_FORMAT " ]", - time_stamp->name(), - time_stamp->entry_time(), - time_stamp->exit_time()); + // Since _time_stamps is now lazily allocated we need to check that it + // has in fact been allocated when calling this function. + if (_time_stamps != NULL) { + log_debug(gc, task, time)("GC-Thread %u entries: %d", id(), _time_stamp_index); + for(uint i=0; i<_time_stamp_index; i++) { + GCTaskTimeStamp* time_stamp = time_stamp_at(i); + log_debug(gc, task, time)("\t[ %s " JLONG_FORMAT " " JLONG_FORMAT " ]", + time_stamp->name(), + time_stamp->entry_time(), + time_stamp->exit_time()); + } + + // Reset after dumping the data + _time_stamp_index = 0; } - - // Reset after dumping the data - _time_stamp_index = 0; } // GC workers get tasks from the GCTaskManager and execute diff --git a/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp b/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp index f14aefa7943..cfe23356b5a 100644 --- a/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp +++ b/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp @@ -250,7 +250,7 @@ HeapWord* ParallelScavengeHeap::mem_allocate( } // Failed to allocate without a gc. - if (GC_locker::is_active_and_needs_gc()) { + if (GCLocker::is_active_and_needs_gc()) { // If this thread is not in a jni critical section, we stall // the requestor until the critical section has cleared and // GC allowed. When the critical section clears, a GC is @@ -260,7 +260,7 @@ HeapWord* ParallelScavengeHeap::mem_allocate( JavaThread* jthr = JavaThread::current(); if (!jthr->in_critical()) { MutexUnlocker mul(Heap_lock); - GC_locker::stall_until_clear(); + GCLocker::stall_until_clear(); gclocker_stalled_count += 1; continue; } else { @@ -350,7 +350,7 @@ ParallelScavengeHeap::death_march_check(HeapWord* const addr, size_t size) { } HeapWord* ParallelScavengeHeap::mem_allocate_old_gen(size_t size) { - if (!should_alloc_in_eden(size) || GC_locker::is_active_and_needs_gc()) { + if (!should_alloc_in_eden(size) || GCLocker::is_active_and_needs_gc()) { // Size is too big for eden, or gc is locked out. return old_gen()->allocate(size); } diff --git a/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp b/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp index 75fed6c0c40..4b8bcf77c71 100644 --- a/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp +++ b/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp @@ -109,7 +109,7 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint"); assert(ref_processor() != NULL, "Sanity"); - if (GC_locker::check_active_before_gc()) { + if (GCLocker::check_active_before_gc()) { return false; } diff --git a/hotspot/src/share/vm/gc/parallel/psOldGen.cpp b/hotspot/src/share/vm/gc/parallel/psOldGen.cpp index 42160922637..0a89c5f9d22 100644 --- a/hotspot/src/share/vm/gc/parallel/psOldGen.cpp +++ b/hotspot/src/share/vm/gc/parallel/psOldGen.cpp @@ -257,7 +257,7 @@ void PSOldGen::expand(size_t bytes) { success = expand_to_reserved(); } - if (success && GC_locker::is_active_and_needs_gc()) { + if (success && GCLocker::is_active_and_needs_gc()) { log_debug(gc)("Garbage collection disabled, expanded heap instead"); } } diff --git a/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp b/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp index 2e5e266a4fd..2198705943a 100644 --- a/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp +++ b/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp @@ -1717,7 +1717,7 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint"); assert(ref_processor() != NULL, "Sanity"); - if (GC_locker::check_active_before_gc()) { + if (GCLocker::check_active_before_gc()) { return false; } diff --git a/hotspot/src/share/vm/gc/parallel/psScavenge.cpp b/hotspot/src/share/vm/gc/parallel/psScavenge.cpp index 648db23dab7..6b9e9318b0b 100644 --- a/hotspot/src/share/vm/gc/parallel/psScavenge.cpp +++ b/hotspot/src/share/vm/gc/parallel/psScavenge.cpp @@ -268,7 +268,7 @@ bool PSScavenge::invoke_no_policy() { scavenge_entry.update(); - if (GC_locker::check_active_before_gc()) { + if (GCLocker::check_active_before_gc()) { return false; } diff --git a/hotspot/src/share/vm/gc/parallel/vmPSOperations.cpp b/hotspot/src/share/vm/gc/parallel/vmPSOperations.cpp index 931ec86313d..4b77aded056 100644 --- a/hotspot/src/share/vm/gc/parallel/vmPSOperations.cpp +++ b/hotspot/src/share/vm/gc/parallel/vmPSOperations.cpp @@ -45,7 +45,7 @@ void VM_ParallelGCFailedAllocation::doit() { GCCauseSetter gccs(heap, _gc_cause); _result = heap->failed_mem_allocate(_word_size); - if (_result == NULL && GC_locker::is_active_and_needs_gc()) { + if (_result == NULL && GCLocker::is_active_and_needs_gc()) { set_gc_locked(); } } diff --git a/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp b/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp index eaaf9a213e5..e86037cc5d9 100644 --- a/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp +++ b/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, 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 @@ -357,13 +357,43 @@ bool DefNewGeneration::expand(size_t bytes) { // For example if the first expand fail for unknown reasons, // but the second succeeds and expands the heap to its maximum // value. - if (GC_locker::is_active()) { + if (GCLocker::is_active()) { log_debug(gc)("Garbage collection disabled, expanded heap instead"); } return success; } +size_t DefNewGeneration::adjust_for_thread_increase(size_t new_size_candidate, + size_t new_size_before, + size_t alignment) const { + size_t desired_new_size = new_size_before; + + if (NewSizeThreadIncrease > 0) { + int threads_count; + size_t thread_increase_size = 0; + + // 1. Check an overflow at 'threads_count * NewSizeThreadIncrease'. + threads_count = Threads::number_of_non_daemon_threads(); + if (threads_count > 0 && NewSizeThreadIncrease <= max_uintx / threads_count) { + thread_increase_size = threads_count * NewSizeThreadIncrease; + + // 2. Check an overflow at 'new_size_candidate + thread_increase_size'. + if (new_size_candidate <= max_uintx - thread_increase_size) { + new_size_candidate += thread_increase_size; + + // 3. Check an overflow at 'align_size_up'. + size_t aligned_max = ((max_uintx - alignment) & ~(alignment-1)); + if (new_size_candidate <= aligned_max) { + desired_new_size = align_size_up(new_size_candidate, alignment); + } + } + } + } + + return desired_new_size; +} + void DefNewGeneration::compute_new_size() { // This is called after a GC that includes the old generation, so from-space // will normally be empty. @@ -385,12 +415,13 @@ void DefNewGeneration::compute_new_size() { // All space sizes must be multiples of Generation::GenGrain. size_t alignment = Generation::GenGrain; - // Compute desired new generation size based on NewRatio and - // NewSizeThreadIncrease - size_t desired_new_size = old_size/NewRatio; - int threads_count = Threads::number_of_non_daemon_threads(); - size_t thread_increase_size = threads_count * NewSizeThreadIncrease; - desired_new_size = align_size_up(desired_new_size + thread_increase_size, alignment); + int threads_count = 0; + size_t thread_increase_size = 0; + + size_t new_size_candidate = old_size / NewRatio; + // Compute desired new generation size based on NewRatio and NewSizeThreadIncrease + // and reverts to previous value if any overflow happens + size_t desired_new_size = adjust_for_thread_increase(new_size_candidate, new_size_before, alignment); // Adjust new generation size desired_new_size = MAX2(MIN2(desired_new_size, max_new_size), min_new_size); @@ -496,7 +527,7 @@ void DefNewGeneration::space_iterate(SpaceClosure* blk, // The last collection bailed out, we are running out of heap space, // so we try to allocate the from-space, too. HeapWord* DefNewGeneration::allocate_from_space(size_t size) { - bool should_try_alloc = should_allocate_from_space() || GC_locker::is_active_and_needs_gc(); + bool should_try_alloc = should_allocate_from_space() || GCLocker::is_active_and_needs_gc(); // If the Heap_lock is not locked by this thread, this will be called // again later with the Heap_lock held. @@ -879,7 +910,7 @@ bool DefNewGeneration::collection_attempt_is_safe() { void DefNewGeneration::gc_epilogue(bool full) { DEBUG_ONLY(static bool seen_incremental_collection_failed = false;) - assert(!GC_locker::is_active(), "We should not be executing here"); + assert(!GCLocker::is_active(), "We should not be executing here"); // Check if the heap is approaching full after a collection has // been done. Generally the young generation is empty at // a minimum at the end of a collection. If it is not, then diff --git a/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp b/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp index f537a6d6a4f..f42c8ed8b47 100644 --- a/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp +++ b/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp @@ -47,11 +47,11 @@ class DefNewGeneration: public Generation { protected: Generation* _old_gen; uint _tenuring_threshold; // Tenuring threshold for next collection. - ageTable _age_table; + AgeTable _age_table; // Size of object to pretenure in words; command line provides bytes size_t _pretenure_size_threshold_words; - ageTable* age_table() { return &_age_table; } + AgeTable* age_table() { return &_age_table; } // Initialize state to optimistically assume no promotion failure will // happen. @@ -354,6 +354,14 @@ protected: void compute_space_boundaries(uintx minimum_eden_size, bool clear_space, bool mangle_space); + + // Return adjusted new size for NewSizeThreadIncrease. + // If any overflow happens, revert to previous new size. + size_t adjust_for_thread_increase(size_t new_size_candidate, + size_t new_size_before, + size_t alignment) const; + + // Scavenge support void swap_spaces(); }; diff --git a/hotspot/src/share/vm/gc/serial/markSweep.cpp b/hotspot/src/share/vm/gc/serial/markSweep.cpp index 489fe2a0cd0..93741aeee4a 100644 --- a/hotspot/src/share/vm/gc/serial/markSweep.cpp +++ b/hotspot/src/share/vm/gc/serial/markSweep.cpp @@ -37,6 +37,7 @@ #include "oops/methodData.hpp" #include "oops/objArrayKlass.inline.hpp" #include "oops/oop.inline.hpp" +#include "oops/typeArrayOop.inline.hpp" #include "utilities/macros.hpp" #include "utilities/stack.inline.hpp" #if INCLUDE_ALL_GCS diff --git a/hotspot/src/share/vm/gc/shared/ageTable.cpp b/hotspot/src/share/vm/gc/shared/ageTable.cpp index 2b9b46321c2..cf6542ddf11 100644 --- a/hotspot/src/share/vm/gc/shared/ageTable.cpp +++ b/hotspot/src/share/vm/gc/shared/ageTable.cpp @@ -34,7 +34,7 @@ /* Copyright (c) 1992, 2015, Oracle and/or its affiliates, and Stanford University. See the LICENSE file for license information. */ -ageTable::ageTable(bool global) { +AgeTable::AgeTable(bool global) { clear(); @@ -61,19 +61,19 @@ ageTable::ageTable(bool global) { } } -void ageTable::clear() { +void AgeTable::clear() { for (size_t* p = sizes; p < sizes + table_size; ++p) { *p = 0; } } -void ageTable::merge(ageTable* subTable) { +void AgeTable::merge(AgeTable* subTable) { for (int i = 0; i < table_size; i++) { sizes[i]+= subTable->sizes[i]; } } -uint ageTable::compute_tenuring_threshold(size_t survivor_capacity, GCPolicyCounters* gc_counters) { +uint AgeTable::compute_tenuring_threshold(size_t survivor_capacity, GCPolicyCounters* gc_counters) { size_t desired_survivor_size = (size_t)((((double) survivor_capacity)*TargetSurvivorRatio)/100); uint result; diff --git a/hotspot/src/share/vm/gc/shared/ageTable.hpp b/hotspot/src/share/vm/gc/shared/ageTable.hpp index 588cd9e5c72..b0724101642 100644 --- a/hotspot/src/share/vm/gc/shared/ageTable.hpp +++ b/hotspot/src/share/vm/gc/shared/ageTable.hpp @@ -38,7 +38,7 @@ class GCPolicyCounters; // // Note: all sizes are in oops -class ageTable VALUE_OBJ_CLASS_SPEC { +class AgeTable VALUE_OBJ_CLASS_SPEC { friend class VMStructs; public: @@ -50,7 +50,7 @@ class ageTable VALUE_OBJ_CLASS_SPEC { // constructor. "global" indicates that this is the global age table // (as opposed to gc-thread-local) - ageTable(bool global = true); + AgeTable(bool global = true); // clear table void clear(); @@ -67,7 +67,7 @@ class ageTable VALUE_OBJ_CLASS_SPEC { // Merge another age table with the current one. Used // for parallel young generation gc. - void merge(ageTable* subTable); + void merge(AgeTable* subTable); // calculate new tenuring threshold based on age information uint compute_tenuring_threshold(size_t survivor_capacity, GCPolicyCounters* gc_counters); diff --git a/hotspot/src/share/vm/gc/shared/blockOffsetTable.cpp b/hotspot/src/share/vm/gc/shared/blockOffsetTable.cpp index 9588d223bba..f4a3d15662e 100644 --- a/hotspot/src/share/vm/gc/shared/blockOffsetTable.cpp +++ b/hotspot/src/share/vm/gc/shared/blockOffsetTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -87,7 +87,7 @@ void BlockOffsetSharedArray::resize(size_t new_word_size) { bool BlockOffsetSharedArray::is_card_boundary(HeapWord* p) const { assert(p >= _reserved.start(), "just checking"); size_t delta = pointer_delta(p, _reserved.start()); - return (delta & right_n_bits(LogN_words)) == (size_t)NoBits; + return (delta & right_n_bits((int)BOTConstants::LogN_words)) == (size_t)NoBits; } @@ -104,7 +104,7 @@ BlockOffsetArray::BlockOffsetArray(BlockOffsetSharedArray* array, set_init_to_zero(init_to_zero_); if (!init_to_zero_) { // initialize cards to point back to mr.start() - set_remainder_to_point_to_start(mr.start() + N_words, mr.end()); + set_remainder_to_point_to_start(mr.start() + BOTConstants::N_words, mr.end()); _array->set_offset_array(0, 0); // set first card to 0 } } @@ -160,7 +160,7 @@ set_remainder_to_point_to_start(HeapWord* start, HeapWord* end, bool reducing) { size_t start_card = _array->index_for(start); size_t end_card = _array->index_for(end-1); assert(start ==_array->address_for_index(start_card), "Precondition"); - assert(end ==_array->address_for_index(end_card)+N_words, "Precondition"); + assert(end ==_array->address_for_index(end_card)+BOTConstants::N_words, "Precondition"); set_remainder_to_point_to_start_incl(start_card, end_card, reducing); // closed interval } @@ -176,16 +176,16 @@ BlockOffsetArray::set_remainder_to_point_to_start_incl(size_t start_card, size_t return; } assert(start_card > _array->index_for(_bottom), "Cannot be first card"); - assert(_array->offset_array(start_card-1) <= N_words, + assert(_array->offset_array(start_card-1) <= BOTConstants::N_words, "Offset card has an unexpected value"); size_t start_card_for_region = start_card; u_char offset = max_jubyte; - for (int i = 0; i < N_powers; i++) { + for (uint i = 0; i < BOTConstants::N_powers; i++) { // -1 so that the the card with the actual offset is counted. Another -1 // so that the reach ends in this region and not at the start // of the next. - size_t reach = start_card - 1 + (power_to_cards_back(i+1) - 1); - offset = N_words + i; + size_t reach = start_card - 1 + (BOTConstants::power_to_cards_back(i+1) - 1); + offset = BOTConstants::N_words + i; if (reach >= end_card) { _array->set_offset_array(start_card_for_region, end_card, offset, reducing); start_card_for_region = reach + 1; @@ -206,15 +206,15 @@ void BlockOffsetArray::check_all_cards(size_t start_card, size_t end_card) const if (end_card < start_card) { return; } - guarantee(_array->offset_array(start_card) == N_words, "Wrong value in second card"); - u_char last_entry = N_words; + guarantee(_array->offset_array(start_card) == BOTConstants::N_words, "Wrong value in second card"); + u_char last_entry = BOTConstants::N_words; for (size_t c = start_card + 1; c <= end_card; c++ /* yeah! */) { u_char entry = _array->offset_array(c); guarantee(entry >= last_entry, "Monotonicity"); - if (c - start_card > power_to_cards_back(1)) { - guarantee(entry > N_words, "Should be in logarithmic region"); + if (c - start_card > BOTConstants::power_to_cards_back(1)) { + guarantee(entry > BOTConstants::N_words, "Should be in logarithmic region"); } - size_t backskip = entry_to_cards_back(entry); + size_t backskip = BOTConstants::entry_to_cards_back(entry); size_t landing_card = c - backskip; guarantee(landing_card >= (start_card - 1), "Inv"); if (landing_card >= start_card) { @@ -222,7 +222,7 @@ void BlockOffsetArray::check_all_cards(size_t start_card, size_t end_card) const } else { guarantee(landing_card == (start_card - 1), "Tautology"); // Note that N_words is the maximum offset value - guarantee(_array->offset_array(landing_card) <= N_words, "Offset value"); + guarantee(_array->offset_array(landing_card) <= BOTConstants::N_words, "Offset value"); } last_entry = entry; // remember for monotonicity test } @@ -254,7 +254,7 @@ BlockOffsetArray::do_block_internal(HeapWord* blk_start, uintptr_t start_ui = (uintptr_t)blk_start; // Calculate the last card boundary preceding end of blk intptr_t boundary_before_end = (intptr_t)end_ui; - clear_bits(boundary_before_end, right_n_bits(LogN)); + clear_bits(boundary_before_end, right_n_bits((int)BOTConstants::LogN)); if (start_ui <= (uintptr_t)boundary_before_end) { // blk starts at or crosses a boundary // Calculate index of card on which blk begins @@ -267,7 +267,7 @@ BlockOffsetArray::do_block_internal(HeapWord* blk_start, if (blk_start != boundary) { // blk starts strictly after boundary // adjust card boundary and start_index forward to next card - boundary += N_words; + boundary += BOTConstants::N_words; start_index++; } assert(start_index <= end_index, "monotonicity of index_for()"); @@ -284,8 +284,8 @@ BlockOffsetArray::do_block_internal(HeapWord* blk_start, // We have finished marking the "offset card". We need to now // mark the subsequent cards that this blk spans. if (start_index < end_index) { - HeapWord* rem_st = _array->address_for_index(start_index) + N_words; - HeapWord* rem_end = _array->address_for_index(end_index) + N_words; + HeapWord* rem_st = _array->address_for_index(start_index) + BOTConstants::N_words; + HeapWord* rem_end = _array->address_for_index(end_index) + BOTConstants::N_words; set_remainder_to_point_to_start(rem_st, rem_end, reducing); } break; @@ -450,8 +450,8 @@ void BlockOffsetArrayNonContigSpace::split_block(HeapWord* blk, bool more = true; uint i = 1; // Fix the first power block with back_by > num_pref_cards. - while (more && (i < N_powers)) { - size_t back_by = power_to_cards_back(i); + while (more && (i < BOTConstants::N_powers)) { + size_t back_by = BOTConstants::power_to_cards_back(i); size_t right_index = suff_index + back_by - 1; size_t left_index = right_index - num_pref_cards + 1; if (right_index >= end_index - 1) { // last iteration @@ -466,7 +466,7 @@ void BlockOffsetArrayNonContigSpace::split_block(HeapWord* blk, // is non-null. if (left_index <= right_index) { _array->set_offset_array(left_index, right_index, - N_words + i - 1, true /* reducing */); + BOTConstants::N_words + i - 1, true /* reducing */); } else { more = false; // we are done assert((end_index - 1) == right_index, "Must be at the end."); @@ -477,8 +477,8 @@ void BlockOffsetArrayNonContigSpace::split_block(HeapWord* blk, i++; } // Fix the rest of the power blocks. - while (more && (i < N_powers)) { - size_t back_by = power_to_cards_back(i); + while (more && (i < BOTConstants::N_powers)) { + size_t back_by = BOTConstants::power_to_cards_back(i); size_t right_index = suff_index + back_by - 1; size_t left_index = right_index - num_pref_cards + 1; if (right_index >= end_index - 1) { // last iteration @@ -489,7 +489,7 @@ void BlockOffsetArrayNonContigSpace::split_block(HeapWord* blk, more = false; } assert(left_index <= right_index, "Error"); - _array->set_offset_array(left_index, right_index, N_words + i - 1, true /* reducing */); + _array->set_offset_array(left_index, right_index, BOTConstants::N_words + i - 1, true /* reducing */); i++; } } @@ -530,11 +530,11 @@ HeapWord* BlockOffsetArrayNonContigSpace::block_start_unsafe( HeapWord* q = _array->address_for_index(index); uint offset = _array->offset_array(index); // Extend u_char to uint. - while (offset >= N_words) { + while (offset >= BOTConstants::N_words) { // The excess of the offset from N_words indicates a power of Base // to go back by. - size_t n_cards_back = entry_to_cards_back(offset); - q -= (N_words * n_cards_back); + size_t n_cards_back = BOTConstants::entry_to_cards_back(offset); + q -= (BOTConstants::N_words * n_cards_back); assert(q >= _sp->bottom(), "q = " PTR_FORMAT " crossed below bottom = " PTR_FORMAT, p2i(q), p2i(_sp->bottom())); @@ -544,7 +544,7 @@ HeapWord* BlockOffsetArrayNonContigSpace::block_start_unsafe( index -= n_cards_back; offset = _array->offset_array(index); } - assert(offset < N_words, "offset too large"); + assert(offset < BOTConstants::N_words, "offset too large"); index--; q -= offset; assert(q >= _sp->bottom(), @@ -599,14 +599,14 @@ HeapWord* BlockOffsetArrayNonContigSpace::block_start_careful( uint offset; do { offset = _array->offset_array(index); - if (offset < N_words) { + if (offset < BOTConstants::N_words) { q -= offset; } else { - size_t n_cards_back = entry_to_cards_back(offset); - q -= (n_cards_back * N_words); + size_t n_cards_back = BOTConstants::entry_to_cards_back(offset); + q -= (n_cards_back * BOTConstants::N_words); index -= n_cards_back; } - } while (offset >= N_words); + } while (offset >= BOTConstants::N_words); assert(q <= addr, "block start should be to left of arg"); return q; } @@ -668,22 +668,22 @@ HeapWord* BlockOffsetArrayContigSpace::block_start_unsafe(const void* addr) cons HeapWord* q = _array->address_for_index(index); uint offset = _array->offset_array(index); // Extend u_char to uint. - while (offset > N_words) { + while (offset > BOTConstants::N_words) { // The excess of the offset from N_words indicates a power of Base // to go back by. - size_t n_cards_back = entry_to_cards_back(offset); - q -= (N_words * n_cards_back); + size_t n_cards_back = BOTConstants::entry_to_cards_back(offset); + q -= (BOTConstants::N_words * n_cards_back); assert(q >= _sp->bottom(), "Went below bottom!"); index -= n_cards_back; offset = _array->offset_array(index); } - while (offset == N_words) { + while (offset == BOTConstants::N_words) { assert(q >= _sp->bottom(), "Went below bottom!"); - q -= N_words; + q -= BOTConstants::N_words; index--; offset = _array->offset_array(index); } - assert(offset < N_words, "offset too large"); + assert(offset < BOTConstants::N_words, "offset too large"); q -= offset; HeapWord* n = q; @@ -716,14 +716,14 @@ void BlockOffsetArrayContigSpace::alloc_block_work(HeapWord* blk_start, "should be past threshold"); assert(blk_start <= _next_offset_threshold, "blk_start should be at or before threshold"); - assert(pointer_delta(_next_offset_threshold, blk_start) <= N_words, + assert(pointer_delta(_next_offset_threshold, blk_start) <= BOTConstants::N_words, "offset should be <= BlockOffsetSharedArray::N"); assert(Universe::heap()->is_in_reserved(blk_start), "reference must be into the heap"); assert(Universe::heap()->is_in_reserved(blk_end-1), "limit must be within the heap"); assert(_next_offset_threshold == - _array->_reserved.start() + _next_offset_index*N_words, + _array->_reserved.start() + _next_offset_index*BOTConstants::N_words, "index must agree with threshold"); debug_only(size_t orig_next_offset_index = _next_offset_index;) @@ -745,7 +745,7 @@ void BlockOffsetArrayContigSpace::alloc_block_work(HeapWord* blk_start, HeapWord* rem_st = _array->address_for_index(_next_offset_index + 1); // Calculate rem_end this way because end_index // may be the last valid index in the covered region. - HeapWord* rem_end = _array->address_for_index(end_index) + N_words; + HeapWord* rem_end = _array->address_for_index(end_index) + BOTConstants::N_words; set_remainder_to_point_to_start(rem_st, rem_end); } @@ -753,7 +753,7 @@ void BlockOffsetArrayContigSpace::alloc_block_work(HeapWord* blk_start, _next_offset_index = end_index + 1; // Calculate _next_offset_threshold this way because end_index // may be the last valid index in the covered region. - _next_offset_threshold = _array->address_for_index(end_index) + N_words; + _next_offset_threshold = _array->address_for_index(end_index) + BOTConstants::N_words; assert(_next_offset_threshold >= blk_end, "Incorrect offset threshold"); #ifdef ASSERT @@ -764,11 +764,11 @@ void BlockOffsetArrayContigSpace::alloc_block_work(HeapWord* blk_start, assert((_array->offset_array(orig_next_offset_index) == 0 && blk_start == boundary) || (_array->offset_array(orig_next_offset_index) > 0 && - _array->offset_array(orig_next_offset_index) <= N_words), + _array->offset_array(orig_next_offset_index) <= BOTConstants::N_words), "offset array should have been set"); for (size_t j = orig_next_offset_index + 1; j <= end_index; j++) { assert(_array->offset_array(j) > 0 && - _array->offset_array(j) <= (u_char) (N_words+N_powers-1), + _array->offset_array(j) <= (u_char) (BOTConstants::N_words+BOTConstants::N_powers-1), "offset array should have been set"); } #endif diff --git a/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp b/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp index 24f5df95429..05736fb045d 100644 --- a/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp +++ b/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,6 +46,34 @@ class ContiguousSpace; +class BOTConstants : public AllStatic { +public: + static const uint LogN = 9; + static const uint LogN_words = LogN - LogHeapWordSize; + static const uint N_bytes = 1 << LogN; + static const uint N_words = 1 << LogN_words; + // entries "e" of at least N_words mean "go back by Base^(e-N_words)." + // All entries are less than "N_words + N_powers". + static const uint LogBase = 4; + static const uint Base = (1 << LogBase); + static const uint N_powers = 14; + + static size_t power_to_cards_back(uint i) { + return (size_t)1 << (LogBase * i); + } + static size_t power_to_words_back(uint i) { + return power_to_cards_back(i) * N_words; + } + static size_t entry_to_cards_back(u_char entry) { + assert(entry >= N_words, "Precondition"); + return power_to_cards_back(entry - N_words); + } + static size_t entry_to_words_back(u_char entry) { + assert(entry >= N_words, "Precondition"); + return power_to_words_back(entry - N_words); + } +}; + ////////////////////////////////////////////////////////////////////////// // The BlockOffsetTable "interface" ////////////////////////////////////////////////////////////////////////// @@ -109,13 +137,6 @@ class BlockOffsetSharedArray: public CHeapObj { friend class VMStructs; private: - enum SomePrivateConstants { - LogN = 9, - LogN_words = LogN - LogHeapWordSize, - N_bytes = 1 << LogN, - N_words = 1 << LogN_words - }; - bool _init_to_zero; // The reserved region covered by the shared array. @@ -163,7 +184,7 @@ class BlockOffsetSharedArray: public CHeapObj { check_reducing_assertion(reducing); assert(index < _vs.committed_size(), "index out of range"); assert(high >= low, "addresses out of order"); - assert(pointer_delta(high, low) <= N_words, "offset too large"); + assert(pointer_delta(high, low) <= BOTConstants::N_words, "offset too large"); assert(!reducing || _offset_array[index] >= (u_char)pointer_delta(high, low), "Not reducing"); _offset_array[index] = (u_char)pointer_delta(high, low); @@ -174,7 +195,7 @@ class BlockOffsetSharedArray: public CHeapObj { assert(index_for(right - 1) < _vs.committed_size(), "right address out of range"); assert(left < right, "Heap addresses out of order"); - size_t num_cards = pointer_delta(right, left) >> LogN_words; + size_t num_cards = pointer_delta(right, left) >> BOTConstants::LogN_words; fill_range(index_for(left), num_cards, offset); } @@ -191,7 +212,7 @@ class BlockOffsetSharedArray: public CHeapObj { void check_offset_array(size_t index, HeapWord* high, HeapWord* low) const { assert(index < _vs.committed_size(), "index out of range"); assert(high >= low, "addresses out of order"); - assert(pointer_delta(high, low) <= N_words, "offset too large"); + assert(pointer_delta(high, low) <= BOTConstants::N_words, "offset too large"); assert(_offset_array[index] == pointer_delta(high, low), "Wrong offset"); } @@ -206,7 +227,7 @@ class BlockOffsetSharedArray: public CHeapObj { // to be reserved. size_t compute_size(size_t mem_region_words) { - size_t number_of_slots = (mem_region_words / N_words) + 1; + size_t number_of_slots = (mem_region_words / BOTConstants::N_words) + 1; return ReservedSpace::allocation_align_size_up(number_of_slots); } @@ -248,7 +269,6 @@ public: ////////////////////////////////////////////////////////////////////////// class BlockOffsetArray: public BlockOffsetTable { friend class VMStructs; - friend class G1BlockOffsetArray; // temp. until we restructure and cleanup protected: // The following enums are used by do_block_internal() below enum Action { @@ -258,31 +278,6 @@ class BlockOffsetArray: public BlockOffsetTable { // (see verify_single_block()). }; - enum SomePrivateConstants { - N_words = BlockOffsetSharedArray::N_words, - LogN = BlockOffsetSharedArray::LogN, - // entries "e" of at least N_words mean "go back by Base^(e-N_words)." - // All entries are less than "N_words + N_powers". - LogBase = 4, - Base = (1 << LogBase), - N_powers = 14 - }; - - static size_t power_to_cards_back(uint i) { - return (size_t)1 << (LogBase * i); - } - static size_t power_to_words_back(uint i) { - return power_to_cards_back(i) * N_words; - } - static size_t entry_to_cards_back(u_char entry) { - assert(entry >= N_words, "Precondition"); - return power_to_cards_back(entry - N_words); - } - static size_t entry_to_words_back(u_char entry) { - assert(entry >= N_words, "Precondition"); - return power_to_words_back(entry - N_words); - } - // The shared array, which is shared with other BlockOffsetArray's // corresponding to different spaces within a generation or span of // memory. @@ -344,7 +339,7 @@ class BlockOffsetArray: public BlockOffsetTable { assert(_array->is_card_boundary(new_end), "new _end would not be a card boundary"); // set all the newly added cards - _array->set_offset_array(_end, new_end, N_words); + _array->set_offset_array(_end, new_end, BOTConstants::N_words); } _end = new_end; // update _end } diff --git a/hotspot/src/share/vm/gc/shared/blockOffsetTable.inline.hpp b/hotspot/src/share/vm/gc/shared/blockOffsetTable.inline.hpp index 4014927c6b6..4908c107d14 100644 --- a/hotspot/src/share/vm/gc/shared/blockOffsetTable.inline.hpp +++ b/hotspot/src/share/vm/gc/shared/blockOffsetTable.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,14 +49,14 @@ inline size_t BlockOffsetSharedArray::index_for(const void* p) const { pc < (char*)_reserved.end(), "p not in range."); size_t delta = pointer_delta(pc, _reserved.start(), sizeof(char)); - size_t result = delta >> LogN; + size_t result = delta >> BOTConstants::LogN; assert(result < _vs.committed_size(), "bad index from address"); return result; } inline HeapWord* BlockOffsetSharedArray::address_for_index(size_t index) const { assert(index < _vs.committed_size(), "bad index"); - HeapWord* result = _reserved.start() + (index << LogN_words); + HeapWord* result = _reserved.start() + (index << BOTConstants::LogN_words); assert(result >= _reserved.start() && result < _reserved.end(), "bad address from index"); return result; diff --git a/hotspot/src/share/vm/gc/shared/cardGeneration.cpp b/hotspot/src/share/vm/gc/shared/cardGeneration.cpp index c43f0822358..dd448d4cf25 100644 --- a/hotspot/src/share/vm/gc/shared/cardGeneration.cpp +++ b/hotspot/src/share/vm/gc/shared/cardGeneration.cpp @@ -131,7 +131,7 @@ bool CardGeneration::expand(size_t bytes, size_t expand_bytes) { if (!success) { success = grow_to_reserved(); } - if (success && GC_locker::is_active_and_needs_gc()) { + if (success && GCLocker::is_active_and_needs_gc()) { log_trace(gc, heap)("Garbage collection disabled, expanded heap instead"); } diff --git a/hotspot/src/share/vm/gc/shared/collectedHeap.cpp b/hotspot/src/share/vm/gc/shared/collectedHeap.cpp index d0fb006d2ed..b4055f67e57 100644 --- a/hotspot/src/share/vm/gc/shared/collectedHeap.cpp +++ b/hotspot/src/share/vm/gc/shared/collectedHeap.cpp @@ -630,4 +630,8 @@ void CollectedHeap::test_is_in() { assert(!heap->is_in(after_heap), "after_heap: " PTR_FORMAT " is unexpectedly in the heap", p2i(after_heap)); } + +void CollectedHeap_test() { + CollectedHeap::test_is_in(); +} #endif diff --git a/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp b/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp index 223c9063b12..fa1e2eaddbc 100644 --- a/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp +++ b/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp @@ -303,7 +303,7 @@ void GenCollectorPolicy::initialize_flags() { // Make sure NewSize allows an old generation to fit even if set on the command line if (FLAG_IS_CMDLINE(NewSize) && NewSize >= _initial_heap_byte_size) { - warning("NewSize was set larger than initial heap size, will use initial heap size."); + log_warning(gc, ergo)("NewSize was set larger than initial heap size, will use initial heap size."); NewSize = bound_minus_alignment(NewSize, _initial_heap_byte_size); } @@ -325,9 +325,9 @@ void GenCollectorPolicy::initialize_flags() { // Make sure there is room for an old generation size_t smaller_max_new_size = MaxHeapSize - _gen_alignment; if (FLAG_IS_CMDLINE(MaxNewSize)) { - warning("MaxNewSize (" SIZE_FORMAT "k) is equal to or greater than the entire " - "heap (" SIZE_FORMAT "k). A new max generation size of " SIZE_FORMAT "k will be used.", - MaxNewSize/K, MaxHeapSize/K, smaller_max_new_size/K); + log_warning(gc, ergo)("MaxNewSize (" SIZE_FORMAT "k) is equal to or greater than the entire " + "heap (" SIZE_FORMAT "k). A new max generation size of " SIZE_FORMAT "k will be used.", + MaxNewSize/K, MaxHeapSize/K, smaller_max_new_size/K); } FLAG_SET_ERGO(size_t, MaxNewSize, smaller_max_new_size); if (NewSize > MaxNewSize) { @@ -346,9 +346,9 @@ void GenCollectorPolicy::initialize_flags() { // At this point this should only happen if the user specifies a large NewSize and/or // a small (but not too small) MaxNewSize. if (FLAG_IS_CMDLINE(MaxNewSize)) { - warning("NewSize (" SIZE_FORMAT "k) is greater than the MaxNewSize (" SIZE_FORMAT "k). " - "A new max generation size of " SIZE_FORMAT "k will be used.", - NewSize/K, MaxNewSize/K, NewSize/K); + log_warning(gc, ergo)("NewSize (" SIZE_FORMAT "k) is greater than the MaxNewSize (" SIZE_FORMAT "k). " + "A new max generation size of " SIZE_FORMAT "k will be used.", + NewSize/K, MaxNewSize/K, NewSize/K); } FLAG_SET_ERGO(size_t, MaxNewSize, NewSize); _max_young_size = MaxNewSize; @@ -516,10 +516,10 @@ void GenCollectorPolicy::initialize_size_info() { // The generation minimums and the overall heap minimum should // be within one generation alignment. if (_initial_old_size > _max_old_size) { - warning("Inconsistency between maximum heap size and maximum " - "generation sizes: using maximum heap = " SIZE_FORMAT - " -XX:OldSize flag is being ignored", - _max_heap_byte_size); + log_warning(gc, ergo)("Inconsistency between maximum heap size and maximum " + "generation sizes: using maximum heap = " SIZE_FORMAT + ", -XX:OldSize flag is being ignored", + _max_heap_byte_size); _initial_old_size = _max_old_size; } @@ -531,8 +531,8 @@ void GenCollectorPolicy::initialize_size_info() { // differs from JDK8 where the generation sizes have higher priority // than the initial heap size. if ((_initial_old_size + _initial_young_size) != _initial_heap_byte_size) { - warning("Inconsistency between generation sizes and heap size, resizing " - "the generations to fit the heap."); + log_warning(gc, ergo)("Inconsistency between generation sizes and heap size, resizing " + "the generations to fit the heap."); size_t desired_young_size = _initial_heap_byte_size - _initial_old_size; if (_initial_heap_byte_size < _initial_old_size) { @@ -620,7 +620,7 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size, return result; } - if (GC_locker::is_active_and_needs_gc()) { + if (GCLocker::is_active_and_needs_gc()) { if (is_tlab) { return NULL; // Caller will retry allocating individual object. } @@ -647,7 +647,7 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size, if (!jthr->in_critical()) { MutexUnlocker mul(Heap_lock); // Wait for JNI critical section to be exited - GC_locker::stall_until_clear(); + GCLocker::stall_until_clear(); gclocker_stalled_count += 1; continue; } else { @@ -697,8 +697,8 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size, // Give a warning if we seem to be looping forever. if ((QueuedAllocationWarningCount > 0) && (try_count % QueuedAllocationWarningCount == 0)) { - warning("GenCollectorPolicy::mem_allocate_work retries %d times \n\t" - " size=" SIZE_FORMAT " %s", try_count, size, is_tlab ? "(TLAB)" : ""); + log_warning(gc, ergo)("GenCollectorPolicy::mem_allocate_work retries %d times," + " size=" SIZE_FORMAT " %s", try_count, size, is_tlab ? "(TLAB)" : ""); } } } @@ -728,7 +728,7 @@ HeapWord* GenCollectorPolicy::satisfy_failed_allocation(size_t size, HeapWord* result = NULL; assert(size != 0, "Precondition violated"); - if (GC_locker::is_active_and_needs_gc()) { + if (GCLocker::is_active_and_needs_gc()) { // GC locker is active; instead of a collection we will attempt // to expand the heap, if there's room for expansion. if (!gch->is_maximal_no_gc()) { @@ -815,8 +815,8 @@ MetaWord* CollectorPolicy::satisfy_failed_metadata_allocation( return result; } - if (GC_locker::is_active_and_needs_gc()) { - // If the GC_locker is active, just expand and allocate. + if (GCLocker::is_active_and_needs_gc()) { + // If the GCLocker is active, just expand and allocate. // If that does not succeed, wait if this thread is not // in a critical section itself. result = @@ -828,7 +828,7 @@ MetaWord* CollectorPolicy::satisfy_failed_metadata_allocation( JavaThread* jthr = JavaThread::current(); if (!jthr->in_critical()) { // Wait for JNI critical section to be exited - GC_locker::stall_until_clear(); + GCLocker::stall_until_clear(); // The GC invoked by the last thread leaving the critical // section will be a young collection and a full collection // is (currently) needed for unloading classes so continue @@ -870,8 +870,8 @@ MetaWord* CollectorPolicy::satisfy_failed_metadata_allocation( loop_count++; if ((QueuedAllocationWarningCount > 0) && (loop_count % QueuedAllocationWarningCount == 0)) { - warning("satisfy_failed_metadata_allocation() retries %d times \n\t" - " size=" SIZE_FORMAT, loop_count, word_size); + log_warning(gc, ergo)("satisfy_failed_metadata_allocation() retries %d times," + " size=" SIZE_FORMAT, loop_count, word_size); } } while (true); // Until a GC is done } @@ -887,7 +887,7 @@ bool GenCollectorPolicy::should_try_older_generation_allocation( GenCollectedHeap* gch = GenCollectedHeap::heap(); size_t young_capacity = gch->young_gen()->capacity_before_gc(); return (word_size > heap_word_size(young_capacity)) - || GC_locker::is_active_and_needs_gc() + || GCLocker::is_active_and_needs_gc() || gch->incremental_collection_failed(); } diff --git a/hotspot/src/share/vm/gc/shared/gcId.cpp b/hotspot/src/share/vm/gc/shared/gcId.cpp index 1fd75130b80..55b54ed3288 100644 --- a/hotspot/src/share/vm/gc/shared/gcId.cpp +++ b/hotspot/src/share/vm/gc/shared/gcId.cpp @@ -26,7 +26,6 @@ #include "gc/shared/gcId.hpp" #include "runtime/safepoint.hpp" #include "runtime/thread.inline.hpp" -#include "runtime/threadLocalStorage.hpp" uint GCId::_next_id = 0; @@ -53,7 +52,8 @@ const uint GCId::current_raw() { } size_t GCId::print_prefix(char* buf, size_t len) { - if (ThreadLocalStorage::is_initialized() && ThreadLocalStorage::thread()->is_Named_thread()) { + Thread* thread = Thread::current_or_null(); + if (thread != NULL && thread->is_Named_thread()) { uint gc_id = current_raw(); if (gc_id != undefined()) { int ret = jio_snprintf(buf, len, "GC(%u) ", gc_id); diff --git a/hotspot/src/share/vm/gc/shared/gcLocker.cpp b/hotspot/src/share/vm/gc/shared/gcLocker.cpp index 3b3b8448f7d..115115d0a61 100644 --- a/hotspot/src/share/vm/gc/shared/gcLocker.cpp +++ b/hotspot/src/share/vm/gc/shared/gcLocker.cpp @@ -30,17 +30,17 @@ #include "runtime/atomic.inline.hpp" #include "runtime/thread.inline.hpp" -volatile jint GC_locker::_jni_lock_count = 0; -volatile bool GC_locker::_needs_gc = false; -volatile bool GC_locker::_doing_gc = false; +volatile jint GCLocker::_jni_lock_count = 0; +volatile bool GCLocker::_needs_gc = false; +volatile bool GCLocker::_doing_gc = false; #ifdef ASSERT -volatile jint GC_locker::_debug_jni_lock_count = 0; +volatile jint GCLocker::_debug_jni_lock_count = 0; #endif #ifdef ASSERT -void GC_locker::verify_critical_count() { +void GCLocker::verify_critical_count() { if (SafepointSynchronize::is_at_safepoint()) { assert(!needs_gc() || _debug_jni_lock_count == _jni_lock_count, "must agree"); int count = 0; @@ -63,18 +63,18 @@ void GC_locker::verify_critical_count() { } // In debug mode track the locking state at all times -void GC_locker::increment_debug_jni_lock_count() { +void GCLocker::increment_debug_jni_lock_count() { assert(_debug_jni_lock_count >= 0, "bad value"); Atomic::inc(&_debug_jni_lock_count); } -void GC_locker::decrement_debug_jni_lock_count() { +void GCLocker::decrement_debug_jni_lock_count() { assert(_debug_jni_lock_count > 0, "bad value"); Atomic::dec(&_debug_jni_lock_count); } #endif -void GC_locker::log_debug_jni(const char* msg) { +void GCLocker::log_debug_jni(const char* msg) { LogHandle(gc, jni) log; if (log.is_debug()) { ResourceMark rm; // JavaThread::name() allocates to convert to UTF8 @@ -82,7 +82,7 @@ void GC_locker::log_debug_jni(const char* msg) { } } -bool GC_locker::check_active_before_gc() { +bool GCLocker::check_active_before_gc() { assert(SafepointSynchronize::is_at_safepoint(), "only read at safepoint"); if (is_active() && !_needs_gc) { verify_critical_count(); @@ -92,7 +92,7 @@ bool GC_locker::check_active_before_gc() { return is_active(); } -void GC_locker::stall_until_clear() { +void GCLocker::stall_until_clear() { assert(!JavaThread::current()->in_critical(), "Would deadlock"); MutexLocker ml(JNICritical_lock); @@ -106,7 +106,7 @@ void GC_locker::stall_until_clear() { } } -void GC_locker::jni_lock(JavaThread* thread) { +void GCLocker::jni_lock(JavaThread* thread) { assert(!thread->in_critical(), "shouldn't currently be in a critical region"); MutexLocker mu(JNICritical_lock); // Block entering threads if we know at least one thread is in a @@ -122,7 +122,7 @@ void GC_locker::jni_lock(JavaThread* thread) { increment_debug_jni_lock_count(); } -void GC_locker::jni_unlock(JavaThread* thread) { +void GCLocker::jni_unlock(JavaThread* thread) { assert(thread->in_last_critical(), "should be exiting critical region"); MutexLocker mu(JNICritical_lock); _jni_lock_count--; @@ -143,49 +143,49 @@ void GC_locker::jni_unlock(JavaThread* thread) { } } -// Implementation of No_GC_Verifier +// Implementation of NoGCVerifier #ifdef ASSERT -No_GC_Verifier::No_GC_Verifier(bool verifygc) { +NoGCVerifier::NoGCVerifier(bool verifygc) { _verifygc = verifygc; if (_verifygc) { CollectedHeap* h = Universe::heap(); - assert(!h->is_gc_active(), "GC active during No_GC_Verifier"); + assert(!h->is_gc_active(), "GC active during NoGCVerifier"); _old_invocations = h->total_collections(); } } -No_GC_Verifier::~No_GC_Verifier() { +NoGCVerifier::~NoGCVerifier() { if (_verifygc) { CollectedHeap* h = Universe::heap(); - assert(!h->is_gc_active(), "GC active during No_GC_Verifier"); + assert(!h->is_gc_active(), "GC active during NoGCVerifier"); if (_old_invocations != h->total_collections()) { - fatal("collection in a No_GC_Verifier secured function"); + fatal("collection in a NoGCVerifier secured function"); } } } -Pause_No_GC_Verifier::Pause_No_GC_Verifier(No_GC_Verifier * ngcv) { +PauseNoGCVerifier::PauseNoGCVerifier(NoGCVerifier * ngcv) { _ngcv = ngcv; if (_ngcv->_verifygc) { // if we were verifying, then make sure that nothing is // wrong before we "pause" verification CollectedHeap* h = Universe::heap(); - assert(!h->is_gc_active(), "GC active during No_GC_Verifier"); + assert(!h->is_gc_active(), "GC active during NoGCVerifier"); if (_ngcv->_old_invocations != h->total_collections()) { - fatal("collection in a No_GC_Verifier secured function"); + fatal("collection in a NoGCVerifier secured function"); } } } -Pause_No_GC_Verifier::~Pause_No_GC_Verifier() { +PauseNoGCVerifier::~PauseNoGCVerifier() { if (_ngcv->_verifygc) { // if we were verifying before, then reenable verification CollectedHeap* h = Universe::heap(); - assert(!h->is_gc_active(), "GC active during No_GC_Verifier"); + assert(!h->is_gc_active(), "GC active during NoGCVerifier"); _ngcv->_old_invocations = h->total_collections(); } } @@ -201,16 +201,16 @@ Pause_No_GC_Verifier::~Pause_No_GC_Verifier() { // 6) reaching a safepoint // 7) running too long // Nor may any method it calls. -JRT_Leaf_Verifier::JRT_Leaf_Verifier() - : No_Safepoint_Verifier(true, JRT_Leaf_Verifier::should_verify_GC()) +JRTLeafVerifier::JRTLeafVerifier() + : NoSafepointVerifier(true, JRTLeafVerifier::should_verify_GC()) { } -JRT_Leaf_Verifier::~JRT_Leaf_Verifier() +JRTLeafVerifier::~JRTLeafVerifier() { } -bool JRT_Leaf_Verifier::should_verify_GC() { +bool JRTLeafVerifier::should_verify_GC() { switch (JavaThread::current()->thread_state()) { case _thread_in_Java: // is in a leaf routine, there must be no safepoint. diff --git a/hotspot/src/share/vm/gc/shared/gcLocker.hpp b/hotspot/src/share/vm/gc/shared/gcLocker.hpp index d4134dc2fb6..846242376f4 100644 --- a/hotspot/src/share/vm/gc/shared/gcLocker.hpp +++ b/hotspot/src/share/vm/gc/shared/gcLocker.hpp @@ -33,12 +33,12 @@ // The direct lock/unlock calls do not force a collection if an unlock // decrements the count to zero. Avoid calling these if at all possible. -class GC_locker: public AllStatic { +class GCLocker: public AllStatic { private: // The _jni_lock_count keeps track of the number of threads that are // currently in a critical region. It's only kept up to date when // _needs_gc is true. The current value is computed during - // safepointing and decremented during the slow path of GC_locker + // safepointing and decremented during the slow path of GCLocker // unlocking. static volatile jint _jni_lock_count; // number of jni active instances. static volatile bool _needs_gc; // heap is filling, we need a GC @@ -103,7 +103,7 @@ class GC_locker: public AllStatic { static void stall_until_clear(); // The following two methods are used for JNI critical regions. - // If we find that we failed to perform a GC because the GC_locker + // If we find that we failed to perform a GC because the GCLocker // was active, arrange for one as soon as possible by allowing // all threads in critical regions to complete, but not allowing // other critical regions to be entered. The reasons for that are: @@ -126,7 +126,7 @@ class GC_locker: public AllStatic { // _needs_gc is initially false and every java thread will go // through the fast path, which simply increments or decrements the // current thread's critical count. When GC happens at a safepoint, - // GC_locker::is_active() is checked. Since there is no safepoint in + // GCLocker::is_active() is checked. Since there is no safepoint in // the fast path of lock_critical() and unlock_critical(), there is // no race condition between the fast path and GC. After _needs_gc // is set at a safepoint, every thread will go through the slow path @@ -142,14 +142,14 @@ class GC_locker: public AllStatic { }; -// A No_GC_Verifier object can be placed in methods where one assumes that +// A NoGCVerifier object can be placed in methods where one assumes that // no garbage collection will occur. The destructor will verify this property // unless the constructor is called with argument false (not verifygc). // // The check will only be done in debug mode and if verifygc true. -class No_GC_Verifier: public StackObj { - friend class Pause_No_GC_Verifier; +class NoGCVerifier: public StackObj { + friend class PauseNoGCVerifier; protected: bool _verifygc; @@ -157,51 +157,51 @@ class No_GC_Verifier: public StackObj { public: #ifdef ASSERT - No_GC_Verifier(bool verifygc = true); - ~No_GC_Verifier(); + NoGCVerifier(bool verifygc = true); + ~NoGCVerifier(); #else - No_GC_Verifier(bool verifygc = true) {} - ~No_GC_Verifier() {} + NoGCVerifier(bool verifygc = true) {} + ~NoGCVerifier() {} #endif }; -// A Pause_No_GC_Verifier is used to temporarily pause the behavior -// of a No_GC_Verifier object. If we are not in debug mode or if the -// No_GC_Verifier object has a _verifygc value of false, then there +// A PauseNoGCVerifier is used to temporarily pause the behavior +// of a NoGCVerifier object. If we are not in debug mode or if the +// NoGCVerifier object has a _verifygc value of false, then there // is nothing to do. -class Pause_No_GC_Verifier: public StackObj { +class PauseNoGCVerifier: public StackObj { private: - No_GC_Verifier * _ngcv; + NoGCVerifier * _ngcv; public: #ifdef ASSERT - Pause_No_GC_Verifier(No_GC_Verifier * ngcv); - ~Pause_No_GC_Verifier(); + PauseNoGCVerifier(NoGCVerifier * ngcv); + ~PauseNoGCVerifier(); #else - Pause_No_GC_Verifier(No_GC_Verifier * ngcv) {} - ~Pause_No_GC_Verifier() {} + PauseNoGCVerifier(NoGCVerifier * ngcv) {} + ~PauseNoGCVerifier() {} #endif }; -// A No_Safepoint_Verifier object will throw an assertion failure if +// A NoSafepointVerifier object will throw an assertion failure if // the current thread passes a possible safepoint while this object is // instantiated. A safepoint, will either be: an oop allocation, blocking // on a Mutex or JavaLock, or executing a VM operation. // -// If StrictSafepointChecks is turned off, it degrades into a No_GC_Verifier +// If StrictSafepointChecks is turned off, it degrades into a NoGCVerifier // -class No_Safepoint_Verifier : public No_GC_Verifier { - friend class Pause_No_Safepoint_Verifier; +class NoSafepointVerifier : public NoGCVerifier { + friend class PauseNoSafepointVerifier; private: bool _activated; Thread *_thread; public: #ifdef ASSERT - No_Safepoint_Verifier(bool activated = true, bool verifygc = true ) : - No_GC_Verifier(verifygc), + NoSafepointVerifier(bool activated = true, bool verifygc = true ) : + NoGCVerifier(verifygc), _activated(activated) { _thread = Thread::current(); if (_activated) { @@ -210,33 +210,33 @@ class No_Safepoint_Verifier : public No_GC_Verifier { } } - ~No_Safepoint_Verifier() { + ~NoSafepointVerifier() { if (_activated) { _thread->_allow_allocation_count--; _thread->_allow_safepoint_count--; } } #else - No_Safepoint_Verifier(bool activated = true, bool verifygc = true) : No_GC_Verifier(verifygc){} - ~No_Safepoint_Verifier() {} + NoSafepointVerifier(bool activated = true, bool verifygc = true) : NoGCVerifier(verifygc){} + ~NoSafepointVerifier() {} #endif }; -// A Pause_No_Safepoint_Verifier is used to temporarily pause the -// behavior of a No_Safepoint_Verifier object. If we are not in debug -// mode then there is nothing to do. If the No_Safepoint_Verifier +// A PauseNoSafepointVerifier is used to temporarily pause the +// behavior of a NoSafepointVerifier object. If we are not in debug +// mode then there is nothing to do. If the NoSafepointVerifier // object has an _activated value of false, then there is nothing to // do for safepoint and allocation checking, but there may still be -// something to do for the underlying No_GC_Verifier object. +// something to do for the underlying NoGCVerifier object. -class Pause_No_Safepoint_Verifier : public Pause_No_GC_Verifier { +class PauseNoSafepointVerifier : public PauseNoGCVerifier { private: - No_Safepoint_Verifier * _nsv; + NoSafepointVerifier * _nsv; public: #ifdef ASSERT - Pause_No_Safepoint_Verifier(No_Safepoint_Verifier * nsv) - : Pause_No_GC_Verifier(nsv) { + PauseNoSafepointVerifier(NoSafepointVerifier * nsv) + : PauseNoGCVerifier(nsv) { _nsv = nsv; if (_nsv->_activated) { @@ -245,16 +245,16 @@ class Pause_No_Safepoint_Verifier : public Pause_No_GC_Verifier { } } - ~Pause_No_Safepoint_Verifier() { + ~PauseNoSafepointVerifier() { if (_nsv->_activated) { _nsv->_thread->_allow_allocation_count++; _nsv->_thread->_allow_safepoint_count++; } } #else - Pause_No_Safepoint_Verifier(No_Safepoint_Verifier * nsv) - : Pause_No_GC_Verifier(nsv) {} - ~Pause_No_Safepoint_Verifier() {} + PauseNoSafepointVerifier(NoSafepointVerifier * nsv) + : PauseNoGCVerifier(nsv) {} + ~PauseNoSafepointVerifier() {} #endif }; @@ -287,19 +287,19 @@ class SkipGCALot : public StackObj { // _thread_in_native mode. In _thread_in_native, it is ok // for another thread to trigger GC. The rest of the JRT_LEAF // rules apply. -class JRT_Leaf_Verifier : public No_Safepoint_Verifier { +class JRTLeafVerifier : public NoSafepointVerifier { static bool should_verify_GC(); public: #ifdef ASSERT - JRT_Leaf_Verifier(); - ~JRT_Leaf_Verifier(); + JRTLeafVerifier(); + ~JRTLeafVerifier(); #else - JRT_Leaf_Verifier() {} - ~JRT_Leaf_Verifier() {} + JRTLeafVerifier() {} + ~JRTLeafVerifier() {} #endif }; -// A No_Alloc_Verifier object can be placed in methods where one assumes that +// A NoAllocVerifier object can be placed in methods where one assumes that // no allocation will occur. The destructor will verify this property // unless the constructor is called with argument false (not activated). // @@ -307,23 +307,23 @@ class JRT_Leaf_Verifier : public No_Safepoint_Verifier { // Note: this only makes sense at safepoints (otherwise, other threads may // allocate concurrently.) -class No_Alloc_Verifier : public StackObj { +class NoAllocVerifier : public StackObj { private: bool _activated; public: #ifdef ASSERT - No_Alloc_Verifier(bool activated = true) { + NoAllocVerifier(bool activated = true) { _activated = activated; if (_activated) Thread::current()->_allow_allocation_count++; } - ~No_Alloc_Verifier() { + ~NoAllocVerifier() { if (_activated) Thread::current()->_allow_allocation_count--; } #else - No_Alloc_Verifier(bool activated = true) {} - ~No_Alloc_Verifier() {} + NoAllocVerifier(bool activated = true) {} + ~NoAllocVerifier() {} #endif }; diff --git a/hotspot/src/share/vm/gc/shared/gcLocker.inline.hpp b/hotspot/src/share/vm/gc/shared/gcLocker.inline.hpp index 6e677ed529c..a1a92fb7f78 100644 --- a/hotspot/src/share/vm/gc/shared/gcLocker.inline.hpp +++ b/hotspot/src/share/vm/gc/shared/gcLocker.inline.hpp @@ -27,7 +27,7 @@ #include "gc/shared/gcLocker.hpp" -inline void GC_locker::lock_critical(JavaThread* thread) { +inline void GCLocker::lock_critical(JavaThread* thread) { if (!thread->in_critical()) { if (needs_gc()) { // jni_lock call calls enter_critical under the lock so that the @@ -40,7 +40,7 @@ inline void GC_locker::lock_critical(JavaThread* thread) { thread->enter_critical(); } -inline void GC_locker::unlock_critical(JavaThread* thread) { +inline void GCLocker::unlock_critical(JavaThread* thread) { if (thread->in_last_critical()) { if (needs_gc()) { // jni_unlock call calls exit_critical under the lock so that diff --git a/hotspot/src/share/vm/gc/shared/gcTimer.cpp b/hotspot/src/share/vm/gc/shared/gcTimer.cpp index 29b19e4679a..a13e7a8c5dd 100644 --- a/hotspot/src/share/vm/gc/shared/gcTimer.cpp +++ b/hotspot/src/share/vm/gc/shared/gcTimer.cpp @@ -388,7 +388,7 @@ public: } }; -void GCTimerAllTest::all() { +void GCTimer_test() { GCTimerTest::all(); TimePartitionPhasesIteratorTest::all(); } diff --git a/hotspot/src/share/vm/gc/shared/gcTimer.hpp b/hotspot/src/share/vm/gc/shared/gcTimer.hpp index d520dab8714..0ed30b010d2 100644 --- a/hotspot/src/share/vm/gc/shared/gcTimer.hpp +++ b/hotspot/src/share/vm/gc/shared/gcTimer.hpp @@ -185,16 +185,4 @@ class TimePartitionPhasesIterator { virtual GCPhase* next(); }; - -/////////////// Unit tests /////////////// - -#ifndef PRODUCT - -class GCTimerAllTest { - public: - static void all(); -}; - -#endif - #endif // SHARE_VM_GC_SHARED_GCTIMER_HPP diff --git a/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp b/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp index 5c732a15ced..6afef5c5494 100644 --- a/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp @@ -409,7 +409,7 @@ void GenCollectedHeap::do_collection(bool full, "the requesting thread should have the Heap_lock"); guarantee(!is_gc_active(), "collection is not reentrant"); - if (GC_locker::check_active_before_gc()) { + if (GCLocker::check_active_before_gc()) { return; // GC is disabled (e.g. JNI GetXXXCritical operation) } diff --git a/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp b/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp index 58e73f237ed..73be2d60d14 100644 --- a/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp +++ b/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, 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 @@ -23,7 +23,7 @@ */ #include "precompiled.hpp" -#include "classfile/javaClasses.hpp" +#include "classfile/javaClasses.inline.hpp" #include "classfile/systemDictionary.hpp" #include "gc/shared/collectedHeap.hpp" #include "gc/shared/collectedHeap.inline.hpp" @@ -119,7 +119,6 @@ ReferenceProcessor::ReferenceProcessor(MemRegion span, _discoveredWeakRefs = &_discoveredSoftRefs[_max_num_q]; _discoveredFinalRefs = &_discoveredWeakRefs[_max_num_q]; _discoveredPhantomRefs = &_discoveredFinalRefs[_max_num_q]; - _discoveredCleanerRefs = &_discoveredPhantomRefs[_max_num_q]; // Initialize all entries to NULL for (uint i = 0; i < _max_num_q * number_of_subclasses_of_ref(); i++) { @@ -208,14 +207,11 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references( _soft_ref_timestamp_clock = java_lang_ref_SoftReference::clock(); - // Include cleaners in phantom statistics. We expect Cleaner - // references to be temporary, and don't want to deal with - // possible incompatibilities arising from making it more visible. ReferenceProcessorStats stats( total_count(_discoveredSoftRefs), total_count(_discoveredWeakRefs), total_count(_discoveredFinalRefs), - total_count(_discoveredPhantomRefs) + total_count(_discoveredCleanerRefs)); + total_count(_discoveredPhantomRefs)); // Soft references { @@ -245,12 +241,6 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references( GCTraceTime(Debug, gc, ref) tt("PhantomReference", gc_timer); process_discovered_reflist(_discoveredPhantomRefs, NULL, true, is_alive, keep_alive, complete_gc, task_executor); - - // Process cleaners, but include them in phantom timing. We expect - // Cleaner references to be temporary, and don't want to deal with - // possible incompatibilities arising from making it more visible. - process_discovered_reflist(_discoveredCleanerRefs, NULL, true, - is_alive, keep_alive, complete_gc, task_executor); } // Weak global JNI references. It would make more sense (semantically) to @@ -807,7 +797,6 @@ void ReferenceProcessor::balance_all_queues() { balance_queues(_discoveredWeakRefs); balance_queues(_discoveredFinalRefs); balance_queues(_discoveredPhantomRefs); - balance_queues(_discoveredCleanerRefs); } void ReferenceProcessor::process_discovered_reflist( @@ -912,9 +901,6 @@ inline DiscoveredList* ReferenceProcessor::get_discovered_list(ReferenceType rt) case REF_PHANTOM: list = &_discoveredPhantomRefs[id]; break; - case REF_CLEANER: - list = &_discoveredCleanerRefs[id]; - break; case REF_NONE: // we should not reach here if we are an InstanceRefKlass default: @@ -1162,17 +1148,6 @@ void ReferenceProcessor::preclean_discovered_references( preclean_discovered_reflist(_discoveredPhantomRefs[i], is_alive, keep_alive, complete_gc, yield); } - - // Cleaner references. Included in timing for phantom references. We - // expect Cleaner references to be temporary, and don't want to deal with - // possible incompatibilities arising from making it more visible. - for (uint i = 0; i < _max_num_q; i++) { - if (yield->should_return()) { - return; - } - preclean_discovered_reflist(_discoveredCleanerRefs[i], is_alive, - keep_alive, complete_gc, yield); - } } } @@ -1238,7 +1213,6 @@ const char* ReferenceProcessor::list_name(uint i) { case 1: return "WeakRef"; case 2: return "FinalRef"; case 3: return "PhantomRef"; - case 4: return "CleanerRef"; } ShouldNotReachHere(); return NULL; diff --git a/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp b/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp index fcfcbccd02d..0d100893465 100644 --- a/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp +++ b/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, 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 @@ -244,10 +244,9 @@ class ReferenceProcessor : public CHeapObj { DiscoveredList* _discoveredWeakRefs; DiscoveredList* _discoveredFinalRefs; DiscoveredList* _discoveredPhantomRefs; - DiscoveredList* _discoveredCleanerRefs; public: - static int number_of_subclasses_of_ref() { return (REF_CLEANER - REF_OTHER); } + static int number_of_subclasses_of_ref() { return (REF_PHANTOM - REF_OTHER); } uint num_q() { return _num_q; } uint max_num_q() { return _max_num_q; } diff --git a/hotspot/src/share/vm/gc/shared/space.cpp b/hotspot/src/share/vm/gc/shared/space.cpp index 44d0583b8f8..fe339a08412 100644 --- a/hotspot/src/share/vm/gc/shared/space.cpp +++ b/hotspot/src/share/vm/gc/shared/space.cpp @@ -208,9 +208,9 @@ HeapWord* ContiguousSpaceDCTOC::get_actual_top(HeapWord* top, return top; } -void Filtering_DCTOC::walk_mem_region(MemRegion mr, - HeapWord* bottom, - HeapWord* top) { +void FilteringDCTOC::walk_mem_region(MemRegion mr, + HeapWord* bottom, + HeapWord* top) { // Note that this assumption won't hold if we have a concurrent // collector in this space, which may have freed up objects after // they were dirtied and before the stop-the-world GC that is diff --git a/hotspot/src/share/vm/gc/shared/space.hpp b/hotspot/src/share/vm/gc/shared/space.hpp index 036677410bd..c44383d18f3 100644 --- a/hotspot/src/share/vm/gc/shared/space.hpp +++ b/hotspot/src/share/vm/gc/shared/space.hpp @@ -676,7 +676,7 @@ class ContiguousSpace: public CompactibleSpace { // A dirty card to oop closure that does filtering. // It knows how to filter out objects that are outside of the _boundary. -class Filtering_DCTOC : public DirtyCardToOopClosure { +class FilteringDCTOC : public DirtyCardToOopClosure { protected: // Override. void walk_mem_region(MemRegion mr, @@ -697,7 +697,7 @@ protected: FilteringClosure* cl) = 0; public: - Filtering_DCTOC(Space* sp, ExtendedOopClosure* cl, + FilteringDCTOC(Space* sp, ExtendedOopClosure* cl, CardTableModRefBS::PrecisionStyle precision, HeapWord* boundary) : DirtyCardToOopClosure(sp, cl, precision, boundary) {} @@ -713,7 +713,7 @@ public: // 2. That the space is really made up of objects and not just // blocks. -class ContiguousSpaceDCTOC : public Filtering_DCTOC { +class ContiguousSpaceDCTOC : public FilteringDCTOC { protected: // Overrides. HeapWord* get_actual_top(HeapWord* top, HeapWord* top_obj); @@ -729,7 +729,7 @@ public: ContiguousSpaceDCTOC(ContiguousSpace* sp, ExtendedOopClosure* cl, CardTableModRefBS::PrecisionStyle precision, HeapWord* boundary) : - Filtering_DCTOC(sp, cl, precision, boundary) + FilteringDCTOC(sp, cl, precision, boundary) {} }; diff --git a/hotspot/src/share/vm/gc/shared/specialized_oop_closures.hpp b/hotspot/src/share/vm/gc/shared/specialized_oop_closures.hpp index 0dce402952d..f84ad0db1b1 100644 --- a/hotspot/src/share/vm/gc/shared/specialized_oop_closures.hpp +++ b/hotspot/src/share/vm/gc/shared/specialized_oop_closures.hpp @@ -49,11 +49,11 @@ class ParScanWithBarrierClosure; class ParScanWithoutBarrierClosure; // CMS class MarkRefsIntoAndScanClosure; -class Par_MarkRefsIntoAndScanClosure; +class ParMarkRefsIntoAndScanClosure; class PushAndMarkClosure; -class Par_PushAndMarkClosure; +class ParPushAndMarkClosure; class PushOrMarkClosure; -class Par_PushOrMarkClosure; +class ParPushOrMarkClosure; class CMSKeepAliveClosure; class CMSInnerParMarkAndPushClosure; // Misc @@ -95,11 +95,11 @@ class NoHeaderExtendedOopClosure; #if INCLUDE_ALL_GCS #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_CMS(f) \ f(MarkRefsIntoAndScanClosure,_nv) \ - f(Par_MarkRefsIntoAndScanClosure,_nv) \ + f(ParMarkRefsIntoAndScanClosure,_nv) \ f(PushAndMarkClosure,_nv) \ - f(Par_PushAndMarkClosure,_nv) \ + f(ParPushAndMarkClosure,_nv) \ f(PushOrMarkClosure,_nv) \ - f(Par_PushOrMarkClosure,_nv) \ + f(ParPushOrMarkClosure,_nv) \ f(CMSKeepAliveClosure,_nv) \ f(CMSInnerParMarkAndPushClosure,_nv) #endif @@ -136,8 +136,8 @@ class NoHeaderExtendedOopClosure; #define SPECIALIZED_PAR_OOP_ITERATE_CLOSURES(f) \ f(MarkRefsIntoAndScanClosure,_nv) \ f(PushAndMarkClosure,_nv) \ - f(Par_MarkRefsIntoAndScanClosure,_nv) \ - f(Par_PushAndMarkClosure,_nv) + f(ParMarkRefsIntoAndScanClosure,_nv) \ + f(ParPushAndMarkClosure,_nv) #define ALL_PAR_OOP_ITERATE_CLOSURES(f) \ f(ExtendedOopClosure,_v) \ diff --git a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp index 43389fb4613..d2b688ffc5b 100644 --- a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp +++ b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp @@ -105,7 +105,7 @@ void ThreadLocalAllocBuffer::accumulate_statistics() { // an illusion of a contiguous Eden and optionally retires the tlab. // Waste accounting should be done in caller as appropriate; see, // for example, clear_before_allocation(). -void ThreadLocalAllocBuffer::make_parsable(bool retire) { +void ThreadLocalAllocBuffer::make_parsable(bool retire, bool zap) { if (end() != NULL) { invariants(); @@ -113,7 +113,7 @@ void ThreadLocalAllocBuffer::make_parsable(bool retire) { myThread()->incr_allocated_bytes(used_bytes()); } - CollectedHeap::fill_with_object(top(), hard_end(), retire); + CollectedHeap::fill_with_object(top(), hard_end(), retire && zap); if (retire || ZeroTLAB) { // "Reset" the TLAB set_start(NULL); diff --git a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.hpp b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.hpp index eca56006510..2af19576191 100644 --- a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.hpp +++ b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.hpp @@ -145,8 +145,8 @@ public: // Initialization at startup static void startup_initialization(); - // Make an in-use tlab parsable, optionally also retiring it. - void make_parsable(bool retire); + // Make an in-use tlab parsable, optionally retiring and/or zapping it. + void make_parsable(bool retire, bool zap = true); // Retire in-use tlab before allocation of a new tlab void clear_before_allocation(); diff --git a/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp b/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp index 57ffc4eb40a..755681afe8a 100644 --- a/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp +++ b/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp @@ -84,10 +84,10 @@ bool VM_GC_Operation::skip_operation() const { if (_full && skip) { skip = (_full_gc_count_before != Universe::heap()->total_full_collections()); } - if (!skip && GC_locker::is_active_and_needs_gc()) { + if (!skip && GCLocker::is_active_and_needs_gc()) { skip = Universe::heap()->is_maximal_no_gc(); assert(!(skip && (_gc_cause == GCCause::_gc_locker)), - "GC_locker cannot be active when initiating GC"); + "GCLocker cannot be active when initiating GC"); } return skip; } @@ -136,7 +136,7 @@ bool VM_GC_HeapInspection::skip_operation() const { } bool VM_GC_HeapInspection::collect() { - if (GC_locker::is_active()) { + if (GCLocker::is_active()) { return false; } Universe::heap()->collect_as_vm_thread(GCCause::_heap_inspection); @@ -146,7 +146,7 @@ bool VM_GC_HeapInspection::collect() { void VM_GC_HeapInspection::doit() { HandleMark hm; Universe::heap()->ensure_parsability(false); // must happen, even if collection does - // not happen (e.g. due to GC_locker) + // not happen (e.g. due to GCLocker) // or _full_gc being false if (_full_gc) { if (!collect()) { @@ -177,7 +177,7 @@ void VM_GenCollectForAllocation::doit() { _result = gch->satisfy_failed_allocation(_word_size, _tlab); assert(gch->is_in_reserved_or_null(_result), "result not in heap"); - if (_result == NULL && GC_locker::is_active_and_needs_gc()) { + if (_result == NULL && GCLocker::is_active_and_needs_gc()) { set_gc_locked(); } } @@ -289,7 +289,7 @@ void VM_CollectForMetadataAllocation::doit() { log_debug(gc)("After Metaspace GC failed to allocate size " SIZE_FORMAT, _size); - if (GC_locker::is_active_and_needs_gc()) { + if (GCLocker::is_active_and_needs_gc()) { set_gc_locked(); } } diff --git a/hotspot/src/share/vm/gc/shared/workgroup.cpp b/hotspot/src/share/vm/gc/shared/workgroup.cpp index 0fea9e88eb3..41b3b9a8ef8 100644 --- a/hotspot/src/share/vm/gc/shared/workgroup.cpp +++ b/hotspot/src/share/vm/gc/shared/workgroup.cpp @@ -499,43 +499,3 @@ bool SequentialSubTasksDone::all_tasks_completed() { } return false; } - -FreeIdSet::FreeIdSet(uint size, Monitor* mon) : - _size(size), _mon(mon), _hd(0), _waiters(0), _claimed(0) -{ - guarantee(size != 0, "must be"); - _ids = NEW_C_HEAP_ARRAY(uint, size, mtGC); - for (uint i = 0; i < size - 1; i++) { - _ids[i] = i+1; - } - _ids[size-1] = end_of_list; // end of list. -} - -FreeIdSet::~FreeIdSet() { - FREE_C_HEAP_ARRAY(uint, _ids); -} - -uint FreeIdSet::claim_par_id() { - MutexLockerEx x(_mon, Mutex::_no_safepoint_check_flag); - while (_hd == end_of_list) { - _waiters++; - _mon->wait(Mutex::_no_safepoint_check_flag); - _waiters--; - } - uint res = _hd; - _hd = _ids[res]; - _ids[res] = claimed; // For debugging. - _claimed++; - return res; -} - -void FreeIdSet::release_par_id(uint id) { - MutexLockerEx x(_mon, Mutex::_no_safepoint_check_flag); - assert(_ids[id] == claimed, "Precondition."); - _ids[id] = _hd; - _hd = id; - _claimed--; - if (_waiters > 0) { - _mon->notify_all(); - } -} diff --git a/hotspot/src/share/vm/gc/shared/workgroup.hpp b/hotspot/src/share/vm/gc/shared/workgroup.hpp index 8c0dde8b396..b2a48647cab 100644 --- a/hotspot/src/share/vm/gc/shared/workgroup.hpp +++ b/hotspot/src/share/vm/gc/shared/workgroup.hpp @@ -378,30 +378,4 @@ public: bool all_tasks_completed(); }; -// Represents a set of free small integer ids. -class FreeIdSet : public CHeapObj { - enum { - end_of_list = UINT_MAX, - claimed = UINT_MAX - 1 - }; - - uint _size; - Monitor* _mon; - - uint* _ids; - uint _hd; - uint _waiters; - uint _claimed; - -public: - FreeIdSet(uint size, Monitor* mon); - ~FreeIdSet(); - - // Returns an unclaimed parallel id (waiting for one to be released if - // necessary). - uint claim_par_id(); - - void release_par_id(uint id); -}; - #endif // SHARE_VM_GC_SHARED_WORKGROUP_HPP diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.cpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.cpp new file mode 100644 index 00000000000..96fb64403cd --- /dev/null +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.cpp @@ -0,0 +1,420 @@ +/* + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "asm/macroAssembler.hpp" +#include "asm/macroAssembler.inline.hpp" +#include "interpreter/bytecodeHistogram.hpp" +#include "interpreter/bytecodeInterpreter.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" +#include "interpreter/templateTable.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/resourceArea.hpp" +#include "oops/arrayOop.hpp" +#include "oops/methodData.hpp" +#include "oops/method.hpp" +#include "oops/oop.inline.hpp" +#include "prims/forte.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/methodHandles.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/timer.hpp" + +# define __ _masm-> + +//------------------------------------------------------------------------------------------------------------------------ +// Implementation of platform independent aspects of Interpreter + +void AbstractInterpreter::initialize() { + if (_code != NULL) return; + + // make sure 'imported' classes are initialized + if (CountBytecodes || TraceBytecodes || StopInterpreterAt) BytecodeCounter::reset(); + if (PrintBytecodeHistogram) BytecodeHistogram::reset(); + if (PrintBytecodePairHistogram) BytecodePairHistogram::reset(); + + InvocationCounter::reinitialize(DelayCompilationDuringStartup); + +} + +void AbstractInterpreter::print() { + tty->cr(); + tty->print_cr("----------------------------------------------------------------------"); + tty->print_cr("Interpreter"); + tty->cr(); + tty->print_cr("code size = %6dK bytes", (int)_code->used_space()/1024); + tty->print_cr("total space = %6dK bytes", (int)_code->total_space()/1024); + tty->print_cr("wasted space = %6dK bytes", (int)_code->available_space()/1024); + tty->cr(); + tty->print_cr("# of codelets = %6d" , _code->number_of_stubs()); + if (_code->number_of_stubs() != 0) { + tty->print_cr("avg codelet size = %6d bytes", _code->used_space() / _code->number_of_stubs()); + tty->cr(); + } + _code->print(); + tty->print_cr("----------------------------------------------------------------------"); + tty->cr(); +} + + +//------------------------------------------------------------------------------------------------------------------------ +// Implementation of interpreter + +StubQueue* AbstractInterpreter::_code = NULL; +bool AbstractInterpreter::_notice_safepoints = false; +address AbstractInterpreter::_rethrow_exception_entry = NULL; + +address AbstractInterpreter::_native_entry_begin = NULL; +address AbstractInterpreter::_native_entry_end = NULL; +address AbstractInterpreter::_slow_signature_handler; +address AbstractInterpreter::_entry_table [AbstractInterpreter::number_of_method_entries]; +address AbstractInterpreter::_native_abi_to_tosca [AbstractInterpreter::number_of_result_handlers]; + +//------------------------------------------------------------------------------------------------------------------------ +// Generation of complete interpreter + +AbstractInterpreterGenerator::AbstractInterpreterGenerator(StubQueue* _code) { + _masm = NULL; +} + + +//------------------------------------------------------------------------------------------------------------------------ +// Entry points + +AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(methodHandle m) { + // Abstract method? + if (m->is_abstract()) return abstract; + + // Method handle primitive? + if (m->is_method_handle_intrinsic()) { + vmIntrinsics::ID id = m->intrinsic_id(); + assert(MethodHandles::is_signature_polymorphic(id), "must match an intrinsic"); + MethodKind kind = (MethodKind)( method_handle_invoke_FIRST + + ((int)id - vmIntrinsics::FIRST_MH_SIG_POLY) ); + assert(kind <= method_handle_invoke_LAST, "parallel enum ranges"); + return kind; + } + +#ifndef CC_INTERP + if (UseCRC32Intrinsics && m->is_native()) { + // Use optimized stub code for CRC32 native methods. + switch (m->intrinsic_id()) { + case vmIntrinsics::_updateCRC32 : return java_util_zip_CRC32_update; + case vmIntrinsics::_updateBytesCRC32 : return java_util_zip_CRC32_updateBytes; + case vmIntrinsics::_updateByteBufferCRC32 : return java_util_zip_CRC32_updateByteBuffer; + } + } + if (UseCRC32CIntrinsics) { + // Use optimized stub code for CRC32C methods. + switch (m->intrinsic_id()) { + case vmIntrinsics::_updateBytesCRC32C : return java_util_zip_CRC32C_updateBytes; + case vmIntrinsics::_updateDirectByteBufferCRC32C : return java_util_zip_CRC32C_updateDirectByteBuffer; + } + } + + switch(m->intrinsic_id()) { + case vmIntrinsics::_intBitsToFloat: return java_lang_Float_intBitsToFloat; + case vmIntrinsics::_floatToRawIntBits: return java_lang_Float_floatToRawIntBits; + case vmIntrinsics::_longBitsToDouble: return java_lang_Double_longBitsToDouble; + case vmIntrinsics::_doubleToRawLongBits: return java_lang_Double_doubleToRawLongBits; + } + +#endif // CC_INTERP + + // Native method? + // Note: This test must come _before_ the test for intrinsic + // methods. See also comments below. + if (m->is_native()) { + assert(!m->is_method_handle_intrinsic(), "overlapping bits here, watch out"); + return m->is_synchronized() ? native_synchronized : native; + } + + // Synchronized? + if (m->is_synchronized()) { + return zerolocals_synchronized; + } + + if (RegisterFinalizersAtInit && m->code_size() == 1 && + m->intrinsic_id() == vmIntrinsics::_Object_init) { + // We need to execute the special return bytecode to check for + // finalizer registration so create a normal frame. + return zerolocals; + } + + // Empty method? + if (m->is_empty_method()) { + return empty; + } + + // Special intrinsic method? + // Note: This test must come _after_ the test for native methods, + // otherwise we will run into problems with JDK 1.2, see also + // TemplateInterpreterGenerator::generate_method_entry() for + // for details. + switch (m->intrinsic_id()) { + case vmIntrinsics::_dsin : return java_lang_math_sin ; + case vmIntrinsics::_dcos : return java_lang_math_cos ; + case vmIntrinsics::_dtan : return java_lang_math_tan ; + case vmIntrinsics::_dabs : return java_lang_math_abs ; + case vmIntrinsics::_dsqrt : return java_lang_math_sqrt ; + case vmIntrinsics::_dlog : return java_lang_math_log ; + case vmIntrinsics::_dlog10: return java_lang_math_log10; + case vmIntrinsics::_dpow : return java_lang_math_pow ; + case vmIntrinsics::_dexp : return java_lang_math_exp ; + + case vmIntrinsics::_Reference_get: + return java_lang_ref_reference_get; + } + + // Accessor method? + if (m->is_getter()) { + // TODO: We should have used ::is_accessor above, but fast accessors in Zero expect only getters. + // See CppInterpreter::accessor_entry in cppInterpreter_zero.cpp. This should be fixed in Zero, + // then the call above updated to ::is_accessor + assert(m->size_of_parameters() == 1, "fast code for accessors assumes parameter size = 1"); + return accessor; + } + + // Note: for now: zero locals for all non-empty methods + return zerolocals; +} + + +void AbstractInterpreter::set_entry_for_kind(AbstractInterpreter::MethodKind kind, address entry) { + assert(kind >= method_handle_invoke_FIRST && + kind <= method_handle_invoke_LAST, "late initialization only for MH entry points"); + assert(_entry_table[kind] == _entry_table[abstract], "previous value must be AME entry"); + _entry_table[kind] = entry; +} + + +// Return true if the interpreter can prove that the given bytecode has +// not yet been executed (in Java semantics, not in actual operation). +bool AbstractInterpreter::is_not_reached(const methodHandle& method, int bci) { + Bytecodes::Code code = method()->code_at(bci); + + if (!Bytecodes::must_rewrite(code)) { + // might have been reached + return false; + } + + // the bytecode might not be rewritten if the method is an accessor, etc. + address ientry = method->interpreter_entry(); + if (ientry != entry_for_kind(AbstractInterpreter::zerolocals) && + ientry != entry_for_kind(AbstractInterpreter::zerolocals_synchronized)) + return false; // interpreter does not run this method! + + // otherwise, we can be sure this bytecode has never been executed + return true; +} + + +#ifndef PRODUCT +void AbstractInterpreter::print_method_kind(MethodKind kind) { + switch (kind) { + case zerolocals : tty->print("zerolocals" ); break; + case zerolocals_synchronized: tty->print("zerolocals_synchronized"); break; + case native : tty->print("native" ); break; + case native_synchronized : tty->print("native_synchronized" ); break; + case empty : tty->print("empty" ); break; + case accessor : tty->print("accessor" ); break; + case abstract : tty->print("abstract" ); break; + case java_lang_math_sin : tty->print("java_lang_math_sin" ); break; + case java_lang_math_cos : tty->print("java_lang_math_cos" ); break; + case java_lang_math_tan : tty->print("java_lang_math_tan" ); break; + case java_lang_math_abs : tty->print("java_lang_math_abs" ); break; + case java_lang_math_sqrt : tty->print("java_lang_math_sqrt" ); break; + case java_lang_math_log : tty->print("java_lang_math_log" ); break; + case java_lang_math_log10 : tty->print("java_lang_math_log10" ); break; + case java_util_zip_CRC32_update : tty->print("java_util_zip_CRC32_update"); break; + case java_util_zip_CRC32_updateBytes : tty->print("java_util_zip_CRC32_updateBytes"); break; + case java_util_zip_CRC32_updateByteBuffer : tty->print("java_util_zip_CRC32_updateByteBuffer"); break; + case java_util_zip_CRC32C_updateBytes : tty->print("java_util_zip_CRC32C_updateBytes"); break; + case java_util_zip_CRC32C_updateDirectByteBuffer: tty->print("java_util_zip_CRC32C_updateDirectByteByffer"); break; + default: + if (kind >= method_handle_invoke_FIRST && + kind <= method_handle_invoke_LAST) { + const char* kind_name = vmIntrinsics::name_at(method_handle_intrinsic(kind)); + if (kind_name[0] == '_') kind_name = &kind_name[1]; // '_invokeExact' => 'invokeExact' + tty->print("method_handle_%s", kind_name); + break; + } + ShouldNotReachHere(); + break; + } +} +#endif // PRODUCT + + +//------------------------------------------------------------------------------------------------------------------------ +// Deoptimization support + +/** + * If a deoptimization happens, this function returns the point of next bytecode to continue execution. + */ +address AbstractInterpreter::deopt_continue_after_entry(Method* method, address bcp, int callee_parameters, bool is_top_frame) { + assert(method->contains(bcp), "just checkin'"); + + // Get the original and rewritten bytecode. + Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); + assert(!Interpreter::bytecode_should_reexecute(code), "should not reexecute"); + + const int bci = method->bci_from(bcp); + + // compute continuation length + const int length = Bytecodes::length_at(method, bcp); + + // compute result type + BasicType type = T_ILLEGAL; + + switch (code) { + case Bytecodes::_invokevirtual : + case Bytecodes::_invokespecial : + case Bytecodes::_invokestatic : + case Bytecodes::_invokeinterface: { + Thread *thread = Thread::current(); + ResourceMark rm(thread); + methodHandle mh(thread, method); + type = Bytecode_invoke(mh, bci).result_type(); + // since the cache entry might not be initialized: + // (NOT needed for the old calling convension) + if (!is_top_frame) { + int index = Bytes::get_native_u2(bcp+1); + method->constants()->cache()->entry_at(index)->set_parameter_size(callee_parameters); + } + break; + } + + case Bytecodes::_invokedynamic: { + Thread *thread = Thread::current(); + ResourceMark rm(thread); + methodHandle mh(thread, method); + type = Bytecode_invoke(mh, bci).result_type(); + // since the cache entry might not be initialized: + // (NOT needed for the old calling convension) + if (!is_top_frame) { + int index = Bytes::get_native_u4(bcp+1); + method->constants()->invokedynamic_cp_cache_entry_at(index)->set_parameter_size(callee_parameters); + } + break; + } + + case Bytecodes::_ldc : + case Bytecodes::_ldc_w : // fall through + case Bytecodes::_ldc2_w: + { + Thread *thread = Thread::current(); + ResourceMark rm(thread); + methodHandle mh(thread, method); + type = Bytecode_loadconstant(mh, bci).result_type(); + break; + } + + default: + type = Bytecodes::result_type(code); + break; + } + + // return entry point for computed continuation state & bytecode length + return + is_top_frame + ? Interpreter::deopt_entry (as_TosState(type), length) + : Interpreter::return_entry(as_TosState(type), length, code); +} + +// If deoptimization happens, this function returns the point where the interpreter reexecutes +// the bytecode. +// Note: Bytecodes::_athrow is a special case in that it does not return +// Interpreter::deopt_entry(vtos, 0) like others +address AbstractInterpreter::deopt_reexecute_entry(Method* method, address bcp) { + assert(method->contains(bcp), "just checkin'"); + Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); +#if defined(COMPILER1) || INCLUDE_JVMCI + if(code == Bytecodes::_athrow ) { + return Interpreter::rethrow_exception_entry(); + } +#endif /* COMPILER1 || INCLUDE_JVMCI */ + return Interpreter::deopt_entry(vtos, 0); +} + +// If deoptimization happens, the interpreter should reexecute these bytecodes. +// This function mainly helps the compilers to set up the reexecute bit. +bool AbstractInterpreter::bytecode_should_reexecute(Bytecodes::Code code) { + switch (code) { + case Bytecodes::_lookupswitch: + case Bytecodes::_tableswitch: + case Bytecodes::_fast_binaryswitch: + case Bytecodes::_fast_linearswitch: + // recompute condtional expression folded into _if + case Bytecodes::_lcmp : + case Bytecodes::_fcmpl : + case Bytecodes::_fcmpg : + case Bytecodes::_dcmpl : + case Bytecodes::_dcmpg : + case Bytecodes::_ifnull : + case Bytecodes::_ifnonnull : + case Bytecodes::_goto : + case Bytecodes::_goto_w : + case Bytecodes::_ifeq : + case Bytecodes::_ifne : + case Bytecodes::_iflt : + case Bytecodes::_ifge : + case Bytecodes::_ifgt : + case Bytecodes::_ifle : + case Bytecodes::_if_icmpeq : + case Bytecodes::_if_icmpne : + case Bytecodes::_if_icmplt : + case Bytecodes::_if_icmpge : + case Bytecodes::_if_icmpgt : + case Bytecodes::_if_icmple : + case Bytecodes::_if_acmpeq : + case Bytecodes::_if_acmpne : + // special cases + case Bytecodes::_getfield : + case Bytecodes::_putfield : + case Bytecodes::_getstatic : + case Bytecodes::_putstatic : + case Bytecodes::_aastore : +#ifdef COMPILER1 + //special case of reexecution + case Bytecodes::_athrow : +#endif + return true; + + default: + return false; + } +} + +void AbstractInterpreter::initialize_method_handle_entries() { + // method handle entry kinds are generated later in MethodHandlesAdapterGenerator::generate: + for (int i = method_handle_invoke_FIRST; i <= method_handle_invoke_LAST; i++) { + MethodKind kind = (MethodKind) i; + _entry_table[kind] = _entry_table[Interpreter::abstract]; + } +} diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp index 62d1947e227..8be852bae60 100644 --- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -284,6 +284,12 @@ class AbstractInterpreter: AllStatic { default: ShouldNotReachHere(); } } + + static void initialize_method_handle_entries(); + + // PPC-only: Support abs and sqrt like in compiler. + // For others we can use a normal (native) entry. + static bool math_entry_available(MethodKind kind); }; //------------------------------------------------------------------------------------------------------------------------ @@ -294,16 +300,6 @@ class AbstractInterpreterGenerator: public StackObj { protected: InterpreterMacroAssembler* _masm; - // shared code sequences - // Converter for native abi result to tosca result - address generate_result_handler_for(BasicType type); - address generate_slow_signature_handler(); - - void bang_stack_shadow_pages(bool native_call); - - void generate_all(); - void initialize_method_handle_entries(); - public: AbstractInterpreterGenerator(StubQueue* _code); }; diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp index 09e3d579ea0..cab530d379c 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2016, 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 @@ -2780,14 +2780,14 @@ run: MORE_STACK(1); pc = METHOD->code_base() + continuation_bci; if (log_is_enabled(Info, exceptions)) { - ResourceMark rm; - log_info(exceptions)("Exception <%s> (" INTPTR_FORMAT ")\n" - " thrown in interpreter method <%s>\n" - " at bci %d, continuing at %d for thread " INTPTR_FORMAT, - except_oop->print_value_string(), p2i(except_oop()), - METHOD->print_value_string(), - (int)(istate->bcp() - METHOD->code_base()), - (int)continuation_bci, p2i(THREAD)); + ResourceMark rm(THREAD); + stringStream tempst; + tempst.print("interpreter method <%s>\n" + " at bci %d, continuing at %d for thread " INTPTR_FORMAT, + METHOD->print_value_string(), + (int)(istate->bcp() - METHOD->code_base()), + (int)continuation_bci, p2i(THREAD)); + Exceptions::log_exception(except_oop, tempst); } // for AbortVMOnException flag Exceptions::debug_check_abort(except_oop); @@ -2798,13 +2798,13 @@ run: } if (log_is_enabled(Info, exceptions)) { ResourceMark rm; - log_info(exceptions)("Exception <%s> (" INTPTR_FORMAT ")\n" - " thrown in interpreter method <%s>\n" - " at bci %d, unwinding for thread " INTPTR_FORMAT, - except_oop->print_value_string(), p2i(except_oop()), - METHOD->print_value_string(), - (int)(istate->bcp() - METHOD->code_base()), - p2i(THREAD)); + stringStream tempst; + tempst.print("interpreter method <%s>\n" + " at bci %d, unwinding for thread " INTPTR_FORMAT, + METHOD->print_value_string(), + (int)(istate->bcp() - METHOD->code_base()), + p2i(THREAD)); + Exceptions::log_exception(except_oop, tempst); } // for AbortVMOnException flag Exceptions::debug_check_abort(except_oop); diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreterProfiling.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreterProfiling.hpp index 86b6c22822f..b6d780963dc 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreterProfiling.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreterProfiling.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 SAP SE. 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 diff --git a/hotspot/src/share/vm/interpreter/cppInterpreter.cpp b/hotspot/src/share/vm/interpreter/cppInterpreter.cpp index 318dbd9a74a..cbcfccbd759 100644 --- a/hotspot/src/share/vm/interpreter/cppInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/cppInterpreter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,12 +46,11 @@ void CppInterpreter::initialize() { int code_size = InterpreterCodeSize; NOT_PRODUCT(code_size *= 4;) // debug uses extra interpreter code space _code = new StubQueue(new InterpreterCodeletInterface, code_size, NULL, - "Interpreter"); + "Interpreter"); CppInterpreterGenerator g(_code); if (PrintInterpreter) print(); } - // Allow c++ interpreter to do one initialization now that switches are set, etc. BytecodeInterpreter start_msg(BytecodeInterpreter::initialize); if (JvmtiExport::can_post_interpreter_events()) @@ -73,114 +72,10 @@ void CppInterpreter::invoke_osr(Method* method, } -CppInterpreterGenerator::CppInterpreterGenerator(StubQueue* _code): AbstractInterpreterGenerator(_code) { - generate_all(); -} - -static const BasicType types[Interpreter::number_of_result_handlers] = { - T_BOOLEAN, - T_CHAR , - T_BYTE , - T_SHORT , - T_INT , - T_LONG , - T_VOID , - T_FLOAT , - T_DOUBLE , - T_OBJECT -}; - -void CppInterpreterGenerator::generate_all() { - AbstractInterpreterGenerator::generate_all(); - - -#define method_entry(kind) Interpreter::_entry_table[Interpreter::kind] = generate_method_entry(Interpreter::kind) - - { CodeletMark cm(_masm, "(kind = frame_manager)"); - // all non-native method kinds - method_entry(zerolocals); - method_entry(zerolocals_synchronized); - method_entry(empty); - method_entry(accessor); - method_entry(abstract); - method_entry(java_lang_math_sin ); - method_entry(java_lang_math_cos ); - method_entry(java_lang_math_tan ); - method_entry(java_lang_math_abs ); - method_entry(java_lang_math_sqrt ); - method_entry(java_lang_math_log ); - method_entry(java_lang_math_log10 ); - method_entry(java_lang_math_pow ); - method_entry(java_lang_math_exp ); - method_entry(java_lang_ref_reference_get); - - initialize_method_handle_entries(); - - Interpreter::_native_entry_begin = Interpreter::code()->code_end(); - method_entry(native); - method_entry(native_synchronized); - Interpreter::_native_entry_end = Interpreter::code()->code_end(); - } - - -#undef method_entry -} InterpreterCodelet* CppInterpreter::codelet_containing(address pc) { // FIXME: I'm pretty sure _code is null and this is never called, which is why it's copied. return (InterpreterCodelet*)_code->stub_containing(pc); } -// Generate method entries -address CppInterpreterGenerator::generate_method_entry( - AbstractInterpreter::MethodKind kind) { - // determine code generation flags - bool native = false; - bool synchronized = false; - address entry_point = NULL; - - switch (kind) { - case Interpreter::zerolocals : break; - case Interpreter::zerolocals_synchronized: synchronized = true; break; - case Interpreter::native : native = true; break; - case Interpreter::native_synchronized : native = true; synchronized = true; break; - case Interpreter::empty : entry_point = generate_empty_entry(); break; - case Interpreter::accessor : entry_point = generate_accessor_entry(); break; - case Interpreter::abstract : entry_point = generate_abstract_entry(); break; - - case Interpreter::java_lang_math_sin : // fall thru - case Interpreter::java_lang_math_cos : // fall thru - case Interpreter::java_lang_math_tan : // fall thru - case Interpreter::java_lang_math_abs : // fall thru - case Interpreter::java_lang_math_log : // fall thru - case Interpreter::java_lang_math_log10 : // fall thru - case Interpreter::java_lang_math_sqrt : // fall thru - case Interpreter::java_lang_math_pow : // fall thru - case Interpreter::java_lang_math_exp : entry_point = generate_math_entry(kind); break; - case Interpreter::java_lang_ref_reference_get - : entry_point = generate_Reference_get_entry(); break; - default: - fatal("unexpected method kind: %d", kind); - break; - } - - if (entry_point) { - return entry_point; - } - - // We expect the normal and native entry points to be generated first so we can reuse them. - if (native) { - entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native); - if (entry_point == NULL) { - entry_point = generate_native_entry(synchronized); - } - } else { - entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals); - if (entry_point == NULL) { - entry_point = generate_normal_entry(synchronized); - } - } - - return entry_point; -} #endif // CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.cpp b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.cpp new file mode 100644 index 00000000000..db808a9d477 --- /dev/null +++ b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.cpp @@ -0,0 +1,125 @@ +/* + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "interpreter/bytecodeInterpreter.hpp" +#include "interpreter/cppInterpreterGenerator.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" + +#ifdef CC_INTERP + +CppInterpreterGenerator::CppInterpreterGenerator(StubQueue* _code): AbstractInterpreterGenerator(_code) { + generate_all(); +} + +void CppInterpreterGenerator::generate_all() { + { CodeletMark cm(_masm, "slow signature handler"); + AbstractInterpreter::_slow_signature_handler = generate_slow_signature_handler(); + } + +#define method_entry(kind) Interpreter::_entry_table[Interpreter::kind] = generate_method_entry(Interpreter::kind) + + { CodeletMark cm(_masm, "(kind = frame_manager)"); + // all non-native method kinds + method_entry(zerolocals); + method_entry(zerolocals_synchronized); + method_entry(empty); + method_entry(accessor); + method_entry(abstract); + method_entry(java_lang_math_sin ); + method_entry(java_lang_math_cos ); + method_entry(java_lang_math_tan ); + method_entry(java_lang_math_abs ); + method_entry(java_lang_math_sqrt ); + method_entry(java_lang_math_log ); + method_entry(java_lang_math_log10 ); + method_entry(java_lang_math_pow ); + method_entry(java_lang_math_exp ); + method_entry(java_lang_ref_reference_get); + + AbstractInterpreter::initialize_method_handle_entries(); + + Interpreter::_native_entry_begin = Interpreter::code()->code_end(); + method_entry(native); + method_entry(native_synchronized); + Interpreter::_native_entry_end = Interpreter::code()->code_end(); + } + +#undef method_entry +} + +// Generate method entries +address CppInterpreterGenerator::generate_method_entry( + AbstractInterpreter::MethodKind kind) { + // determine code generation flags + bool native = false; + bool synchronized = false; + address entry_point = NULL; + + switch (kind) { + case Interpreter::zerolocals : break; + case Interpreter::zerolocals_synchronized: synchronized = true; break; + case Interpreter::native : native = true; break; + case Interpreter::native_synchronized : native = true; synchronized = true; break; + case Interpreter::empty : entry_point = generate_empty_entry(); break; + case Interpreter::accessor : entry_point = generate_accessor_entry(); break; + case Interpreter::abstract : entry_point = generate_abstract_entry(); break; + + case Interpreter::java_lang_math_sin : // fall thru + case Interpreter::java_lang_math_cos : // fall thru + case Interpreter::java_lang_math_tan : // fall thru + case Interpreter::java_lang_math_abs : // fall thru + case Interpreter::java_lang_math_log : // fall thru + case Interpreter::java_lang_math_log10 : // fall thru + case Interpreter::java_lang_math_sqrt : // fall thru + case Interpreter::java_lang_math_pow : // fall thru + case Interpreter::java_lang_math_exp : entry_point = generate_math_entry(kind); break; + case Interpreter::java_lang_ref_reference_get + : entry_point = generate_Reference_get_entry(); break; + default: + fatal("unexpected method kind: %d", kind); + break; + } + + if (entry_point) { + return entry_point; + } + + // We expect the normal and native entry points to be generated first so we can reuse them. + if (native) { + entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native); + if (entry_point == NULL) { + entry_point = generate_native_entry(synchronized); + } + } else { + entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals); + if (entry_point == NULL) { + entry_point = generate_normal_entry(synchronized); + } + } + + return entry_point; +} +#endif // CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp index 69072c7f50c..c9fbd30fff0 100644 --- a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp +++ b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -39,6 +39,8 @@ class CppInterpreterGenerator: public AbstractInterpreterGenerator { private: void generate_all(); + address generate_slow_signature_handler(); + address generate_method_entry(AbstractInterpreter::MethodKind kind); address generate_normal_entry(bool synchronized); address generate_native_entry(bool synchronized); diff --git a/hotspot/src/share/vm/interpreter/interpreter.cpp b/hotspot/src/share/vm/interpreter/interpreter.cpp index 3101d3628f6..d23803eb7ba 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.cpp +++ b/hotspot/src/share/vm/interpreter/interpreter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -111,40 +111,6 @@ CodeletMark::~CodeletMark() { *_masm = NULL; } -//------------------------------------------------------------------------------------------------------------------------ -// Implementation of platform independent aspects of Interpreter - -void AbstractInterpreter::initialize() { - if (_code != NULL) return; - - // make sure 'imported' classes are initialized - if (CountBytecodes || TraceBytecodes || StopInterpreterAt) BytecodeCounter::reset(); - if (PrintBytecodeHistogram) BytecodeHistogram::reset(); - if (PrintBytecodePairHistogram) BytecodePairHistogram::reset(); - - InvocationCounter::reinitialize(DelayCompilationDuringStartup); - -} - -void AbstractInterpreter::print() { - tty->cr(); - tty->print_cr("----------------------------------------------------------------------"); - tty->print_cr("Interpreter"); - tty->cr(); - tty->print_cr("code size = %6dK bytes", (int)_code->used_space()/1024); - tty->print_cr("total space = %6dK bytes", (int)_code->total_space()/1024); - tty->print_cr("wasted space = %6dK bytes", (int)_code->available_space()/1024); - tty->cr(); - tty->print_cr("# of codelets = %6d" , _code->number_of_stubs()); - if (_code->number_of_stubs() != 0) { - tty->print_cr("avg codelet size = %6d bytes", _code->used_space() / _code->number_of_stubs()); - tty->cr(); - } - _code->print(); - tty->print_cr("----------------------------------------------------------------------"); - tty->cr(); -} - void interpreter_init() { Interpreter::initialize(); @@ -166,384 +132,3 @@ void interpreter_init() { AbstractInterpreter::code()->code_end()); } } - -//------------------------------------------------------------------------------------------------------------------------ -// Implementation of interpreter - -StubQueue* AbstractInterpreter::_code = NULL; -bool AbstractInterpreter::_notice_safepoints = false; -address AbstractInterpreter::_rethrow_exception_entry = NULL; - -address AbstractInterpreter::_native_entry_begin = NULL; -address AbstractInterpreter::_native_entry_end = NULL; -address AbstractInterpreter::_slow_signature_handler; -address AbstractInterpreter::_entry_table [AbstractInterpreter::number_of_method_entries]; -address AbstractInterpreter::_native_abi_to_tosca [AbstractInterpreter::number_of_result_handlers]; - -//------------------------------------------------------------------------------------------------------------------------ -// Generation of complete interpreter - -AbstractInterpreterGenerator::AbstractInterpreterGenerator(StubQueue* _code) { - _masm = NULL; -} - - -static const BasicType types[Interpreter::number_of_result_handlers] = { - T_BOOLEAN, - T_CHAR , - T_BYTE , - T_SHORT , - T_INT , - T_LONG , - T_VOID , - T_FLOAT , - T_DOUBLE , - T_OBJECT -}; - -void AbstractInterpreterGenerator::generate_all() { - - - { CodeletMark cm(_masm, "slow signature handler"); - Interpreter::_slow_signature_handler = generate_slow_signature_handler(); - } - -} - -//------------------------------------------------------------------------------------------------------------------------ -// Entry points - -AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(methodHandle m) { - // Abstract method? - if (m->is_abstract()) return abstract; - - // Method handle primitive? - if (m->is_method_handle_intrinsic()) { - vmIntrinsics::ID id = m->intrinsic_id(); - assert(MethodHandles::is_signature_polymorphic(id), "must match an intrinsic"); - MethodKind kind = (MethodKind)( method_handle_invoke_FIRST + - ((int)id - vmIntrinsics::FIRST_MH_SIG_POLY) ); - assert(kind <= method_handle_invoke_LAST, "parallel enum ranges"); - return kind; - } - -#ifndef CC_INTERP - if (UseCRC32Intrinsics && m->is_native()) { - // Use optimized stub code for CRC32 native methods. - switch (m->intrinsic_id()) { - case vmIntrinsics::_updateCRC32 : return java_util_zip_CRC32_update; - case vmIntrinsics::_updateBytesCRC32 : return java_util_zip_CRC32_updateBytes; - case vmIntrinsics::_updateByteBufferCRC32 : return java_util_zip_CRC32_updateByteBuffer; - } - } - if (UseCRC32CIntrinsics) { - // Use optimized stub code for CRC32C methods. - switch (m->intrinsic_id()) { - case vmIntrinsics::_updateBytesCRC32C : return java_util_zip_CRC32C_updateBytes; - case vmIntrinsics::_updateDirectByteBufferCRC32C : return java_util_zip_CRC32C_updateDirectByteBuffer; - } - } - - switch(m->intrinsic_id()) { - case vmIntrinsics::_intBitsToFloat: return java_lang_Float_intBitsToFloat; - case vmIntrinsics::_floatToRawIntBits: return java_lang_Float_floatToRawIntBits; - case vmIntrinsics::_longBitsToDouble: return java_lang_Double_longBitsToDouble; - case vmIntrinsics::_doubleToRawLongBits: return java_lang_Double_doubleToRawLongBits; - } - -#endif // CC_INTERP - - // Native method? - // Note: This test must come _before_ the test for intrinsic - // methods. See also comments below. - if (m->is_native()) { - assert(!m->is_method_handle_intrinsic(), "overlapping bits here, watch out"); - return m->is_synchronized() ? native_synchronized : native; - } - - // Synchronized? - if (m->is_synchronized()) { - return zerolocals_synchronized; - } - - if (RegisterFinalizersAtInit && m->code_size() == 1 && - m->intrinsic_id() == vmIntrinsics::_Object_init) { - // We need to execute the special return bytecode to check for - // finalizer registration so create a normal frame. - return zerolocals; - } - - // Empty method? - if (m->is_empty_method()) { - return empty; - } - - // Special intrinsic method? - // Note: This test must come _after_ the test for native methods, - // otherwise we will run into problems with JDK 1.2, see also - // TemplateInterpreterGenerator::generate_method_entry() for - // for details. - switch (m->intrinsic_id()) { - case vmIntrinsics::_dsin : return java_lang_math_sin ; - case vmIntrinsics::_dcos : return java_lang_math_cos ; - case vmIntrinsics::_dtan : return java_lang_math_tan ; - case vmIntrinsics::_dabs : return java_lang_math_abs ; - case vmIntrinsics::_dsqrt : return java_lang_math_sqrt ; - case vmIntrinsics::_dlog : return java_lang_math_log ; - case vmIntrinsics::_dlog10: return java_lang_math_log10; - case vmIntrinsics::_dpow : return java_lang_math_pow ; - case vmIntrinsics::_dexp : return java_lang_math_exp ; - - case vmIntrinsics::_Reference_get: - return java_lang_ref_reference_get; - } - - // Accessor method? - if (m->is_getter()) { - // TODO: We should have used ::is_accessor above, but fast accessors in Zero expect only getters. - // See CppInterpreter::accessor_entry in cppInterpreter_zero.cpp. This should be fixed in Zero, - // then the call above updated to ::is_accessor - assert(m->size_of_parameters() == 1, "fast code for accessors assumes parameter size = 1"); - return accessor; - } - - // Note: for now: zero locals for all non-empty methods - return zerolocals; -} - - -void AbstractInterpreter::set_entry_for_kind(AbstractInterpreter::MethodKind kind, address entry) { - assert(kind >= method_handle_invoke_FIRST && - kind <= method_handle_invoke_LAST, "late initialization only for MH entry points"); - assert(_entry_table[kind] == _entry_table[abstract], "previous value must be AME entry"); - _entry_table[kind] = entry; -} - - -// Return true if the interpreter can prove that the given bytecode has -// not yet been executed (in Java semantics, not in actual operation). -bool AbstractInterpreter::is_not_reached(const methodHandle& method, int bci) { - Bytecodes::Code code = method()->code_at(bci); - - if (!Bytecodes::must_rewrite(code)) { - // might have been reached - return false; - } - - // the bytecode might not be rewritten if the method is an accessor, etc. - address ientry = method->interpreter_entry(); - if (ientry != entry_for_kind(AbstractInterpreter::zerolocals) && - ientry != entry_for_kind(AbstractInterpreter::zerolocals_synchronized)) - return false; // interpreter does not run this method! - - // otherwise, we can be sure this bytecode has never been executed - return true; -} - - -#ifndef PRODUCT -void AbstractInterpreter::print_method_kind(MethodKind kind) { - switch (kind) { - case zerolocals : tty->print("zerolocals" ); break; - case zerolocals_synchronized: tty->print("zerolocals_synchronized"); break; - case native : tty->print("native" ); break; - case native_synchronized : tty->print("native_synchronized" ); break; - case empty : tty->print("empty" ); break; - case accessor : tty->print("accessor" ); break; - case abstract : tty->print("abstract" ); break; - case java_lang_math_sin : tty->print("java_lang_math_sin" ); break; - case java_lang_math_cos : tty->print("java_lang_math_cos" ); break; - case java_lang_math_tan : tty->print("java_lang_math_tan" ); break; - case java_lang_math_abs : tty->print("java_lang_math_abs" ); break; - case java_lang_math_sqrt : tty->print("java_lang_math_sqrt" ); break; - case java_lang_math_log : tty->print("java_lang_math_log" ); break; - case java_lang_math_log10 : tty->print("java_lang_math_log10" ); break; - case java_util_zip_CRC32_update : tty->print("java_util_zip_CRC32_update"); break; - case java_util_zip_CRC32_updateBytes : tty->print("java_util_zip_CRC32_updateBytes"); break; - case java_util_zip_CRC32_updateByteBuffer : tty->print("java_util_zip_CRC32_updateByteBuffer"); break; - case java_util_zip_CRC32C_updateBytes : tty->print("java_util_zip_CRC32C_updateBytes"); break; - case java_util_zip_CRC32C_updateDirectByteBuffer: tty->print("java_util_zip_CRC32C_updateDirectByteByffer"); break; - default: - if (kind >= method_handle_invoke_FIRST && - kind <= method_handle_invoke_LAST) { - const char* kind_name = vmIntrinsics::name_at(method_handle_intrinsic(kind)); - if (kind_name[0] == '_') kind_name = &kind_name[1]; // '_invokeExact' => 'invokeExact' - tty->print("method_handle_%s", kind_name); - break; - } - ShouldNotReachHere(); - break; - } -} -#endif // PRODUCT - - -//------------------------------------------------------------------------------------------------------------------------ -// Deoptimization support - -/** - * If a deoptimization happens, this function returns the point of next bytecode to continue execution. - */ -address AbstractInterpreter::deopt_continue_after_entry(Method* method, address bcp, int callee_parameters, bool is_top_frame) { - assert(method->contains(bcp), "just checkin'"); - - // Get the original and rewritten bytecode. - Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); - assert(!Interpreter::bytecode_should_reexecute(code), "should not reexecute"); - - const int bci = method->bci_from(bcp); - - // compute continuation length - const int length = Bytecodes::length_at(method, bcp); - - // compute result type - BasicType type = T_ILLEGAL; - - switch (code) { - case Bytecodes::_invokevirtual : - case Bytecodes::_invokespecial : - case Bytecodes::_invokestatic : - case Bytecodes::_invokeinterface: { - Thread *thread = Thread::current(); - ResourceMark rm(thread); - methodHandle mh(thread, method); - type = Bytecode_invoke(mh, bci).result_type(); - // since the cache entry might not be initialized: - // (NOT needed for the old calling convension) - if (!is_top_frame) { - int index = Bytes::get_native_u2(bcp+1); - method->constants()->cache()->entry_at(index)->set_parameter_size(callee_parameters); - } - break; - } - - case Bytecodes::_invokedynamic: { - Thread *thread = Thread::current(); - ResourceMark rm(thread); - methodHandle mh(thread, method); - type = Bytecode_invoke(mh, bci).result_type(); - // since the cache entry might not be initialized: - // (NOT needed for the old calling convension) - if (!is_top_frame) { - int index = Bytes::get_native_u4(bcp+1); - method->constants()->invokedynamic_cp_cache_entry_at(index)->set_parameter_size(callee_parameters); - } - break; - } - - case Bytecodes::_ldc : - case Bytecodes::_ldc_w : // fall through - case Bytecodes::_ldc2_w: - { - Thread *thread = Thread::current(); - ResourceMark rm(thread); - methodHandle mh(thread, method); - type = Bytecode_loadconstant(mh, bci).result_type(); - break; - } - - default: - type = Bytecodes::result_type(code); - break; - } - - // return entry point for computed continuation state & bytecode length - return - is_top_frame - ? Interpreter::deopt_entry (as_TosState(type), length) - : Interpreter::return_entry(as_TosState(type), length, code); -} - -// If deoptimization happens, this function returns the point where the interpreter reexecutes -// the bytecode. -// Note: Bytecodes::_athrow is a special case in that it does not return -// Interpreter::deopt_entry(vtos, 0) like others -address AbstractInterpreter::deopt_reexecute_entry(Method* method, address bcp) { - assert(method->contains(bcp), "just checkin'"); - Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); -#if defined(COMPILER1) || INCLUDE_JVMCI - if(code == Bytecodes::_athrow ) { - return Interpreter::rethrow_exception_entry(); - } -#endif /* COMPILER1 || INCLUDE_JVMCI */ - return Interpreter::deopt_entry(vtos, 0); -} - -// If deoptimization happens, the interpreter should reexecute these bytecodes. -// This function mainly helps the compilers to set up the reexecute bit. -bool AbstractInterpreter::bytecode_should_reexecute(Bytecodes::Code code) { - switch (code) { - case Bytecodes::_lookupswitch: - case Bytecodes::_tableswitch: - case Bytecodes::_fast_binaryswitch: - case Bytecodes::_fast_linearswitch: - // recompute condtional expression folded into _if - case Bytecodes::_lcmp : - case Bytecodes::_fcmpl : - case Bytecodes::_fcmpg : - case Bytecodes::_dcmpl : - case Bytecodes::_dcmpg : - case Bytecodes::_ifnull : - case Bytecodes::_ifnonnull : - case Bytecodes::_goto : - case Bytecodes::_goto_w : - case Bytecodes::_ifeq : - case Bytecodes::_ifne : - case Bytecodes::_iflt : - case Bytecodes::_ifge : - case Bytecodes::_ifgt : - case Bytecodes::_ifle : - case Bytecodes::_if_icmpeq : - case Bytecodes::_if_icmpne : - case Bytecodes::_if_icmplt : - case Bytecodes::_if_icmpge : - case Bytecodes::_if_icmpgt : - case Bytecodes::_if_icmple : - case Bytecodes::_if_acmpeq : - case Bytecodes::_if_acmpne : - // special cases - case Bytecodes::_getfield : - case Bytecodes::_putfield : - case Bytecodes::_getstatic : - case Bytecodes::_putstatic : - case Bytecodes::_aastore : -#ifdef COMPILER1 - //special case of reexecution - case Bytecodes::_athrow : -#endif - return true; - - default: - return false; - } -} - -void AbstractInterpreterGenerator::bang_stack_shadow_pages(bool native_call) { - // Quick & dirty stack overflow checking: bang the stack & handle trap. - // Note that we do the banging after the frame is setup, since the exception - // handling code expects to find a valid interpreter frame on the stack. - // Doing the banging earlier fails if the caller frame is not an interpreter - // frame. - // (Also, the exception throwing code expects to unlock any synchronized - // method receiever, so do the banging after locking the receiver.) - - // Bang each page in the shadow zone. We can't assume it's been done for - // an interpreter frame with greater than a page of locals, so each page - // needs to be checked. Only true for non-native. - if (UseStackBanging) { - const int page_size = os::vm_page_size(); - const int n_shadow_pages = ((int)JavaThread::stack_shadow_zone_size()) / page_size; - const int start_page = native_call ? n_shadow_pages : 1; - for (int pages = start_page; pages <= n_shadow_pages; pages++) { - __ bang_stack_with_offset(pages*page_size); - } - } -} - -void AbstractInterpreterGenerator::initialize_method_handle_entries() { - // method handle entry kinds are generated later in MethodHandlesAdapterGenerator::generate: - for (int i = Interpreter::method_handle_invoke_FIRST; i <= Interpreter::method_handle_invoke_LAST; i++) { - Interpreter::MethodKind kind = (Interpreter::MethodKind) i; - Interpreter::_entry_table[kind] = Interpreter::_entry_table[Interpreter::abstract]; - } -} diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp index d348e8d2cac..f8902c76f93 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -459,21 +459,11 @@ IRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea // tracing if (log_is_enabled(Info, exceptions)) { ResourceMark rm(thread); - Symbol* message = java_lang_Throwable::detail_message(h_exception()); stringStream tempst; - if (message != NULL) { - tempst.print("Exception <%s: %s> (" INTPTR_FORMAT ")\n", - h_exception->print_value_string(), message->as_C_string(), - p2i(h_exception())); - } else { - tempst.print("Exception <%s> (" INTPTR_FORMAT ")\n", - h_exception->print_value_string(), - p2i(h_exception())); - } - tempst.print(" thrown in interpreter method <%s>\n" + tempst.print("interpreter method <%s>\n" " at bci %d for thread " INTPTR_FORMAT, h_method->print_value_string(), current_bci, p2i(thread)); - LogHandle(exceptions)::info_stream()->print_raw_cr(tempst.as_string()); + Exceptions::log_exception(h_exception, tempst); } // Don't go paging in something which won't be used. // else if (extable->length() == 0) { @@ -773,9 +763,11 @@ void InterpreterRuntime::resolve_invoke(JavaThread* thread, Bytecodes::Code byte if (cp_cache_entry->is_resolved(bytecode)) return; if (bytecode == Bytecodes::_invokeinterface) { - if (TraceItables && Verbose) { + if (develop_log_is_enabled(Trace, itables)) { ResourceMark rm(thread); - tty->print_cr("Resolving: klass: %s to method: %s", info.resolved_klass()->name()->as_C_string(), info.resolved_method()->name()->as_C_string()); + log_develop_trace(itables)("Resolving: klass: %s to method: %s", + info.resolved_klass()->name()->as_C_string(), + info.resolved_method()->name()->as_C_string()); } } #ifdef ASSERT @@ -1255,6 +1247,7 @@ void SignatureHandlerLibrary::add(const methodHandle& method) { } else { // debugging suppport if (PrintSignatureHandlers && (handler != Interpreter::slow_signature_handler())) { + ttyLocker ttyl; tty->cr(); tty->print_cr("argument handler #%d for: %s %s (fingerprint = " UINT64_FORMAT ", %d bytes generated)", _handlers->length(), diff --git a/hotspot/src/share/vm/interpreter/linkResolver.cpp b/hotspot/src/share/vm/interpreter/linkResolver.cpp index 48018a55e62..837be42ef2e 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.cpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp @@ -32,9 +32,11 @@ #include "interpreter/bytecode.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/linkResolver.hpp" +#include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.inline.hpp" #include "oops/instanceKlass.hpp" +#include "oops/method.hpp" #include "oops/objArrayOop.hpp" #include "oops/oop.inline.hpp" #include "prims/methodHandles.hpp" @@ -447,6 +449,7 @@ methodHandle LinkResolver::lookup_polymorphic_method( assert(result->intrinsic_id() != vmIntrinsics::_invokeGeneric, "wrong place to find this"); assert(basic_signature == result->signature(), "predict the result signature"); if (TraceMethodHandles) { + ttyLocker ttyl; tty->print("lookup_polymorphic_method => intrinsic "); result->print_on(tty); } @@ -479,6 +482,7 @@ methodHandle LinkResolver::lookup_polymorphic_method( &method_type, CHECK_NULL); if (TraceMethodHandles) { + ttyLocker ttyl; tty->print("lookup_polymorphic_method => (via Java) "); result->print_on(tty); tty->print(" lookup_polymorphic_method => appendix = "); @@ -728,6 +732,36 @@ methodHandle LinkResolver::resolve_method(const LinkInfo& link_info, return resolved_method; } +static void trace_method_resolution(const char* prefix, + KlassHandle klass, + KlassHandle resolved_klass, + const methodHandle& method, + bool logitables, + int index = -1) { +#ifndef PRODUCT + ResourceMark rm; + outputStream* st; + if (logitables) { + st = LogHandle(itables)::trace_stream(); + } else { + st = LogHandle(vtables)::trace_stream(); + } + st->print("%s%s, compile-time-class:%s, method:%s, method_holder:%s, access_flags: ", + prefix, + (klass.is_null() ? "" : klass->internal_name()), + (resolved_klass.is_null() ? "" : resolved_klass->internal_name()), + Method::name_and_sig_as_C_string(resolved_klass(), + method->name(), + method->signature()), + method->method_holder()->internal_name()); + method->print_linkage_flags(st); + if (index != -1) { + st->print("vtable_index:%d", index); + } + st->cr(); +#endif // PRODUCT +} + methodHandle LinkResolver::resolve_interface_method(const LinkInfo& link_info, bool nostatics, TRAPS) { @@ -784,10 +818,10 @@ methodHandle LinkResolver::resolve_interface_method(const LinkInfo& link_info, THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); } - if (TraceItables && Verbose) { + if (develop_log_is_enabled(Trace, itables)) { trace_method_resolution("invokeinterface resolved method: caller-class", - link_info.current_klass(), resolved_klass, resolved_method); - tty->cr(); + link_info.current_klass(), resolved_klass, + resolved_method, true); } return resolved_method; @@ -1032,10 +1066,9 @@ methodHandle LinkResolver::linktime_resolve_special_method(const LinkInfo& link_ THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); } - if (TraceItables && Verbose) { + if (develop_log_is_enabled(Trace, itables)) { trace_method_resolution("invokespecial resolved method: caller-class:", - current_klass, resolved_klass, resolved_method); - tty->cr(); + current_klass, resolved_klass, resolved_method, true); } return resolved_method; @@ -1104,10 +1137,9 @@ void LinkResolver::runtime_resolve_special_method(CallInfo& result, sel_method->signature())); } - if (TraceItables && Verbose) { + if (develop_log_is_enabled(Trace, itables)) { trace_method_resolution("invokespecial selected method: resolved-class:", - resolved_klass, resolved_klass, sel_method); - tty->cr(); + resolved_klass, resolved_klass, sel_method, true); } // setup result @@ -1158,10 +1190,9 @@ methodHandle LinkResolver::linktime_resolve_virtual_method(const LinkInfo& link_ THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); } - if (PrintVtables && Verbose) { + if (develop_log_is_enabled(Trace, vtables)) { trace_method_resolution("invokevirtual resolved method: caller-class:", - current_klass, resolved_klass, resolved_method); - tty->cr(); + current_klass, resolved_klass, resolved_method, false); } return resolved_method; @@ -1239,10 +1270,10 @@ void LinkResolver::runtime_resolve_virtual_method(CallInfo& result, selected_method->signature())); } - if (PrintVtables && Verbose) { + if (develop_log_is_enabled(Trace, vtables)) { trace_method_resolution("invokevirtual selected method: receiver-class:", - recv_klass, resolved_klass, selected_method); - tty->print_cr("vtable_index:%d", vtable_index); + recv_klass, resolved_klass, selected_method, + false, vtable_index); } // setup result result.set_virtual(resolved_klass, recv_klass, resolved_method, selected_method, vtable_index, CHECK); @@ -1338,10 +1369,9 @@ void LinkResolver::runtime_resolve_interface_method(CallInfo& result, sel_method->signature())); } - if (TraceItables && Verbose) { + if (develop_log_is_enabled(Trace, itables)) { trace_method_resolution("invokeinterface selected method: receiver-class", - recv_klass, resolved_klass, sel_method); - tty->cr(); + recv_klass, resolved_klass, sel_method, true); } // setup result if (!resolved_method->has_itable_index()) { @@ -1585,10 +1615,11 @@ void LinkResolver::resolve_invokedynamic(CallInfo& result, const constantPoolHan } if (TraceMethodHandles) { - ResourceMark rm(THREAD); - tty->print_cr("resolve_invokedynamic #%d %s %s", + ResourceMark rm(THREAD); + tty->print_cr("resolve_invokedynamic #%d %s %s in %s", ConstantPool::decode_invokedynamic_index(index), - method_name->as_C_string(), method_signature->as_C_string()); + method_name->as_C_string(), method_signature->as_C_string(), + current_klass->name()->as_C_string()); tty->print(" BSM info: "); bootstrap_specifier->print(); } @@ -1615,28 +1646,3 @@ void LinkResolver::resolve_dynamic_call(CallInfo& result, result.set_handle(resolved_method, resolved_appendix, resolved_method_type, THREAD); wrap_invokedynamic_exception(CHECK); } - -#ifndef PRODUCT -void LinkResolver::trace_method_resolution(const char* prefix, - KlassHandle klass, - KlassHandle resolved_klass, - const methodHandle& method) { - ResourceMark rm; - tty->print("%s%s, compile-time-class:%s, method:%s, method_holder:%s, access_flags: ", - prefix, - (klass.is_null() ? "" : klass->internal_name()), - (resolved_klass.is_null() ? "" : resolved_klass->internal_name()), - Method::name_and_sig_as_C_string(resolved_klass(), - method->name(), - method->signature()), - method->method_holder()->internal_name() - ); - method->access_flags().print_on(tty); - if (method->is_default_method()) { - tty->print("default "); - } - if (method->is_overpass()) { - tty->print("overpass "); - } -} -#endif // PRODUCT diff --git a/hotspot/src/share/vm/interpreter/linkResolver.hpp b/hotspot/src/share/vm/interpreter/linkResolver.hpp index 7d7a27944c8..20bd8f31ffa 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.hpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.hpp @@ -300,10 +300,5 @@ class LinkResolver: AllStatic { static void resolve_invoke(CallInfo& result, Handle& recv, const methodHandle& attached_method, Bytecodes::Code byte, TRAPS); - - private: - static void trace_method_resolution(const char* prefix, KlassHandle klass, - KlassHandle resolved_klass, - const methodHandle& method) PRODUCT_RETURN; }; #endif // SHARE_VM_INTERPRETER_LINKRESOLVER_HPP diff --git a/hotspot/src/share/vm/interpreter/rewriter.cpp b/hotspot/src/share/vm/interpreter/rewriter.cpp index e5e51af1e2e..55cec0f70e3 100644 --- a/hotspot/src/share/vm/interpreter/rewriter.cpp +++ b/hotspot/src/share/vm/interpreter/rewriter.cpp @@ -340,7 +340,7 @@ void Rewriter::scan_method(Method* method, bool reverse, bool* invokespecial_err // We cannot tolerate a GC in this block, because we've // cached the bytecodes in 'code_base'. If the Method* // moves, the bytecodes will also move. - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; Bytecodes::Code c; // Bytecodes and their length diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp index 96e8faeafa8..c68f6858da6 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -30,6 +30,7 @@ #include "interpreter/templateInterpreter.hpp" #include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" +#include "memory/resourceArea.hpp" #ifndef CC_INTERP @@ -219,376 +220,6 @@ DispatchTable TemplateInterpreter::_normal_table; DispatchTable TemplateInterpreter::_safept_table; address TemplateInterpreter::_wentry_point[DispatchTable::length]; -TemplateInterpreterGenerator::TemplateInterpreterGenerator(StubQueue* _code): AbstractInterpreterGenerator(_code) { - _unimplemented_bytecode = NULL; - _illegal_bytecode_sequence = NULL; - generate_all(); -} - -static const BasicType types[Interpreter::number_of_result_handlers] = { - T_BOOLEAN, - T_CHAR , - T_BYTE , - T_SHORT , - T_INT , - T_LONG , - T_VOID , - T_FLOAT , - T_DOUBLE , - T_OBJECT -}; - -void TemplateInterpreterGenerator::generate_all() { - // Loop, in case we need several variants of the interpreter entries - do { - if (!CodeCacheExtensions::skip_code_generation()) { - // bypass code generation when useless - AbstractInterpreterGenerator::generate_all(); - - { CodeletMark cm(_masm, "error exits"); - _unimplemented_bytecode = generate_error_exit("unimplemented bytecode"); - _illegal_bytecode_sequence = generate_error_exit("illegal bytecode sequence - method not verified"); - } - -#ifndef PRODUCT - if (TraceBytecodes) { - CodeletMark cm(_masm, "bytecode tracing support"); - Interpreter::_trace_code = - EntryPoint( - generate_trace_code(btos), - generate_trace_code(ctos), - generate_trace_code(stos), - generate_trace_code(atos), - generate_trace_code(itos), - generate_trace_code(ltos), - generate_trace_code(ftos), - generate_trace_code(dtos), - generate_trace_code(vtos) - ); - } -#endif // !PRODUCT - - { CodeletMark cm(_masm, "return entry points"); - const int index_size = sizeof(u2); - for (int i = 0; i < Interpreter::number_of_return_entries; i++) { - Interpreter::_return_entry[i] = - EntryPoint( - generate_return_entry_for(itos, i, index_size), - generate_return_entry_for(itos, i, index_size), - generate_return_entry_for(itos, i, index_size), - generate_return_entry_for(atos, i, index_size), - generate_return_entry_for(itos, i, index_size), - generate_return_entry_for(ltos, i, index_size), - generate_return_entry_for(ftos, i, index_size), - generate_return_entry_for(dtos, i, index_size), - generate_return_entry_for(vtos, i, index_size) - ); - } - } - - { CodeletMark cm(_masm, "invoke return entry points"); - const TosState states[] = {itos, itos, itos, itos, ltos, ftos, dtos, atos, vtos}; - const int invoke_length = Bytecodes::length_for(Bytecodes::_invokestatic); - const int invokeinterface_length = Bytecodes::length_for(Bytecodes::_invokeinterface); - const int invokedynamic_length = Bytecodes::length_for(Bytecodes::_invokedynamic); - - for (int i = 0; i < Interpreter::number_of_return_addrs; i++) { - TosState state = states[i]; - Interpreter::_invoke_return_entry[i] = generate_return_entry_for(state, invoke_length, sizeof(u2)); - Interpreter::_invokeinterface_return_entry[i] = generate_return_entry_for(state, invokeinterface_length, sizeof(u2)); - Interpreter::_invokedynamic_return_entry[i] = generate_return_entry_for(state, invokedynamic_length, sizeof(u4)); - } - } - - { CodeletMark cm(_masm, "earlyret entry points"); - Interpreter::_earlyret_entry = - EntryPoint( - generate_earlyret_entry_for(btos), - generate_earlyret_entry_for(ctos), - generate_earlyret_entry_for(stos), - generate_earlyret_entry_for(atos), - generate_earlyret_entry_for(itos), - generate_earlyret_entry_for(ltos), - generate_earlyret_entry_for(ftos), - generate_earlyret_entry_for(dtos), - generate_earlyret_entry_for(vtos) - ); - } - - { CodeletMark cm(_masm, "deoptimization entry points"); - for (int i = 0; i < Interpreter::number_of_deopt_entries; i++) { - Interpreter::_deopt_entry[i] = - EntryPoint( - generate_deopt_entry_for(itos, i), - generate_deopt_entry_for(itos, i), - generate_deopt_entry_for(itos, i), - generate_deopt_entry_for(atos, i), - generate_deopt_entry_for(itos, i), - generate_deopt_entry_for(ltos, i), - generate_deopt_entry_for(ftos, i), - generate_deopt_entry_for(dtos, i), - generate_deopt_entry_for(vtos, i) - ); - } - } - - { CodeletMark cm(_masm, "result handlers for native calls"); - // The various result converter stublets. - int is_generated[Interpreter::number_of_result_handlers]; - memset(is_generated, 0, sizeof(is_generated)); - - for (int i = 0; i < Interpreter::number_of_result_handlers; i++) { - BasicType type = types[i]; - if (!is_generated[Interpreter::BasicType_as_index(type)]++) { - Interpreter::_native_abi_to_tosca[Interpreter::BasicType_as_index(type)] = generate_result_handler_for(type); - } - } - } - - { CodeletMark cm(_masm, "continuation entry points"); - Interpreter::_continuation_entry = - EntryPoint( - generate_continuation_for(btos), - generate_continuation_for(ctos), - generate_continuation_for(stos), - generate_continuation_for(atos), - generate_continuation_for(itos), - generate_continuation_for(ltos), - generate_continuation_for(ftos), - generate_continuation_for(dtos), - generate_continuation_for(vtos) - ); - } - - { CodeletMark cm(_masm, "safepoint entry points"); - Interpreter::_safept_entry = - EntryPoint( - generate_safept_entry_for(btos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), - generate_safept_entry_for(ctos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), - generate_safept_entry_for(stos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), - generate_safept_entry_for(atos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), - generate_safept_entry_for(itos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), - generate_safept_entry_for(ltos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), - generate_safept_entry_for(ftos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), - generate_safept_entry_for(dtos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), - generate_safept_entry_for(vtos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)) - ); - } - - { CodeletMark cm(_masm, "exception handling"); - // (Note: this is not safepoint safe because thread may return to compiled code) - generate_throw_exception(); - } - - { CodeletMark cm(_masm, "throw exception entrypoints"); - Interpreter::_throw_ArrayIndexOutOfBoundsException_entry = generate_ArrayIndexOutOfBounds_handler("java/lang/ArrayIndexOutOfBoundsException"); - Interpreter::_throw_ArrayStoreException_entry = generate_klass_exception_handler("java/lang/ArrayStoreException" ); - Interpreter::_throw_ArithmeticException_entry = generate_exception_handler("java/lang/ArithmeticException" , "/ by zero"); - Interpreter::_throw_ClassCastException_entry = generate_ClassCastException_handler(); - Interpreter::_throw_NullPointerException_entry = generate_exception_handler("java/lang/NullPointerException" , NULL ); - Interpreter::_throw_StackOverflowError_entry = generate_StackOverflowError_handler(); - } - - - -#define method_entry(kind) \ - { CodeletMark cm(_masm, "method entry point (kind = " #kind ")"); \ - Interpreter::_entry_table[Interpreter::kind] = generate_method_entry(Interpreter::kind); \ - } - - // all non-native method kinds - method_entry(zerolocals) - method_entry(zerolocals_synchronized) - method_entry(empty) - method_entry(accessor) - method_entry(abstract) - method_entry(java_lang_math_sin ) - method_entry(java_lang_math_cos ) - method_entry(java_lang_math_tan ) - method_entry(java_lang_math_abs ) - method_entry(java_lang_math_sqrt ) - method_entry(java_lang_math_log ) - method_entry(java_lang_math_log10) - method_entry(java_lang_math_exp ) - method_entry(java_lang_math_pow ) - method_entry(java_lang_ref_reference_get) - - initialize_method_handle_entries(); - - // all native method kinds (must be one contiguous block) - Interpreter::_native_entry_begin = Interpreter::code()->code_end(); - method_entry(native) - method_entry(native_synchronized) - Interpreter::_native_entry_end = Interpreter::code()->code_end(); - - if (UseCRC32Intrinsics) { - method_entry(java_util_zip_CRC32_update) - method_entry(java_util_zip_CRC32_updateBytes) - method_entry(java_util_zip_CRC32_updateByteBuffer) - } - - if (UseCRC32CIntrinsics) { - method_entry(java_util_zip_CRC32C_updateBytes) - method_entry(java_util_zip_CRC32C_updateDirectByteBuffer) - } - - method_entry(java_lang_Float_intBitsToFloat); - method_entry(java_lang_Float_floatToRawIntBits); - method_entry(java_lang_Double_longBitsToDouble); - method_entry(java_lang_Double_doubleToRawLongBits); - -#undef method_entry - - // Bytecodes - set_entry_points_for_all_bytes(); - } - } while (CodeCacheExtensions::needs_other_interpreter_variant()); - - // installation of code in other places in the runtime - // (ExcutableCodeManager calls not needed to copy the entries) - set_safepoints_for_all_bytes(); -} - -//------------------------------------------------------------------------------------------------------------------------ - -address TemplateInterpreterGenerator::generate_error_exit(const char* msg) { - address entry = __ pc(); - __ stop(msg); - return entry; -} - - -//------------------------------------------------------------------------------------------------------------------------ - -void TemplateInterpreterGenerator::set_entry_points_for_all_bytes() { - for (int i = 0; i < DispatchTable::length; i++) { - Bytecodes::Code code = (Bytecodes::Code)i; - if (Bytecodes::is_defined(code)) { - set_entry_points(code); - } else { - set_unimplemented(i); - } - } -} - - -void TemplateInterpreterGenerator::set_safepoints_for_all_bytes() { - for (int i = 0; i < DispatchTable::length; i++) { - Bytecodes::Code code = (Bytecodes::Code)i; - if (Bytecodes::is_defined(code)) Interpreter::_safept_table.set_entry(code, Interpreter::_safept_entry); - } -} - - -void TemplateInterpreterGenerator::set_unimplemented(int i) { - address e = _unimplemented_bytecode; - EntryPoint entry(e, e, e, e, e, e, e, e, e); - Interpreter::_normal_table.set_entry(i, entry); - Interpreter::_wentry_point[i] = _unimplemented_bytecode; -} - - -void TemplateInterpreterGenerator::set_entry_points(Bytecodes::Code code) { - if (CodeCacheExtensions::skip_template_interpreter_entries(code)) { - return; - } - CodeletMark cm(_masm, Bytecodes::name(code), code); - // initialize entry points - assert(_unimplemented_bytecode != NULL, "should have been generated before"); - assert(_illegal_bytecode_sequence != NULL, "should have been generated before"); - address bep = _illegal_bytecode_sequence; - address cep = _illegal_bytecode_sequence; - address sep = _illegal_bytecode_sequence; - address aep = _illegal_bytecode_sequence; - address iep = _illegal_bytecode_sequence; - address lep = _illegal_bytecode_sequence; - address fep = _illegal_bytecode_sequence; - address dep = _illegal_bytecode_sequence; - address vep = _unimplemented_bytecode; - address wep = _unimplemented_bytecode; - // code for short & wide version of bytecode - if (Bytecodes::is_defined(code)) { - Template* t = TemplateTable::template_for(code); - assert(t->is_valid(), "just checking"); - set_short_entry_points(t, bep, cep, sep, aep, iep, lep, fep, dep, vep); - } - if (Bytecodes::wide_is_defined(code)) { - Template* t = TemplateTable::template_for_wide(code); - assert(t->is_valid(), "just checking"); - set_wide_entry_point(t, wep); - } - // set entry points - EntryPoint entry(bep, cep, sep, aep, iep, lep, fep, dep, vep); - Interpreter::_normal_table.set_entry(code, entry); - Interpreter::_wentry_point[code] = wep; - CodeCacheExtensions::completed_template_interpreter_entries(_masm, code); -} - - -void TemplateInterpreterGenerator::set_wide_entry_point(Template* t, address& wep) { - assert(t->is_valid(), "template must exist"); - assert(t->tos_in() == vtos, "only vtos tos_in supported for wide instructions"); - wep = __ pc(); generate_and_dispatch(t); -} - - -void TemplateInterpreterGenerator::set_short_entry_points(Template* t, address& bep, address& cep, address& sep, address& aep, address& iep, address& lep, address& fep, address& dep, address& vep) { - assert(t->is_valid(), "template must exist"); - switch (t->tos_in()) { - case btos: - case ctos: - case stos: - ShouldNotReachHere(); // btos/ctos/stos should use itos. - break; - case atos: vep = __ pc(); __ pop(atos); aep = __ pc(); generate_and_dispatch(t); break; - case itos: vep = __ pc(); __ pop(itos); iep = __ pc(); generate_and_dispatch(t); break; - case ltos: vep = __ pc(); __ pop(ltos); lep = __ pc(); generate_and_dispatch(t); break; - case ftos: vep = __ pc(); __ pop(ftos); fep = __ pc(); generate_and_dispatch(t); break; - case dtos: vep = __ pc(); __ pop(dtos); dep = __ pc(); generate_and_dispatch(t); break; - case vtos: set_vtos_entry_points(t, bep, cep, sep, aep, iep, lep, fep, dep, vep); break; - default : ShouldNotReachHere(); break; - } -} - - -//------------------------------------------------------------------------------------------------------------------------ - -void TemplateInterpreterGenerator::generate_and_dispatch(Template* t, TosState tos_out) { - if (PrintBytecodeHistogram) histogram_bytecode(t); -#ifndef PRODUCT - // debugging code - if (CountBytecodes || TraceBytecodes || StopInterpreterAt > 0) count_bytecode(); - if (PrintBytecodePairHistogram) histogram_bytecode_pair(t); - if (TraceBytecodes) trace_bytecode(t); - if (StopInterpreterAt > 0) stop_interpreter_at(); - __ verify_FPU(1, t->tos_in()); -#endif // !PRODUCT - int step = 0; - if (!t->does_dispatch()) { - step = t->is_wide() ? Bytecodes::wide_length_for(t->bytecode()) : Bytecodes::length_for(t->bytecode()); - if (tos_out == ilgl) tos_out = t->tos_out(); - // compute bytecode size - assert(step > 0, "just checkin'"); - // setup stuff for dispatching next bytecode - if (ProfileInterpreter && VerifyDataPointer - && MethodData::bytecode_has_profile(t->bytecode())) { - __ verify_method_data_pointer(); - } - __ dispatch_prolog(tos_out, step); - } - // generate template - t->generate(_masm); - // advance - if (t->does_dispatch()) { -#ifdef ASSERT - // make sure execution doesn't go beyond this point if code is broken - __ should_not_reach_here(); -#endif // ASSERT - } else { - // dispatch to next bytecode - __ dispatch_epilog(tos_out, step); - } -} //------------------------------------------------------------------------------------------------------------------------ // Entry points @@ -724,85 +355,4 @@ InterpreterCodelet* TemplateInterpreter::codelet_containing(address pc) { return (InterpreterCodelet*)_code->stub_containing(pc); } -// Generate method entries -address TemplateInterpreterGenerator::generate_method_entry( - AbstractInterpreter::MethodKind kind) { - // determine code generation flags - bool native = false; - bool synchronized = false; - address entry_point = NULL; - - switch (kind) { - case Interpreter::zerolocals : break; - case Interpreter::zerolocals_synchronized: synchronized = true; break; - case Interpreter::native : native = true; break; - case Interpreter::native_synchronized : native = true; synchronized = true; break; - case Interpreter::empty : break; - case Interpreter::accessor : break; - case Interpreter::abstract : entry_point = generate_abstract_entry(); break; - - case Interpreter::java_lang_math_sin : // fall thru - case Interpreter::java_lang_math_cos : // fall thru - case Interpreter::java_lang_math_tan : // fall thru - case Interpreter::java_lang_math_abs : // fall thru - case Interpreter::java_lang_math_log : // fall thru - case Interpreter::java_lang_math_log10 : // fall thru - case Interpreter::java_lang_math_sqrt : // fall thru - case Interpreter::java_lang_math_pow : // fall thru - case Interpreter::java_lang_math_exp : entry_point = generate_math_entry(kind); break; - case Interpreter::java_lang_ref_reference_get - : entry_point = generate_Reference_get_entry(); break; - case Interpreter::java_util_zip_CRC32_update - : native = true; entry_point = generate_CRC32_update_entry(); break; - case Interpreter::java_util_zip_CRC32_updateBytes - : // fall thru - case Interpreter::java_util_zip_CRC32_updateByteBuffer - : native = true; entry_point = generate_CRC32_updateBytes_entry(kind); break; - case Interpreter::java_util_zip_CRC32C_updateBytes - : // fall thru - case Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer - : entry_point = generate_CRC32C_updateBytes_entry(kind); break; -#ifdef IA32 - // On x86_32 platforms, a special entry is generated for the following four methods. - // On other platforms the normal entry is used to enter these methods. - case Interpreter::java_lang_Float_intBitsToFloat - : native = true; entry_point = generate_Float_intBitsToFloat_entry(); break; - case Interpreter::java_lang_Float_floatToRawIntBits - : native = true; entry_point = generate_Float_floatToRawIntBits_entry(); break; - case Interpreter::java_lang_Double_longBitsToDouble - : native = true; entry_point = generate_Double_longBitsToDouble_entry(); break; - case Interpreter::java_lang_Double_doubleToRawLongBits - : native = true; entry_point = generate_Double_doubleToRawLongBits_entry(); break; -#else - case Interpreter::java_lang_Float_intBitsToFloat: - case Interpreter::java_lang_Float_floatToRawIntBits: - case Interpreter::java_lang_Double_longBitsToDouble: - case Interpreter::java_lang_Double_doubleToRawLongBits: - native = true; - break; -#endif // defined(TARGET_ARCH_x86) && !defined(_LP64) - default: - fatal("unexpected method kind: %d", kind); - break; - } - - if (entry_point) { - return entry_point; - } - - // We expect the normal and native entry points to be generated first so we can reuse them. - if (native) { - entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native); - if (entry_point == NULL) { - entry_point = generate_native_entry(synchronized); - } - } else { - entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals); - if (entry_point == NULL) { - entry_point = generate_normal_entry(synchronized); - } - } - - return entry_point; -} #endif // !CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp index 8a5f4910283..1955cae20cb 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -193,13 +193,6 @@ class TemplateInterpreter: public AbstractInterpreter { // Size of interpreter code. Max size with JVMTI static int InterpreterCodeSize; - -#ifdef PPC - public: - // PPC-only: Support abs and sqrt like in compiler. - // For others we can use a normal (native) entry. - static bool math_entry_available(AbstractInterpreter::MethodKind kind); -#endif }; #endif // !CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.cpp b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.cpp new file mode 100644 index 00000000000..0fbe6f8ddac --- /dev/null +++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.cpp @@ -0,0 +1,492 @@ +/* + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "code/codeCacheExtensions.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreter.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" +#include "interpreter/templateTable.hpp" + +#ifndef CC_INTERP + +# define __ _masm-> + +TemplateInterpreterGenerator::TemplateInterpreterGenerator(StubQueue* _code): AbstractInterpreterGenerator(_code) { + _unimplemented_bytecode = NULL; + _illegal_bytecode_sequence = NULL; + generate_all(); +} + +static const BasicType types[Interpreter::number_of_result_handlers] = { + T_BOOLEAN, + T_CHAR , + T_BYTE , + T_SHORT , + T_INT , + T_LONG , + T_VOID , + T_FLOAT , + T_DOUBLE , + T_OBJECT +}; + +void TemplateInterpreterGenerator::generate_all() { + // Loop, in case we need several variants of the interpreter entries + do { + if (!CodeCacheExtensions::skip_code_generation()) { + // bypass code generation when useless + { CodeletMark cm(_masm, "slow signature handler"); + AbstractInterpreter::_slow_signature_handler = generate_slow_signature_handler(); + } + + { CodeletMark cm(_masm, "error exits"); + _unimplemented_bytecode = generate_error_exit("unimplemented bytecode"); + _illegal_bytecode_sequence = generate_error_exit("illegal bytecode sequence - method not verified"); + } + +#ifndef PRODUCT + if (TraceBytecodes) { + CodeletMark cm(_masm, "bytecode tracing support"); + Interpreter::_trace_code = + EntryPoint( + generate_trace_code(btos), + generate_trace_code(ctos), + generate_trace_code(stos), + generate_trace_code(atos), + generate_trace_code(itos), + generate_trace_code(ltos), + generate_trace_code(ftos), + generate_trace_code(dtos), + generate_trace_code(vtos) + ); + } +#endif // !PRODUCT + + { CodeletMark cm(_masm, "return entry points"); + const int index_size = sizeof(u2); + for (int i = 0; i < Interpreter::number_of_return_entries; i++) { + Interpreter::_return_entry[i] = + EntryPoint( + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(atos, i, index_size), + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(ltos, i, index_size), + generate_return_entry_for(ftos, i, index_size), + generate_return_entry_for(dtos, i, index_size), + generate_return_entry_for(vtos, i, index_size) + ); + } + } + + { CodeletMark cm(_masm, "invoke return entry points"); + const TosState states[] = {itos, itos, itos, itos, ltos, ftos, dtos, atos, vtos}; + const int invoke_length = Bytecodes::length_for(Bytecodes::_invokestatic); + const int invokeinterface_length = Bytecodes::length_for(Bytecodes::_invokeinterface); + const int invokedynamic_length = Bytecodes::length_for(Bytecodes::_invokedynamic); + + for (int i = 0; i < Interpreter::number_of_return_addrs; i++) { + TosState state = states[i]; + Interpreter::_invoke_return_entry[i] = generate_return_entry_for(state, invoke_length, sizeof(u2)); + Interpreter::_invokeinterface_return_entry[i] = generate_return_entry_for(state, invokeinterface_length, sizeof(u2)); + Interpreter::_invokedynamic_return_entry[i] = generate_return_entry_for(state, invokedynamic_length, sizeof(u4)); + } + } + + { CodeletMark cm(_masm, "earlyret entry points"); + Interpreter::_earlyret_entry = + EntryPoint( + generate_earlyret_entry_for(btos), + generate_earlyret_entry_for(ctos), + generate_earlyret_entry_for(stos), + generate_earlyret_entry_for(atos), + generate_earlyret_entry_for(itos), + generate_earlyret_entry_for(ltos), + generate_earlyret_entry_for(ftos), + generate_earlyret_entry_for(dtos), + generate_earlyret_entry_for(vtos) + ); + } + + { CodeletMark cm(_masm, "deoptimization entry points"); + for (int i = 0; i < Interpreter::number_of_deopt_entries; i++) { + Interpreter::_deopt_entry[i] = + EntryPoint( + generate_deopt_entry_for(itos, i), + generate_deopt_entry_for(itos, i), + generate_deopt_entry_for(itos, i), + generate_deopt_entry_for(atos, i), + generate_deopt_entry_for(itos, i), + generate_deopt_entry_for(ltos, i), + generate_deopt_entry_for(ftos, i), + generate_deopt_entry_for(dtos, i), + generate_deopt_entry_for(vtos, i) + ); + } + } + + { CodeletMark cm(_masm, "result handlers for native calls"); + // The various result converter stublets. + int is_generated[Interpreter::number_of_result_handlers]; + memset(is_generated, 0, sizeof(is_generated)); + + for (int i = 0; i < Interpreter::number_of_result_handlers; i++) { + BasicType type = types[i]; + if (!is_generated[Interpreter::BasicType_as_index(type)]++) { + Interpreter::_native_abi_to_tosca[Interpreter::BasicType_as_index(type)] = generate_result_handler_for(type); + } + } + } + + { CodeletMark cm(_masm, "continuation entry points"); + Interpreter::_continuation_entry = + EntryPoint( + generate_continuation_for(btos), + generate_continuation_for(ctos), + generate_continuation_for(stos), + generate_continuation_for(atos), + generate_continuation_for(itos), + generate_continuation_for(ltos), + generate_continuation_for(ftos), + generate_continuation_for(dtos), + generate_continuation_for(vtos) + ); + } + + { CodeletMark cm(_masm, "safepoint entry points"); + Interpreter::_safept_entry = + EntryPoint( + generate_safept_entry_for(btos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), + generate_safept_entry_for(ctos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), + generate_safept_entry_for(stos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), + generate_safept_entry_for(atos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), + generate_safept_entry_for(itos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), + generate_safept_entry_for(ltos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), + generate_safept_entry_for(ftos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), + generate_safept_entry_for(dtos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), + generate_safept_entry_for(vtos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)) + ); + } + + { CodeletMark cm(_masm, "exception handling"); + // (Note: this is not safepoint safe because thread may return to compiled code) + generate_throw_exception(); + } + + { CodeletMark cm(_masm, "throw exception entrypoints"); + Interpreter::_throw_ArrayIndexOutOfBoundsException_entry = generate_ArrayIndexOutOfBounds_handler("java/lang/ArrayIndexOutOfBoundsException"); + Interpreter::_throw_ArrayStoreException_entry = generate_klass_exception_handler("java/lang/ArrayStoreException" ); + Interpreter::_throw_ArithmeticException_entry = generate_exception_handler("java/lang/ArithmeticException" , "/ by zero"); + Interpreter::_throw_ClassCastException_entry = generate_ClassCastException_handler(); + Interpreter::_throw_NullPointerException_entry = generate_exception_handler("java/lang/NullPointerException" , NULL ); + Interpreter::_throw_StackOverflowError_entry = generate_StackOverflowError_handler(); + } + + + +#define method_entry(kind) \ + { CodeletMark cm(_masm, "method entry point (kind = " #kind ")"); \ + Interpreter::_entry_table[Interpreter::kind] = generate_method_entry(Interpreter::kind); \ + } + + // all non-native method kinds + method_entry(zerolocals) + method_entry(zerolocals_synchronized) + method_entry(empty) + method_entry(accessor) + method_entry(abstract) + method_entry(java_lang_math_sin ) + method_entry(java_lang_math_cos ) + method_entry(java_lang_math_tan ) + method_entry(java_lang_math_abs ) + method_entry(java_lang_math_sqrt ) + method_entry(java_lang_math_log ) + method_entry(java_lang_math_log10) + method_entry(java_lang_math_exp ) + method_entry(java_lang_math_pow ) + method_entry(java_lang_ref_reference_get) + + AbstractInterpreter::initialize_method_handle_entries(); + + // all native method kinds (must be one contiguous block) + Interpreter::_native_entry_begin = Interpreter::code()->code_end(); + method_entry(native) + method_entry(native_synchronized) + Interpreter::_native_entry_end = Interpreter::code()->code_end(); + + if (UseCRC32Intrinsics) { + method_entry(java_util_zip_CRC32_update) + method_entry(java_util_zip_CRC32_updateBytes) + method_entry(java_util_zip_CRC32_updateByteBuffer) + } + + if (UseCRC32CIntrinsics) { + method_entry(java_util_zip_CRC32C_updateBytes) + method_entry(java_util_zip_CRC32C_updateDirectByteBuffer) + } + + method_entry(java_lang_Float_intBitsToFloat); + method_entry(java_lang_Float_floatToRawIntBits); + method_entry(java_lang_Double_longBitsToDouble); + method_entry(java_lang_Double_doubleToRawLongBits); + +#undef method_entry + + // Bytecodes + set_entry_points_for_all_bytes(); + } + } while (CodeCacheExtensions::needs_other_interpreter_variant()); + + // installation of code in other places in the runtime + // (ExcutableCodeManager calls not needed to copy the entries) + set_safepoints_for_all_bytes(); +} + +//------------------------------------------------------------------------------------------------------------------------ + +address TemplateInterpreterGenerator::generate_error_exit(const char* msg) { + address entry = __ pc(); + __ stop(msg); + return entry; +} + + +//------------------------------------------------------------------------------------------------------------------------ + +void TemplateInterpreterGenerator::set_entry_points_for_all_bytes() { + for (int i = 0; i < DispatchTable::length; i++) { + Bytecodes::Code code = (Bytecodes::Code)i; + if (Bytecodes::is_defined(code)) { + set_entry_points(code); + } else { + set_unimplemented(i); + } + } +} + + +void TemplateInterpreterGenerator::set_safepoints_for_all_bytes() { + for (int i = 0; i < DispatchTable::length; i++) { + Bytecodes::Code code = (Bytecodes::Code)i; + if (Bytecodes::is_defined(code)) Interpreter::_safept_table.set_entry(code, Interpreter::_safept_entry); + } +} + + +void TemplateInterpreterGenerator::set_unimplemented(int i) { + address e = _unimplemented_bytecode; + EntryPoint entry(e, e, e, e, e, e, e, e, e); + Interpreter::_normal_table.set_entry(i, entry); + Interpreter::_wentry_point[i] = _unimplemented_bytecode; +} + + +void TemplateInterpreterGenerator::set_entry_points(Bytecodes::Code code) { + if (CodeCacheExtensions::skip_template_interpreter_entries(code)) { + return; + } + CodeletMark cm(_masm, Bytecodes::name(code), code); + // initialize entry points + assert(_unimplemented_bytecode != NULL, "should have been generated before"); + assert(_illegal_bytecode_sequence != NULL, "should have been generated before"); + address bep = _illegal_bytecode_sequence; + address cep = _illegal_bytecode_sequence; + address sep = _illegal_bytecode_sequence; + address aep = _illegal_bytecode_sequence; + address iep = _illegal_bytecode_sequence; + address lep = _illegal_bytecode_sequence; + address fep = _illegal_bytecode_sequence; + address dep = _illegal_bytecode_sequence; + address vep = _unimplemented_bytecode; + address wep = _unimplemented_bytecode; + // code for short & wide version of bytecode + if (Bytecodes::is_defined(code)) { + Template* t = TemplateTable::template_for(code); + assert(t->is_valid(), "just checking"); + set_short_entry_points(t, bep, cep, sep, aep, iep, lep, fep, dep, vep); + } + if (Bytecodes::wide_is_defined(code)) { + Template* t = TemplateTable::template_for_wide(code); + assert(t->is_valid(), "just checking"); + set_wide_entry_point(t, wep); + } + // set entry points + EntryPoint entry(bep, cep, sep, aep, iep, lep, fep, dep, vep); + Interpreter::_normal_table.set_entry(code, entry); + Interpreter::_wentry_point[code] = wep; + CodeCacheExtensions::completed_template_interpreter_entries(_masm, code); +} + + +void TemplateInterpreterGenerator::set_wide_entry_point(Template* t, address& wep) { + assert(t->is_valid(), "template must exist"); + assert(t->tos_in() == vtos, "only vtos tos_in supported for wide instructions"); + wep = __ pc(); generate_and_dispatch(t); +} + + +void TemplateInterpreterGenerator::set_short_entry_points(Template* t, address& bep, address& cep, address& sep, address& aep, address& iep, address& lep, address& fep, address& dep, address& vep) { + assert(t->is_valid(), "template must exist"); + switch (t->tos_in()) { + case btos: + case ctos: + case stos: + ShouldNotReachHere(); // btos/ctos/stos should use itos. + break; + case atos: vep = __ pc(); __ pop(atos); aep = __ pc(); generate_and_dispatch(t); break; + case itos: vep = __ pc(); __ pop(itos); iep = __ pc(); generate_and_dispatch(t); break; + case ltos: vep = __ pc(); __ pop(ltos); lep = __ pc(); generate_and_dispatch(t); break; + case ftos: vep = __ pc(); __ pop(ftos); fep = __ pc(); generate_and_dispatch(t); break; + case dtos: vep = __ pc(); __ pop(dtos); dep = __ pc(); generate_and_dispatch(t); break; + case vtos: set_vtos_entry_points(t, bep, cep, sep, aep, iep, lep, fep, dep, vep); break; + default : ShouldNotReachHere(); break; + } +} + + +//------------------------------------------------------------------------------------------------------------------------ + +void TemplateInterpreterGenerator::generate_and_dispatch(Template* t, TosState tos_out) { + if (PrintBytecodeHistogram) histogram_bytecode(t); +#ifndef PRODUCT + // debugging code + if (CountBytecodes || TraceBytecodes || StopInterpreterAt > 0) count_bytecode(); + if (PrintBytecodePairHistogram) histogram_bytecode_pair(t); + if (TraceBytecodes) trace_bytecode(t); + if (StopInterpreterAt > 0) stop_interpreter_at(); + __ verify_FPU(1, t->tos_in()); +#endif // !PRODUCT + int step = 0; + if (!t->does_dispatch()) { + step = t->is_wide() ? Bytecodes::wide_length_for(t->bytecode()) : Bytecodes::length_for(t->bytecode()); + if (tos_out == ilgl) tos_out = t->tos_out(); + // compute bytecode size + assert(step > 0, "just checkin'"); + // setup stuff for dispatching next bytecode + if (ProfileInterpreter && VerifyDataPointer + && MethodData::bytecode_has_profile(t->bytecode())) { + __ verify_method_data_pointer(); + } + __ dispatch_prolog(tos_out, step); + } + // generate template + t->generate(_masm); + // advance + if (t->does_dispatch()) { +#ifdef ASSERT + // make sure execution doesn't go beyond this point if code is broken + __ should_not_reach_here(); +#endif // ASSERT + } else { + // dispatch to next bytecode + __ dispatch_epilog(tos_out, step); + } +} + +// Generate method entries +address TemplateInterpreterGenerator::generate_method_entry( + AbstractInterpreter::MethodKind kind) { + // determine code generation flags + bool native = false; + bool synchronized = false; + address entry_point = NULL; + + switch (kind) { + case Interpreter::zerolocals : break; + case Interpreter::zerolocals_synchronized: synchronized = true; break; + case Interpreter::native : native = true; break; + case Interpreter::native_synchronized : native = true; synchronized = true; break; + case Interpreter::empty : break; + case Interpreter::accessor : break; + case Interpreter::abstract : entry_point = generate_abstract_entry(); break; + + case Interpreter::java_lang_math_sin : // fall thru + case Interpreter::java_lang_math_cos : // fall thru + case Interpreter::java_lang_math_tan : // fall thru + case Interpreter::java_lang_math_abs : // fall thru + case Interpreter::java_lang_math_log : // fall thru + case Interpreter::java_lang_math_log10 : // fall thru + case Interpreter::java_lang_math_sqrt : // fall thru + case Interpreter::java_lang_math_pow : // fall thru + case Interpreter::java_lang_math_exp : entry_point = generate_math_entry(kind); break; + case Interpreter::java_lang_ref_reference_get + : entry_point = generate_Reference_get_entry(); break; + case Interpreter::java_util_zip_CRC32_update + : native = true; entry_point = generate_CRC32_update_entry(); break; + case Interpreter::java_util_zip_CRC32_updateBytes + : // fall thru + case Interpreter::java_util_zip_CRC32_updateByteBuffer + : native = true; entry_point = generate_CRC32_updateBytes_entry(kind); break; + case Interpreter::java_util_zip_CRC32C_updateBytes + : // fall thru + case Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer + : entry_point = generate_CRC32C_updateBytes_entry(kind); break; +#ifdef IA32 + // On x86_32 platforms, a special entry is generated for the following four methods. + // On other platforms the normal entry is used to enter these methods. + case Interpreter::java_lang_Float_intBitsToFloat + : native = true; entry_point = generate_Float_intBitsToFloat_entry(); break; + case Interpreter::java_lang_Float_floatToRawIntBits + : native = true; entry_point = generate_Float_floatToRawIntBits_entry(); break; + case Interpreter::java_lang_Double_longBitsToDouble + : native = true; entry_point = generate_Double_longBitsToDouble_entry(); break; + case Interpreter::java_lang_Double_doubleToRawLongBits + : native = true; entry_point = generate_Double_doubleToRawLongBits_entry(); break; +#else + case Interpreter::java_lang_Float_intBitsToFloat: + case Interpreter::java_lang_Float_floatToRawIntBits: + case Interpreter::java_lang_Double_longBitsToDouble: + case Interpreter::java_lang_Double_doubleToRawLongBits: + native = true; + break; +#endif // defined(TARGET_ARCH_x86) && !defined(_LP64) + default: + fatal("unexpected method kind: %d", kind); + break; + } + + if (entry_point) { + return entry_point; + } + + // We expect the normal and native entry points to be generated first so we can reuse them. + if (native) { + entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native); + if (entry_point == NULL) { + entry_point = generate_native_entry(synchronized); + } + } else { + entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals); + if (entry_point == NULL) { + entry_point = generate_normal_entry(synchronized); + } + } + + return entry_point; +} +#endif // !CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp index e53e6ac0211..3f45525224a 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -61,6 +61,8 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator { void lock_method(); + void bang_stack_shadow_pages(bool native_call); + // Instruction generation void generate_and_dispatch (Template* t, TosState tos_out = ilgl); void set_vtos_entry_points (Template* t, address& bep, address& cep, address& sep, address& aep, address& iep, address& lep, address& fep, address& dep, address& vep); @@ -113,7 +115,6 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator { #endif // SPARC #ifdef AARCH64 - void bang_stack_shadow_pages(bool native_call); void generate_transcendental_entry(AbstractInterpreter::MethodKind kind, int fpargs); #endif // AARCH64 diff --git a/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.cpp b/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.cpp index 7adb8e3fdfb..bd56e38c08e 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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 @@ -489,7 +489,6 @@ JVMCIEnv::CodeInstallResult CodeInstaller::gather_metadata(Handle target, Handle if (result != JVMCIEnv::ok) { return result; } - process_exception_handlers(); _debug_recorder->pcs_size(); // ehm, create the sentinel record @@ -523,7 +522,6 @@ JVMCIEnv::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler, Hand if (result != JVMCIEnv::ok) { return result; } - process_exception_handlers(); int stack_slots = _total_frame_size / HeapWordSize; // conversion to words @@ -574,7 +572,6 @@ void CodeInstaller::initialize_fields(oop target, oop compiled_code, TRAPS) { _parameter_count = 0; } _sites_handle = JNIHandles::make_local(HotSpotCompiledCode::sites(compiled_code)); - _exception_handlers_handle = JNIHandles::make_local(HotSpotCompiledCode::exceptionHandlers(compiled_code)); _code_handle = JNIHandles::make_local(HotSpotCompiledCode::targetCode(compiled_code)); _code_size = HotSpotCompiledCode::targetCodeSize(compiled_code); @@ -608,8 +605,8 @@ int CodeInstaller::estimate_stubs_size(TRAPS) { objArrayOop sites = this->sites(); for (int i = 0; i < sites->length(); i++) { oop site = sites->obj_at(i); - if (site != NULL && site->is_a(CompilationResult_Mark::klass())) { - oop id_obj = CompilationResult_Mark::id(site); + if (site != NULL && site->is_a(site_Mark::klass())) { + oop id_obj = site_Mark::id(site); if (id_obj != NULL) { if (!java_lang_boxing_object::is_instance(id_obj, T_INT)) { JVMCI_ERROR_0("expected Integer id, got %s", id_obj->klass()->signature_name()); @@ -669,18 +666,18 @@ JVMCIEnv::CodeInstallResult CodeInstaller::initialize_buffer(CodeBuffer& buffer, if (patch.is_null()) { THROW_(vmSymbols::java_lang_NullPointerException(), JVMCIEnv::ok); } - Handle reference = CompilationResult_DataPatch::reference(patch); + Handle reference = site_DataPatch::reference(patch); if (reference.is_null()) { THROW_(vmSymbols::java_lang_NullPointerException(), JVMCIEnv::ok); } - if (!reference->is_a(CompilationResult_ConstantReference::klass())) { + if (!reference->is_a(site_ConstantReference::klass())) { JVMCI_ERROR_OK("invalid patch in data section: %s", reference->klass()->signature_name()); } - Handle constant = CompilationResult_ConstantReference::constant(reference); + Handle constant = site_ConstantReference::constant(reference); if (constant.is_null()) { THROW_(vmSymbols::java_lang_NullPointerException(), JVMCIEnv::ok); } - address dest = _constants->start() + CompilationResult_Site::pcOffset(patch); + address dest = _constants->start() + site_Site::pcOffset(patch); if (constant->is_a(HotSpotMetaspaceConstantImpl::klass())) { if (HotSpotMetaspaceConstantImpl::compressed(constant)) { #ifdef _LP64 @@ -716,27 +713,30 @@ JVMCIEnv::CodeInstallResult CodeInstaller::initialize_buffer(CodeBuffer& buffer, THROW_(vmSymbols::java_lang_NullPointerException(), JVMCIEnv::ok); } - jint pc_offset = CompilationResult_Site::pcOffset(site); + jint pc_offset = site_Site::pcOffset(site); - if (site->is_a(CompilationResult_Call::klass())) { + if (site->is_a(site_Call::klass())) { TRACE_jvmci_4("call at %i", pc_offset); site_Call(buffer, pc_offset, site, CHECK_OK); - } else if (site->is_a(CompilationResult_Infopoint::klass())) { + } else if (site->is_a(site_Infopoint::klass())) { // three reasons for infopoints denote actual safepoints - oop reason = CompilationResult_Infopoint::reason(site); - if (InfopointReason::SAFEPOINT() == reason || InfopointReason::CALL() == reason || InfopointReason::IMPLICIT_EXCEPTION() == reason) { + oop reason = site_Infopoint::reason(site); + if (site_InfopointReason::SAFEPOINT() == reason || site_InfopointReason::CALL() == reason || site_InfopointReason::IMPLICIT_EXCEPTION() == reason) { TRACE_jvmci_4("safepoint at %i", pc_offset); site_Safepoint(buffer, pc_offset, site, CHECK_OK); } else { TRACE_jvmci_4("infopoint at %i", pc_offset); site_Infopoint(buffer, pc_offset, site, CHECK_OK); } - } else if (site->is_a(CompilationResult_DataPatch::klass())) { + } else if (site->is_a(site_DataPatch::klass())) { TRACE_jvmci_4("datapatch at %i", pc_offset); site_DataPatch(buffer, pc_offset, site, CHECK_OK); - } else if (site->is_a(CompilationResult_Mark::klass())) { + } else if (site->is_a(site_Mark::klass())) { TRACE_jvmci_4("mark at %i", pc_offset); site_Mark(buffer, pc_offset, site, CHECK_OK); + } else if (site->is_a(site_ExceptionHandler::klass())) { + TRACE_jvmci_4("exceptionhandler at %i", pc_offset); + site_ExceptionHandler(pc_offset, site); } else { JVMCI_ERROR_OK("unexpected site subclass: %s", site->klass()->signature_name()); } @@ -802,21 +802,14 @@ void CodeInstaller::assumption_CallSiteTargetValue(Handle assumption) { _dependencies->assert_call_site_target_value(callSite(), methodHandle()); } -void CodeInstaller::process_exception_handlers() { - if (exception_handlers() != NULL) { - objArrayOop handlers = exception_handlers(); - for (int i = 0; i < handlers->length(); i++) { - oop exc = handlers->obj_at(i); - jint pc_offset = CompilationResult_Site::pcOffset(exc); - jint handler_offset = CompilationResult_ExceptionHandler::handlerPos(exc); +void CodeInstaller::site_ExceptionHandler(jint pc_offset, Handle exc) { + jint handler_offset = site_ExceptionHandler::handlerPos(exc); - // Subtable header - _exception_handler_table.add_entry(HandlerTableEntry(1, pc_offset, 0)); + // Subtable header + _exception_handler_table.add_entry(HandlerTableEntry(1, pc_offset, 0)); - // Subtable entry - _exception_handler_table.add_entry(HandlerTableEntry(-1, handler_offset, 0)); - } - } + // Subtable entry + _exception_handler_table.add_entry(HandlerTableEntry(-1, handler_offset, 0)); } // If deoptimization happens, the interpreter should reexecute these bytecodes. @@ -988,7 +981,7 @@ void CodeInstaller::record_scope(jint pc_offset, Handle position, ScopeMode scop } void CodeInstaller::site_Safepoint(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS) { - Handle debug_info = CompilationResult_Infopoint::debugInfo(site); + Handle debug_info = site_Infopoint::debugInfo(site); if (debug_info.is_null()) { JVMCI_ERROR("debug info expected at safepoint at %i", pc_offset); } @@ -1002,7 +995,7 @@ void CodeInstaller::site_Safepoint(CodeBuffer& buffer, jint pc_offset, Handle si } void CodeInstaller::site_Infopoint(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS) { - Handle debug_info = CompilationResult_Infopoint::debugInfo(site); + Handle debug_info = site_Infopoint::debugInfo(site); if (debug_info.is_null()) { JVMCI_ERROR("debug info expected at infopoint at %i", pc_offset); } @@ -1017,7 +1010,7 @@ void CodeInstaller::site_Infopoint(CodeBuffer& buffer, jint pc_offset, Handle si } void CodeInstaller::site_Call(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS) { - Handle target = CompilationResult_Call::target(site); + Handle target = site_Call::target(site); InstanceKlass* target_klass = InstanceKlass::cast(target->klass()); Handle hotspot_method; // JavaMethod @@ -1029,7 +1022,7 @@ void CodeInstaller::site_Call(CodeBuffer& buffer, jint pc_offset, Handle site, T hotspot_method = target; } - Handle debug_info = CompilationResult_Call::debugInfo(site); + Handle debug_info = site_Call::debugInfo(site); assert(hotspot_method.not_null() ^ foreign_call.not_null(), "Call site needs exactly one type"); @@ -1066,11 +1059,11 @@ void CodeInstaller::site_Call(CodeBuffer& buffer, jint pc_offset, Handle site, T } void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS) { - Handle reference = CompilationResult_DataPatch::reference(site); + Handle reference = site_DataPatch::reference(site); if (reference.is_null()) { THROW(vmSymbols::java_lang_NullPointerException()); - } else if (reference->is_a(CompilationResult_ConstantReference::klass())) { - Handle constant = CompilationResult_ConstantReference::constant(reference); + } else if (reference->is_a(site_ConstantReference::klass())) { + Handle constant = site_ConstantReference::constant(reference); if (constant.is_null()) { THROW(vmSymbols::java_lang_NullPointerException()); } else if (constant->is_a(HotSpotObjectConstantImpl::klass())) { @@ -1080,8 +1073,8 @@ void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, Handle si } else { JVMCI_ERROR("unknown constant type in data patch: %s", constant->klass()->signature_name()); } - } else if (reference->is_a(CompilationResult_DataSectionReference::klass())) { - int data_offset = CompilationResult_DataSectionReference::offset(reference); + } else if (reference->is_a(site_DataSectionReference::klass())) { + int data_offset = site_DataSectionReference::offset(reference); if (0 <= data_offset && data_offset < _constants_size) { pd_patch_DataSectionReference(pc_offset, data_offset); } else { @@ -1093,7 +1086,7 @@ void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, Handle si } void CodeInstaller::site_Mark(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS) { - Handle id_obj = CompilationResult_Mark::id(site); + Handle id_obj = site_Mark::id(site); if (id_obj.not_null()) { if (!java_lang_boxing_object::is_instance(id_obj(), T_INT)) { diff --git a/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.hpp b/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.hpp index 1157759d0ed..ccf6a6d836f 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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 @@ -120,7 +120,6 @@ private: jobject _data_section_handle; jobject _data_section_patches_handle; jobject _sites_handle; - jobject _exception_handlers_handle; CodeOffsets _offsets; jobject _code_handle; @@ -166,7 +165,6 @@ private: arrayOop code() { return (arrayOop) JNIHandles::resolve(_code_handle); } arrayOop data_section() { return (arrayOop) JNIHandles::resolve(_data_section_handle); } objArrayOop data_section_patches() { return (objArrayOop) JNIHandles::resolve(_data_section_patches_handle); } - objArrayOop exception_handlers() { return (objArrayOop) JNIHandles::resolve(_exception_handlers_handle); } #ifndef PRODUCT objArrayOop comments() { return (objArrayOop) JNIHandles::resolve(_comments_handle); } #endif @@ -196,7 +194,7 @@ protected: narrowKlass record_narrow_metadata_reference(Handle constant, TRAPS); #endif - // extract the fields of the CompilationResult + // extract the fields of the HotSpotCompiledCode void initialize_fields(oop target, oop target_method, TRAPS); void initialize_dependencies(oop target_method, OopRecorder* oop_recorder, TRAPS); @@ -216,6 +214,7 @@ protected: void site_Call(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS); void site_DataPatch(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS); void site_Mark(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS); + void site_ExceptionHandler(jint pc_offset, Handle site); OopMap* create_oop_map(Handle debug_info, TRAPS); @@ -235,7 +234,6 @@ protected: GrowableArray* record_virtual_objects(Handle debug_info, TRAPS); - void process_exception_handlers(); int estimateStubSpace(int static_call_stubs); }; diff --git a/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp b/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp index 8e5a2ff86f7..b9da75cde0d 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp @@ -134,7 +134,6 @@ void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JV JVMCIRuntime::initialize_well_known_classes(CHECK_ABORT); HandleMark hm; - ResourceMark rm; Handle receiver = JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK_ABORT); JavaValue method_result(T_OBJECT); @@ -143,8 +142,8 @@ void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JV JavaCalls::call_static(&method_result, SystemDictionary::HotSpotResolvedJavaMethodImpl_klass(), vmSymbols::fromMetaspace_name(), vmSymbols::method_fromMetaspace_signature(), &args, THREAD); + JavaValue result(T_OBJECT); if (!HAS_PENDING_EXCEPTION) { - JavaValue result(T_VOID); JavaCallArguments args; args.push_oop(receiver); args.push_oop((oop)method_result.get_jobject()); @@ -162,15 +161,27 @@ void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JV Handle exception(THREAD, PENDING_EXCEPTION); CLEAR_PENDING_EXCEPTION; - { - ttyLocker ttyl; - java_lang_Throwable::print_stack_trace(exception, tty); - } + java_lang_Throwable::java_printStackTrace(exception, THREAD); - // Something went wrong so disable compilation at this level - method->set_not_compilable(CompLevel_full_optimization); + env->set_failure("exception throw", false); } else { - _methodsCompiled++; + oop result_object = (oop) result.get_jobject(); + if (result_object != NULL) { + oop failure_message = CompilationRequestResult::failureMessage(result_object); + if (failure_message != NULL) { + const char* failure_reason = java_lang_String::as_utf8_string(failure_message); + env->set_failure(failure_reason, CompilationRequestResult::retry(result_object) != 0); + } else { + if (env->task()->code() == NULL) { + env->set_failure("no nmethod produced", true); + } else { + env->task()->set_num_inlined_bytecodes(CompilationRequestResult::inlinedBytecodes(result_object)); + _methodsCompiled++; + } + } + } else { + assert(false, "JVMCICompiler.compileMethod should always return non-null"); + } } } @@ -181,11 +192,7 @@ void JVMCICompiler::abort_on_pending_exception(Handle exception, const char* mes Thread* THREAD = Thread::current(); CLEAR_PENDING_EXCEPTION; - { - ttyLocker ttyl; - tty->print_raw_cr(message); - java_lang_Throwable::print_stack_trace(exception, tty); - } + java_lang_Throwable::java_printStackTrace(exception, THREAD); // Give other aborting threads to also print their stack traces. // This can be very useful when debugging class initialization diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp index 2205ff479fd..f2592ecb716 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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 @@ -22,6 +22,7 @@ */ #include "precompiled.hpp" +#include "classfile/javaClasses.inline.hpp" #include "code/codeCache.hpp" #include "code/scopeDesc.hpp" #include "interpreter/linkResolver.hpp" @@ -149,6 +150,8 @@ HeapWord** CompilerToVM::Data::_heap_top_addr; jbyte* CompilerToVM::Data::cardtable_start_address; int CompilerToVM::Data::cardtable_shift; +int CompilerToVM::Data::vm_page_size; + void CompilerToVM::Data::initialize() { InstanceKlass_vtable_start_offset = InstanceKlass::vtable_start_offset(); InstanceKlass_vtable_length_offset = InstanceKlass::vtable_length_offset() * HeapWordSize; @@ -198,6 +201,8 @@ void CompilerToVM::Data::initialize() { ShouldNotReachHere(); break; } + + vm_page_size = os::vm_page_size(); } /** @@ -834,30 +839,6 @@ C2V_VMENTRY(jint, getMetadata, (JNIEnv *jniEnv, jobject, jobject target, jobject return result; C2V_END -C2V_VMENTRY(void, notifyCompilationStatistics, (JNIEnv *jniEnv, jobject, jint id, jobject hotspot_method, jboolean osr, jint processedBytecodes, jlong time, jlong timeUnitsPerSecond, jobject installed_code)) - JVMCICompiler* compiler = JVMCICompiler::instance(CHECK); - CompilerStatistics* stats = compiler->stats(); - - elapsedTimer timer = elapsedTimer(time, timeUnitsPerSecond); - if (osr) { - stats->_osr.update(timer, processedBytecodes); - } else { - stats->_standard.update(timer, processedBytecodes); - } - Handle installed_code_handle = JNIHandles::resolve(installed_code); - if (installed_code_handle->is_a(HotSpotInstalledCode::klass())) { - stats->_nmethods_size += HotSpotInstalledCode::size(installed_code_handle); - stats->_nmethods_code_size += HotSpotInstalledCode::codeSize(installed_code_handle); - } - - if (CITimeEach) { - methodHandle method = CompilerToVM::asMethod(hotspot_method); - float bytes_per_sec = 1.0 * processedBytecodes / timer.seconds(); - tty->print_cr("%3d seconds: %f bytes/sec: %f (bytes %d)", - id, timer.seconds(), bytes_per_sec, processedBytecodes); - } -C2V_END - C2V_VMENTRY(void, resetCompilationStatistics, (JNIEnv *jniEnv, jobject)) JVMCICompiler* compiler = JVMCICompiler::instance(CHECK); CompilerStatistics* stats = compiler->stats(); @@ -897,10 +878,8 @@ C2V_VMENTRY(jobject, disassembleCodeBlob, (JNIEnv *jniEnv, jobject, jobject inst if (!nm->is_alive()) { return NULL; } - Disassembler::decode(nm, &st); - } else { - Disassembler::decode(cb, &st); } + Disassembler::decode(cb, &st); if (st.size() <= 0) { return NULL; } @@ -1390,6 +1369,42 @@ C2V_VMENTRY(int, methodDataProfileDataSize, (JNIEnv*, jobject, jlong metaspace_m THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), err_msg("Invalid profile data position %d", position)); C2V_END +C2V_VMENTRY(int, interpreterFrameSize, (JNIEnv*, jobject, jobject bytecode_frame_handle)) + if (bytecode_frame_handle == NULL) { + THROW_0(vmSymbols::java_lang_NullPointerException()); + } + + oop top_bytecode_frame = JNIHandles::resolve_non_null(bytecode_frame_handle); + oop bytecode_frame = top_bytecode_frame; + int size = 0; + int callee_parameters = 0; + int callee_locals = 0; + Method* method = getMethodFromHotSpotMethod(BytecodePosition::method(bytecode_frame)); + int extra_args = method->max_stack() - BytecodeFrame::numStack(bytecode_frame); + + while (bytecode_frame != NULL) { + int locks = BytecodeFrame::numLocks(bytecode_frame); + int temps = BytecodeFrame::numStack(bytecode_frame); + bool is_top_frame = (bytecode_frame == top_bytecode_frame); + Method* method = getMethodFromHotSpotMethod(BytecodePosition::method(bytecode_frame)); + + int frame_size = BytesPerWord * Interpreter::size_activation(method->max_stack(), + temps + callee_parameters, + extra_args, + locks, + callee_parameters, + callee_locals, + is_top_frame); + size += frame_size; + + callee_parameters = method->size_of_parameters(); + callee_locals = method->max_locals(); + extra_args = 0; + bytecode_frame = BytecodePosition::caller(bytecode_frame); + } + return size + Deoptimization::last_frame_adjust(0, callee_locals) * BytesPerWord; +C2V_END + #define CC (char*) /*cast a literal from (const char*)*/ #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(c2v_ ## f)) @@ -1400,6 +1415,7 @@ C2V_END #define STACK_TRACE_ELEMENT "Ljava/lang/StackTraceElement;" #define INSTALLED_CODE "Ljdk/vm/ci/code/InstalledCode;" #define TARGET_DESCRIPTION "Ljdk/vm/ci/code/TargetDescription;" +#define BYTECODE_FRAME "Ljdk/vm/ci/code/BytecodeFrame;" #define RESOLVED_METHOD "Ljdk/vm/ci/meta/ResolvedJavaMethod;" #define HS_RESOLVED_METHOD "Ljdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl;" #define HS_RESOLVED_KLASS "Ljdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl;" @@ -1449,7 +1465,6 @@ JNINativeMethod CompilerToVM::methods[] = { {CC"initializeConfiguration", CC"("HS_CONFIG")J", FN_PTR(initializeConfiguration)}, {CC"installCode", CC"("TARGET_DESCRIPTION HS_COMPILED_CODE INSTALLED_CODE HS_SPECULATION_LOG")I", FN_PTR(installCode)}, {CC"getMetadata", CC"("TARGET_DESCRIPTION HS_COMPILED_CODE HS_METADATA")I", FN_PTR(getMetadata)}, - {CC"notifyCompilationStatistics", CC"(I"HS_RESOLVED_METHOD"ZIJJ"INSTALLED_CODE")V", FN_PTR(notifyCompilationStatistics)}, {CC"resetCompilationStatistics", CC"()V", FN_PTR(resetCompilationStatistics)}, {CC"disassembleCodeBlob", CC"("INSTALLED_CODE")"STRING, FN_PTR(disassembleCodeBlob)}, {CC"executeInstalledCode", CC"(["OBJECT INSTALLED_CODE")"OBJECT, FN_PTR(executeInstalledCode)}, @@ -1470,6 +1485,7 @@ JNINativeMethod CompilerToVM::methods[] = { {CC"writeDebugOutput", CC"([BII)V", FN_PTR(writeDebugOutput)}, {CC"flushDebugOutput", CC"()V", FN_PTR(flushDebugOutput)}, {CC"methodDataProfileDataSize", CC"(JI)I", FN_PTR(methodDataProfileDataSize)}, + {CC"interpreterFrameSize", CC"("BYTECODE_FRAME")I", FN_PTR(interpreterFrameSize)}, }; int CompilerToVM::methods_count() { diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp index 1947324556b..9a6667a82ef 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp @@ -63,6 +63,8 @@ class CompilerToVM { static jbyte* cardtable_start_address; static int cardtable_shift; + static int vm_page_size; + public: static void initialize(); }; diff --git a/hotspot/src/share/vm/jvmci/jvmciEnv.cpp b/hotspot/src/share/vm/jvmci/jvmciEnv.cpp index 4142f790c6c..edf2d21fdd0 100644 --- a/hotspot/src/share/vm/jvmci/jvmciEnv.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciEnv.cpp @@ -48,16 +48,17 @@ #include "jvmci/jvmciRuntime.hpp" #include "jvmci/jvmciJavaClasses.hpp" -JVMCIEnv::JVMCIEnv(CompileTask* task, int system_dictionary_modification_counter) { - _task = task; - _system_dictionary_modification_counter = system_dictionary_modification_counter; - { - // Get Jvmti capabilities under lock to get consistent values. - MutexLocker mu(JvmtiThreadState_lock); - _jvmti_can_hotswap_or_post_breakpoint = JvmtiExport::can_hotswap_or_post_breakpoint(); - _jvmti_can_access_local_variables = JvmtiExport::can_access_local_variables(); - _jvmti_can_post_on_exceptions = JvmtiExport::can_post_on_exceptions(); - } +JVMCIEnv::JVMCIEnv(CompileTask* task, int system_dictionary_modification_counter): + _task(task), + _system_dictionary_modification_counter(system_dictionary_modification_counter), + _failure_reason(NULL), + _retryable(true) +{ + // Get Jvmti capabilities under lock to get consistent values. + MutexLocker mu(JvmtiThreadState_lock); + _jvmti_can_hotswap_or_post_breakpoint = JvmtiExport::can_hotswap_or_post_breakpoint(); + _jvmti_can_access_local_variables = JvmtiExport::can_access_local_variables(); + _jvmti_can_post_on_exceptions = JvmtiExport::can_post_on_exceptions(); } // ------------------------------------------------------------------ @@ -534,7 +535,9 @@ JVMCIEnv::CodeInstallResult JVMCIEnv::register_method( // Record successful registration. // (Put nm into the task handle *before* publishing to the Java heap.) CompileTask* task = env == NULL ? NULL : env->task(); - if (task != NULL) task->set_code(nm); + if (task != NULL) { + task->set_code(nm); + } if (installed_code->is_a(HotSpotNmethod::klass()) && HotSpotNmethod::isDefault(installed_code())) { if (entry_bci == InvocationEntryBci) { diff --git a/hotspot/src/share/vm/jvmci/jvmciEnv.hpp b/hotspot/src/share/vm/jvmci/jvmciEnv.hpp index 2bc95d3308c..833074326bf 100644 --- a/hotspot/src/share/vm/jvmci/jvmciEnv.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciEnv.hpp @@ -100,6 +100,10 @@ private: CompileTask* _task; int _system_dictionary_modification_counter; + // Compilation result values + const char* _failure_reason; + bool _retryable; + // Cache JVMTI state bool _jvmti_can_hotswap_or_post_breakpoint; bool _jvmti_can_access_local_variables; @@ -141,6 +145,14 @@ private: public: CompileTask* task() { return _task; } + const char* failure_reason() { return _failure_reason; } + bool retryable() { return _retryable; } + + void set_failure(const char* reason, bool retryable) { + _failure_reason = reason; + _retryable = retryable; + } + // Register the result of a compilation. static JVMCIEnv::CodeInstallResult register_method( const methodHandle& target, diff --git a/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp b/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp index a49eda73d4d..083f726d170 100644 --- a/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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 @@ -26,6 +26,7 @@ #include "classfile/systemDictionary.hpp" #include "oops/instanceMirrorKlass.hpp" +#include "oops/oop.inline.hpp" class JVMCIJavaClasses : AllStatic { public: @@ -79,19 +80,18 @@ class JVMCIJavaClasses : AllStatic { end_class \ start_class(HotSpotCompiledCode) \ oop_field(HotSpotCompiledCode, name, "Ljava/lang/String;") \ - objArrayOop_field(HotSpotCompiledCode, sites, "[Ljdk/vm/ci/code/CompilationResult$Site;") \ - objArrayOop_field(HotSpotCompiledCode, exceptionHandlers, "[Ljdk/vm/ci/code/CompilationResult$ExceptionHandler;") \ - objArrayOop_field(HotSpotCompiledCode, comments, "[Ljdk/vm/ci/hotspot/HotSpotCompiledCode$Comment;") \ - objArrayOop_field(HotSpotCompiledCode, assumptions, "[Ljdk/vm/ci/meta/Assumptions$Assumption;") \ typeArrayOop_field(HotSpotCompiledCode, targetCode, "[B") \ int_field(HotSpotCompiledCode, targetCodeSize) \ + objArrayOop_field(HotSpotCompiledCode, sites, "[Ljdk/vm/ci/code/site/Site;") \ + objArrayOop_field(HotSpotCompiledCode, assumptions, "[Ljdk/vm/ci/meta/Assumptions$Assumption;") \ + objArrayOop_field(HotSpotCompiledCode, methods, "[Ljdk/vm/ci/meta/ResolvedJavaMethod;") \ + objArrayOop_field(HotSpotCompiledCode, comments, "[Ljdk/vm/ci/hotspot/HotSpotCompiledCode$Comment;") \ typeArrayOop_field(HotSpotCompiledCode, dataSection, "[B") \ int_field(HotSpotCompiledCode, dataSectionAlignment) \ - objArrayOop_field(HotSpotCompiledCode, dataSectionPatches, "[Ljdk/vm/ci/code/CompilationResult$DataPatch;") \ + objArrayOop_field(HotSpotCompiledCode, dataSectionPatches, "[Ljdk/vm/ci/code/site/DataPatch;") \ boolean_field(HotSpotCompiledCode, isImmutablePIC) \ int_field(HotSpotCompiledCode, totalFrameSize) \ int_field(HotSpotCompiledCode, customStackAreaOffset) \ - objArrayOop_field(HotSpotCompiledCode, methods, "[Ljdk/vm/ci/meta/ResolvedJavaMethod;") \ end_class \ start_class(HotSpotCompiledCode_Comment) \ oop_field(HotSpotCompiledCode_Comment, text, "Ljava/lang/String;") \ @@ -131,36 +131,41 @@ class JVMCIJavaClasses : AllStatic { oop_field(Assumptions_CallSiteTargetValue, callSite, "Ljava/lang/invoke/CallSite;") \ oop_field(Assumptions_CallSiteTargetValue, methodHandle, "Ljava/lang/invoke/MethodHandle;") \ end_class \ - start_class(CompilationResult_Site) \ - int_field(CompilationResult_Site, pcOffset) \ + start_class(site_Site) \ + int_field(site_Site, pcOffset) \ end_class \ - start_class(CompilationResult_Call) \ - oop_field(CompilationResult_Call, target, "Ljdk/vm/ci/meta/InvokeTarget;") \ - oop_field(CompilationResult_Call, debugInfo, "Ljdk/vm/ci/code/DebugInfo;") \ + start_class(site_Call) \ + oop_field(site_Call, target, "Ljdk/vm/ci/meta/InvokeTarget;") \ + oop_field(site_Call, debugInfo, "Ljdk/vm/ci/code/DebugInfo;") \ end_class \ - start_class(CompilationResult_DataPatch) \ - oop_field(CompilationResult_DataPatch, reference, "Ljdk/vm/ci/code/CompilationResult$Reference;") \ + start_class(site_DataPatch) \ + oop_field(site_DataPatch, reference, "Ljdk/vm/ci/code/site/Reference;") \ end_class \ - start_class(CompilationResult_ConstantReference) \ - oop_field(CompilationResult_ConstantReference, constant, "Ljdk/vm/ci/meta/VMConstant;") \ + start_class(site_ConstantReference) \ + oop_field(site_ConstantReference, constant, "Ljdk/vm/ci/meta/VMConstant;") \ end_class \ - start_class(CompilationResult_DataSectionReference) \ - int_field(CompilationResult_DataSectionReference, offset) \ + start_class(site_DataSectionReference) \ + int_field(site_DataSectionReference, offset) \ end_class \ - start_class(InfopointReason) \ - static_oop_field(InfopointReason, SAFEPOINT, "Ljdk/vm/ci/code/InfopointReason;") \ - static_oop_field(InfopointReason, CALL, "Ljdk/vm/ci/code/InfopointReason;") \ - static_oop_field(InfopointReason, IMPLICIT_EXCEPTION, "Ljdk/vm/ci/code/InfopointReason;") \ + start_class(site_InfopointReason) \ + static_oop_field(site_InfopointReason, SAFEPOINT, "Ljdk/vm/ci/code/site/InfopointReason;") \ + static_oop_field(site_InfopointReason, CALL, "Ljdk/vm/ci/code/site/InfopointReason;") \ + static_oop_field(site_InfopointReason, IMPLICIT_EXCEPTION, "Ljdk/vm/ci/code/site/InfopointReason;") \ end_class \ - start_class(CompilationResult_Infopoint) \ - oop_field(CompilationResult_Infopoint, debugInfo, "Ljdk/vm/ci/code/DebugInfo;") \ - oop_field(CompilationResult_Infopoint, reason, "Ljdk/vm/ci/code/InfopointReason;") \ + start_class(site_Infopoint) \ + oop_field(site_Infopoint, debugInfo, "Ljdk/vm/ci/code/DebugInfo;") \ + oop_field(site_Infopoint, reason, "Ljdk/vm/ci/code/site/InfopointReason;") \ end_class \ - start_class(CompilationResult_ExceptionHandler) \ - int_field(CompilationResult_ExceptionHandler, handlerPos) \ + start_class(site_ExceptionHandler) \ + int_field(site_ExceptionHandler, handlerPos) \ end_class \ - start_class(CompilationResult_Mark) \ - oop_field(CompilationResult_Mark, id, "Ljava/lang/Object;") \ + start_class(site_Mark) \ + oop_field(site_Mark, id, "Ljava/lang/Object;") \ + end_class \ + start_class(CompilationRequestResult) \ + oop_field(CompilationRequestResult, failureMessage, "Ljava/lang/String;") \ + boolean_field(CompilationRequestResult, retry) \ + int_field(CompilationRequestResult, inlinedBytecodes) \ end_class \ start_class(DebugInfo) \ oop_field(DebugInfo, bytecodePosition, "Ljdk/vm/ci/code/BytecodePosition;") \ @@ -288,7 +293,7 @@ class JVMCIJavaClasses : AllStatic { long_field(HotSpotConstantPool, metaspaceConstantPool) \ end_class \ start_class(HotSpotJVMCIRuntime) \ - objArrayOop_field(HotSpotJVMCIRuntime, trivialPrefixes, "[Ljava/lang/String;") \ + objArrayOop_field(HotSpotJVMCIRuntime, trivialPrefixes, "[Ljava/lang/String;") \ end_class \ /* end*/ diff --git a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp index fafc68b0ac1..ec205b11ce4 100644 --- a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -23,6 +23,7 @@ #include "precompiled.hpp" #include "asm/codeBuffer.hpp" +#include "classfile/javaClasses.inline.hpp" #include "code/codeCache.hpp" #include "compiler/compileBroker.hpp" #include "compiler/disassembler.hpp" diff --git a/hotspot/src/share/vm/jvmci/systemDictionary_jvmci.hpp b/hotspot/src/share/vm/jvmci/systemDictionary_jvmci.hpp index 58701527f0f..864539f6654 100644 --- a/hotspot/src/share/vm/jvmci/systemDictionary_jvmci.hpp +++ b/hotspot/src/share/vm/jvmci/systemDictionary_jvmci.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -60,15 +60,7 @@ do_klass(DebugInfo_klass, jdk_vm_ci_code_DebugInfo, Jvmci) \ do_klass(RegisterSaveLayout_klass, jdk_vm_ci_code_RegisterSaveLayout, Jvmci) \ do_klass(BytecodeFrame_klass, jdk_vm_ci_code_BytecodeFrame, Jvmci) \ - do_klass(CompilationResult_Call_klass, jdk_vm_ci_code_CompilationResult_Call, Jvmci) \ - do_klass(CompilationResult_ConstantReference_klass, jdk_vm_ci_code_CompilationResult_ConstantReference, Jvmci) \ - do_klass(CompilationResult_DataPatch_klass, jdk_vm_ci_code_CompilationResult_DataPatch, Jvmci) \ - do_klass(CompilationResult_DataSectionReference_klass, jdk_vm_ci_code_CompilationResult_DataSectionReference, Jvmci) \ - do_klass(CompilationResult_ExceptionHandler_klass, jdk_vm_ci_code_CompilationResult_ExceptionHandler, Jvmci) \ - do_klass(CompilationResult_Mark_klass, jdk_vm_ci_code_CompilationResult_Mark, Jvmci) \ - do_klass(CompilationResult_Infopoint_klass, jdk_vm_ci_code_CompilationResult_Infopoint, Jvmci) \ - do_klass(CompilationResult_Site_klass, jdk_vm_ci_code_CompilationResult_Site, Jvmci) \ - do_klass(InfopointReason_klass, jdk_vm_ci_code_InfopointReason, Jvmci) \ + do_klass(CompilationRequestResult_klass, jdk_vm_ci_code_CompilationRequestResult, Jvmci) \ do_klass(InstalledCode_klass, jdk_vm_ci_code_InstalledCode, Jvmci) \ do_klass(code_Location_klass, jdk_vm_ci_code_Location, Jvmci) \ do_klass(code_Register_klass, jdk_vm_ci_code_Register, Jvmci) \ @@ -76,6 +68,15 @@ do_klass(StackSlot_klass, jdk_vm_ci_code_StackSlot, Jvmci) \ do_klass(StackLockValue_klass, jdk_vm_ci_code_StackLockValue, Jvmci) \ do_klass(VirtualObject_klass, jdk_vm_ci_code_VirtualObject, Jvmci) \ + do_klass(site_Call_klass, jdk_vm_ci_code_site_Call, Jvmci) \ + do_klass(site_ConstantReference_klass, jdk_vm_ci_code_site_ConstantReference, Jvmci) \ + do_klass(site_DataPatch_klass, jdk_vm_ci_code_site_DataPatch, Jvmci) \ + do_klass(site_DataSectionReference_klass, jdk_vm_ci_code_site_DataSectionReference, Jvmci) \ + do_klass(site_ExceptionHandler_klass, jdk_vm_ci_code_site_ExceptionHandler, Jvmci) \ + do_klass(site_Mark_klass, jdk_vm_ci_code_site_Mark, Jvmci) \ + do_klass(site_Infopoint_klass, jdk_vm_ci_code_site_Infopoint, Jvmci) \ + do_klass(site_Site_klass, jdk_vm_ci_code_site_Site, Jvmci) \ + do_klass(site_InfopointReason_klass, jdk_vm_ci_code_site_InfopointReason, Jvmci) \ do_klass(JavaConstant_klass, jdk_vm_ci_meta_JavaConstant, Jvmci) \ do_klass(PrimitiveConstant_klass, jdk_vm_ci_meta_PrimitiveConstant, Jvmci) \ do_klass(RawConstant_klass, jdk_vm_ci_meta_RawConstant, Jvmci) \ diff --git a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp index 84f7dca06ef..2b58b4a35ba 100644 --- a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp +++ b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp @@ -74,6 +74,8 @@ static_field(CompilerToVM::Data, cardtable_start_address, jbyte*) \ static_field(CompilerToVM::Data, cardtable_shift, int) \ \ + static_field(CompilerToVM::Data, vm_page_size, int) \ + \ static_field(Abstract_VM_Version, _features, uint64_t) \ \ nonstatic_field(Array, _length, int) \ diff --git a/hotspot/src/share/vm/jvmci/vmSymbols_jvmci.hpp b/hotspot/src/share/vm/jvmci/vmSymbols_jvmci.hpp index 8d8af6bd79a..f7aada3b81b 100644 --- a/hotspot/src/share/vm/jvmci/vmSymbols_jvmci.hpp +++ b/hotspot/src/share/vm/jvmci/vmSymbols_jvmci.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,31 +64,32 @@ template(jdk_vm_ci_meta_Assumptions_ConcreteMethod, "jdk/vm/ci/meta/Assumptions$ConcreteMethod") \ template(jdk_vm_ci_meta_Assumptions_CallSiteTargetValue, "jdk/vm/ci/meta/Assumptions$CallSiteTargetValue") \ template(jdk_vm_ci_code_Architecture, "jdk/vm/ci/code/Architecture") \ - template(jdk_vm_ci_code_TargetDescription, "jdk/vm/ci/code/TargetDescription") \ - template(jdk_vm_ci_code_CompilationResult_Call, "jdk/vm/ci/code/CompilationResult$Call") \ - template(jdk_vm_ci_code_CompilationResult_ConstantReference, "jdk/vm/ci/code/CompilationResult$ConstantReference") \ - template(jdk_vm_ci_code_CompilationResult_DataPatch, "jdk/vm/ci/code/CompilationResult$DataPatch") \ - template(jdk_vm_ci_code_CompilationResult_DataSectionReference, "jdk/vm/ci/code/CompilationResult$DataSectionReference") \ - template(jdk_vm_ci_code_CompilationResult_ExceptionHandler, "jdk/vm/ci/code/CompilationResult$ExceptionHandler") \ - template(jdk_vm_ci_code_CompilationResult_Mark, "jdk/vm/ci/code/CompilationResult$Mark") \ - template(jdk_vm_ci_code_CompilationResult_Infopoint, "jdk/vm/ci/code/CompilationResult$Infopoint") \ - template(jdk_vm_ci_code_CompilationResult_Site, "jdk/vm/ci/code/CompilationResult$Site") \ - template(jdk_vm_ci_code_InfopointReason, "jdk/vm/ci/code/InfopointReason") \ - template(jdk_vm_ci_code_InstalledCode, "jdk/vm/ci/code/InstalledCode") \ template(jdk_vm_ci_code_BytecodeFrame, "jdk/vm/ci/code/BytecodeFrame") \ template(jdk_vm_ci_code_BytecodePosition, "jdk/vm/ci/code/BytecodePosition") \ + template(jdk_vm_ci_code_CompilationRequestResult, "jdk/vm/ci/code/CompilationRequestResult") \ template(jdk_vm_ci_code_DebugInfo, "jdk/vm/ci/code/DebugInfo") \ + template(jdk_vm_ci_code_InstalledCode, "jdk/vm/ci/code/InstalledCode") \ template(jdk_vm_ci_code_Location, "jdk/vm/ci/code/Location") \ template(jdk_vm_ci_code_Register, "jdk/vm/ci/code/Register") \ template(jdk_vm_ci_code_RegisterValue, "jdk/vm/ci/code/RegisterValue") \ template(jdk_vm_ci_code_StackSlot, "jdk/vm/ci/code/StackSlot") \ template(jdk_vm_ci_code_StackLockValue, "jdk/vm/ci/code/StackLockValue") \ + template(jdk_vm_ci_code_TargetDescription, "jdk/vm/ci/code/TargetDescription") \ template(jdk_vm_ci_code_VirtualObject, "jdk/vm/ci/code/VirtualObject") \ template(jdk_vm_ci_code_RegisterSaveLayout, "jdk/vm/ci/code/RegisterSaveLayout") \ template(jdk_vm_ci_code_InvalidInstalledCodeException, "jdk/vm/ci/code/InvalidInstalledCodeException") \ + template(jdk_vm_ci_code_site_Call, "jdk/vm/ci/code/site/Call") \ + template(jdk_vm_ci_code_site_ConstantReference, "jdk/vm/ci/code/site/ConstantReference") \ + template(jdk_vm_ci_code_site_DataPatch, "jdk/vm/ci/code/site/DataPatch") \ + template(jdk_vm_ci_code_site_DataSectionReference, "jdk/vm/ci/code/site/DataSectionReference") \ + template(jdk_vm_ci_code_site_ExceptionHandler, "jdk/vm/ci/code/site/ExceptionHandler") \ + template(jdk_vm_ci_code_site_Mark, "jdk/vm/ci/code/site/Mark") \ + template(jdk_vm_ci_code_site_Infopoint, "jdk/vm/ci/code/site/Infopoint") \ + template(jdk_vm_ci_code_site_Site, "jdk/vm/ci/code/site/Site") \ + template(jdk_vm_ci_code_site_InfopointReason, "jdk/vm/ci/code/site/InfopointReason") \ template(jdk_vm_ci_common_JVMCIError, "jdk/vm/ci/common/JVMCIError") \ template(compileMethod_name, "compileMethod") \ - template(compileMethod_signature, "(Ljdk/vm/ci/hotspot/HotSpotResolvedJavaMethod;IJI)V") \ + template(compileMethod_signature, "(Ljdk/vm/ci/hotspot/HotSpotResolvedJavaMethod;IJI)Ljdk/vm/ci/code/CompilationRequestResult;") \ template(fromMetaspace_name, "fromMetaspace") \ template(method_fromMetaspace_signature, "(J)Ljdk/vm/ci/hotspot/HotSpotResolvedJavaMethod;") \ template(constantPool_fromMetaspace_signature, "(J)Ljdk/vm/ci/hotspot/HotSpotConstantPool;") \ diff --git a/hotspot/src/share/vm/logging/logTag.hpp b/hotspot/src/share/vm/logging/logTag.hpp index f723b3548d7..aeedd0b2043 100644 --- a/hotspot/src/share/vm/logging/logTag.hpp +++ b/hotspot/src/share/vm/logging/logTag.hpp @@ -52,6 +52,7 @@ LOG_TAG(heap) \ LOG_TAG(humongous) \ LOG_TAG(ihop) \ + LOG_TAG(itables) \ LOG_TAG(jni) \ LOG_TAG(liveness) \ LOG_TAG(logging) \ @@ -80,7 +81,8 @@ LOG_TAG(tlab) \ LOG_TAG(time) \ LOG_TAG(verify) \ - LOG_TAG(vmoperation) + LOG_TAG(vmoperation) \ + LOG_TAG(vtables) #define PREFIX_LOG_TAG(T) (LogTag::_##T) diff --git a/hotspot/src/share/vm/memory/guardedMemory.cpp b/hotspot/src/share/vm/memory/guardedMemory.cpp index 763548fd35d..d40f3b84319 100644 --- a/hotspot/src/share/vm/memory/guardedMemory.cpp +++ b/hotspot/src/share/vm/memory/guardedMemory.cpp @@ -157,5 +157,9 @@ void GuardedMemory::test_guarded_memory() { assert(GuardedMemory::free_copy(no_data_copy), "Expected valid guards even for no data copy"); } +void GuardedMemory_test() { + GuardedMemory::test_guarded_memory(); +} + #endif // !PRODUCT diff --git a/hotspot/src/share/vm/memory/heap.cpp b/hotspot/src/share/vm/memory/heap.cpp index 1910ed49e18..7afab964a7f 100644 --- a/hotspot/src/share/vm/memory/heap.cpp +++ b/hotspot/src/share/vm/memory/heap.cpp @@ -149,6 +149,10 @@ bool CodeHeap::expand_by(size_t size) { // expand _memory space size_t dm = align_to_page_size(_memory.committed_size() + size) - _memory.committed_size(); if (dm > 0) { + // Use at least the available uncommitted space if 'size' is larger + if (_memory.uncommitted_size() != 0 && dm > _memory.uncommitted_size()) { + dm = _memory.uncommitted_size(); + } char* base = _memory.low() + _memory.committed_size(); if (!_memory.expand_by(dm)) return false; on_code_mapping(base, dm); diff --git a/hotspot/src/share/vm/memory/referenceType.hpp b/hotspot/src/share/vm/memory/referenceType.hpp index a54e8238e87..ea50b2c88f6 100644 --- a/hotspot/src/share/vm/memory/referenceType.hpp +++ b/hotspot/src/share/vm/memory/referenceType.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -35,8 +35,7 @@ enum ReferenceType { REF_SOFT, // Subclass of java/lang/ref/SoftReference REF_WEAK, // Subclass of java/lang/ref/WeakReference REF_FINAL, // Subclass of java/lang/ref/FinalReference - REF_PHANTOM, // Subclass of java/lang/ref/PhantomReference - REF_CLEANER // Subclass of sun/misc/Cleaner + REF_PHANTOM // Subclass of java/lang/ref/PhantomReference }; #endif // SHARE_VM_MEMORY_REFERENCETYPE_HPP diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp index d9c17bc71d1..ac36a988d97 100644 --- a/hotspot/src/share/vm/memory/universe.cpp +++ b/hotspot/src/share/vm/memory/universe.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -129,6 +129,7 @@ oop Universe::_delayed_stack_overflow_error_message = NULL; objArrayOop Universe::_preallocated_out_of_memory_error_array = NULL; volatile jint Universe::_preallocated_out_of_memory_error_avail_count = 0; bool Universe::_verify_in_progress = false; +long Universe::verify_flags = Universe::Verify_All; oop Universe::_null_ptr_exception_instance = NULL; oop Universe::_arithmetic_exception_instance = NULL; oop Universe::_virtual_machine_error_instance = NULL; @@ -669,6 +670,9 @@ jint universe_init() { MetaspaceShared::prepare_for_dumping(); } } + if (strlen(VerifySubSet) > 0) { + Universe::initialize_verify_flags(); + } return JNI_OK; } @@ -1103,6 +1107,53 @@ void Universe::print_heap_after_gc() { } } +void Universe::initialize_verify_flags() { + verify_flags = 0; + const char delimiter[] = " ,"; + + size_t length = strlen(VerifySubSet); + char* subset_list = NEW_C_HEAP_ARRAY(char, length + 1, mtInternal); + strncpy(subset_list, VerifySubSet, length + 1); + + char* token = strtok(subset_list, delimiter); + while (token != NULL) { + if (strcmp(token, "threads") == 0) { + verify_flags |= Verify_Threads; + } else if (strcmp(token, "heap") == 0) { + verify_flags |= Verify_Heap; + } else if (strcmp(token, "symbol_table") == 0) { + verify_flags |= Verify_SymbolTable; + } else if (strcmp(token, "string_table") == 0) { + verify_flags |= Verify_StringTable; + } else if (strcmp(token, "codecache") == 0) { + verify_flags |= Verify_CodeCache; + } else if (strcmp(token, "dictionary") == 0) { + verify_flags |= Verify_SystemDictionary; + } else if (strcmp(token, "classloader_data_graph") == 0) { + verify_flags |= Verify_ClassLoaderDataGraph; + } else if (strcmp(token, "metaspace") == 0) { + verify_flags |= Verify_MetaspaceAux; + } else if (strcmp(token, "jni_handles") == 0) { + verify_flags |= Verify_JNIHandles; + } else if (strcmp(token, "c-heap") == 0) { + verify_flags |= Verify_CHeap; + } else if (strcmp(token, "codecache_oops") == 0) { + verify_flags |= Verify_CodeCacheOops; + } else { + vm_exit_during_initialization(err_msg("VerifySubSet: \'%s\' memory sub-system is unknown, please correct it", token)); + } + token = strtok(NULL, delimiter); + } + FREE_C_HEAP_ARRAY(char, subset_list); +} + +bool Universe::should_verify_subset(uint subset) { + if (verify_flags & subset) { + return true; + } + return false; +} + void Universe::verify(VerifyOption option, const char* prefix) { // The use of _verify_in_progress is a temporary work around for // 6320749. Don't bother with a creating a class to set and clear @@ -1122,33 +1173,55 @@ void Universe::verify(VerifyOption option, const char* prefix) { FormatBuffer<> title("Verifying %s", prefix); GCTraceTime(Info, gc, verify) tm(title.buffer()); - log_debug(gc, verify)("Threads"); - Threads::verify(); - log_debug(gc, verify)("Heap"); - heap()->verify(option); - log_debug(gc, verify)("SymbolTable"); - SymbolTable::verify(); - log_debug(gc, verify)("StringTable"); - StringTable::verify(); + if (should_verify_subset(Verify_Threads)) { + log_debug(gc, verify)("Threads"); + Threads::verify(); + } + if (should_verify_subset(Verify_Heap)) { + log_debug(gc, verify)("Heap"); + heap()->verify(option); + } + if (should_verify_subset(Verify_SymbolTable)) { + log_debug(gc, verify)("SymbolTable"); + SymbolTable::verify(); + } + if (should_verify_subset(Verify_StringTable)) { + log_debug(gc, verify)("StringTable"); + StringTable::verify(); + } + if (should_verify_subset(Verify_CodeCache)) { { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); log_debug(gc, verify)("CodeCache"); CodeCache::verify(); } - log_debug(gc, verify)("SystemDictionary"); - SystemDictionary::verify(); + } + if (should_verify_subset(Verify_SystemDictionary)) { + log_debug(gc, verify)("SystemDictionary"); + SystemDictionary::verify(); + } #ifndef PRODUCT - log_debug(gc, verify)("ClassLoaderDataGraph"); - ClassLoaderDataGraph::verify(); + if (should_verify_subset(Verify_ClassLoaderDataGraph)) { + log_debug(gc, verify)("ClassLoaderDataGraph"); + ClassLoaderDataGraph::verify(); + } #endif - log_debug(gc, verify)("MetaspaceAux"); - MetaspaceAux::verify_free_chunks(); - log_debug(gc, verify)("JNIHandles"); - JNIHandles::verify(); - log_debug(gc, verify)("C-heap"); - os::check_heap(); - log_debug(gc, verify)("CodeCache Oops"); - CodeCache::verify_oops(); + if (should_verify_subset(Verify_MetaspaceAux)) { + log_debug(gc, verify)("MetaspaceAux"); + MetaspaceAux::verify_free_chunks(); + } + if (should_verify_subset(Verify_JNIHandles)) { + log_debug(gc, verify)("JNIHandles"); + JNIHandles::verify(); + } + if (should_verify_subset(Verify_CHeap)) { + log_debug(gc, verify)("C-heap"); + os::check_heap(); + } + if (should_verify_subset(Verify_CodeCacheOops)) { + log_debug(gc, verify)("CodeCache Oops"); + CodeCache::verify_oops(); + } _verify_in_progress = false; } diff --git a/hotspot/src/share/vm/memory/universe.hpp b/hotspot/src/share/vm/memory/universe.hpp index e7ba90dba12..fe10e849121 100644 --- a/hotspot/src/share/vm/memory/universe.hpp +++ b/hotspot/src/share/vm/memory/universe.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -255,6 +255,7 @@ class Universe: AllStatic { // True during call to verify(). Should only be set/cleared in verify(). static bool _verify_in_progress; + static long verify_flags; static uintptr_t _verify_oop_mask; static uintptr_t _verify_oop_bits; @@ -463,6 +464,22 @@ class Universe: AllStatic { static void init_self_patching_vtbl_list(void** list, int count); // Debugging + enum VERIFY_FLAGS { + Verify_Threads = 1, + Verify_Heap = 2, + Verify_SymbolTable = 4, + Verify_StringTable = 8, + Verify_CodeCache = 16, + Verify_SystemDictionary = 32, + Verify_ClassLoaderDataGraph = 64, + Verify_MetaspaceAux = 128, + Verify_JNIHandles = 256, + Verify_CHeap = 512, + Verify_CodeCacheOops = 1024, + Verify_All = -1 + }; + static void initialize_verify_flags(); + static bool should_verify_subset(uint subset); static bool verify_in_progress() { return _verify_in_progress; } static void verify(VerifyOption option, const char* prefix); static void verify(const char* prefix) { diff --git a/hotspot/src/share/vm/oops/arrayOop.cpp b/hotspot/src/share/vm/oops/arrayOop.cpp index ee94c91f24a..cd9ffcd8529 100644 --- a/hotspot/src/share/vm/oops/arrayOop.cpp +++ b/hotspot/src/share/vm/oops/arrayOop.cpp @@ -39,21 +39,24 @@ bool arrayOopDesc::check_max_length_overflow(BasicType type) { return (julong)(size_t)bytes == bytes; } -void arrayOopDesc::test_max_array_length() { - assert(check_max_length_overflow(T_BOOLEAN), "size_t overflow for boolean array"); - assert(check_max_length_overflow(T_CHAR), "size_t overflow for char array"); - assert(check_max_length_overflow(T_FLOAT), "size_t overflow for float array"); - assert(check_max_length_overflow(T_DOUBLE), "size_t overflow for double array"); - assert(check_max_length_overflow(T_BYTE), "size_t overflow for byte array"); - assert(check_max_length_overflow(T_SHORT), "size_t overflow for short array"); - assert(check_max_length_overflow(T_INT), "size_t overflow for int array"); - assert(check_max_length_overflow(T_LONG), "size_t overflow for long array"); - assert(check_max_length_overflow(T_OBJECT), "size_t overflow for object array"); - assert(check_max_length_overflow(T_ARRAY), "size_t overflow for array array"); - assert(check_max_length_overflow(T_NARROWOOP), "size_t overflow for narrowOop array"); +static void test_max_array_length() { + assert(arrayOopDesc::check_max_length_overflow(T_BOOLEAN), "size_t overflow for boolean array"); + assert(arrayOopDesc::check_max_length_overflow(T_CHAR), "size_t overflow for char array"); + assert(arrayOopDesc::check_max_length_overflow(T_FLOAT), "size_t overflow for float array"); + assert(arrayOopDesc::check_max_length_overflow(T_DOUBLE), "size_t overflow for double array"); + assert(arrayOopDesc::check_max_length_overflow(T_BYTE), "size_t overflow for byte array"); + assert(arrayOopDesc::check_max_length_overflow(T_SHORT), "size_t overflow for short array"); + assert(arrayOopDesc::check_max_length_overflow(T_INT), "size_t overflow for int array"); + assert(arrayOopDesc::check_max_length_overflow(T_LONG), "size_t overflow for long array"); + assert(arrayOopDesc::check_max_length_overflow(T_OBJECT), "size_t overflow for object array"); + assert(arrayOopDesc::check_max_length_overflow(T_ARRAY), "size_t overflow for array array"); + assert(arrayOopDesc::check_max_length_overflow(T_NARROWOOP), "size_t overflow for narrowOop array"); // T_VOID and T_ADDRESS are not supported by max_array_length() } +void arrayOopDesc_test() { + test_max_array_length(); +} #endif //PRODUCT diff --git a/hotspot/src/share/vm/oops/arrayOop.hpp b/hotspot/src/share/vm/oops/arrayOop.hpp index 0cc8f2e448d..8e9c2af6c8a 100644 --- a/hotspot/src/share/vm/oops/arrayOop.hpp +++ b/hotspot/src/share/vm/oops/arrayOop.hpp @@ -127,8 +127,6 @@ class arrayOopDesc : public oopDesc { // for unit testing #ifndef PRODUCT static bool check_max_length_overflow(BasicType type); - static int32_t old_max_array_length(BasicType type); - static void test_max_array_length(); #endif }; diff --git a/hotspot/src/share/vm/oops/constMethod.cpp b/hotspot/src/share/vm/oops/constMethod.cpp index 5b66ab2b6c9..ae3b1ae1076 100644 --- a/hotspot/src/share/vm/oops/constMethod.cpp +++ b/hotspot/src/share/vm/oops/constMethod.cpp @@ -49,7 +49,7 @@ ConstMethod::ConstMethod(int byte_code_size, MethodType method_type, int size) { - No_Safepoint_Verifier no_safepoint; + NoSafepointVerifier no_safepoint; init_fingerprint(); set_constants(NULL); set_stackmap_data(NULL); diff --git a/hotspot/src/share/vm/oops/constantPool.cpp b/hotspot/src/share/vm/oops/constantPool.cpp index 26b5e3abe07..6d7b72c3f07 100644 --- a/hotspot/src/share/vm/oops/constantPool.cpp +++ b/hotspot/src/share/vm/oops/constantPool.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -186,6 +186,10 @@ int ConstantPool::cp_to_object_index(int cp_index) { return (i < 0) ? _no_index_sentinel : i; } +void ConstantPool::string_at_put(int which, int obj_index, oop str) { + resolved_references()->obj_at_put(obj_index, str); +} + void ConstantPool::trace_class_resolution(const constantPoolHandle& this_cp, KlassHandle k) { ResourceMark rm; int line_number = -1; diff --git a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp index f56074cf3f2..c50c8c57045 100644 --- a/hotspot/src/share/vm/oops/constantPool.hpp +++ b/hotspot/src/share/vm/oops/constantPool.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -303,9 +303,7 @@ class ConstantPool : public Metadata { *symbol_at_addr(which) = s; } - void string_at_put(int which, int obj_index, oop str) { - resolved_references()->obj_at_put(obj_index, str); - } + void string_at_put(int which, int obj_index, oop str); // For temporary use while constructing constant pool void string_index_at_put(int which, int string_index) { diff --git a/hotspot/src/share/vm/oops/cpCache.cpp b/hotspot/src/share/vm/oops/cpCache.cpp index 6066a319e8f..2adcb1c21e9 100644 --- a/hotspot/src/share/vm/oops/cpCache.cpp +++ b/hotspot/src/share/vm/oops/cpCache.cpp @@ -306,6 +306,7 @@ void ConstantPoolCacheEntry::set_method_handle_common(const constantPoolHandle& adapter->size_of_parameters()); if (TraceInvokeDynamic) { + ttyLocker ttyl; tty->print_cr("set_method_handle bc=%d appendix=" PTR_FORMAT "%s method_type=" PTR_FORMAT "%s method=" PTR_FORMAT " ", invoke_code, p2i(appendix()), (has_appendix ? "" : " (unused)"), @@ -357,6 +358,7 @@ void ConstantPoolCacheEntry::set_method_handle_common(const constantPoolHandle& set_bytecode_1(invoke_code); NOT_PRODUCT(verify(tty)); if (TraceInvokeDynamic) { + ttyLocker ttyl; this->print(tty, 0); } } diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp index d54d593594b..4c8986bdcec 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp @@ -2624,7 +2624,7 @@ nmethod* InstanceKlass::lookup_osr_nmethod(const Method* m, int bci, int comp_le bool InstanceKlass::add_member_name(Handle mem_name) { jweak mem_name_wref = JNIHandles::make_weak_global(mem_name); MutexLocker ml(MemberNameTable_lock); - DEBUG_ONLY(No_Safepoint_Verifier nsv); + DEBUG_ONLY(NoSafepointVerifier nsv); // Check if method has been redefined while taking out MemberNameTable_lock, if so // return false. We cannot cache obsolete methods. They will crash when the function diff --git a/hotspot/src/share/vm/oops/instanceRefKlass.inline.hpp b/hotspot/src/share/vm/oops/instanceRefKlass.inline.hpp index 580d99346b3..97e6d48d311 100644 --- a/hotspot/src/share/vm/oops/instanceRefKlass.inline.hpp +++ b/hotspot/src/share/vm/oops/instanceRefKlass.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -25,7 +25,7 @@ #ifndef SHARE_VM_OOPS_INSTANCEREFKLASS_INLINE_HPP #define SHARE_VM_OOPS_INSTANCEREFKLASS_INLINE_HPP -#include "classfile/javaClasses.hpp" +#include "classfile/javaClasses.inline.hpp" #include "gc/shared/referenceProcessor.hpp" #include "logging/log.hpp" #include "oops/instanceKlass.inline.hpp" diff --git a/hotspot/src/share/vm/oops/klass.cpp b/hotspot/src/share/vm/oops/klass.cpp index a9d660b8e13..313130021d5 100644 --- a/hotspot/src/share/vm/oops/klass.cpp +++ b/hotspot/src/share/vm/oops/klass.cpp @@ -44,6 +44,20 @@ #include "gc/g1/g1SATBCardTableModRefBS.hpp" #endif // INCLUDE_ALL_GCS +bool Klass::is_cloneable() const { + return _access_flags.is_cloneable_fast() || + is_subtype_of(SystemDictionary::Cloneable_klass()); +} + +void Klass::set_is_cloneable() { + if (name() != vmSymbols::java_lang_invoke_MemberName()) { + _access_flags.set_is_cloneable_fast(); + } else { + assert(is_final(), "no subclasses allowed"); + // MemberName cloning should not be intrinsified and always happen in JVM_Clone. + } +} + void Klass::set_name(Symbol* n) { _name = n; if (_name != NULL) _name->increment_refcount(); diff --git a/hotspot/src/share/vm/oops/klass.hpp b/hotspot/src/share/vm/oops/klass.hpp index 1f05ba24aaa..fbb40c16188 100644 --- a/hotspot/src/share/vm/oops/klass.hpp +++ b/hotspot/src/share/vm/oops/klass.hpp @@ -524,13 +524,14 @@ protected: bool has_final_method() const { return _access_flags.has_final_method(); } void set_has_finalizer() { _access_flags.set_has_finalizer(); } void set_has_final_method() { _access_flags.set_has_final_method(); } - bool is_cloneable() const { return _access_flags.is_cloneable(); } - void set_is_cloneable() { _access_flags.set_is_cloneable(); } bool has_vanilla_constructor() const { return _access_flags.has_vanilla_constructor(); } void set_has_vanilla_constructor() { _access_flags.set_has_vanilla_constructor(); } bool has_miranda_methods () const { return access_flags().has_miranda_methods(); } void set_has_miranda_methods() { _access_flags.set_has_miranda_methods(); } + bool is_cloneable() const; + void set_is_cloneable(); + // Biased locking support // Note: the prototype header is always set up to be at least the // prototype markOop. If biased locking is enabled it may further be diff --git a/hotspot/src/share/vm/oops/klassVtable.cpp b/hotspot/src/share/vm/oops/klassVtable.cpp index f5955c6bf28..164532185e9 100644 --- a/hotspot/src/share/vm/oops/klassVtable.cpp +++ b/hotspot/src/share/vm/oops/klassVtable.cpp @@ -26,6 +26,7 @@ #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" #include "gc/shared/gcLocker.hpp" +#include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.inline.hpp" #include "oops/instanceKlass.hpp" @@ -58,7 +59,7 @@ void klassVtable::compute_vtable_size_and_num_mirandas( Array* methods, AccessFlags class_flags, Handle classloader, Symbol* classname, Array* local_interfaces, TRAPS) { - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; // set up default result values int vtable_length = 0; @@ -134,12 +135,12 @@ int klassVtable::initialize_from_super(KlassHandle super) { superVtable->verify(tty, true); #endif superVtable->copy_vtable_to(table()); -#ifndef PRODUCT - if (PrintVtables && Verbose) { + if (develop_log_is_enabled(Trace, vtables)) { ResourceMark rm; - tty->print_cr("copy vtable from %s to %s size %d", super->internal_name(), klass()->internal_name(), _length); + log_develop_trace(vtables)("copy vtable from %s to %s size %d", + super->internal_name(), klass()->internal_name(), + _length); } -#endif return superVtable->length(); } } @@ -152,9 +153,9 @@ void klassVtable::initialize_vtable(bool checkconstraints, TRAPS) { KlassHandle super (THREAD, klass()->java_super()); int nofNewEntries = 0; - if (PrintVtables && !klass()->is_array_klass()) { + if (!klass()->is_array_klass()) { ResourceMark rm(THREAD); - tty->print_cr("Initializing: %s", _klass->name()->as_C_string()); + log_develop_debug(vtables)("Initializing: %s", _klass->name()->as_C_string()); } #ifdef ASSERT @@ -271,24 +272,19 @@ InstanceKlass* klassVtable::find_transitive_override(InstanceKlass* initialsuper assert(super_method->name() == name && super_method->signature() == signature, "vtable entry name/sig mismatch"); #endif if (supersuperklass->is_override(super_method, target_loader, target_classname, THREAD)) { -#ifndef PRODUCT - if (PrintVtables && Verbose) { + if (develop_log_is_enabled(Trace, vtables)) { ResourceMark rm(THREAD); + outputStream* logst = LogHandle(vtables)::trace_stream(); char* sig = target_method()->name_and_sig_as_C_string(); - tty->print("transitive overriding superclass %s with %s::%s index %d, original flags: ", - supersuperklass->internal_name(), - _klass->internal_name(), sig, vtable_index); - super_method->access_flags().print_on(tty); - if (super_method->is_default_method()) { - tty->print("default "); - } - tty->print("overriders flags: "); - target_method->access_flags().print_on(tty); - if (target_method->is_default_method()) { - tty->print("default "); - } + logst->print("transitive overriding superclass %s with %s::%s index %d, original flags: ", + supersuperklass->internal_name(), + _klass->internal_name(), sig, vtable_index); + super_method->print_linkage_flags(logst); + logst->print("overriders flags: "); + target_method->print_linkage_flags(logst); + logst->cr(); } -#endif /*PRODUCT*/ + break; // return found superk } } else { @@ -303,6 +299,29 @@ InstanceKlass* klassVtable::find_transitive_override(InstanceKlass* initialsuper return superk; } +static void log_vtables(int i, bool overrides, methodHandle target_method, + KlassHandle target_klass, Method* super_method, + Thread* thread) { +#ifndef PRODUCT + if (develop_log_is_enabled(Trace, vtables)) { + ResourceMark rm(thread); + outputStream* logst = LogHandle(vtables)::trace_stream(); + char* sig = target_method()->name_and_sig_as_C_string(); + if (overrides) { + logst->print("overriding with %s::%s index %d, original flags: ", + target_klass->internal_name(), sig, i); + } else { + logst->print("NOT overriding with %s::%s index %d, original flags: ", + target_klass->internal_name(), sig, i); + } + super_method->print_linkage_flags(logst); + logst->print("overriders flags: "); + target_method->print_linkage_flags(logst); + logst->cr(); + } +#endif +} + // Update child's copy of super vtable for overrides // OR return true if a new vtable entry is required. // Only called for InstanceKlass's, i.e. not for arrays @@ -396,6 +415,9 @@ bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle tar // get super_klass for method_holder for the found method InstanceKlass* super_klass = super_method->method_holder(); + // Whether the method is being overridden + bool overrides = false; + // private methods are also never overridden if (!super_method->is_private() && (is_default @@ -446,95 +468,39 @@ bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle tar THROW_MSG_(vmSymbols::java_lang_LinkageError(), buf, false); } } - } - - put_method_at(target_method(), i); - if (!is_default) { - target_method()->set_vtable_index(i); - } else { - if (def_vtable_indices != NULL) { - def_vtable_indices->at_put(default_index, i); - } - assert(super_method->is_default_method() || super_method->is_overpass() - || super_method->is_abstract(), "default override error"); - } - - -#ifndef PRODUCT - if (PrintVtables && Verbose) { - ResourceMark rm(THREAD); - char* sig = target_method()->name_and_sig_as_C_string(); - tty->print("overriding with %s::%s index %d, original flags: ", - target_klass->internal_name(), sig, i); - super_method->access_flags().print_on(tty); - if (super_method->is_default_method()) { - tty->print("default "); - } - if (super_method->is_overpass()) { - tty->print("overpass"); - } - tty->print("overriders flags: "); - target_method->access_flags().print_on(tty); - if (target_method->is_default_method()) { - tty->print("default "); - } - if (target_method->is_overpass()) { - tty->print("overpass"); - } - tty->cr(); } -#endif /*PRODUCT*/ + + put_method_at(target_method(), i); + overrides = true; + if (!is_default) { + target_method()->set_vtable_index(i); + } else { + if (def_vtable_indices != NULL) { + def_vtable_indices->at_put(default_index, i); + } + assert(super_method->is_default_method() || super_method->is_overpass() + || super_method->is_abstract(), "default override error"); + } } else { - // allocate_new = true; default. We might override one entry, - // but not override another. Once we override one, not need new -#ifndef PRODUCT - if (PrintVtables && Verbose) { - ResourceMark rm(THREAD); - char* sig = target_method()->name_and_sig_as_C_string(); - tty->print("NOT overriding with %s::%s index %d, original flags: ", - target_klass->internal_name(), sig,i); - super_method->access_flags().print_on(tty); - if (super_method->is_default_method()) { - tty->print("default "); - } - if (super_method->is_overpass()) { - tty->print("overpass"); - } - tty->print("overriders flags: "); - target_method->access_flags().print_on(tty); - if (target_method->is_default_method()) { - tty->print("default "); - } - if (target_method->is_overpass()) { - tty->print("overpass"); - } - tty->cr(); - } -#endif /*PRODUCT*/ + overrides = false; } + log_vtables(i, overrides, target_method, target_klass, super_method, THREAD); } } return allocate_new; } void klassVtable::put_method_at(Method* m, int index) { -#ifndef PRODUCT - if (PrintVtables && Verbose) { + if (develop_log_is_enabled(Trace, vtables)) { ResourceMark rm; + outputStream* logst = LogHandle(vtables)::trace_stream(); const char* sig = (m != NULL) ? m->name_and_sig_as_C_string() : ""; - tty->print("adding %s at index %d, flags: ", sig, index); + logst->print("adding %s at index %d, flags: ", sig, index); if (m != NULL) { - m->access_flags().print_on(tty); - if (m->is_default_method()) { - tty->print("default "); - } - if (m->is_overpass()) { - tty->print("overpass"); - } + m->print_linkage_flags(logst); } - tty->cr(); + logst->cr(); } -#endif table()[index].set(m); } @@ -852,18 +818,16 @@ int klassVtable::fill_in_mirandas(int initialized) { get_mirandas(&mirandas, NULL, ik()->super(), ik()->methods(), ik()->default_methods(), ik()->local_interfaces()); for (int i = 0; i < mirandas.length(); i++) { - if (PrintVtables && Verbose) { + if (develop_log_is_enabled(Trace, vtables)) { Method* meth = mirandas.at(i); ResourceMark rm(Thread::current()); + outputStream* logst = LogHandle(vtables)::trace_stream(); if (meth != NULL) { char* sig = meth->name_and_sig_as_C_string(); - tty->print("fill in mirandas with %s index %d, flags: ", - sig, initialized); - meth->access_flags().print_on(tty); - if (meth->is_default_method()) { - tty->print("default "); - } - tty->cr(); + logst->print("fill in mirandas with %s index %d, flags: ", + sig, initialized); + meth->print_linkage_flags(logst); + logst->cr(); } } put_method_at(mirandas.at(i), initialized); @@ -1036,8 +1000,8 @@ void klassItable::initialize_itable(bool checkconstraints, TRAPS) { guarantee(size_offset_table() >= 1, "too small"); int num_interfaces = size_offset_table() - 1; if (num_interfaces > 0) { - if (TraceItables) tty->print_cr("%3d: Initializing itables for %s", ++initialize_count, - _klass->name()->as_C_string()); + log_develop_debug(itables)("%3d: Initializing itables for %s", ++initialize_count, + _klass->name()->as_C_string()); // Iterate through all interfaces @@ -1069,8 +1033,8 @@ inline bool interface_method_needs_itable_index(Method* m) { int klassItable::assign_itable_indices_for_interface(Klass* klass) { // an interface does not have an itable, but its methods need to be numbered - if (TraceItables) tty->print_cr("%3d: Initializing itable indices for interface %s", ++initialize_count, - klass->name()->as_C_string()); + log_develop_debug(itables)("%3d: Initializing itable indices for interface %s", + ++initialize_count, klass->name()->as_C_string()); Array* methods = InstanceKlass::cast(klass)->methods(); int nof_methods = methods->length(); int ime_num = 0; @@ -1079,24 +1043,18 @@ int klassItable::assign_itable_indices_for_interface(Klass* klass) { if (interface_method_needs_itable_index(m)) { assert(!m->is_final_method(), "no final interface methods"); // If m is already assigned a vtable index, do not disturb it. - if (TraceItables && Verbose) { + if (develop_log_is_enabled(Trace, itables)) { ResourceMark rm; - const char* sig = (m != NULL) ? m->name_and_sig_as_C_string() : ""; + outputStream* logst = LogHandle(itables)::trace_stream(); + assert(m != NULL, "methods can never be null"); + const char* sig = m->name_and_sig_as_C_string(); if (m->has_vtable_index()) { - tty->print("vtable index %d for method: %s, flags: ", m->vtable_index(), sig); + logst->print("vtable index %d for method: %s, flags: ", m->vtable_index(), sig); } else { - tty->print("itable index %d for method: %s, flags: ", ime_num, sig); + logst->print("itable index %d for method: %s, flags: ", ime_num, sig); } - if (m != NULL) { - m->access_flags().print_on(tty); - if (m->is_default_method()) { - tty->print("default "); - } - if (m->is_overpass()) { - tty->print("overpass"); - } - } - tty->cr(); + m->print_linkage_flags(logst); + logst->cr(); } if (!m->has_vtable_index()) { assert(m->vtable_index() == Method::pending_itable_index, "set by initialize_vtable"); @@ -1200,19 +1158,17 @@ void klassItable::initialize_itable_for_interface(int method_table_offset, Klass int ime_num = m->itable_index(); assert(ime_num < ime_count, "oob"); itableOffsetEntry::method_entry(_klass(), method_table_offset)[ime_num].initialize(target()); - if (TraceItables && Verbose) { + if (develop_log_is_enabled(Trace, itables)) { ResourceMark rm(THREAD); if (target() != NULL) { + outputStream* logst = LogHandle(itables)::trace_stream(); char* sig = target()->name_and_sig_as_C_string(); - tty->print("interface: %s, ime_num: %d, target: %s, method_holder: %s ", - interf_h()->internal_name(), ime_num, sig, - target()->method_holder()->internal_name()); - tty->print("target_method flags: "); - target()->access_flags().print_on(tty); - if (target()->is_default_method()) { - tty->print("default "); - } - tty->cr(); + logst->print("interface: %s, ime_num: %d, target: %s, method_holder: %s ", + interf_h()->internal_name(), ime_num, sig, + target()->method_holder()->internal_name()); + logst->print("target_method flags: "); + target()->print_linkage_flags(logst); + logst->cr(); } } } diff --git a/hotspot/src/share/vm/oops/method.cpp b/hotspot/src/share/vm/oops/method.cpp index 015843d9c87..9db75b1966f 100644 --- a/hotspot/src/share/vm/oops/method.cpp +++ b/hotspot/src/share/vm/oops/method.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,6 +41,7 @@ #include "oops/constMethod.hpp" #include "oops/method.hpp" #include "oops/methodData.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "oops/symbol.hpp" #include "prims/jvmtiExport.hpp" @@ -77,7 +78,7 @@ Method* Method::allocate(ClassLoaderData* loader_data, } Method::Method(ConstMethod* xconst, AccessFlags access_flags) { - No_Safepoint_Verifier no_safepoint; + NoSafepointVerifier no_safepoint; set_constMethod(xconst); set_access_flags(access_flags); #ifdef CC_INTERP @@ -998,7 +999,7 @@ void Method::restore_unshareable_info(TRAPS) { // or adapter that it points to is still live and valid. // This function must not hit a safepoint! address Method::verified_code_entry() { - debug_only(No_Safepoint_Verifier nsv;) + debug_only(NoSafepointVerifier nsv;) assert(_from_compiled_entry != NULL, "must be set"); return _from_compiled_entry; } @@ -1200,8 +1201,10 @@ methodHandle Method::make_method_handle_intrinsic(vmIntrinsics::ID iid, m->set_vtable_index(Method::nonvirtual_vtable_index); m->link_method(m, CHECK_(empty)); - if (TraceMethodHandles && (Verbose || WizardMode)) + if (TraceMethodHandles && (Verbose || WizardMode)) { + ttyLocker ttyl; m->print_on(tty); + } return m; } @@ -1548,7 +1551,7 @@ void Method::sort_methods(Array* methods, bool idempotent, bool set_idn int length = methods->length(); if (length > 1) { { - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; QuickSort::sort(methods->data(), length, method_comparator, idempotent); } // Reset method ordering @@ -2207,6 +2210,15 @@ void Method::print_on(outputStream* st) const { } } +void Method::print_linkage_flags(outputStream* st) { + access_flags().print_on(st); + if (is_default_method()) { + st->print("default "); + } + if (is_overpass()) { + st->print("overpass "); + } +} #endif //PRODUCT void Method::print_value_on(outputStream* st) const { diff --git a/hotspot/src/share/vm/oops/method.hpp b/hotspot/src/share/vm/oops/method.hpp index c3c8d3f032d..8bc3b7073fc 100644 --- a/hotspot/src/share/vm/oops/method.hpp +++ b/hotspot/src/share/vm/oops/method.hpp @@ -940,6 +940,7 @@ class Method : public Metadata { void print_on(outputStream* st) const; #endif void print_value_on(outputStream* st) const; + void print_linkage_flags(outputStream* st) PRODUCT_RETURN; const char* internal_name() const { return "{method}"; } diff --git a/hotspot/src/share/vm/oops/methodData.cpp b/hotspot/src/share/vm/oops/methodData.cpp index f460028393f..5f278176275 100644 --- a/hotspot/src/share/vm/oops/methodData.cpp +++ b/hotspot/src/share/vm/oops/methodData.cpp @@ -1140,7 +1140,7 @@ MethodData::MethodData(const methodHandle& method, int size, TRAPS) } void MethodData::initialize() { - No_Safepoint_Verifier no_safepoint; // init function atomic wrt GC + NoSafepointVerifier no_safepoint; // init function atomic wrt GC ResourceMark rm; init(); diff --git a/hotspot/src/share/vm/oops/objArrayOop.hpp b/hotspot/src/share/vm/oops/objArrayOop.hpp index 189be122044..b30b1fd8007 100644 --- a/hotspot/src/share/vm/oops/objArrayOop.hpp +++ b/hotspot/src/share/vm/oops/objArrayOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -81,13 +81,7 @@ private: // Accessing oop obj_at(int index) const; - void obj_at_put(int index, oop value) { - if (UseCompressedOops) { - oop_store(obj_at_addr(index), value); - } else { - oop_store(obj_at_addr(index), value); - } - } + void /*inline*/ obj_at_put(int index, oop value); oop atomic_compare_exchange_oop(int index, oop exchange_value, oop compare_value); diff --git a/hotspot/src/share/vm/oops/objArrayOop.inline.hpp b/hotspot/src/share/vm/oops/objArrayOop.inline.hpp index 53f402023ff..5c9004de897 100644 --- a/hotspot/src/share/vm/oops/objArrayOop.inline.hpp +++ b/hotspot/src/share/vm/oops/objArrayOop.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -39,4 +39,12 @@ inline oop objArrayOopDesc::obj_at(int index) const { } } +inline void objArrayOopDesc::obj_at_put(int index, oop value) { + if (UseCompressedOops) { + oop_store(obj_at_addr(index), value); + } else { + oop_store(obj_at_addr(index), value); + } +} + #endif // SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP diff --git a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp index b7fa4c2de6e..20e25261d5b 100644 --- a/hotspot/src/share/vm/oops/oop.hpp +++ b/hotspot/src/share/vm/oops/oop.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,7 @@ #include "utilities/macros.hpp" #include "utilities/top.hpp" -// oopDesc is the top baseclass for objects classes. The {name}Desc classes describe +// oopDesc is the top baseclass for objects classes. The {name}Desc classes describe // the format of Java objects so the fields can be accessed from C++. // oopDesc is abstract. // (see oopHierarchy for complete oop class hierarchy) @@ -40,8 +40,8 @@ // no virtual functions allowed // store into oop with store check -template void oop_store(T* p, oop v); -template void oop_store(volatile T* p, oop v); +template inline void oop_store(T* p, oop v); +template inline void oop_store(volatile T* p, oop v); extern bool always_do_update_barrier; @@ -60,60 +60,60 @@ class oopDesc { friend class VMStructs; friend class JVMCIVMStructs; private: - volatile markOop _mark; + volatile markOop _mark; union _metadata { Klass* _klass; narrowKlass _compressed_klass; } _metadata; - // Fast access to barrier set. Must be initialized. + // Fast access to barrier set. Must be initialized. static BarrierSet* _bs; public: - markOop mark() const { return _mark; } - markOop* mark_addr() const { return (markOop*) &_mark; } + markOop mark() const { return _mark; } + markOop* mark_addr() const { return (markOop*) &_mark; } - void set_mark(volatile markOop m) { _mark = m; } + void set_mark(volatile markOop m) { _mark = m; } - void release_set_mark(markOop m); - markOop cas_set_mark(markOop new_mark, markOop old_mark); + inline void release_set_mark(markOop m); + inline markOop cas_set_mark(markOop new_mark, markOop old_mark); // Used only to re-initialize the mark word (e.g., of promoted // objects during a GC) -- requires a valid klass pointer - void init_mark(); + inline void init_mark(); - Klass* klass() const; - Klass* klass_or_null() const volatile; - Klass** klass_addr(); - narrowKlass* compressed_klass_addr(); + /*inline*/ Klass* klass() const; + inline Klass* klass_or_null() const volatile; + inline Klass** klass_addr(); + inline narrowKlass* compressed_klass_addr(); - void set_klass(Klass* k); + /*inline*/ void set_klass(Klass* k); // For klass field compression - int klass_gap() const; - void set_klass_gap(int z); + inline int klass_gap() const; + /*inline*/ void set_klass_gap(int z); // For when the klass pointer is being used as a linked list "next" field. - void set_klass_to_list_ptr(oop k); - oop list_ptr_from_klass(); + inline void set_klass_to_list_ptr(oop k); + inline oop list_ptr_from_klass(); // size of object header, aligned to platform wordSize - static int header_size() { return sizeof(oopDesc)/HeapWordSize; } + static int header_size() { return sizeof(oopDesc)/HeapWordSize; } // Returns whether this is an instance of k or an instance of a subclass of k - bool is_a(Klass* k) const; + inline bool is_a(Klass* k) const; // Returns the actual oop size of the object - int size(); + /*inline*/ int size(); // Sometimes (for complicated concurrency-related reasons), it is useful // to be able to figure out the size of an object knowing its klass. - int size_given_klass(Klass* klass); + inline int size_given_klass(Klass* klass); // type test operations (inlined in oop.inline.hpp) - bool is_instance() const; - bool is_array() const; - bool is_objArray() const; - bool is_typeArray() const; + inline bool is_instance() const; + /*inline*/ bool is_array() const; + inline bool is_objArray() const; + inline bool is_typeArray() const; // type test operations that don't require inclusion of oop.inline.hpp. bool is_instance_noinline() const; @@ -123,141 +123,142 @@ class oopDesc { private: // field addresses in oop - void* field_base(int offset) const; + inline void* field_base(int offset) const; - jbyte* byte_field_addr(int offset) const; - jchar* char_field_addr(int offset) const; - jboolean* bool_field_addr(int offset) const; - jint* int_field_addr(int offset) const; - jshort* short_field_addr(int offset) const; - jlong* long_field_addr(int offset) const; - jfloat* float_field_addr(int offset) const; - jdouble* double_field_addr(int offset) const; - Metadata** metadata_field_addr(int offset) const; + inline jbyte* byte_field_addr(int offset) const; + inline jchar* char_field_addr(int offset) const; + inline jboolean* bool_field_addr(int offset) const; + inline jint* int_field_addr(int offset) const; + inline jshort* short_field_addr(int offset) const; + inline jlong* long_field_addr(int offset) const; + inline jfloat* float_field_addr(int offset) const; + inline jdouble* double_field_addr(int offset) const; + inline Metadata** metadata_field_addr(int offset) const; public: // Need this as public for garbage collection. - template T* obj_field_addr(int offset) const; + template inline T* obj_field_addr(int offset) const; // Needed for javaClasses - address* address_field_addr(int offset) const; + inline address* address_field_addr(int offset) const; - static bool is_null(oop obj); - static bool is_null(narrowOop obj); + inline static bool is_null(oop obj) { return obj == NULL; } + inline static bool is_null(narrowOop obj) { return obj == 0; } // Decode an oop pointer from a narrowOop if compressed. // These are overloaded for oop and narrowOop as are the other functions // below so that they can be called in template functions. - static oop decode_heap_oop_not_null(oop v); - static oop decode_heap_oop_not_null(narrowOop v); - static oop decode_heap_oop(oop v); - static oop decode_heap_oop(narrowOop v); + static inline oop decode_heap_oop_not_null(oop v) { return v; } + static /*inline*/ oop decode_heap_oop_not_null(narrowOop v); + static inline oop decode_heap_oop(oop v) { return v; } + static /*inline*/ oop decode_heap_oop(narrowOop v); - // Encode an oop pointer to a narrow oop. The or_null versions accept + // Encode an oop pointer to a narrow oop. The or_null versions accept // null oop pointer, others do not in order to eliminate the // null checking branches. - static narrowOop encode_heap_oop_not_null(oop v); - static narrowOop encode_heap_oop(oop v); + static inline narrowOop encode_heap_oop_not_null(oop v); + static /*inline*/ narrowOop encode_heap_oop(oop v); - // Load an oop out of the Java heap - static narrowOop load_heap_oop(narrowOop* p); - static oop load_heap_oop(oop* p); + // Load an oop out of the Java heap as is without decoding. + // Called by GC to check for null before decoding. + static inline narrowOop load_heap_oop(narrowOop* p) { return *p; } + static inline oop load_heap_oop(oop* p) { return *p; } // Load an oop out of Java heap and decode it to an uncompressed oop. - static oop load_decode_heap_oop_not_null(narrowOop* p); - static oop load_decode_heap_oop_not_null(oop* p); - static oop load_decode_heap_oop(narrowOop* p); - static oop load_decode_heap_oop(oop* p); + static inline oop load_decode_heap_oop_not_null(narrowOop* p); + static inline oop load_decode_heap_oop_not_null(oop* p) { return *p; } + static inline oop load_decode_heap_oop(narrowOop* p); + static inline oop load_decode_heap_oop(oop* p) { return *p; } - // Store an oop into the heap. - static void store_heap_oop(narrowOop* p, narrowOop v); - static void store_heap_oop(oop* p, oop v); + // Store already encoded heap oop into the heap. + static inline void store_heap_oop(narrowOop* p, narrowOop v) { *p = v; } + static inline void store_heap_oop(oop* p, oop v) { *p = v; } // Encode oop if UseCompressedOops and store into the heap. - static void encode_store_heap_oop_not_null(narrowOop* p, oop v); - static void encode_store_heap_oop_not_null(oop* p, oop v); - static void encode_store_heap_oop(narrowOop* p, oop v); - static void encode_store_heap_oop(oop* p, oop v); + static inline void encode_store_heap_oop_not_null(narrowOop* p, oop v); + static inline void encode_store_heap_oop_not_null(oop* p, oop v) { *p = v; } + static inline void encode_store_heap_oop(narrowOop* p, oop v); + static inline void encode_store_heap_oop(oop* p, oop v) { *p = v; } - static void release_store_heap_oop(volatile narrowOop* p, narrowOop v); - static void release_store_heap_oop(volatile oop* p, oop v); + static inline void release_store_heap_oop(volatile narrowOop* p, narrowOop v); + static inline void release_store_heap_oop(volatile oop* p, oop v); - static void release_encode_store_heap_oop_not_null(volatile narrowOop* p, oop v); - static void release_encode_store_heap_oop_not_null(volatile oop* p, oop v); - static void release_encode_store_heap_oop(volatile narrowOop* p, oop v); - static void release_encode_store_heap_oop(volatile oop* p, oop v); + static inline void release_encode_store_heap_oop_not_null(volatile narrowOop* p, oop v); + static inline void release_encode_store_heap_oop_not_null(volatile oop* p, oop v); + static inline void release_encode_store_heap_oop(volatile narrowOop* p, oop v); + static inline void release_encode_store_heap_oop(volatile oop* p, oop v); - static oop atomic_exchange_oop(oop exchange_value, volatile HeapWord *dest); - static oop atomic_compare_exchange_oop(oop exchange_value, - volatile HeapWord *dest, - oop compare_value, - bool prebarrier = false); + static inline oop atomic_exchange_oop(oop exchange_value, volatile HeapWord *dest); + static inline oop atomic_compare_exchange_oop(oop exchange_value, + volatile HeapWord *dest, + oop compare_value, + bool prebarrier = false); // Access to fields in a instanceOop through these methods. - oop obj_field(int offset) const; - void obj_field_put(int offset, oop value); - void obj_field_put_raw(int offset, oop value); - void obj_field_put_volatile(int offset, oop value); + inline oop obj_field(int offset) const; + inline void obj_field_put(int offset, oop value); + inline void obj_field_put_raw(int offset, oop value); + inline void obj_field_put_volatile(int offset, oop value); - Metadata* metadata_field(int offset) const; - void metadata_field_put(int offset, Metadata* value); + inline Metadata* metadata_field(int offset) const; + inline void metadata_field_put(int offset, Metadata* value); - jbyte byte_field(int offset) const; - void byte_field_put(int offset, jbyte contents); + inline jbyte byte_field(int offset) const; + inline void byte_field_put(int offset, jbyte contents); - jchar char_field(int offset) const; - void char_field_put(int offset, jchar contents); + inline jchar char_field(int offset) const; + inline void char_field_put(int offset, jchar contents); - jboolean bool_field(int offset) const; - void bool_field_put(int offset, jboolean contents); + inline jboolean bool_field(int offset) const; + inline void bool_field_put(int offset, jboolean contents); - jint int_field(int offset) const; - void int_field_put(int offset, jint contents); + inline jint int_field(int offset) const; + inline void int_field_put(int offset, jint contents); - jshort short_field(int offset) const; - void short_field_put(int offset, jshort contents); + inline jshort short_field(int offset) const; + inline void short_field_put(int offset, jshort contents); - jlong long_field(int offset) const; - void long_field_put(int offset, jlong contents); + inline jlong long_field(int offset) const; + inline void long_field_put(int offset, jlong contents); - jfloat float_field(int offset) const; - void float_field_put(int offset, jfloat contents); + inline jfloat float_field(int offset) const; + inline void float_field_put(int offset, jfloat contents); - jdouble double_field(int offset) const; - void double_field_put(int offset, jdouble contents); + inline jdouble double_field(int offset) const; + inline void double_field_put(int offset, jdouble contents); - address address_field(int offset) const; - void address_field_put(int offset, address contents); + inline address address_field(int offset) const; + inline void address_field_put(int offset, address contents); - oop obj_field_acquire(int offset) const; - void release_obj_field_put(int offset, oop value); + inline oop obj_field_acquire(int offset) const; + inline void release_obj_field_put(int offset, oop value); - jbyte byte_field_acquire(int offset) const; - void release_byte_field_put(int offset, jbyte contents); + inline jbyte byte_field_acquire(int offset) const; + inline void release_byte_field_put(int offset, jbyte contents); - jchar char_field_acquire(int offset) const; - void release_char_field_put(int offset, jchar contents); + inline jchar char_field_acquire(int offset) const; + inline void release_char_field_put(int offset, jchar contents); - jboolean bool_field_acquire(int offset) const; - void release_bool_field_put(int offset, jboolean contents); + inline jboolean bool_field_acquire(int offset) const; + inline void release_bool_field_put(int offset, jboolean contents); - jint int_field_acquire(int offset) const; - void release_int_field_put(int offset, jint contents); + inline jint int_field_acquire(int offset) const; + inline void release_int_field_put(int offset, jint contents); - jshort short_field_acquire(int offset) const; - void release_short_field_put(int offset, jshort contents); + inline jshort short_field_acquire(int offset) const; + inline void release_short_field_put(int offset, jshort contents); - jlong long_field_acquire(int offset) const; - void release_long_field_put(int offset, jlong contents); + inline jlong long_field_acquire(int offset) const; + inline void release_long_field_put(int offset, jlong contents); - jfloat float_field_acquire(int offset) const; - void release_float_field_put(int offset, jfloat contents); + inline jfloat float_field_acquire(int offset) const; + inline void release_float_field_put(int offset, jfloat contents); - jdouble double_field_acquire(int offset) const; - void release_double_field_put(int offset, jdouble contents); + inline jdouble double_field_acquire(int offset) const; + inline void release_double_field_put(int offset, jdouble contents); - address address_field_acquire(int offset) const; - void release_address_field_put(int offset, address contents); + inline address address_field_acquire(int offset) const; + inline void release_address_field_put(int offset, address contents); // printing functions for VM debugging void print_on(outputStream* st) const; // First level print @@ -278,42 +279,41 @@ class oopDesc { void verify(); // locking operations - bool is_locked() const; - bool is_unlocked() const; - bool has_bias_pattern() const; + inline bool is_locked() const; + inline bool is_unlocked() const; + inline bool has_bias_pattern() const; // asserts - bool is_oop(bool ignore_mark_word = false) const; - bool is_oop_or_null(bool ignore_mark_word = false) const; + /*inline*/ bool is_oop(bool ignore_mark_word = false) const; + /*inline*/ bool is_oop_or_null(bool ignore_mark_word = false) const; #ifndef PRODUCT - bool is_unlocked_oop() const; + inline bool is_unlocked_oop() const; #endif // garbage collection - bool is_gc_marked() const; + inline bool is_gc_marked() const; - bool is_scavengable() const; + inline bool is_scavengable() const; // Forward pointer operations for scavenge - bool is_forwarded() const; + inline bool is_forwarded() const; - void forward_to(oop p); - bool cas_forward_to(oop p, markOop compare); + inline void forward_to(oop p); + inline bool cas_forward_to(oop p, markOop compare); #if INCLUDE_ALL_GCS // Like "forward_to", but inserts the forwarding pointer atomically. // Exactly one thread succeeds in inserting the forwarding pointer, and // this call returns "NULL" for that thread; any other thread has the // value of the forwarding pointer returned and does not modify "this". - oop forward_to_atomic(oop p); + inline oop forward_to_atomic(oop p); #endif // INCLUDE_ALL_GCS - oop forwardee() const; + inline oop forwardee() const; // Age of object during scavenge - uint age() const; - void incr_age(); - + /*inline*/ uint age() const; + inline void incr_age(); // mark-sweep support void follow_body(int begin, int end); @@ -326,28 +326,28 @@ class oopDesc { // Mark Sweep // Adjust all pointers in this object to point at it's forwarded location and - // return the size of this oop. This is used by the MarkSweep collector. - int ms_adjust_pointers(); + // return the size of this oop. This is used by the MarkSweep collector. + inline int ms_adjust_pointers(); #if INCLUDE_ALL_GCS // Parallel Compact - void pc_follow_contents(ParCompactionManager* pc); - void pc_update_contents(); + inline void pc_follow_contents(ParCompactionManager* pc); + inline void pc_update_contents(); // Parallel Scavenge - void ps_push_contents(PSPromotionManager* pm); + inline void ps_push_contents(PSPromotionManager* pm); #endif // iterators, returns size of object #define OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ - void oop_iterate(OopClosureType* blk); \ - void oop_iterate(OopClosureType* blk, MemRegion mr); // Only in mr. + inline void oop_iterate(OopClosureType* blk); \ + inline void oop_iterate(OopClosureType* blk, MemRegion mr); // Only in mr. ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_DECL) -#define OOP_ITERATE_SIZE_DECL(OopClosureType, nv_suffix) \ - int oop_iterate_size(OopClosureType* blk); \ - int oop_iterate_size(OopClosureType* blk, MemRegion mr); // Only in mr. +#define OOP_ITERATE_SIZE_DECL(OopClosureType, nv_suffix) \ + inline int oop_iterate_size(OopClosureType* blk); \ + inline int oop_iterate_size(OopClosureType* blk, MemRegion mr); // Only in mr. ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_SIZE_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_SIZE_DECL) @@ -356,28 +356,29 @@ class oopDesc { #if INCLUDE_ALL_GCS #define OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \ - void oop_iterate_backwards(OopClosureType* blk); + inline void oop_iterate_backwards(OopClosureType* blk); ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_BACKWARDS_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_BACKWARDS_DECL) -#endif - int oop_iterate_no_header(OopClosure* bk); - int oop_iterate_no_header(OopClosure* bk, MemRegion mr); +#endif // INCLUDE_ALL_GCS + + inline int oop_iterate_no_header(OopClosure* bk); + inline int oop_iterate_no_header(OopClosure* bk, MemRegion mr); // identity hash; returns the identity hash key (computes it if necessary) // NOTE with the introduction of UseBiasedLocking that identity_hash() might reach a // safepoint if called on a biased object. Calling code must be aware of that. - intptr_t identity_hash(); + inline intptr_t identity_hash(); intptr_t slow_identity_hash(); // Alternate hashing code if string table is rehashed unsigned int new_hash(juint seed); // marks are forwarded to stack when object is locked - bool has_displaced_mark() const; - markOop displaced_mark() const; - void set_displaced_mark(markOop m); + inline bool has_displaced_mark() const; + inline markOop displaced_mark() const; + inline void set_displaced_mark(markOop m); static bool has_klass_gap(); diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp index bc480f49dea..32b87fa1edd 100644 --- a/hotspot/src/share/vm/oops/oop.inline.hpp +++ b/hotspot/src/share/vm/oops/oop.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,17 +41,65 @@ #include "runtime/os.hpp" #include "utilities/macros.hpp" +inline void update_barrier_set(void* p, oop v, bool release = false) { + assert(oopDesc::bs() != NULL, "Uninitialized bs in oop!"); + oopDesc::bs()->write_ref_field(p, v, release); +} + +template inline void update_barrier_set_pre(T* p, oop v) { + oopDesc::bs()->write_ref_field_pre(p, v); +} + +template void oop_store(T* p, oop v) { + if (always_do_update_barrier) { + oop_store((volatile T*)p, v); + } else { + update_barrier_set_pre(p, v); + oopDesc::encode_store_heap_oop(p, v); + // always_do_update_barrier == false => + // Either we are at a safepoint (in GC) or CMS is not used. In both + // cases it's unnecessary to mark the card as dirty with release sematics. + update_barrier_set((void*)p, v, false /* release */); // cast away type + } +} + +template void oop_store(volatile T* p, oop v) { + update_barrier_set_pre((T*)p, v); // cast away volatile + // Used by release_obj_field_put, so use release_store_ptr. + oopDesc::release_encode_store_heap_oop(p, v); + // When using CMS we must mark the card corresponding to p as dirty + // with release sematics to prevent that CMS sees the dirty card but + // not the new value v at p due to reordering of the two + // stores. Note that CMS has a concurrent precleaning phase, where + // it reads the card table while the Java threads are running. + update_barrier_set((void*)p, v, true /* release */); // cast away type +} + +// Should replace *addr = oop assignments where addr type depends on UseCompressedOops +// (without having to remember the function name this calls). +inline void oop_store_raw(HeapWord* addr, oop value) { + if (UseCompressedOops) { + oopDesc::encode_store_heap_oop((narrowOop*)addr, value); + } else { + oopDesc::encode_store_heap_oop((oop*)addr, value); + } +} + // Implementation of all inlined member functions defined in oop.hpp // We need a separate file to avoid circular references -inline void oopDesc::release_set_mark(markOop m) { +void oopDesc::release_set_mark(markOop m) { OrderAccess::release_store_ptr(&_mark, m); } -inline markOop oopDesc::cas_set_mark(markOop new_mark, markOop old_mark) { +markOop oopDesc::cas_set_mark(markOop new_mark, markOop old_mark) { return (markOop) Atomic::cmpxchg_ptr(new_mark, &_mark, old_mark); } +void oopDesc::init_mark() { + set_mark(markOopDesc::prototype_for_object(this)); +} + inline Klass* oopDesc::klass() const { if (UseCompressedClassPointers) { return Klass::decode_klass_not_null(_metadata._compressed_klass); @@ -60,7 +108,7 @@ inline Klass* oopDesc::klass() const { } } -inline Klass* oopDesc::klass_or_null() const volatile { +Klass* oopDesc::klass_or_null() const volatile { // can be NULL in CMS if (UseCompressedClassPointers) { return Klass::decode_klass(_metadata._compressed_klass); @@ -69,14 +117,14 @@ inline Klass* oopDesc::klass_or_null() const volatile { } } -inline Klass** oopDesc::klass_addr() { +Klass** oopDesc::klass_addr() { // Only used internally and with CMS and will not work with // UseCompressedOops assert(!UseCompressedClassPointers, "only supported with uncompressed klass pointers"); return (Klass**) &_metadata._klass; } -inline narrowKlass* oopDesc::compressed_klass_addr() { +narrowKlass* oopDesc::compressed_klass_addr() { assert(UseCompressedClassPointers, "only called by compressed klass pointers"); return &_metadata._compressed_klass; } @@ -92,7 +140,7 @@ inline void oopDesc::set_klass(Klass* k) { } } -inline int oopDesc::klass_gap() const { +int oopDesc::klass_gap() const { return *(int*)(((intptr_t)this) + klass_gap_offset_in_bytes()); } @@ -102,7 +150,7 @@ inline void oopDesc::set_klass_gap(int v) { } } -inline void oopDesc::set_klass_to_list_ptr(oop k) { +void oopDesc::set_klass_to_list_ptr(oop k) { // This is only to be used during GC, for from-space objects, so no // barrier is needed. if (UseCompressedClassPointers) { @@ -112,7 +160,7 @@ inline void oopDesc::set_klass_to_list_ptr(oop k) { } } -inline oop oopDesc::list_ptr_from_klass() { +oop oopDesc::list_ptr_from_klass() { // This is only to be used during GC, for from-space objects. if (UseCompressedClassPointers) { return decode_heap_oop((narrowOop)_metadata._compressed_klass); @@ -122,261 +170,15 @@ inline oop oopDesc::list_ptr_from_klass() { } } -inline void oopDesc::init_mark() { set_mark(markOopDesc::prototype_for_object(this)); } - -inline bool oopDesc::is_a(Klass* k) const { return klass()->is_subtype_of(k); } - -inline bool oopDesc::is_instance() const { - return klass()->is_instance_klass(); +bool oopDesc::is_a(Klass* k) const { + return klass()->is_subtype_of(k); } -inline bool oopDesc::is_array() const { return klass()->is_array_klass(); } -inline bool oopDesc::is_objArray() const { return klass()->is_objArray_klass(); } -inline bool oopDesc::is_typeArray() const { return klass()->is_typeArray_klass(); } - -inline void* oopDesc::field_base(int offset) const { return (void*)&((char*)this)[offset]; } - -template inline T* oopDesc::obj_field_addr(int offset) const { return (T*)field_base(offset); } -inline Metadata** oopDesc::metadata_field_addr(int offset) const { return (Metadata**)field_base(offset); } -inline jbyte* oopDesc::byte_field_addr(int offset) const { return (jbyte*) field_base(offset); } -inline jchar* oopDesc::char_field_addr(int offset) const { return (jchar*) field_base(offset); } -inline jboolean* oopDesc::bool_field_addr(int offset) const { return (jboolean*)field_base(offset); } -inline jint* oopDesc::int_field_addr(int offset) const { return (jint*) field_base(offset); } -inline jshort* oopDesc::short_field_addr(int offset) const { return (jshort*) field_base(offset); } -inline jlong* oopDesc::long_field_addr(int offset) const { return (jlong*) field_base(offset); } -inline jfloat* oopDesc::float_field_addr(int offset) const { return (jfloat*) field_base(offset); } -inline jdouble* oopDesc::double_field_addr(int offset) const { return (jdouble*) field_base(offset); } -inline address* oopDesc::address_field_addr(int offset) const { return (address*) field_base(offset); } - - -// Functions for getting and setting oops within instance objects. -// If the oops are compressed, the type passed to these overloaded functions -// is narrowOop. All functions are overloaded so they can be called by -// template functions without conditionals (the compiler instantiates via -// the right type and inlines the appopriate code). - -inline bool oopDesc::is_null(oop obj) { return obj == NULL; } -inline bool oopDesc::is_null(narrowOop obj) { return obj == 0; } - -// Algorithm for encoding and decoding oops from 64 bit pointers to 32 bit -// offset from the heap base. Saving the check for null can save instructions -// in inner GC loops so these are separated. - -inline bool check_obj_alignment(oop obj) { - return cast_from_oop(obj) % MinObjAlignmentInBytes == 0; +inline int oopDesc::size() { + return size_given_klass(klass()); } -inline narrowOop oopDesc::encode_heap_oop_not_null(oop v) { - assert(!is_null(v), "oop value can never be zero"); - assert(check_obj_alignment(v), "Address not aligned"); - assert(Universe::heap()->is_in_reserved(v), "Address not in heap"); - address base = Universe::narrow_oop_base(); - int shift = Universe::narrow_oop_shift(); - uint64_t pd = (uint64_t)(pointer_delta((void*)v, (void*)base, 1)); - assert(OopEncodingHeapMax > pd, "change encoding max if new encoding"); - uint64_t result = pd >> shift; - assert((result & CONST64(0xffffffff00000000)) == 0, "narrow oop overflow"); - assert(decode_heap_oop(result) == v, "reversibility"); - return (narrowOop)result; -} - -inline narrowOop oopDesc::encode_heap_oop(oop v) { - return (is_null(v)) ? (narrowOop)0 : encode_heap_oop_not_null(v); -} - -inline oop oopDesc::decode_heap_oop_not_null(narrowOop v) { - assert(!is_null(v), "narrow oop value can never be zero"); - address base = Universe::narrow_oop_base(); - int shift = Universe::narrow_oop_shift(); - oop result = (oop)(void*)((uintptr_t)base + ((uintptr_t)v << shift)); - assert(check_obj_alignment(result), "address not aligned: " INTPTR_FORMAT, p2i((void*) result)); - return result; -} - -inline oop oopDesc::decode_heap_oop(narrowOop v) { - return is_null(v) ? (oop)NULL : decode_heap_oop_not_null(v); -} - -inline oop oopDesc::decode_heap_oop_not_null(oop v) { return v; } -inline oop oopDesc::decode_heap_oop(oop v) { return v; } - -// Load an oop out of the Java heap as is without decoding. -// Called by GC to check for null before decoding. -inline oop oopDesc::load_heap_oop(oop* p) { return *p; } -inline narrowOop oopDesc::load_heap_oop(narrowOop* p) { return *p; } - -// Load and decode an oop out of the Java heap into a wide oop. -inline oop oopDesc::load_decode_heap_oop_not_null(oop* p) { return *p; } -inline oop oopDesc::load_decode_heap_oop_not_null(narrowOop* p) { - return decode_heap_oop_not_null(*p); -} - -// Load and decode an oop out of the heap accepting null -inline oop oopDesc::load_decode_heap_oop(oop* p) { return *p; } -inline oop oopDesc::load_decode_heap_oop(narrowOop* p) { - return decode_heap_oop(*p); -} - -// Store already encoded heap oop into the heap. -inline void oopDesc::store_heap_oop(oop* p, oop v) { *p = v; } -inline void oopDesc::store_heap_oop(narrowOop* p, narrowOop v) { *p = v; } - -// Encode and store a heap oop. -inline void oopDesc::encode_store_heap_oop_not_null(narrowOop* p, oop v) { - *p = encode_heap_oop_not_null(v); -} -inline void oopDesc::encode_store_heap_oop_not_null(oop* p, oop v) { *p = v; } - -// Encode and store a heap oop allowing for null. -inline void oopDesc::encode_store_heap_oop(narrowOop* p, oop v) { - *p = encode_heap_oop(v); -} -inline void oopDesc::encode_store_heap_oop(oop* p, oop v) { *p = v; } - -// Store heap oop as is for volatile fields. -inline void oopDesc::release_store_heap_oop(volatile oop* p, oop v) { - OrderAccess::release_store_ptr(p, v); -} -inline void oopDesc::release_store_heap_oop(volatile narrowOop* p, - narrowOop v) { - OrderAccess::release_store(p, v); -} - -inline void oopDesc::release_encode_store_heap_oop_not_null( - volatile narrowOop* p, oop v) { - // heap oop is not pointer sized. - OrderAccess::release_store(p, encode_heap_oop_not_null(v)); -} - -inline void oopDesc::release_encode_store_heap_oop_not_null( - volatile oop* p, oop v) { - OrderAccess::release_store_ptr(p, v); -} - -inline void oopDesc::release_encode_store_heap_oop(volatile oop* p, - oop v) { - OrderAccess::release_store_ptr(p, v); -} -inline void oopDesc::release_encode_store_heap_oop( - volatile narrowOop* p, oop v) { - OrderAccess::release_store(p, encode_heap_oop(v)); -} - - -// These functions are only used to exchange oop fields in instances, -// not headers. -inline oop oopDesc::atomic_exchange_oop(oop exchange_value, volatile HeapWord *dest) { - if (UseCompressedOops) { - // encode exchange value from oop to T - narrowOop val = encode_heap_oop(exchange_value); - narrowOop old = (narrowOop)Atomic::xchg(val, (narrowOop*)dest); - // decode old from T to oop - return decode_heap_oop(old); - } else { - return (oop)Atomic::xchg_ptr(exchange_value, (oop*)dest); - } -} - -// In order to put or get a field out of an instance, must first check -// if the field has been compressed and uncompress it. -inline oop oopDesc::obj_field(int offset) const { - return UseCompressedOops ? - load_decode_heap_oop(obj_field_addr(offset)) : - load_decode_heap_oop(obj_field_addr(offset)); -} - -inline void oopDesc::obj_field_put(int offset, oop value) { - UseCompressedOops ? oop_store(obj_field_addr(offset), value) : - oop_store(obj_field_addr(offset), value); -} - -inline Metadata* oopDesc::metadata_field(int offset) const { - return *metadata_field_addr(offset); -} - -inline void oopDesc::metadata_field_put(int offset, Metadata* value) { - *metadata_field_addr(offset) = value; -} - -inline void oopDesc::obj_field_put_raw(int offset, oop value) { - UseCompressedOops ? - encode_store_heap_oop(obj_field_addr(offset), value) : - encode_store_heap_oop(obj_field_addr(offset), value); -} -inline void oopDesc::obj_field_put_volatile(int offset, oop value) { - OrderAccess::release(); - obj_field_put(offset, value); - OrderAccess::fence(); -} - -inline jbyte oopDesc::byte_field(int offset) const { return (jbyte) *byte_field_addr(offset); } -inline void oopDesc::byte_field_put(int offset, jbyte contents) { *byte_field_addr(offset) = (jint) contents; } - -inline jboolean oopDesc::bool_field(int offset) const { return (jboolean) *bool_field_addr(offset); } -inline void oopDesc::bool_field_put(int offset, jboolean contents) { *bool_field_addr(offset) = (jint) contents; } - -inline jchar oopDesc::char_field(int offset) const { return (jchar) *char_field_addr(offset); } -inline void oopDesc::char_field_put(int offset, jchar contents) { *char_field_addr(offset) = (jint) contents; } - -inline jint oopDesc::int_field(int offset) const { return *int_field_addr(offset); } -inline void oopDesc::int_field_put(int offset, jint contents) { *int_field_addr(offset) = contents; } - -inline jshort oopDesc::short_field(int offset) const { return (jshort) *short_field_addr(offset); } -inline void oopDesc::short_field_put(int offset, jshort contents) { *short_field_addr(offset) = (jint) contents;} - -inline jlong oopDesc::long_field(int offset) const { return *long_field_addr(offset); } -inline void oopDesc::long_field_put(int offset, jlong contents) { *long_field_addr(offset) = contents; } - -inline jfloat oopDesc::float_field(int offset) const { return *float_field_addr(offset); } -inline void oopDesc::float_field_put(int offset, jfloat contents) { *float_field_addr(offset) = contents; } - -inline jdouble oopDesc::double_field(int offset) const { return *double_field_addr(offset); } -inline void oopDesc::double_field_put(int offset, jdouble contents) { *double_field_addr(offset) = contents; } - -inline address oopDesc::address_field(int offset) const { return *address_field_addr(offset); } -inline void oopDesc::address_field_put(int offset, address contents) { *address_field_addr(offset) = contents; } - -inline oop oopDesc::obj_field_acquire(int offset) const { - return UseCompressedOops ? - decode_heap_oop((narrowOop) - OrderAccess::load_acquire(obj_field_addr(offset))) - : decode_heap_oop((oop) - OrderAccess::load_ptr_acquire(obj_field_addr(offset))); -} -inline void oopDesc::release_obj_field_put(int offset, oop value) { - UseCompressedOops ? - oop_store((volatile narrowOop*)obj_field_addr(offset), value) : - oop_store((volatile oop*) obj_field_addr(offset), value); -} - -inline jbyte oopDesc::byte_field_acquire(int offset) const { return OrderAccess::load_acquire(byte_field_addr(offset)); } -inline void oopDesc::release_byte_field_put(int offset, jbyte contents) { OrderAccess::release_store(byte_field_addr(offset), contents); } - -inline jboolean oopDesc::bool_field_acquire(int offset) const { return OrderAccess::load_acquire(bool_field_addr(offset)); } -inline void oopDesc::release_bool_field_put(int offset, jboolean contents) { OrderAccess::release_store(bool_field_addr(offset), contents); } - -inline jchar oopDesc::char_field_acquire(int offset) const { return OrderAccess::load_acquire(char_field_addr(offset)); } -inline void oopDesc::release_char_field_put(int offset, jchar contents) { OrderAccess::release_store(char_field_addr(offset), contents); } - -inline jint oopDesc::int_field_acquire(int offset) const { return OrderAccess::load_acquire(int_field_addr(offset)); } -inline void oopDesc::release_int_field_put(int offset, jint contents) { OrderAccess::release_store(int_field_addr(offset), contents); } - -inline jshort oopDesc::short_field_acquire(int offset) const { return (jshort)OrderAccess::load_acquire(short_field_addr(offset)); } -inline void oopDesc::release_short_field_put(int offset, jshort contents) { OrderAccess::release_store(short_field_addr(offset), contents); } - -inline jlong oopDesc::long_field_acquire(int offset) const { return OrderAccess::load_acquire(long_field_addr(offset)); } -inline void oopDesc::release_long_field_put(int offset, jlong contents) { OrderAccess::release_store(long_field_addr(offset), contents); } - -inline jfloat oopDesc::float_field_acquire(int offset) const { return OrderAccess::load_acquire(float_field_addr(offset)); } -inline void oopDesc::release_float_field_put(int offset, jfloat contents) { OrderAccess::release_store(float_field_addr(offset), contents); } - -inline jdouble oopDesc::double_field_acquire(int offset) const { return OrderAccess::load_acquire(double_field_addr(offset)); } -inline void oopDesc::release_double_field_put(int offset, jdouble contents) { OrderAccess::release_store(double_field_addr(offset), contents); } - -inline address oopDesc::address_field_acquire(int offset) const { return (address) OrderAccess::load_ptr_acquire(address_field_addr(offset)); } -inline void oopDesc::release_address_field_put(int offset, address contents) { OrderAccess::release_store_ptr(address_field_addr(offset), contents); } - -inline int oopDesc::size_given_klass(Klass* klass) { +int oopDesc::size_given_klass(Klass* klass) { int lh = klass->layout_helper(); int s; @@ -461,59 +263,133 @@ inline int oopDesc::size_given_klass(Klass* klass) { return s; } +bool oopDesc::is_instance() const { return klass()->is_instance_klass(); } +inline bool oopDesc::is_array() const { return klass()->is_array_klass(); } +bool oopDesc::is_objArray() const { return klass()->is_objArray_klass(); } +bool oopDesc::is_typeArray() const { return klass()->is_typeArray_klass(); } -inline int oopDesc::size() { - return size_given_klass(klass()); +void* oopDesc::field_base(int offset) const { return (void*)&((char*)this)[offset]; } + +jbyte* oopDesc::byte_field_addr(int offset) const { return (jbyte*) field_base(offset); } +jchar* oopDesc::char_field_addr(int offset) const { return (jchar*) field_base(offset); } +jboolean* oopDesc::bool_field_addr(int offset) const { return (jboolean*) field_base(offset); } +jint* oopDesc::int_field_addr(int offset) const { return (jint*) field_base(offset); } +jshort* oopDesc::short_field_addr(int offset) const { return (jshort*) field_base(offset); } +jlong* oopDesc::long_field_addr(int offset) const { return (jlong*) field_base(offset); } +jfloat* oopDesc::float_field_addr(int offset) const { return (jfloat*) field_base(offset); } +jdouble* oopDesc::double_field_addr(int offset) const { return (jdouble*) field_base(offset); } +Metadata** oopDesc::metadata_field_addr(int offset) const { return (Metadata**)field_base(offset); } + +template T* oopDesc::obj_field_addr(int offset) const { return (T*) field_base(offset); } +address* oopDesc::address_field_addr(int offset) const { return (address*) field_base(offset); } + + +// Functions for getting and setting oops within instance objects. +// If the oops are compressed, the type passed to these overloaded functions +// is narrowOop. All functions are overloaded so they can be called by +// template functions without conditionals (the compiler instantiates via +// the right type and inlines the appopriate code). + +// Algorithm for encoding and decoding oops from 64 bit pointers to 32 bit +// offset from the heap base. Saving the check for null can save instructions +// in inner GC loops so these are separated. + +inline bool check_obj_alignment(oop obj) { + return cast_from_oop(obj) % MinObjAlignmentInBytes == 0; } -inline void update_barrier_set(void* p, oop v, bool release = false) { - assert(oopDesc::bs() != NULL, "Uninitialized bs in oop!"); - oopDesc::bs()->write_ref_field(p, v, release); +inline oop oopDesc::decode_heap_oop_not_null(narrowOop v) { + assert(!is_null(v), "narrow oop value can never be zero"); + address base = Universe::narrow_oop_base(); + int shift = Universe::narrow_oop_shift(); + oop result = (oop)(void*)((uintptr_t)base + ((uintptr_t)v << shift)); + assert(check_obj_alignment(result), "address not aligned: " INTPTR_FORMAT, p2i((void*) result)); + return result; } -template inline void update_barrier_set_pre(T* p, oop v) { - oopDesc::bs()->write_ref_field_pre(p, v); +inline oop oopDesc::decode_heap_oop(narrowOop v) { + return is_null(v) ? (oop)NULL : decode_heap_oop_not_null(v); } -template inline void oop_store(T* p, oop v) { - if (always_do_update_barrier) { - oop_store((volatile T*)p, v); - } else { - update_barrier_set_pre(p, v); - oopDesc::encode_store_heap_oop(p, v); - // always_do_update_barrier == false => - // Either we are at a safepoint (in GC) or CMS is not used. In both - // cases it's unnecessary to mark the card as dirty with release sematics. - update_barrier_set((void*)p, v, false /* release */); // cast away type - } +narrowOop oopDesc::encode_heap_oop_not_null(oop v) { + assert(!is_null(v), "oop value can never be zero"); + assert(check_obj_alignment(v), "Address not aligned"); + assert(Universe::heap()->is_in_reserved(v), "Address not in heap"); + address base = Universe::narrow_oop_base(); + int shift = Universe::narrow_oop_shift(); + uint64_t pd = (uint64_t)(pointer_delta((void*)v, (void*)base, 1)); + assert(OopEncodingHeapMax > pd, "change encoding max if new encoding"); + uint64_t result = pd >> shift; + assert((result & CONST64(0xffffffff00000000)) == 0, "narrow oop overflow"); + assert(decode_heap_oop(result) == v, "reversibility"); + return (narrowOop)result; } -template inline void oop_store(volatile T* p, oop v) { - update_barrier_set_pre((T*)p, v); // cast away volatile - // Used by release_obj_field_put, so use release_store_ptr. - oopDesc::release_encode_store_heap_oop(p, v); - // When using CMS we must mark the card corresponding to p as dirty - // with release sematics to prevent that CMS sees the dirty card but - // not the new value v at p due to reordering of the two - // stores. Note that CMS has a concurrent precleaning phase, where - // it reads the card table while the Java threads are running. - update_barrier_set((void*)p, v, true /* release */); // cast away type +inline narrowOop oopDesc::encode_heap_oop(oop v) { + return (is_null(v)) ? (narrowOop)0 : encode_heap_oop_not_null(v); } -// Should replace *addr = oop assignments where addr type depends on UseCompressedOops -// (without having to remember the function name this calls). -inline void oop_store_raw(HeapWord* addr, oop value) { +// Load and decode an oop out of the Java heap into a wide oop. +oop oopDesc::load_decode_heap_oop_not_null(narrowOop* p) { + return decode_heap_oop_not_null(*p); +} + +// Load and decode an oop out of the heap accepting null +oop oopDesc::load_decode_heap_oop(narrowOop* p) { + return decode_heap_oop(*p); +} + +// Encode and store a heap oop. +void oopDesc::encode_store_heap_oop_not_null(narrowOop* p, oop v) { + *p = encode_heap_oop_not_null(v); +} + +// Encode and store a heap oop allowing for null. +void oopDesc::encode_store_heap_oop(narrowOop* p, oop v) { + *p = encode_heap_oop(v); +} + +// Store heap oop as is for volatile fields. +void oopDesc::release_store_heap_oop(volatile oop* p, oop v) { + OrderAccess::release_store_ptr(p, v); +} +void oopDesc::release_store_heap_oop(volatile narrowOop* p, narrowOop v) { + OrderAccess::release_store(p, v); +} + +void oopDesc::release_encode_store_heap_oop_not_null(volatile narrowOop* p, oop v) { + // heap oop is not pointer sized. + OrderAccess::release_store(p, encode_heap_oop_not_null(v)); +} +void oopDesc::release_encode_store_heap_oop_not_null(volatile oop* p, oop v) { + OrderAccess::release_store_ptr(p, v); +} + +void oopDesc::release_encode_store_heap_oop(volatile oop* p, oop v) { + OrderAccess::release_store_ptr(p, v); +} +void oopDesc::release_encode_store_heap_oop(volatile narrowOop* p, oop v) { + OrderAccess::release_store(p, encode_heap_oop(v)); +} + +// These functions are only used to exchange oop fields in instances, +// not headers. +oop oopDesc::atomic_exchange_oop(oop exchange_value, volatile HeapWord *dest) { if (UseCompressedOops) { - oopDesc::encode_store_heap_oop((narrowOop*)addr, value); + // encode exchange value from oop to T + narrowOop val = encode_heap_oop(exchange_value); + narrowOop old = (narrowOop)Atomic::xchg(val, (narrowOop*)dest); + // decode old from T to oop + return decode_heap_oop(old); } else { - oopDesc::encode_store_heap_oop((oop*)addr, value); + return (oop)Atomic::xchg_ptr(exchange_value, (oop*)dest); } } -inline oop oopDesc::atomic_compare_exchange_oop(oop exchange_value, - volatile HeapWord *dest, - oop compare_value, - bool prebarrier) { +oop oopDesc::atomic_compare_exchange_oop(oop exchange_value, + volatile HeapWord *dest, + oop compare_value, + bool prebarrier) { if (UseCompressedOops) { if (prebarrier) { update_barrier_set_pre((narrowOop*)dest, exchange_value); @@ -533,24 +409,112 @@ inline oop oopDesc::atomic_compare_exchange_oop(oop exchange_value, } } -// Used only for markSweep, scavenging -inline bool oopDesc::is_gc_marked() const { - return mark()->is_marked(); +// In order to put or get a field out of an instance, must first check +// if the field has been compressed and uncompress it. +oop oopDesc::obj_field(int offset) const { + return UseCompressedOops ? + load_decode_heap_oop(obj_field_addr(offset)) : + load_decode_heap_oop(obj_field_addr(offset)); } -inline bool oopDesc::is_locked() const { +void oopDesc::obj_field_put(int offset, oop value) { + UseCompressedOops ? oop_store(obj_field_addr(offset), value) : + oop_store(obj_field_addr(offset), value); +} + +void oopDesc::obj_field_put_raw(int offset, oop value) { + UseCompressedOops ? + encode_store_heap_oop(obj_field_addr(offset), value) : + encode_store_heap_oop(obj_field_addr(offset), value); +} +void oopDesc::obj_field_put_volatile(int offset, oop value) { + OrderAccess::release(); + obj_field_put(offset, value); + OrderAccess::fence(); +} + +Metadata* oopDesc::metadata_field(int offset) const { return *metadata_field_addr(offset); } +void oopDesc::metadata_field_put(int offset, Metadata* value) { *metadata_field_addr(offset) = value; } + +jbyte oopDesc::byte_field(int offset) const { return (jbyte) *byte_field_addr(offset); } +void oopDesc::byte_field_put(int offset, jbyte contents) { *byte_field_addr(offset) = (jint) contents; } + +jchar oopDesc::char_field(int offset) const { return (jchar) *char_field_addr(offset); } +void oopDesc::char_field_put(int offset, jchar contents) { *char_field_addr(offset) = (jint) contents; } + +jboolean oopDesc::bool_field(int offset) const { return (jboolean) *bool_field_addr(offset); } +void oopDesc::bool_field_put(int offset, jboolean contents) { *bool_field_addr(offset) = (jint) contents; } + +jint oopDesc::int_field(int offset) const { return *int_field_addr(offset); } +void oopDesc::int_field_put(int offset, jint contents) { *int_field_addr(offset) = contents; } + +jshort oopDesc::short_field(int offset) const { return (jshort) *short_field_addr(offset); } +void oopDesc::short_field_put(int offset, jshort contents) { *short_field_addr(offset) = (jint) contents;} + +jlong oopDesc::long_field(int offset) const { return *long_field_addr(offset); } +void oopDesc::long_field_put(int offset, jlong contents) { *long_field_addr(offset) = contents; } + +jfloat oopDesc::float_field(int offset) const { return *float_field_addr(offset); } +void oopDesc::float_field_put(int offset, jfloat contents) { *float_field_addr(offset) = contents; } + +jdouble oopDesc::double_field(int offset) const { return *double_field_addr(offset); } +void oopDesc::double_field_put(int offset, jdouble contents) { *double_field_addr(offset) = contents; } + +address oopDesc::address_field(int offset) const { return *address_field_addr(offset); } +void oopDesc::address_field_put(int offset, address contents) { *address_field_addr(offset) = contents; } + +oop oopDesc::obj_field_acquire(int offset) const { + return UseCompressedOops ? + decode_heap_oop((narrowOop) + OrderAccess::load_acquire(obj_field_addr(offset))) + : decode_heap_oop((oop) + OrderAccess::load_ptr_acquire(obj_field_addr(offset))); +} +void oopDesc::release_obj_field_put(int offset, oop value) { + UseCompressedOops ? + oop_store((volatile narrowOop*)obj_field_addr(offset), value) : + oop_store((volatile oop*) obj_field_addr(offset), value); +} + +jbyte oopDesc::byte_field_acquire(int offset) const { return OrderAccess::load_acquire(byte_field_addr(offset)); } +void oopDesc::release_byte_field_put(int offset, jbyte contents) { OrderAccess::release_store(byte_field_addr(offset), contents); } + +jchar oopDesc::char_field_acquire(int offset) const { return OrderAccess::load_acquire(char_field_addr(offset)); } +void oopDesc::release_char_field_put(int offset, jchar contents) { OrderAccess::release_store(char_field_addr(offset), contents); } + +jboolean oopDesc::bool_field_acquire(int offset) const { return OrderAccess::load_acquire(bool_field_addr(offset)); } +void oopDesc::release_bool_field_put(int offset, jboolean contents) { OrderAccess::release_store(bool_field_addr(offset), contents); } + +jint oopDesc::int_field_acquire(int offset) const { return OrderAccess::load_acquire(int_field_addr(offset)); } +void oopDesc::release_int_field_put(int offset, jint contents) { OrderAccess::release_store(int_field_addr(offset), contents); } + +jshort oopDesc::short_field_acquire(int offset) const { return (jshort)OrderAccess::load_acquire(short_field_addr(offset)); } +void oopDesc::release_short_field_put(int offset, jshort contents) { OrderAccess::release_store(short_field_addr(offset), contents); } + +jlong oopDesc::long_field_acquire(int offset) const { return OrderAccess::load_acquire(long_field_addr(offset)); } +void oopDesc::release_long_field_put(int offset, jlong contents) { OrderAccess::release_store(long_field_addr(offset), contents); } + +jfloat oopDesc::float_field_acquire(int offset) const { return OrderAccess::load_acquire(float_field_addr(offset)); } +void oopDesc::release_float_field_put(int offset, jfloat contents) { OrderAccess::release_store(float_field_addr(offset), contents); } + +jdouble oopDesc::double_field_acquire(int offset) const { return OrderAccess::load_acquire(double_field_addr(offset)); } +void oopDesc::release_double_field_put(int offset, jdouble contents) { OrderAccess::release_store(double_field_addr(offset), contents); } + +address oopDesc::address_field_acquire(int offset) const { return (address) OrderAccess::load_ptr_acquire(address_field_addr(offset)); } +void oopDesc::release_address_field_put(int offset, address contents) { OrderAccess::release_store_ptr(address_field_addr(offset), contents); } + +bool oopDesc::is_locked() const { return mark()->is_locked(); } -inline bool oopDesc::is_unlocked() const { +bool oopDesc::is_unlocked() const { return mark()->is_unlocked(); } -inline bool oopDesc::has_bias_pattern() const { +bool oopDesc::has_bias_pattern() const { return mark()->has_bias_pattern(); } - // used only for asserts inline bool oopDesc::is_oop(bool ignore_mark_word) const { oop obj = (oop) this; @@ -580,25 +544,30 @@ inline bool oopDesc::is_oop_or_null(bool ignore_mark_word) const { #ifndef PRODUCT // used only for asserts -inline bool oopDesc::is_unlocked_oop() const { +bool oopDesc::is_unlocked_oop() const { if (!Universe::heap()->is_in_reserved(this)) return false; return mark()->is_unlocked(); } #endif // PRODUCT -inline bool oopDesc::is_scavengable() const { +// Used only for markSweep, scavenging +bool oopDesc::is_gc_marked() const { + return mark()->is_marked(); +} + +bool oopDesc::is_scavengable() const { return Universe::heap()->is_scavengable(this); } // Used by scavengers -inline bool oopDesc::is_forwarded() const { +bool oopDesc::is_forwarded() const { // The extra heap check is needed since the obj might be locked, in which case the // mark would point to a stack location and have the sentinel bit cleared return mark()->is_marked(); } // Used by scavengers -inline void oopDesc::forward_to(oop p) { +void oopDesc::forward_to(oop p) { assert(check_obj_alignment(p), "forwarding to something not aligned"); assert(Universe::heap()->is_in_reserved(p), @@ -609,7 +578,7 @@ inline void oopDesc::forward_to(oop p) { } // Used by parallel scavengers -inline bool oopDesc::cas_forward_to(oop p, markOop compare) { +bool oopDesc::cas_forward_to(oop p, markOop compare) { assert(check_obj_alignment(p), "forwarding to something not aligned"); assert(Universe::heap()->is_in_reserved(p), @@ -620,7 +589,7 @@ inline bool oopDesc::cas_forward_to(oop p, markOop compare) { } #if INCLUDE_ALL_GCS -inline oop oopDesc::forward_to_atomic(oop p) { +oop oopDesc::forward_to_atomic(oop p) { markOop oldMark = mark(); markOop forwardPtrMark = markOopDesc::encode_pointer_as_mark(p); markOop curMark; @@ -646,22 +615,10 @@ inline oop oopDesc::forward_to_atomic(oop p) { // Note that the forwardee is not the same thing as the displaced_mark. // The forwardee is used when copying during scavenge and mark-sweep. // It does need to clear the low two locking- and GC-related bits. -inline oop oopDesc::forwardee() const { +oop oopDesc::forwardee() const { return (oop) mark()->decode_pointer(); } -inline bool oopDesc::has_displaced_mark() const { - return mark()->has_displaced_mark_helper(); -} - -inline markOop oopDesc::displaced_mark() const { - return mark()->displaced_mark_helper(); -} - -inline void oopDesc::set_displaced_mark(markOop m) { - mark()->set_displaced_mark_helper(m); -} - // The following method needs to be MT safe. inline uint oopDesc::age() const { assert(!is_forwarded(), "Attempt to read age from forwarded mark"); @@ -672,7 +629,7 @@ inline uint oopDesc::age() const { } } -inline void oopDesc::incr_age() { +void oopDesc::incr_age() { assert(!is_forwarded(), "Attempt to increment age of forwarded mark"); if (has_displaced_mark()) { set_displaced_mark(displaced_mark()->incr_age()); @@ -681,21 +638,7 @@ inline void oopDesc::incr_age() { } } - -inline intptr_t oopDesc::identity_hash() { - // Fast case; if the object is unlocked and the hash value is set, no locking is needed - // Note: The mark must be read into local variable to avoid concurrent updates. - markOop mrk = mark(); - if (mrk->is_unlocked() && !mrk->has_no_hash()) { - return mrk->hash(); - } else if (mrk->is_marked()) { - return mrk->hash(); - } else { - return slow_identity_hash(); - } -} - -inline int oopDesc::ms_adjust_pointers() { +int oopDesc::ms_adjust_pointers() { debug_only(int check_size = size()); int s = klass()->oop_ms_adjust_pointers(this); assert(s == check_size, "should be the same"); @@ -703,11 +646,11 @@ inline int oopDesc::ms_adjust_pointers() { } #if INCLUDE_ALL_GCS -inline void oopDesc::pc_follow_contents(ParCompactionManager* cm) { +void oopDesc::pc_follow_contents(ParCompactionManager* cm) { klass()->oop_pc_follow_contents(this, cm); } -inline void oopDesc::pc_update_contents() { +void oopDesc::pc_update_contents() { Klass* k = klass(); if (!k->is_typeArray_klass()) { // It might contain oops beyond the header, so take the virtual call. @@ -716,7 +659,7 @@ inline void oopDesc::pc_update_contents() { // Else skip it. The TypeArrayKlass in the header never needs scavenging. } -inline void oopDesc::ps_push_contents(PSPromotionManager* pm) { +void oopDesc::ps_push_contents(PSPromotionManager* pm) { Klass* k = klass(); if (!k->is_typeArray_klass()) { // It might contain oops beyond the header, so take the virtual call. @@ -724,43 +667,42 @@ inline void oopDesc::ps_push_contents(PSPromotionManager* pm) { } // Else skip it. The TypeArrayKlass in the header never needs scavenging. } -#endif +#endif // INCLUDE_ALL_GCS -#define OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ - \ -inline void oopDesc::oop_iterate(OopClosureType* blk) { \ - klass()->oop_oop_iterate##nv_suffix(this, blk); \ -} \ - \ -inline void oopDesc::oop_iterate(OopClosureType* blk, MemRegion mr) { \ - klass()->oop_oop_iterate_bounded##nv_suffix(this, blk, mr); \ +#define OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ + \ +void oopDesc::oop_iterate(OopClosureType* blk) { \ + klass()->oop_oop_iterate##nv_suffix(this, blk); \ +} \ + \ +void oopDesc::oop_iterate(OopClosureType* blk, MemRegion mr) { \ + klass()->oop_oop_iterate_bounded##nv_suffix(this, blk, mr); \ } -#define OOP_ITERATE_SIZE_DEFN(OopClosureType, nv_suffix) \ - \ -inline int oopDesc::oop_iterate_size(OopClosureType* blk) { \ - Klass* k = klass(); \ - int size = size_given_klass(k); \ - k->oop_oop_iterate##nv_suffix(this, blk); \ - return size; \ -} \ - \ -inline int oopDesc::oop_iterate_size(OopClosureType* blk, \ - MemRegion mr) { \ - Klass* k = klass(); \ - int size = size_given_klass(k); \ - k->oop_oop_iterate_bounded##nv_suffix(this, blk, mr); \ - return size; \ +#define OOP_ITERATE_SIZE_DEFN(OopClosureType, nv_suffix) \ + \ +int oopDesc::oop_iterate_size(OopClosureType* blk) { \ + Klass* k = klass(); \ + int size = size_given_klass(k); \ + k->oop_oop_iterate##nv_suffix(this, blk); \ + return size; \ +} \ + \ +int oopDesc::oop_iterate_size(OopClosureType* blk, MemRegion mr) { \ + Klass* k = klass(); \ + int size = size_given_klass(k); \ + k->oop_oop_iterate_bounded##nv_suffix(this, blk, mr); \ + return size; \ } -inline int oopDesc::oop_iterate_no_header(OopClosure* blk) { +int oopDesc::oop_iterate_no_header(OopClosure* blk) { // The NoHeaderExtendedOopClosure wraps the OopClosure and proxies all // the do_oop calls, but turns off all other features in ExtendedOopClosure. NoHeaderExtendedOopClosure cl(blk); return oop_iterate_size(&cl); } -inline int oopDesc::oop_iterate_no_header(OopClosure* blk, MemRegion mr) { +int oopDesc::oop_iterate_no_header(OopClosure* blk, MemRegion mr) { NoHeaderExtendedOopClosure cl(blk); return oop_iterate_size(&cl, mr); } @@ -773,7 +715,7 @@ inline void oopDesc::oop_iterate_backwards(OopClosureType* blk) { \ } #else #define OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) -#endif +#endif // INCLUDE_ALL_GCS #define ALL_OOPDESC_OOP_ITERATE(OopClosureType, nv_suffix) \ OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ @@ -783,4 +725,29 @@ inline void oopDesc::oop_iterate_backwards(OopClosureType* blk) { \ ALL_OOP_OOP_ITERATE_CLOSURES_1(ALL_OOPDESC_OOP_ITERATE) ALL_OOP_OOP_ITERATE_CLOSURES_2(ALL_OOPDESC_OOP_ITERATE) +intptr_t oopDesc::identity_hash() { + // Fast case; if the object is unlocked and the hash value is set, no locking is needed + // Note: The mark must be read into local variable to avoid concurrent updates. + markOop mrk = mark(); + if (mrk->is_unlocked() && !mrk->has_no_hash()) { + return mrk->hash(); + } else if (mrk->is_marked()) { + return mrk->hash(); + } else { + return slow_identity_hash(); + } +} + +bool oopDesc::has_displaced_mark() const { + return mark()->has_displaced_mark_helper(); +} + +markOop oopDesc::displaced_mark() const { + return mark()->displaced_mark_helper(); +} + +void oopDesc::set_displaced_mark(markOop m) { + mark()->set_displaced_mark_helper(m); +} + #endif // SHARE_VM_OOPS_OOP_INLINE_HPP diff --git a/hotspot/src/share/vm/oops/typeArrayKlass.cpp b/hotspot/src/share/vm/oops/typeArrayKlass.cpp index 2e76bc4d96a..f8ec9ee822e 100644 --- a/hotspot/src/share/vm/oops/typeArrayKlass.cpp +++ b/hotspot/src/share/vm/oops/typeArrayKlass.cpp @@ -37,7 +37,7 @@ #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" #include "oops/typeArrayKlass.inline.hpp" -#include "oops/typeArrayOop.hpp" +#include "oops/typeArrayOop.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/orderAccess.inline.hpp" #include "utilities/macros.hpp" diff --git a/hotspot/src/share/vm/oops/typeArrayOop.hpp b/hotspot/src/share/vm/oops/typeArrayOop.hpp index 57036c2c0c8..e4670a8949b 100644 --- a/hotspot/src/share/vm/oops/typeArrayOop.hpp +++ b/hotspot/src/share/vm/oops/typeArrayOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -160,10 +160,7 @@ class typeArrayOopDesc : public arrayOopDesc { } public: - int object_size() { - TypeArrayKlass* tk = TypeArrayKlass::cast(klass()); - return object_size(tk->layout_helper(), length()); - } + inline int object_size(); }; #endif // SHARE_VM_OOPS_TYPEARRAYOOP_HPP diff --git a/jdk/test/sun/misc/Cleaner/ExitOnThrow.java b/hotspot/src/share/vm/oops/typeArrayOop.inline.hpp similarity index 65% rename from jdk/test/sun/misc/Cleaner/ExitOnThrow.java rename to hotspot/src/share/vm/oops/typeArrayOop.inline.hpp index 5fdca20670d..679993db822 100644 --- a/jdk/test/sun/misc/Cleaner/ExitOnThrow.java +++ b/hotspot/src/share/vm/oops/typeArrayOop.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -19,26 +19,18 @@ * 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. + * */ -// +#ifndef SHARE_VM_OOPS_TYPEARRAYOOP_INLINE_HPP +#define SHARE_VM_OOPS_TYPEARRAYOOP_INLINE_HPP -import sun.misc.*; - - -public class ExitOnThrow { - - public static void main(String[] args) throws Exception { - Cleaner.create(new Object(), - new Runnable() { - public void run() { - throw new RuntimeException("Foo!"); - } - }); - while (true) { - System.gc(); - Thread.sleep(100); - } - } +#include "oops/oop.inline.hpp" +#include "oops/typeArrayOop.hpp" +int typeArrayOopDesc::object_size() { + TypeArrayKlass* tk = TypeArrayKlass::cast(klass()); + return object_size(tk->layout_helper(), length()); } + +#endif // SHARE_VM_OOPS_TYPEARRAYOOP_INLINE_HPP diff --git a/hotspot/src/share/vm/opto/addnode.cpp b/hotspot/src/share/vm/opto/addnode.cpp index de7356db4b9..416b9c35ff9 100644 --- a/hotspot/src/share/vm/opto/addnode.cpp +++ b/hotspot/src/share/vm/opto/addnode.cpp @@ -52,7 +52,7 @@ uint AddNode::hash() const { //------------------------------Identity--------------------------------------- // If either input is a constant 0, return the other input. -Node *AddNode::Identity( PhaseTransform *phase ) { +Node* AddNode::Identity(PhaseGVN* phase) { const Type *zero = add_id(); // The additive identity if( phase->type( in(1) )->higher_equal( zero ) ) return in(2); if( phase->type( in(2) )->higher_equal( zero ) ) return in(1); @@ -204,7 +204,7 @@ Node *AddNode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Value----------------------------------------- // An add node sums it's two _in. If one input is an RSD, we must mixin // the other input's symbols. -const Type *AddNode::Value( PhaseTransform *phase ) const { +const Type* AddNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -326,7 +326,7 @@ Node *AddINode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Identity--------------------------------------- // Fold (x-y)+y OR y+(x-y) into x -Node *AddINode::Identity( PhaseTransform *phase ) { +Node* AddINode::Identity(PhaseGVN* phase) { if( in(1)->Opcode() == Op_SubI && phase->eqv(in(1)->in(2),in(2)) ) { return in(1)->in(1); } @@ -443,7 +443,7 @@ Node *AddLNode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Identity--------------------------------------- // Fold (x-y)+y OR y+(x-y) into x -Node *AddLNode::Identity( PhaseTransform *phase ) { +Node* AddLNode::Identity(PhaseGVN* phase) { if( in(1)->Opcode() == Op_SubL && phase->eqv(in(1)->in(2),in(2)) ) { return in(1)->in(1); } @@ -561,7 +561,7 @@ Node *AddDNode::Ideal(PhaseGVN *phase, bool can_reshape) { //============================================================================= //------------------------------Identity--------------------------------------- // If one input is a constant 0, return the other input. -Node *AddPNode::Identity( PhaseTransform *phase ) { +Node* AddPNode::Identity(PhaseGVN* phase) { return ( phase->type( in(Offset) )->higher_equal( TypeX_ZERO ) ) ? in(Address) : this; } @@ -659,7 +659,7 @@ const Type *AddPNode::bottom_type() const { } //------------------------------Value------------------------------------------ -const Type *AddPNode::Value( PhaseTransform *phase ) const { +const Type* AddPNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(Address) ); const Type *t2 = phase->type( in(Offset) ); @@ -733,7 +733,7 @@ uint AddPNode::match_edge(uint idx) const { //============================================================================= //------------------------------Identity--------------------------------------- -Node *OrINode::Identity( PhaseTransform *phase ) { +Node* OrINode::Identity(PhaseGVN* phase) { // x | x => x if (phase->eqv(in(1), in(2))) { return in(1); @@ -774,7 +774,7 @@ const Type *OrINode::add_ring( const Type *t0, const Type *t1 ) const { //============================================================================= //------------------------------Identity--------------------------------------- -Node *OrLNode::Identity( PhaseTransform *phase ) { +Node* OrLNode::Identity(PhaseGVN* phase) { // x | x => x if (phase->eqv(in(1), in(2))) { return in(1); diff --git a/hotspot/src/share/vm/opto/addnode.hpp b/hotspot/src/share/vm/opto/addnode.hpp index 31aed490e78..8166050d228 100644 --- a/hotspot/src/share/vm/opto/addnode.hpp +++ b/hotspot/src/share/vm/opto/addnode.hpp @@ -47,7 +47,7 @@ public: // Handle algebraic identities here. If we have an identity, return the Node // we are equivalent to. We look for "add of zero" as an identity. - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); // We also canonicalize the Node, moving constants to the right input, // and flatten expressions (so that 1+x+2 becomes x+3). @@ -55,7 +55,7 @@ public: // Compute a new Type for this node. Basically we just do the pre-check, // then call the virtual add() to set the type. - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; // Check if this addition involves the additive identity virtual const Type *add_of_identity( const Type *t1, const Type *t2 ) const; @@ -80,7 +80,7 @@ public: virtual const Type *add_id() const { return TypeInt::ZERO; } virtual const Type *bottom_type() const { return TypeInt::INT; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual uint ideal_reg() const { return Op_RegI; } }; @@ -94,7 +94,7 @@ public: virtual const Type *add_id() const { return TypeLong::ZERO; } virtual const Type *bottom_type() const { return TypeLong::LONG; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual uint ideal_reg() const { return Op_RegL; } }; @@ -109,7 +109,7 @@ public: virtual const Type *add_ring( const Type *, const Type * ) const; virtual const Type *add_id() const { return TypeF::ZERO; } virtual const Type *bottom_type() const { return Type::FLOAT; } - virtual Node *Identity( PhaseTransform *phase ) { return this; } + virtual Node* Identity(PhaseGVN* phase) { return this; } virtual uint ideal_reg() const { return Op_RegF; } }; @@ -124,7 +124,7 @@ public: virtual const Type *add_ring( const Type *, const Type * ) const; virtual const Type *add_id() const { return TypeD::ZERO; } virtual const Type *bottom_type() const { return Type::DOUBLE; } - virtual Node *Identity( PhaseTransform *phase ) { return this; } + virtual Node* Identity(PhaseGVN* phase) { return this; } virtual uint ideal_reg() const { return Op_RegD; } }; @@ -142,9 +142,9 @@ public: init_class_id(Class_AddP); } virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const; virtual uint ideal_reg() const { return Op_RegP; } Node *base_node() { assert( req() > Base, "Missing base"); return in(Base); } @@ -170,7 +170,7 @@ public: virtual const Type *add_ring( const Type *, const Type * ) const; virtual const Type *add_id() const { return TypeInt::ZERO; } virtual const Type *bottom_type() const { return TypeInt::INT; } - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual uint ideal_reg() const { return Op_RegI; } }; @@ -184,7 +184,7 @@ public: virtual const Type *add_ring( const Type *, const Type * ) const; virtual const Type *add_id() const { return TypeLong::ZERO; } virtual const Type *bottom_type() const { return TypeLong::LONG; } - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual uint ideal_reg() const { return Op_RegL; } }; diff --git a/hotspot/src/share/vm/opto/arraycopynode.hpp b/hotspot/src/share/vm/opto/arraycopynode.hpp index 468b5463da2..e17ea1f57a6 100644 --- a/hotspot/src/share/vm/opto/arraycopynode.hpp +++ b/hotspot/src/share/vm/opto/arraycopynode.hpp @@ -89,7 +89,6 @@ private: static const TypePtr* get_address_type(PhaseGVN *phase, Node* n); Node* try_clone_instance(PhaseGVN *phase, bool can_reshape, int count); - Node* conv_I2X_offset(PhaseGVN *phase, Node* offset, const TypeAryPtr* ary_t); bool prepare_array_copy(PhaseGVN *phase, bool can_reshape, Node*& adr_src, Node*& base_src, Node*& adr_dest, Node*& base_dest, BasicType& copy_type, const Type*& value_type, bool& disjoint_bases); diff --git a/hotspot/src/share/vm/opto/block.hpp b/hotspot/src/share/vm/opto/block.hpp index d84529deb88..d7aa5bb783c 100644 --- a/hotspot/src/share/vm/opto/block.hpp +++ b/hotspot/src/share/vm/opto/block.hpp @@ -499,6 +499,7 @@ class PhaseCFG : public Phase { void convert_NeverBranch_to_Goto(Block *b); CFGLoop* create_loop_tree(); + bool is_dominator(Node* dom_node, Node* node); #ifndef PRODUCT bool _trace_opto_pipelining; // tracing flag diff --git a/hotspot/src/share/vm/opto/callnode.cpp b/hotspot/src/share/vm/opto/callnode.cpp index ffdf6a2d29b..ffe97dc68ab 100644 --- a/hotspot/src/share/vm/opto/callnode.cpp +++ b/hotspot/src/share/vm/opto/callnode.cpp @@ -49,7 +49,7 @@ uint StartNode::size_of() const { return sizeof(*this); } uint StartNode::cmp( const Node &n ) const { return _domain == ((StartNode&)n)._domain; } const Type *StartNode::bottom_type() const { return _domain; } -const Type *StartNode::Value(PhaseTransform *phase) const { return _domain; } +const Type* StartNode::Value(PhaseGVN* phase) const { return _domain; } #ifndef PRODUCT void StartNode::dump_spec(outputStream *st) const { st->print(" #"); _domain->dump_on(st);} void StartNode::dump_compact_spec(outputStream *st) const { /* empty */ } @@ -173,7 +173,7 @@ Node *ReturnNode::Ideal(PhaseGVN *phase, bool can_reshape){ return remove_dead_region(phase, can_reshape) ? this : NULL; } -const Type *ReturnNode::Value( PhaseTransform *phase ) const { +const Type* ReturnNode::Value(PhaseGVN* phase) const { return ( phase->type(in(TypeFunc::Control)) == Type::TOP) ? Type::TOP : Type::BOTTOM; @@ -218,7 +218,7 @@ Node *RethrowNode::Ideal(PhaseGVN *phase, bool can_reshape){ return remove_dead_region(phase, can_reshape) ? this : NULL; } -const Type *RethrowNode::Value( PhaseTransform *phase ) const { +const Type* RethrowNode::Value(PhaseGVN* phase) const { return (phase->type(in(TypeFunc::Control)) == Type::TOP) ? Type::TOP : Type::BOTTOM; @@ -685,7 +685,7 @@ void CallNode::dump_spec(outputStream *st) const { #endif const Type *CallNode::bottom_type() const { return tf()->range(); } -const Type *CallNode::Value(PhaseTransform *phase) const { +const Type* CallNode::Value(PhaseGVN* phase) const { if (phase->type(in(0)) == Type::TOP) return Type::TOP; return tf()->range(); } @@ -1133,7 +1133,7 @@ Node *SafePointNode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Identity--------------------------------------- // Remove obviously duplicate safepoints -Node *SafePointNode::Identity( PhaseTransform *phase ) { +Node* SafePointNode::Identity(PhaseGVN* phase) { // If you have back to back safepoints, remove one if( in(TypeFunc::Control)->is_SafePoint() ) @@ -1156,7 +1156,7 @@ Node *SafePointNode::Identity( PhaseTransform *phase ) { } //------------------------------Value------------------------------------------ -const Type *SafePointNode::Value( PhaseTransform *phase ) const { +const Type* SafePointNode::Value(PhaseGVN* phase) const { if( phase->type(in(0)) == Type::TOP ) return Type::TOP; if( phase->eqv( in(0), this ) ) return Type::TOP; // Dead infinite loop return Type::CONTROL; diff --git a/hotspot/src/share/vm/opto/callnode.hpp b/hotspot/src/share/vm/opto/callnode.hpp index cbe9d90e773..00979ae0d53 100644 --- a/hotspot/src/share/vm/opto/callnode.hpp +++ b/hotspot/src/share/vm/opto/callnode.hpp @@ -76,7 +76,7 @@ public: virtual bool pinned() const { return true; }; virtual const Type *bottom_type() const; virtual const TypePtr *adr_type() const { return TypePtr::BOTTOM; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual void calling_convention( BasicType* sig_bt, VMRegPair *parm_reg, uint length ) const; virtual const RegMask &in_RegMask(uint) const; @@ -127,7 +127,7 @@ public: virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash virtual bool depends_only_on_test() const { return false; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual uint ideal_reg() const { return NotAMachineReg; } virtual uint match_edge(uint idx) const; #ifndef PRODUCT @@ -148,7 +148,7 @@ class RethrowNode : public Node { virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash virtual bool depends_only_on_test() const { return false; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual uint match_edge(uint idx) const; virtual uint ideal_reg() const { return NotAMachineReg; } #ifndef PRODUCT @@ -465,11 +465,11 @@ public: // Standard Node stuff virtual int Opcode() const; virtual bool pinned() const { return true; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const { return Type::CONTROL; } virtual const TypePtr *adr_type() const { return _adr_type; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual uint ideal_reg() const { return 0; } virtual const RegMask &in_RegMask(uint) const; virtual const RegMask &out_RegMask() const; @@ -593,9 +593,9 @@ public: void set_generator(CallGenerator* cg) { _generator = cg; } virtual const Type *bottom_type() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity( PhaseTransform *phase ) { return this; } + virtual Node* Identity(PhaseGVN* phase) { return this; } virtual uint cmp( const Node &n ) const; virtual uint size_of() const = 0; virtual void calling_convention( BasicType* sig_bt, VMRegPair *parm_regs, uint argcnt ) const; diff --git a/hotspot/src/share/vm/opto/castnode.cpp b/hotspot/src/share/vm/opto/castnode.cpp index 44ea7c39814..634ec0bcc1b 100644 --- a/hotspot/src/share/vm/opto/castnode.cpp +++ b/hotspot/src/share/vm/opto/castnode.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "opto/addnode.hpp" +#include "opto/callnode.hpp" #include "opto/castnode.hpp" #include "opto/connode.hpp" #include "opto/matcher.hpp" @@ -33,14 +34,22 @@ //============================================================================= // If input is already higher or equal to cast type, then this is an identity. -Node *ConstraintCastNode::Identity( PhaseTransform *phase ) { +Node* ConstraintCastNode::Identity(PhaseGVN* phase) { + Node* dom = dominating_cast(phase); + if (dom != NULL) { + assert(_carry_dependency, "only for casts that carry a dependency"); + return dom; + } + if (_carry_dependency) { + return this; + } return phase->type(in(1))->higher_equal_speculative(_type) ? in(1) : this; } //------------------------------Value------------------------------------------ // Take 'join' of input and cast-up type -const Type *ConstraintCastNode::Value( PhaseTransform *phase ) const { - if( in(0) && phase->type(in(0)) == Type::TOP ) return Type::TOP; +const Type* ConstraintCastNode::Value(PhaseGVN* phase) const { + if (in(0) && phase->type(in(0)) == Type::TOP) return Type::TOP; const Type* ft = phase->type(in(1))->filter_speculative(_type); #ifdef ASSERT @@ -69,26 +78,78 @@ const Type *ConstraintCastNode::Value( PhaseTransform *phase ) const { //------------------------------Ideal------------------------------------------ // Return a node which is more "ideal" than the current node. Strip out // control copies -Node *ConstraintCastNode::Ideal(PhaseGVN *phase, bool can_reshape){ +Node *ConstraintCastNode::Ideal(PhaseGVN *phase, bool can_reshape) { return (in(0) && remove_dead_region(phase, can_reshape)) ? this : NULL; } -uint CastIINode::size_of() const { +uint ConstraintCastNode::cmp(const Node &n) const { + return TypeNode::cmp(n) && ((ConstraintCastNode&)n)._carry_dependency == _carry_dependency; +} + +uint ConstraintCastNode::size_of() const { return sizeof(*this); } -uint CastIINode::cmp(const Node &n) const { - return TypeNode::cmp(n) && ((CastIINode&)n)._carry_dependency == _carry_dependency; -} - -Node *CastIINode::Identity(PhaseTransform *phase) { - if (_carry_dependency) { - return this; +Node* ConstraintCastNode::make_cast(int opcode, Node* c, Node *n, const Type *t, bool carry_dependency) { + switch(opcode) { + case Op_CastII: { + Node* cast = new CastIINode(n, t, carry_dependency); + cast->set_req(0, c); + return cast; } - return ConstraintCastNode::Identity(phase); + case Op_CastPP: { + Node* cast = new CastPPNode(n, t, carry_dependency); + cast->set_req(0, c); + return cast; + } + case Op_CheckCastPP: return new CheckCastPPNode(c, n, t, carry_dependency); + default: + fatal("Bad opcode %d", opcode); + } + return NULL; } -const Type *CastIINode::Value(PhaseTransform *phase) const { +TypeNode* ConstraintCastNode::dominating_cast(PhaseTransform *phase) const { + if (!carry_dependency()) { + return NULL; + } + Node* val = in(1); + Node* ctl = in(0); + int opc = Opcode(); + if (ctl == NULL) { + return NULL; + } + for (DUIterator_Fast imax, i = val->fast_outs(imax); i < imax; i++) { + Node* u = val->fast_out(i); + if (u != this && + u->Opcode() == opc && + u->in(0) != NULL && + u->bottom_type()->higher_equal(type())) { + if (phase->is_dominator(u->in(0), ctl)) { + return u->as_Type(); + } + if (is_CheckCastPP() && u->in(1)->is_Proj() && u->in(1)->in(0)->is_Allocate() && + u->in(0)->is_Proj() && u->in(0)->in(0)->is_Initialize() && + u->in(1)->in(0)->as_Allocate()->initialization() == u->in(0)->in(0)) { + // CheckCastPP following an allocation always dominates all + // use of the allocation result + return u->as_Type(); + } + } + } + return NULL; +} + +#ifndef PRODUCT +void ConstraintCastNode::dump_spec(outputStream *st) const { + TypeNode::dump_spec(st); + if (_carry_dependency) { + st->print(" carry dependency"); + } +} +#endif + +const Type* CastIINode::Value(PhaseGVN* phase) const { const Type *res = ConstraintCastNode::Value(phase); // Try to improve the type of the CastII if we recognize a CmpI/If @@ -154,11 +215,81 @@ const Type *CastIINode::Value(PhaseTransform *phase) const { return res; } +Node *CastIINode::Ideal(PhaseGVN *phase, bool can_reshape) { + Node* progress = ConstraintCastNode::Ideal(phase, can_reshape); + if (progress != NULL) { + return progress; + } + + // transform: + // (CastII (AddI x const)) -> (AddI (CastII x) const) + // So the AddI has a chance to be optimized out + if (in(1)->Opcode() == Op_AddI) { + Node* in2 = in(1)->in(2); + const TypeInt* in2_t = phase->type(in2)->isa_int(); + if (in2_t != NULL && in2_t->singleton()) { + int in2_const = in2_t->_lo; + const TypeInt* current_type = _type->is_int(); + jlong new_lo_long = ((jlong)current_type->_lo) - in2_const; + jlong new_hi_long = ((jlong)current_type->_hi) - in2_const; + int new_lo = (int)new_lo_long; + int new_hi = (int)new_hi_long; + if (((jlong)new_lo) == new_lo_long && ((jlong)new_hi) == new_hi_long) { + Node* in1 = in(1)->in(1); + CastIINode* new_cast = (CastIINode*)clone(); + AddINode* new_add = (AddINode*)in(1)->clone(); + new_cast->set_type(TypeInt::make(new_lo, new_hi, current_type->_widen)); + new_cast->set_req(1, in1); + new_add->set_req(1, phase->transform(new_cast)); + return new_add; + } + } + } + // Similar to ConvI2LNode::Ideal() for the same reasons + if (can_reshape && !phase->C->major_progress()) { + const TypeInt* this_type = this->type()->is_int(); + const TypeInt* in_type = phase->type(in(1))->isa_int(); + if (in_type != NULL && this_type != NULL && + (in_type->_lo != this_type->_lo || + in_type->_hi != this_type->_hi)) { + int lo1 = this_type->_lo; + int hi1 = this_type->_hi; + int w1 = this_type->_widen; + + if (lo1 >= 0) { + // Keep a range assertion of >=0. + lo1 = 0; hi1 = max_jint; + } else if (hi1 < 0) { + // Keep a range assertion of <0. + lo1 = min_jint; hi1 = -1; + } else { + lo1 = min_jint; hi1 = max_jint; + } + const TypeInt* wtype = TypeInt::make(MAX2(in_type->_lo, lo1), + MIN2(in_type->_hi, hi1), + MAX2((int)in_type->_widen, w1)); + if (wtype != type()) { + set_type(wtype); + return this; + } + } + } + return NULL; +} + +uint CastIINode::cmp(const Node &n) const { + return ConstraintCastNode::cmp(n) && ((CastIINode&)n)._range_check_dependency == _range_check_dependency; +} + +uint CastIINode::size_of() const { + return sizeof(*this); +} + #ifndef PRODUCT -void CastIINode::dump_spec(outputStream *st) const { - TypeNode::dump_spec(st); - if (_carry_dependency) { - st->print(" carry dependency"); +void CastIINode::dump_spec(outputStream* st) const { + ConstraintCastNode::dump_spec(st); + if (_range_check_dependency) { + st->print(" range check dependency"); } } #endif @@ -166,7 +297,15 @@ void CastIINode::dump_spec(outputStream *st) const { //============================================================================= //------------------------------Identity--------------------------------------- // If input is already higher or equal to cast type, then this is an identity. -Node *CheckCastPPNode::Identity( PhaseTransform *phase ) { +Node* CheckCastPPNode::Identity(PhaseGVN* phase) { + Node* dom = dominating_cast(phase); + if (dom != NULL) { + assert(_carry_dependency, "only for casts that carry a dependency"); + return dom; + } + if (_carry_dependency) { + return this; + } // Toned down to rescue meeting at a Phi 3 different oops all implementing // the same interface. CompileTheWorld starting at 502, kd12rc1.zip. return (phase->type(in(1)) == phase->type(this)) ? in(1) : this; @@ -174,7 +313,7 @@ Node *CheckCastPPNode::Identity( PhaseTransform *phase ) { //------------------------------Value------------------------------------------ // Take 'join' of input and cast-up type, unless working with an Interface -const Type *CheckCastPPNode::Value( PhaseTransform *phase ) const { +const Type* CheckCastPPNode::Value(PhaseGVN* phase) const { if( in(0) && phase->type(in(0)) == Type::TOP ) return Type::TOP; const Type *inn = phase->type(in(1)); @@ -255,16 +394,9 @@ const Type *CheckCastPPNode::Value( PhaseTransform *phase ) const { // return join; } -//------------------------------Ideal------------------------------------------ -// Return a node which is more "ideal" than the current node. Strip out -// control copies -Node *CheckCastPPNode::Ideal(PhaseGVN *phase, bool can_reshape){ - return (in(0) && remove_dead_region(phase, can_reshape)) ? this : NULL; -} - //============================================================================= //------------------------------Value------------------------------------------ -const Type *CastX2PNode::Value( PhaseTransform *phase ) const { +const Type* CastX2PNode::Value(PhaseGVN* phase) const { const Type* t = phase->type(in(1)); if (t == Type::TOP) return Type::TOP; if (t->base() == Type_X && t->singleton()) { @@ -328,14 +460,14 @@ Node *CastX2PNode::Ideal(PhaseGVN *phase, bool can_reshape) { } //------------------------------Identity--------------------------------------- -Node *CastX2PNode::Identity( PhaseTransform *phase ) { +Node* CastX2PNode::Identity(PhaseGVN* phase) { if (in(1)->Opcode() == Op_CastP2X) return in(1)->in(1); return this; } //============================================================================= //------------------------------Value------------------------------------------ -const Type *CastP2XNode::Value( PhaseTransform *phase ) const { +const Type* CastP2XNode::Value(PhaseGVN* phase) const { const Type* t = phase->type(in(1)); if (t == Type::TOP) return Type::TOP; if (t->base() == Type::RawPtr && t->singleton()) { @@ -350,7 +482,7 @@ Node *CastP2XNode::Ideal(PhaseGVN *phase, bool can_reshape) { } //------------------------------Identity--------------------------------------- -Node *CastP2XNode::Identity( PhaseTransform *phase ) { +Node* CastP2XNode::Identity(PhaseGVN* phase) { if (in(1)->Opcode() == Op_CastX2P) return in(1)->in(1); return this; } diff --git a/hotspot/src/share/vm/opto/castnode.hpp b/hotspot/src/share/vm/opto/castnode.hpp index 535b0e6610b..9c2dfcb2e9d 100644 --- a/hotspot/src/share/vm/opto/castnode.hpp +++ b/hotspot/src/share/vm/opto/castnode.hpp @@ -32,38 +32,62 @@ //------------------------------ConstraintCastNode----------------------------- // cast to a different range class ConstraintCastNode: public TypeNode { + protected: + // Can this node be removed post CCP or does it carry a required dependency? + const bool _carry_dependency; + virtual uint cmp( const Node &n ) const; + virtual uint size_of() const; + public: - ConstraintCastNode (Node *n, const Type *t ): TypeNode(t,2) { + ConstraintCastNode(Node *n, const Type *t, bool carry_dependency) + : TypeNode(t,2), _carry_dependency(carry_dependency) { init_class_id(Class_ConstraintCast); init_req(1, n); } - virtual Node *Identity( PhaseTransform *phase ); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual int Opcode() const; virtual uint ideal_reg() const = 0; + virtual bool depends_only_on_test() const { return !_carry_dependency; } + bool carry_dependency() const { return _carry_dependency; } + TypeNode* dominating_cast(PhaseTransform *phase) const; + static Node* make_cast(int opcode, Node* c, Node *n, const Type *t, bool carry_dependency); + +#ifndef PRODUCT + virtual void dump_spec(outputStream *st) const; +#endif }; //------------------------------CastIINode------------------------------------- // cast integer to integer (different range) class CastIINode: public ConstraintCastNode { - private: - // Can this node be removed post CCP or does it carry a required dependency? - const bool _carry_dependency; - protected: - virtual uint cmp( const Node &n ) const; + // Is this node dependent on a range check? + const bool _range_check_dependency; + virtual uint cmp(const Node &n) const; virtual uint size_of() const; public: - CastIINode(Node *n, const Type *t, bool carry_dependency = false) - : ConstraintCastNode(n,t), _carry_dependency(carry_dependency) {} + CastIINode(Node* n, const Type* t, bool carry_dependency = false, bool range_check_dependency = false) + : ConstraintCastNode(n, t, carry_dependency), _range_check_dependency(range_check_dependency) { + init_class_id(Class_CastII); + } virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } - virtual Node *Identity( PhaseTransform *phase ); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); + const bool has_range_check() { +#ifdef _LP64 + return _range_check_dependency; +#else + assert(!_range_check_dependency, "Should not have range check dependency"); + return false; +#endif + } + #ifndef PRODUCT - virtual void dump_spec(outputStream *st) const; + virtual void dump_spec(outputStream* st) const; #endif }; @@ -71,24 +95,25 @@ class CastIINode: public ConstraintCastNode { // cast pointer to pointer (different type) class CastPPNode: public ConstraintCastNode { public: - CastPPNode (Node *n, const Type *t ): ConstraintCastNode(n, t) {} + CastPPNode (Node *n, const Type *t, bool carry_dependency = false) + : ConstraintCastNode(n, t, carry_dependency) { + } virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegP; } }; //------------------------------CheckCastPPNode-------------------------------- // for _checkcast, cast pointer to pointer (different type), without JOIN, -class CheckCastPPNode: public TypeNode { +class CheckCastPPNode: public ConstraintCastNode { public: - CheckCastPPNode( Node *c, Node *n, const Type *t ) : TypeNode(t,2) { + CheckCastPPNode(Node *c, Node *n, const Type *t, bool carry_dependency = false) + : ConstraintCastNode(n, t, carry_dependency) { init_class_id(Class_CheckCastPP); init_req(0, c); - init_req(1, n); } - virtual Node *Identity( PhaseTransform *phase ); - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); + virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegP; } }; @@ -100,9 +125,9 @@ class CastX2PNode : public Node { public: CastX2PNode( Node *n ) : Node(NULL, n) {} virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual uint ideal_reg() const { return Op_RegP; } virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; } }; @@ -114,9 +139,9 @@ class CastP2XNode : public Node { public: CastP2XNode( Node *ctrl, Node *n ) : Node(ctrl, n) {} virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual uint ideal_reg() const { return Op_RegX; } virtual const Type *bottom_type() const { return TypeX_X; } // Return false to keep node from moving away from an associated card mark. diff --git a/hotspot/src/share/vm/opto/cfgnode.cpp b/hotspot/src/share/vm/opto/cfgnode.cpp index 454a29636a6..12aa7c7d6b4 100644 --- a/hotspot/src/share/vm/opto/cfgnode.cpp +++ b/hotspot/src/share/vm/opto/cfgnode.cpp @@ -27,6 +27,7 @@ #include "memory/allocation.inline.hpp" #include "oops/objArrayKlass.hpp" #include "opto/addnode.hpp" +#include "opto/castnode.hpp" #include "opto/cfgnode.hpp" #include "opto/connode.hpp" #include "opto/convertnode.hpp" @@ -47,7 +48,7 @@ //============================================================================= //------------------------------Value------------------------------------------ // Compute the type of the RegionNode. -const Type *RegionNode::Value( PhaseTransform *phase ) const { +const Type* RegionNode::Value(PhaseGVN* phase) const { for( uint i=1; itype(in(1)) : Type::TOP; @@ -902,24 +903,35 @@ const Type *PhiNode::Value( PhaseTransform *phase ) const { return Type::TOP; // Check for trip-counted loop. If so, be smarter. - CountedLoopNode *l = r->is_CountedLoop() ? r->as_CountedLoop() : NULL; - if( l && l->can_be_counted_loop(phase) && - ((const Node*)l->phi() == this) ) { // Trip counted loop! + CountedLoopNode* l = r->is_CountedLoop() ? r->as_CountedLoop() : NULL; + if (l && ((const Node*)l->phi() == this)) { // Trip counted loop! // protect against init_trip() or limit() returning NULL - const Node *init = l->init_trip(); - const Node *limit = l->limit(); - if( init != NULL && limit != NULL && l->stride_is_con() ) { - const TypeInt *lo = init ->bottom_type()->isa_int(); - const TypeInt *hi = limit->bottom_type()->isa_int(); - if( lo && hi ) { // Dying loops might have TOP here - int stride = l->stride_con(); - if( stride < 0 ) { // Down-counter loop - const TypeInt *tmp = lo; lo = hi; hi = tmp; - stride = -stride; + if (l->can_be_counted_loop(phase)) { + const Node *init = l->init_trip(); + const Node *limit = l->limit(); + const Node* stride = l->stride(); + if (init != NULL && limit != NULL && stride != NULL) { + const TypeInt* lo = phase->type(init)->isa_int(); + const TypeInt* hi = phase->type(limit)->isa_int(); + const TypeInt* stride_t = phase->type(stride)->isa_int(); + if (lo != NULL && hi != NULL && stride_t != NULL) { // Dying loops might have TOP here + assert(stride_t->_hi >= stride_t->_lo, "bad stride type"); + if (stride_t->_hi < 0) { // Down-counter loop + swap(lo, hi); + return TypeInt::make(MIN2(lo->_lo, hi->_lo) , hi->_hi, 3); + } else if (stride_t->_lo >= 0) { + return TypeInt::make(lo->_lo, MAX2(lo->_hi, hi->_hi), 3); + } } - if( lo->_hi < hi->_lo ) // Reversed endpoints are well defined :-( - return TypeInt::make(lo->_lo,hi->_hi,3); } + } else if (l->in(LoopNode::LoopBackControl) != NULL && + in(LoopNode::EntryControl) != NULL && + phase->type(l->in(LoopNode::LoopBackControl)) == Type::TOP) { + // During CCP, if we saturate the type of a counted loop's Phi + // before the special code for counted loop above has a chance + // to run (that is as long as the type of the backedge's control + // is top), we might end up with non monotonic types + return phase->type(in(LoopNode::EntryControl)); } } @@ -1142,13 +1154,13 @@ Node* PhiNode::is_cmove_id(PhaseTransform* phase, int true_path) { //------------------------------Identity--------------------------------------- // Check for Region being Identity. -Node *PhiNode::Identity( PhaseTransform *phase ) { +Node* PhiNode::Identity(PhaseGVN* phase) { // Check for no merging going on // (There used to be special-case code here when this->region->is_Loop. // It would check for a tributary phi on the backedge that the main phi // trivially, perhaps with a single cast. The unique_input method // does all this and more, by reducing such tributaries to 'this'.) - Node* uin = unique_input(phase); + Node* uin = unique_input(phase, false); if (uin != NULL) { return uin; } @@ -1165,11 +1177,10 @@ Node *PhiNode::Identity( PhaseTransform *phase ) { //-----------------------------unique_input------------------------------------ // Find the unique value, discounting top, self-loops, and casts. // Return top if there are no inputs, and self if there are multiple. -Node* PhiNode::unique_input(PhaseTransform* phase) { - // 1) One unique direct input, or - // 2) some of the inputs have an intervening ConstraintCast and - // the type of input is the same or sharper (more specific) - // than the phi's type. +Node* PhiNode::unique_input(PhaseTransform* phase, bool uncast) { + // 1) One unique direct input, + // or if uncast is true: + // 2) some of the inputs have an intervening ConstraintCast // 3) an input is a self loop // // 1) input or 2) input or 3) input __ @@ -1180,8 +1191,7 @@ Node* PhiNode::unique_input(PhaseTransform* phase) { Node* r = in(0); // RegionNode if (r == NULL) return in(1); // Already degraded to a Copy - Node* uncasted_input = NULL; // The unique uncasted input (ConstraintCasts removed) - Node* direct_input = NULL; // The unique direct input + Node* input = NULL; // The unique direct input (maybe uncasted = ConstraintCasts removed) for (uint i = 1, cnt = req(); i < cnt; ++i) { Node* rc = r->in(i); @@ -1190,34 +1200,37 @@ Node* PhiNode::unique_input(PhaseTransform* phase) { Node* n = in(i); if (n == NULL) continue; - Node* un = n->uncast(); + Node* un = n; + if (uncast) { +#ifdef ASSERT + Node* m = un->uncast(); +#endif + while (un != NULL && un->req() == 2 && un->is_ConstraintCast()) { + Node* next = un->in(1); + if (phase->type(next)->isa_rawptr() && phase->type(un)->isa_oopptr()) { + // risk exposing raw ptr at safepoint + break; + } + un = next; + } + assert(m == un || un->in(1) == m, "Only expected at CheckCastPP from allocation"); + } if (un == NULL || un == this || phase->type(un) == Type::TOP) { continue; // ignore if top, or in(i) and "this" are in a data cycle } - // Check for a unique uncasted input - if (uncasted_input == NULL) { - uncasted_input = un; - } else if (uncasted_input != un) { - uncasted_input = NodeSentinel; // no unique uncasted input - } - // Check for a unique direct input - if (direct_input == NULL) { - direct_input = n; - } else if (direct_input != n) { - direct_input = NodeSentinel; // no unique direct input + // Check for a unique input (maybe uncasted) + if (input == NULL) { + input = un; + } else if (input != un) { + input = NodeSentinel; // no unique input } } - if (direct_input == NULL) { + if (input == NULL) { return phase->C->top(); // no inputs } - assert(uncasted_input != NULL,""); - if (direct_input != NodeSentinel) { - return direct_input; // one unique direct input - } - if (uncasted_input != NodeSentinel && - phase->type(uncasted_input)->higher_equal(type())) { - return uncasted_input; // one unique uncasted input + if (input != NodeSentinel) { + return input; // one unique direct input } // Nothing. @@ -1650,7 +1663,12 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { return top; } - Node* uin = unique_input(phase); + bool uncasted = false; + Node* uin = unique_input(phase, false); + if (uin == NULL) { + uncasted = true; + uin = unique_input(phase, true); + } if (uin == top) { // Simplest case: no alive inputs. if (can_reshape) // IGVN transformation return top; @@ -1683,6 +1701,31 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { } } + if (uncasted) { + const Type* phi_type = bottom_type(); + assert(phi_type->isa_int() || phi_type->isa_ptr(), "bad phi type"); + int opcode; + if (phi_type->isa_int()) { + opcode = Op_CastII; + } else { + const Type* uin_type = phase->type(uin); + if (phi_type->join(TypePtr::NOTNULL) == uin_type->join(TypePtr::NOTNULL)) { + opcode = Op_CastPP; + } else { + opcode = Op_CheckCastPP; + } + } + // Add a cast to carry the control dependency of the Phi that is + // going away + Node* cast = ConstraintCastNode::make_cast(opcode, r, uin, phi_type, true); + cast = phase->transform(cast); + // set all inputs to the new cast so the Phi is removed by Identity + for (uint i = 1; i < req(); i++) { + set_req(i, cast); + } + uin = cast; + } + // One unique input. debug_only(Node* ident = Identity(phase)); // The unique input must eventually be detected by the Identity call. @@ -1699,7 +1742,6 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { return NULL; } - Node* opt = NULL; int true_path = is_diamond_phi(); if( true_path != 0 ) { @@ -2048,13 +2090,13 @@ void PhiNode::dump_spec(outputStream *st) const { //============================================================================= -const Type *GotoNode::Value( PhaseTransform *phase ) const { +const Type* GotoNode::Value(PhaseGVN* phase) const { // If the input is reachable, then we are executed. // If the input is not reachable, then we are not executed. return phase->type(in(0)); } -Node *GotoNode::Identity( PhaseTransform *phase ) { +Node* GotoNode::Identity(PhaseGVN* phase) { return in(0); // Simple copy of incoming control } @@ -2116,7 +2158,7 @@ const Type *PCTableNode::bottom_type() const { //------------------------------Value------------------------------------------ // Compute the type of the PCTableNode. If reachable it is a tuple of // Control, otherwise the table targets are not reachable -const Type *PCTableNode::Value( PhaseTransform *phase ) const { +const Type* PCTableNode::Value(PhaseGVN* phase) const { if( phase->type(in(0)) == Type::CONTROL ) return bottom_type(); return Type::TOP; // All paths dead? Then so are we @@ -2161,7 +2203,7 @@ void JumpProjNode::related(GrowableArray *in_rel, GrowableArray *o //------------------------------Value------------------------------------------ // Check for being unreachable, or for coming from a Rethrow. Rethrow's cannot // have the default "fall_through_index" path. -const Type *CatchNode::Value( PhaseTransform *phase ) const { +const Type* CatchNode::Value(PhaseGVN* phase) const { // Unreachable? Then so are all paths from here. if( phase->type(in(0)) == Type::TOP ) return Type::TOP; // First assume all paths are reachable @@ -2205,7 +2247,7 @@ uint CatchProjNode::cmp( const Node &n ) const { //------------------------------Identity--------------------------------------- // If only 1 target is possible, choose it if it is the main control -Node *CatchProjNode::Identity( PhaseTransform *phase ) { +Node* CatchProjNode::Identity(PhaseGVN* phase) { // If my value is control and no other value is, then treat as ID const TypeTuple *t = phase->type(in(0))->is_tuple(); if (t->field_at(_con) != Type::CONTROL) return this; @@ -2248,7 +2290,7 @@ void CatchProjNode::dump_spec(outputStream *st) const { //============================================================================= //------------------------------Identity--------------------------------------- // Check for CreateEx being Identity. -Node *CreateExNode::Identity( PhaseTransform *phase ) { +Node* CreateExNode::Identity(PhaseGVN* phase) { if( phase->type(in(1)) == Type::TOP ) return in(1); if( phase->type(in(0)) == Type::TOP ) return in(0); // We only come from CatchProj, unless the CatchProj goes away. @@ -2264,7 +2306,7 @@ Node *CreateExNode::Identity( PhaseTransform *phase ) { //============================================================================= //------------------------------Value------------------------------------------ // Check for being unreachable. -const Type *NeverBranchNode::Value( PhaseTransform *phase ) const { +const Type* NeverBranchNode::Value(PhaseGVN* phase) const { if (!in(0) || in(0)->is_top()) return Type::TOP; return bottom_type(); } diff --git a/hotspot/src/share/vm/opto/cfgnode.hpp b/hotspot/src/share/vm/opto/cfgnode.hpp index a87a70a41e6..8651b672121 100644 --- a/hotspot/src/share/vm/opto/cfgnode.hpp +++ b/hotspot/src/share/vm/opto/cfgnode.hpp @@ -91,8 +91,8 @@ public: virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash virtual bool depends_only_on_test() const { return false; } virtual const Type *bottom_type() const { return Type::CONTROL; } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const RegMask &out_RegMask() const; bool try_clean_mem_phi(PhaseGVN *phase); @@ -175,7 +175,14 @@ public: // Determine a unique non-trivial input, if any. // Ignore casts if it helps. Return NULL on failure. - Node* unique_input(PhaseTransform *phase); + Node* unique_input(PhaseTransform *phase, bool uncast); + Node* unique_input(PhaseTransform *phase) { + Node* uin = unique_input(phase, false); + if (uin == NULL) { + uin = unique_input(phase, true); + } + return uin; + } // Check for a simple dead loop. enum LoopSafety { Safe = 0, Unsafe, UnsafeLoop }; @@ -198,8 +205,8 @@ public: type()->higher_equal(tp); } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const RegMask &out_RegMask() const; virtual const RegMask &in_RegMask(uint) const; @@ -227,8 +234,8 @@ public: virtual const Node *is_block_proj() const { return this; } virtual bool depends_only_on_test() const { return false; } virtual const Type *bottom_type() const { return Type::CONTROL; } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual const RegMask &out_RegMask() const; #ifndef PRODUCT @@ -270,13 +277,6 @@ class IfNode : public MultiBranchNode { virtual uint size_of() const { return sizeof(*this); } private: - ProjNode* range_check_trap_proj() { - int flip_test = 0; - Node* l = NULL; - Node* r = NULL; - return range_check_trap_proj(flip_test, l, r); - } - // Helper methods for fold_compares bool cmpi_folds(PhaseIterGVN* igvn); bool is_ctrl_folds(Node* ctrl, PhaseIterGVN* igvn); @@ -377,7 +377,7 @@ public: virtual bool pinned() const { return true; } virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual int required_outcnt() const { return 2; } virtual const RegMask &out_RegMask() const; Node* fold_compares(PhaseIterGVN* phase); @@ -411,7 +411,7 @@ public: class IfProjNode : public CProjNode { public: IfProjNode(IfNode *ifnode, uint idx) : CProjNode(ifnode,idx) {} - virtual Node *Identity(PhaseTransform *phase); + virtual Node* Identity(PhaseGVN* phase); protected: // Type of If input when this branch is always taken @@ -465,7 +465,7 @@ public: init_req(1, idx); } virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *bottom_type() const; virtual bool pinned() const { return true; } @@ -525,7 +525,7 @@ public: init_class_id(Class_Catch); } virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; }; // CatchProjNode controls which exception handler is targetted after a call. @@ -553,7 +553,7 @@ public: } virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual const Type *bottom_type() const { return Type::CONTROL; } int handler_bci() const { return _handler_bci; } bool is_handler_proj() const { return _handler_bci >= 0; } @@ -572,7 +572,7 @@ public: init_req(1, i_o); } virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual bool pinned() const { return true; } uint match_edge(uint idx) const { return 0; } virtual uint ideal_reg() const { return Op_RegP; } @@ -588,7 +588,7 @@ public: virtual int Opcode() const; virtual bool pinned() const { return true; }; virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual int required_outcnt() const { return 2; } virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { } diff --git a/hotspot/src/share/vm/opto/classes.hpp b/hotspot/src/share/vm/opto/classes.hpp index 16ccc5817b6..e101a9768a2 100644 --- a/hotspot/src/share/vm/opto/classes.hpp +++ b/hotspot/src/share/vm/opto/classes.hpp @@ -112,7 +112,6 @@ macro(ConvI2L) macro(ConvL2D) macro(ConvL2F) macro(ConvL2I) -macro(CosD) macro(CountedLoop) macro(CountedLoopEnd) macro(CountLeadingZerosI) @@ -229,7 +228,6 @@ macro(RoundFloat) macro(SafePoint) macro(SafePointScalarObject) macro(SCMemProj) -macro(SinD) macro(SqrtD) macro(Start) macro(StartOSR) diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp index 41483faf907..bf5597753b6 100644 --- a/hotspot/src/share/vm/opto/compile.cpp +++ b/hotspot/src/share/vm/opto/compile.cpp @@ -38,6 +38,7 @@ #include "opto/c2compiler.hpp" #include "opto/callGenerator.hpp" #include "opto/callnode.hpp" +#include "opto/castnode.hpp" #include "opto/cfgnode.hpp" #include "opto/chaitin.hpp" #include "opto/compile.hpp" @@ -402,6 +403,13 @@ void Compile::remove_useless_nodes(Unique_Node_List &useful) { remove_macro_node(n); } } + // Remove useless CastII nodes with range check dependency + for (int i = range_check_cast_count() - 1; i >= 0; i--) { + Node* cast = range_check_cast_node(i); + if (!useful.member(cast)) { + remove_range_check_cast(cast); + } + } // Remove useless expensive node for (int i = C->expensive_count()-1; i >= 0; i--) { Node* n = C->expensive_node(i); @@ -926,7 +934,6 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr compiler, has_unsafe_access(), SharedRuntime::is_wide_vector(max_vector_size()), - _directive, rtm_state() ); @@ -1178,6 +1185,7 @@ void Compile::Init(int aliaslevel) { _macro_nodes = new(comp_arena()) GrowableArray(comp_arena(), 8, 0, NULL); _predicate_opaqs = new(comp_arena()) GrowableArray(comp_arena(), 8, 0, NULL); _expensive_nodes = new(comp_arena()) GrowableArray(comp_arena(), 8, 0, NULL); + _range_check_casts = new(comp_arena()) GrowableArray(comp_arena(), 8, 0, NULL); register_library_intrinsics(); } @@ -1924,6 +1932,22 @@ void Compile::cleanup_loop_predicates(PhaseIterGVN &igvn) { assert(predicate_count()==0, "should be clean!"); } +void Compile::add_range_check_cast(Node* n) { + assert(n->isa_CastII()->has_range_check(), "CastII should have range check dependency"); + assert(!_range_check_casts->contains(n), "duplicate entry in range check casts"); + _range_check_casts->append(n); +} + +// Remove all range check dependent CastIINodes. +void Compile::remove_range_check_casts(PhaseIterGVN &igvn) { + for (int i = range_check_cast_count(); i > 0; i--) { + Node* cast = range_check_cast_node(i-1); + assert(cast->isa_CastII()->has_range_check(), "CastII should have range check dependency"); + igvn.replace_node(cast, cast->in(1)); + } + assert(range_check_cast_count() == 0, "should be empty"); +} + // StringOpts and late inlining of string methods void Compile::inline_string_calls(bool parse_time) { { @@ -2284,6 +2308,12 @@ void Compile::Optimize() { PhaseIdealLoop::verify(igvn); } + if (range_check_cast_count() > 0) { + // No more loop optimizations. Remove all range check dependent CastIINodes. + C->remove_range_check_casts(igvn); + igvn.optimize(); + } + { TracePhase tp("macroExpand", &timers[_t_macroExpand]); PhaseMacroExpand mex(igvn); @@ -2296,17 +2326,17 @@ void Compile::Optimize() { DEBUG_ONLY( _modified_nodes = NULL; ) } // (End scope of igvn; run destructor if necessary for asserts.) - process_print_inlining(); - // A method with only infinite loops has no edges entering loops from root - { - TracePhase tp("graphReshape", &timers[_t_graphReshaping]); - if (final_graph_reshaping()) { - assert(failing(), "must bail out w/ explicit message"); - return; - } - } + process_print_inlining(); + // A method with only infinite loops has no edges entering loops from root + { + TracePhase tp("graphReshape", &timers[_t_graphReshaping]); + if (final_graph_reshaping()) { + assert(failing(), "must bail out w/ explicit message"); + return; + } + } - print_method(PHASE_OPTIMIZE_FINISHED, 2); + print_method(PHASE_OPTIMIZE_FINISHED, 2); } @@ -2874,7 +2904,7 @@ void Compile::final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc) { Node* use = m->fast_out(i); if (use->is_Mem() || use->is_EncodeNarrowPtr()) { use->ensure_control_or_add_prec(n->in(0)); - } else if (use->in(0) == NULL) { + } else { switch(use->Opcode()) { case Op_AddP: case Op_DecodeN: @@ -3087,6 +3117,16 @@ void Compile::final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc) { #endif +#ifdef ASSERT + case Op_CastII: + // Verify that all range check dependent CastII nodes were removed. + if (n->isa_CastII()->has_range_check()) { + n->dump(3); + assert(false, "Range check dependent CastII node was not removed"); + } + break; +#endif + case Op_ModI: if (UseDivMod) { // Check if a%b and a/b both exist @@ -3962,7 +4002,7 @@ int Compile::static_subtype_check(ciKlass* superk, ciKlass* subk) { return SSC_full_test; } -Node* Compile::conv_I2X_index(PhaseGVN *phase, Node* idx, const TypeInt* sizetype) { +Node* Compile::conv_I2X_index(PhaseGVN* phase, Node* idx, const TypeInt* sizetype, Node* ctrl) { #ifdef _LP64 // The scaled index operand to AddP must be a clean 64-bit value. // Java allows a 32-bit int to be incremented to a negative @@ -3975,13 +4015,31 @@ Node* Compile::conv_I2X_index(PhaseGVN *phase, Node* idx, const TypeInt* sizetyp // number. (The prior range check has ensured this.) // This assertion is used by ConvI2LNode::Ideal. int index_max = max_jint - 1; // array size is max_jint, index is one less - if (sizetype != NULL) index_max = sizetype->_hi - 1; - const TypeLong* lidxtype = TypeLong::make(CONST64(0), index_max, Type::WidenMax); - idx = phase->transform(new ConvI2LNode(idx, lidxtype)); + if (sizetype != NULL) index_max = sizetype->_hi - 1; + const TypeInt* iidxtype = TypeInt::make(0, index_max, Type::WidenMax); + idx = constrained_convI2L(phase, idx, iidxtype, ctrl); #endif return idx; } +// Convert integer value to a narrowed long type dependent on ctrl (for example, a range check) +Node* Compile::constrained_convI2L(PhaseGVN* phase, Node* value, const TypeInt* itype, Node* ctrl) { + if (ctrl != NULL) { + // Express control dependency by a CastII node with a narrow type. + value = new CastIINode(value, itype, false, true /* range check dependency */); + // Make the CastII node dependent on the control input to prevent the narrowed ConvI2L + // node from floating above the range check during loop optimizations. Otherwise, the + // ConvI2L node may be eliminated independently of the range check, causing the data path + // to become TOP while the control path is still there (although it's unreachable). + value->set_req(0, ctrl); + // Save CastII node to remove it after loop optimizations. + phase->C->add_range_check_cast(value); + value = phase->transform(value); + } + const TypeLong* ltype = TypeLong::make(itype->_lo, itype->_hi, itype->_widen); + return phase->transform(new ConvI2LNode(value, ltype)); +} + // The message about the current inlining is accumulated in // _print_inlining_stream and transfered into the _print_inlining_list // once we know whether inlining succeeds or not. For regular diff --git a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp index e012ea660f1..871abe245a7 100644 --- a/hotspot/src/share/vm/opto/compile.hpp +++ b/hotspot/src/share/vm/opto/compile.hpp @@ -400,6 +400,7 @@ class Compile : public Phase { GrowableArray* _macro_nodes; // List of nodes which need to be expanded before matching. GrowableArray* _predicate_opaqs; // List of Opaque1 nodes for the loop predicates. GrowableArray* _expensive_nodes; // List of nodes that are expensive to compute and that we'd better not let the GVN freely common + GrowableArray* _range_check_casts; // List of CastII nodes with a range check dependency ConnectionGraph* _congraph; #ifndef PRODUCT IdealGraphPrinter* _printer; @@ -753,7 +754,7 @@ class Compile : public Phase { void set_congraph(ConnectionGraph* congraph) { _congraph = congraph;} void add_macro_node(Node * n) { //assert(n->is_macro(), "must be a macro node"); - assert(!_macro_nodes->contains(n), " duplicate entry in expand list"); + assert(!_macro_nodes->contains(n), "duplicate entry in expand list"); _macro_nodes->append(n); } void remove_macro_node(Node * n) { @@ -773,10 +774,23 @@ class Compile : public Phase { } } void add_predicate_opaq(Node * n) { - assert(!_predicate_opaqs->contains(n), " duplicate entry in predicate opaque1"); + assert(!_predicate_opaqs->contains(n), "duplicate entry in predicate opaque1"); assert(_macro_nodes->contains(n), "should have already been in macro list"); _predicate_opaqs->append(n); } + + // Range check dependent CastII nodes that can be removed after loop optimizations + void add_range_check_cast(Node* n); + void remove_range_check_cast(Node* n) { + if (_range_check_casts->contains(n)) { + _range_check_casts->remove(n); + } + } + Node* range_check_cast_node(int idx) const { return _range_check_casts->at(idx); } + int range_check_cast_count() const { return _range_check_casts->length(); } + // Remove all range check dependent CastIINodes. + void remove_range_check_casts(PhaseIterGVN &igvn); + // remove the opaque nodes that protect the predicates so that the unused checks and // uncommon traps will be eliminated from the graph. void cleanup_loop_predicates(PhaseIterGVN &igvn); @@ -1292,7 +1306,12 @@ class Compile : public Phase { enum { SSC_always_false, SSC_always_true, SSC_easy_test, SSC_full_test }; int static_subtype_check(ciKlass* superk, ciKlass* subk); - static Node* conv_I2X_index(PhaseGVN *phase, Node* offset, const TypeInt* sizetype); + static Node* conv_I2X_index(PhaseGVN* phase, Node* offset, const TypeInt* sizetype, + // Optional control dependency (for example, on range check) + Node* ctrl = NULL); + + // Convert integer value to a narrowed long type dependent on ctrl (for example, a range check) + static Node* constrained_convI2L(PhaseGVN* phase, Node* value, const TypeInt* itype, Node* ctrl); // Auxiliary method for randomized fuzzing/stressing static bool randomized_select(int count); diff --git a/hotspot/src/share/vm/opto/convertnode.cpp b/hotspot/src/share/vm/opto/convertnode.cpp index 63a391abc97..bc111ccae7a 100644 --- a/hotspot/src/share/vm/opto/convertnode.cpp +++ b/hotspot/src/share/vm/opto/convertnode.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "opto/addnode.hpp" +#include "opto/castnode.hpp" #include "opto/convertnode.hpp" #include "opto/matcher.hpp" #include "opto/phaseX.hpp" @@ -32,7 +33,7 @@ //============================================================================= //------------------------------Identity--------------------------------------- -Node *Conv2BNode::Identity( PhaseTransform *phase ) { +Node* Conv2BNode::Identity(PhaseGVN* phase) { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return in(1); if( t == TypeInt::ZERO ) return in(1); @@ -42,7 +43,7 @@ Node *Conv2BNode::Identity( PhaseTransform *phase ) { } //------------------------------Value------------------------------------------ -const Type *Conv2BNode::Value( PhaseTransform *phase ) const { +const Type* Conv2BNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; if( t == TypeInt::ZERO ) return TypeInt::ZERO; @@ -64,7 +65,7 @@ const Type *Conv2BNode::Value( PhaseTransform *phase ) const { // The conversions operations are all Alpha sorted. Please keep it that way! //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvD2FNode::Value( PhaseTransform *phase ) const { +const Type* ConvD2FNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; if( t == Type::DOUBLE ) return Type::FLOAT; @@ -75,13 +76,13 @@ const Type *ConvD2FNode::Value( PhaseTransform *phase ) const { //------------------------------Identity--------------------------------------- // Float's can be converted to doubles with no loss of bits. Hence // converting a float to a double and back to a float is a NOP. -Node *ConvD2FNode::Identity(PhaseTransform *phase) { +Node* ConvD2FNode::Identity(PhaseGVN* phase) { return (in(1)->Opcode() == Op_ConvF2D) ? in(1)->in(1) : this; } //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvD2INode::Value( PhaseTransform *phase ) const { +const Type* ConvD2INode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; if( t == Type::DOUBLE ) return TypeInt::INT; @@ -100,13 +101,13 @@ Node *ConvD2INode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Identity--------------------------------------- // Int's can be converted to doubles with no loss of bits. Hence // converting an integer to a double and back to an integer is a NOP. -Node *ConvD2INode::Identity(PhaseTransform *phase) { +Node* ConvD2INode::Identity(PhaseGVN* phase) { return (in(1)->Opcode() == Op_ConvI2D) ? in(1)->in(1) : this; } //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvD2LNode::Value( PhaseTransform *phase ) const { +const Type* ConvD2LNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; if( t == Type::DOUBLE ) return TypeLong::LONG; @@ -115,7 +116,7 @@ const Type *ConvD2LNode::Value( PhaseTransform *phase ) const { } //------------------------------Identity--------------------------------------- -Node *ConvD2LNode::Identity(PhaseTransform *phase) { +Node* ConvD2LNode::Identity(PhaseGVN* phase) { // Remove ConvD2L->ConvL2D->ConvD2L sequences. if( in(1) ->Opcode() == Op_ConvL2D && in(1)->in(1)->Opcode() == Op_ConvD2L ) @@ -133,7 +134,7 @@ Node *ConvD2LNode::Ideal(PhaseGVN *phase, bool can_reshape) { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvF2DNode::Value( PhaseTransform *phase ) const { +const Type* ConvF2DNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; if( t == Type::FLOAT ) return Type::DOUBLE; @@ -143,7 +144,7 @@ const Type *ConvF2DNode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvF2INode::Value( PhaseTransform *phase ) const { +const Type* ConvF2INode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; if( t == Type::FLOAT ) return TypeInt::INT; @@ -152,7 +153,7 @@ const Type *ConvF2INode::Value( PhaseTransform *phase ) const { } //------------------------------Identity--------------------------------------- -Node *ConvF2INode::Identity(PhaseTransform *phase) { +Node* ConvF2INode::Identity(PhaseGVN* phase) { // Remove ConvF2I->ConvI2F->ConvF2I sequences. if( in(1) ->Opcode() == Op_ConvI2F && in(1)->in(1)->Opcode() == Op_ConvF2I ) @@ -170,7 +171,7 @@ Node *ConvF2INode::Ideal(PhaseGVN *phase, bool can_reshape) { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvF2LNode::Value( PhaseTransform *phase ) const { +const Type* ConvF2LNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; if( t == Type::FLOAT ) return TypeLong::LONG; @@ -179,7 +180,7 @@ const Type *ConvF2LNode::Value( PhaseTransform *phase ) const { } //------------------------------Identity--------------------------------------- -Node *ConvF2LNode::Identity(PhaseTransform *phase) { +Node* ConvF2LNode::Identity(PhaseGVN* phase) { // Remove ConvF2L->ConvL2F->ConvF2L sequences. if( in(1) ->Opcode() == Op_ConvL2F && in(1)->in(1)->Opcode() == Op_ConvF2L ) @@ -197,7 +198,7 @@ Node *ConvF2LNode::Ideal(PhaseGVN *phase, bool can_reshape) { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvI2DNode::Value( PhaseTransform *phase ) const { +const Type* ConvI2DNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; const TypeInt *ti = t->is_int(); @@ -207,7 +208,7 @@ const Type *ConvI2DNode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvI2FNode::Value( PhaseTransform *phase ) const { +const Type* ConvI2FNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; const TypeInt *ti = t->is_int(); @@ -216,7 +217,7 @@ const Type *ConvI2FNode::Value( PhaseTransform *phase ) const { } //------------------------------Identity--------------------------------------- -Node *ConvI2FNode::Identity(PhaseTransform *phase) { +Node* ConvI2FNode::Identity(PhaseGVN* phase) { // Remove ConvI2F->ConvF2I->ConvI2F sequences. if( in(1) ->Opcode() == Op_ConvF2I && in(1)->in(1)->Opcode() == Op_ConvI2F ) @@ -226,7 +227,7 @@ Node *ConvI2FNode::Identity(PhaseTransform *phase) { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvI2LNode::Value( PhaseTransform *phase ) const { +const Type* ConvI2LNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; const TypeInt *ti = t->is_int(); @@ -293,7 +294,8 @@ Node *ConvI2LNode::Ideal(PhaseGVN *phase, bool can_reshape) { } #ifdef _LP64 - // Convert ConvI2L(AddI(x, y)) to AddL(ConvI2L(x), ConvI2L(y)) , + // Convert ConvI2L(AddI(x, y)) to AddL(ConvI2L(x), ConvI2L(y)) or + // ConvI2L(CastII(AddI(x, y))) to AddL(ConvI2L(CastII(x)), ConvI2L(CastII(y))), // but only if x and y have subranges that cannot cause 32-bit overflow, // under the assumption that x+y is in my own subrange this->type(). @@ -317,6 +319,13 @@ Node *ConvI2LNode::Ideal(PhaseGVN *phase, bool can_reshape) { Node* z = in(1); int op = z->Opcode(); + Node* ctrl = NULL; + if (op == Op_CastII && z->as_CastII()->has_range_check()) { + // Skip CastII node but save control dependency + ctrl = z->in(0); + z = z->in(1); + op = z->Opcode(); + } if (op == Op_AddI || op == Op_SubI) { Node* x = z->in(1); Node* y = z->in(2); @@ -374,9 +383,10 @@ Node *ConvI2LNode::Ideal(PhaseGVN *phase, bool can_reshape) { rylo = -ryhi; ryhi = -rylo0; } - - Node* cx = phase->transform( new ConvI2LNode(x, TypeLong::make(rxlo, rxhi, widen)) ); - Node* cy = phase->transform( new ConvI2LNode(y, TypeLong::make(rylo, ryhi, widen)) ); + assert(rxlo == (int)rxlo && rxhi == (int)rxhi, "x should not overflow"); + assert(rylo == (int)rylo && ryhi == (int)ryhi, "y should not overflow"); + Node* cx = phase->C->constrained_convI2L(phase, x, TypeInt::make(rxlo, rxhi, widen), ctrl); + Node* cy = phase->C->constrained_convI2L(phase, y, TypeInt::make(rylo, ryhi, widen), ctrl); switch (op) { case Op_AddI: return new AddLNode(cx, cy); case Op_SubI: return new SubLNode(cx, cy); @@ -390,7 +400,7 @@ Node *ConvI2LNode::Ideal(PhaseGVN *phase, bool can_reshape) { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvL2DNode::Value( PhaseTransform *phase ) const { +const Type* ConvL2DNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; const TypeLong *tl = t->is_long(); @@ -400,7 +410,7 @@ const Type *ConvL2DNode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvL2FNode::Value( PhaseTransform *phase ) const { +const Type* ConvL2FNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; const TypeLong *tl = t->is_long(); @@ -410,14 +420,14 @@ const Type *ConvL2FNode::Value( PhaseTransform *phase ) const { //============================================================================= //----------------------------Identity----------------------------------------- -Node *ConvL2INode::Identity( PhaseTransform *phase ) { +Node* ConvL2INode::Identity(PhaseGVN* phase) { // Convert L2I(I2L(x)) => x if (in(1)->Opcode() == Op_ConvI2L) return in(1)->in(1); return this; } //------------------------------Value------------------------------------------ -const Type *ConvL2INode::Value( PhaseTransform *phase ) const { +const Type* ConvL2INode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; const TypeLong *tl = t->is_long(); @@ -469,7 +479,7 @@ Node *ConvL2INode::Ideal(PhaseGVN *phase, bool can_reshape) { //============================================================================= //------------------------------Identity--------------------------------------- // Remove redundant roundings -Node *RoundFloatNode::Identity( PhaseTransform *phase ) { +Node* RoundFloatNode::Identity(PhaseGVN* phase) { assert(Matcher::strict_fp_requires_explicit_rounding, "should only generate for Intel"); // Do not round constants if (phase->type(in(1))->base() == Type::FloatCon) return in(1); @@ -483,14 +493,14 @@ Node *RoundFloatNode::Identity( PhaseTransform *phase ) { } //------------------------------Value------------------------------------------ -const Type *RoundFloatNode::Value( PhaseTransform *phase ) const { +const Type* RoundFloatNode::Value(PhaseGVN* phase) const { return phase->type( in(1) ); } //============================================================================= //------------------------------Identity--------------------------------------- // Remove redundant roundings. Incoming arguments are already rounded. -Node *RoundDoubleNode::Identity( PhaseTransform *phase ) { +Node* RoundDoubleNode::Identity(PhaseGVN* phase) { assert(Matcher::strict_fp_requires_explicit_rounding, "should only generate for Intel"); // Do not round constants if (phase->type(in(1))->base() == Type::DoubleCon) return in(1); @@ -506,7 +516,7 @@ Node *RoundDoubleNode::Identity( PhaseTransform *phase ) { } //------------------------------Value------------------------------------------ -const Type *RoundDoubleNode::Value( PhaseTransform *phase ) const { +const Type* RoundDoubleNode::Value(PhaseGVN* phase) const { return phase->type( in(1) ); } diff --git a/hotspot/src/share/vm/opto/convertnode.hpp b/hotspot/src/share/vm/opto/convertnode.hpp index ff19db51e55..0a3e78b18dc 100644 --- a/hotspot/src/share/vm/opto/convertnode.hpp +++ b/hotspot/src/share/vm/opto/convertnode.hpp @@ -36,8 +36,8 @@ class Conv2BNode : public Node { Conv2BNode( Node *i ) : Node(0,i) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeInt::BOOL; } - virtual Node *Identity( PhaseTransform *phase ); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; virtual uint ideal_reg() const { return Op_RegI; } }; @@ -49,8 +49,8 @@ class ConvD2FNode : public Node { ConvD2FNode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::FLOAT; } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual uint ideal_reg() const { return Op_RegF; } }; @@ -61,8 +61,8 @@ class ConvD2INode : public Node { ConvD2INode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeInt::INT; } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual uint ideal_reg() const { return Op_RegI; } }; @@ -74,8 +74,8 @@ class ConvD2LNode : public Node { ConvD2LNode( Node *dbl ) : Node(0,dbl) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeLong::LONG; } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual uint ideal_reg() const { return Op_RegL; } }; @@ -87,7 +87,7 @@ class ConvF2DNode : public Node { ConvF2DNode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::DOUBLE; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual uint ideal_reg() const { return Op_RegD; } }; @@ -98,8 +98,8 @@ class ConvF2INode : public Node { ConvF2INode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeInt::INT; } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual uint ideal_reg() const { return Op_RegI; } }; @@ -111,8 +111,8 @@ class ConvF2LNode : public Node { ConvF2LNode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeLong::LONG; } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual uint ideal_reg() const { return Op_RegL; } }; @@ -124,7 +124,7 @@ class ConvI2DNode : public Node { ConvI2DNode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::DOUBLE; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual uint ideal_reg() const { return Op_RegD; } }; @@ -135,8 +135,8 @@ class ConvI2FNode : public Node { ConvI2FNode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::FLOAT; } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual uint ideal_reg() const { return Op_RegF; } }; @@ -148,7 +148,7 @@ class ConvI2LNode : public TypeNode { : TypeNode(t, 2) { init_req(1, in1); } virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual uint ideal_reg() const { return Op_RegL; } }; @@ -160,7 +160,7 @@ class ConvL2DNode : public Node { ConvL2DNode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::DOUBLE; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual uint ideal_reg() const { return Op_RegD; } }; @@ -171,7 +171,7 @@ class ConvL2FNode : public Node { ConvL2FNode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::FLOAT; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual uint ideal_reg() const { return Op_RegF; } }; @@ -182,8 +182,8 @@ class ConvL2INode : public Node { ConvL2INode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeInt::INT; } - virtual Node *Identity( PhaseTransform *phase ); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual uint ideal_reg() const { return Op_RegI; } }; @@ -195,8 +195,8 @@ class RoundFloatNode: public Node { virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::FLOAT; } virtual uint ideal_reg() const { return Op_RegF; } - virtual Node *Identity( PhaseTransform *phase ); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; }; @@ -207,8 +207,8 @@ class RoundDoubleNode: public Node { virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } - virtual Node *Identity( PhaseTransform *phase ); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; }; diff --git a/hotspot/src/share/vm/opto/countbitsnode.cpp b/hotspot/src/share/vm/opto/countbitsnode.cpp index 152c7699ca7..f9de303ffe4 100644 --- a/hotspot/src/share/vm/opto/countbitsnode.cpp +++ b/hotspot/src/share/vm/opto/countbitsnode.cpp @@ -29,7 +29,7 @@ #include "opto/type.hpp" //------------------------------Value------------------------------------------ -const Type* CountLeadingZerosINode::Value(PhaseTransform* phase) const { +const Type* CountLeadingZerosINode::Value(PhaseGVN* phase) const { const Type* t = phase->type(in(1)); if (t == Type::TOP) return Type::TOP; const TypeInt* ti = t->isa_int(); @@ -51,7 +51,7 @@ const Type* CountLeadingZerosINode::Value(PhaseTransform* phase) const { } //------------------------------Value------------------------------------------ -const Type* CountLeadingZerosLNode::Value(PhaseTransform* phase) const { +const Type* CountLeadingZerosLNode::Value(PhaseGVN* phase) const { const Type* t = phase->type(in(1)); if (t == Type::TOP) return Type::TOP; const TypeLong* tl = t->isa_long(); @@ -74,7 +74,7 @@ const Type* CountLeadingZerosLNode::Value(PhaseTransform* phase) const { } //------------------------------Value------------------------------------------ -const Type* CountTrailingZerosINode::Value(PhaseTransform* phase) const { +const Type* CountTrailingZerosINode::Value(PhaseGVN* phase) const { const Type* t = phase->type(in(1)); if (t == Type::TOP) return Type::TOP; const TypeInt* ti = t->isa_int(); @@ -96,7 +96,7 @@ const Type* CountTrailingZerosINode::Value(PhaseTransform* phase) const { } //------------------------------Value------------------------------------------ -const Type* CountTrailingZerosLNode::Value(PhaseTransform* phase) const { +const Type* CountTrailingZerosLNode::Value(PhaseGVN* phase) const { const Type* t = phase->type(in(1)); if (t == Type::TOP) return Type::TOP; const TypeLong* tl = t->isa_long(); diff --git a/hotspot/src/share/vm/opto/countbitsnode.hpp b/hotspot/src/share/vm/opto/countbitsnode.hpp index 0ead252ee89..1a8a65269ab 100644 --- a/hotspot/src/share/vm/opto/countbitsnode.hpp +++ b/hotspot/src/share/vm/opto/countbitsnode.hpp @@ -44,7 +44,7 @@ class CountLeadingZerosINode : public CountBitsNode { public: CountLeadingZerosINode(Node* in1) : CountBitsNode(in1) {} virtual int Opcode() const; - virtual const Type* Value(PhaseTransform* phase) const; + virtual const Type* Value(PhaseGVN* phase) const; }; //---------- CountLeadingZerosLNode -------------------------------------------- @@ -53,7 +53,7 @@ class CountLeadingZerosLNode : public CountBitsNode { public: CountLeadingZerosLNode(Node* in1) : CountBitsNode(in1) {} virtual int Opcode() const; - virtual const Type* Value(PhaseTransform* phase) const; + virtual const Type* Value(PhaseGVN* phase) const; }; //---------- CountTrailingZerosINode ------------------------------------------- @@ -62,7 +62,7 @@ class CountTrailingZerosINode : public CountBitsNode { public: CountTrailingZerosINode(Node* in1) : CountBitsNode(in1) {} virtual int Opcode() const; - virtual const Type* Value(PhaseTransform* phase) const; + virtual const Type* Value(PhaseGVN* phase) const; }; //---------- CountTrailingZerosLNode ------------------------------------------- @@ -71,7 +71,7 @@ class CountTrailingZerosLNode : public CountBitsNode { public: CountTrailingZerosLNode(Node* in1) : CountBitsNode(in1) {} virtual int Opcode() const; - virtual const Type* Value(PhaseTransform* phase) const; + virtual const Type* Value(PhaseGVN* phase) const; }; //---------- PopCountINode ----------------------------------------------------- diff --git a/hotspot/src/share/vm/opto/divnode.cpp b/hotspot/src/share/vm/opto/divnode.cpp index 002417d0f55..de839cc2c6b 100644 --- a/hotspot/src/share/vm/opto/divnode.cpp +++ b/hotspot/src/share/vm/opto/divnode.cpp @@ -457,7 +457,7 @@ static Node *transform_long_divide( PhaseGVN *phase, Node *dividend, jlong divis //============================================================================= //------------------------------Identity--------------------------------------- // If the divisor is 1, we are an identity on the dividend. -Node *DivINode::Identity( PhaseTransform *phase ) { +Node* DivINode::Identity(PhaseGVN* phase) { return (phase->type( in(2) )->higher_equal(TypeInt::ONE)) ? in(1) : this; } @@ -493,7 +493,7 @@ Node *DivINode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Value------------------------------------------ // A DivINode divides its inputs. The third input is a Control input, used to // prevent hoisting the divide above an unsafe test. -const Type *DivINode::Value( PhaseTransform *phase ) const { +const Type* DivINode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -559,7 +559,7 @@ const Type *DivINode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Identity--------------------------------------- // If the divisor is 1, we are an identity on the dividend. -Node *DivLNode::Identity( PhaseTransform *phase ) { +Node* DivLNode::Identity(PhaseGVN* phase) { return (phase->type( in(2) )->higher_equal(TypeLong::ONE)) ? in(1) : this; } @@ -595,7 +595,7 @@ Node *DivLNode::Ideal( PhaseGVN *phase, bool can_reshape) { //------------------------------Value------------------------------------------ // A DivLNode divides its inputs. The third input is a Control input, used to // prevent hoisting the divide above an unsafe test. -const Type *DivLNode::Value( PhaseTransform *phase ) const { +const Type* DivLNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -662,7 +662,7 @@ const Type *DivLNode::Value( PhaseTransform *phase ) const { //------------------------------Value------------------------------------------ // An DivFNode divides its inputs. The third input is a Control input, used to // prevent hoisting the divide above an unsafe test. -const Type *DivFNode::Value( PhaseTransform *phase ) const { +const Type* DivFNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -705,7 +705,7 @@ const Type *DivFNode::Value( PhaseTransform *phase ) const { //------------------------------isA_Copy--------------------------------------- // Dividing by self is 1. // If the divisor is 1, we are an identity on the dividend. -Node *DivFNode::Identity( PhaseTransform *phase ) { +Node* DivFNode::Identity(PhaseGVN* phase) { return (phase->type( in(2) ) == TypeF::ONE) ? in(1) : this; } @@ -750,7 +750,7 @@ Node *DivFNode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Value------------------------------------------ // An DivDNode divides its inputs. The third input is a Control input, used to // prevent hoisting the divide above an unsafe test. -const Type *DivDNode::Value( PhaseTransform *phase ) const { +const Type* DivDNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -800,7 +800,7 @@ const Type *DivDNode::Value( PhaseTransform *phase ) const { //------------------------------isA_Copy--------------------------------------- // Dividing by self is 1. // If the divisor is 1, we are an identity on the dividend. -Node *DivDNode::Identity( PhaseTransform *phase ) { +Node* DivDNode::Identity(PhaseGVN* phase) { return (phase->type( in(2) ) == TypeD::ONE) ? in(1) : this; } @@ -972,7 +972,7 @@ Node *ModINode::Ideal(PhaseGVN *phase, bool can_reshape) { } //------------------------------Value------------------------------------------ -const Type *ModINode::Value( PhaseTransform *phase ) const { +const Type* ModINode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -1145,7 +1145,7 @@ Node *ModLNode::Ideal(PhaseGVN *phase, bool can_reshape) { } //------------------------------Value------------------------------------------ -const Type *ModLNode::Value( PhaseTransform *phase ) const { +const Type* ModLNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -1186,7 +1186,7 @@ const Type *ModLNode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ModFNode::Value( PhaseTransform *phase ) const { +const Type* ModFNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -1230,7 +1230,7 @@ const Type *ModFNode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ModDNode::Value( PhaseTransform *phase ) const { +const Type* ModDNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); diff --git a/hotspot/src/share/vm/opto/divnode.hpp b/hotspot/src/share/vm/opto/divnode.hpp index 195803e2000..b1bf06e6750 100644 --- a/hotspot/src/share/vm/opto/divnode.hpp +++ b/hotspot/src/share/vm/opto/divnode.hpp @@ -44,9 +44,9 @@ class DivINode : public Node { public: DivINode( Node *c, Node *dividend, Node *divisor ) : Node(c, dividend, divisor ) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } }; @@ -57,9 +57,9 @@ class DivLNode : public Node { public: DivLNode( Node *c, Node *dividend, Node *divisor ) : Node(c, dividend, divisor ) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } }; @@ -70,9 +70,9 @@ class DivFNode : public Node { public: DivFNode( Node *c, Node *dividend, Node *divisor ) : Node(c, dividend, divisor) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const { return Type::FLOAT; } virtual uint ideal_reg() const { return Op_RegF; } }; @@ -83,9 +83,9 @@ class DivDNode : public Node { public: DivDNode( Node *c, Node *dividend, Node *divisor ) : Node(c,dividend, divisor) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } }; @@ -96,7 +96,7 @@ class ModINode : public Node { public: ModINode( Node *c, Node *in1, Node *in2 ) : Node(c,in1, in2) {} virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } @@ -108,7 +108,7 @@ class ModLNode : public Node { public: ModLNode( Node *c, Node *in1, Node *in2 ) : Node(c,in1, in2) {} virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } @@ -120,7 +120,7 @@ class ModFNode : public Node { public: ModFNode( Node *c, Node *in1, Node *in2 ) : Node(c,in1, in2) {} virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const { return Type::FLOAT; } virtual uint ideal_reg() const { return Op_RegF; } }; @@ -131,7 +131,7 @@ class ModDNode : public Node { public: ModDNode( Node *c, Node *in1, Node *in2 ) : Node(c, in1, in2) {} virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } }; @@ -147,9 +147,9 @@ public: mod_proj_num = 1 // remainder }; virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ) { return this; } + virtual Node* Identity(PhaseGVN* phase) { return this; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape) { return NULL; } - virtual const Type *Value( PhaseTransform *phase ) const { return bottom_type(); } + virtual const Type* Value(PhaseGVN* phase) const { return bottom_type(); } virtual uint hash() const { return Node::hash(); } virtual bool is_CFG() const { return false; } virtual uint ideal_reg() const { return NotAMachineReg; } diff --git a/hotspot/src/share/vm/opto/escape.cpp b/hotspot/src/share/vm/opto/escape.cpp index 98bade2457e..310ac7fa70e 100644 --- a/hotspot/src/share/vm/opto/escape.cpp +++ b/hotspot/src/share/vm/opto/escape.cpp @@ -810,6 +810,7 @@ void ConnectionGraph::add_call_node(CallNode* call) { if (cik->is_subclass_of(_compile->env()->Thread_klass()) || cik->is_subclass_of(_compile->env()->Reference_klass()) || !cik->is_instance_klass() || // StressReflectiveCode + !cik->as_instance_klass()->can_be_instantiated() || cik->as_instance_klass()->has_finalizer()) { es = PointsToNode::GlobalEscape; } diff --git a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp index 833be199daa..48376b2f57a 100644 --- a/hotspot/src/share/vm/opto/gcm.cpp +++ b/hotspot/src/share/vm/opto/gcm.cpp @@ -101,7 +101,32 @@ void PhaseCFG::replace_block_proj_ctrl( Node *n ) { } } -static bool is_dominator(Block* d, Block* n) { +bool PhaseCFG::is_dominator(Node* dom_node, Node* node) { + if (dom_node == node) { + return true; + } + Block* d = get_block_for_node(dom_node); + Block* n = get_block_for_node(node); + if (d == n) { + if (dom_node->is_block_start()) { + return true; + } + if (node->is_block_start()) { + return false; + } + if (dom_node->is_block_proj()) { + return false; + } + if (node->is_block_proj()) { + return true; + } +#ifdef ASSERT + node->dump(); + dom_node->dump(); +#endif + fatal("unhandled"); + return false; + } return d->dom_lca(n) == d; } @@ -145,19 +170,15 @@ void PhaseCFG::schedule_pinned_nodes(VectorSet &visited) { if (n == NULL) { n = m; } else { - Block* bn = get_block_for_node(n); - Block* bm = get_block_for_node(m); - assert(is_dominator(bn, bm) || is_dominator(bm, bn), "one must dominate the other"); - n = is_dominator(bn, bm) ? m : n; + assert(is_dominator(n, m) || is_dominator(m, n), "one must dominate the other"); + n = is_dominator(n, m) ? m : n; } } } if (n != NULL) { assert(node->in(0), "control should have been set"); - Block* bn = get_block_for_node(n); - Block* bnode = get_block_for_node(node->in(0)); - assert(is_dominator(bn, bnode) || is_dominator(bnode, bn), "one must dominate the other"); - if (!is_dominator(bn, bnode)) { + assert(is_dominator(n, node->in(0)) || is_dominator(node->in(0), n), "one must dominate the other"); + if (!is_dominator(n, node->in(0))) { node->set_req(0, n); } } diff --git a/hotspot/src/share/vm/opto/graphKit.cpp b/hotspot/src/share/vm/opto/graphKit.cpp index 97ae61503a0..f3389bd969b 100644 --- a/hotspot/src/share/vm/opto/graphKit.cpp +++ b/hotspot/src/share/vm/opto/graphKit.cpp @@ -1658,7 +1658,7 @@ Node* GraphKit::store_oop_to_unknown(Node* ctl, //-------------------------array_element_address------------------------- Node* GraphKit::array_element_address(Node* ary, Node* idx, BasicType elembt, - const TypeInt* sizetype) { + const TypeInt* sizetype, Node* ctrl) { uint shift = exact_log2(type2aelembytes(elembt)); uint header = arrayOopDesc::base_offset_in_bytes(elembt); @@ -1671,7 +1671,7 @@ Node* GraphKit::array_element_address(Node* ary, Node* idx, BasicType elembt, // must be correct type for alignment purposes Node* base = basic_plus_adr(ary, header); - idx = Compile::conv_I2X_index(&_gvn, idx, sizetype); + idx = Compile::conv_I2X_index(&_gvn, idx, sizetype, ctrl); Node* scale = _gvn.transform( new LShiftXNode(idx, intcon(shift)) ); return basic_plus_adr(ary, base, scale); } @@ -3407,8 +3407,7 @@ Node* GraphKit::new_instance(Node* klass_node, if (layout_is_con) { assert(!StressReflectiveCode, "stress mode does not use these paths"); bool must_go_slow = Klass::layout_helper_needs_slow_path(layout_con); - initial_slow_test = must_go_slow? intcon(1): extra_slow_test; - + initial_slow_test = must_go_slow ? intcon(1) : extra_slow_test; } else { // reflective case // This reflective path is used by Unsafe.allocateInstance. // (It may be stress-tested by specifying StressReflectiveCode.) @@ -3507,10 +3506,6 @@ Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable) Node* initial_slow_cmp = _gvn.transform( new CmpUNode( length, intcon( fast_size_limit ) ) ); Node* initial_slow_test = _gvn.transform( new BoolNode( initial_slow_cmp, BoolTest::gt ) ); - if (initial_slow_test->is_Bool()) { - // Hide it behind a CMoveI, or else PhaseIdealLoop::split_up will get sick. - initial_slow_test = initial_slow_test->as_Bool()->as_int_value(&_gvn); - } // --- Size Computation --- // array_size = round_to_heap(array_header + (length << elem_shift)); @@ -3556,13 +3551,35 @@ Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable) Node* lengthx = ConvI2X(length); Node* headerx = ConvI2X(header_size); #ifdef _LP64 - { const TypeLong* tllen = _gvn.find_long_type(lengthx); - if (tllen != NULL && tllen->_lo < 0) { + { const TypeInt* tilen = _gvn.find_int_type(length); + if (tilen != NULL && tilen->_lo < 0) { // Add a manual constraint to a positive range. Cf. array_element_address. - jlong size_max = arrayOopDesc::max_array_length(T_BYTE); - if (size_max > tllen->_hi) size_max = tllen->_hi; - const TypeLong* tlcon = TypeLong::make(CONST64(0), size_max, Type::WidenMin); - lengthx = _gvn.transform( new ConvI2LNode(length, tlcon)); + jint size_max = fast_size_limit; + if (size_max > tilen->_hi) size_max = tilen->_hi; + const TypeInt* tlcon = TypeInt::make(0, size_max, Type::WidenMin); + + // Only do a narrow I2L conversion if the range check passed. + IfNode* iff = new IfNode(control(), initial_slow_test, PROB_MIN, COUNT_UNKNOWN); + _gvn.transform(iff); + RegionNode* region = new RegionNode(3); + _gvn.set_type(region, Type::CONTROL); + lengthx = new PhiNode(region, TypeLong::LONG); + _gvn.set_type(lengthx, TypeLong::LONG); + + // Range check passed. Use ConvI2L node with narrow type. + Node* passed = IfFalse(iff); + region->init_req(1, passed); + // Make I2L conversion control dependent to prevent it from + // floating above the range check during loop optimizations. + lengthx->init_req(1, C->constrained_convI2L(&_gvn, length, tlcon, passed)); + + // Range check failed. Use ConvI2L with wide type because length may be invalid. + region->init_req(2, IfTrue(iff)); + lengthx->init_req(2, ConvI2X(length)); + + set_control(region); + record_for_igvn(region); + record_for_igvn(lengthx); } } #endif @@ -3593,6 +3610,11 @@ Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable) Node *mem = reset_memory(); set_all_memory(mem); // Create new memory state + if (initial_slow_test->is_Bool()) { + // Hide it behind a CMoveI, or else PhaseIdealLoop::split_up will get sick. + initial_slow_test = initial_slow_test->as_Bool()->as_int_value(&_gvn); + } + // Create the AllocateArrayNode and its result projections AllocateArrayNode* alloc = new AllocateArrayNode(C, AllocateArrayNode::alloc_type(TypeInt::INT), @@ -4341,20 +4363,51 @@ void GraphKit::store_String_coder(Node* ctrl, Node* str, Node* value) { value, T_BYTE, coder_field_idx, MemNode::unordered); } -Node* GraphKit::compress_string(Node* src, Node* dst, Node* count) { +// Capture src and dst memory state with a MergeMemNode +Node* GraphKit::capture_memory(const TypePtr* src_type, const TypePtr* dst_type) { + if (src_type == dst_type) { + // Types are equal, we don't need a MergeMemNode + return memory(src_type); + } + MergeMemNode* merge = MergeMemNode::make(map()->memory()); + record_for_igvn(merge); // fold it up later, if possible + int src_idx = C->get_alias_index(src_type); + int dst_idx = C->get_alias_index(dst_type); + merge->set_memory_at(src_idx, memory(src_idx)); + merge->set_memory_at(dst_idx, memory(dst_idx)); + return merge; +} + +Node* GraphKit::compress_string(Node* src, const TypeAryPtr* src_type, Node* dst, Node* count) { assert(Matcher::match_rule_supported(Op_StrCompressedCopy), "Intrinsic not supported"); - uint idx = C->get_alias_index(TypeAryPtr::BYTES); - StrCompressedCopyNode* str = new StrCompressedCopyNode(control(), memory(idx), src, dst, count); + assert(src_type == TypeAryPtr::BYTES || src_type == TypeAryPtr::CHARS, "invalid source type"); + // If input and output memory types differ, capture both states to preserve + // the dependency between preceding and subsequent loads/stores. + // For example, the following program: + // StoreB + // compress_string + // LoadB + // has this memory graph (use->def): + // LoadB -> compress_string -> CharMem + // ... -> StoreB -> ByteMem + // The intrinsic hides the dependency between LoadB and StoreB, causing + // the load to read from memory not containing the result of the StoreB. + // The correct memory graph should look like this: + // LoadB -> compress_string -> MergeMem(CharMem, StoreB(ByteMem)) + Node* mem = capture_memory(src_type, TypeAryPtr::BYTES); + StrCompressedCopyNode* str = new StrCompressedCopyNode(control(), mem, src, dst, count); Node* res_mem = _gvn.transform(new SCMemProjNode(str)); - set_memory(res_mem, idx); + set_memory(res_mem, TypeAryPtr::BYTES); return str; } -void GraphKit::inflate_string(Node* src, Node* dst, Node* count) { +void GraphKit::inflate_string(Node* src, Node* dst, const TypeAryPtr* dst_type, Node* count) { assert(Matcher::match_rule_supported(Op_StrInflatedCopy), "Intrinsic not supported"); - uint idx = C->get_alias_index(TypeAryPtr::BYTES); - StrInflatedCopyNode* str = new StrInflatedCopyNode(control(), memory(idx), src, dst, count); - set_memory(_gvn.transform(str), idx); + assert(dst_type == TypeAryPtr::BYTES || dst_type == TypeAryPtr::CHARS, "invalid dest type"); + // Capture src and dst memory (see comment in 'compress_string'). + Node* mem = capture_memory(TypeAryPtr::BYTES, dst_type); + StrInflatedCopyNode* str = new StrInflatedCopyNode(control(), mem, src, dst, count); + set_memory(_gvn.transform(str), dst_type); } void GraphKit::inflate_string_slow(Node* src, Node* dst, Node* start, Node* count) { diff --git a/hotspot/src/share/vm/opto/graphKit.hpp b/hotspot/src/share/vm/opto/graphKit.hpp index 4b4be335cd3..7bb1f6946db 100644 --- a/hotspot/src/share/vm/opto/graphKit.hpp +++ b/hotspot/src/share/vm/opto/graphKit.hpp @@ -634,7 +634,9 @@ class GraphKit : public Phase { // Return addressing for an array element. Node* array_element_address(Node* ary, Node* idx, BasicType elembt, // Optional constraint on the array size: - const TypeInt* sizetype = NULL); + const TypeInt* sizetype = NULL, + // Optional control dependency (for example, on range check) + Node* ctrl = NULL); // Return a load of array element at idx. Node* load_array_element(Node* ctl, Node* ary, Node* idx, const TypeAryPtr* arytype); @@ -881,8 +883,9 @@ class GraphKit : public Phase { Node* load_String_coder(Node* ctrl, Node* str); void store_String_value(Node* ctrl, Node* str, Node* value); void store_String_coder(Node* ctrl, Node* str, Node* value); - Node* compress_string(Node* src, Node* dst, Node* count); - void inflate_string(Node* src, Node* dst, Node* count); + Node* capture_memory(const TypePtr* src_type, const TypePtr* dst_type); + Node* compress_string(Node* src, const TypeAryPtr* src_type, Node* dst, Node* count); + void inflate_string(Node* src, Node* dst, const TypeAryPtr* dst_type, Node* count); void inflate_string_slow(Node* src, Node* dst, Node* start, Node* count); // Handy for making control flow diff --git a/hotspot/src/share/vm/opto/ifnode.cpp b/hotspot/src/share/vm/opto/ifnode.cpp index c8205690bb0..a2cea88273f 100644 --- a/hotspot/src/share/vm/opto/ifnode.cpp +++ b/hotspot/src/share/vm/opto/ifnode.cpp @@ -45,7 +45,7 @@ extern int explicit_null_checks_elided; //============================================================================= //------------------------------Value------------------------------------------ // Return a tuple for whichever arm of the IF is reachable -const Type *IfNode::Value( PhaseTransform *phase ) const { +const Type* IfNode::Value(PhaseGVN* phase) const { if( !in(0) ) return Type::TOP; if( phase->type(in(0)) == Type::TOP ) return Type::TOP; @@ -1104,7 +1104,8 @@ void IfNode::improve_address_types(Node* l, Node* r, ProjNode* fail, PhaseIterGV if (ctrl == fail) { Node* init_n = stack.node_at(1); assert(init_n->Opcode() == Op_ConvI2L, "unexpected first node"); - Node* new_n = igvn->C->conv_I2X_index(igvn, l, array_size); + // Create a new narrow ConvI2L node that is dependent on the range check + Node* new_n = igvn->C->conv_I2X_index(igvn, l, array_size, fail); // The type of the ConvI2L may be widen and so the new // ConvI2L may not be better than an existing ConvI2L @@ -1527,16 +1528,19 @@ Node* IfNode::search_identical(int dist) { //------------------------------Identity--------------------------------------- // If the test is constant & we match, then we are the input Control -Node *IfProjNode::Identity(PhaseTransform *phase) { +Node* IfProjNode::Identity(PhaseGVN* phase) { // Can only optimize if cannot go the other way const TypeTuple *t = phase->type(in(0))->is_tuple(); - if (t == TypeTuple::IFNEITHER || - // kill dead branch first otherwise the IfNode's control will - // have 2 control uses (the IfNode that doesn't go away because - // it still has uses and this branch of the - // If). Node::has_special_unique_user() will cause this node to - // be reprocessed once the dead branch is killed. - (always_taken(t) && in(0)->outcnt() == 1)) { + if (t == TypeTuple::IFNEITHER || (always_taken(t) && + // During parsing (GVN) we don't remove dead code aggressively. + // Cut off dead branch and let PhaseRemoveUseless take care of it. + (!phase->is_IterGVN() || + // During IGVN, first wait for the dead branch to be killed. + // Otherwise, the IfNode's control will have two control uses (the IfNode + // that doesn't go away because it still has uses and this branch of the + // If) which breaks other optimizations. Node::has_special_unique_user() + // will cause this node to be reprocessed once the dead branch is killed. + in(0)->outcnt() == 1))) { // IfNode control return in(0)->in(0); } diff --git a/hotspot/src/share/vm/opto/intrinsicnode.cpp b/hotspot/src/share/vm/opto/intrinsicnode.cpp index e72c3e221e1..064e73aab2c 100644 --- a/hotspot/src/share/vm/opto/intrinsicnode.cpp +++ b/hotspot/src/share/vm/opto/intrinsicnode.cpp @@ -55,7 +55,7 @@ Node* StrIntrinsicNode::Ideal(PhaseGVN* phase, bool can_reshape) { } //------------------------------Value------------------------------------------ -const Type* StrIntrinsicNode::Value(PhaseTransform* phase) const { +const Type* StrIntrinsicNode::Value(PhaseGVN* phase) const { if (in(0) && phase->type(in(0)) == Type::TOP) return Type::TOP; return bottom_type(); } @@ -93,7 +93,7 @@ Node* EncodeISOArrayNode::Ideal(PhaseGVN* phase, bool can_reshape) { } //------------------------------Value------------------------------------------ -const Type* EncodeISOArrayNode::Value(PhaseTransform* phase) const { +const Type* EncodeISOArrayNode::Value(PhaseGVN* phase) const { if (in(0) && phase->type(in(0)) == Type::TOP) return Type::TOP; return bottom_type(); } diff --git a/hotspot/src/share/vm/opto/intrinsicnode.hpp b/hotspot/src/share/vm/opto/intrinsicnode.hpp index d5bc0c70742..450638076b8 100644 --- a/hotspot/src/share/vm/opto/intrinsicnode.hpp +++ b/hotspot/src/share/vm/opto/intrinsicnode.hpp @@ -77,7 +77,7 @@ class StrIntrinsicNode: public Node { virtual uint match_edge(uint idx) const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); - virtual const Type* Value(PhaseTransform* phase) const; + virtual const Type* Value(PhaseGVN* phase) const; ArgEncoding encoding() const { return _encoding; } }; @@ -177,7 +177,7 @@ class EncodeISOArrayNode: public Node { virtual uint match_edge(uint idx) const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); - virtual const Type* Value(PhaseTransform* phase) const; + virtual const Type* Value(PhaseGVN* phase) const; }; #endif // SHARE_VM_OPTO_INTRINSICNODE_HPP diff --git a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp index 57614f7cddf..3edfc5e0ef0 100644 --- a/hotspot/src/share/vm/opto/lcm.cpp +++ b/hotspot/src/share/vm/opto/lcm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, 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 @@ -949,6 +949,13 @@ bool PhaseCFG::schedule_local(Block* block, GrowableArray& ready_cnt, Vecto // and the edge will be lost. This is why this code should be // executed only when Precedent (== TypeFunc::Parms) edge is present. Node *x = n->in(TypeFunc::Parms); + if (x != NULL && get_block_for_node(x) == block && n->find_prec_edge(x) != -1) { + // Old edge to node within same block will get removed, but no precedence + // edge will get added because it already exists. Update ready count. + int cnt = ready_cnt.at(n->_idx); + assert(cnt > 1, "MemBar node %d must not get ready here", n->_idx); + ready_cnt.at_put(n->_idx, cnt-1); + } n->del_req(TypeFunc::Parms); n->add_prec(x); } diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 5bcd0b06623..0ab8dbb540f 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, 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 @@ -971,8 +971,10 @@ Node* LibraryCallKit::make_string_method_node(int opcode, Node* str1_start, Node str1_start, cnt1, str2_start, cnt2, ae); break; case Op_StrEquals: + // We already know that cnt1 == cnt2 here (checked in 'inline_string_equals'). + // Use the constant length if there is one because optimized match rule may exist. result = new StrEqualsNode(control(), memory(TypeAryPtr::BYTES), - str1_start, str2_start, cnt1, ae); + str1_start, str2_start, cnt2->is_Con() ? cnt2 : cnt1, ae); break; default: ShouldNotReachHere(); @@ -1131,7 +1133,7 @@ bool LibraryCallKit::inline_objects_checkIndex() { //------------------------------inline_string_indexOf------------------------ bool LibraryCallKit::inline_string_indexOf(StrIntrinsicNode::ArgEnc ae) { - if (!Matcher::has_match_rule(Op_StrIndexOf) || !UseSSE42Intrinsics) { + if (!Matcher::match_rule_supported(Op_StrIndexOf)) { return false; } Node* src = argument(0); @@ -1175,7 +1177,7 @@ bool LibraryCallKit::inline_string_indexOfI(StrIntrinsicNode::ArgEnc ae) { if (too_many_traps(Deoptimization::Reason_intrinsic)) { return false; } - if (!Matcher::has_match_rule(Op_StrIndexOf) || !UseSSE42Intrinsics) { + if (!Matcher::match_rule_supported(Op_StrIndexOf)) { return false; } assert(callee()->signature()->size() == 5, "String.indexOf() has 5 arguments"); @@ -1260,7 +1262,7 @@ bool LibraryCallKit::inline_string_indexOfChar() { if (too_many_traps(Deoptimization::Reason_intrinsic)) { return false; } - if (!Matcher::has_match_rule(Op_StrIndexOfChar) || !(UseSSE > 4)) { + if (!Matcher::match_rule_supported(Op_StrIndexOfChar)) { return false; } assert(callee()->signature()->size() == 4, "String.indexOfChar() has 4 arguments"); @@ -1359,9 +1361,9 @@ bool LibraryCallKit::inline_string_copy(bool compress) { // 'dst_start' points to dst array + scaled offset Node* count = NULL; if (compress) { - count = compress_string(src_start, dst_start, length); + count = compress_string(src_start, TypeAryPtr::get_array_body_type(src_elem), dst_start, length); } else { - inflate_string(src_start, dst_start, length); + inflate_string(src_start, dst_start, TypeAryPtr::get_array_body_type(dst_elem), length); } if (alloc != NULL) { @@ -1587,7 +1589,7 @@ bool LibraryCallKit::inline_string_char_access(bool is_store) { (void) store_to_memory(control(), adr, ch, T_CHAR, TypeAryPtr::BYTES, MemNode::unordered, false, false, true /* mismatched */); } else { - ch = make_load(control(), adr, TypeInt::CHAR, T_CHAR, MemNode::unordered, + ch = make_load(control(), adr, TypeInt::CHAR, T_CHAR, TypeAryPtr::BYTES, MemNode::unordered, LoadNode::DependsOnlyOnTest, false, false, true /* mismatched */); set_result(ch); } @@ -1628,8 +1630,6 @@ bool LibraryCallKit::inline_trig(vmIntrinsics::ID id) { Node* n = NULL; switch (id) { - case vmIntrinsics::_dsin: n = new SinDNode(C, control(), arg); break; - case vmIntrinsics::_dcos: n = new CosDNode(C, control(), arg); break; case vmIntrinsics::_dtan: n = new TanDNode(C, control(), arg); break; default: fatal_unexpected_iid(id); break; } @@ -1692,16 +1692,6 @@ bool LibraryCallKit::inline_trig(vmIntrinsics::ID id) { // Slow path - non-blocking leaf call Node* call = NULL; switch (id) { - case vmIntrinsics::_dsin: - call = make_runtime_call(RC_LEAF, OptoRuntime::Math_D_D_Type(), - CAST_FROM_FN_PTR(address, SharedRuntime::dsin), - "Sin", NULL, arg, top()); - break; - case vmIntrinsics::_dcos: - call = make_runtime_call(RC_LEAF, OptoRuntime::Math_D_D_Type(), - CAST_FROM_FN_PTR(address, SharedRuntime::dcos), - "Cos", NULL, arg, top()); - break; case vmIntrinsics::_dtan: call = make_runtime_call(RC_LEAF, OptoRuntime::Math_D_D_Type(), CAST_FROM_FN_PTR(address, SharedRuntime::dtan), @@ -1752,17 +1742,21 @@ bool LibraryCallKit::inline_math_native(vmIntrinsics::ID id) { #define FN_PTR(f) CAST_FROM_FN_PTR(address, f) switch (id) { // These intrinsics are not properly supported on all hardware - case vmIntrinsics::_dcos: return Matcher::has_match_rule(Op_CosD) ? inline_trig(id) : - runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dcos), "COS"); - case vmIntrinsics::_dsin: return Matcher::has_match_rule(Op_SinD) ? inline_trig(id) : - runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dsin), "SIN"); + case vmIntrinsics::_dsin: + return StubRoutines::dsin() != NULL ? + runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dsin(), "dsin") : + runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dsin), "SIN"); + case vmIntrinsics::_dcos: + return StubRoutines::dcos() != NULL ? + runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dcos(), "dcos") : + runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dcos), "COS"); case vmIntrinsics::_dtan: return Matcher::has_match_rule(Op_TanD) ? inline_trig(id) : runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dtan), "TAN"); case vmIntrinsics::_dlog: return StubRoutines::dlog() != NULL ? - runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dlog(), "dlog") : - runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dlog), "LOG"); + runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dlog(), "dlog") : + runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dlog), "LOG"); case vmIntrinsics::_dlog10: return Matcher::has_match_rule(Op_Log10D) ? inline_math(id) : runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dlog10), "LOG10"); @@ -3085,7 +3079,7 @@ bool LibraryCallKit::inline_native_isInterrupted() { set_control( _gvn.transform(new IfTrueNode(iff_arg))); #else // To return true on Windows you must read the _interrupted field - // and check the the event state i.e. take the slow path. + // and check the event state i.e. take the slow path. #endif // TARGET_OS_FAMILY_windows // (d) Otherwise, go to the slow path. @@ -3159,7 +3153,7 @@ Node* LibraryCallKit::load_klass_from_mirror_common(Node* mirror, } //--------------------(inline_native_Class_query helpers)--------------------- -// Use this for JVM_ACC_INTERFACE, JVM_ACC_IS_CLONEABLE, JVM_ACC_HAS_FINALIZER. +// Use this for JVM_ACC_INTERFACE, JVM_ACC_IS_CLONEABLE_FAST, JVM_ACC_HAS_FINALIZER. // Fall through if (mods & mask) == bits, take the guard otherwise. Node* LibraryCallKit::generate_access_flags_guard(Node* kls, int modifier_mask, int modifier_bits, RegionNode* region) { // Branch around if the given klass has the given modifier bit set. @@ -4497,14 +4491,14 @@ bool LibraryCallKit::inline_native_clone(bool is_virtual) { generate_virtual_guard(obj_klass, slow_region); } - // The object must be cloneable and must not have a finalizer. + // The object must be easily cloneable and must not have a finalizer. // Both of these conditions may be checked in a single test. - // We could optimize the cloneable test further, but we don't care. + // We could optimize the test further, but we don't care. generate_access_flags_guard(obj_klass, // Test both conditions: - JVM_ACC_IS_CLONEABLE | JVM_ACC_HAS_FINALIZER, + JVM_ACC_IS_CLONEABLE_FAST | JVM_ACC_HAS_FINALIZER, // Must be cloneable but not finalizer: - JVM_ACC_IS_CLONEABLE, + JVM_ACC_IS_CLONEABLE_FAST, slow_region); } diff --git a/hotspot/src/share/vm/opto/locknode.hpp b/hotspot/src/share/vm/opto/locknode.hpp index 515a40c4663..b0e62ecef00 100644 --- a/hotspot/src/share/vm/opto/locknode.hpp +++ b/hotspot/src/share/vm/opto/locknode.hpp @@ -96,7 +96,7 @@ public: virtual uint size_of() const; virtual uint cmp( const Node &n ) const ; // Always fail, except on self virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const { return TypeInt::CC; } + virtual const Type* Value(PhaseGVN* phase) const { return TypeInt::CC; } const Type *sub(const Type *t1, const Type *t2) const { return TypeInt::CC;} void create_lock_counter(JVMState* s); @@ -123,7 +123,7 @@ public: virtual uint hash() const ; // { return NO_HASH; } virtual uint cmp( const Node &n ) const ; // Always fail, except on self virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const { return TypeInt::CC; } + virtual const Type* Value(PhaseGVN* phase) const { return TypeInt::CC; } const Type *sub(const Type *t1, const Type *t2) const { return TypeInt::CC;} }; diff --git a/hotspot/src/share/vm/opto/loopPredicate.cpp b/hotspot/src/share/vm/opto/loopPredicate.cpp index 9cc6961931e..56d21451ef8 100644 --- a/hotspot/src/share/vm/opto/loopPredicate.cpp +++ b/hotspot/src/share/vm/opto/loopPredicate.cpp @@ -519,7 +519,31 @@ class Invariance : public StackObj { _lpt(lpt), _phase(lpt->_phase), _visited(area), _invariant(area), _stack(area, 10 /* guess */), _clone_visited(area), _old_new(area) - {} + { + Node* head = _lpt->_head; + Node* entry = head->in(LoopNode::EntryControl); + if (entry->outcnt() != 1) { + // If a node is pinned between the predicates and the loop + // entry, we won't be able to move any node in the loop that + // depends on it above it in a predicate. Mark all those nodes + // as non loop invariatnt. + Unique_Node_List wq; + wq.push(entry); + for (uint next = 0; next < wq.size(); ++next) { + Node *n = wq.at(next); + for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) { + Node* u = n->fast_out(i); + if (!u->is_CFG()) { + Node* c = _phase->get_ctrl(u); + if (_lpt->is_member(_phase->get_loop(c)) || _phase->is_dominator(c, head)) { + _visited.set(u->_idx); + wq.push(u); + } + } + } + } + } + } // Map old to n for invariance computation and clone void map_ctrl(Node* old, Node* n) { @@ -641,6 +665,7 @@ BoolNode* PhaseIdealLoop::rc_predicate(IdealLoopTree *loop, Node* ctrl, if (scale != 1) { ConNode* con_scale = _igvn.intcon(scale); + set_ctrl(con_scale, C->root()); max_idx_expr = new MulINode(max_idx_expr, con_scale); register_new_node(max_idx_expr, ctrl); if (TraceLoopPredicate) predString->print("* %d ", scale); diff --git a/hotspot/src/share/vm/opto/loopTransform.cpp b/hotspot/src/share/vm/opto/loopTransform.cpp index cbff6c2b879..dd05872370a 100644 --- a/hotspot/src/share/vm/opto/loopTransform.cpp +++ b/hotspot/src/share/vm/opto/loopTransform.cpp @@ -2660,7 +2660,7 @@ bool IdealLoopTree::iteration_split( PhaseIdealLoop *phase, Node_List &old_new ) //============================================================================= // Process all the loops in the loop tree and replace any fill -// patterns with an intrisc version. +// patterns with an intrinsic version. bool PhaseIdealLoop::do_intrinsify_fill() { bool changed = false; for (LoopTreeIterator iter(_ltree_root); !iter.done(); iter.next()) { @@ -2758,8 +2758,9 @@ bool PhaseIdealLoop::match_fill_loop(IdealLoopTree* lpt, Node*& store, Node*& st } // Make sure the address expression can be handled. It should be - // head->phi * elsize + con. head->phi might have a ConvI2L. + // head->phi * elsize + con. head->phi might have a ConvI2L(CastII()). Node* elements[4]; + Node* cast = NULL; Node* conv = NULL; bool found_index = false; int count = store->in(MemNode::Address)->as_AddP()->unpack_offsets(elements, ARRAY_SIZE(elements)); @@ -2774,6 +2775,12 @@ bool PhaseIdealLoop::match_fill_loop(IdealLoopTree* lpt, Node*& store, Node*& st conv = value; value = value->in(1); } + if (value->Opcode() == Op_CastII && + value->as_CastII()->has_range_check()) { + // Skip range check dependent CastII nodes + cast = value; + value = value->in(1); + } #endif if (value != head->phi()) { msg = "unhandled shift in address"; @@ -2786,9 +2793,16 @@ bool PhaseIdealLoop::match_fill_loop(IdealLoopTree* lpt, Node*& store, Node*& st } } } else if (n->Opcode() == Op_ConvI2L && conv == NULL) { - if (n->in(1) == head->phi()) { + conv = n; + n = n->in(1); + if (n->Opcode() == Op_CastII && + n->as_CastII()->has_range_check()) { + // Skip range check dependent CastII nodes + cast = n; + n = n->in(1); + } + if (n == head->phi()) { found_index = true; - conv = n; } else { msg = "unhandled input to ConvI2L"; } @@ -2847,6 +2861,7 @@ bool PhaseIdealLoop::match_fill_loop(IdealLoopTree* lpt, Node*& store, Node*& st // Address elements are ok if (con) ok.set(con->_idx); if (shift) ok.set(shift->_idx); + if (cast) ok.set(cast->_idx); if (conv) ok.set(conv->_idx); for (uint i = 0; msg == NULL && i < lpt->_body.size(); i++) { diff --git a/hotspot/src/share/vm/opto/loopnode.cpp b/hotspot/src/share/vm/opto/loopnode.cpp index 3faa0c2d319..8996def6d6f 100644 --- a/hotspot/src/share/vm/opto/loopnode.cpp +++ b/hotspot/src/share/vm/opto/loopnode.cpp @@ -815,6 +815,11 @@ bool PhaseIdealLoop::is_counted_loop( Node *x, IdealLoopTree *loop ) { C->print_method(PHASE_AFTER_CLOOPS, 3); + // Capture bounds of the loop in the induction variable Phi before + // subsequent transformation (iteration splitting) obscures the + // bounds + l->phi()->as_Phi()->set_type(l->phi()->Value(&_igvn)); + return true; } @@ -897,7 +902,7 @@ int CountedLoopEndNode::stride_con() const { //============================================================================= //------------------------------Value----------------------------------------- -const Type *LoopLimitNode::Value( PhaseTransform *phase ) const { +const Type* LoopLimitNode::Value(PhaseGVN* phase) const { const Type* init_t = phase->type(in(Init)); const Type* limit_t = phase->type(in(Limit)); const Type* stride_t = phase->type(in(Stride)); @@ -1011,7 +1016,7 @@ Node *LoopLimitNode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Identity--------------------------------------- // If stride == 1 return limit node. -Node *LoopLimitNode::Identity( PhaseTransform *phase ) { +Node* LoopLimitNode::Identity(PhaseGVN* phase) { int stride_con = phase->type(in(Stride))->is_int()->get_con(); if (stride_con == 1 || stride_con == -1) return in(Limit); @@ -3483,7 +3488,7 @@ void PhaseIdealLoop::build_loop_late( VectorSet &visited, Node_List &worklist, N // Second pass finds latest legal placement, and ideal loop placement. void PhaseIdealLoop::build_loop_late_post( Node *n ) { - if (n->req() == 2 && n->Opcode() == Op_ConvI2L && !C->major_progress() && !_verify_only) { + if (n->req() == 2 && (n->Opcode() == Op_ConvI2L || n->Opcode() == Op_CastII) && !C->major_progress() && !_verify_only) { _igvn._worklist.push(n); // Maybe we'll normalize it, if no more loops. } diff --git a/hotspot/src/share/vm/opto/loopnode.hpp b/hotspot/src/share/vm/opto/loopnode.hpp index 59cfc690c7e..2e20eaf40b0 100644 --- a/hotspot/src/share/vm/opto/loopnode.hpp +++ b/hotspot/src/share/vm/opto/loopnode.hpp @@ -339,9 +339,9 @@ class LoopLimitNode : public Node { virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); }; // -----------------------------IdealLoopTree---------------------------------- diff --git a/hotspot/src/share/vm/opto/loopopts.cpp b/hotspot/src/share/vm/opto/loopopts.cpp index 9be560add6a..8246600f82f 100644 --- a/hotspot/src/share/vm/opto/loopopts.cpp +++ b/hotspot/src/share/vm/opto/loopopts.cpp @@ -25,7 +25,9 @@ #include "precompiled.hpp" #include "memory/allocation.inline.hpp" #include "opto/addnode.hpp" +#include "opto/castnode.hpp" #include "opto/connode.hpp" +#include "opto/castnode.hpp" #include "opto/divnode.hpp" #include "opto/loopnode.hpp" #include "opto/matcher.hpp" @@ -900,6 +902,14 @@ Node *PhaseIdealLoop::split_if_with_blocks_pre( Node *n ) { Node *m = remix_address_expressions( n ); if( m ) return m; + if (n->is_ConstraintCast()) { + Node* dom_cast = n->as_ConstraintCast()->dominating_cast(this); + if (dom_cast != NULL) { + _igvn.replace_node(n, dom_cast); + return dom_cast; + } + } + // Determine if the Node has inputs from some local Phi. // Returns the block to clone thru. Node *n_blk = has_local_phi_input( n ); @@ -988,6 +998,9 @@ static bool merge_point_safe(Node* region) { #ifdef _LP64 if (m->Opcode() == Op_ConvI2L) return false; + if (m->is_CastII() && m->isa_CastII()->has_range_check()) { + return false; + } #endif } } diff --git a/hotspot/src/share/vm/opto/machnode.cpp b/hotspot/src/share/vm/opto/machnode.cpp index c4e6953ab9f..fc5b08625e5 100644 --- a/hotspot/src/share/vm/opto/machnode.cpp +++ b/hotspot/src/share/vm/opto/machnode.cpp @@ -652,7 +652,7 @@ const RegMask &MachSafePointNode::in_RegMask( uint idx ) const { uint MachCallNode::cmp( const Node &n ) const { return _tf == ((MachCallNode&)n)._tf; } const Type *MachCallNode::bottom_type() const { return tf()->range(); } -const Type *MachCallNode::Value(PhaseTransform *phase) const { return tf()->range(); } +const Type* MachCallNode::Value(PhaseGVN* phase) const { return tf()->range(); } #ifndef PRODUCT void MachCallNode::dump_spec(outputStream *st) const { diff --git a/hotspot/src/share/vm/opto/machnode.hpp b/hotspot/src/share/vm/opto/machnode.hpp index 25cbdc648e7..60bdc9b8768 100644 --- a/hotspot/src/share/vm/opto/machnode.hpp +++ b/hotspot/src/share/vm/opto/machnode.hpp @@ -863,7 +863,7 @@ public: virtual const Type *bottom_type() const; virtual bool pinned() const { return false; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const RegMask &in_RegMask(uint) const; virtual int ret_addr_offset() { return 0; } diff --git a/hotspot/src/share/vm/opto/macro.cpp b/hotspot/src/share/vm/opto/macro.cpp index 93c93b58206..80584956ffb 100644 --- a/hotspot/src/share/vm/opto/macro.cpp +++ b/hotspot/src/share/vm/opto/macro.cpp @@ -244,7 +244,7 @@ void PhaseMacroExpand::eliminate_card_mark(Node* p2x) { } else { // G1 pre/post barriers assert(p2x->outcnt() <= 2, "expects 1 or 2 users: Xor and URShift nodes"); - // It could be only one user, URShift node, in Object.clone() instrinsic + // It could be only one user, URShift node, in Object.clone() intrinsic // but the new allocation is passed to arraycopy stub and it could not // be scalar replaced. So we don't check the case. @@ -1813,10 +1813,11 @@ PhaseMacroExpand::initialize_object(AllocateNode* alloc, // there can be two Allocates to one Initialize. The answer in all these // edge cases is safety first. It is always safe to clear immediately // within an Allocate, and then (maybe or maybe not) clear some more later. - if (!ZeroTLAB) + if (!(UseTLAB && ZeroTLAB)) { rawmem = ClearArrayNode::clear_memory(control, rawmem, object, header_size, size_in_bytes, &_igvn); + } } else { if (!init->is_complete()) { // Try to win by zeroing only what the init does not store. diff --git a/hotspot/src/share/vm/opto/macroArrayCopy.cpp b/hotspot/src/share/vm/opto/macroArrayCopy.cpp index 7e3279c68aa..82816b2462b 100644 --- a/hotspot/src/share/vm/opto/macroArrayCopy.cpp +++ b/hotspot/src/share/vm/opto/macroArrayCopy.cpp @@ -295,7 +295,7 @@ Node* PhaseMacroExpand::generate_arraycopy(ArrayCopyNode *ac, AllocateArrayNode* // out-edges of the dest, we need to avoid making derived pointers // from it until we have checked its uses.) if (ReduceBulkZeroing - && !ZeroTLAB // pointless if already zeroed + && !(UseTLAB && ZeroTLAB) // pointless if already zeroed && basic_elem_type != T_CONFLICT // avoid corner case && !src->eqv_uncast(dest) && alloc != NULL diff --git a/hotspot/src/share/vm/opto/mathexactnode.cpp b/hotspot/src/share/vm/opto/mathexactnode.cpp index 4c167d255a8..196dd343e06 100644 --- a/hotspot/src/share/vm/opto/mathexactnode.cpp +++ b/hotspot/src/share/vm/opto/mathexactnode.cpp @@ -247,11 +247,11 @@ Node* OverflowLNode::Ideal(PhaseGVN* phase, bool can_reshape) { return IdealHelper::Ideal(this, phase, can_reshape); } -const Type* OverflowINode::Value(PhaseTransform* phase) const { +const Type* OverflowINode::Value(PhaseGVN* phase) const { return IdealHelper::Value(this, phase); } -const Type* OverflowLNode::Value(PhaseTransform* phase) const { +const Type* OverflowLNode::Value(PhaseGVN* phase) const { return IdealHelper::Value(this, phase); } diff --git a/hotspot/src/share/vm/opto/mathexactnode.hpp b/hotspot/src/share/vm/opto/mathexactnode.hpp index 3e037cf568b..0c948e3dc34 100644 --- a/hotspot/src/share/vm/opto/mathexactnode.hpp +++ b/hotspot/src/share/vm/opto/mathexactnode.hpp @@ -48,7 +48,7 @@ public: OverflowINode(Node* in1, Node* in2) : OverflowNode(in1, in2) {} virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); - virtual const Type* Value(PhaseTransform* phase) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual bool will_overflow(jint v1, jint v2) const = 0; virtual bool can_overflow(const Type* t1, const Type* t2) const = 0; @@ -61,7 +61,7 @@ public: OverflowLNode(Node* in1, Node* in2) : OverflowNode(in1, in2) {} virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); - virtual const Type* Value(PhaseTransform* phase) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual bool will_overflow(jlong v1, jlong v2) const = 0; virtual bool can_overflow(const Type* t1, const Type* t2) const = 0; diff --git a/hotspot/src/share/vm/opto/memnode.cpp b/hotspot/src/share/vm/opto/memnode.cpp index 2995b7dfade..44483491a9e 100644 --- a/hotspot/src/share/vm/opto/memnode.cpp +++ b/hotspot/src/share/vm/opto/memnode.cpp @@ -1069,7 +1069,7 @@ bool LoadNode::is_instance_field_load_with_local_phi(Node* ctrl) { //------------------------------Identity--------------------------------------- // Loads are identity if previous store is to same address -Node *LoadNode::Identity( PhaseTransform *phase ) { +Node* LoadNode::Identity(PhaseGVN* phase) { // If the previous store-maker is the right kind of Store, and the store is // to the same address, then we are equal to the value stored. Node* mem = in(Memory); @@ -1615,7 +1615,7 @@ static const Type* fold_stable_ary_elem(const TypeAryPtr* ary, int off, BasicTyp } //------------------------------Value----------------------------------------- -const Type *LoadNode::Value( PhaseTransform *phase ) const { +const Type* LoadNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP Node* mem = in(MemNode::Memory); const Type *t1 = phase->type(mem); @@ -1901,7 +1901,7 @@ Node *LoadBNode::Ideal(PhaseGVN *phase, bool can_reshape) { return LoadNode::Ideal(phase, can_reshape); } -const Type* LoadBNode::Value(PhaseTransform *phase) const { +const Type* LoadBNode::Value(PhaseGVN* phase) const { Node* mem = in(MemNode::Memory); Node* value = can_see_stored_value(mem,phase); if (value != NULL && value->is_Con() && @@ -1931,7 +1931,7 @@ Node* LoadUBNode::Ideal(PhaseGVN* phase, bool can_reshape) { return LoadNode::Ideal(phase, can_reshape); } -const Type* LoadUBNode::Value(PhaseTransform *phase) const { +const Type* LoadUBNode::Value(PhaseGVN* phase) const { Node* mem = in(MemNode::Memory); Node* value = can_see_stored_value(mem,phase); if (value != NULL && value->is_Con() && @@ -1961,7 +1961,7 @@ Node *LoadUSNode::Ideal(PhaseGVN *phase, bool can_reshape) { return LoadNode::Ideal(phase, can_reshape); } -const Type* LoadUSNode::Value(PhaseTransform *phase) const { +const Type* LoadUSNode::Value(PhaseGVN* phase) const { Node* mem = in(MemNode::Memory); Node* value = can_see_stored_value(mem,phase); if (value != NULL && value->is_Con() && @@ -1993,7 +1993,7 @@ Node *LoadSNode::Ideal(PhaseGVN *phase, bool can_reshape) { return LoadNode::Ideal(phase, can_reshape); } -const Type* LoadSNode::Value(PhaseTransform *phase) const { +const Type* LoadSNode::Value(PhaseGVN* phase) const { Node* mem = in(MemNode::Memory); Node* value = can_see_stored_value(mem,phase); if (value != NULL && value->is_Con() && @@ -2026,7 +2026,7 @@ Node* LoadKlassNode::make(PhaseGVN& gvn, Node* ctl, Node* mem, Node* adr, const } //------------------------------Value------------------------------------------ -const Type *LoadKlassNode::Value( PhaseTransform *phase ) const { +const Type* LoadKlassNode::Value(PhaseGVN* phase) const { return klass_value_common(phase); } @@ -2036,7 +2036,7 @@ bool LoadKlassNode::can_remove_control() const { return false; } -const Type *LoadNode::klass_value_common( PhaseTransform *phase ) const { +const Type* LoadNode::klass_value_common(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(MemNode::Memory) ); if (t1 == Type::TOP) return Type::TOP; @@ -2172,11 +2172,11 @@ const Type *LoadNode::klass_value_common( PhaseTransform *phase ) const { //------------------------------Identity--------------------------------------- // To clean up reflective code, simplify k.java_mirror.as_klass to plain k. // Also feed through the klass in Allocate(...klass...)._klass. -Node* LoadKlassNode::Identity( PhaseTransform *phase ) { +Node* LoadKlassNode::Identity(PhaseGVN* phase) { return klass_identity_common(phase); } -Node* LoadNode::klass_identity_common(PhaseTransform *phase ) { +Node* LoadNode::klass_identity_common(PhaseGVN* phase) { Node* x = LoadNode::Identity(phase); if (x != this) return x; @@ -2231,7 +2231,7 @@ Node* LoadNode::klass_identity_common(PhaseTransform *phase ) { //------------------------------Value------------------------------------------ -const Type *LoadNKlassNode::Value( PhaseTransform *phase ) const { +const Type* LoadNKlassNode::Value(PhaseGVN* phase) const { const Type *t = klass_value_common(phase); if (t == Type::TOP) return t; @@ -2242,7 +2242,7 @@ const Type *LoadNKlassNode::Value( PhaseTransform *phase ) const { //------------------------------Identity--------------------------------------- // To clean up reflective code, simplify k.java_mirror.as_klass to narrow k. // Also feed through the klass in Allocate(...klass...)._klass. -Node* LoadNKlassNode::Identity( PhaseTransform *phase ) { +Node* LoadNKlassNode::Identity(PhaseGVN* phase) { Node *x = klass_identity_common(phase); const Type *t = phase->type( x ); @@ -2254,7 +2254,7 @@ Node* LoadNKlassNode::Identity( PhaseTransform *phase ) { } //------------------------------Value----------------------------------------- -const Type *LoadRangeNode::Value( PhaseTransform *phase ) const { +const Type* LoadRangeNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(MemNode::Memory) ); if( t1 == Type::TOP ) return Type::TOP; @@ -2302,7 +2302,7 @@ Node *LoadRangeNode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Identity--------------------------------------- // Feed through the length in AllocateArray(...length...)._length. -Node* LoadRangeNode::Identity( PhaseTransform *phase ) { +Node* LoadRangeNode::Identity(PhaseGVN* phase) { Node* x = LoadINode::Identity(phase); if (x != this) return x; @@ -2473,7 +2473,7 @@ Node *StoreNode::Ideal(PhaseGVN *phase, bool can_reshape) { } //------------------------------Value----------------------------------------- -const Type *StoreNode::Value( PhaseTransform *phase ) const { +const Type* StoreNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(MemNode::Memory) ); if( t1 == Type::TOP ) return Type::TOP; @@ -2488,7 +2488,7 @@ const Type *StoreNode::Value( PhaseTransform *phase ) const { // Remove redundant stores: // Store(m, p, Load(m, p)) changes to m. // Store(, p, x) -> Store(m, p, x) changes to Store(m, p, x). -Node *StoreNode::Identity( PhaseTransform *phase ) { +Node* StoreNode::Identity(PhaseGVN* phase) { Node* mem = in(MemNode::Memory); Node* adr = in(MemNode::Address); Node* val = in(MemNode::ValueIn); @@ -2642,7 +2642,7 @@ Node *StoreCNode::Ideal(PhaseGVN *phase, bool can_reshape){ //============================================================================= //------------------------------Identity--------------------------------------- -Node *StoreCMNode::Identity( PhaseTransform *phase ) { +Node* StoreCMNode::Identity(PhaseGVN* phase) { // No need to card mark when storing a null ptr Node* my_store = in(MemNode::OopStore); if (my_store->is_Store()) { @@ -2671,7 +2671,7 @@ Node *StoreCMNode::Ideal(PhaseGVN *phase, bool can_reshape){ } //------------------------------Value----------------------------------------- -const Type *StoreCMNode::Value( PhaseTransform *phase ) const { +const Type* StoreCMNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t = phase->type( in(MemNode::Memory) ); if( t == Type::TOP ) return Type::TOP; @@ -2689,7 +2689,7 @@ const Type *StoreCMNode::Value( PhaseTransform *phase ) const { //============================================================================= //----------------------------------SCMemProjNode------------------------------ -const Type * SCMemProjNode::Value( PhaseTransform *phase ) const +const Type* SCMemProjNode::Value(PhaseGVN* phase) const { return bottom_type(); } @@ -2745,7 +2745,7 @@ uint ClearArrayNode::match_edge(uint idx) const { //------------------------------Identity--------------------------------------- // Clearing a zero length array does nothing -Node *ClearArrayNode::Identity( PhaseTransform *phase ) { +Node* ClearArrayNode::Identity(PhaseGVN* phase) { return phase->type(in(2))->higher_equal(TypeX::ZERO) ? in(1) : this; } @@ -3001,7 +3001,7 @@ Node *MemBarNode::Ideal(PhaseGVN *phase, bool can_reshape) { } //------------------------------Value------------------------------------------ -const Type *MemBarNode::Value( PhaseTransform *phase ) const { +const Type* MemBarNode::Value(PhaseGVN* phase) const { if( !in(0) ) return Type::TOP; if( phase->type(in(0)) == Type::TOP ) return Type::TOP; @@ -3850,7 +3850,7 @@ Node* InitializeNode::complete_stores(Node* rawctl, Node* rawmem, Node* rawptr, bool do_zeroing = true; // we might give up if inits are very sparse int big_init_gaps = 0; // how many large gaps have we seen? - if (ZeroTLAB) do_zeroing = false; + if (UseTLAB && ZeroTLAB) do_zeroing = false; if (!ReduceFieldZeroing && !ReduceBulkZeroing) do_zeroing = false; for (uint i = InitializeNode::RawStores, limit = req(); i < limit; i++) { @@ -3951,7 +3951,7 @@ Node* InitializeNode::complete_stores(Node* rawctl, Node* rawmem, Node* rawptr, remove_extra_zeroes(); // clear out all the zmems left over add_req(inits); - if (!ZeroTLAB) { + if (!(UseTLAB && ZeroTLAB)) { // If anything remains to be zeroed, zero it all now. zeroes_done = align_size_down(zeroes_done, BytesPerInt); // if it is the last unused 4 bytes of an instance, forget about it @@ -4143,7 +4143,7 @@ uint MergeMemNode::cmp( const Node &n ) const { } //------------------------------Identity--------------------------------------- -Node* MergeMemNode::Identity(PhaseTransform *phase) { +Node* MergeMemNode::Identity(PhaseGVN* phase) { // Identity if this merge point does not record any interesting memory // disambiguations. Node* base_mem = base_memory(); diff --git a/hotspot/src/share/vm/opto/memnode.hpp b/hotspot/src/share/vm/opto/memnode.hpp index cab41bcdf0d..994b782dfbb 100644 --- a/hotspot/src/share/vm/opto/memnode.hpp +++ b/hotspot/src/share/vm/opto/memnode.hpp @@ -207,7 +207,7 @@ public: // Handle algebraic identities here. If we have an identity, return the Node // we are equivalent to. We look for Load of a Store. - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); // If the load is from Field memory and the pointer is non-null, it might be possible to // zero out the control input. @@ -223,11 +223,11 @@ public: // Compute a new Type for this node. Basically we just do the pre-check, // then call the virtual add() to set the type. - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; // Common methods for LoadKlass and LoadNKlass nodes. - const Type *klass_value_common( PhaseTransform *phase ) const; - Node *klass_identity_common( PhaseTransform *phase ); + const Type* klass_value_common(PhaseGVN* phase) const; + Node* klass_identity_common(PhaseGVN* phase); virtual uint ideal_reg() const; virtual const Type *bottom_type() const; @@ -284,7 +284,7 @@ public: virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value(PhaseTransform *phase) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual int store_Opcode() const { return Op_StoreB; } virtual BasicType memory_type() const { return T_BYTE; } }; @@ -298,7 +298,7 @@ public: virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node* Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value(PhaseTransform *phase) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual int store_Opcode() const { return Op_StoreB; } virtual BasicType memory_type() const { return T_BYTE; } }; @@ -312,7 +312,7 @@ public: virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value(PhaseTransform *phase) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual int store_Opcode() const { return Op_StoreC; } virtual BasicType memory_type() const { return T_CHAR; } }; @@ -326,7 +326,7 @@ public: virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value(PhaseTransform *phase) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual int store_Opcode() const { return Op_StoreC; } virtual BasicType memory_type() const { return T_SHORT; } }; @@ -350,8 +350,8 @@ public: LoadRangeNode(Node *c, Node *mem, Node *adr, const TypeInt *ti = TypeInt::POS) : LoadINode(c, mem, adr, TypeAryPtr::RANGE, ti, MemNode::unordered) {} virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); }; @@ -483,8 +483,8 @@ public: LoadKlassNode(Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeKlassPtr *tk, MemOrd mo) : LoadPNode(c, mem, adr, at, tk, mo) {} virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual bool depends_only_on_test() const { return true; } // Polymorphic factory method: @@ -503,8 +503,8 @@ public: virtual int store_Opcode() const { return Op_StoreNKlass; } virtual BasicType memory_type() const { return T_NARROWKLASS; } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual bool depends_only_on_test() const { return true; } }; @@ -581,10 +581,10 @@ public: // Compute a new Type for this node. Basically we just do the pre-check, // then call the virtual add() to set the type. - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; // Check for identity function on memory (Load then Store at same address) - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); // Do not match memory edge virtual uint match_edge(uint idx) const; @@ -746,9 +746,9 @@ public: "bad oop alias idx"); } virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual BasicType memory_type() const { return T_VOID; } // unspecific int oop_alias_idx() const { return _oop_alias_idx; } }; @@ -782,7 +782,7 @@ public: return ctrl->in(MemNode::Memory)->adr_type(); } virtual uint ideal_reg() const { return 0;} // memory projections don't have a register - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; #ifndef PRODUCT virtual void dump_spec(outputStream *st) const {}; #endif @@ -934,7 +934,7 @@ public: // ClearArray modifies array elements, and so affects only the // array memory addressed by the bottom_type of its base address. virtual const class TypePtr *adr_type() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual uint match_edge(uint idx) const; @@ -983,7 +983,7 @@ public: MemBarNode(Compile* C, int alias_idx, Node* precedent); virtual int Opcode() const = 0; virtual const class TypePtr *adr_type() const { return _adr_type; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual uint match_edge(uint idx) const { return 0; } virtual const Type *bottom_type() const { return TypeTuple::MEMBAR; } @@ -1199,7 +1199,7 @@ public: static MergeMemNode* make(Node* base_memory); virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual uint ideal_reg() const { return NotAMachineReg; } virtual uint match_edge(uint idx) const { return 0; } diff --git a/hotspot/src/share/vm/opto/movenode.cpp b/hotspot/src/share/vm/opto/movenode.cpp index ee797cf5d28..32c9877f64e 100644 --- a/hotspot/src/share/vm/opto/movenode.cpp +++ b/hotspot/src/share/vm/opto/movenode.cpp @@ -121,7 +121,7 @@ Node *CMoveNode::is_cmove_id( PhaseTransform *phase, Node *cmp, Node *t, Node *f //------------------------------Identity--------------------------------------- // Conditional-move is an identity if both inputs are the same, or the test // true or false. -Node *CMoveNode::Identity( PhaseTransform *phase ) { +Node* CMoveNode::Identity(PhaseGVN* phase) { if( phase->eqv(in(IfFalse),in(IfTrue)) ) // C-moving identical inputs? return in(IfFalse); // Then it doesn't matter if( phase->type(in(Condition)) == TypeInt::ZERO ) @@ -149,7 +149,7 @@ Node *CMoveNode::Identity( PhaseTransform *phase ) { //------------------------------Value------------------------------------------ // Result is the meet of inputs -const Type *CMoveNode::Value( PhaseTransform *phase ) const { +const Type* CMoveNode::Value(PhaseGVN* phase) const { if( phase->type(in(Condition)) == Type::TOP ) return Type::TOP; return phase->type(in(IfFalse))->meet_speculative(phase->type(in(IfTrue))); @@ -351,7 +351,7 @@ Node *CMoveDNode::Ideal(PhaseGVN *phase, bool can_reshape) { } //------------------------------Value------------------------------------------ -const Type *MoveL2DNode::Value( PhaseTransform *phase ) const { +const Type* MoveL2DNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; const TypeLong *tl = t->is_long(); @@ -362,7 +362,7 @@ const Type *MoveL2DNode::Value( PhaseTransform *phase ) const { } //------------------------------Value------------------------------------------ -const Type *MoveI2FNode::Value( PhaseTransform *phase ) const { +const Type* MoveI2FNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; const TypeInt *ti = t->is_int(); @@ -373,7 +373,7 @@ const Type *MoveI2FNode::Value( PhaseTransform *phase ) const { } //------------------------------Value------------------------------------------ -const Type *MoveF2INode::Value( PhaseTransform *phase ) const { +const Type* MoveF2INode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; if( t == Type::FLOAT ) return TypeInt::INT; @@ -384,7 +384,7 @@ const Type *MoveF2INode::Value( PhaseTransform *phase ) const { } //------------------------------Value------------------------------------------ -const Type *MoveD2LNode::Value( PhaseTransform *phase ) const { +const Type* MoveD2LNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; if( t == Type::DOUBLE ) return TypeLong::LONG; diff --git a/hotspot/src/share/vm/opto/movenode.hpp b/hotspot/src/share/vm/opto/movenode.hpp index 4cd94185063..b84e784a285 100644 --- a/hotspot/src/share/vm/opto/movenode.hpp +++ b/hotspot/src/share/vm/opto/movenode.hpp @@ -45,8 +45,8 @@ class CMoveNode : public TypeNode { init_req(IfTrue,right); } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); static CMoveNode *make(Node *c, Node *bol, Node *left, Node *right, const Type *t); // Helper function to spot cmove graph shapes static Node *is_cmove_id( PhaseTransform *phase, Node *cmp, Node *t, Node *f, BoolNode *b ); @@ -104,7 +104,7 @@ class MoveI2FNode : public Node { virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::FLOAT; } virtual uint ideal_reg() const { return Op_RegF; } - virtual const Type* Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; }; class MoveL2DNode : public Node { @@ -113,7 +113,7 @@ class MoveL2DNode : public Node { virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } - virtual const Type* Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; }; class MoveF2INode : public Node { @@ -122,7 +122,7 @@ class MoveF2INode : public Node { virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } - virtual const Type* Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; }; class MoveD2LNode : public Node { @@ -131,7 +131,7 @@ class MoveD2LNode : public Node { virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } - virtual const Type* Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; }; //------------------------------BinaryNode------------------------------------- diff --git a/hotspot/src/share/vm/opto/mulnode.cpp b/hotspot/src/share/vm/opto/mulnode.cpp index 4e796ce72d3..d5a7de73e92 100644 --- a/hotspot/src/share/vm/opto/mulnode.cpp +++ b/hotspot/src/share/vm/opto/mulnode.cpp @@ -46,7 +46,7 @@ uint MulNode::hash() const { //------------------------------Identity--------------------------------------- // Multiplying a one preserves the other argument -Node *MulNode::Identity( PhaseTransform *phase ) { +Node* MulNode::Identity(PhaseGVN* phase) { register const Type *one = mul_id(); // The multiplicative identity if( phase->type( in(1) )->higher_equal( one ) ) return in(2); if( phase->type( in(2) )->higher_equal( one ) ) return in(1); @@ -139,7 +139,7 @@ Node *MulNode::Ideal(PhaseGVN *phase, bool can_reshape) { } //------------------------------Value----------------------------------------- -const Type *MulNode::Value( PhaseTransform *phase ) const { +const Type* MulNode::Value(PhaseGVN* phase) const { const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); // Either input is TOP ==> the result is TOP @@ -381,7 +381,7 @@ const Type *MulDNode::mul_ring(const Type *t0, const Type *t1) const { //============================================================================= //------------------------------Value------------------------------------------ -const Type *MulHiLNode::Value( PhaseTransform *phase ) const { +const Type* MulHiLNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -432,7 +432,7 @@ const Type *AndINode::mul_ring( const Type *t0, const Type *t1 ) const { //------------------------------Identity--------------------------------------- // Masking off the high bits of an unsigned load is not required -Node *AndINode::Identity( PhaseTransform *phase ) { +Node* AndINode::Identity(PhaseGVN* phase) { // x & x => x if (phase->eqv(in(1), in(2))) return in(1); @@ -562,7 +562,7 @@ const Type *AndLNode::mul_ring( const Type *t0, const Type *t1 ) const { //------------------------------Identity--------------------------------------- // Masking off the high bits of an unsigned load is not required -Node *AndLNode::Identity( PhaseTransform *phase ) { +Node* AndLNode::Identity(PhaseGVN* phase) { // x & x => x if (phase->eqv(in(1), in(2))) return in(1); @@ -639,7 +639,7 @@ Node *AndLNode::Ideal(PhaseGVN *phase, bool can_reshape) { //============================================================================= //------------------------------Identity--------------------------------------- -Node *LShiftINode::Identity( PhaseTransform *phase ) { +Node* LShiftINode::Identity(PhaseGVN* phase) { const TypeInt *ti = phase->type( in(2) )->isa_int(); // shift count is an int return ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerInt - 1 ) ) == 0 ) ? in(1) : this; } @@ -704,7 +704,7 @@ Node *LShiftINode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Value------------------------------------------ // A LShiftINode shifts its input2 left by input1 amount. -const Type *LShiftINode::Value( PhaseTransform *phase ) const { +const Type* LShiftINode::Value(PhaseGVN* phase) const { const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); // Either input is TOP ==> the result is TOP @@ -751,7 +751,7 @@ const Type *LShiftINode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Identity--------------------------------------- -Node *LShiftLNode::Identity( PhaseTransform *phase ) { +Node* LShiftLNode::Identity(PhaseGVN* phase) { const TypeInt *ti = phase->type( in(2) )->isa_int(); // shift count is an int return ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerLong - 1 ) ) == 0 ) ? in(1) : this; } @@ -813,7 +813,7 @@ Node *LShiftLNode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Value------------------------------------------ // A LShiftLNode shifts its input2 left by input1 amount. -const Type *LShiftLNode::Value( PhaseTransform *phase ) const { +const Type* LShiftLNode::Value(PhaseGVN* phase) const { const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); // Either input is TOP ==> the result is TOP @@ -860,7 +860,7 @@ const Type *LShiftLNode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Identity--------------------------------------- -Node *RShiftINode::Identity( PhaseTransform *phase ) { +Node* RShiftINode::Identity(PhaseGVN* phase) { const TypeInt *t2 = phase->type(in(2))->isa_int(); if( !t2 ) return this; if ( t2->is_con() && ( t2->get_con() & ( BitsPerInt - 1 ) ) == 0 ) @@ -959,7 +959,7 @@ Node *RShiftINode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Value------------------------------------------ // A RShiftINode shifts its input2 right by input1 amount. -const Type *RShiftINode::Value( PhaseTransform *phase ) const { +const Type* RShiftINode::Value(PhaseGVN* phase) const { const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); // Either input is TOP ==> the result is TOP @@ -1014,14 +1014,14 @@ const Type *RShiftINode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Identity--------------------------------------- -Node *RShiftLNode::Identity( PhaseTransform *phase ) { +Node* RShiftLNode::Identity(PhaseGVN* phase) { const TypeInt *ti = phase->type( in(2) )->isa_int(); // shift count is an int return ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerLong - 1 ) ) == 0 ) ? in(1) : this; } //------------------------------Value------------------------------------------ // A RShiftLNode shifts its input2 right by input1 amount. -const Type *RShiftLNode::Value( PhaseTransform *phase ) const { +const Type* RShiftLNode::Value(PhaseGVN* phase) const { const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); // Either input is TOP ==> the result is TOP @@ -1072,7 +1072,7 @@ const Type *RShiftLNode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Identity--------------------------------------- -Node *URShiftINode::Identity( PhaseTransform *phase ) { +Node* URShiftINode::Identity(PhaseGVN* phase) { const TypeInt *ti = phase->type( in(2) )->isa_int(); if ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerInt - 1 ) ) == 0 ) return in(1); @@ -1168,7 +1168,7 @@ Node *URShiftINode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Value------------------------------------------ // A URShiftINode shifts its input2 right by input1 amount. -const Type *URShiftINode::Value( PhaseTransform *phase ) const { +const Type* URShiftINode::Value(PhaseGVN* phase) const { // (This is a near clone of RShiftINode::Value.) const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -1242,7 +1242,7 @@ const Type *URShiftINode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Identity--------------------------------------- -Node *URShiftLNode::Identity( PhaseTransform *phase ) { +Node* URShiftLNode::Identity(PhaseGVN* phase) { const TypeInt *ti = phase->type( in(2) )->isa_int(); // shift count is an int return ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerLong - 1 ) ) == 0 ) ? in(1) : this; } @@ -1297,7 +1297,7 @@ Node *URShiftLNode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Value------------------------------------------ // A URShiftINode shifts its input2 right by input1 amount. -const Type *URShiftLNode::Value( PhaseTransform *phase ) const { +const Type* URShiftLNode::Value(PhaseGVN* phase) const { // (This is a near clone of RShiftLNode::Value.) const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); diff --git a/hotspot/src/share/vm/opto/mulnode.hpp b/hotspot/src/share/vm/opto/mulnode.hpp index c3adc433fda..987f2e9e695 100644 --- a/hotspot/src/share/vm/opto/mulnode.hpp +++ b/hotspot/src/share/vm/opto/mulnode.hpp @@ -47,7 +47,7 @@ public: // Handle algebraic identities here. If we have an identity, return the Node // we are equivalent to. We look for "add of zero" as an identity. - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); // We also canonicalize the Node, moving constants to the right input, // and flatten expressions (so that 1+x+2 becomes x+3). @@ -55,7 +55,7 @@ public: // Compute a new Type for this node. Basically we just do the pre-check, // then call the virtual add() to set the type. - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; // Supplied function returns the product of the inputs. // This also type-checks the inputs for sanity. Guaranteed never to @@ -146,7 +146,7 @@ class MulHiLNode : public Node { public: MulHiLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } }; @@ -159,7 +159,7 @@ public: AndINode( Node *in1, Node *in2 ) : MulINode(in1,in2) {} virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual const Type *mul_ring( const Type *, const Type * ) const; const Type *mul_id() const { return TypeInt::MINUS_1; } const Type *add_id() const { return TypeInt::ZERO; } @@ -176,7 +176,7 @@ public: AndLNode( Node *in1, Node *in2 ) : MulLNode(in1,in2) {} virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual const Type *mul_ring( const Type *, const Type * ) const; const Type *mul_id() const { return TypeLong::MINUS_1; } const Type *add_id() const { return TypeLong::ZERO; } @@ -191,9 +191,9 @@ class LShiftINode : public Node { public: LShiftINode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } }; @@ -204,9 +204,9 @@ class LShiftLNode : public Node { public: LShiftLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } }; @@ -217,9 +217,9 @@ class RShiftINode : public Node { public: RShiftINode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } }; @@ -230,8 +230,8 @@ class RShiftLNode : public Node { public: RShiftLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } }; @@ -243,9 +243,9 @@ class URShiftINode : public Node { public: URShiftINode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } }; @@ -256,9 +256,9 @@ class URShiftLNode : public Node { public: URShiftLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } }; diff --git a/hotspot/src/share/vm/opto/multnode.cpp b/hotspot/src/share/vm/opto/multnode.cpp index 83ef36b7621..184e6a94bf4 100644 --- a/hotspot/src/share/vm/opto/multnode.cpp +++ b/hotspot/src/share/vm/opto/multnode.cpp @@ -147,7 +147,7 @@ void ProjNode::check_con() const { } //------------------------------Value------------------------------------------ -const Type *ProjNode::Value( PhaseTransform *phase ) const { +const Type* ProjNode::Value(PhaseGVN* phase) const { if (in(0) == NULL) return Type::TOP; return proj_type(phase->type(in(0))); } diff --git a/hotspot/src/share/vm/opto/multnode.hpp b/hotspot/src/share/vm/opto/multnode.hpp index 25f8c503436..ec32fea977b 100644 --- a/hotspot/src/share/vm/opto/multnode.hpp +++ b/hotspot/src/share/vm/opto/multnode.hpp @@ -81,7 +81,7 @@ public: virtual const Type *bottom_type() const; virtual const TypePtr *adr_type() const; virtual bool pinned() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual uint ideal_reg() const; virtual const RegMask &out_RegMask() const; diff --git a/hotspot/src/share/vm/opto/narrowptrnode.cpp b/hotspot/src/share/vm/opto/narrowptrnode.cpp index de88eb6393b..412ecae69c5 100644 --- a/hotspot/src/share/vm/opto/narrowptrnode.cpp +++ b/hotspot/src/share/vm/opto/narrowptrnode.cpp @@ -26,7 +26,7 @@ #include "opto/narrowptrnode.hpp" #include "opto/phaseX.hpp" -Node* DecodeNNode::Identity(PhaseTransform* phase) { +Node* DecodeNNode::Identity(PhaseGVN* phase) { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return in(1); @@ -37,7 +37,7 @@ Node* DecodeNNode::Identity(PhaseTransform* phase) { return this; } -const Type *DecodeNNode::Value( PhaseTransform *phase ) const { +const Type* DecodeNNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if (t == Type::TOP) return Type::TOP; if (t == TypeNarrowOop::NULL_PTR) return TypePtr::NULL_PTR; @@ -46,7 +46,7 @@ const Type *DecodeNNode::Value( PhaseTransform *phase ) const { return t->make_ptr(); } -Node* EncodePNode::Identity(PhaseTransform* phase) { +Node* EncodePNode::Identity(PhaseGVN* phase) { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return in(1); @@ -57,7 +57,7 @@ Node* EncodePNode::Identity(PhaseTransform* phase) { return this; } -const Type *EncodePNode::Value( PhaseTransform *phase ) const { +const Type* EncodePNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if (t == Type::TOP) return Type::TOP; if (t == TypePtr::NULL_PTR) return TypeNarrowOop::NULL_PTR; @@ -67,7 +67,7 @@ const Type *EncodePNode::Value( PhaseTransform *phase ) const { } -Node* DecodeNKlassNode::Identity(PhaseTransform* phase) { +Node* DecodeNKlassNode::Identity(PhaseGVN* phase) { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return in(1); @@ -78,7 +78,7 @@ Node* DecodeNKlassNode::Identity(PhaseTransform* phase) { return this; } -const Type *DecodeNKlassNode::Value( PhaseTransform *phase ) const { +const Type* DecodeNKlassNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if (t == Type::TOP) return Type::TOP; assert(t != TypeNarrowKlass::NULL_PTR, "null klass?"); @@ -87,7 +87,7 @@ const Type *DecodeNKlassNode::Value( PhaseTransform *phase ) const { return t->make_ptr(); } -Node* EncodePKlassNode::Identity(PhaseTransform* phase) { +Node* EncodePKlassNode::Identity(PhaseGVN* phase) { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return in(1); @@ -98,7 +98,7 @@ Node* EncodePKlassNode::Identity(PhaseTransform* phase) { return this; } -const Type *EncodePKlassNode::Value( PhaseTransform *phase ) const { +const Type* EncodePKlassNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if (t == Type::TOP) return Type::TOP; assert (t != TypePtr::NULL_PTR, "null klass?"); diff --git a/hotspot/src/share/vm/opto/narrowptrnode.hpp b/hotspot/src/share/vm/opto/narrowptrnode.hpp index feecbd0b906..e900bf7d93e 100644 --- a/hotspot/src/share/vm/opto/narrowptrnode.hpp +++ b/hotspot/src/share/vm/opto/narrowptrnode.hpp @@ -52,8 +52,8 @@ class EncodePNode : public EncodeNarrowPtrNode { init_class_id(Class_EncodeP); } virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; }; //------------------------------EncodePKlass-------------------------------- @@ -67,8 +67,8 @@ class EncodePKlassNode : public EncodeNarrowPtrNode { init_class_id(Class_EncodePKlass); } virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; }; //------------------------------DecodeNarrowPtr-------------------------------- @@ -95,8 +95,8 @@ class DecodeNNode : public DecodeNarrowPtrNode { init_class_id(Class_DecodeN); } virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); }; //------------------------------DecodeNKlass-------------------------------- @@ -110,8 +110,8 @@ class DecodeNKlassNode : public DecodeNarrowPtrNode { init_class_id(Class_DecodeNKlass); } virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); }; #endif // SHARE_VM_OPTO_NARROWPTRNODE_HPP diff --git a/hotspot/src/share/vm/opto/node.cpp b/hotspot/src/share/vm/opto/node.cpp index ac093690bc5..42ca23d212a 100644 --- a/hotspot/src/share/vm/opto/node.cpp +++ b/hotspot/src/share/vm/opto/node.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "libadt/vectset.hpp" #include "memory/allocation.inline.hpp" +#include "opto/castnode.hpp" #include "opto/cfgnode.hpp" #include "opto/connode.hpp" #include "opto/loopnode.hpp" @@ -516,6 +517,11 @@ Node *Node::clone() const { C->add_macro_node(n); if (is_expensive()) C->add_expensive_node(n); + // If the cloned node is a range check dependent CastII, add it to the list. + CastIINode* cast = n->isa_CastII(); + if (cast != NULL && cast->has_range_check()) { + C->add_range_check_cast(cast); + } n->set_idx(C->next_unique()); // Get new unique index as well debug_only( n->verify_construction() ); @@ -644,6 +650,11 @@ void Node::destruct() { if (is_expensive()) { compile->remove_expensive_node(this); } + CastIINode* cast = isa_CastII(); + if (cast != NULL && cast->has_range_check()) { + compile->remove_range_check_cast(cast); + } + if (is_SafePoint()) { as_SafePoint()->delete_replaced_nodes(); } @@ -796,8 +807,9 @@ void Node::del_req( uint idx ) { // First remove corresponding def-use edge Node *n = in(idx); if (n != NULL) n->del_out((Node *)this); - _in[idx] = in(--_cnt); // Compact the array - _in[_cnt] = NULL; // NULL out emptied slot + _in[idx] = in(--_cnt); // Compact the array + // Avoid spec violation: Gap in prec edges. + close_prec_gap_at(_cnt); Compile::current()->record_modified_node(this); } @@ -810,10 +822,11 @@ void Node::del_req_ordered( uint idx ) { // First remove corresponding def-use edge Node *n = in(idx); if (n != NULL) n->del_out((Node *)this); - if (idx < _cnt - 1) { // Not last edge ? - Copy::conjoint_words_to_lower((HeapWord*)&_in[idx+1], (HeapWord*)&_in[idx], ((_cnt-idx-1)*sizeof(Node*))); + if (idx < --_cnt) { // Not last edge ? + Copy::conjoint_words_to_lower((HeapWord*)&_in[idx+1], (HeapWord*)&_in[idx], ((_cnt-idx)*sizeof(Node*))); } - _in[--_cnt] = NULL; // NULL out emptied slot + // Avoid spec violation: Gap in prec edges. + close_prec_gap_at(_cnt); Compile::current()->record_modified_node(this); } @@ -845,10 +858,12 @@ int Node::replace_edge(Node* old, Node* neww) { uint nrep = 0; for (uint i = 0; i < len(); i++) { if (in(i) == old) { - if (i < req()) + if (i < req()) { set_req(i, neww); - else + } else { + assert(find_prec_edge(neww) == -1, "spec violation: duplicated prec edge (node %d -> %d)", _idx, neww->_idx); set_prec(i, neww); + } nrep++; } } @@ -907,7 +922,7 @@ int Node::disconnect_inputs(Node *n, Compile* C) { Node* Node::uncast() const { // Should be inline: //return is_ConstraintCast() ? uncast_helper(this) : (Node*) this; - if (is_ConstraintCast() || is_CheckCastPP()) + if (is_ConstraintCast()) return uncast_helper(this); else return (Node*) this; @@ -961,8 +976,6 @@ Node* Node::uncast_helper(const Node* p) { break; } else if (p->is_ConstraintCast()) { p = p->in(1); - } else if (p->is_CheckCastPP()) { - p = p->in(1); } else { break; } @@ -982,24 +995,27 @@ void Node::add_prec( Node *n ) { // Find a precedence edge to move uint i = _cnt; - while( in(i) != NULL ) i++; + while( in(i) != NULL ) { + if (in(i) == n) return; // Avoid spec violation: duplicated prec edge. + i++; + } _in[i] = n; // Stuff prec edge over NULL if ( n != NULL) n->add_out((Node *)this); // Add mirror edge + +#ifdef ASSERT + while ((++i)<_max) { assert(_in[i] == NULL, "spec violation: Gap in prec edges (node %d)", _idx); } +#endif } //------------------------------rm_prec---------------------------------------- // Remove a precedence input. Precedence inputs are unordered, with // duplicates removed and NULLs packed down at the end. void Node::rm_prec( uint j ) { - - // Find end of precedence list to pack NULLs - uint i; - for( i=j; i<_max; i++ ) - if( !_in[i] ) // Find the NULL at end of prec edge list - break; - if (_in[j] != NULL) _in[j]->del_out((Node *)this); - _in[j] = _in[--i]; // Move last element over removed guy - _in[i] = NULL; // NULL out last element + assert(j < _max, "oob: i=%d, _max=%d", j, _max); + assert(j >= _cnt, "not a precedence edge"); + if (_in[j] == NULL) return; // Avoid spec violation: Gap in prec edges. + _in[j]->del_out((Node *)this); + close_prec_gap_at(j); } //------------------------------size_of---------------------------------------- @@ -1066,13 +1082,13 @@ void Node::raise_bottom_type(const Type* new_type) { //------------------------------Identity--------------------------------------- // Return a node that the given node is equivalent to. -Node *Node::Identity( PhaseTransform * ) { +Node* Node::Identity(PhaseGVN* phase) { return this; // Default to no identities } //------------------------------Value------------------------------------------ // Compute a new Type for a node using the Type of the inputs. -const Type *Node::Value( PhaseTransform * ) const { +const Type* Node::Value(PhaseGVN* phase) const { return bottom_type(); // Default to worst-case Type } @@ -1374,6 +1390,10 @@ static void kill_dead_code( Node *dead, PhaseIterGVN *igvn ) { if (dead->is_expensive()) { igvn->C->remove_expensive_node(dead); } + CastIINode* cast = dead->isa_CastII(); + if (cast != NULL && cast->has_range_check()) { + igvn->C->remove_range_check_cast(cast); + } igvn->C->record_dead_node(dead->_idx); // Kill all inputs to the dead guy for (uint i=0; i < dead->req(); i++) { @@ -2451,7 +2471,7 @@ uint TypeNode::hash() const { uint TypeNode::cmp( const Node &n ) const { return !Type::cmp( _type, ((TypeNode&)n)._type ); } const Type *TypeNode::bottom_type() const { return _type; } -const Type *TypeNode::Value( PhaseTransform * ) const { return _type; } +const Type* TypeNode::Value(PhaseGVN* phase) const { return _type; } //------------------------------ideal_reg-------------------------------------- uint TypeNode::ideal_reg() const { diff --git a/hotspot/src/share/vm/opto/node.hpp b/hotspot/src/share/vm/opto/node.hpp index d737f537868..b7900ad276d 100644 --- a/hotspot/src/share/vm/opto/node.hpp +++ b/hotspot/src/share/vm/opto/node.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -51,6 +51,7 @@ class CallLeafNode; class CallNode; class CallRuntimeNode; class CallStaticJavaNode; +class CastIINode; class CatchNode; class CatchProjNode; class CheckCastPPNode; @@ -423,6 +424,16 @@ protected: } // Find first occurrence of n among my edges: int find_edge(Node* n); + int find_prec_edge(Node* n) { + for (uint i = req(); i < len(); i++) { + if (_in[i] == n) return i; + if (_in[i] == NULL) { + DEBUG_ONLY( while ((++i) < len()) assert(_in[i] == NULL, "Gap in prec edges!"); ) + break; + } + } + return -1; + } int replace_edge(Node* old, Node* neww); int replace_edges_in_range(Node* old, Node* neww, int start, int end); // NULL out all inputs to eliminate incoming Def-Use edges. @@ -476,6 +487,19 @@ private: debug_only(_last_del = n; ++_del_tick); #endif } + // Close gap after removing edge. + void close_prec_gap_at(uint gap) { + assert(_cnt <= gap && gap < _max, "no valid prec edge"); + uint i = gap; + Node *last = NULL; + for (; i < _max-1; ++i) { + Node *next = _in[i+1]; + if (next == NULL) break; + last = next; + } + _in[gap] = last; // Move last slot to empty one. + _in[i] = NULL; // NULL out last slot. + } public: // Globally replace this node by a given new node, updating all uses. @@ -492,13 +516,23 @@ public: // Add or remove precedence edges void add_prec( Node *n ); void rm_prec( uint i ); + + // Note: prec(i) will not necessarily point to n if edge already exists. void set_prec( uint i, Node *n ) { - assert( is_not_dead(n), "can not use dead node"); - assert( i >= _cnt, "not a precedence edge"); + assert(i < _max, "oob: i=%d, _max=%d", i, _max); + assert(is_not_dead(n), "can not use dead node"); + assert(i >= _cnt, "not a precedence edge"); + // Avoid spec violation: duplicated prec edge. + if (_in[i] == n) return; + if (n == NULL || find_prec_edge(n) != -1) { + rm_prec(i); + return; + } if (_in[i] != NULL) _in[i]->del_out((Node *)this); _in[i] = n; if (n != NULL) n->add_out((Node *)this); } + // Set this node's index, used by cisc_version to replace current node void set_idx(uint new_idx) { const node_idx_t* ref = &_idx; @@ -620,7 +654,8 @@ public: DEFINE_CLASS_ID(Type, Node, 2) DEFINE_CLASS_ID(Phi, Type, 0) DEFINE_CLASS_ID(ConstraintCast, Type, 1) - DEFINE_CLASS_ID(CheckCastPP, Type, 2) + DEFINE_CLASS_ID(CastII, ConstraintCast, 0) + DEFINE_CLASS_ID(CheckCastPP, ConstraintCast, 1) DEFINE_CLASS_ID(CMove, Type, 3) DEFINE_CLASS_ID(SafePointScalarObject, Type, 4) DEFINE_CLASS_ID(DecodeNarrowPtr, Type, 5) @@ -751,6 +786,7 @@ public: DEFINE_CLASS_QUERY(Catch) DEFINE_CLASS_QUERY(CatchProj) DEFINE_CLASS_QUERY(CheckCastPP) + DEFINE_CLASS_QUERY(CastII) DEFINE_CLASS_QUERY(ConstraintCast) DEFINE_CLASS_QUERY(ClearArray) DEFINE_CLASS_QUERY(CMove) @@ -893,10 +929,10 @@ public: // Return an existing node which computes the same function as this node. // The optimistic combined algorithm requires this to return a Node which // is a small number of steps away (e.g., one of my inputs). - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); // Return the set of values this Node can take on at runtime. - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; // Return a node which is more "ideal" than the current node. // The invariants on this call are subtle. If in doubt, read the @@ -1663,7 +1699,7 @@ public: TypeNode( const Type *t, uint required ) : Node(required), _type(t) { init_class_id(Class_Type); } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const; virtual uint ideal_reg() const; #ifndef PRODUCT diff --git a/hotspot/src/share/vm/opto/opaquenode.cpp b/hotspot/src/share/vm/opto/opaquenode.cpp index cc0bdebc79e..f6afc7ebccf 100644 --- a/hotspot/src/share/vm/opto/opaquenode.cpp +++ b/hotspot/src/share/vm/opto/opaquenode.cpp @@ -40,7 +40,7 @@ uint Opaque1Node::cmp( const Node &n ) const { // call to IterGVN and any chance of hitting this code. Hence there's no // phase-ordering problem with stripping Opaque1 in IGVN followed by some // more loop optimizations that require it. -Node *Opaque1Node::Identity( PhaseTransform *phase ) { +Node* Opaque1Node::Identity(PhaseGVN* phase) { return phase->C->major_progress() ? this : in(1); } @@ -76,7 +76,7 @@ Node *ProfileBooleanNode::Ideal(PhaseGVN *phase, bool can_reshape) { } } -Node *ProfileBooleanNode::Identity( PhaseTransform *phase ) { +Node* ProfileBooleanNode::Identity(PhaseGVN* phase) { if (_delay_removal) { return this; } else { diff --git a/hotspot/src/share/vm/opto/opaquenode.hpp b/hotspot/src/share/vm/opto/opaquenode.hpp index ba298864486..5c4c7e42100 100644 --- a/hotspot/src/share/vm/opto/opaquenode.hpp +++ b/hotspot/src/share/vm/opto/opaquenode.hpp @@ -50,7 +50,7 @@ class Opaque1Node : public Node { Node* original_loop_limit() { return req()==3 ? in(2) : NULL; } virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeInt::INT; } - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); }; //------------------------------Opaque2Node------------------------------------ @@ -109,7 +109,7 @@ class ProfileBooleanNode : public Node { virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity(PhaseTransform *phase); + virtual Node* Identity(PhaseGVN* phase); virtual const Type *bottom_type() const { return TypeInt::BOOL; } }; diff --git a/hotspot/src/share/vm/opto/parse2.cpp b/hotspot/src/share/vm/opto/parse2.cpp index f6adb5d6241..e03abd4f931 100644 --- a/hotspot/src/share/vm/opto/parse2.cpp +++ b/hotspot/src/share/vm/opto/parse2.cpp @@ -166,7 +166,9 @@ Node* Parse::array_addressing(BasicType type, int vals, const Type* *result2) { // Check for always knowing you are throwing a range-check exception if (stopped()) return top(); - Node* ptr = array_element_address(ary, idx, type, sizetype); + // Make array address computation control dependent to prevent it + // from floating above the range check during loop optimizations. + Node* ptr = array_element_address(ary, idx, type, sizetype, control()); if (result2 != NULL) *result2 = elemtype; @@ -466,12 +468,14 @@ bool Parse::create_jump_tables(Node* key_val, SwitchRange* lo, SwitchRange* hi) // of all possible ranges for a switch statement // The key_val input must be converted to a pointer offset and scaled. // Compare Parse::array_addressing above. -#ifdef _LP64 + // Clean the 32-bit int into a real 64-bit offset. // Otherwise, the jint value 0 might turn into an offset of 0x0800000000. - const TypeLong* lkeytype = TypeLong::make(CONST64(0), num_cases-1, Type::WidenMin); - key_val = _gvn.transform( new ConvI2LNode(key_val, lkeytype) ); -#endif + const TypeInt* ikeytype = TypeInt::make(0, num_cases, Type::WidenMin); + // Make I2L conversion control dependent to prevent it from + // floating above the range check during loop optimizations. + key_val = C->conv_I2X_index(&_gvn, key_val, ikeytype, control()); + // Shift the value by wordsize so we have an index into the table, rather // than a switch value Node *shiftWord = _gvn.MakeConX(wordSize); diff --git a/hotspot/src/share/vm/opto/phaseX.cpp b/hotspot/src/share/vm/opto/phaseX.cpp index 0274f0e7c98..1f6de0d1700 100644 --- a/hotspot/src/share/vm/opto/phaseX.cpp +++ b/hotspot/src/share/vm/opto/phaseX.cpp @@ -26,6 +26,7 @@ #include "memory/allocation.inline.hpp" #include "opto/block.hpp" #include "opto/callnode.hpp" +#include "opto/castnode.hpp" #include "opto/cfgnode.hpp" #include "opto/idealGraphPrinter.hpp" #include "opto/loopnode.hpp" @@ -835,6 +836,22 @@ Node *PhaseGVN::transform_no_reclaim( Node *n ) { return k; } +bool PhaseGVN::is_dominator_helper(Node *d, Node *n, bool linear_only) { + if (d->is_top() || n->is_top()) { + return false; + } + assert(d->is_CFG() && n->is_CFG(), "must have CFG nodes"); + int i = 0; + while (d != n) { + n = IfNode::up_one_dom(n, linear_only); + i++; + if (n == NULL || i >= 10) { + return false; + } + } + return true; +} + #ifdef ASSERT //------------------------------dead_loop_check-------------------------------- // Check for a simple dead loop when a data node references itself directly @@ -1396,6 +1413,10 @@ void PhaseIterGVN::remove_globally_dead_node( Node *dead ) { if (dead->is_expensive()) { C->remove_expensive_node(dead); } + CastIINode* cast = dead->isa_CastII(); + if (cast != NULL && cast->has_range_check()) { + C->remove_range_check_cast(cast); + } } } // while (_stack.is_nonempty()) } @@ -1525,7 +1546,7 @@ void PhaseIterGVN::add_users_to_worklist( Node *n ) { } // If changed Cast input, check Phi users for simple cycles - if( use->is_ConstraintCast() || use->is_CheckCastPP() ) { + if (use->is_ConstraintCast()) { for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) { Node* u = use->fast_out(i2); if (u->is_Phi()) diff --git a/hotspot/src/share/vm/opto/phaseX.hpp b/hotspot/src/share/vm/opto/phaseX.hpp index 990383e76c6..837118d177a 100644 --- a/hotspot/src/share/vm/opto/phaseX.hpp +++ b/hotspot/src/share/vm/opto/phaseX.hpp @@ -330,6 +330,9 @@ public: // Delayed node rehash if this is an IGVN phase virtual void igvn_rehash_node_delayed(Node* n) {} + // true if CFG node d dominates CFG node n + virtual bool is_dominator(Node *d, Node *n) { fatal("unimplemented for this pass"); return false; }; + #ifndef PRODUCT void dump_old2new_map() const; void dump_new( uint new_lidx ) const; @@ -397,6 +400,9 @@ public: //------------------------------PhaseGVN--------------------------------------- // Phase for performing local, pessimistic GVN-style optimizations. class PhaseGVN : public PhaseValues { +protected: + bool is_dominator_helper(Node *d, Node *n, bool linear_only); + public: PhaseGVN( Arena *arena, uint est_max_size ) : PhaseValues( arena, est_max_size ) {} PhaseGVN( PhaseGVN *gvn ) : PhaseValues( gvn ) {} @@ -415,6 +421,8 @@ public: _types = gvn->_types; } + bool is_dominator(Node *d, Node *n) { return is_dominator_helper(d, n, true); } + // Check for a simple dead loop when a data node references itself. DEBUG_ONLY(void dead_loop_check(Node *n);) }; @@ -545,6 +553,8 @@ public: _table.check_no_speculative_types(); } + bool is_dominator(Node *d, Node *n) { return is_dominator_helper(d, n, false); } + #ifndef PRODUCT protected: // Sub-quadratic implementation of VerifyIterativeGVN. diff --git a/hotspot/src/share/vm/opto/rootnode.cpp b/hotspot/src/share/vm/opto/rootnode.cpp index e5542f6ff74..dab56c1cf2b 100644 --- a/hotspot/src/share/vm/opto/rootnode.cpp +++ b/hotspot/src/share/vm/opto/rootnode.cpp @@ -79,7 +79,7 @@ Node *HaltNode::Ideal(PhaseGVN *phase, bool can_reshape) { } //------------------------------Value------------------------------------------ -const Type *HaltNode::Value( PhaseTransform *phase ) const { +const Type* HaltNode::Value(PhaseGVN* phase) const { return ( phase->type(in(TypeFunc::Control)) == Type::TOP) ? Type::TOP : Type::BOTTOM; diff --git a/hotspot/src/share/vm/opto/rootnode.hpp b/hotspot/src/share/vm/opto/rootnode.hpp index 3be5dfa7673..a15d9edf6d7 100644 --- a/hotspot/src/share/vm/opto/rootnode.hpp +++ b/hotspot/src/share/vm/opto/rootnode.hpp @@ -42,9 +42,9 @@ public: virtual int Opcode() const; virtual const Node *is_block_proj() const { return this; } virtual const Type *bottom_type() const { return Type::BOTTOM; } - virtual Node *Identity( PhaseTransform *phase ) { return this; } + virtual Node* Identity(PhaseGVN* phase) { return this; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const { return Type::BOTTOM; } + virtual const Type* Value(PhaseGVN* phase) const { return Type::BOTTOM; } }; //------------------------------HaltNode--------------------------------------- @@ -55,7 +55,7 @@ public: virtual int Opcode() const; virtual bool pinned() const { return true; }; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const; virtual bool is_CFG() const { return true; } virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp index e6639491063..1d6bdfb6230 100644 --- a/hotspot/src/share/vm/opto/runtime.cpp +++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -46,6 +46,7 @@ #include "memory/oopFactory.hpp" #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" +#include "oops/typeArrayOop.inline.hpp" #include "opto/ad.hpp" #include "opto/addnode.hpp" #include "opto/callnode.hpp" @@ -1432,7 +1433,7 @@ address OptoRuntime::handle_exception_C(JavaThread* thread) { // However, there needs to be a safepoint check in the middle! So compiled // safepoints are completely watertight. // -// Thus, it cannot be a leaf since it contains the No_GC_Verifier. +// Thus, it cannot be a leaf since it contains the NoGCVerifier. // // *THIS IS NOT RECOMMENDED PROGRAMMING STYLE* // diff --git a/hotspot/src/share/vm/opto/stringopts.cpp b/hotspot/src/share/vm/opto/stringopts.cpp index 241384eccc6..79036c9d539 100644 --- a/hotspot/src/share/vm/opto/stringopts.cpp +++ b/hotspot/src/share/vm/opto/stringopts.cpp @@ -822,11 +822,10 @@ bool StringConcat::validate_mem_flow() { } } else if (ctrl->is_IfTrue()) { // null checks, class checks iff = ctrl->in(0)->as_If(); - assert(iff->is_If(), "must be if"); // Verify that the other arm is an uncommon trap Node* otherproj = iff->proj_out(1 - ctrl->as_Proj()->_con); CallStaticJavaNode* call = otherproj->unique_out()->isa_CallStaticJava(); - assert(strcmp(call->_name, "uncommon_trap") == 0, "must be uncommond trap"); + assert(strcmp(call->_name, "uncommon_trap") == 0, "must be uncommon trap"); ctrl = iff->in(0); } else { break; @@ -914,6 +913,13 @@ bool StringConcat::validate_control_flow() { BoolNode* b = iff->in(1)->isa_Bool(); if (b == NULL) { +#ifndef PRODUCT + if (PrintOptimizeStringConcat) { + tty->print_cr("unexpected input to IfNode"); + iff->in(1)->dump(); + tty->cr(); + } +#endif fail = true; break; } @@ -1460,7 +1466,7 @@ void PhaseStringOpts::copy_latin1_string(GraphKit& kit, IdealKit& ideal, Node* s // Use fast intrinsic Node* src = kit.array_element_address(src_array, kit.intcon(0), T_BYTE); Node* dst = kit.array_element_address(dst_array, start, T_BYTE); - kit.inflate_string(src, dst, __ value(count)); + kit.inflate_string(src, dst, TypeAryPtr::BYTES, __ value(count)); } else { // No intrinsic available, use slow method kit.inflate_string_slow(src_array, dst_array, start, __ value(count)); diff --git a/hotspot/src/share/vm/opto/subnode.cpp b/hotspot/src/share/vm/opto/subnode.cpp index 6e27f53c0a4..4250c6b8a20 100644 --- a/hotspot/src/share/vm/opto/subnode.cpp +++ b/hotspot/src/share/vm/opto/subnode.cpp @@ -46,7 +46,7 @@ //============================================================================= //------------------------------Identity--------------------------------------- // If right input is a constant 0, return the left input. -Node *SubNode::Identity( PhaseTransform *phase ) { +Node* SubNode::Identity(PhaseGVN* phase) { assert(in(1) != this, "Must already have called Value"); assert(in(2) != this, "Must already have called Value"); @@ -100,7 +100,7 @@ const Type* SubNode::Value_common(PhaseTransform *phase) const { return NULL; } -const Type* SubNode::Value(PhaseTransform *phase) const { +const Type* SubNode::Value(PhaseGVN* phase) const { const Type* t = Value_common(phase); if (t != NULL) { return t; @@ -378,7 +378,7 @@ const Type *SubLNode::sub( const Type *t1, const Type *t2 ) const { //============================================================================= //------------------------------Value------------------------------------------ // A subtract node differences its two inputs. -const Type *SubFPNode::Value( PhaseTransform *phase ) const { +const Type* SubFPNode::Value(PhaseGVN* phase) const { const Node* in1 = in(1); const Node* in2 = in(2); // Either input is TOP ==> the result is TOP @@ -494,7 +494,7 @@ const Type *SubDNode::sub( const Type *t1, const Type *t2 ) const { // Unlike SubNodes, compare must still flatten return value to the // range -1, 0, 1. // And optimizations like those for (X + Y) - X fail if overflow happens. -Node *CmpNode::Identity( PhaseTransform *phase ) { +Node* CmpNode::Identity(PhaseGVN* phase) { return this; } @@ -611,7 +611,7 @@ const Type *CmpUNode::sub( const Type *t1, const Type *t2 ) const { return TypeInt::CC; // else use worst case results } -const Type* CmpUNode::Value(PhaseTransform *phase) const { +const Type* CmpUNode::Value(PhaseGVN* phase) const { const Type* t = SubNode::Value_common(phase); if (t != NULL) { return t; @@ -1053,7 +1053,7 @@ Node *CmpNNode::Ideal( PhaseGVN *phase, bool can_reshape ) { //------------------------------Value------------------------------------------ // Simplify an CmpF (compare 2 floats ) node, based on local information. // If both inputs are constants, compare them. -const Type *CmpFNode::Value( PhaseTransform *phase ) const { +const Type* CmpFNode::Value(PhaseGVN* phase) const { const Node* in1 = in(1); const Node* in2 = in(2); // Either input is TOP ==> the result is TOP @@ -1083,7 +1083,7 @@ const Type *CmpFNode::Value( PhaseTransform *phase ) const { //------------------------------Value------------------------------------------ // Simplify an CmpD (compare 2 doubles ) node, based on local information. // If both inputs are constants, compare them. -const Type *CmpDNode::Value( PhaseTransform *phase ) const { +const Type* CmpDNode::Value(PhaseGVN* phase) const { const Node* in1 = in(1); const Node* in2 = in(2); // Either input is TOP ==> the result is TOP @@ -1423,7 +1423,7 @@ Node *BoolNode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Value------------------------------------------ // Simplify a Bool (convert condition codes to boolean (1 or 0)) node, // based on local information. If the input is constant, do it. -const Type *BoolNode::Value( PhaseTransform *phase ) const { +const Type* BoolNode::Value(PhaseGVN* phase) const { return _test.cc2logical( phase->type( in(1) ) ); } @@ -1466,7 +1466,7 @@ bool BoolNode::is_counted_loop_exit_test() { //============================================================================= //------------------------------Value------------------------------------------ // Compute sqrt -const Type *SqrtDNode::Value( PhaseTransform *phase ) const { +const Type* SqrtDNode::Value(PhaseGVN* phase) const { const Type *t1 = phase->type( in(1) ); if( t1 == Type::TOP ) return Type::TOP; if( t1->base() != Type::DoubleCon ) return Type::DOUBLE; @@ -1475,32 +1475,10 @@ const Type *SqrtDNode::Value( PhaseTransform *phase ) const { return TypeD::make( sqrt( d ) ); } -//============================================================================= -//------------------------------Value------------------------------------------ -// Compute cos -const Type *CosDNode::Value( PhaseTransform *phase ) const { - const Type *t1 = phase->type( in(1) ); - if( t1 == Type::TOP ) return Type::TOP; - if( t1->base() != Type::DoubleCon ) return Type::DOUBLE; - double d = t1->getd(); - return TypeD::make( StubRoutines::intrinsic_cos( d ) ); -} - -//============================================================================= -//------------------------------Value------------------------------------------ -// Compute sin -const Type *SinDNode::Value( PhaseTransform *phase ) const { - const Type *t1 = phase->type( in(1) ); - if( t1 == Type::TOP ) return Type::TOP; - if( t1->base() != Type::DoubleCon ) return Type::DOUBLE; - double d = t1->getd(); - return TypeD::make( StubRoutines::intrinsic_sin( d ) ); -} - //============================================================================= //------------------------------Value------------------------------------------ // Compute tan -const Type *TanDNode::Value( PhaseTransform *phase ) const { +const Type* TanDNode::Value(PhaseGVN* phase) const { const Type *t1 = phase->type( in(1) ); if( t1 == Type::TOP ) return Type::TOP; if( t1->base() != Type::DoubleCon ) return Type::DOUBLE; @@ -1511,7 +1489,7 @@ const Type *TanDNode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Value------------------------------------------ // Compute log10 -const Type *Log10DNode::Value( PhaseTransform *phase ) const { +const Type* Log10DNode::Value(PhaseGVN* phase) const { const Type *t1 = phase->type( in(1) ); if( t1 == Type::TOP ) return Type::TOP; if( t1->base() != Type::DoubleCon ) return Type::DOUBLE; diff --git a/hotspot/src/share/vm/opto/subnode.hpp b/hotspot/src/share/vm/opto/subnode.hpp index 3ee7b4763b1..1812853a8a9 100644 --- a/hotspot/src/share/vm/opto/subnode.hpp +++ b/hotspot/src/share/vm/opto/subnode.hpp @@ -45,11 +45,11 @@ public: // Handle algebraic identities here. If we have an identity, return the Node // we are equivalent to. We look for "add of zero" as an identity. - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); // Compute a new Type for this node. Basically we just do the pre-check, // then call the virtual add() to set the type. - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; const Type* Value_common( PhaseTransform *phase ) const; // Supplied function returns the subtractend of the inputs. @@ -97,7 +97,7 @@ class SubFPNode : public SubNode { protected: SubFPNode( Node *in1, Node *in2 ) : SubNode(in1,in2) {} public: - const Type *Value( PhaseTransform *phase ) const; + const Type* Value(PhaseGVN* phase) const; }; // NOTE: SubFNode should be taken away and replaced by add and negate @@ -135,7 +135,7 @@ public: CmpNode( Node *in1, Node *in2 ) : SubNode(in1,in2) { init_class_id(Class_Cmp); } - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); const Type *add_id() const { return TypeInt::ZERO; } const Type *bottom_type() const { return TypeInt::CC; } virtual uint ideal_reg() const { return Op_RegFlags; } @@ -165,7 +165,7 @@ public: CmpUNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {} virtual int Opcode() const; virtual const Type *sub( const Type *, const Type * ) const; - const Type *Value( PhaseTransform *phase ) const; + const Type* Value(PhaseGVN* phase) const; bool is_index_range_check() const; }; @@ -219,7 +219,7 @@ public: CmpFNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {} virtual int Opcode() const; virtual const Type *sub( const Type *, const Type * ) const { ShouldNotReachHere(); return NULL; } - const Type *Value( PhaseTransform *phase ) const; + const Type* Value(PhaseGVN* phase) const; }; //------------------------------CmpF3Node-------------------------------------- @@ -247,7 +247,7 @@ public: CmpDNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {} virtual int Opcode() const; virtual const Type *sub( const Type *, const Type * ) const { ShouldNotReachHere(); return NULL; } - const Type *Value( PhaseTransform *phase ) const; + const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); }; @@ -309,7 +309,7 @@ public: BoolNode* negate(PhaseGVN* phase); virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const { return TypeInt::BOOL; } uint match_edge(uint idx) const { return 0; } virtual uint ideal_reg() const { return Op_RegI; } @@ -408,35 +408,6 @@ public: virtual uint ideal_reg() const { return Op_RegD; } }; -//------------------------------CosDNode--------------------------------------- -// Cosinus of a double -class CosDNode : public Node { -public: - CosDNode(Compile* C, Node *c, Node *in1) : Node(c, in1) { - init_flags(Flag_is_expensive); - C->add_expensive_node(this); - } - virtual int Opcode() const; - const Type *bottom_type() const { return Type::DOUBLE; } - virtual uint ideal_reg() const { return Op_RegD; } - virtual const Type *Value( PhaseTransform *phase ) const; -}; - -//------------------------------CosDNode--------------------------------------- -// Sinus of a double -class SinDNode : public Node { -public: - SinDNode(Compile* C, Node *c, Node *in1) : Node(c, in1) { - init_flags(Flag_is_expensive); - C->add_expensive_node(this); - } - virtual int Opcode() const; - const Type *bottom_type() const { return Type::DOUBLE; } - virtual uint ideal_reg() const { return Op_RegD; } - virtual const Type *Value( PhaseTransform *phase ) const; -}; - - //------------------------------TanDNode--------------------------------------- // tangens of a double class TanDNode : public Node { @@ -448,7 +419,7 @@ public: virtual int Opcode() const; const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; }; @@ -474,7 +445,7 @@ public: virtual int Opcode() const; const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; }; //------------------------------Log10DNode--------------------------------------- @@ -488,7 +459,7 @@ public: virtual int Opcode() const; const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; }; //-------------------------------ReverseBytesINode-------------------------------- diff --git a/hotspot/src/share/vm/opto/superword.cpp b/hotspot/src/share/vm/opto/superword.cpp index 67d27e35bf8..b7495936443 100644 --- a/hotspot/src/share/vm/opto/superword.cpp +++ b/hotspot/src/share/vm/opto/superword.cpp @@ -3343,6 +3343,11 @@ bool SWPointer::scaled_iv(Node* n) { return true; } } else if (opc == Op_ConvI2L) { + if (n->in(1)->Opcode() == Op_CastII && + n->in(1)->as_CastII()->has_range_check()) { + // Skip range check dependent CastII nodes + n = n->in(1); + } if (scaled_iv_plus_offset(n->in(1))) { NOT_PRODUCT(_tracer.scaled_iv_7(n);) return true; @@ -3437,11 +3442,19 @@ bool SWPointer::offset_plus_k(Node* n, bool negate) { if (invariant(n)) { if (opc == Op_ConvI2L) { n = n->in(1); + if (n->Opcode() == Op_CastII && + n->as_CastII()->has_range_check()) { + // Skip range check dependent CastII nodes + assert(invariant(n), "sanity"); + n = n->in(1); + } + } + if (n->bottom_type()->isa_int()) { + _negate_invar = negate; + _invar = n; + NOT_PRODUCT(_tracer.offset_plus_k_10(n, _invar, _negate_invar, _offset);) + return true; } - _negate_invar = negate; - _invar = n; - NOT_PRODUCT(_tracer.offset_plus_k_10(n, _invar, _negate_invar, _offset);) - return true; } NOT_PRODUCT(_tracer.offset_plus_k_11(n);) diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index 54d8248e718..e3251d14e56 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -28,7 +28,7 @@ #include "classfile/altHashing.hpp" #include "classfile/classFileStream.hpp" #include "classfile/classLoader.hpp" -#include "classfile/javaClasses.hpp" +#include "classfile/javaClasses.inline.hpp" #include "classfile/symbolTable.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" @@ -78,6 +78,7 @@ #include "utilities/dtrace.hpp" #include "utilities/events.hpp" #include "utilities/histogram.hpp" +#include "utilities/internalVMTests.hpp" #include "utilities/macros.hpp" #if INCLUDE_ALL_GCS #include "gc/g1/g1SATBCardTableModRefBS.hpp" @@ -204,7 +205,7 @@ intptr_t jfieldIDWorkaround::encode_klass_hash(Klass* k, intptr_t offset) { field_klass = super_klass; // super contains the field also super_klass = field_klass->super(); } - debug_only(No_Safepoint_Verifier nosafepoint;) + debug_only(NoSafepointVerifier nosafepoint;) uintptr_t klass_hash = field_klass->identity_hash(); return ((klass_hash & klass_mask) << klass_shift) | checked_mask_in_place; } else { @@ -224,7 +225,7 @@ bool jfieldIDWorkaround::klass_hash_ok(Klass* k, jfieldID id) { uintptr_t as_uint = (uintptr_t) id; intptr_t klass_hash = (as_uint >> klass_shift) & klass_mask; do { - debug_only(No_Safepoint_Verifier nosafepoint;) + debug_only(NoSafepointVerifier nosafepoint;) // Could use a non-blocking query for identity_hash here... if ((k->identity_hash() & klass_mask) == klass_hash) return true; @@ -1124,7 +1125,7 @@ static void jni_invoke_nonstatic(JNIEnv *env, JavaValue* result, jobject receive selected_method = m; } else if (!m->has_itable_index()) { // non-interface call -- for that little speed boost, don't handlize - debug_only(No_Safepoint_Verifier nosafepoint;) + debug_only(NoSafepointVerifier nosafepoint;) // jni_GetMethodID makes sure class is linked and initialized // so m should have a valid vtable index. assert(m->valid_vtable_index(), "no valid vtable index"); @@ -3157,7 +3158,7 @@ JNI_END JNI_ENTRY(void*, jni_GetPrimitiveArrayCritical(JNIEnv *env, jarray array, jboolean *isCopy)) JNIWrapper("GetPrimitiveArrayCritical"); HOTSPOT_JNI_GETPRIMITIVEARRAYCRITICAL_ENTRY(env, array, (uintptr_t *) isCopy); - GC_locker::lock_critical(thread); + GCLocker::lock_critical(thread); if (isCopy != NULL) { *isCopy = JNI_FALSE; } @@ -3179,7 +3180,7 @@ JNI_ENTRY(void, jni_ReleasePrimitiveArrayCritical(JNIEnv *env, jarray array, voi JNIWrapper("ReleasePrimitiveArrayCritical"); HOTSPOT_JNI_RELEASEPRIMITIVEARRAYCRITICAL_ENTRY(env, array, carray, mode); // The array, carray and mode arguments are ignored - GC_locker::unlock_critical(thread); + GCLocker::unlock_critical(thread); HOTSPOT_JNI_RELEASEPRIMITIVEARRAYCRITICAL_RETURN(); JNI_END @@ -3187,7 +3188,7 @@ JNI_END JNI_ENTRY(const jchar*, jni_GetStringCritical(JNIEnv *env, jstring string, jboolean *isCopy)) JNIWrapper("GetStringCritical"); HOTSPOT_JNI_GETSTRINGCRITICAL_ENTRY(env, string, (uintptr_t *) isCopy); - GC_locker::lock_critical(thread); + GCLocker::lock_critical(thread); oop s = JNIHandles::resolve_non_null(string); typeArrayOop s_value = java_lang_String::value(s); bool is_latin1 = java_lang_String::is_latin1(s); @@ -3225,7 +3226,7 @@ JNI_ENTRY(void, jni_ReleaseStringCritical(JNIEnv *env, jstring str, const jchar // This assumes that ReleaseStringCritical bookends GetStringCritical. FREE_C_HEAP_ARRAY(jchar, chars); } - GC_locker::unlock_critical(thread); + GCLocker::unlock_critical(thread); HOTSPOT_JNI_RELEASESTRINGCRITICAL_RETURN(); JNI_END @@ -3850,112 +3851,6 @@ _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_GetDefaultJavaVMInitArgs(void *args_) { return ret; } -#ifndef PRODUCT - -#include "gc/shared/collectedHeap.hpp" -#include "gc/shared/gcTimer.hpp" -#if INCLUDE_ALL_GCS -#include "gc/g1/heapRegionRemSet.hpp" -#endif -#include "compiler/directivesParser.hpp" -#include "memory/guardedMemory.hpp" -#include "utilities/json.hpp" -#include "utilities/ostream.hpp" -#include "utilities/quickSort.hpp" -#if INCLUDE_VM_STRUCTS -#include "runtime/vmStructs.hpp" -#endif - -#define run_unit_test(unit_test_function_call) \ - tty->print_cr("Running test: " #unit_test_function_call); \ - unit_test_function_call - -// Forward declaration -void TestDependencyContext_test(); -void test_semaphore(); -void TestOS_test(); -void TestReservedSpace_test(); -void TestReserveMemorySpecial_test(); -void TestVirtualSpace_test(); -void TestMetaspaceAux_test(); -void TestMetachunk_test(); -void TestVirtualSpaceNode_test(); -void TestNewSize_test(); -void TestOldSize_test(); -void TestKlass_test(); -void TestBitMap_test(); -void TestAsUtf8(); -void Test_linked_list(); -void TestResourcehash_test(); -void TestChunkedList_test(); -void Test_log_length(); -#if INCLUDE_ALL_GCS -void TestOldFreeSpaceCalculation_test(); -void TestG1BiasedArray_test(); -void TestBufferingOopClosure_test(); -void TestCodeCacheRemSet_test(); -void FreeRegionList_test(); -void IHOP_test(); -void test_memset_with_concurrent_readers() NOT_DEBUG_RETURN; -void TestPredictions_test(); -void WorkerDataArray_test(); -#endif - -void execute_internal_vm_tests() { - if (ExecuteInternalVMTests) { - tty->print_cr("Running internal VM tests"); - run_unit_test(TestDependencyContext_test()); - run_unit_test(test_semaphore()); - run_unit_test(TestOS_test()); - run_unit_test(TestReservedSpace_test()); - run_unit_test(TestReserveMemorySpecial_test()); - run_unit_test(TestVirtualSpace_test()); - run_unit_test(TestMetaspaceAux_test()); - run_unit_test(TestMetachunk_test()); - run_unit_test(TestVirtualSpaceNode_test()); - run_unit_test(GlobalDefinitions::test_globals()); - run_unit_test(GCTimerAllTest::all()); - run_unit_test(arrayOopDesc::test_max_array_length()); - run_unit_test(CollectedHeap::test_is_in()); - run_unit_test(QuickSort::test_quick_sort()); - run_unit_test(GuardedMemory::test_guarded_memory()); - run_unit_test(AltHashing::test_alt_hash()); - run_unit_test(TestNewSize_test()); - run_unit_test(TestOldSize_test()); - run_unit_test(TestKlass_test()); - run_unit_test(TestBitMap_test()); - run_unit_test(TestAsUtf8()); - run_unit_test(TestResourcehash_test()); - run_unit_test(ObjectMonitor::sanity_checks()); - run_unit_test(Test_linked_list()); - run_unit_test(TestChunkedList_test()); - run_unit_test(JSONTest::test()); - run_unit_test(Test_log_length()); - run_unit_test(DirectivesParser::test()); -#if INCLUDE_VM_STRUCTS - run_unit_test(VMStructs::test()); -#endif -#if INCLUDE_ALL_GCS - run_unit_test(TestOldFreeSpaceCalculation_test()); - run_unit_test(TestG1BiasedArray_test()); - run_unit_test(TestBufferingOopClosure_test()); - run_unit_test(TestCodeCacheRemSet_test()); - if (UseG1GC) { - run_unit_test(FreeRegionList_test()); - run_unit_test(IHOP_test()); - } - run_unit_test(test_memset_with_concurrent_readers()); - run_unit_test(TestPredictions_test()); - run_unit_test(WorkerDataArray_test()); -#endif - tty->print_cr("All internal VM tests passed"); - } -} - -#undef run_unit_test - -#endif - DT_RETURN_MARK_DECL(CreateJavaVM, jint , HOTSPOT_JNI_CREATEJAVAVM_RETURN(_ret_ref)); @@ -4056,7 +3951,9 @@ static jint JNI_CreateJavaVM_inner(JavaVM **vm, void **penv, void *args) { // Some platforms (like Win*) need a wrapper around these test // functions in order to properly handle error conditions. test_error_handler(); - execute_internal_vm_tests(); + if (ExecuteInternalVMTests) { + InternalVMTests::run(); + } #endif // Since this is not a JVM_ENTRY we have to set the thread state manually before leaving. diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index 04dad288395..2067afd58d5 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -2104,6 +2104,56 @@ JVM_ENTRY(jobjectArray, JVM_ConstantPoolGetMemberRefInfoAt(JNIEnv *env, jobject } JVM_END +JVM_ENTRY(jint, JVM_ConstantPoolGetClassRefIndexAt(JNIEnv *env, jobject obj, jobject unused, jint index)) +{ + JVMWrapper("JVM_ConstantPoolGetClassRefIndexAt"); + JvmtiVMObjectAllocEventCollector oam; + constantPoolHandle cp(THREAD, sun_reflect_ConstantPool::get_cp(JNIHandles::resolve_non_null(obj))); + bounds_check(cp, index, CHECK_0); + constantTag tag = cp->tag_at(index); + if (!tag.is_field_or_method()) { + THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "Wrong type at constant pool index"); + } + return (jint) cp->uncached_klass_ref_index_at(index); +} +JVM_END + +JVM_ENTRY(jint, JVM_ConstantPoolGetNameAndTypeRefIndexAt(JNIEnv *env, jobject obj, jobject unused, jint index)) +{ + JVMWrapper("JVM_ConstantPoolGetNameAndTypeRefIndexAt"); + JvmtiVMObjectAllocEventCollector oam; + constantPoolHandle cp(THREAD, sun_reflect_ConstantPool::get_cp(JNIHandles::resolve_non_null(obj))); + bounds_check(cp, index, CHECK_0); + constantTag tag = cp->tag_at(index); + if (!tag.is_invoke_dynamic() && !tag.is_field_or_method()) { + THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "Wrong type at constant pool index"); + } + return (jint) cp->uncached_name_and_type_ref_index_at(index); +} +JVM_END + +JVM_ENTRY(jobjectArray, JVM_ConstantPoolGetNameAndTypeRefInfoAt(JNIEnv *env, jobject obj, jobject unused, jint index)) +{ + JVMWrapper("JVM_ConstantPoolGetNameAndTypeRefInfoAt"); + JvmtiVMObjectAllocEventCollector oam; + constantPoolHandle cp(THREAD, sun_reflect_ConstantPool::get_cp(JNIHandles::resolve_non_null(obj))); + bounds_check(cp, index, CHECK_NULL); + constantTag tag = cp->tag_at(index); + if (!tag.is_name_and_type()) { + THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "Wrong type at constant pool index"); + } + Symbol* member_name = cp->symbol_at(cp->name_ref_index_at(index)); + Symbol* member_sig = cp->symbol_at(cp->signature_ref_index_at(index)); + objArrayOop dest_o = oopFactory::new_objArray(SystemDictionary::String_klass(), 2, CHECK_NULL); + objArrayHandle dest(THREAD, dest_o); + Handle str = java_lang_String::create_from_symbol(member_name, CHECK_NULL); + dest->obj_at_put(0, str()); + str = java_lang_String::create_from_symbol(member_sig, CHECK_NULL); + dest->obj_at_put(1, str()); + return (jobjectArray) JNIHandles::make_local(dest()); +} +JVM_END + JVM_ENTRY(jint, JVM_ConstantPoolGetIntAt(JNIEnv *env, jobject obj, jobject unused, jint index)) { JVMWrapper("JVM_ConstantPoolGetIntAt"); @@ -2186,6 +2236,28 @@ JVM_ENTRY(jstring, JVM_ConstantPoolGetUTF8At(JNIEnv *env, jobject obj, jobject u } JVM_END +JVM_ENTRY(jbyte, JVM_ConstantPoolGetTagAt(JNIEnv *env, jobject obj, jobject unused, jint index)) +{ + JVMWrapper("JVM_ConstantPoolGetTagAt"); + constantPoolHandle cp = constantPoolHandle(THREAD, sun_reflect_ConstantPool::get_cp(JNIHandles::resolve_non_null(obj))); + bounds_check(cp, index, CHECK_0); + constantTag tag = cp->tag_at(index); + jbyte result = tag.value(); + // If returned tag values are not from the JVM spec, e.g. tags from 100 to 105, + // they are changed to the corresponding tags from the JVM spec, so that java code in + // sun.reflect.ConstantPool will return only tags from the JVM spec, not internal ones. + if (tag.is_klass_or_reference()) { + result = JVM_CONSTANT_Class; + } else if (tag.is_string_index()) { + result = JVM_CONSTANT_String; + } else if (tag.is_method_type_in_error()) { + result = JVM_CONSTANT_MethodType; + } else if (tag.is_method_handle_in_error()) { + result = JVM_CONSTANT_MethodHandle; + } + return result; +} +JVM_END // Assertion support. ////////////////////////////////////////////////////////// diff --git a/hotspot/src/share/vm/prims/jvm.h b/hotspot/src/share/vm/prims/jvm.h index 2e995cabf4d..af12c25bf1d 100644 --- a/hotspot/src/share/vm/prims/jvm.h +++ b/hotspot/src/share/vm/prims/jvm.h @@ -87,7 +87,7 @@ extern "C" { * class. */ -#define JVM_INTERFACE_VERSION 4 +#define JVM_INTERFACE_VERSION 5 JNIEXPORT jobjectArray JNICALL JVM_GetMethodParameters(JNIEnv *env, jobject method); @@ -532,6 +532,15 @@ JNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAtIfLoaded JNIEXPORT jobjectArray JNICALL JVM_ConstantPoolGetMemberRefInfoAt (JNIEnv *env, jobject obj, jobject unused, jint index); +JNIEXPORT jobjectArray JNICALL JVM_ConstantPoolGetNameAndTypeRefInfoAt +(JNIEnv *env, jobject obj, jobject unused, jint index); + +JNIEXPORT jint JNICALL JVM_ConstantPoolGetNameAndTypeRefIndexAt +(JNIEnv *env, jobject obj, jobject unused, jint index); + +JNIEXPORT jint JNICALL JVM_ConstantPoolGetClassRefIndexAt +(JNIEnv *env, jobject obj, jobject unused, jint index); + JNIEXPORT jint JNICALL JVM_ConstantPoolGetIntAt (JNIEnv *env, jobject obj, jobject unused, jint index); @@ -550,6 +559,9 @@ JNIEXPORT jstring JNICALL JVM_ConstantPoolGetStringAt JNIEXPORT jstring JNICALL JVM_ConstantPoolGetUTF8At (JNIEnv *env, jobject obj, jobject unused, jint index); +JNIEXPORT jbyte JNICALL JVM_ConstantPoolGetTagAt +(JNIEnv *env, jobject unused, jobject jcpool, jint index); + /* * java.security.* */ diff --git a/hotspot/src/share/vm/prims/jvmtiEnv.cpp b/hotspot/src/share/vm/prims/jvmtiEnv.cpp index bc3dd3ccfc4..a699b79ed95 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp +++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp @@ -630,9 +630,9 @@ JvmtiEnv::SetVerboseFlag(jvmtiVerboseFlag flag, jboolean value) { break; case JVMTI_VERBOSE_GC: if (value == 0) { - LogConfiguration::parse_log_arguments("stdout", "gc=off", NULL, NULL, NULL); + LogConfiguration::configure_stdout(LogLevel::Off, true, LOG_TAGS(gc)); } else { - LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL); + LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(gc)); } break; case JVMTI_VERBOSE_JNI: diff --git a/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp b/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp index e8327c2e0ea..5b2bff54305 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp +++ b/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp @@ -95,7 +95,7 @@ JvmtiEnvBase::initialize() { { // This block of code must not contain any safepoints, as list deallocation // (which occurs at a safepoint) cannot occur simultaneously with this list - // addition. Note: No_Safepoint_Verifier cannot, currently, be used before + // addition. Note: NoSafepointVerifier cannot, currently, be used before // threads exist. JvmtiEnvIterator it; JvmtiEnvBase *previous_env = NULL; diff --git a/hotspot/src/share/vm/prims/jvmtiExport.cpp b/hotspot/src/share/vm/prims/jvmtiExport.cpp index 54a4bac002d..2c352044f02 100644 --- a/hotspot/src/share/vm/prims/jvmtiExport.cpp +++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp @@ -1904,7 +1904,7 @@ void JvmtiExport::record_vm_internal_object_allocation(oop obj) { Thread* thread = Thread::current_or_null(); if (thread != NULL && thread->is_Java_thread()) { // Can not take safepoint here. - No_Safepoint_Verifier no_sfpt; + NoSafepointVerifier no_sfpt; // Can not take safepoint here so can not use state_for to get // jvmti thread state. JvmtiThreadState *state = ((JavaThread*)thread)->jvmti_thread_state(); diff --git a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp index a4ce6c7fee4..8823e6670a6 100644 --- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp +++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp @@ -1674,10 +1674,10 @@ void VM_RedefineClasses::rewrite_cp_refs_in_method(methodHandle method, // We cache a pointer to the bytecodes here in code_base. If GC // moves the Method*, then the bytecodes will also move which - // will likely cause a crash. We create a No_Safepoint_Verifier + // will likely cause a crash. We create a NoSafepointVerifier // object to detect whether we pass a possible safepoint in this // code block. - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; // Bytecodes and their length address code_base = method->code_base(); @@ -1735,7 +1735,7 @@ void VM_RedefineClasses::rewrite_cp_refs_in_method(methodHandle method, Relocator rc(method, NULL /* no RelocatorListener needed */); methodHandle m; { - Pause_No_Safepoint_Verifier pnsv(&nsv); + PauseNoSafepointVerifier pnsv(&nsv); // ldc is 2 bytes and ldc_w is 3 bytes m = rc.insert_space_at(bci, 3, inst_buffer, CHECK); diff --git a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp index a468a62e571..9883c5278b6 100644 --- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp +++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, 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 @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "classfile/javaClasses.inline.hpp" #include "classfile/symbolTable.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" diff --git a/hotspot/src/share/vm/prims/jvmtiThreadState.cpp b/hotspot/src/share/vm/prims/jvmtiThreadState.cpp index b5ed5fb9146..e98891e8ef3 100644 --- a/hotspot/src/share/vm/prims/jvmtiThreadState.cpp +++ b/hotspot/src/share/vm/prims/jvmtiThreadState.cpp @@ -86,7 +86,7 @@ JvmtiThreadState::JvmtiThreadState(JavaThread* thread) { // The thread state list manipulation code must not have safepoints. // See periodic_clean_up(). - debug_only(No_Safepoint_Verifier nosafepoint;) + debug_only(NoSafepointVerifier nosafepoint;) _prev = NULL; _next = _head; @@ -123,7 +123,7 @@ JvmtiThreadState::~JvmtiThreadState() { { // The thread state list manipulation code must not have safepoints. // See periodic_clean_up(). - debug_only(No_Safepoint_Verifier nosafepoint;) + debug_only(NoSafepointVerifier nosafepoint;) if (_prev == NULL) { assert(_head == this, "sanity check"); @@ -147,7 +147,7 @@ JvmtiThreadState::periodic_clean_up() { // This iteration is initialized with "_head" instead of "JvmtiThreadState::first()" // because the latter requires the JvmtiThreadState_lock. - // This iteration is safe at a safepoint as well, see the No_Safepoint_Verifier + // This iteration is safe at a safepoint as well, see the NoSafepointVerifier // asserts at all list manipulation sites. for (JvmtiThreadState *state = _head; state != NULL; state = state->next()) { // For each environment thread state corresponding to an invalid environment @@ -182,7 +182,7 @@ void JvmtiThreadState::add_env(JvmtiEnvBase *env) { // add this environment thread state to the end of the list (order is important) { // list deallocation (which occurs at a safepoint) cannot occur simultaneously - debug_only(No_Safepoint_Verifier nosafepoint;) + debug_only(NoSafepointVerifier nosafepoint;) JvmtiEnvThreadStateIterator it(this); JvmtiEnvThreadState* previous_ets = NULL; diff --git a/hotspot/src/share/vm/prims/methodHandles.cpp b/hotspot/src/share/vm/prims/methodHandles.cpp index 4f21e410c24..00c33b644d3 100644 --- a/hotspot/src/share/vm/prims/methodHandles.cpp +++ b/hotspot/src/share/vm/prims/methodHandles.cpp @@ -202,6 +202,7 @@ oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) { assert(m_klass->verify_itable_index(vmindex), ""); flags |= IS_METHOD | (JVM_REF_invokeInterface << REFERENCE_KIND_SHIFT); if (TraceInvokeDynamic) { + ttyLocker ttyl; ResourceMark rm; tty->print_cr("memberName: invokeinterface method_holder::method: %s, itableindex: %d, access_flags:", Method::name_and_sig_as_C_string(m->method_holder(), m->name(), m->signature()), @@ -242,6 +243,7 @@ oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) { m_klass = m_klass_non_interface; } if (TraceInvokeDynamic) { + ttyLocker ttyl; ResourceMark rm; tty->print_cr("memberName: invokevirtual method_holder::method: %s, receiver: %s, vtableindex: %d, access_flags:", Method::name_and_sig_as_C_string(m->method_holder(), m->name(), m->signature()), @@ -994,7 +996,7 @@ void MethodHandles::flush_dependent_nmethods(Handle call_site, Handle target) { int marked = 0; CallSiteDepChange changes(call_site(), target()); { - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; MutexLockerEx mu2(CodeCache_lock, Mutex::_no_safepoint_check_flag); oop context = java_lang_invoke_CallSite::context(call_site()); @@ -1352,7 +1354,7 @@ JVM_ENTRY(void, MHN_clearCallSiteContext(JNIEnv* env, jobject igcls, jobject con int marked = 0; { - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; MutexLockerEx mu2(CodeCache_lock, Mutex::_no_safepoint_check_flag); assert(safe_to_expunge(), "removal is not safe"); DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context()); diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp index 39e8a4bde15..9e993f7afad 100644 --- a/hotspot/src/share/vm/prims/whitebox.cpp +++ b/hotspot/src/share/vm/prims/whitebox.cpp @@ -565,14 +565,15 @@ WB_ENTRY(jboolean, WB_IsIntrinsicAvailable(JNIEnv* env, jobject o, jobject metho methodHandle mh(THREAD, Method::checked_resolve_jmethod_id(method_id)); DirectiveSet* directive; + AbstractCompiler* comp = CompileBroker::compiler((int)compLevel); if (compilation_context != NULL) { compilation_context_id = reflected_method_to_jmid(thread, env, compilation_context); CHECK_JNI_EXCEPTION_(env, JNI_FALSE); methodHandle cch(THREAD, Method::checked_resolve_jmethod_id(compilation_context_id)); - directive = DirectivesStack::getMatchingDirective(cch, CompileBroker::compiler((int)compLevel)); + directive = DirectivesStack::getMatchingDirective(cch, comp); } else { // Calling with NULL matches default directive - directive = DirectivesStack::getDefaultDirective(CompileBroker::compiler((int)compLevel)); + directive = DirectivesStack::getDefaultDirective(comp); } bool result = CompileBroker::compiler(compLevel)->is_intrinsic_available(mh, directive); DirectivesStack::release(directive); @@ -1095,6 +1096,7 @@ WB_ENTRY(jobjectArray, WB_GetNMethod(JNIEnv* env, jobject o, jobject method, jbo CodeBlobStub stub(code); jobjectArray codeBlob = codeBlob2objectArray(thread, env, &stub); + CHECK_JNI_EXCEPTION_(env, NULL); env->SetObjectArrayElement(result, 0, codeBlob); jobject level = integerBox(thread, env, code->comp_level()); @@ -1180,6 +1182,7 @@ WB_ENTRY(jobjectArray, WB_GetCodeHeapEntries(JNIEnv* env, jobject o, jint blob_t for (GrowableArrayIterator it = blobs.begin(); it != blobs.end(); ++it) { jobjectArray obj = codeBlob2objectArray(thread, env, *it); + CHECK_JNI_EXCEPTION_(env, NULL); env->SetObjectArrayElement(result, i, obj); ++i; } diff --git a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp index 5d9a3096787..1d046e6abe0 100644 --- a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp +++ b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp @@ -165,7 +165,7 @@ bool AdvancedThresholdPolicy::is_method_profiled(Method* method) { // Called with the queue locked and with at least one element CompileTask* AdvancedThresholdPolicy::select_task(CompileQueue* compile_queue) { #if INCLUDE_JVMCI - CompileTask *max_non_jvmci_task = NULL; + CompileTask *max_blocking_task = NULL; #endif CompileTask *max_task = NULL; Method* max_method = NULL; @@ -197,13 +197,25 @@ CompileTask* AdvancedThresholdPolicy::select_task(CompileQueue* compile_queue) { max_method = method; } } +#if INCLUDE_JVMCI + if (UseJVMCICompiler && task->is_blocking()) { + if (max_blocking_task == NULL || compare_methods(method, max_blocking_task->method())) { + max_blocking_task = task; + } + } +#endif task = next_task; } #if INCLUDE_JVMCI if (UseJVMCICompiler) { - if (max_non_jvmci_task != NULL) { - max_task = max_non_jvmci_task; + if (max_blocking_task != NULL) { + // In blocking compilation mode, the CompileBroker will make + // compilations submitted by a JVMCI compiler thread non-blocking. These + // compilations should be scheduled after all blocking compilations + // to service non-compiler related compilations sooner and reduce the + // chance of such compilations timing out. + max_task = max_blocking_task; max_method = max_task->method(); } } diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 279ebf4f7dc..365013e152d 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -33,6 +33,7 @@ #include "gc/shared/referenceProcessor.hpp" #include "gc/shared/taskqueue.hpp" #include "logging/log.hpp" +#include "logging/logTag.hpp" #include "logging/logConfiguration.hpp" #include "memory/allocation.inline.hpp" #include "memory/universe.inline.hpp" @@ -399,14 +400,11 @@ static AliasedFlag const aliased_jvm_flags[] = { { NULL, NULL} }; -static AliasedFlag const aliased_jvm_logging_flags[] = { - { "-XX:+TraceClassResolution", "-Xlog:classresolve=info"}, - { "-XX:-TraceClassResolution", "-Xlog:classresolve=off"}, - { "-XX:+TraceExceptions", "-Xlog:exceptions=info" }, - { "-XX:-TraceExceptions", "-Xlog:exceptions=off" }, - { "-XX:+TraceMonitorInflation", "-Xlog:monitorinflation=debug" }, - { "-XX:-TraceMonitorInflation", "-Xlog:monitorinflation=off" }, - { NULL, NULL } +static AliasedLoggingFlag const aliased_logging_flags[] = { + { "TraceClassResolution", LogLevel::Info, true, LogTag::_classresolve }, + { "TraceExceptions", LogLevel::Info, true, LogTag::_exceptions }, + { "TraceMonitorInflation", LogLevel::Debug, true, LogTag::_monitorinflation }, + { NULL, LogLevel::Off, false, LogTag::__NO_TAG } }; // Return true if "v" is less than "other", where "other" may be "undefined". @@ -939,18 +937,15 @@ const char* Arguments::handle_aliases_and_deprecation(const char* arg, bool warn return NULL; } -// lookup_logging_aliases -// Called from parse_each_vm_init_arg(). Should be called on -XX options before specific cases are checked. -// If arg matches any aliased_jvm_logging_flags entry, look up the real name and copy it into buffer. -bool Arguments::lookup_logging_aliases(const char* arg, char* buffer) { - for (size_t i = 0; aliased_jvm_logging_flags[i].alias_name != NULL; i++) { - const AliasedFlag& flag_status = aliased_jvm_logging_flags[i]; - if (strcmp(flag_status.alias_name, arg) == 0) { - strcpy(buffer, flag_status.real_name); - return true; +AliasedLoggingFlag Arguments::catch_logging_aliases(const char* name){ + for (size_t i = 0; aliased_logging_flags[i].alias_name != NULL; i++) { + const AliasedLoggingFlag& alf = aliased_logging_flags[i]; + if (strcmp(alf.alias_name, name) == 0) { + return alf; } } - return false; + AliasedLoggingFlag a = {NULL, LogLevel::Off, false, LogTag::__NO_TAG}; + return a; } bool Arguments::parse_argument(const char* arg, Flag::Flags origin) { @@ -962,8 +957,14 @@ bool Arguments::parse_argument(const char* arg, Flag::Flags origin) { char dummy; const char* real_name; bool warn_if_deprecated = true; + AliasedLoggingFlag alf; if (sscanf(arg, "-%" XSTR(BUFLEN) NAME_RANGE "%c", name, &dummy) == 1) { + alf = catch_logging_aliases(name); + if (alf.alias_name != NULL){ + LogConfiguration::configure_stdout(LogLevel::Off, alf.exactMatch, alf.tag, LogTag::__NO_TAG); + return true; + } real_name = handle_aliases_and_deprecation(name, warn_if_deprecated); if (real_name == NULL) { return false; @@ -971,6 +972,11 @@ bool Arguments::parse_argument(const char* arg, Flag::Flags origin) { return set_bool_flag(real_name, false, origin); } if (sscanf(arg, "+%" XSTR(BUFLEN) NAME_RANGE "%c", name, &dummy) == 1) { + alf = catch_logging_aliases(name); + if (alf.alias_name != NULL){ + LogConfiguration::configure_stdout(alf.level, alf.exactMatch, alf.tag, LogTag::__NO_TAG); + return true; + } real_name = handle_aliases_and_deprecation(name, warn_if_deprecated); if (real_name == NULL) { return false; @@ -1675,16 +1681,16 @@ void Arguments::set_cms_and_parnew_gc_flags() { // OldPLAB sizing manually turned off: Use a larger default setting, // unless it was manually specified. This is because a too-low value // will slow down scavenges. - FLAG_SET_ERGO(size_t, OldPLABSize, CFLS_LAB::_default_static_old_plab_size); // default value before 6631166 + FLAG_SET_ERGO(size_t, OldPLABSize, CompactibleFreeListSpaceLAB::_default_static_old_plab_size); // default value before 6631166 } else { - FLAG_SET_DEFAULT(OldPLABSize, CFLS_LAB::_default_dynamic_old_plab_size); // old CMSParPromoteBlocksToClaim default + FLAG_SET_DEFAULT(OldPLABSize, CompactibleFreeListSpaceLAB::_default_dynamic_old_plab_size); // old CMSParPromoteBlocksToClaim default } } // If either of the static initialization defaults have changed, note this // modification. if (!FLAG_IS_DEFAULT(OldPLABSize) || !FLAG_IS_DEFAULT(OldPLABWeight)) { - CFLS_LAB::modify_initialization(OldPLABSize, OldPLABWeight); + CompactibleFreeListSpaceLAB::modify_initialization(OldPLABSize, OldPLABWeight); } if (!ClassUnloading) { @@ -2622,14 +2628,14 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, SysClassPath* scp_p, bool* scp_assembly_required_p, Flag::Flags origin) { - // Remaining part of option string + // For match_option to return remaining or value part of option string const char* tail; // iterate over arguments for (int index = 0; index < args->nOptions; index++) { bool is_absolute_path = false; // for -agentpath vs -agentlib - JavaVMOption* option = args->options + index; + const JavaVMOption* option = args->options + index; if (!match_option(option, "-Djava.class.path", &tail) && !match_option(option, "-Dsun.java.command", &tail) && @@ -2643,16 +2649,6 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, build_jvm_args(option->optionString); } - // char buffer to store looked up logging option. - char aliased_logging_option[256]; - - // Catch -XX options which are aliased to Unified logging commands. - if (match_option(option, "-XX:", &tail)) { - if (lookup_logging_aliases(option->optionString, aliased_logging_option)) { - option->optionString = aliased_logging_option; - } - } - // -verbose:[class/gc/jni] if (match_option(option, "-verbose", &tail)) { if (!strcmp(tail, ":class") || !strcmp(tail, "")) { @@ -2663,11 +2659,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, return JNI_EINVAL; } } else if (!strcmp(tail, ":gc")) { - // LogConfiguration_lock is not set up yet, but this code is executed by a single thread - bool ret = LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL); - if (!ret) { - return JNI_EINVAL; - } + LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(gc)); } else if (!strcmp(tail, ":jni")) { if (FLAG_SET_CMDLINE(bool, PrintJNIResolving, true) != Flag::SUCCESS) { return JNI_EINVAL; @@ -3496,15 +3488,19 @@ jint Arguments::finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_req class ScopedVMInitArgs : public StackObj { private: JavaVMInitArgs _args; + char* _container_name; bool _is_set; + char* _vm_options_file_arg; public: - ScopedVMInitArgs() { + ScopedVMInitArgs(const char *container_name) { _args.version = JNI_VERSION_1_2; _args.nOptions = 0; _args.options = NULL; _args.ignoreUnrecognized = false; + _container_name = (char *)container_name; _is_set = false; + _vm_options_file_arg = NULL; } // Populates the JavaVMInitArgs object represented by this @@ -3536,10 +3532,23 @@ class ScopedVMInitArgs : public StackObj { return JNI_OK; } - JavaVMInitArgs* get() { return &_args; } - bool is_set() { return _is_set; } + JavaVMInitArgs* get() { return &_args; } + char* container_name() { return _container_name; } + bool is_set() { return _is_set; } + bool found_vm_options_file_arg() { return _vm_options_file_arg != NULL; } + char* vm_options_file_arg() { return _vm_options_file_arg; } + + void set_vm_options_file_arg(const char *vm_options_file_arg) { + if (_vm_options_file_arg != NULL) { + os::free(_vm_options_file_arg); + } + _vm_options_file_arg = os::strdup_check_oom(vm_options_file_arg); + } ~ScopedVMInitArgs() { + if (_vm_options_file_arg != NULL) { + os::free(_vm_options_file_arg); + } if (_args.options == NULL) return; for (int i = 0; i < _args.nOptions; i++) { os::free(_args.options[i].optionString); @@ -3820,12 +3829,23 @@ static bool use_vm_log() { #endif // PRODUCT +bool Arguments::args_contains_vm_options_file_arg(const JavaVMInitArgs* args) { + for (int index = 0; index < args->nOptions; index++) { + const JavaVMOption* option = args->options + index; + const char* tail; + if (match_option(option, "-XX:VMOptionsFile=", &tail)) { + return true; + } + } + return false; +} + jint Arguments::insert_vm_options_file(const JavaVMInitArgs* args, - char** vm_options_file, + const char* vm_options_file, const int vm_options_file_pos, - ScopedVMInitArgs *vm_options_file_args, + ScopedVMInitArgs* vm_options_file_args, ScopedVMInitArgs* args_out) { - jint code = parse_vm_options_file(*vm_options_file, vm_options_file_args); + jint code = parse_vm_options_file(vm_options_file, vm_options_file_args); if (code != JNI_OK) { return code; } @@ -3834,17 +3854,46 @@ jint Arguments::insert_vm_options_file(const JavaVMInitArgs* args, return JNI_OK; } + if (args_contains_vm_options_file_arg(vm_options_file_args->get())) { + jio_fprintf(defaultStream::error_stream(), + "A VM options file may not refer to a VM options file. " + "Specification of '-XX:VMOptionsFile=' in the " + "options file '%s' in options container '%s' is an error.\n", + vm_options_file_args->vm_options_file_arg(), + vm_options_file_args->container_name()); + return JNI_EINVAL; + } + return args_out->insert(args, vm_options_file_args->get(), vm_options_file_pos); } +// Expand -XX:VMOptionsFile found in args_in as needed. +// mod_args and args_out parameters may return values as needed. +jint Arguments::expand_vm_options_as_needed(const JavaVMInitArgs* args_in, + ScopedVMInitArgs* mod_args, + JavaVMInitArgs** args_out) { + jint code = match_special_option_and_act(args_in, mod_args); + if (code != JNI_OK) { + return code; + } + + if (mod_args->is_set()) { + // args_in contains -XX:VMOptionsFile and mod_args contains the + // original options from args_in along with the options expanded + // from the VMOptionsFile. Return a short-hand to the caller. + *args_out = mod_args->get(); + } else { + *args_out = (JavaVMInitArgs *)args_in; // no changes so use args_in + } + return JNI_OK; +} + jint Arguments::match_special_option_and_act(const JavaVMInitArgs* args, - char ** vm_options_file, ScopedVMInitArgs* args_out) { // Remaining part of option string const char* tail; - int vm_options_file_pos = -1; - ScopedVMInitArgs vm_options_file_args; + ScopedVMInitArgs vm_options_file_args(args_out->container_name()); for (int index = 0; index < args->nOptions; index++) { const JavaVMOption* option = args->options + index; @@ -3856,39 +3905,34 @@ jint Arguments::match_special_option_and_act(const JavaVMInitArgs* args, continue; } if (match_option(option, "-XX:VMOptionsFile=", &tail)) { - if (vm_options_file != NULL) { - // The caller accepts -XX:VMOptionsFile - if (*vm_options_file != NULL) { - jio_fprintf(defaultStream::error_stream(), - "The VM Options file can only be specified once and " - "only on the command line.\n"); - return JNI_EINVAL; - } - - *vm_options_file = (char *) tail; - vm_options_file_pos = index; // save position of -XX:VMOptionsFile - // If there's a VMOptionsFile, parse that (also can set flags_file) - jint code = insert_vm_options_file(args, vm_options_file, - vm_options_file_pos, - &vm_options_file_args, args_out); - if (code != JNI_OK) { - return code; - } - if (args_out->is_set()) { - // The VMOptions file inserted some options so switch 'args' - // to the new set of options, and continue processing which - // preserves "last option wins" semantics. - args = args_out->get(); - // The first option from the VMOptionsFile replaces the - // current option. So we back track to process the - // replacement option. - index--; - } - } else { + if (vm_options_file_args.found_vm_options_file_arg()) { jio_fprintf(defaultStream::error_stream(), - "VM options file is only supported on the command line\n"); + "The option '%s' is already specified in the options " + "container '%s' so the specification of '%s' in the " + "same options container is an error.\n", + vm_options_file_args.vm_options_file_arg(), + vm_options_file_args.container_name(), + option->optionString); return JNI_EINVAL; } + vm_options_file_args.set_vm_options_file_arg(option->optionString); + // If there's a VMOptionsFile, parse that + jint code = insert_vm_options_file(args, tail, index, + &vm_options_file_args, args_out); + if (code != JNI_OK) { + return code; + } + args_out->set_vm_options_file_arg(vm_options_file_args.vm_options_file_arg()); + if (args_out->is_set()) { + // The VMOptions file inserted some options so switch 'args' + // to the new set of options, and continue processing which + // preserves "last option wins" semantics. + args = args_out->get(); + // The first option from the VMOptionsFile replaces the + // current option. So we back track to process the + // replacement option. + index--; + } continue; } if (match_option(option, "-XX:+PrintVMOptions")) { @@ -3957,7 +4001,7 @@ static void print_options(const JavaVMInitArgs *args) { // Parse entry point called from JNI_CreateJavaVM -jint Arguments::parse(const JavaVMInitArgs* args) { +jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) { assert(verify_special_jvm_flags(), "deprecated and obsolete flag table inconsistent"); // Initialize ranges and constraints @@ -3966,67 +4010,74 @@ jint Arguments::parse(const JavaVMInitArgs* args) { // If flag "-XX:Flags=flags-file" is used it will be the first option to be processed. const char* hotspotrc = ".hotspotrc"; - char* vm_options_file = NULL; bool settings_file_specified = false; bool needs_hotspotrc_warning = false; - ScopedVMInitArgs java_tool_options_args; - ScopedVMInitArgs java_options_args; - ScopedVMInitArgs modified_cmd_line_args; + ScopedVMInitArgs initial_java_tool_options_args("env_var='JAVA_TOOL_OPTIONS'"); + ScopedVMInitArgs initial_java_options_args("env_var='_JAVA_OPTIONS'"); + + // Pointers to current working set of containers + JavaVMInitArgs* cur_cmd_args; + JavaVMInitArgs* cur_java_options_args; + JavaVMInitArgs* cur_java_tool_options_args; + + // Containers for modified/expanded options + ScopedVMInitArgs mod_cmd_args("cmd_line_args"); + ScopedVMInitArgs mod_java_tool_options_args("env_var='JAVA_TOOL_OPTIONS'"); + ScopedVMInitArgs mod_java_options_args("env_var='_JAVA_OPTIONS'"); + jint code = - parse_java_tool_options_environment_variable(&java_tool_options_args); + parse_java_tool_options_environment_variable(&initial_java_tool_options_args); if (code != JNI_OK) { return code; } - code = parse_java_options_environment_variable(&java_options_args); + code = parse_java_options_environment_variable(&initial_java_options_args); if (code != JNI_OK) { return code; } - code = match_special_option_and_act(java_tool_options_args.get(), - NULL, NULL); + code = expand_vm_options_as_needed(initial_java_tool_options_args.get(), + &mod_java_tool_options_args, + &cur_java_tool_options_args); if (code != JNI_OK) { return code; } - code = match_special_option_and_act(args, &vm_options_file, - &modified_cmd_line_args); + code = expand_vm_options_as_needed(initial_cmd_args, + &mod_cmd_args, + &cur_cmd_args); if (code != JNI_OK) { return code; } - - // The command line arguments have been modified to include VMOptionsFile arguments. - if (modified_cmd_line_args.is_set()) { - args = modified_cmd_line_args.get(); - } - - code = match_special_option_and_act(java_options_args.get(), - NULL, NULL); + code = expand_vm_options_as_needed(initial_java_options_args.get(), + &mod_java_options_args, + &cur_java_options_args); if (code != JNI_OK) { return code; } - const char * flags_file = Arguments::get_jvm_flags_file(); + const char* flags_file = Arguments::get_jvm_flags_file(); settings_file_specified = (flags_file != NULL); if (IgnoreUnrecognizedVMOptions) { - // uncast const to modify the flag args->ignoreUnrecognized - *(jboolean*)(&args->ignoreUnrecognized) = true; - java_tool_options_args.get()->ignoreUnrecognized = true; - java_options_args.get()->ignoreUnrecognized = true; + cur_cmd_args->ignoreUnrecognized = true; + cur_java_tool_options_args->ignoreUnrecognized = true; + cur_java_options_args->ignoreUnrecognized = true; } // Parse specified settings file if (settings_file_specified) { - if (!process_settings_file(flags_file, true, args->ignoreUnrecognized)) { + if (!process_settings_file(flags_file, true, + cur_cmd_args->ignoreUnrecognized)) { return JNI_EINVAL; } } else { #ifdef ASSERT // Parse default .hotspotrc settings file - if (!process_settings_file(".hotspotrc", false, args->ignoreUnrecognized)) { + if (!process_settings_file(".hotspotrc", false, + cur_cmd_args->ignoreUnrecognized)) { return JNI_EINVAL; } #else @@ -4038,15 +4089,15 @@ jint Arguments::parse(const JavaVMInitArgs* args) { } if (PrintVMOptions) { - print_options(java_tool_options_args.get()); - print_options(args); - print_options(java_options_args.get()); + print_options(cur_java_tool_options_args); + print_options(cur_cmd_args); + print_options(cur_java_options_args); } // Parse JavaVMInitArgs structure passed in, as well as JAVA_TOOL_OPTIONS and _JAVA_OPTIONS - jint result = parse_vm_init_args(java_tool_options_args.get(), - java_options_args.get(), - args); // command line arguments + jint result = parse_vm_init_args(cur_java_tool_options_args, + cur_java_options_args, + cur_cmd_args); if (result != JNI_OK) { return result; diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp index 8ad75aa506a..a6918fde8e7 100644 --- a/hotspot/src/share/vm/runtime/arguments.hpp +++ b/hotspot/src/share/vm/runtime/arguments.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -25,6 +25,8 @@ #ifndef SHARE_VM_RUNTIME_ARGUMENTS_HPP #define SHARE_VM_RUNTIME_ARGUMENTS_HPP +#include "logging/logLevel.hpp" +#include "logging/logTag.hpp" #include "runtime/java.hpp" #include "runtime/os.hpp" #include "runtime/perfData.hpp" @@ -223,6 +225,14 @@ class AgentLibraryList VALUE_OBJ_CLASS_SPEC { // Helper class for controlling the lifetime of JavaVMInitArgs objects. class ScopedVMInitArgs; +// Most logging functions require 5 tags. Some of them may be _NO_TAG. +typedef struct { + const char* alias_name; + LogLevelType level; + bool exactMatch; + LogTagType tag; +} AliasedLoggingFlag; + class Arguments : AllStatic { friend class VMStructs; friend class JvmtiExport; @@ -379,12 +389,15 @@ class Arguments : AllStatic { static jint parse_vm_options_file(const char* file_name, ScopedVMInitArgs* vm_args); static jint parse_options_buffer(const char* name, char* buffer, const size_t buf_len, ScopedVMInitArgs* vm_args); static jint insert_vm_options_file(const JavaVMInitArgs* args, - char** vm_options_file, + const char* vm_options_file, const int vm_options_file_pos, ScopedVMInitArgs* vm_options_file_args, ScopedVMInitArgs* args_out); + static bool args_contains_vm_options_file_arg(const JavaVMInitArgs* args); + static jint expand_vm_options_as_needed(const JavaVMInitArgs* args_in, + ScopedVMInitArgs* mod_args, + JavaVMInitArgs** args_out); static jint match_special_option_and_act(const JavaVMInitArgs* args, - char** vm_options_file, ScopedVMInitArgs* args_out); static jint parse_vm_init_args(const JavaVMInitArgs *java_tool_options_args, @@ -446,7 +459,7 @@ class Arguments : AllStatic { // Return NULL if the arg has expired. static const char* handle_aliases_and_deprecation(const char* arg, bool warn); static bool lookup_logging_aliases(const char* arg, char* buffer); - + static AliasedLoggingFlag catch_logging_aliases(const char* name); static short CompileOnlyClassesNum; static short CompileOnlyClassesMax; static char** CompileOnlyClasses; diff --git a/hotspot/src/share/vm/runtime/compilationPolicy.cpp b/hotspot/src/share/vm/runtime/compilationPolicy.cpp index d6c45d1247f..aa0333968e7 100644 --- a/hotspot/src/share/vm/runtime/compilationPolicy.cpp +++ b/hotspot/src/share/vm/runtime/compilationPolicy.cpp @@ -159,6 +159,26 @@ bool CompilationPolicy::is_compilation_enabled() { return !delay_compilation_during_startup() && CompileBroker::should_compile_new_jobs(); } +CompileTask* CompilationPolicy::select_task_helper(CompileQueue* compile_queue) { +#if INCLUDE_JVMCI + if (UseJVMCICompiler && !BackgroundCompilation) { + /* + * In blocking compilation mode, the CompileBroker will make + * compilations submitted by a JVMCI compiler thread non-blocking. These + * compilations should be scheduled after all blocking compilations + * to service non-compiler related compilations sooner and reduce the + * chance of such compilations timing out. + */ + for (CompileTask* task = compile_queue->first(); task != NULL; task = task->next()) { + if (task->is_blocking()) { + return task; + } + } + } +#endif + return compile_queue->first(); +} + #ifndef PRODUCT void CompilationPolicy::print_time() { tty->print_cr ("Accumulated compilationPolicy times:"); @@ -339,7 +359,7 @@ void NonTieredCompPolicy::disable_compilation(Method* method) { } CompileTask* NonTieredCompPolicy::select_task(CompileQueue* compile_queue) { - return compile_queue->first(); + return select_task_helper(compile_queue); } bool NonTieredCompPolicy::is_mature(Method* method) { diff --git a/hotspot/src/share/vm/runtime/compilationPolicy.hpp b/hotspot/src/share/vm/runtime/compilationPolicy.hpp index 054671a846d..ae2128adb30 100644 --- a/hotspot/src/share/vm/runtime/compilationPolicy.hpp +++ b/hotspot/src/share/vm/runtime/compilationPolicy.hpp @@ -58,6 +58,8 @@ public: static void set_policy(CompilationPolicy* policy) { _policy = policy; } static CompilationPolicy* policy() { return _policy; } + static CompileTask* select_task_helper(CompileQueue* compile_queue); + // Profiling elapsedTimer* accumulated_time() { return &_accumulated_time; } void print_time() PRODUCT_RETURN; diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp index a1711971464..9c038d74c48 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.cpp +++ b/hotspot/src/share/vm/runtime/deoptimization.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -36,6 +36,7 @@ #include "memory/oopFactory.hpp" #include "memory/resourceArea.hpp" #include "oops/method.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "oops/fieldStreams.hpp" #include "oops/verifyOopClosure.hpp" @@ -296,7 +297,7 @@ Deoptimization::UnrollBlock* Deoptimization::fetch_unroll_info_helper(JavaThread // Ensure that no safepoint is taken after pointers have been stored // in fields of rematerialized objects. If a safepoint occurs from here on // out the java state residing in the vframeArray will be missed. - No_Safepoint_Verifier no_safepoint; + NoSafepointVerifier no_safepoint; vframeArray* array = create_vframeArray(thread, deoptee, &map, chunk, realloc_failures); #if defined(COMPILER2) || INCLUDE_JVMCI diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 093578b168c..50895a0bd84 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -741,9 +741,6 @@ public: product(bool, ForceTimeHighResolution, false, \ "Using high time resolution (for Win32 only)") \ \ - develop(bool, TraceItables, false, \ - "Trace initialization and use of itables") \ - \ develop(bool, TracePcPatching, false, \ "Trace usage of frame::patch_pc") \ \ @@ -829,9 +826,6 @@ public: notproduct(bool, StressCriticalJNINatives, false, \ "Exercise register saving code in critical natives") \ \ - product(bool, UseSSE42Intrinsics, false, \ - "SSE4.2 versions of intrinsics") \ - \ product(bool, UseAESIntrinsics, false, \ "Use intrinsics for AES versions of crypto") \ \ @@ -892,7 +886,7 @@ public: \ notproduct(bool, StrictSafepointChecks, trueInDebug, \ "Enable strict checks that safepoints cannot happen for threads " \ - "that use No_Safepoint_Verifier") \ + "that use NoSafepointVerifier") \ \ notproduct(bool, VerifyLastFrame, false, \ "Verify oops on last frame on entry to VM") \ @@ -2337,6 +2331,14 @@ public: diagnostic(bool, VerifyDuringGC, false, \ "Verify memory system during GC (between phases)") \ \ + diagnostic(ccstrlist, VerifySubSet, "", \ + "Memory sub-systems to verify when Verify*GC flag(s) " \ + "are enabled. One or more sub-systems can be specified " \ + "in a comma separated string. Sub-systems are: " \ + "threads, heap, symbol_table, string_table, codecache, " \ + "dictionary, classloader_data_graph, metaspace, jni_handles, " \ + "c-heap, codecache_oops") \ + \ diagnostic(bool, GCParallelVerificationEnabled, true, \ "Enable parallel memory system verification") \ \ @@ -2705,9 +2707,6 @@ public: develop(bool, DebugVtables, false, \ "add debugging code to vtable dispatch") \ \ - develop(bool, PrintVtables, false, \ - "print vtables when printing klass") \ - \ notproduct(bool, PrintVtableStats, false, \ "print vtables stats at end of run") \ \ diff --git a/hotspot/src/share/vm/runtime/interfaceSupport.hpp b/hotspot/src/share/vm/runtime/interfaceSupport.hpp index aa628e3a7fa..47cfcfdfaaa 100644 --- a/hotspot/src/share/vm/runtime/interfaceSupport.hpp +++ b/hotspot/src/share/vm/runtime/interfaceSupport.hpp @@ -451,7 +451,7 @@ class RuntimeHistogramElement : public HistogramElement { #define IRT_LEAF(result_type, header) \ result_type header { \ VM_LEAF_BASE(result_type, header) \ - debug_only(No_Safepoint_Verifier __nspv(true);) + debug_only(NoSafepointVerifier __nspv(true);) #define IRT_ENTRY_NO_ASYNC(result_type, header) \ @@ -475,7 +475,7 @@ class RuntimeHistogramElement : public HistogramElement { #define JRT_LEAF(result_type, header) \ result_type header { \ VM_LEAF_BASE(result_type, header) \ - debug_only(JRT_Leaf_Verifier __jlv;) + debug_only(JRTLeafVerifier __jlv;) #define JRT_ENTRY_NO_ASYNC(result_type, header) \ diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp index aa57bbc4601..9df11977229 100644 --- a/hotspot/src/share/vm/runtime/java.cpp +++ b/hotspot/src/share/vm/runtime/java.cpp @@ -432,8 +432,7 @@ void before_exit(JavaThread* thread) { if (HAS_PENDING_EXCEPTION) { Handle exception(THREAD, PENDING_EXCEPTION); CLEAR_PENDING_EXCEPTION; - ttyLocker ttyl; - java_lang_Throwable::print_stack_trace(exception, tty); + java_lang_Throwable::java_printStackTrace(exception, THREAD); } #endif diff --git a/hotspot/src/share/vm/runtime/javaCalls.cpp b/hotspot/src/share/vm/runtime/javaCalls.cpp index e0a04e6d3bc..bf8aa7cefa7 100644 --- a/hotspot/src/share/vm/runtime/javaCalls.cpp +++ b/hotspot/src/share/vm/runtime/javaCalls.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -385,7 +385,7 @@ void JavaCalls::call_helper(JavaValue* result, const methodHandle& method, JavaC return; } else { // Touch pages checked if the OS needs them to be touched to be mapped. - os::bang_stack_shadow_pages(); + os::map_stack_shadow_pages(); } #if INCLUDE_JVMCI diff --git a/hotspot/src/share/vm/runtime/objectMonitor.cpp b/hotspot/src/share/vm/runtime/objectMonitor.cpp index 93b051b4e58..2f7937d4f3e 100644 --- a/hotspot/src/share/vm/runtime/objectMonitor.cpp +++ b/hotspot/src/share/vm/runtime/objectMonitor.cpp @@ -2470,4 +2470,8 @@ void ObjectMonitor::verify() { void ObjectMonitor::print() { } + +void ObjectMonitor_test() { + ObjectMonitor::sanity_checks(); +} #endif diff --git a/hotspot/src/share/vm/runtime/orderAccess.inline.hpp b/hotspot/src/share/vm/runtime/orderAccess.inline.hpp index eae1b965c00..bc3237351ea 100644 --- a/hotspot/src/share/vm/runtime/orderAccess.inline.hpp +++ b/hotspot/src/share/vm/runtime/orderAccess.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2014 SAP AG. All rights reserved. + * Copyright (c) 2014 SAP SE. 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 diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp index 70888fdf31e..9668104ef5d 100644 --- a/hotspot/src/share/vm/runtime/os.hpp +++ b/hotspot/src/share/vm/runtime/os.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -263,7 +263,7 @@ class os: AllStatic { // pages for stack overflow checking. static bool uses_stack_guard_pages(); static bool allocate_stack_guard_pages(); - static void bang_stack_shadow_pages(); + static void map_stack_shadow_pages(); static bool stack_shadow_pages_available(Thread *thread, const methodHandle& method); // OS interface to Virtual Memory diff --git a/hotspot/src/share/vm/runtime/safepoint.cpp b/hotspot/src/share/vm/runtime/safepoint.cpp index 09f6ea8d1a4..437e3bd4176 100644 --- a/hotspot/src/share/vm/runtime/safepoint.cpp +++ b/hotspot/src/share/vm/runtime/safepoint.cpp @@ -363,7 +363,7 @@ void SafepointSynchronize::begin() { #endif // ASSERT // Update the count of active JNI critical regions - GC_locker::set_jni_lock_count(_current_jni_active_count); + GCLocker::set_jni_lock_count(_current_jni_active_count); if (log_is_enabled(Debug, safepoint)) { VM_Operation *op = VMThread::vm_operation(); @@ -563,7 +563,7 @@ void SafepointSynchronize::check_for_lazy_critical_native(JavaThread *thread, Ja if (!thread->do_critical_native_unlock()) { #ifdef ASSERT if (!thread->in_critical()) { - GC_locker::increment_debug_jni_lock_count(); + GCLocker::increment_debug_jni_lock_count(); } #endif thread->enter_critical(); diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index f2497b54fbb..5b862a01fab 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -726,6 +726,7 @@ address SharedRuntime::compute_compiled_exc_handler(nmethod* nm, address ret_pc, #endif if (t == NULL) { + ttyLocker ttyl; tty->print_cr("MISSING EXCEPTION HANDLER for pc " INTPTR_FORMAT " and handler bci %d", p2i(ret_pc), handler_bci); tty->print_cr(" Exception:"); exception->print(); @@ -2759,7 +2760,7 @@ void AdapterHandlerLibrary::create_native_wrapper(const methodHandle& method) { DirectiveSet* directive = DirectivesStack::getDefaultDirective(CompileBroker::compiler(CompLevel_simple)); if (directive->PrintAssemblyOption) { - Disassembler::decode(nm, tty); + nm->print_code(); } DirectivesStack::release(directive); } @@ -2787,8 +2788,8 @@ JRT_ENTRY_NO_ASYNC(void, SharedRuntime::block_for_jni_critical(JavaThread* threa return; } // Lock and unlock a critical section to give the system a chance to block - GC_locker::lock_critical(thread); - GC_locker::unlock_critical(thread); + GCLocker::lock_critical(thread); + GCLocker::unlock_critical(thread); JRT_END // ------------------------------------------------------------------------- diff --git a/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp b/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp index db3c1cc1089..187d3b1e208 100644 --- a/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp +++ b/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp @@ -168,7 +168,7 @@ void SimpleThresholdPolicy::handle_counter_overflow(Method* method) { // Called with the queue locked and with at least one element CompileTask* SimpleThresholdPolicy::select_task(CompileQueue* compile_queue) { - return compile_queue->first(); + return select_task_helper(compile_queue); } void SimpleThresholdPolicy::reprofile(ScopeDesc* trap_scope, bool is_osr) { diff --git a/hotspot/src/share/vm/runtime/stubRoutines.cpp b/hotspot/src/share/vm/runtime/stubRoutines.cpp index 2682be50945..0f2c5b65e17 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.cpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.cpp @@ -155,6 +155,10 @@ address StubRoutines::_vectorizedMismatch = NULL; address StubRoutines::_dexp = NULL; address StubRoutines::_dlog = NULL; address StubRoutines::_dpow = NULL; +address StubRoutines::_dsin = NULL; +address StubRoutines::_dcos = NULL; +address StubRoutines::_dlibm_sin_cos_huge = NULL; +address StubRoutines::_dlibm_reduce_pi04l = NULL; double (* StubRoutines::_intrinsic_log10 )(double) = NULL; double (* StubRoutines::_intrinsic_sin )(double) = NULL; diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp index a3f905aed11..38fe86e631b 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.hpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp @@ -214,6 +214,10 @@ class StubRoutines: AllStatic { static address _dexp; static address _dlog; static address _dpow; + static address _dsin; + static address _dcos; + static address _dlibm_sin_cos_huge; + static address _dlibm_reduce_pi04l; // These are versions of the java.lang.Math methods which perform // the same operations as the intrinsic version. They are used for @@ -388,6 +392,10 @@ class StubRoutines: AllStatic { static address dexp() { return _dexp; } static address dlog() { return _dlog; } static address dpow() { return _dpow; } + static address dsin() { return _dsin; } + static address dcos() { return _dcos; } + static address dlibm_reduce_pi04l() { return _dlibm_reduce_pi04l; } + static address dlibm_sin_cos_huge() { return _dlibm_sin_cos_huge; } static address select_fill_function(BasicType t, bool aligned, const char* &name); diff --git a/hotspot/src/share/vm/runtime/synchronizer.cpp b/hotspot/src/share/vm/runtime/synchronizer.cpp index f74f78a98ef..971012fbb11 100644 --- a/hotspot/src/share/vm/runtime/synchronizer.cpp +++ b/hotspot/src/share/vm/runtime/synchronizer.cpp @@ -159,7 +159,7 @@ bool ObjectSynchronizer::quick_notify(oopDesc * obj, Thread * self, bool all) { assert(!SafepointSynchronize::is_at_safepoint(), "invariant"); assert(self->is_Java_thread(), "invariant"); assert(((JavaThread *) self)->thread_state() == _thread_in_Java, "invariant"); - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; if (obj == NULL) return false; // slow-path for invalid obj const markOop mark = obj->mark(); @@ -209,7 +209,7 @@ bool ObjectSynchronizer::quick_enter(oop obj, Thread * Self, assert(!SafepointSynchronize::is_at_safepoint(), "invariant"); assert(Self->is_Java_thread(), "invariant"); assert(((JavaThread *) Self)->thread_state() == _thread_in_Java, "invariant"); - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; if (obj == NULL) return false; // Need to throw NPE const markOop mark = obj->mark(); @@ -1734,7 +1734,7 @@ class ReleaseJavaMonitorsClosure: public MonitorClosure { void ObjectSynchronizer::release_monitors_owned_by_thread(TRAPS) { assert(THREAD == JavaThread::current(), "must be current Java thread"); - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; ReleaseJavaMonitorsClosure rjmc(THREAD); Thread::muxAcquire(&gListLock, "release_monitors_owned_by_thread"); ObjectSynchronizer::monitors_iterate(&rjmc); diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index b762e2874a3..70e3ec6c8c4 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -1419,9 +1419,6 @@ void JavaThread::collect_counters(typeArrayOop array) { void JavaThread::initialize() { // Initialize fields - // Set the claimed par_id to UINT_MAX (ie not claiming any par_ids) - set_claimed_par_id(UINT_MAX); - set_saved_exception_pc(NULL); set_threadObj(NULL); _anchor.clear(); @@ -2443,7 +2440,7 @@ void JavaThread::check_special_condition_for_native_trans(JavaThread *thread) { // normal checks but also performs the transition back into // thread_in_Java state. This is required so that critical natives // can potentially block and perform a GC if they are the last thread -// exiting the GC_locker. +// exiting the GCLocker. void JavaThread::check_special_condition_for_native_trans_and_transition(JavaThread *thread) { check_special_condition_for_native_trans(thread); @@ -2452,7 +2449,7 @@ void JavaThread::check_special_condition_for_native_trans_and_transition(JavaThr if (thread->do_critical_native_unlock()) { ThreadInVMfromJavaNoAsyncException tiv(thread); - GC_locker::unlock_critical(thread); + GCLocker::unlock_critical(thread); thread->clear_critical_native_unlock(); } } @@ -3390,13 +3387,16 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { // Check version if (!is_supported_jni_version(args->version)) return JNI_EVERSION; + // Initialize library-based TLS + ThreadLocalStorage::init(); + // Initialize the output stream module ostream_init(); // Process java launcher properties. Arguments::process_sun_java_launcher_properties(args); - // Initialize the os module before using TLS + // Initialize the os module os::init(); // Record VM creation timing statistics @@ -3451,9 +3451,6 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { jint adjust_after_os_result = Arguments::adjust_after_os(); if (adjust_after_os_result != JNI_OK) return adjust_after_os_result; - // Initialize library-based TLS - ThreadLocalStorage::init(); - // Initialize output stream logging ostream_init_log(); diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp index 804fbbd0a50..79d7c04568f 100644 --- a/hotspot/src/share/vm/runtime/thread.hpp +++ b/hotspot/src/share/vm/runtime/thread.hpp @@ -256,7 +256,7 @@ class Thread: public ThreadShadow { // If !allow_allocation(), then an assertion failure will happen during allocation // (Hence, !allow_safepoint() => !allow_allocation()). // - // The two classes No_Safepoint_Verifier and No_Allocation_Verifier are used to set these counters. + // The two classes NoSafepointVerifier and No_Allocation_Verifier are used to set these counters. // NOT_PRODUCT(int _allow_safepoint_count;) // If 0, thread allow a safepoint to happen debug_only(int _allow_allocation_count;) // If 0, the thread is allowed to allocate oops. @@ -264,10 +264,10 @@ class Thread: public ThreadShadow { // Used by SkipGCALot class. NOT_PRODUCT(bool _skip_gcalot;) // Should we elide gc-a-lot? - friend class No_Alloc_Verifier; - friend class No_Safepoint_Verifier; - friend class Pause_No_Safepoint_Verifier; - friend class GC_locker; + friend class NoAllocVerifier; + friend class NoSafepointVerifier; + friend class PauseNoSafepointVerifier; + friend class GCLocker; ThreadLocalAllocBuffer _tlab; // Thread-local eden jlong _allocated_bytes; // Cumulative number of bytes allocated on @@ -1966,14 +1966,6 @@ class JavaThread: public Thread { bool is_attaching_via_jni() const { return _jni_attach_state == _attaching_via_jni; } bool has_attached_via_jni() const { return is_attaching_via_jni() || _jni_attach_state == _attached_via_jni; } inline void set_done_attaching_via_jni(); - private: - // This field is used to determine if a thread has claimed - // a par_id: it is UINT_MAX if the thread has not claimed a par_id; - // otherwise its value is the par_id that has been claimed. - uint _claimed_par_id; - public: - uint get_claimed_par_id() { return _claimed_par_id; } - void set_claimed_par_id(uint id) { _claimed_par_id = id; } }; // Inline implementation of JavaThread::current diff --git a/hotspot/src/share/vm/runtime/vframe.hpp b/hotspot/src/share/vm/runtime/vframe.hpp index 654d6b823b1..dde2f246812 100644 --- a/hotspot/src/share/vm/runtime/vframe.hpp +++ b/hotspot/src/share/vm/runtime/vframe.hpp @@ -406,6 +406,7 @@ inline void vframeStreamCommon::fill_from_compiled_frame(int decode_offset) { // as it were a native compiled frame (no Java-level assumptions). #ifdef ASSERT if (WizardMode) { + ttyLocker ttyl; tty->print_cr("Error in fill_from_frame: pc_desc for " INTPTR_FORMAT " not found or invalid at %d", p2i(_frame.pc()), decode_offset); diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index e20dbbbb00a..b3db7ef26da 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, 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 @@ -503,7 +503,7 @@ typedef CompactHashtable SymbolCompactHashTable; /* Generation and Space hierarchies */ \ /**********************************************************************************/ \ \ - unchecked_nonstatic_field(ageTable, sizes, sizeof(ageTable::sizes)) \ + unchecked_nonstatic_field(AgeTable, sizes, sizeof(AgeTable::sizes)) \ \ nonstatic_field(BarrierSet, _fake_rtti, BarrierSet::FakeRtti) \ \ @@ -560,7 +560,7 @@ typedef CompactHashtable SymbolCompactHashTable; \ nonstatic_field(DefNewGeneration, _old_gen, Generation*) \ nonstatic_field(DefNewGeneration, _tenuring_threshold, uint) \ - nonstatic_field(DefNewGeneration, _age_table, ageTable) \ + nonstatic_field(DefNewGeneration, _age_table, AgeTable) \ nonstatic_field(DefNewGeneration, _eden_space, ContiguousSpace*) \ nonstatic_field(DefNewGeneration, _from_space, ContiguousSpace*) \ nonstatic_field(DefNewGeneration, _to_space, ContiguousSpace*) \ @@ -706,7 +706,6 @@ typedef CompactHashtable SymbolCompactHashTable; static_field(SystemDictionary, WK_KLASS(WeakReference_klass), InstanceKlass*) \ static_field(SystemDictionary, WK_KLASS(FinalReference_klass), InstanceKlass*) \ static_field(SystemDictionary, WK_KLASS(PhantomReference_klass), InstanceKlass*) \ - static_field(SystemDictionary, WK_KLASS(Cleaner_klass), InstanceKlass*) \ static_field(SystemDictionary, WK_KLASS(Finalizer_klass), InstanceKlass*) \ static_field(SystemDictionary, WK_KLASS(Thread_klass), InstanceKlass*) \ static_field(SystemDictionary, WK_KLASS(ThreadGroup_klass), InstanceKlass*) \ @@ -862,6 +861,8 @@ typedef CompactHashtable SymbolCompactHashTable; static_field(StubRoutines, _dexp, address) \ static_field(StubRoutines, _dlog, address) \ static_field(StubRoutines, _dpow, address) \ + static_field(StubRoutines, _dsin, address) \ + static_field(StubRoutines, _dcos, address) \ static_field(StubRoutines, _vectorizedMismatch, address) \ static_field(StubRoutines, _jbyte_arraycopy, address) \ static_field(StubRoutines, _jshort_arraycopy, address) \ @@ -1606,7 +1607,7 @@ typedef CompactHashtable SymbolCompactHashTable; \ /* Miscellaneous other GC types */ \ \ - declare_toplevel_type(ageTable) \ + declare_toplevel_type(AgeTable) \ declare_toplevel_type(Generation::StatRecord) \ declare_toplevel_type(GenerationSpec) \ declare_toplevel_type(HeapWord) \ @@ -2056,8 +2057,6 @@ typedef CompactHashtable SymbolCompactHashTable; declare_c2_type(NegNode, Node) \ declare_c2_type(NegFNode, NegNode) \ declare_c2_type(NegDNode, NegNode) \ - declare_c2_type(CosDNode, Node) \ - declare_c2_type(SinDNode, Node) \ declare_c2_type(TanDNode, Node) \ declare_c2_type(AtanDNode, Node) \ declare_c2_type(SqrtDNode, Node) \ @@ -2315,7 +2314,7 @@ typedef CompactHashtable SymbolCompactHashTable; /* Generation and Space Hierarchy Constants */ \ /********************************************/ \ \ - declare_constant(ageTable::table_size) \ + declare_constant(AgeTable::table_size) \ \ declare_constant(BarrierSet::ModRef) \ declare_constant(BarrierSet::CardTableModRef) \ @@ -2324,12 +2323,13 @@ typedef CompactHashtable SymbolCompactHashTable; declare_constant(BarrierSet::G1SATBCT) \ declare_constant(BarrierSet::G1SATBCTLogging) \ \ - declare_constant(BlockOffsetSharedArray::LogN) \ - declare_constant(BlockOffsetSharedArray::LogN_words) \ - declare_constant(BlockOffsetSharedArray::N_bytes) \ - declare_constant(BlockOffsetSharedArray::N_words) \ - \ - declare_constant(BlockOffsetArray::N_words) \ + declare_constant(BOTConstants::LogN) \ + declare_constant(BOTConstants::LogN_words) \ + declare_constant(BOTConstants::N_bytes) \ + declare_constant(BOTConstants::N_words) \ + declare_constant(BOTConstants::LogBase) \ + declare_constant(BOTConstants::Base) \ + declare_constant(BOTConstants::N_powers) \ \ declare_constant(CardTableModRefBS::clean_card) \ declare_constant(CardTableModRefBS::last_card) \ @@ -2397,7 +2397,7 @@ typedef CompactHashtable SymbolCompactHashTable; declare_constant(JVM_ACC_HAS_MIRANDA_METHODS) \ declare_constant(JVM_ACC_HAS_VANILLA_CONSTRUCTOR) \ declare_constant(JVM_ACC_HAS_FINALIZER) \ - declare_constant(JVM_ACC_IS_CLONEABLE) \ + declare_constant(JVM_ACC_IS_CLONEABLE_FAST) \ declare_constant(JVM_ACC_HAS_LOCAL_VARIABLE_TABLE) \ declare_constant(JVM_ACC_PROMOTED_FLAGS) \ declare_constant(JVM_ACC_FIELD_ACCESS_WATCHED) \ @@ -3496,4 +3496,8 @@ void VMStructs::test() { } } } + +void VMStructs_test() { + VMStructs::test(); +} #endif diff --git a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp index e36fce25870..cf2bf5a4644 100644 --- a/hotspot/src/share/vm/runtime/vm_version.cpp +++ b/hotspot/src/share/vm/runtime/vm_version.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, 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 @@ -215,6 +215,8 @@ const char* Abstract_VM_Version::internal_vm_info_string() { #define HOTSPOT_BUILD_COMPILER "Sun Studio 12u1" #elif __SUNPRO_CC == 0x5120 #define HOTSPOT_BUILD_COMPILER "Sun Studio 12u3" + #elif __SUNPRO_CC == 0x5130 + #define HOTSPOT_BUILD_COMPILER "Sun Studio 12u4" #else #define HOTSPOT_BUILD_COMPILER "unknown Workshop:" XSTR(__SUNPRO_CC) #endif @@ -238,9 +240,14 @@ const char* Abstract_VM_Version::internal_vm_info_string() { #define FLOAT_ARCH_STR XSTR(FLOAT_ARCH) #endif - return VMNAME " (" VM_RELEASE ") for " OS "-" CPU FLOAT_ARCH_STR - " JRE (" VERSION_STRING "), built on " __DATE__ " " __TIME__ - " by " XSTR(HOTSPOT_BUILD_USER) " with " HOTSPOT_BUILD_COMPILER; + #define INTERNAL_VERSION_SUFFIX VM_RELEASE ")" \ + " for " OS "-" CPU FLOAT_ARCH_STR \ + " JRE (" VERSION_STRING "), built on " __DATE__ " " __TIME__ \ + " by " XSTR(HOTSPOT_BUILD_USER) " with " HOTSPOT_BUILD_COMPILER + + return strcmp(DEBUG_LEVEL, "release") == 0 + ? VMNAME " (" INTERNAL_VERSION_SUFFIX + : VMNAME " (" DEBUG_LEVEL " " INTERNAL_VERSION_SUFFIX; } const char *Abstract_VM_Version::vm_build_user() { @@ -251,6 +258,11 @@ const char *Abstract_VM_Version::jdk_debug_level() { return DEBUG_LEVEL; } +const char *Abstract_VM_Version::printable_jdk_debug_level() { + // Debug level is not printed for "release" builds + return strcmp(DEBUG_LEVEL, "release") == 0 ? "" : DEBUG_LEVEL " "; +} + unsigned int Abstract_VM_Version::jvm_version() { return ((Abstract_VM_Version::vm_major_version() & 0xFF) << 24) | ((Abstract_VM_Version::vm_minor_version() & 0xFF) << 16) | diff --git a/hotspot/src/share/vm/runtime/vm_version.hpp b/hotspot/src/share/vm/runtime/vm_version.hpp index ee4b4ec0d64..5d07fc703b7 100644 --- a/hotspot/src/share/vm/runtime/vm_version.hpp +++ b/hotspot/src/share/vm/runtime/vm_version.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -106,6 +106,7 @@ class Abstract_VM_Version: AllStatic { static const char* internal_vm_info_string(); static const char* jre_release_version(); static const char* jdk_debug_level(); + static const char* printable_jdk_debug_level(); static uint64_t features() { return _features; diff --git a/hotspot/src/share/vm/services/gcNotifier.cpp b/hotspot/src/share/vm/services/gcNotifier.cpp index 5a90b7be4f9..0336428e2b4 100644 --- a/hotspot/src/share/vm/services/gcNotifier.cpp +++ b/hotspot/src/share/vm/services/gcNotifier.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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 @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/java.hpp" diff --git a/hotspot/src/share/vm/services/heapDumper.cpp b/hotspot/src/share/vm/services/heapDumper.cpp index 96ea8d7a744..2f01fab4cc9 100644 --- a/hotspot/src/share/vm/services/heapDumper.cpp +++ b/hotspot/src/share/vm/services/heapDumper.cpp @@ -379,11 +379,11 @@ class DumpWriter : public StackObj { }; int _fd; // file descriptor (-1 if dump file not open) - jlong _bytes_written; // number of byte written to dump file + julong _bytes_written; // number of byte written to dump file char* _buffer; // internal buffer - int _size; - int _pos; + size_t _size; + size_t _pos; char* _error; // error message when I/O fails @@ -391,14 +391,14 @@ class DumpWriter : public StackObj { int file_descriptor() const { return _fd; } char* buffer() const { return _buffer; } - int buffer_size() const { return _size; } - int position() const { return _pos; } - void set_position(int pos) { _pos = pos; } + size_t buffer_size() const { return _size; } + size_t position() const { return _pos; } + void set_position(size_t pos) { _pos = pos; } void set_error(const char* error) { _error = (char*)os::strdup(error); } // all I/O go through this function - void write_internal(void* s, int len); + void write_internal(void* s, size_t len); public: DumpWriter(const char* path); @@ -409,14 +409,14 @@ class DumpWriter : public StackObj { void flush(); // total number of bytes written to the disk - jlong bytes_written() const { return _bytes_written; } + julong bytes_written() const { return _bytes_written; } // adjust the number of bytes written to disk (used to keep the count // of the number of bytes written in case of rewrites) - void adjust_bytes_written(jlong n) { _bytes_written += n; } + void adjust_bytes_written(jlong n) { _bytes_written += n; } // number of (buffered) bytes as yet unwritten to the dump file - jlong bytes_unwritten() const { return (jlong)position(); } + size_t bytes_unwritten() const { return position(); } char* error() const { return _error; } @@ -424,7 +424,7 @@ class DumpWriter : public StackObj { void seek_to_offset(jlong pos); // writer functions - void write_raw(void* s, int len); + void write_raw(void* s, size_t len); void write_u1(u1 x) { write_raw((void*)&x, 1); } void write_u2(u2 x); void write_u4(u4 x); @@ -471,35 +471,40 @@ void DumpWriter::close() { // flush and close dump file if (is_open()) { flush(); - ::close(file_descriptor()); + os::close(file_descriptor()); set_file_descriptor(-1); } } // write directly to the file -void DumpWriter::write_internal(void* s, int len) { +void DumpWriter::write_internal(void* s, size_t len) { if (is_open()) { - int n = ::write(file_descriptor(), s, len); - if (n > 0) { - _bytes_written += n; - } - if (n != len) { + const char* pos = (char*)s; + ssize_t n = 0; + while (len > 0) { + uint tmp = (uint)MIN2(len, (size_t)UINT_MAX); + n = os::write(file_descriptor(), pos, tmp); + if (n < 0) { + // EINTR cannot happen here, os::write will take care of that set_error(strerror(errno)); - } else { - set_error("file size limit"); + os::close(file_descriptor()); + set_file_descriptor(-1); + return; } - ::close(file_descriptor()); - set_file_descriptor(-1); + + _bytes_written += n; + pos += n; + len -= n; } } } // write raw bytes -void DumpWriter::write_raw(void* s, int len) { +void DumpWriter::write_raw(void* s, size_t len) { if (is_open()) { - // flush buffer to make toom - if ((position()+ len) >= buffer_size()) { + // flush buffer to make room + if ((position() + len) >= buffer_size()) { flush(); } @@ -522,13 +527,12 @@ void DumpWriter::flush() { } } - jlong DumpWriter::current_offset() { if (is_open()) { // the offset is the file offset plus whatever we have buffered jlong offset = os::current_file_offset(file_descriptor()); assert(offset >= 0, "lseek failed"); - return offset + (jlong)position(); + return offset + position(); } else { return (jlong)-1; } @@ -777,7 +781,7 @@ u4 DumperSupport::instance_size(Klass* k) { HandleMark hm; instanceKlassHandle ikh = instanceKlassHandle(Thread::current(), k); - int size = 0; + u4 size = 0; for (FieldStream fld(ikh, false, false); !fld.eos(); fld.next()) { if (!fld.access_flags().is_static()) { @@ -802,7 +806,7 @@ u4 DumperSupport::instance_size(Klass* k) { } } } - return (u4)size; + return size; } // dumps static fields of the given class @@ -1039,8 +1043,7 @@ void DumperSupport::dump_prim_array(DumpWriter* writer, typeArrayOop array) { } // If the byte ordering is big endian then we can copy most types directly - int length_in_bytes = array->length() * type2aelembytes(type); - assert(length_in_bytes > 0, "nothing to copy"); + u4 length_in_bytes = (u4)array->length() * type2aelembytes(type); switch (type) { case T_INT : { @@ -1293,22 +1296,18 @@ void HeapObjectDumper::do_object(oop o) { } } - // create a HPROF_GC_INSTANCE record for each object if (o->is_instance()) { + // create a HPROF_GC_INSTANCE record for each object DumperSupport::dump_instance(writer(), o); mark_end_of_record(); - } else { + } else if (o->is_objArray()) { // create a HPROF_GC_OBJ_ARRAY_DUMP record for each object array - if (o->is_objArray()) { - DumperSupport::dump_object_array(writer(), objArrayOop(o)); - mark_end_of_record(); - } else { - // create a HPROF_GC_PRIM_ARRAY_DUMP record for each type array - if (o->is_typeArray()) { - DumperSupport::dump_prim_array(writer(), typeArrayOop(o)); - mark_end_of_record(); - } - } + DumperSupport::dump_object_array(writer(), objArrayOop(o)); + mark_end_of_record(); + } else if (o->is_typeArray()) { + // create a HPROF_GC_PRIM_ARRAY_DUMP record for each type array + DumperSupport::dump_prim_array(writer(), typeArrayOop(o)); + mark_end_of_record(); } } @@ -1456,11 +1455,11 @@ void VM_HeapDumper::write_current_dump_record_length() { assert(dump_start() >= 0, "no dump start recorded"); // calculate the size of the dump record - jlong dump_end = writer()->current_offset(); - jlong dump_len = (dump_end - dump_start() - 4); + julong dump_end = writer()->current_offset(); + julong dump_len = (dump_end - dump_start() - 4); // record length must fit in a u4 - if (dump_len > (jlong)(4L*(jlong)G)) { + if (dump_len > max_juint) { warning("record is too large"); } @@ -1469,7 +1468,7 @@ void VM_HeapDumper::write_current_dump_record_length() { writer()->write_u4((u4)dump_len); // adjust the total size written to keep the bytes written correct. - writer()->adjust_bytes_written(-((long) sizeof(u4))); + writer()->adjust_bytes_written(-((jlong) sizeof(u4))); // seek to dump end so we can continue writer()->seek_to_offset(dump_end); @@ -1485,12 +1484,12 @@ void VM_HeapDumper::check_segment_length() { if (writer()->is_open()) { if (is_segmented_dump()) { // don't use current_offset that would be too expensive on a per record basis - jlong dump_end = writer()->bytes_written() + writer()->bytes_unwritten(); - assert(dump_end == writer()->current_offset(), "checking"); - jlong dump_len = (dump_end - dump_start() - 4); - assert(dump_len >= 0 && dump_len <= max_juint, "bad dump length"); + julong dump_end = writer()->bytes_written() + writer()->bytes_unwritten(); + assert(dump_end == (julong)writer()->current_offset(), "checking"); + julong dump_len = (dump_end - dump_start() - 4); + assert(dump_len <= max_juint, "bad dump length"); - if (dump_len > (jlong)HeapDumpSegmentSize) { + if (dump_len > HeapDumpSegmentSize) { write_current_dump_record_length(); write_dump_header(); } @@ -1708,10 +1707,10 @@ void VM_HeapDumper::doit() { CollectedHeap* ch = Universe::heap(); ch->ensure_parsability(false); // must happen, even if collection does - // not happen (e.g. due to GC_locker) + // not happen (e.g. due to GCLocker) if (_gc_before_heap_dump) { - if (GC_locker::is_active()) { + if (GCLocker::is_active()) { warning("GC locker is held; pre-heapdump GC was skipped"); } else { ch->collect_as_vm_thread(GCCause::_heap_dump); @@ -1887,7 +1886,7 @@ int HeapDumper::dump(const char* path) { if (print_to_tty()) { timer()->stop(); if (error() == NULL) { - tty->print_cr("Heap dump file created [" JLONG_FORMAT " bytes in %3.3f secs]", + tty->print_cr("Heap dump file created [" JULONG_FORMAT " bytes in %3.3f secs]", writer.bytes_written(), timer()->seconds()); } else { tty->print_cr("Dump file is incomplete: %s", writer.error()); diff --git a/hotspot/src/share/vm/services/memoryService.cpp b/hotspot/src/share/vm/services/memoryService.cpp index 11a4d569057..d2666a2f08b 100644 --- a/hotspot/src/share/vm/services/memoryService.cpp +++ b/hotspot/src/share/vm/services/memoryService.cpp @@ -519,9 +519,9 @@ bool MemoryService::set_verbose(bool verbose) { MutexLocker m(Management_lock); // verbose will be set to the previous value if (verbose) { - LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL); + LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(gc)); } else { - LogConfiguration::parse_log_arguments("stdout", "gc=off", NULL, NULL, NULL); + LogConfiguration::configure_stdout(LogLevel::Off, true, LOG_TAGS(gc)); } ClassLoadingService::reset_trace_class_unloading(); diff --git a/hotspot/src/share/vm/services/serviceUtil.hpp b/hotspot/src/share/vm/services/serviceUtil.hpp index fca509770c2..14276bb7da0 100644 --- a/hotspot/src/share/vm/services/serviceUtil.hpp +++ b/hotspot/src/share/vm/services/serviceUtil.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ #include "classfile/systemDictionary.hpp" #include "oops/objArrayOop.hpp" +#include "oops/oop.inline.hpp" // // Serviceability utility functions. diff --git a/hotspot/src/share/vm/services/threadService.cpp b/hotspot/src/share/vm/services/threadService.cpp index d0598e46195..7d49726d1ac 100644 --- a/hotspot/src/share/vm/services/threadService.cpp +++ b/hotspot/src/share/vm/services/threadService.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ #include "memory/heapInspection.hpp" #include "memory/oopFactory.hpp" #include "oops/instanceKlass.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/handles.inline.hpp" diff --git a/hotspot/src/share/vm/services/virtualMemoryTracker.cpp b/hotspot/src/share/vm/services/virtualMemoryTracker.cpp index 56fe27a1029..16f249b82e9 100644 --- a/hotspot/src/share/vm/services/virtualMemoryTracker.cpp +++ b/hotspot/src/share/vm/services/virtualMemoryTracker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, 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 @@ -416,6 +416,14 @@ bool VirtualMemoryTracker::remove_released_region(address addr, size_t size) { return false; } + if (reserved_rgn->flag() == mtClassShared && + reserved_rgn->contain_region(addr, size) && + !reserved_rgn->same_region(addr, size)) { + // This is an unmapped CDS region, which is part of the reserved shared + // memory region. + // See special handling in VirtualMemoryTracker::add_reserved_region also. + return true; + } VirtualMemorySummary::record_released_memory(size, reserved_rgn->flag()); diff --git a/hotspot/src/share/vm/trace/traceEventClasses.xsl b/hotspot/src/share/vm/trace/traceEventClasses.xsl index fe097e0b370..f7c90ad758f 100644 --- a/hotspot/src/share/vm/trace/traceEventClasses.xsl +++ b/hotspot/src/share/vm/trace/traceEventClasses.xsl @@ -36,7 +36,6 @@ // Some parts of traceEvent.hpp are used outside of // INCLUDE_TRACE -#include "memory/resourceArea.hpp" #include "tracefiles/traceTypes.hpp" #include "trace/traceEvent.hpp" #include "utilities/macros.hpp" @@ -136,7 +135,6 @@ public: void writeEvent(void) { - ResourceMark rm; if (UseLockedTracing) { ttyLocker lock; writeEventContent(); diff --git a/hotspot/src/share/vm/trace/traceStream.hpp b/hotspot/src/share/vm/trace/traceStream.hpp index e2c982a2cd6..405e462522e 100644 --- a/hotspot/src/share/vm/trace/traceStream.hpp +++ b/hotspot/src/share/vm/trace/traceStream.hpp @@ -27,6 +27,7 @@ #include "utilities/macros.hpp" #if INCLUDE_TRACE +#include "memory/resourceArea.hpp" #include "oops/klass.hpp" #include "oops/method.hpp" #include "oops/symbol.hpp" @@ -79,11 +80,8 @@ class TraceStream : public StackObj { _st.print("%s = %f", label, val); } - // Caller is machine generated code located in traceEventClasses.hpp - // Event::writeEvent() (pseudocode) contains the - // necessary ResourceMark for the resource allocations below. - // See traceEventClasses.xsl for details. void print_val(const char* label, const Klass* const val) { + ResourceMark rm; const char* description = "NULL"; if (val != NULL) { Symbol* name = val->name(); @@ -94,11 +92,8 @@ class TraceStream : public StackObj { _st.print("%s = %s", label, description); } - // Caller is machine generated code located in traceEventClasses.hpp - // Event::writeEvent() (pseudocode) contains the - // necessary ResourceMark for the resource allocations below. - // See traceEventClasses.xsl for details. void print_val(const char* label, const Method* const val) { + ResourceMark rm; const char* description = "NULL"; if (val != NULL) { description = val->name_and_sig_as_C_string(); diff --git a/hotspot/src/share/vm/utilities/accessFlags.hpp b/hotspot/src/share/vm/utilities/accessFlags.hpp index 2cab120a880..8e9219fe8bc 100644 --- a/hotspot/src/share/vm/utilities/accessFlags.hpp +++ b/hotspot/src/share/vm/utilities/accessFlags.hpp @@ -61,7 +61,7 @@ enum { JVM_ACC_HAS_MIRANDA_METHODS = 0x10000000, // True if this class has miranda methods in it's vtable JVM_ACC_HAS_VANILLA_CONSTRUCTOR = 0x20000000, // True if klass has a vanilla default constructor JVM_ACC_HAS_FINALIZER = 0x40000000, // True if klass has a non-empty finalize() method - JVM_ACC_IS_CLONEABLE = (int)0x80000000,// True if klass supports the Clonable interface + JVM_ACC_IS_CLONEABLE_FAST = (int)0x80000000,// True if klass implements the Cloneable interface and can be optimized in generated code JVM_ACC_HAS_FINAL_METHOD = 0x01000000, // True if klass has final method // Klass* and Method* flags @@ -143,7 +143,7 @@ class AccessFlags VALUE_OBJ_CLASS_SPEC { bool has_vanilla_constructor () const { return (_flags & JVM_ACC_HAS_VANILLA_CONSTRUCTOR) != 0; } bool has_finalizer () const { return (_flags & JVM_ACC_HAS_FINALIZER ) != 0; } bool has_final_method () const { return (_flags & JVM_ACC_HAS_FINAL_METHOD ) != 0; } - bool is_cloneable () const { return (_flags & JVM_ACC_IS_CLONEABLE ) != 0; } + bool is_cloneable_fast () const { return (_flags & JVM_ACC_IS_CLONEABLE_FAST ) != 0; } // Klass* and Method* flags bool has_localvariable_table () const { return (_flags & JVM_ACC_HAS_LOCAL_VARIABLE_TABLE) != 0; } void set_has_localvariable_table() { atomic_set_bits(JVM_ACC_HAS_LOCAL_VARIABLE_TABLE); } @@ -210,7 +210,7 @@ class AccessFlags VALUE_OBJ_CLASS_SPEC { void set_has_vanilla_constructor() { atomic_set_bits(JVM_ACC_HAS_VANILLA_CONSTRUCTOR); } void set_has_finalizer() { atomic_set_bits(JVM_ACC_HAS_FINALIZER); } void set_has_final_method() { atomic_set_bits(JVM_ACC_HAS_FINAL_METHOD); } - void set_is_cloneable() { atomic_set_bits(JVM_ACC_IS_CLONEABLE); } + void set_is_cloneable_fast() { atomic_set_bits(JVM_ACC_IS_CLONEABLE_FAST); } void set_has_miranda_methods() { atomic_set_bits(JVM_ACC_HAS_MIRANDA_METHODS); } public: diff --git a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp index 29ccf223721..fa9a27dacc4 100644 --- a/hotspot/src/share/vm/utilities/debug.cpp +++ b/hotspot/src/share/vm/utilities/debug.cpp @@ -480,12 +480,13 @@ extern "C" void nm(intptr_t p) { extern "C" void disnm(intptr_t p) { Command c("disnm"); CodeBlob* cb = CodeCache::find_blob((address) p); - nmethod* nm = cb->as_nmethod_or_null(); - if (nm) { - nm->print(); - Disassembler::decode(nm); - } else { - cb->print(); + if (cb != NULL) { + nmethod* nm = cb->as_nmethod_or_null(); + if (nm != NULL) { + nm->print(); + } else { + cb->print(); + } Disassembler::decode(cb); } } diff --git a/hotspot/src/share/vm/utilities/elfFuncDescTable.cpp b/hotspot/src/share/vm/utilities/elfFuncDescTable.cpp index c5a00606d55..abd80bed137 100644 --- a/hotspot/src/share/vm/utilities/elfFuncDescTable.cpp +++ b/hotspot/src/share/vm/utilities/elfFuncDescTable.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/share/vm/utilities/elfFuncDescTable.hpp b/hotspot/src/share/vm/utilities/elfFuncDescTable.hpp index 0b767a2c7b4..4ba4b0b0cb5 100644 --- a/hotspot/src/share/vm/utilities/elfFuncDescTable.hpp +++ b/hotspot/src/share/vm/utilities/elfFuncDescTable.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/share/vm/utilities/exceptions.cpp b/hotspot/src/share/vm/utilities/exceptions.cpp index d0847c4c021..71b3e95a11a 100644 --- a/hotspot/src/share/vm/utilities/exceptions.cpp +++ b/hotspot/src/share/vm/utilities/exceptions.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, 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 @@ -502,3 +502,18 @@ void Exceptions::debug_check_abort_helper(Handle exception, const char* message) } debug_check_abort(exception()->klass()->external_name(), message); } + +// for logging exceptions +void Exceptions::log_exception(Handle exception, stringStream tempst) { + ResourceMark rm; + Symbol* message = java_lang_Throwable::detail_message(exception()); + if (message != NULL) { + log_info(exceptions)("Exception <%s: %s> (" INTPTR_FORMAT ")\n thrown in %s", + exception->print_value_string(), + message->as_C_string(), p2i(exception()), tempst.as_string()); + } else { + log_info(exceptions)("Exception <%s> (" INTPTR_FORMAT ")\n thrown in %s", + exception->print_value_string(), + p2i(exception()), tempst.as_string()); + } +} diff --git a/hotspot/src/share/vm/utilities/exceptions.hpp b/hotspot/src/share/vm/utilities/exceptions.hpp index 5983f5e32f9..cdfa0bdf817 100644 --- a/hotspot/src/share/vm/utilities/exceptions.hpp +++ b/hotspot/src/share/vm/utilities/exceptions.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ #include "memory/allocation.hpp" #include "oops/oopsHierarchy.hpp" +#include "utilities/ostream.hpp" #include "utilities/sizes.hpp" // This file provides the basic support for exception handling in the VM. @@ -178,6 +179,9 @@ class Exceptions { static void debug_check_abort(Handle exception, const char* message = NULL); static void debug_check_abort_helper(Handle exception, const char* message = NULL); static void debug_check_abort(const char *value_string, const char* message = NULL); + + // for logging exceptions + static void log_exception(Handle exception, stringStream tempst); }; diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.cpp b/hotspot/src/share/vm/utilities/globalDefinitions.cpp index 8f8f3865c5a..1491be7091e 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.cpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.cpp @@ -357,6 +357,11 @@ size_t lcm(size_t a, size_t b) { } #ifndef PRODUCT +// For unit testing only +class GlobalDefinitions { +public: + static void test_globals(); +}; void GlobalDefinitions::test_globals() { intptr_t page_sizes[] = { os::vm_page_size(), 4096, 8192, 65536, 2*1024*1024 }; @@ -384,4 +389,8 @@ void GlobalDefinitions::test_globals() { } } +void GlobalDefinitions_test() { + GlobalDefinitions::test_globals(); +} + #endif // PRODUCT diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp index 53431e8a6b3..d5c2f20cfad 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -1452,14 +1452,4 @@ static inline void* dereference_vptr(const void* addr) { return *(void**)addr; } -#ifndef PRODUCT - -// For unit testing only -class GlobalDefinitions { -public: - static void test_globals(); -}; - -#endif // PRODUCT - #endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP diff --git a/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp b/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp index afeafa384ee..bdcc095ba94 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, 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 @@ -212,16 +212,8 @@ extern "C" { #define DEBUG_EXCEPTION ::abort(); -#ifdef ARM32 -#ifdef SOLARIS -#define BREAKPOINT __asm__ volatile (".long 0xe1200070") -#else -#define BREAKPOINT __asm__ volatile (".long 0xe7f001f0") -#endif -#else extern "C" void breakpoint(); #define BREAKPOINT ::breakpoint() -#endif // checking for nanness #ifdef SOLARIS diff --git a/hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp b/hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp index 93f2eaaac98..1892e1a5cb3 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2012, 2013 SAP SE. 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 diff --git a/hotspot/src/share/vm/utilities/hashtable.cpp b/hotspot/src/share/vm/utilities/hashtable.cpp index b62c52b5e54..10f4456274a 100644 --- a/hotspot/src/share/vm/utilities/hashtable.cpp +++ b/hotspot/src/share/vm/utilities/hashtable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, 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 @@ -24,7 +24,7 @@ #include "precompiled.hpp" #include "classfile/altHashing.hpp" -#include "classfile/javaClasses.hpp" +#include "classfile/javaClasses.inline.hpp" #include "classfile/stringTable.hpp" #include "memory/allocation.inline.hpp" #include "memory/filemap.hpp" diff --git a/hotspot/src/share/vm/utilities/internalVMTests.cpp b/hotspot/src/share/vm/utilities/internalVMTests.cpp new file mode 100644 index 00000000000..9b7395e3514 --- /dev/null +++ b/hotspot/src/share/vm/utilities/internalVMTests.cpp @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" + +#ifndef PRODUCT + +#include "utilities/internalVMTests.hpp" +#include "utilities/macros.hpp" +#include "utilities/ostream.hpp" + +#define run_unit_test(unit_test_function_call) \ + tty->print_cr("Running test: " #unit_test_function_call); \ + unit_test_function_call + +// Forward declaration +void TestDependencyContext_test(); +void test_semaphore(); +void TestOS_test(); +void TestReservedSpace_test(); +void TestReserveMemorySpecial_test(); +void TestVirtualSpace_test(); +void TestMetaspaceAux_test(); +void TestMetachunk_test(); +void TestVirtualSpaceNode_test(); +void TestNewSize_test(); +void TestOldSize_test(); +void TestKlass_test(); +void TestBitMap_test(); +void TestAsUtf8(); +void Test_linked_list(); +void TestResourcehash_test(); +void TestChunkedList_test(); +void Test_log_length(); +void Test_TempNewSymbol(); +void GlobalDefinitions_test(); +void GCTimer_test(); +void arrayOopDesc_test(); +void CollectedHeap_test(); +void QuickSort_test(); +void GuardedMemory_test(); +void AltHashing_test(); +void ObjectMonitor_test(); +void JSON_test(); +void DirectivesParser_test(); + +#if INCLUDE_VM_STRUCTS +void VMStructs_test(); +#endif + +#if INCLUDE_ALL_GCS +void TestOldFreeSpaceCalculation_test(); +void TestG1BiasedArray_test(); +void TestBufferingOopClosure_test(); +void TestCodeCacheRemSet_test(); +void FreeRegionList_test(); +void IHOP_test(); +void test_memset_with_concurrent_readers(); +void TestPredictions_test(); +void WorkerDataArray_test(); +#endif + +void InternalVMTests::run() { + tty->print_cr("Running internal VM tests"); + run_unit_test(TestDependencyContext_test()); + run_unit_test(test_semaphore()); + run_unit_test(TestOS_test()); + run_unit_test(TestReservedSpace_test()); + run_unit_test(TestReserveMemorySpecial_test()); + run_unit_test(TestVirtualSpace_test()); + run_unit_test(TestMetaspaceAux_test()); + run_unit_test(TestMetachunk_test()); + run_unit_test(TestVirtualSpaceNode_test()); + run_unit_test(GlobalDefinitions_test()); + run_unit_test(GCTimer_test()); + run_unit_test(arrayOopDesc_test()); + run_unit_test(CollectedHeap_test()); + run_unit_test(QuickSort_test()); + run_unit_test(GuardedMemory_test()); + run_unit_test(AltHashing_test()); + run_unit_test(TestNewSize_test()); + run_unit_test(TestOldSize_test()); + run_unit_test(TestKlass_test()); + run_unit_test(TestBitMap_test()); + run_unit_test(TestAsUtf8()); + run_unit_test(TestResourcehash_test()); + run_unit_test(ObjectMonitor_test()); + run_unit_test(Test_linked_list()); + run_unit_test(TestChunkedList_test()); + run_unit_test(JSON_test()); + run_unit_test(Test_log_length()); + run_unit_test(DirectivesParser_test()); + run_unit_test(Test_TempNewSymbol()); +#if INCLUDE_VM_STRUCTS + run_unit_test(VMStructs_test()); +#endif +#if INCLUDE_ALL_GCS + run_unit_test(TestOldFreeSpaceCalculation_test()); + run_unit_test(TestG1BiasedArray_test()); + run_unit_test(TestBufferingOopClosure_test()); + run_unit_test(TestCodeCacheRemSet_test()); + if (UseG1GC) { + run_unit_test(FreeRegionList_test()); + run_unit_test(IHOP_test()); + } + run_unit_test(test_memset_with_concurrent_readers()); + run_unit_test(TestPredictions_test()); + run_unit_test(WorkerDataArray_test()); +#endif + tty->print_cr("All internal VM tests passed"); +} + +#endif diff --git a/hotspot/src/share/vm/utilities/internalVMTests.hpp b/hotspot/src/share/vm/utilities/internalVMTests.hpp new file mode 100644 index 00000000000..93bc3309abe --- /dev/null +++ b/hotspot/src/share/vm/utilities/internalVMTests.hpp @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_VM_UTILITIES_INTERNALVMTESTS_HPP +#define SHARE_VM_UTILITIES_INTERNALVMTESTS_HPP + +#ifndef PRODUCT + +#include "memory/allocation.hpp" + +class InternalVMTests : public AllStatic { + public: + static void run(); +}; + +#endif + +#endif // SHARE_VM_UTILITIES_INTERNALVMTESTS_HPP diff --git a/hotspot/src/share/vm/utilities/json.cpp b/hotspot/src/share/vm/utilities/json.cpp index 2064bb81e7a..cb3bf391006 100644 --- a/hotspot/src/share/vm/utilities/json.cpp +++ b/hotspot/src/share/vm/utilities/json.cpp @@ -687,6 +687,24 @@ void JSON::error(JSON_ERROR e, const char* format, ...) { } #ifndef PRODUCT +class JSONTest : public JSON { + public: + static void test(); + + private: + JSONTest(const char* text); + static void test(const char* json, bool valid); + + void log(uint level, const char* format, ...) ATTRIBUTE_PRINTF(3, 4); + + bool callback(JSON_TYPE t, JSON_VAL* v, uint level); + JSON_TYPE prev; +}; + +void JSON_test() { + JSONTest::test(); +} + void JSONTest::test(const char* text, bool should_pass) { JSONTest json(text); if (should_pass) { @@ -707,7 +725,7 @@ JSONTest::JSONTest(const char* text) : JSON(text, !VerboseInternalVMTests, tty) parse(); } -bool JSONTest::test() { +void JSONTest::test() { JSONTest::test("{}", true); JSONTest::test("[]", true); JSONTest::test(" { } ", true); @@ -842,8 +860,6 @@ bool JSONTest::test() { " blocking_compile: true" "\n" " }," "\n" "]" "\n", true); - - return true; } void JSONTest::log(uint indent, const char* format, ...) { diff --git a/hotspot/src/share/vm/utilities/json.hpp b/hotspot/src/share/vm/utilities/json.hpp index b22eb427557..7106990ce34 100644 --- a/hotspot/src/share/vm/utilities/json.hpp +++ b/hotspot/src/share/vm/utilities/json.hpp @@ -108,20 +108,4 @@ class JSON : public ResourceObj { const char* strerror(JSON_ERROR e); }; -#ifndef PRODUCT -class JSONTest : public JSON { - public: - static bool test(); - - private: - JSONTest(const char* text); - static void test(const char* json, bool valid); - - void log(uint level, const char* format, ...) ATTRIBUTE_PRINTF(3, 4); - - bool callback(JSON_TYPE t, JSON_VAL* v, uint level); - JSON_TYPE prev; -}; -#endif - #endif // SHARE_VM_UTILITIES_JSON_HPP diff --git a/hotspot/src/share/vm/utilities/quickSort.cpp b/hotspot/src/share/vm/utilities/quickSort.cpp index 523b169b3c3..ebe399ee1b3 100644 --- a/hotspot/src/share/vm/utilities/quickSort.cpp +++ b/hotspot/src/share/vm/utilities/quickSort.cpp @@ -72,7 +72,7 @@ extern "C" { } } -void QuickSort::print_array(const char* prefix, int* array, int length) { +static void print_array(const char* prefix, int* array, int length) { tty->print("%s:", prefix); for (int i = 0; i < length; i++) { tty->print(" %d", array[i]); @@ -80,7 +80,7 @@ void QuickSort::print_array(const char* prefix, int* array, int length) { tty->cr(); } -bool QuickSort::compare_arrays(int* actual, int* expected, int length) { +static bool compare_arrays(int* actual, int* expected, int length) { for (int i = 0; i < length; i++) { if (actual[i] != expected[i]) { print_array("Sorted array ", actual, length); @@ -92,12 +92,12 @@ bool QuickSort::compare_arrays(int* actual, int* expected, int length) { } template -bool QuickSort::sort_and_compare(int* arrayToSort, int* expectedResult, int length, C comparator, bool idempotent) { - sort(arrayToSort, length, comparator, idempotent); +static bool sort_and_compare(int* arrayToSort, int* expectedResult, int length, C comparator, bool idempotent = false) { + QuickSort::sort(arrayToSort, length, comparator, idempotent); return compare_arrays(arrayToSort, expectedResult, length); } -void QuickSort::test_quick_sort() { +void QuickSort_test() { { int* test_array = NULL; int* expected_array = NULL; @@ -208,15 +208,14 @@ void QuickSort::test_quick_sort() { // Now sort them once with the test_even_odd_comparator. Then sort the // test_array one more time with test_even_odd_comparator and verify that // it is idempotent. - sort(expected_array, length, test_even_odd_comparator, true); - sort(test_array, length, test_even_odd_comparator, true); + QuickSort::sort(expected_array, length, test_even_odd_comparator, true); + QuickSort::sort(test_array, length, test_even_odd_comparator, true); assert(compare_arrays(test_array, expected_array, length), "Sorting identical arrays rendered different results"); - sort(test_array, length, test_even_odd_comparator, true); + QuickSort::sort(test_array, length, test_even_odd_comparator, true); assert(compare_arrays(test_array, expected_array, length), "Sorting already sorted array changed order of elements - not idempotent"); FREE_C_HEAP_ARRAY(int, test_array); FREE_C_HEAP_ARRAY(int, expected_array); } } - #endif diff --git a/hotspot/src/share/vm/utilities/quickSort.hpp b/hotspot/src/share/vm/utilities/quickSort.hpp index ba131aad652..0f2084ac68a 100644 --- a/hotspot/src/share/vm/utilities/quickSort.hpp +++ b/hotspot/src/share/vm/utilities/quickSort.hpp @@ -124,14 +124,6 @@ class QuickSort : AllStatic { inner_sort(array, length, comparator); } } - - // for unit testing -#ifndef PRODUCT - static void print_array(const char* prefix, int* array, int length); - static bool compare_arrays(int* actual, int* expected, int length); - template static bool sort_and_compare(int* arrayToSort, int* expectedResult, int length, C comparator, bool idempotent = false); - static void test_quick_sort(); -#endif }; diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp index 23c3195db4d..4ad914ef4e5 100644 --- a/hotspot/src/share/vm/utilities/vmError.cpp +++ b/hotspot/src/share/vm/utilities/vmError.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, 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 @@ -232,11 +232,17 @@ static void report_vm_version(outputStream* st, char* buf, int buflen) { const char* runtime_name = JDK_Version::runtime_name() != NULL ? JDK_Version::runtime_name() : ""; const char* runtime_version = JDK_Version::runtime_version() != NULL ? - JDK_Version::runtime_version() : ""; - st->print_cr("# JRE version: %s (%s) (build %s)", runtime_name, buf, runtime_version); + JDK_Version::runtime_version() : ""; + const char* jdk_debug_level = Abstract_VM_Version::printable_jdk_debug_level() != NULL ? + Abstract_VM_Version::printable_jdk_debug_level() : ""; + + st->print_cr("# JRE version: %s (%s) (%sbuild %s)", runtime_name, buf, + jdk_debug_level, runtime_version); + // This is the long version with some default settings added - st->print_cr("# Java VM: %s (%s, %s%s%s%s%s, %s, %s)", + st->print_cr("# Java VM: %s (%s%s, %s%s%s%s%s, %s, %s)", Abstract_VM_Version::vm_name(), + jdk_debug_level, Abstract_VM_Version::vm_release(), Abstract_VM_Version::vm_info_string(), TieredCompilation ? ", tiered" : "", @@ -1234,38 +1240,6 @@ void VMError::report_and_die(int id, const char* message, const char* detail_fmt log_done = true; } - - static bool skip_OnError = false; - if (!skip_OnError && OnError && OnError[0]) { - skip_OnError = true; - - out.print_raw_cr("#"); - out.print_raw ("# -XX:OnError=\""); - out.print_raw (OnError); - out.print_raw_cr("\""); - - char* cmd; - const char* ptr = OnError; - while ((cmd = next_OnError_command(buffer, sizeof(buffer), &ptr)) != NULL){ - out.print_raw ("# Executing "); -#if defined(LINUX) || defined(_ALLBSD_SOURCE) - out.print_raw ("/bin/sh -c "); -#elif defined(SOLARIS) - out.print_raw ("/usr/bin/sh -c "); -#endif - out.print_raw ("\""); - out.print_raw (cmd); - out.print_raw_cr("\" ..."); - - if (os::fork_and_exec(cmd) < 0) { - out.print_cr("os::fork_and_exec failed: %s (%d)", strerror(errno), errno); - } - } - - // done with OnError - OnError = NULL; - } - static bool skip_replay = ReplayCompiles; // Do not overwrite file during replay if (DumpReplayDataOnError && _thread && _thread->is_Compiler_thread() && !skip_replay) { skip_replay = true; @@ -1295,6 +1269,40 @@ void VMError::report_and_die(int id, const char* message, const char* detail_fmt print_bug_submit_message(&out, _thread); } + static bool skip_OnError = false; + if (!skip_OnError && OnError && OnError[0]) { + skip_OnError = true; + + // Flush output and finish logs before running OnError commands. + ostream_abort(); + + out.print_raw_cr("#"); + out.print_raw ("# -XX:OnError=\""); + out.print_raw (OnError); + out.print_raw_cr("\""); + + char* cmd; + const char* ptr = OnError; + while ((cmd = next_OnError_command(buffer, sizeof(buffer), &ptr)) != NULL){ + out.print_raw ("# Executing "); +#if defined(LINUX) || defined(_ALLBSD_SOURCE) + out.print_raw ("/bin/sh -c "); +#elif defined(SOLARIS) + out.print_raw ("/usr/bin/sh -c "); +#endif + out.print_raw ("\""); + out.print_raw (cmd); + out.print_raw_cr("\" ..."); + + if (os::fork_and_exec(cmd) < 0) { + out.print_cr("os::fork_and_exec failed: %s (%d)", strerror(errno), errno); + } + } + + // done with OnError + OnError = NULL; + } + if (!UseOSErrorReporting) { // os::abort() will call abort hooks, try it first. static bool skip_os_abort = false; diff --git a/hotspot/test/Makefile b/hotspot/test/Makefile index 41538dec380..5c703e9d5cc 100644 --- a/hotspot/test/Makefile +++ b/hotspot/test/Makefile @@ -121,11 +121,11 @@ TEST_ROOT := $(shell pwd) # Root of all test results ifdef ALT_OUTPUTDIR - ABS_BUILD_ROOT = $(ALT_OUTPUTDIR)/$(PLATFORM)-$(ARCH) + ABS_BUILD_ROOT = $(ALT_OUTPUTDIR) else ABS_BUILD_ROOT = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH) endif -ABS_TEST_OUTPUT_DIR = $(ABS_BUILD_ROOT)/testoutput +ABS_TEST_OUTPUT_DIR = $(ABS_BUILD_ROOT)/testoutput/$(UNIQUE_DIR) # Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test) ifndef PRODUCT_HOME @@ -253,8 +253,8 @@ prep: clean # Cleanup clean: - $(RM) -r $(ABS_TEST_OUTPUT_DIR) - $(RM) $(ARCHIVE_BUNDLE) + @$(RM) -r $(ABS_TEST_OUTPUT_DIR) + @$(RM) $(ARCHIVE_BUNDLE) ################################################################ diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups index c0b6324416a..f7d983f5a8f 100644 --- a/hotspot/test/TEST.groups +++ b/hotspot/test/TEST.groups @@ -97,7 +97,8 @@ needs_jdk = \ runtime/XCheckJniJsig/XCheckJSig.java \ serviceability/attach/AttachWithStalePidFile.java \ serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java \ - serviceability/dcmd/vm/DynLibsTest.java + serviceability/dcmd/vm/DynLibsTest.java \ + serviceability/tmtools # JRE adds further tests to compact3 @@ -130,13 +131,12 @@ compact3 = \ # Tests that require compact3 API's # needs_compact3 = \ - gc/6581734/Test6581734.java \ - gc/7072527/TestFullGCCount.java \ - gc/g1/TestHumongousAllocInitialMark.java \ + gc/TestFullGCCount.java \ gc/arguments/TestG1HeapRegionSize.java \ - gc/metaspace/TestMetaspaceMemoryPool.java \ gc/arguments/TestDynMinHeapFreeRatio.java \ gc/arguments/TestDynMaxHeapFreeRatio.java \ + gc/cms/TestMBeanCMS.java \ + gc/g1/TestHumongousAllocInitialMark.java \ gc/g1/TestShrinkAuxiliaryData00.java \ gc/g1/TestShrinkAuxiliaryData05.java \ gc/g1/TestShrinkAuxiliaryData10.java \ @@ -144,6 +144,7 @@ needs_compact3 = \ gc/g1/TestShrinkAuxiliaryData20.java \ gc/g1/TestShrinkAuxiliaryData25.java \ gc/g1/TestShrinkAuxiliaryData30.java \ + gc/metaspace/TestMetaspaceMemoryPool.java \ gc/survivorAlignment \ runtime/InternalApi/ThreadCpuTimesDeadlock.java \ runtime/NMT/JcmdSummaryDiff.java \ @@ -288,6 +289,7 @@ hotspot_compiler_3 = \ compiler/jsr292/ \ compiler/loopopts/ \ compiler/macronodes/ \ + compiler/memoryinitialization/ \ compiler/osr/ \ compiler/regalloc/ \ compiler/runtime/ \ @@ -339,7 +341,8 @@ hotspot_runtime = \ hotspot_serviceability = \ sanity/ExecuteInternalVMTests.java \ - serviceability/dcmd/compiler + serviceability/dcmd/compiler \ + serviceability/logging hotspot_jprt = \ :hotspot_compiler_1 \ @@ -362,3 +365,6 @@ needs_nashorn = \ not_needs_nashorn = \ :jdk \ -:needs_nashorn + +hotspot_tmtools = \ + serviceability/tmtools diff --git a/hotspot/test/compiler/c2/6772683/InterruptedTest.java b/hotspot/test/compiler/c2/6772683/InterruptedTest.java index ca7fd5a98b5..aa513fa02aa 100644 --- a/hotspot/test/compiler/c2/6772683/InterruptedTest.java +++ b/hotspot/test/compiler/c2/6772683/InterruptedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2016, 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 @@ -26,12 +26,39 @@ * @test * @bug 6772683 * @summary Thread.isInterrupted() fails to return true on multiprocessor PC - * @run main/othervm InterruptedTest + * @run main/othervm InterruptedTest 100 */ public class InterruptedTest { public static void main(String[] args) throws Exception { + /* The value of the threshold determines for how many seconds + * the main thread must wait for the worker thread. On highly + * loaded systems it can take a while until the worker thread + * obtains CPU time and is able to check if it was interrupted + * by the main thread. The higher the threshold the likelier + * the worker thread can check if it was interrupted (that is + * required for successul test execution). + */ + int threshold = 100; + + if (args.length != 1) { + System.out.println("Incorrect number of arguments"); + System.exit(1); + } + + try { + threshold = Integer.parseInt(args[0]); + } catch (NumberFormatException e) { + System.out.println("Invalid argument format"); + System.exit(1); + } + + if (threshold < 1) { + System.out.println("Threshold must be at least 1"); + System.exit(1); + } + Thread workerThread = new Thread("worker") { public void run() { System.out.println("Worker thread: running..."); @@ -42,24 +69,27 @@ public class InterruptedTest { }; System.out.println("Main thread: starts a worker thread..."); workerThread.start(); - System.out.println("Main thread: waits at most 5s for the worker thread to die..."); + System.out.println("Main thread: waits 5 seconds after starting the worker thread"); workerThread.join(5000); // Wait 5 sec to let run() method to be compiled + int ntries = 0; - while (workerThread.isAlive() && ntries < 5) { + while (workerThread.isAlive() && ntries < threshold) { System.out.println("Main thread: interrupts the worker thread..."); workerThread.interrupt(); if (workerThread.isInterrupted()) { System.out.println("Main thread: worker thread is interrupted"); } ntries++; - System.out.println("Main thread: waits for the worker thread to die..."); + System.out.println("Main thread: waits 1 second for the worker thread to die..."); workerThread.join(1000); // Wait 1 sec and try again } - if (ntries == 5) { - System.out.println("Main thread: the worker thread dod not die"); + + if (ntries == threshold) { + System.out.println("Main thread: the worker thread did not die after " + + ntries + " seconds have elapsed"); System.exit(97); } + System.out.println("Main thread: bye"); } - } diff --git a/hotspot/test/compiler/c2/6880034/Test6880034.java b/hotspot/test/compiler/c2/6880034/Test6880034.java index e834f23e549..72af0958b7e 100644 --- a/hotspot/test/compiler/c2/6880034/Test6880034.java +++ b/hotspot/test/compiler/c2/6880034/Test6880034.java @@ -1,5 +1,5 @@ /* - * Copyright 2009 SAP AG. All Rights Reserved. + * Copyright (c) 2009 SAP SE. 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 diff --git a/hotspot/test/compiler/c2/6910484/Test.java b/hotspot/test/compiler/c2/6910484/Test.java index 9835b34c6bb..3907c98fd2a 100644 --- a/hotspot/test/compiler/c2/6910484/Test.java +++ b/hotspot/test/compiler/c2/6910484/Test.java @@ -1,5 +1,5 @@ /* - * Copyright 2009 SAP. All Rights Reserved. + * Copyright (c) 2009 SAP SE. 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 diff --git a/hotspot/test/compiler/c2/8007294/Test8007294.java b/hotspot/test/compiler/c2/8007294/Test8007294.java index 33f0fb8bbab..a335ba7fe96 100644 --- a/hotspot/test/compiler/c2/8007294/Test8007294.java +++ b/hotspot/test/compiler/c2/8007294/Test8007294.java @@ -24,6 +24,7 @@ /* * @test * @bug 8007294 + * @bug 8146999 * @summary ReduceFieldZeroing doesn't check for dependent load and can lead to incorrect execution * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline -XX:-UseOnStackReplacement -XX:-BackgroundCompilation Test8007294 * @@ -82,6 +83,7 @@ public class Test8007294 { } } for (int i = 0; i < 20000; i++) { + test2(0); // pollute profile int res = test2(1); if (res != 2) { System.out.println("FAILED test2 = " + res); diff --git a/hotspot/test/compiler/codegen/8005033/Test8005033.java b/hotspot/test/compiler/codegen/8005033/Test8005033.java index e6706390841..1918136d67e 100644 --- a/hotspot/test/compiler/codegen/8005033/Test8005033.java +++ b/hotspot/test/compiler/codegen/8005033/Test8005033.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 SAP AG. All Rights Reserved. + * Copyright (c) 2012 SAP SE. 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 diff --git a/hotspot/test/compiler/codegen/IntRotateWithImmediate.java b/hotspot/test/compiler/codegen/IntRotateWithImmediate.java index 1d617a41526..e174de699e8 100644 --- a/hotspot/test/compiler/codegen/IntRotateWithImmediate.java +++ b/hotspot/test/compiler/codegen/IntRotateWithImmediate.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 SAP AG. All Rights Reserved. + * Copyright (c) 2015 SAP SE. 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 diff --git a/hotspot/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java b/hotspot/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java index 87a5efd732e..7fccb4577ac 100644 --- a/hotspot/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java +++ b/hotspot/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests CompileCommand=compileonly * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build CompileOnlyTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.commandfile.CompileOnlyTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java b/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java index 0e5dc7948e0..afe38547431 100644 --- a/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java +++ b/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests CompileCommand=exclude * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build ExcludeTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.commandfile.ExcludeTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/commandfile/LogTest.java b/hotspot/test/compiler/compilercontrol/commandfile/LogTest.java index 60463073253..a3b7c8f26b4 100644 --- a/hotspot/test/compiler/compilercontrol/commandfile/LogTest.java +++ b/hotspot/test/compiler/compilercontrol/commandfile/LogTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests CompileCommand=log * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build LogTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.commandfile.LogTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/commandfile/PrintTest.java b/hotspot/test/compiler/compilercontrol/commandfile/PrintTest.java index 2040b4aaac8..a5f3ed978f8 100644 --- a/hotspot/test/compiler/compilercontrol/commandfile/PrintTest.java +++ b/hotspot/test/compiler/compilercontrol/commandfile/PrintTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests CompileCommand=print * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build PrintTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.commandfile.PrintTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/commands/CompileOnlyTest.java b/hotspot/test/compiler/compilercontrol/commands/CompileOnlyTest.java index ad4328fc018..1509473fc40 100644 --- a/hotspot/test/compiler/compilercontrol/commands/CompileOnlyTest.java +++ b/hotspot/test/compiler/compilercontrol/commands/CompileOnlyTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests CompileCommand=compileonly * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build CompileOnlyTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.commands.CompileOnlyTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/commands/ExcludeTest.java b/hotspot/test/compiler/compilercontrol/commands/ExcludeTest.java index 4be5f37998f..86f18c60180 100644 --- a/hotspot/test/compiler/compilercontrol/commands/ExcludeTest.java +++ b/hotspot/test/compiler/compilercontrol/commands/ExcludeTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests CompileCommand=exclude * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build ExcludeTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.commands.ExcludeTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/commands/LogTest.java b/hotspot/test/compiler/compilercontrol/commands/LogTest.java index 2b28436ed1a..4a000fe0a29 100644 --- a/hotspot/test/compiler/compilercontrol/commands/LogTest.java +++ b/hotspot/test/compiler/compilercontrol/commands/LogTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests CompileCommand=log * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build LogTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.commands.LogTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/commands/PrintTest.java b/hotspot/test/compiler/compilercontrol/commands/PrintTest.java index 62af5e0552b..27313abe197 100644 --- a/hotspot/test/compiler/compilercontrol/commands/PrintTest.java +++ b/hotspot/test/compiler/compilercontrol/commands/PrintTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests CompileCommand=print * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build PrintTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.commands.PrintTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/directives/CompileOnlyTest.java b/hotspot/test/compiler/compilercontrol/directives/CompileOnlyTest.java index 12a522d777b..45034afa1ff 100644 --- a/hotspot/test/compiler/compilercontrol/directives/CompileOnlyTest.java +++ b/hotspot/test/compiler/compilercontrol/directives/CompileOnlyTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests directives to be able to compile only specified methods * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build CompileOnlyTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.directives.CompileOnlyTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/directives/ExcludeTest.java b/hotspot/test/compiler/compilercontrol/directives/ExcludeTest.java index cd6d01c65a1..72b30bf8720 100644 --- a/hotspot/test/compiler/compilercontrol/directives/ExcludeTest.java +++ b/hotspot/test/compiler/compilercontrol/directives/ExcludeTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests directives to be able to exclude methods from compilation * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build ExcludeTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.directives.ExcludeTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/directives/LogTest.java b/hotspot/test/compiler/compilercontrol/directives/LogTest.java index cca0b7e6754..f3147caa73e 100644 --- a/hotspot/test/compiler/compilercontrol/directives/LogTest.java +++ b/hotspot/test/compiler/compilercontrol/directives/LogTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests directives to be able to turn on LogCompilation * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build LogTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.directives.LogTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/directives/PrintTest.java b/hotspot/test/compiler/compilercontrol/directives/PrintTest.java index 466f452f48c..204e42bd130 100644 --- a/hotspot/test/compiler/compilercontrol/directives/PrintTest.java +++ b/hotspot/test/compiler/compilercontrol/directives/PrintTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests directives to be able to turn on print_assembly * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build PrintTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.directives.PrintTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java index 937500b996f..474e2bfe36b 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests directives to be able to add and remove directives * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build AddAndRemoveTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.AddAndRemoveTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java index 010cc16661f..ef0df375170 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests jcmd to be able to add a directive to compile only specified methods * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build AddCompileOnlyTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.AddCompileOnlyTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddExcludeTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddExcludeTest.java index e17d104879c..20282fbd41c 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddExcludeTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddExcludeTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests jcmd to be able to add a directive to exclude only specified methods * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build AddExcludeTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.AddExcludeTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java index 12610af9777..aaf6abb78f2 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests jcmd to be able to add a directive to log only specified methods * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build AddLogTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.AddLogTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java index b3a0379e9ee..054f44d308b 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java @@ -27,7 +27,8 @@ * @summary Tests jcmd to be able to add a directive to print assembly * only for specified methods * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build AddPrintAssemblyTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.AddPrintAssemblyTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java b/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java index aaccbc3b58e..25966f9f726 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java @@ -27,7 +27,8 @@ * @ignore 8140405 * @summary Tests jcmd to be able to clear directives added via options * @library /testlibrary /test/lib /compiler/testlibrary ../share / - * @build ClearDirectivesFileStackTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.ClearDirectivesFileStackTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java b/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java index 0731e0ba8c2..f9f382da110 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests clear JCMD command * @library /testlibrary /test/lib /compiler/testlibrary ../share / - * @build ClearDirectivesStackTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.ClearDirectivesStackTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/jcmd/PrintDirectivesTest.java b/hotspot/test/compiler/compilercontrol/jcmd/PrintDirectivesTest.java index 7e3225f6587..632e79e6c22 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/PrintDirectivesTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/PrintDirectivesTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests jcmd to be able to add a directive to compile only specified methods * @library /testlibrary /test/lib /compiler/testlibrary ../share / - * @build pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.PrintDirectivesTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -80,4 +81,4 @@ public class PrintDirectivesTest extends AbstractTestBase { Scenario scenario = builder.build(); scenario.execute(); } -} \ No newline at end of file +} diff --git a/hotspot/test/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java b/hotspot/test/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java index a955b47f4fa..326a8a0b4b6 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java @@ -27,7 +27,8 @@ * @summary Tests jcmd to be able to add a lot of huge directive files with * parallel executed jcmds until timeout has reached * @library /testlibrary /test/lib /compiler/testlibrary ../share / - * @build StressAddMultiThreadedTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.StressAddMultiThreadedTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils * compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/compilercontrol/jcmd/StressAddSequentiallyTest.java b/hotspot/test/compiler/compilercontrol/jcmd/StressAddSequentiallyTest.java index 071ecd3ddf4..f8509128321 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/StressAddSequentiallyTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/StressAddSequentiallyTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests jcmd to be able to add a lot of huge directives * @library /testlibrary /test/lib /compiler/testlibrary ../share / - * @build StressAddSequentiallyTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.StressAddSequentiallyTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils * compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/compilercontrol/matcher/MethodMatcherTest.java b/hotspot/test/compiler/compilercontrol/matcher/MethodMatcherTest.java index e38ec6e8b83..00ca74d108d 100644 --- a/hotspot/test/compiler/compilercontrol/matcher/MethodMatcherTest.java +++ b/hotspot/test/compiler/compilercontrol/matcher/MethodMatcherTest.java @@ -41,7 +41,7 @@ import java.util.regex.Pattern; * @bug 8135068 * @summary Tests CompilerCommand's method matcher * @library /testlibrary /test/lib /compiler/whitebox ../share / - * @build MethodMatcherTest + * @build compiler.compilercontrol.matcher.MethodMatcherTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/compilercontrol/mixed/RandomCommandsTest.java b/hotspot/test/compiler/compilercontrol/mixed/RandomCommandsTest.java index 7837b16d480..c175bb04ce3 100644 --- a/hotspot/test/compiler/compilercontrol/mixed/RandomCommandsTest.java +++ b/hotspot/test/compiler/compilercontrol/mixed/RandomCommandsTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Randomly generates commands with random types * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build RandomCommandsTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.mixed.RandomCommandsTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java b/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java index 951789991f7..3c67043621f 100644 --- a/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java +++ b/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Randomly generates valid commands with random types * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build RandomValidCommandsTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.mixed.RandomValidCommandsTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/share/pool/SubMethodHolder.java b/hotspot/test/compiler/compilercontrol/share/pool/SubMethodHolder.java new file mode 100644 index 00000000000..7ccc7393fbb --- /dev/null +++ b/hotspot/test/compiler/compilercontrol/share/pool/SubMethodHolder.java @@ -0,0 +1,49 @@ +package pool; + +import jdk.test.lib.Pair; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Executable; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.Callable; + +/** + * A helper class that creates executables and callables for internal classes + * It's necessary to have this class to make all helper lambdas not contain + * any of class names that could be used as a pattern (Internal*, *Klass*) + */ +public abstract class SubMethodHolder extends MethodHolder { + @Override + public List>> getAllMethods() { + List>> pairs = new ArrayList<>(); + { + Method method = getMethod(this, "method", Float.class); + Pair> pair = new Pair<>(method, + () -> method.invoke(this, 3.141592f)); + pairs.add(pair); + } + { + Method method = getMethod(this, "methodDup"); + Pair> pair = new Pair<>(method, + () -> method.invoke(this)); + pairs.add(pair); + } + { + Method method = getMethod(this, "smethod", Integer.class); + Pair> pair = new Pair<>(method, + () -> method.invoke(this, 1024)); + pairs.add(pair); + } + try { + Constructor constructor = this.getClass().getConstructor(); + Pair> pair = new Pair<>(constructor, + constructor::newInstance); + pairs.add(pair); + } catch (NoSuchMethodException e) { + throw new Error("TESTBUG: unable to get constructor"); + } + return pairs; + } +} diff --git a/hotspot/test/compiler/compilercontrol/share/pool/sub/Klass.java b/hotspot/test/compiler/compilercontrol/share/pool/sub/Klass.java index 9d677544e74..f1a3b3ecb53 100644 --- a/hotspot/test/compiler/compilercontrol/share/pool/sub/Klass.java +++ b/hotspot/test/compiler/compilercontrol/share/pool/sub/Klass.java @@ -23,13 +23,8 @@ package pool.sub; -import jdk.test.lib.Pair; import pool.MethodHolder; - -import java.lang.reflect.Executable; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.Callable; +import pool.SubMethodHolder; /** * Simple class with methods to test signatures @@ -53,7 +48,7 @@ public class Klass extends MethodHolder { } // Internal class and constructor - public static class Internal extends MethodHolder { + public static class Internal extends SubMethodHolder { public Internal() { } public Double method(Float fl) { return Double.valueOf(fl); } @@ -66,27 +61,5 @@ public class Klass extends MethodHolder { Integer var = 1024; return arg + var; } - - @Override - public List>> getAllMethods() { - List>> pairs = new ArrayList<>(); - Pair> pair = new Pair<> - (getMethod(this, "method", Float.class), - () -> this.method(3.141592f)); - pairs.add(pair); - pair = new Pair<>(getMethod(this, "methodDup"), this::methodDup); - pairs.add(pair); - pair = new Pair<>(getMethod(this, "smethod", Integer.class), - () -> smethod(1024)); - pairs.add(pair); - try { - pair = new Pair<>(this.getClass().getConstructor(), - Internal::new); - pairs.add(pair); - } catch (NoSuchMethodException e) { - throw new Error("TESTBUG: unable to get constructor"); - } - return pairs; - } } } diff --git a/hotspot/test/compiler/compilercontrol/share/pool/subpack/KlassDup.java b/hotspot/test/compiler/compilercontrol/share/pool/subpack/KlassDup.java index 6349abdc167..f5e930ba96a 100644 --- a/hotspot/test/compiler/compilercontrol/share/pool/subpack/KlassDup.java +++ b/hotspot/test/compiler/compilercontrol/share/pool/subpack/KlassDup.java @@ -23,13 +23,8 @@ package pool.subpack; -import jdk.test.lib.Pair; import pool.MethodHolder; - -import java.lang.reflect.Executable; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.Callable; +import pool.SubMethodHolder; /** * This is a clone of the pool.sub.Klass used to test pattern matching @@ -54,7 +49,7 @@ public class KlassDup extends MethodHolder { } // Internal class and constructor - public static class Internal extends MethodHolder { + public static class Internal extends SubMethodHolder { public Internal() { } public Double method(Float fl) { return Double.valueOf(fl); } @@ -67,27 +62,5 @@ public class KlassDup extends MethodHolder { Integer var = 1024; return arg + var; } - - @Override - public List>> getAllMethods() { - List>> pairs = new ArrayList<>(); - Pair> pair = new Pair<> - (getMethod(this, "method", Float.class), - () -> this.method(3.141592f)); - pairs.add(pair); - pair = new Pair<>(getMethod(this, "methodDup"), this::methodDup); - pairs.add(pair); - pair = new Pair<>(getMethod(this, "smethod", Integer.class), - () -> smethod(1024)); - pairs.add(pair); - try { - pair = new Pair<>(this.getClass().getConstructor(), - Internal::new); - pairs.add(pair); - } catch (NoSuchMethodException e) { - throw new Error("TESTBUG: unable to get constructor"); - } - return pairs; - } } } diff --git a/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java b/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java index 0d78cadd8e0..eafbefb31f1 100644 --- a/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java +++ b/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java @@ -105,15 +105,15 @@ public abstract class AbstractCommandBuilder Map states = new HashMap<>(); for (Pair> pair : METHODS) { Executable exec = pair.first; - State state = getState(commandList, states, exec); + State state = getState(commandList, exec); states.put(exec, state); } return states; } private State getState(List commandList, - Map states, Executable exec) { - State state = states.getOrDefault(exec, new State()); + Executable exec) { + State state = new State(); MethodDescriptor execDesc = new MethodDescriptor(exec); for (CompileCommand compileCommand : commandList) { if (compileCommand.isValid()) { @@ -149,7 +149,8 @@ public abstract class AbstractCommandBuilder && (compileCommand.command == Command.COMPILEONLY)) { MethodDescriptor md = compileCommand.methodDescriptor; if (!execDesc.getCanonicalString().matches(md.getRegexp()) - && (state.getCompilableOptional( + // if compilation state wasn't set before + && (!state.getCompilableOptional( // no matter C1, C2 or both Scenario.Compiler.C2).isPresent())) { /* compileonly excludes only methods that haven't been diff --git a/hotspot/test/compiler/controldependency/TestEliminatedCastPPAtPhi.java b/hotspot/test/compiler/controldependency/TestEliminatedCastPPAtPhi.java new file mode 100644 index 00000000000..9c3daafbb9b --- /dev/null +++ b/hotspot/test/compiler/controldependency/TestEliminatedCastPPAtPhi.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/** + * @test + * @bug 8139771 + * @summary Eliminating CastPP nodes at Phis when they all come from a unique input may cause crash + * @requires vm.gc=="Serial" | vm.gc=="Parallel" + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:+IgnoreUnrecognizedVMOptions -XX:+StressGCM TestEliminatedCastPPAtPhi + * + */ + +public class TestEliminatedCastPPAtPhi { + + static TestEliminatedCastPPAtPhi saved; + static TestEliminatedCastPPAtPhi saved_not_null; + + int f; + + static int test(TestEliminatedCastPPAtPhi obj, int[] array, boolean flag) { + int ret = array[0] + array[20]; + saved = obj; + if (obj == null) { + return ret; + } + saved_not_null = obj; + + // empty loop to be optimized out. Delays range check smearing + // for the array access below until the if diamond is + // optimized out + int i = 0; + for (; i < 10; i++); + + ret += array[i]; + + TestEliminatedCastPPAtPhi res; + if (flag) { + // load is optimized out and res is obj here + res = saved; + } else { + // load is optimized out and res is non null CastPP of res here + res = saved_not_null; + } + // null check + CastPP here for res field load below + + // 1) null check is pushed in the branches of the if above by + // split through phi because res is non null in the second + // branch and the null check can be optimized out in that + // branch. The Castpp stays here. + + // 2) null check in the first branch is also optimized out + // because a dominating null check is found (the explicit null + // check at the beggining of the test) + + // 3) the Phi for the if above merges a CastPP'ed value and + // the same value so it's optimized out and replaced by the + // uncasted value: obj + + // 4) the if above has 2 empty branches so it's optimized + // out. The control of the CastPP that is still here is now + // the success branch of the range check for the array access + // above + + // 5) the loop above is optimized out, i = 10, the range check + // for the array access above is optimized out and all its + // uses are replaced by the range check for the array accesses + // at the beginning of the method. The castPP here is one of + // the uses and so its control is now the range check at the + // beginning of the method: the control of the CastPP bypasses + // the explicit null check + + return ret + res.f; + } + + static public void main(String[] args) { + int[] array = new int[100]; + TestEliminatedCastPPAtPhi obj = new TestEliminatedCastPPAtPhi(); + for (int i = 0; i < 20000; i++) { + test(obj, array, (i%2) == 0); + } + test(null, array, true); + } + +} diff --git a/hotspot/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java b/hotspot/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java index d70ec5cb268..ce7be99f7a1 100644 --- a/hotspot/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java +++ b/hotspot/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 SAP AG. All Rights Reserved. + * Copyright (c) 2014 SAP SE. 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 diff --git a/hotspot/test/compiler/intrinsics/IntrinsicAvailableTest.java b/hotspot/test/compiler/intrinsics/IntrinsicAvailableTest.java index d48702e6da0..ff2c7e366df 100644 --- a/hotspot/test/compiler/intrinsics/IntrinsicAvailableTest.java +++ b/hotspot/test/compiler/intrinsics/IntrinsicAvailableTest.java @@ -23,6 +23,8 @@ import java.lang.reflect.Executable; import java.util.concurrent.Callable; import java.util.Objects; + +import jdk.test.lib.*; import compiler.whitebox.CompilerWhiteBoxTest; /* * @test @@ -105,17 +107,16 @@ public class IntrinsicAvailableTest extends CompilerWhiteBoxTest { } } - protected boolean isServerVM() { - return VMName.toLowerCase().contains("server"); - } - public void test() throws Exception { Executable intrinsicMethod = testCase.getExecutable(); - if (isServerVM()) { + if (Platform.isServer()) { if (TIERED_COMPILATION) { checkIntrinsicForCompilationLevel(intrinsicMethod, COMP_LEVEL_SIMPLE); } - checkIntrinsicForCompilationLevel(intrinsicMethod, COMP_LEVEL_FULL_OPTIMIZATION); + // Dont bother check JVMCI compiler - returns false on all intrinsics. + if (!Boolean.valueOf(getVMOption("UseJVMCICompiler"))) { + checkIntrinsicForCompilationLevel(intrinsicMethod, COMP_LEVEL_FULL_OPTIMIZATION); + } } else { checkIntrinsicForCompilationLevel(intrinsicMethod, COMP_LEVEL_SIMPLE); } diff --git a/hotspot/test/compiler/intrinsics/string/TestStringIntrinsicMemoryFlow.java b/hotspot/test/compiler/intrinsics/string/TestStringIntrinsicMemoryFlow.java new file mode 100644 index 00000000000..86d7b309179 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/string/TestStringIntrinsicMemoryFlow.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import jdk.test.lib.Asserts; + +/* + * @test + * @bug 8144212 + * @summary Check for correct memory flow with the String compress/inflate intrinsics. + * @library /testlibrary + * @run main TestStringIntrinsicMemoryFlow + */ +public class TestStringIntrinsicMemoryFlow { + + public static void main(String[] args) { + for (int i = 0; i < 100_000; ++i) { + String s = "MyString"; + char[] c = {'M'}; + char res = testInflate1(s); + Asserts.assertEquals(res, 'M', "testInflate1 failed"); + res = testInflate2(s); + Asserts.assertEquals(res, (char)42, "testInflate2 failed"); + res = testCompress1(c); + Asserts.assertEquals(res, 'M', "testCompress1 failed"); + byte resB = testCompress2(c); + Asserts.assertEquals(resB, (byte)42, "testCompress2 failed"); + } + } + + private static char testInflate1(String s) { + char c[] = new char[1]; + // Inflate String from byte[] to char[] + s.getChars(0, 1, c, 0); + // Read char[] memory written by inflate intrinsic + return c[0]; + } + + private static char testInflate2(String s) { + char c1[] = new char[1]; + char c2[] = new char[1]; + c2[0] = 42; + // Inflate String from byte[] to char[] + s.getChars(0, 1, c1, 0); + // Read char[] memory written before inflation + return c2[0]; + } + + private static char testCompress1(char[] c) { + // Compress String from char[] to byte[] + String s = new String(c); + // Read the memory written by compress intrinsic + return s.charAt(0); + } + + private static byte testCompress2(char[] c) { + byte b1[] = new byte[1]; + b1[0] = 42; + // Compress String from char[] to byte[] + new String(c); + // Read byte[] memory written before compression + return b1[0]; + } +} diff --git a/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java b/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java new file mode 100644 index 00000000000..21c64179531 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java @@ -0,0 +1,674 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016 SAP SE. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8145336 + * @summary PPC64: fix string intrinsics after CompactStrings change + * @library /testlibrary /../../test/lib + * @build sun.hotspot.WhiteBox + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * + * @run main/othervm + * -Xbootclasspath/a:. + * -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:MaxInlineSize=100 + * -XX:MinInliningThreshold=0 + * TestStringIntrinsics2 + */ + +import java.lang.annotation.ElementType; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.function.Consumer; +import java.util.function.Function; + +import static jdk.test.lib.Asserts.*; +import sun.hotspot.WhiteBox; + +public class TestStringIntrinsics2 { + // ------------------------------------------------------------------------ + // + // We test the following cases: + // - no match in string. Do we miss the end condition? Will crash if we read + // past the string. + // - no match in string, but after the string there is a match. + // Do we incorrectly report this match? We had a case where we stepped + // a few chars past the string, this test would report that error. The + // one above would not. + // - The needle is exactly at the end of the string. + // - The needle spans the end of the string + // + // A special case are needles of length 1. For these we test: + // - needle is first char + // - needle is last char + // - no match + // - match behind string. + // + // We test all these for an unknown needle, and needles known to the compiler + // of lengths 5, 2 and 1. + + + private static final WhiteBox WB = WhiteBox.getWhiteBox(); + + public enum Role { + TEST_ENTRY, + TEST_HELPER + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.METHOD) + @interface Test { + Role role(); + int compileAt() default 0; + int warmup() default 0; + String[] warmupArgs() default {}; + } + + // All this mess is needed to avoid try/catch inside the lambdas below. + // See: http://stackoverflow.com/questions/27644361/how-can-i-throw-checked-exceptions-from-inside-java-8-streams + @SuppressWarnings ("unchecked") + private static void throwAsUnchecked(Exception exception) throws E { + throw (E)exception; + } + @FunctionalInterface + public interface Consumer_WithExceptions { + void accept(T t) throws E; + } + public static Consumer rethrowConsumer(Consumer_WithExceptions consumer) { + return t -> { + try { consumer.accept(t); } + catch (Exception exception) { throwAsUnchecked(exception); } + }; + } + + public static void main(String[] args) throws Exception { + + // Warmup helper methods + Arrays.stream(TestStringIntrinsics2.class.getDeclaredMethods()) + .filter(m -> m.isAnnotationPresent(Test.class)) + .filter(m -> m.getAnnotation(Test.class).warmup() > 0) + .forEach(rethrowConsumer(m -> { + Test a = m.getAnnotation(Test.class); + System.out.println("Warming up " + m + " " + a.warmup() + " time(s) "); + for (int i=0; i < a.warmup(); i++) { + m.invoke(null, (Object[])a.warmupArgs()); + } + })); + + // Compile helper methods + Arrays.stream(TestStringIntrinsics2.class.getDeclaredMethods()) + .filter(m -> m.isAnnotationPresent(Test.class)) + .filter(m -> m.getAnnotation(Test.class).compileAt() > 0) + .forEach(rethrowConsumer(m -> { + Test a = m.getAnnotation(Test.class); + if (WB.isMethodCompilable(m, a.compileAt())) { + WB.enqueueMethodForCompilation(m, a.compileAt()); + while (WB.isMethodQueuedForCompilation(m)) Thread.sleep(10); + System.out.println(m + " compiled at " + WB.getMethodCompilationLevel(m)); + } else { + System.out.println("Can't compile " + m + " at level " + a.compileAt()); + } + })); + + // Run test methods + Arrays.stream(TestStringIntrinsics2.class.getDeclaredMethods()) + .filter(m -> m.isAnnotationPresent(Test.class)) + .filter(m -> m.getAnnotation(Test.class).role() == Role.TEST_ENTRY) + .forEach(rethrowConsumer(m -> { + System.out.print("Executing " + m); + m.invoke(null, (Object[])null); + System.out.println(" - OK"); + })); + } + + static String text = "\n" + ""; + static String text2 = "\n" + ""; + static String[] ss = text.split("\n"); + static String[] ss2 = null; + static String needle = ""; + + @Test(role = Role.TEST_ENTRY) + public static void test_indexOf_no_match() { + int res = indexOf_no_match_unknown_needle(ss[0], ""); + assertEquals(res, -1, "test_indexOf_no_match_unknown_needle matched at: " + res); + res = indexOf_no_match_imm_needle(ss[0]); + assertEquals(res, -1, "test_indexOf_no_match_imm_needle matched at: " + res); + res = indexOf_no_match_imm2_needle(ss[0]); + assertEquals(res, -1, "test_indexOf_no_match_imm2_needle matched at: " + res); + + if (ss2 == null) ss2 = text.split("\n"); + res = indexOf_no_match_unknown_needle(ss2[0], ""); + assertEquals(res, -1, "test_indexOf_no_match_unknown_needle matched at: " + res); + res = indexOf_no_match_imm_needle(ss2[0]); + assertEquals(res, -1, "test_indexOf_no_match_imm_needle matched at: " + res); + res = indexOf_no_match_imm2_needle(ss2[0]); + assertEquals(res, -1, "test_indexOf_no_match_imm2_needle matched at: " + res); + res = indexOf_no_match_imm1_needle(ss2[0]); + assertEquals(res, -1, "test_indexOf_no_match_imm1_needle matched at: " + res); + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "", "" }) + static int indexOf_no_match_unknown_needle(String s, String needle) { + int index = s.indexOf(needle); + return index; + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "" }) + static int indexOf_no_match_imm_needle(String s) { + int index = s.indexOf(""); + return index; + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "" }) + static int indexOf_no_match_imm2_needle(String s) { + int index = s.indexOf("" }) + static int indexOf_no_match_imm1_needle(String s) { + int index = s.indexOf("m"); + return index; + } + + @Test(role = Role.TEST_ENTRY) + public static void test_indexOf_reads_past_string() { + if (ss == null) ss = text.split("\n"); + String res = indexOf_reads_past_string_unknown_needle(ss[0], ""); + assertEquals(res, null, "test_indexOf_reads_past_string_unknown_needle " + res); + res = indexOf_reads_past_string_imm_needle(ss[0]); + assertEquals(res, null, "test_indexOf_reads_past_string_imm_needle " + res); + res = indexOf_reads_past_string_imm2_needle(ss[0]); + assertEquals(res, null, "test_indexOf_reads_past_string_imm2_needle " + res); + res = indexOf_reads_past_string_imm1_needle(ss[0]); + assertEquals(res, null, "test_indexOf_reads_past_string_imm1_needle " + res); + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "", "" }) + static String indexOf_reads_past_string_unknown_needle(String s, String needle) { + int index = s.indexOf(needle); + if (index > s.length()) { + return "Found needle \"" + needle + "\" behind string of length " + s.length() + + " at position " + index + "."; + } + return null; + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "" }) + static String indexOf_reads_past_string_imm_needle(String s) { + int index = s.indexOf(""); + if (index > s.length()) { + return "Found needle \"\" behind string of length " + s.length() + " at position " + index + "."; + } + return null; + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "" }) + static String indexOf_reads_past_string_imm2_needle(String s) { + int index = s.indexOf(" s.length()) { + return "Found needle \"" }) + static String indexOf_reads_past_string_imm1_needle(String s) { + int index = s.indexOf("h"); + if (index > s.length()) { + return "Found needle \""); + assertEquals(len3, res + 5, testname); + res = indexOf_match_at_end_of_string_unknown_needle(text4, ""); + assertEquals(len4, res + 5, testname); + res = indexOf_match_at_end_of_string_unknown_needle(text5, ""); + assertEquals(len5, res + 5, testname); + res = indexOf_match_at_end_of_string_unknown_needle(text6, ""); + assertEquals(len6, res + 5, testname); + + res = indexOf_match_at_end_of_string_imm_needle(text3); + assertEquals(len3, res + 5, testname); + res = indexOf_match_at_end_of_string_imm_needle(text4); + assertEquals(len4, res + 5, testname); + res = indexOf_match_at_end_of_string_imm_needle(text5); + assertEquals(len5, res + 5, testname); + res = indexOf_match_at_end_of_string_imm_needle(text6); + assertEquals(len6, res + 5, testname); + + res = indexOf_match_at_end_of_string_imm2_needle(text7); + assertEquals(text7.length(), res + 2, testname); + res = indexOf_match_at_end_of_string_imm2_needle(text8); + assertEquals(text8.length(), res + 2, testname); + res = indexOf_match_at_end_of_string_imm2_needle(text9); + assertEquals(text9.length(), res + 2, testname); + res = indexOf_match_at_end_of_string_imm2_needle(text10); + assertEquals(text10.length(), res + 2, testname); + + res = indexOf_match_at_end_of_string_imm1_needle(text7); + assertEquals(text7.length(), res + 1, testname); + res = indexOf_match_at_end_of_string_imm1_needle(text8); + assertEquals(text8.length(), res + 1, testname); + res = indexOf_match_at_end_of_string_imm1_needle(text9); + assertEquals(text9.length(), res + 1, testname); + res = indexOf_match_at_end_of_string_imm1_needle(text10); + assertEquals(text10.length(), res + 1, testname); + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "", "" }) + static int indexOf_match_at_end_of_string_unknown_needle(String s, String needle) { + int index = s.indexOf(needle); + return index; + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "" }) + static int indexOf_match_at_end_of_string_imm_needle(String s) { + int index = s.indexOf(""); + return index; + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "" }) + static int indexOf_match_at_end_of_string_imm2_needle(String s) { + int index = s.indexOf("" }) + static int indexOf_match_at_end_of_string_imm1_needle(String s) { + int index = s.indexOf("h"); + return index; + } + + static String s0_1 = text3.substring(0, len3-1); + static String s0_2 = text3.substring(0, len3-2); + static String s0_3 = text3.substring(0, len3-3); + static String s0_4 = text3.substring(0, len3-4); + static String s1_1 = text4.substring(0, len4-1); + static String s1_2 = text4.substring(0, len4-2); + static String s1_3 = text4.substring(0, len4-3); + static String s1_4 = text4.substring(0, len4-4); + static String s2_1 = text5.substring(0, len5-1); + static String s2_2 = text5.substring(0, len5-2); + static String s2_3 = text5.substring(0, len5-3); + static String s2_4 = text5.substring(0, len5-4); + static String s3_1 = text6.substring(0, len6-1); + static String s3_2 = text6.substring(0, len6-2); + static String s3_3 = text6.substring(0, len6-3); + static String s3_4 = text6.substring(0, len6-4); + + static String s0_1x = text7 .substring(0, text7 .length()-1); + static String s1_1x = text8 .substring(0, text8 .length()-1); + static String s2_1x = text9 .substring(0, text9 .length()-1); + static String s3_1x = text10.substring(0, text10.length()-1); + + @Test(role = Role.TEST_ENTRY) + public static void test_indexOf_match_spans_end_of_string() { + String res = null; + res = indexOf_match_spans_end_of_string_unknown_needle(s0_1, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s0_1 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s0_2, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s0_2 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s0_3, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s0_3 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s0_4, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s0_4 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s1_1, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s1_1 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s1_2, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s1_2 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s1_3, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s1_3 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s1_4, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s1_4 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s2_1, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s2_1 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s2_2, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s2_2 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s2_3, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s2_3 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s2_4, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s2_4 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s3_1, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s3_1 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s3_2, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s3_2 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s3_3, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s3_3 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s3_4, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s3_4 " + res); + + res = indexOf_match_spans_end_of_string_imm_needle(s0_1); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s0_1 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s0_2); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s0_2 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s0_3); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s0_3 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s0_4); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s0_4 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s1_1); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s1_1 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s1_2); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s1_2 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s1_3); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s1_3 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s1_4); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s1_4 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s2_1); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s2_1 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s2_2); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s2_2 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s2_3); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s2_3 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s2_4); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s2_4 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s3_1); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s3_1 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s3_2); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s3_2 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s3_3); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s3_3 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s3_4); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s3_4 " + res); + + res = indexOf_match_spans_end_of_string_imm2_needle(s0_1x); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm2_needle s0_1x " + res); + res = indexOf_match_spans_end_of_string_imm2_needle(s1_1x); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm2_needle s1_1x " + res); + res = indexOf_match_spans_end_of_string_imm2_needle(s2_1x); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm2_needle s2_1x " + res); + res = indexOf_match_spans_end_of_string_imm2_needle(s3_1x); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm2_needle s3_1x " + res); + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "" }) + static String indexOf_match_spans_end_of_string_unknown_needle(String s, String needle) { + int index = s.indexOf(needle); + if (index > -1) { + return "Found needle \"" + needle + "\" that is spanning the end of the string: " + s + "."; + } + return null; + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { ""); + if (index > -1) { + return "Found needle \"\" that is spanning the end of the string: " + s + "."; + } + return null; + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "<" }) + static String indexOf_match_spans_end_of_string_imm2_needle(String s) { + int index = s.indexOf(" -1) { + return "Found needle \"0 + { + // check first character optimization + assertEquals(1, asmStringCompareTo("5", "4"), + "TestOther.asmStringCompareTo(\"5\", \"4\")"); + + // check real comparisons + assertEquals(1, asmStringCompareTo("diff5", "diff4"), + "TestOther.asmStringCompareTo(\"diff5\", \"diff4\")"); + assertEquals(10, asmStringCompareTo("123456789A", ""), + "TestOther.asmStringCompareTo(\"123456789A\", \"\")"); + assertEquals(10, asmStringCompareTo("ZYX123456789A", "ZYX"), + "TestOther.asmStringCompareTo(\"ZYX123456789A\", \"ZYX\")"); + } + + // very long strings (100k) + { + char[] ac = new char[(100 * 1024)]; + for (int i = 0; i < (100 * 1024); i += 315) + ac[i] = (char) ((i % 12) + 'a'); + char[] bc = new char[(100 * 1024)]; + for (int i = 0; i < (100 * 1024); i += 315) + bc[i] = (char) ((i % 12) + 'a'); + + ac[(100 * 1024) - 1] = '2'; + bc[(100 * 1024) - 1] = '2'; + String a1 = new String(ac); + String b1 = new String(bc); + assertEquals(0, asmStringCompareTo(a1, b1), + "TestOther.asmStringCompareTo(very_long_strings_1)"); + + ac[(100 * 1024) - 1] = 'X'; + bc[(100 * 1024) - 1] = 'Z'; + String a2 = new String(ac); + String b2 = new String(bc); + assertEquals(-2, asmStringCompareTo(a2, b2), + "TestOther.asmStringCompareTo(very_long_strings_2)"); + } + + // very very long strings (2M) + { + char[] ac = new char[(2 * 1024 * 1024)]; + for (int i = 0; i < (2 * 1024 * 1024); i += 315) + ac[i] = (char) ((i % 12) + 'a'); + char[] bc = new char[(2 * 1024 * 1024)]; + for (int i = 0; i < (2 * 1024 * 1024); i += 315) + bc[i] = (char) ((i % 12) + 'a'); + + ac[(2 * 1024 * 1024) - 1] = '3'; + bc[(2 * 1024 * 1024) - 1] = '3'; + String a1 = new String(ac); + String b1 = new String(bc); + assertEquals(0, asmStringCompareTo(a1, b1), + "TestOther.asmStringCompareTo(very_very_long_strings_1)"); + + ac[(2 * 1024 * 1024) - 1] = 'W'; + bc[(2 * 1024 * 1024) - 1] = 'Z'; + String a2 = new String(ac); + String b2 = new String(bc); + assertEquals(-3, asmStringCompareTo(a2, b2), + "TestOther.asmStringCompareTo(very_very_long_strings_2)"); + } + } + + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "abc", "abcd" }) + public static boolean asmStringEquals(String a, String b) { + return a.equals(b); + } + + static String a1 = "abcd"; + static String b1 = "abcd"; + static final String a2 = "1234"; + static final String b2 = "1234"; + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1) + public static boolean asmStringEqualsConst() { + boolean ret = a1.equals(b1); + ret &= a2.equals(b2); + ret &= !a2.equals(b1); + ret &= "ABCD".equals("ABCD"); + return ret; + } + + + @Test(role = Role.TEST_ENTRY) + public static void test_asmStringEquals() { + // null + { + assertFalse(asmStringEquals("not null", null), + "TestOther.asmStringEquals(\"not null\", null)"); + } + + // true + { + // check constant optimization + assertTrue(asmStringEqualsConst(), + "TestOther.asmStringEqualsConst(\"\", \"\")"); + + // check length 0 optimization + assertTrue(asmStringEquals("", ""), + "TestOther.asmStringEquals(\"\", \"\")"); + + // check first character optimization + assertTrue(asmStringEquals("A", "A"), + "TestOther.asmStringEquals(\"A\", \"A\")"); + + // check real comparisons + assertTrue(asmStringEquals(new String("eq") + new String("ual"), "equal"), + "TestOther.asmStringEquals(\"equal\", \"equal\")"); + assertTrue(asmStringEquals("textABC", "textABC"), + "TestOther.asmStringEquals(\"textABC\", \"textABC\")"); + assertTrue(asmStringEquals(new String("abcdefgh01234") + + new String("56abcdefgh0123456abcdefgh0123456"), + "abcdefgh0123456abcdefgh0123456abcdefgh0123456"), + "TestOther.asmStringEquals(\"abcdefgh0123456abcdefgh0123456abcdefgh0123456\", " + + "\"abcdefgh0123456abcdefgh0123456abcdefgh0123456\")"); + } + } + +} diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java index 884295cf77e..51481e87bb4 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -30,7 +30,6 @@ * sun.hotspot.WhiteBox$WhiteBoxPermission * java.lang.invoke.RedefineTest * Agent - * jdk.test.lib.Asserts * @run main Agent agent.jar java.lang.invoke.RedefineTest * @run main/othervm -Xbootclasspath/a:. -javaagent:agent.jar * -XX:+IgnoreUnrecognizedVMOptions diff --git a/hotspot/test/compiler/jvmci/code/CodeInstallationTest.java b/hotspot/test/compiler/jvmci/code/CodeInstallationTest.java index 7ef8ab6c01a..aa0899ed256 100644 --- a/hotspot/test/compiler/jvmci/code/CodeInstallationTest.java +++ b/hotspot/test/compiler/jvmci/code/CodeInstallationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,12 +27,12 @@ import java.lang.reflect.Method; import jdk.vm.ci.amd64.AMD64; import jdk.vm.ci.code.Architecture; import jdk.vm.ci.code.CodeCacheProvider; -import jdk.vm.ci.code.CompilationResult; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.code.TargetDescription; +import jdk.vm.ci.hotspot.HotSpotCompiledCode; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.meta.ConstantReflectionProvider; import jdk.vm.ci.meta.MetaAccessProvider; -import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.runtime.JVMCI; import jdk.vm.ci.runtime.JVMCIBackend; import jdk.vm.ci.sparc.SPARC; @@ -65,12 +65,12 @@ public class CodeInstallationTest { void compile(TestAssembler asm); } - private TestAssembler createAssembler(CompilationResult result) { + private TestAssembler createAssembler() { Architecture arch = codeCache.getTarget().arch; if (arch instanceof AMD64) { - return new AMD64TestAssembler(result, codeCache); + return new AMD64TestAssembler(codeCache); } else if (arch instanceof SPARC) { - return new SPARCTestAssembler(result, codeCache); + return new SPARCTestAssembler(codeCache); } else { Assert.fail("unsupported architecture"); return null; @@ -87,17 +87,14 @@ public class CodeInstallationTest { } protected void test(TestCompiler compiler, Method method, Object... args) { - CompilationResult result = new CompilationResult(method.getName()); - TestAssembler asm = createAssembler(result); + HotSpotResolvedJavaMethod resolvedMethod = (HotSpotResolvedJavaMethod) metaAccess.lookupJavaMethod(method); + TestAssembler asm = createAssembler(); asm.emitPrologue(); compiler.compile(asm); - asm.finish(); - result.close(); - - ResolvedJavaMethod resolvedMethod = metaAccess.lookupJavaMethod(method); - InstalledCode installed = codeCache.addCode(resolvedMethod, result, null, null); + HotSpotCompiledCode code = asm.finish(resolvedMethod); + InstalledCode installed = codeCache.addCode(resolvedMethod, code, null, null); try { Object expected = method.invoke(null, args); diff --git a/hotspot/test/compiler/jvmci/code/DataPatchTest.java b/hotspot/test/compiler/jvmci/code/DataPatchTest.java index 42bf40c1af4..af438a306bf 100644 --- a/hotspot/test/compiler/jvmci/code/DataPatchTest.java +++ b/hotspot/test/compiler/jvmci/code/DataPatchTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -30,9 +30,8 @@ package compiler.jvmci.code; -import jdk.vm.ci.code.CompilationResult.DataSectionReference; -import jdk.vm.ci.code.DataSection.Data; import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.site.DataSectionReference; import jdk.vm.ci.hotspot.HotSpotConstant; import jdk.vm.ci.hotspot.HotSpotVMConfig; import jdk.vm.ci.meta.ResolvedJavaType; @@ -53,12 +52,11 @@ public class DataPatchTest extends CodeInstallationTest { test(compiler, getMethod("getConstClass")); } - @Test public void testInlineObject() { test(asm -> { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); - HotSpotConstant c = (HotSpotConstant) type.getJavaClass(); + HotSpotConstant c = (HotSpotConstant) constantReflection.asJavaClass(type); Register ret = asm.emitLoadPointer(c); asm.emitPointerRet(ret); }); @@ -69,7 +67,7 @@ public class DataPatchTest extends CodeInstallationTest { Assume.assumeTrue(HotSpotVMConfig.config().useCompressedOops); test(asm -> { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); - HotSpotConstant c = (HotSpotConstant) type.getJavaClass(); + HotSpotConstant c = (HotSpotConstant) constantReflection.asJavaClass(type); Register compressed = asm.emitLoadPointer((HotSpotConstant) c.compress()); Register ret = asm.emitUncompressPointer(compressed, HotSpotVMConfig.config().narrowOopBase, HotSpotVMConfig.config().narrowOopShift); asm.emitPointerRet(ret); @@ -80,9 +78,8 @@ public class DataPatchTest extends CodeInstallationTest { public void testDataSectionReference() { test(asm -> { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); - HotSpotConstant c = (HotSpotConstant) type.getJavaClass(); - Data data = codeCache.createDataItem(c); - DataSectionReference ref = asm.result.getDataSection().insertData(data); + HotSpotConstant c = (HotSpotConstant) constantReflection.asJavaClass(type); + DataSectionReference ref = asm.emitDataItem(c); Register ret = asm.emitLoadPointer(ref); asm.emitPointerRet(ret); }); @@ -93,10 +90,9 @@ public class DataPatchTest extends CodeInstallationTest { Assume.assumeTrue(HotSpotVMConfig.config().useCompressedOops); test(asm -> { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); - HotSpotConstant c = (HotSpotConstant) type.getJavaClass(); + HotSpotConstant c = (HotSpotConstant) constantReflection.asJavaClass(type); HotSpotConstant cCompressed = (HotSpotConstant) c.compress(); - Data data = codeCache.createDataItem(cCompressed); - DataSectionReference ref = asm.result.getDataSection().insertData(data); + DataSectionReference ref = asm.emitDataItem(cCompressed); Register compressed = asm.emitLoadNarrowPointer(ref); Register ret = asm.emitUncompressPointer(compressed, HotSpotVMConfig.config().narrowOopBase, HotSpotVMConfig.config().narrowOopShift); asm.emitPointerRet(ret); @@ -107,7 +103,7 @@ public class DataPatchTest extends CodeInstallationTest { public void testInlineMetadata() { test(asm -> { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); - Register klass = asm.emitLoadPointer((HotSpotConstant) type.getObjectHub()); + Register klass = asm.emitLoadPointer((HotSpotConstant) constantReflection.asObjectHub(type)); Register ret = asm.emitLoadPointer(klass, HotSpotVMConfig.config().classMirrorOffset); asm.emitPointerRet(ret); }); @@ -118,7 +114,7 @@ public class DataPatchTest extends CodeInstallationTest { Assume.assumeTrue(HotSpotVMConfig.config().useCompressedClassPointers); test(asm -> { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); - HotSpotConstant hub = (HotSpotConstant) type.getObjectHub(); + HotSpotConstant hub = (HotSpotConstant) constantReflection.asObjectHub(type); Register narrowKlass = asm.emitLoadPointer((HotSpotConstant) hub.compress()); Register klass = asm.emitUncompressPointer(narrowKlass, HotSpotVMConfig.config().narrowKlassBase, HotSpotVMConfig.config().narrowKlassShift); Register ret = asm.emitLoadPointer(klass, HotSpotVMConfig.config().classMirrorOffset); @@ -130,9 +126,8 @@ public class DataPatchTest extends CodeInstallationTest { public void testMetadataInDataSection() { test(asm -> { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); - HotSpotConstant hub = (HotSpotConstant) type.getObjectHub(); - Data data = codeCache.createDataItem(hub); - DataSectionReference ref = asm.result.getDataSection().insertData(data); + HotSpotConstant hub = (HotSpotConstant) constantReflection.asObjectHub(type); + DataSectionReference ref = asm.emitDataItem(hub); Register klass = asm.emitLoadPointer(ref); Register ret = asm.emitLoadPointer(klass, HotSpotVMConfig.config().classMirrorOffset); asm.emitPointerRet(ret); @@ -144,10 +139,9 @@ public class DataPatchTest extends CodeInstallationTest { Assume.assumeTrue(HotSpotVMConfig.config().useCompressedClassPointers); test(asm -> { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); - HotSpotConstant hub = (HotSpotConstant) type.getObjectHub(); + HotSpotConstant hub = (HotSpotConstant) constantReflection.asObjectHub(type); HotSpotConstant narrowHub = (HotSpotConstant) hub.compress(); - Data data = codeCache.createDataItem(narrowHub); - DataSectionReference ref = asm.result.getDataSection().insertData(data); + DataSectionReference ref = asm.emitDataItem(narrowHub); Register narrowKlass = asm.emitLoadNarrowPointer(ref); Register klass = asm.emitUncompressPointer(narrowKlass, HotSpotVMConfig.config().narrowKlassBase, HotSpotVMConfig.config().narrowKlassShift); Register ret = asm.emitLoadPointer(klass, HotSpotVMConfig.config().classMirrorOffset); diff --git a/hotspot/test/compiler/jvmci/code/InterpreterFrameSizeTest.java b/hotspot/test/compiler/jvmci/code/InterpreterFrameSizeTest.java new file mode 100644 index 00000000000..9f5e9cfe106 --- /dev/null +++ b/hotspot/test/compiler/jvmci/code/InterpreterFrameSizeTest.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.code.InterpreterFrameSizeTest + */ + +package compiler.jvmci.code; + +import java.lang.reflect.Method; + +import jdk.vm.ci.code.BytecodeFrame; +import jdk.vm.ci.meta.JavaKind; +import jdk.vm.ci.meta.JavaValue; +import jdk.vm.ci.meta.ResolvedJavaMethod; + +import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; + +import org.junit.Assert; +import org.junit.Test; + +public class InterpreterFrameSizeTest extends CodeInstallationTest { + + HotSpotCodeCacheProvider hotspotCodeCache() { + return (HotSpotCodeCacheProvider) codeCache; + } + + @Test + public void testNull() { + try { + hotspotCodeCache().interpreterFrameSize(null); + } catch (NullPointerException npe) { + System.out.println("threw NPE as expected"); + return; + } + Assert.fail("expected NullPointerException"); + } + + @Test + public void test() { + ResolvedJavaMethod resolvedMethod = metaAccess.lookupJavaMethod(getMethod("testNull")); + + int bci = 0; + int numLocals = resolvedMethod.getMaxLocals(); + int numStack = 0; + JavaValue[] values = new JavaValue[numLocals]; + JavaKind[] slotKinds = new JavaKind[numLocals]; + BytecodeFrame frame = new BytecodeFrame(null, resolvedMethod, bci, false, false, values, slotKinds, numLocals, numStack, 0); + int size = hotspotCodeCache().interpreterFrameSize(frame); + System.out.println("Frame size is " + size + " bytes"); + if (size <= 0) { + Assert.fail("expected non-zero result"); + } + } +} diff --git a/hotspot/test/compiler/jvmci/code/SimpleDebugInfoTest.java b/hotspot/test/compiler/jvmci/code/SimpleDebugInfoTest.java index dffd336d2a8..041a184bc16 100644 --- a/hotspot/test/compiler/jvmci/code/SimpleDebugInfoTest.java +++ b/hotspot/test/compiler/jvmci/code/SimpleDebugInfoTest.java @@ -217,7 +217,7 @@ public class SimpleDebugInfoTest extends DebugInfoTest { public void testConstObject() { ResolvedJavaType type = metaAccess.lookupJavaType(objectOnStack()); DebugInfoCompiler compiler = (asm, values) -> { - values[0] = type.getJavaClass(); + values[0] = constantReflection.asJavaClass(type); return null; }; testObjectOnStack(compiler); @@ -228,7 +228,7 @@ public class SimpleDebugInfoTest extends DebugInfoTest { public void testRegObject() { ResolvedJavaType type = metaAccess.lookupJavaType(objectOnStack()); DebugInfoCompiler compiler = (asm, values) -> { - Register reg = asm.emitLoadPointer((HotSpotConstant) type.getJavaClass()); + Register reg = asm.emitLoadPointer((HotSpotConstant) constantReflection.asJavaClass(type)); values[0] = reg.asValue(target.getLIRKind(JavaKind.Object)); return null; }; @@ -240,7 +240,7 @@ public class SimpleDebugInfoTest extends DebugInfoTest { public void testStackObject() { ResolvedJavaType type = metaAccess.lookupJavaType(objectOnStack()); DebugInfoCompiler compiler = (asm, values) -> { - Register reg = asm.emitLoadPointer((HotSpotConstant) type.getJavaClass()); + Register reg = asm.emitLoadPointer((HotSpotConstant) constantReflection.asJavaClass(type)); values[0] = asm.emitPointerToStack(reg); return null; }; @@ -253,7 +253,7 @@ public class SimpleDebugInfoTest extends DebugInfoTest { Assume.assumeTrue(HotSpotVMConfig.config().useCompressedOops); ResolvedJavaType type = metaAccess.lookupJavaType(objectOnStack()); DebugInfoCompiler compiler = (asm, values) -> { - HotSpotConstant wide = (HotSpotConstant) type.getJavaClass(); + HotSpotConstant wide = (HotSpotConstant) constantReflection.asJavaClass(type); Register reg = asm.emitLoadPointer((HotSpotConstant) wide.compress()); values[0] = reg.asValue(asm.narrowOopKind); return null; @@ -267,7 +267,7 @@ public class SimpleDebugInfoTest extends DebugInfoTest { Assume.assumeTrue(HotSpotVMConfig.config().useCompressedOops); ResolvedJavaType type = metaAccess.lookupJavaType(objectOnStack()); DebugInfoCompiler compiler = (asm, values) -> { - HotSpotConstant wide = (HotSpotConstant) type.getJavaClass(); + HotSpotConstant wide = (HotSpotConstant) constantReflection.asJavaClass(type); Register reg = asm.emitLoadPointer((HotSpotConstant) wide.compress()); values[0] = asm.emitNarrowPointerToStack(reg); return null; diff --git a/hotspot/test/compiler/jvmci/code/TestAssembler.java b/hotspot/test/compiler/jvmci/code/TestAssembler.java index 520e19b0e32..4ed5b938dcd 100644 --- a/hotspot/test/compiler/jvmci/code/TestAssembler.java +++ b/hotspot/test/compiler/jvmci/code/TestAssembler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -25,17 +25,30 @@ package compiler.jvmci.code; import java.nio.ByteBuffer; import java.nio.ByteOrder; +import java.util.ArrayList; import java.util.Arrays; import jdk.vm.ci.code.CodeCacheProvider; -import jdk.vm.ci.code.CompilationResult; -import jdk.vm.ci.code.CompilationResult.DataSectionReference; import jdk.vm.ci.code.DebugInfo; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.StackSlot; +import jdk.vm.ci.code.site.ConstantReference; +import jdk.vm.ci.code.site.DataPatch; +import jdk.vm.ci.code.site.DataSectionReference; +import jdk.vm.ci.code.site.Infopoint; +import jdk.vm.ci.code.site.InfopointReason; +import jdk.vm.ci.code.site.Reference; +import jdk.vm.ci.code.site.Site; +import jdk.vm.ci.hotspot.HotSpotCompiledCode; +import jdk.vm.ci.hotspot.HotSpotCompiledCode.Comment; +import jdk.vm.ci.hotspot.HotSpotCompiledNmethod; import jdk.vm.ci.hotspot.HotSpotConstant; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; +import jdk.vm.ci.meta.Assumptions.Assumption; import jdk.vm.ci.meta.LIRKind; import jdk.vm.ci.meta.PlatformKind; +import jdk.vm.ci.meta.ResolvedJavaMethod; +import jdk.vm.ci.meta.VMConstant; /** * Simple assembler used by the code installation tests. @@ -49,6 +62,7 @@ public abstract class TestAssembler { /** * Emit code to grow the stack frame. + * * @param size the size in bytes that the stack should grow */ public abstract void emitGrowStack(int size); @@ -84,18 +98,20 @@ public abstract class TestAssembler { public abstract Register emitLoadFloat(float value); /** - * Emit code to load a constant oop or metaspace pointer to a register. - * The pointer may be wide or narrow, depending on {@link HotSpotConstant#isCompressed() c.isCompressed()}. + * Emit code to load a constant oop or metaspace pointer to a register. The pointer may be wide + * or narrow, depending on {@link HotSpotConstant#isCompressed() c.isCompressed()}. */ public abstract Register emitLoadPointer(HotSpotConstant c); /** - * Emit code to load a wide pointer from the {@link DataSection} to a register. + * Emit code to load a wide pointer from the {@link HotSpotCompiledCode#dataSection} to a + * register. */ public abstract Register emitLoadPointer(DataSectionReference ref); /** - * Emit code to load a narrow pointer from the {@link DataSection} to a register. + * Emit code to load a narrow pointer from the {@link HotSpotCompiledCode#dataSection} to a + * register. */ public abstract Register emitLoadNarrowPointer(DataSectionReference ref); @@ -149,14 +165,13 @@ public abstract class TestAssembler { */ public abstract void emitTrap(DebugInfo info); - protected int position() { - return data.position(); - } - - public final CompilationResult result; public final LIRKind narrowOopKind; - private ByteBuffer data; + protected final Buffer code; + protected final Buffer data; + private final ArrayList sites; + private final ArrayList dataPatches; + protected final CodeCacheProvider codeCache; private final Register[] registers; @@ -166,11 +181,14 @@ public abstract class TestAssembler { private int stackAlignment; private int curStackSlot; - protected TestAssembler(CompilationResult result, CodeCacheProvider codeCache, int initialFrameSize, int stackAlignment, PlatformKind narrowOopKind, Register... registers) { - this.result = result; + protected TestAssembler(CodeCacheProvider codeCache, int initialFrameSize, int stackAlignment, PlatformKind narrowOopKind, Register... registers) { this.narrowOopKind = LIRKind.reference(narrowOopKind); - this.data = ByteBuffer.allocate(32).order(ByteOrder.nativeOrder()); + this.code = new Buffer(); + this.data = new Buffer(); + this.sites = new ArrayList<>(); + this.dataPatches = new ArrayList<>(); + this.codeCache = codeCache; this.registers = registers; @@ -198,38 +216,96 @@ public abstract class TestAssembler { return StackSlot.get(kind, -curStackSlot, true); } - public void finish() { - result.setTotalFrameSize(frameSize); - result.setTargetCode(data.array(), data.position()); + protected void recordImplicitException(DebugInfo info) { + sites.add(new Infopoint(code.position(), info, InfopointReason.IMPLICIT_EXCEPTION)); } - private void ensureSize(int length) { - if (length >= data.limit()) { - byte[] newBuf = Arrays.copyOf(data.array(), length * 4); - ByteBuffer newData = ByteBuffer.wrap(newBuf); - newData.order(data.order()); - newData.position(data.position()); - data = newData; + protected void recordDataPatchInCode(Reference ref) { + sites.add(new DataPatch(code.position(), ref)); + } + + protected void recordDataPatchInData(Reference ref) { + dataPatches.add(new DataPatch(data.position(), ref)); + } + + public DataSectionReference emitDataItem(HotSpotConstant c) { + DataSectionReference ref = new DataSectionReference(); + ref.setOffset(data.position()); + + recordDataPatchInData(new ConstantReference((VMConstant) c)); + if (c.isCompressed()) { + data.emitInt(0xDEADDEAD); + } else { + data.emitLong(0xDEADDEADDEADDEADL); + } + + return ref; + } + + public HotSpotCompiledCode finish(HotSpotResolvedJavaMethod method) { + int id = method.allocateCompileId(0); + byte[] finishedCode = code.finish(); + Site[] finishedSites = sites.toArray(new Site[0]); + byte[] finishedData = data.finish(); + DataPatch[] finishedDataPatches = dataPatches.toArray(new DataPatch[0]); + return new HotSpotCompiledNmethod(method.getName(), finishedCode, finishedCode.length, finishedSites, new Assumption[0], new ResolvedJavaMethod[]{method}, new Comment[0], finishedData, 16, + finishedDataPatches, false, frameSize, 0, method, 0, id, 0L, false); + } + + protected static class Buffer { + + private ByteBuffer data = ByteBuffer.allocate(32).order(ByteOrder.nativeOrder()); + + private void ensureSize(int length) { + if (length >= data.limit()) { + byte[] newBuf = Arrays.copyOf(data.array(), length * 4); + ByteBuffer newData = ByteBuffer.wrap(newBuf); + newData.order(data.order()); + newData.position(data.position()); + data = newData; + } + } + + public int position() { + return data.position(); + } + + public void emitByte(int b) { + ensureSize(data.position() + 1); + data.put((byte) (b & 0xFF)); + } + + public void emitShort(int b) { + ensureSize(data.position() + 2); + data.putShort((short) b); + } + + public void emitInt(int b) { + ensureSize(data.position() + 4); + data.putInt(b); + } + + public void emitLong(long b) { + ensureSize(data.position() + 8); + data.putLong(b); + } + + public void emitFloat(float f) { + ensureSize(data.position() + 4); + data.putFloat(f); + } + + public void align(int alignment) { + int pos = data.position(); + int misaligned = pos % alignment; + if (misaligned != 0) { + pos += alignment - misaligned; + data.position(pos); + } + } + + private byte[] finish() { + return Arrays.copyOf(data.array(), data.position()); } } - - protected void emitByte(int b) { - ensureSize(data.position() + 1); - data.put((byte) (b & 0xFF)); - } - - protected void emitShort(int b) { - ensureSize(data.position() + 2); - data.putShort((short) b); - } - - protected void emitInt(int b) { - ensureSize(data.position() + 4); - data.putInt(b); - } - - protected void emitLong(long b) { - ensureSize(data.position() + 8); - data.putLong(b); - } } diff --git a/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java b/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java index efd001c18d4..c67192674a2 100644 --- a/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java +++ b/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -26,17 +26,13 @@ package compiler.jvmci.code.amd64; import jdk.vm.ci.amd64.AMD64; import jdk.vm.ci.amd64.AMD64Kind; import jdk.vm.ci.code.CodeCacheProvider; -import jdk.vm.ci.code.CompilationResult; -import jdk.vm.ci.code.CompilationResult.ConstantReference; -import jdk.vm.ci.code.CompilationResult.DataSectionReference; -import jdk.vm.ci.code.DataSection.Data; import jdk.vm.ci.code.DebugInfo; -import jdk.vm.ci.code.InfopointReason; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.StackSlot; -import jdk.vm.ci.code.CallingConvention.Type; +import jdk.vm.ci.code.site.ConstantReference; +import jdk.vm.ci.code.site.DataSectionReference; +import jdk.vm.ci.hotspot.HotSpotCallingConventionType; import jdk.vm.ci.hotspot.HotSpotConstant; -import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.LIRKind; import jdk.vm.ci.meta.VMConstant; @@ -45,88 +41,112 @@ import compiler.jvmci.code.TestAssembler; public class AMD64TestAssembler extends TestAssembler { - public AMD64TestAssembler(CompilationResult result, CodeCacheProvider codeCache) { - super(result, codeCache, 16, 16, AMD64Kind.DWORD, AMD64.rax, AMD64.rcx, AMD64.rdi, AMD64.r8, AMD64.r9, AMD64.r10); + public AMD64TestAssembler(CodeCacheProvider codeCache) { + super(codeCache, 16, 16, AMD64Kind.DWORD, AMD64.rax, AMD64.rcx, AMD64.rdi, AMD64.r8, AMD64.r9, AMD64.r10); } + private void emitFatNop() { + // 5 byte NOP: + // NOP DWORD ptr [EAX + EAX*1 + 00H] + code.emitByte(0x0F); + code.emitByte(0x1F); + code.emitByte(0x44); + code.emitByte(0x00); + code.emitByte(0x00); + } + + @Override public void emitPrologue() { - emitByte(0x50 | AMD64.rbp.encoding); // PUSH rbp - emitMove(true, AMD64.rbp, AMD64.rsp); // MOV rbp, rsp + // WARNING: Initial instruction MUST be 5 bytes or longer so that + // NativeJump::patch_verified_entry will be able to patch out the entry + // code safely. + emitFatNop(); + code.emitByte(0x50 | AMD64.rbp.encoding); // PUSH rbp + emitMove(true, AMD64.rbp, AMD64.rsp); // MOV rbp, rsp } + @Override public void emitGrowStack(int size) { // SUB rsp, size - emitByte(0x48); - emitByte(0x81); - emitByte(0xEC); - emitInt(size); + code.emitByte(0x48); + code.emitByte(0x81); + code.emitByte(0xEC); + code.emitInt(size); } + @Override public Register emitIntArg0() { - return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCall, JavaKind.Int)[0]; + return codeCache.getRegisterConfig().getCallingConventionRegisters(HotSpotCallingConventionType.JavaCall, JavaKind.Int)[0]; } + @Override public Register emitIntArg1() { - return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCall, JavaKind.Int)[1]; + return codeCache.getRegisterConfig().getCallingConventionRegisters(HotSpotCallingConventionType.JavaCall, JavaKind.Int)[1]; } private void emitREX(boolean w, int r, int x, int b) { int wrxb = (w ? 0x08 : 0) | ((r >> 3) << 2) | ((x >> 3) << 1) | (b >> 3); if (wrxb != 0) { - emitByte(0x40 | wrxb); + code.emitByte(0x40 | wrxb); } } private void emitModRMReg(boolean w, int opcode, int r, int m) { emitREX(w, r, 0, m); - emitByte((byte) opcode); - emitByte((byte) 0xC0 | ((r & 0x7) << 3) | (m & 0x7)); + code.emitByte((byte) opcode); + code.emitByte((byte) 0xC0 | ((r & 0x7) << 3) | (m & 0x7)); } private void emitModRMMemory(boolean w, int opcode, int r, int b, int offset) { emitREX(w, r, 0, b); - emitByte((byte) opcode); - emitByte((byte) 0x80 | ((r & 0x7) << 3) | (b & 0x7)); - emitInt(offset); + code.emitByte((byte) opcode); + code.emitByte((byte) 0x80 | ((r & 0x7) << 3) | (b & 0x7)); + code.emitInt(offset); } + @Override public Register emitLoadInt(int c) { Register ret = newRegister(); emitREX(false, 0, 0, ret.encoding); - emitByte(0xB8 | (ret.encoding & 0x7)); // MOV r32, imm32 - emitInt(c); + code.emitByte(0xB8 | (ret.encoding & 0x7)); // MOV r32, imm32 + code.emitInt(c); return ret; } + @Override public Register emitLoadLong(long c) { Register ret = newRegister(); emitREX(true, 0, 0, ret.encoding); - emitByte(0xB8 | (ret.encoding & 0x7)); // MOV r64, imm64 - emitLong(c); + code.emitByte(0xB8 | (ret.encoding & 0x7)); // MOV r64, imm64 + code.emitLong(c); return ret; } + @Override public Register emitLoadFloat(float c) { - Data data = codeCache.createDataItem(JavaConstant.forFloat(c)); - DataSectionReference ref = result.getDataSection().insertData(data); - result.recordDataPatch(position(), ref); + DataSectionReference ref = new DataSectionReference(); + ref.setOffset(data.position()); + data.emitFloat(c); + + recordDataPatchInCode(ref); Register ret = AMD64.xmm0; emitREX(false, ret.encoding, 0, 0); - emitByte(0xF3); - emitByte(0x0F); - emitByte(0x10); // MOVSS xmm1, xmm2/m32 - emitByte(0x05 | ((ret.encoding & 0x7) << 3)); // xmm, [rip+offset] - emitInt(0xDEADDEAD); + code.emitByte(0xF3); + code.emitByte(0x0F); + code.emitByte(0x10); // MOVSS xmm1, xmm2/m32 + code.emitByte(0x05 | ((ret.encoding & 0x7) << 3)); // xmm, [rip+offset] + code.emitInt(0xDEADDEAD); return ret; } + @Override public Register emitLoadPointer(HotSpotConstant c) { - result.recordDataPatch(position(), new ConstantReference((VMConstant) c)); + recordDataPatchInCode(new ConstantReference((VMConstant) c)); if (c.isCompressed()) { Register ret = newRegister(); emitREX(false, 0, 0, ret.encoding); - emitByte(0xB8 | (ret.encoding & 0x7)); // MOV r32, imm32 - emitInt(0xDEADDEAD); + code.emitByte(0xB8 | (ret.encoding & 0x7)); // MOV r32, imm32 + code.emitInt(0xDEADDEAD); return ret; } else { return emitLoadLong(0xDEADDEADDEADDEADl); @@ -134,68 +154,77 @@ public class AMD64TestAssembler extends TestAssembler { } private Register emitLoadPointer(DataSectionReference ref, boolean narrow) { - result.recordDataPatch(position(), ref); + recordDataPatchInCode(ref); Register ret = newRegister(); emitREX(!narrow, ret.encoding, 0, 0); - emitByte(0x8B); // MOV r64,r/m64 - emitByte(0x05 | ((ret.encoding & 0x7) << 3)); // r64, [rip+offset] - emitInt(0xDEADDEAD); + code.emitByte(0x8B); // MOV r64,r/m64 + code.emitByte(0x05 | ((ret.encoding & 0x7) << 3)); // r64, [rip+offset] + code.emitInt(0xDEADDEAD); return ret; } + @Override public Register emitLoadPointer(DataSectionReference ref) { return emitLoadPointer(ref, false); } + @Override public Register emitLoadNarrowPointer(DataSectionReference ref) { return emitLoadPointer(ref, true); } + @Override public Register emitLoadPointer(Register b, int offset) { Register ret = newRegister(); emitModRMMemory(true, 0x8B, ret.encoding, b.encoding, offset); // MOV r64,r/m64 return ret; } + @Override public StackSlot emitIntToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.value(AMD64Kind.DWORD)); emitModRMMemory(false, 0x89, a.encoding, AMD64.rbp.encoding, ret.getRawOffset() + 16); // MOV r/m32,r32 return ret; } + @Override public StackSlot emitLongToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.value(AMD64Kind.QWORD)); emitModRMMemory(true, 0x89, a.encoding, AMD64.rbp.encoding, ret.getRawOffset() + 16); // MOV r/m64,r64 return ret; } + @Override public StackSlot emitFloatToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.value(AMD64Kind.SINGLE)); emitREX(false, a.encoding, 0, 0); - emitByte(0xF3); - emitByte(0x0F); - emitByte(0x11); // MOVSS xmm2/m32, xmm1 - emitByte(0x85 | ((a.encoding & 0x7) << 3)); // [rbp+offset] - emitInt(ret.getRawOffset() + 16); + code.emitByte(0xF3); + code.emitByte(0x0F); + code.emitByte(0x11); // MOVSS xmm2/m32, xmm1 + code.emitByte(0x85 | ((a.encoding & 0x7) << 3)); // [rbp+offset] + code.emitInt(ret.getRawOffset() + 16); return ret; } + @Override public StackSlot emitPointerToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.reference(AMD64Kind.QWORD)); emitModRMMemory(true, 0x89, a.encoding, AMD64.rbp.encoding, ret.getRawOffset() + 16); // MOV r/m64,r64 return ret; } + @Override public StackSlot emitNarrowPointerToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.reference(AMD64Kind.DWORD)); emitModRMMemory(false, 0x89, a.encoding, AMD64.rbp.encoding, ret.getRawOffset() + 16); // MOV r/m32,r32 return ret; } + @Override public Register emitUncompressPointer(Register compressed, long base, int shift) { if (shift > 0) { emitModRMReg(true, 0xC1, 4, compressed.encoding); - emitByte(shift); + code.emitByte(shift); } if (base == 0) { return compressed; @@ -206,6 +235,7 @@ public class AMD64TestAssembler extends TestAssembler { } } + @Override public Register emitIntAdd(Register a, Register b) { emitModRMReg(false, 0x03, a.encoding, b.encoding); return a; @@ -217,26 +247,29 @@ public class AMD64TestAssembler extends TestAssembler { } } + @Override public void emitIntRet(Register a) { - emitMove(false, AMD64.rax, a); // MOV eax, ... - emitMove(true, AMD64.rsp, AMD64.rbp); // MOV rsp, rbp - emitByte(0x58 | AMD64.rbp.encoding); // POP rbp - emitByte(0xC3); // RET + emitMove(false, AMD64.rax, a); // MOV eax, ... + emitMove(true, AMD64.rsp, AMD64.rbp); // MOV rsp, rbp + code.emitByte(0x58 | AMD64.rbp.encoding); // POP rbp + code.emitByte(0xC3); // RET } + @Override public void emitPointerRet(Register a) { - emitMove(true, AMD64.rax, a); // MOV rax, ... - emitMove(true, AMD64.rsp, AMD64.rbp); // MOV rsp, rbp - emitByte(0x58 | AMD64.rbp.encoding); // POP rbp - emitByte(0xC3); // RET + emitMove(true, AMD64.rax, a); // MOV rax, ... + emitMove(true, AMD64.rsp, AMD64.rbp); // MOV rsp, rbp + code.emitByte(0x58 | AMD64.rbp.encoding); // POP rbp + code.emitByte(0xC3); // RET } + @Override public void emitTrap(DebugInfo info) { - result.recordInfopoint(position(), info, InfopointReason.IMPLICIT_EXCEPTION); + recordImplicitException(info); // MOV rax, [0] - emitByte(0x8B); - emitByte(0x04); - emitByte(0x25); - emitInt(0); + code.emitByte(0x8B); + code.emitByte(0x04); + code.emitByte(0x25); + code.emitInt(0); } } diff --git a/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java b/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java index b37ed57c77a..7b423641e18 100644 --- a/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java +++ b/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -24,17 +24,15 @@ package compiler.jvmci.code.sparc; import jdk.vm.ci.code.CodeCacheProvider; -import jdk.vm.ci.code.CompilationResult; -import jdk.vm.ci.code.CompilationResult.ConstantReference; -import jdk.vm.ci.code.CompilationResult.DataSectionReference; -import jdk.vm.ci.code.DataSection.Data; import jdk.vm.ci.code.DebugInfo; -import jdk.vm.ci.code.InfopointReason; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.StackSlot; -import jdk.vm.ci.code.CallingConvention.Type; +import jdk.vm.ci.code.site.ConstantReference; +import jdk.vm.ci.code.site.DataSectionReference; +import jdk.vm.ci.hotspot.HotSpotCallingConventionType; +import jdk.vm.ci.hotspot.HotSpotCompiledCode; import jdk.vm.ci.hotspot.HotSpotConstant; -import jdk.vm.ci.meta.JavaConstant; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.LIRKind; import jdk.vm.ci.meta.VMConstant; @@ -47,48 +45,53 @@ public class SPARCTestAssembler extends TestAssembler { private static final int MASK13 = (1 << 13) - 1; - public SPARCTestAssembler(CompilationResult result, CodeCacheProvider codeCache) { - super(result, codeCache, 0, 16, SPARCKind.WORD, SPARC.l0, SPARC.l1, SPARC.l2, SPARC.l3, SPARC.l4, SPARC.l5, SPARC.l6, SPARC.l7); + public SPARCTestAssembler(CodeCacheProvider codeCache) { + super(codeCache, 0, 16, SPARCKind.WORD, SPARC.l0, SPARC.l1, SPARC.l2, SPARC.l3, SPARC.l4, SPARC.l5, SPARC.l6, SPARC.l7); } private void emitOp2(Register rd, int op2, int imm22) { - emitInt((0b00 << 30) | (rd.encoding << 25) | (op2 << 22) | imm22); + code.emitInt((0b00 << 30) | (rd.encoding << 25) | (op2 << 22) | imm22); } private void emitOp3(int op, Register rd, int op3, Register rs1, Register rs2) { - emitInt((op << 30) | (rd.encoding << 25) | (op3 << 19) | (rs1.encoding << 14) | rs2.encoding); + code.emitInt((op << 30) | (rd.encoding << 25) | (op3 << 19) | (rs1.encoding << 14) | rs2.encoding); } private void emitOp3(int op, Register rd, int op3, Register rs1, int simm13) { - emitInt((op << 30) | (rd.encoding << 25) | (op3 << 19) | (rs1.encoding << 14) | (1 << 13) | (simm13 & MASK13)); + code.emitInt((op << 30) | (rd.encoding << 25) | (op3 << 19) | (rs1.encoding << 14) | (1 << 13) | (simm13 & MASK13)); } private void emitNop() { - emitInt(1 << 24); + code.emitInt(1 << 24); } + @Override public void emitPrologue() { emitOp3(0b10, SPARC.sp, 0b111100, SPARC.sp, -SPARC.REGISTER_SAFE_AREA_SIZE); // SAVE sp, -128, sp } @Override - public void finish() { + public HotSpotCompiledCode finish(HotSpotResolvedJavaMethod method) { frameSize += SPARC.REGISTER_SAFE_AREA_SIZE; - super.finish(); + return super.finish(method); } + @Override public void emitGrowStack(int size) { emitOp3(0b10, SPARC.sp, 0b000100, SPARC.sp, size); // SUB sp, size, sp } + @Override public Register emitIntArg0() { - return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCallee, JavaKind.Int)[0]; + return codeCache.getRegisterConfig().getCallingConventionRegisters(HotSpotCallingConventionType.JavaCallee, JavaKind.Int)[0]; } + @Override public Register emitIntArg1() { - return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCallee, JavaKind.Int)[1]; + return codeCache.getRegisterConfig().getCallingConventionRegisters(HotSpotCallingConventionType.JavaCallee, JavaKind.Int)[1]; } + @Override public Register emitLoadInt(int c) { Register ret = newRegister(); int hi = c >>> 10; @@ -104,41 +107,48 @@ public class SPARCTestAssembler extends TestAssembler { return ret; } + @Override public Register emitLoadLong(long c) { - if ((c & 0xFFFFFFFF) == c) { + if ((c & 0xFFFF_FFFFL) == c) { return emitLoadInt((int) c); } else { - Data data = codeCache.createDataItem(JavaConstant.forLong(c)); - DataSectionReference ref = result.getDataSection().insertData(data); + DataSectionReference ref = new DataSectionReference(); + data.align(8); + ref.setOffset(data.position()); + data.emitLong(c); return emitLoadPointer(ref); } } private void emitPatchableSethi(Register ret, boolean wide) { - int startPos = position(); + int startPos = code.position(); emitOp2(ret, 0b100, 0); // SETHI 0, ret if (wide) { // pad for later patching - while (position() < (startPos + 28)) { + while (code.position() < (startPos + 28)) { emitNop(); } } } + @Override public Register emitLoadFloat(float c) { - Data data = codeCache.createDataItem(JavaConstant.forFloat(c)); - DataSectionReference ref = result.getDataSection().insertData(data); + DataSectionReference ref = new DataSectionReference(); + data.align(4); + ref.setOffset(data.position()); + data.emitFloat(c); Register ptr = newRegister(); - result.recordDataPatch(position(), ref); + recordDataPatchInCode(ref); emitPatchableSethi(ptr, true); emitOp3(0b11, SPARC.f0, 0b100000, ptr, 0); // LDF [ptr+0], f0 return SPARC.f0; } + @Override public Register emitLoadPointer(HotSpotConstant c) { Register ret = newRegister(); - result.recordDataPatch(position(), new ConstantReference((VMConstant) c)); + recordDataPatchInCode(new ConstantReference((VMConstant) c)); emitPatchableSethi(ret, !c.isCompressed()); emitOp3(0b10, ret, 0b000010, ret, 0); // OR ret, 0, ret @@ -146,58 +156,67 @@ public class SPARCTestAssembler extends TestAssembler { return ret; } + @Override public Register emitLoadPointer(DataSectionReference ref) { Register ret = newRegister(); - result.recordDataPatch(position(), ref); + recordDataPatchInCode(ref); emitPatchableSethi(ret, true); emitOp3(0b11, ret, 0b001011, ret, 0); // LDX [ret+0], ret return ret; } + @Override public Register emitLoadNarrowPointer(DataSectionReference ref) { Register ret = newRegister(); - result.recordDataPatch(position(), ref); + recordDataPatchInCode(ref); emitPatchableSethi(ret, true); emitOp3(0b11, ret, 0b000000, ret, 0); // LDUW [ret+0], ret return ret; } + @Override public Register emitLoadPointer(Register b, int offset) { Register ret = newRegister(); emitOp3(0b11, ret, 0b001011, b, offset); // LDX [b+offset], ret return ret; } + @Override public StackSlot emitIntToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.value(SPARCKind.WORD)); emitOp3(0b11, a, 0b000100, SPARC.fp, ret.getRawOffset() + SPARC.STACK_BIAS); // STW a, [fp+offset] return ret; } + @Override public StackSlot emitLongToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.value(SPARCKind.XWORD)); emitOp3(0b11, a, 0b001110, SPARC.fp, ret.getRawOffset() + SPARC.STACK_BIAS); // STX a, [fp+offset] return ret; } + @Override public StackSlot emitFloatToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.value(SPARCKind.SINGLE)); emitOp3(0b11, a, 0b100100, SPARC.fp, ret.getRawOffset() + SPARC.STACK_BIAS); // STF a, [fp+offset] return ret; } + @Override public StackSlot emitPointerToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.reference(SPARCKind.XWORD)); emitOp3(0b11, a, 0b001110, SPARC.fp, ret.getRawOffset() + SPARC.STACK_BIAS); // STX a, [fp+offset] return ret; } + @Override public StackSlot emitNarrowPointerToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.reference(SPARCKind.WORD)); emitOp3(0b11, a, 0b000100, SPARC.fp, ret.getRawOffset() + SPARC.STACK_BIAS); // STW a, [fp+offset] return ret; } + @Override public Register emitUncompressPointer(Register compressed, long base, int shift) { Register ret; if (shift > 0) { @@ -215,6 +234,7 @@ public class SPARCTestAssembler extends TestAssembler { } } + @Override public Register emitIntAdd(Register a, Register b) { Register ret = newRegister(); emitOp3(0b10, ret, 0b00000, a, b); // ADD a, b, ret @@ -227,18 +247,31 @@ public class SPARCTestAssembler extends TestAssembler { } } + @Override public void emitIntRet(Register a) { emitPointerRet(a); } + @Override public void emitPointerRet(Register a) { emitMove(SPARC.i0, a); emitOp3(0b10, SPARC.g0, 0b111000, SPARC.i7, 8); // JMPL [i7+8], g0 emitOp3(0b10, SPARC.g0, 0b111101, SPARC.g0, SPARC.g0); // RESTORE g0, g0, g0 } + @Override public void emitTrap(DebugInfo info) { - result.recordInfopoint(position(), info, InfopointReason.IMPLICIT_EXCEPTION); + recordImplicitException(info); emitOp3(0b11, SPARC.g0, 0b001011, SPARC.g0, 0); // LDX [g0+0], g0 } + + @Override + public DataSectionReference emitDataItem(HotSpotConstant c) { + if (c.isCompressed()) { + data.align(4); + } else { + data.align(8); + } + return super.emitDataItem(c); + } } diff --git a/hotspot/test/compiler/jvmci/common/CompilerToVMHelper.java b/hotspot/test/compiler/jvmci/common/CompilerToVMHelper.java index b5f4574b3a0..f9602f33064 100644 --- a/hotspot/test/compiler/jvmci/common/CompilerToVMHelper.java +++ b/hotspot/test/compiler/jvmci/common/CompilerToVMHelper.java @@ -148,14 +148,6 @@ public class CompilerToVMHelper { return CTVM.getMetadata(target, compiledCode, metaData); } - public static void notifyCompilationStatistics(int id, - HotSpotResolvedJavaMethod method, boolean osr, - int processedBytecodes, long time, long timeUnitsPerSecond, - InstalledCode installedCode) { - CTVM.notifyCompilationStatistics(id, (HotSpotResolvedJavaMethodImpl) method, osr, processedBytecodes, - time, timeUnitsPerSecond, installedCode); - } - public static void resetCompilationStatistics() { CTVM.resetCompilationStatistics(); } diff --git a/hotspot/test/compiler/jvmci/common/JVMCIHelpers.java b/hotspot/test/compiler/jvmci/common/JVMCIHelpers.java index 35cece6db07..a99c0908fc5 100644 --- a/hotspot/test/compiler/jvmci/common/JVMCIHelpers.java +++ b/hotspot/test/compiler/jvmci/common/JVMCIHelpers.java @@ -25,6 +25,7 @@ package compiler.jvmci.common; import jdk.vm.ci.code.Architecture; import jdk.vm.ci.code.CompilationRequest; +import jdk.vm.ci.code.CompilationRequestResult; import jdk.vm.ci.hotspot.HotSpotVMEventListener; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.runtime.JVMCICompiler; @@ -43,8 +44,9 @@ public class JVMCIHelpers { public static class EmptyHotspotCompiler implements JVMCICompiler { @Override - public void compileMethod(CompilationRequest request) { + public CompilationRequestResult compileMethod(CompilationRequest request) { // do nothing + return CompilationRequestResult.failure("no compiler configured", true); } } diff --git a/hotspot/test/compiler/jvmci/errors/CodeInstallerTest.java b/hotspot/test/compiler/jvmci/errors/CodeInstallerTest.java index 195b7d52cd7..b06697634b2 100644 --- a/hotspot/test/compiler/jvmci/errors/CodeInstallerTest.java +++ b/hotspot/test/compiler/jvmci/errors/CodeInstallerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,12 +27,16 @@ import java.lang.reflect.Method; import jdk.vm.ci.code.Architecture; import jdk.vm.ci.code.CodeCacheProvider; -import jdk.vm.ci.code.CompilationResult; import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.site.DataPatch; +import jdk.vm.ci.code.site.Site; +import jdk.vm.ci.hotspot.HotSpotCompiledCode; +import jdk.vm.ci.hotspot.HotSpotCompiledCode.Comment; +import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; +import jdk.vm.ci.meta.Assumptions.Assumption; import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.PlatformKind; import jdk.vm.ci.meta.ResolvedJavaMethod; -import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; import jdk.vm.ci.runtime.JVMCI; import jdk.vm.ci.runtime.JVMCIBackend; @@ -67,22 +71,18 @@ public class CodeInstallerTest { dummyMethod = metaAccess.lookupJavaMethod(method); } - protected void installCode(CompilationResult result) { - result.close(); - codeCache.addCode(dummyMethod, result, null, null); - } - - protected CompilationResult createEmptyCompilationResult() { - CompilationResult ret = new CompilationResult(); - ret.setTotalFrameSize(0); - return ret; + protected void installEmptyCode(Site[] sites, Assumption[] assumptions, Comment[] comments, int dataSectionAlignment, DataPatch[] dataSectionPatches) { + HotSpotCompiledCode code = new HotSpotCompiledCode("dummyMethod", new byte[0], 0, sites, assumptions, new ResolvedJavaMethod[]{dummyMethod}, comments, new byte[8], dataSectionAlignment, + dataSectionPatches, false, 0, 0); + codeCache.addCode(dummyMethod, code, null, null); } protected Register getRegister(PlatformKind kind, int index) { + int idx = index; Register[] allRegs = arch.getAvailableValueRegisters(); for (int i = 0; i < allRegs.length; i++) { if (arch.canStoreValue(allRegs[i].getRegisterCategory(), kind)) { - if (index-- == 0) { + if (idx-- == 0) { return allRegs[i]; } } diff --git a/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java b/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java index f40dea820eb..928bd74522e 100644 --- a/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java +++ b/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -30,20 +30,18 @@ package compiler.jvmci.errors; -import static jdk.vm.ci.code.CompilationResult.ConstantReference; -import static jdk.vm.ci.code.CompilationResult.DataPatch; -import static jdk.vm.ci.code.CompilationResult.DataSectionReference; -import static jdk.vm.ci.code.CompilationResult.Infopoint; -import static jdk.vm.ci.code.CompilationResult.Reference; -import static jdk.vm.ci.code.DataSection.Data; -import static jdk.vm.ci.code.DataSection.DataBuilder; -import static jdk.vm.ci.meta.Assumptions.Assumption; - -import jdk.vm.ci.code.CompilationResult; -import jdk.vm.ci.code.InfopointReason; +import jdk.vm.ci.code.site.ConstantReference; +import jdk.vm.ci.code.site.DataPatch; +import jdk.vm.ci.code.site.DataSectionReference; +import jdk.vm.ci.code.site.Infopoint; +import jdk.vm.ci.code.site.InfopointReason; +import jdk.vm.ci.code.site.Mark; +import jdk.vm.ci.code.site.Reference; +import jdk.vm.ci.code.site.Site; import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotCompiledCode.Comment; import jdk.vm.ci.hotspot.HotSpotConstant; -import jdk.vm.ci.meta.ResolvedJavaType; +import jdk.vm.ci.meta.Assumptions.Assumption; import jdk.vm.ci.meta.VMConstant; import org.junit.Test; @@ -82,153 +80,104 @@ public class TestInvalidCompilationResult extends CodeInstallerTest { @Test(expected = JVMCIError.class) public void testInvalidAssumption() { - CompilationResult result = createEmptyCompilationResult(); - result.setAssumptions(new Assumption[]{new InvalidAssumption()}); - installCode(result); + installEmptyCode(new Site[0], new Assumption[]{new InvalidAssumption()}, new Comment[0], 16, new DataPatch[0]); } @Test(expected = JVMCIError.class) public void testInvalidAlignment() { - CompilationResult result = createEmptyCompilationResult(); - result.getDataSection().insertData(new Data(7, 1, DataBuilder.zero(1))); - installCode(result); + installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 7, new DataPatch[0]); } @Test(expected = NullPointerException.class) public void testNullDataPatchInDataSection() { - CompilationResult result = createEmptyCompilationResult(); - Data data = new Data(1, 1, (buffer, patch) -> { - patch.accept(null); - buffer.put((byte) 0); - }); - result.getDataSection().insertData(data); - installCode(result); + installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 16, new DataPatch[]{null}); } @Test(expected = NullPointerException.class) public void testNullReferenceInDataSection() { - CompilationResult result = createEmptyCompilationResult(); - Data data = new Data(1, 1, (buffer, patch) -> { - patch.accept(new DataPatch(buffer.position(), null)); - buffer.put((byte) 0); - }); - result.getDataSection().insertData(data); - installCode(result); + installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 16, new DataPatch[]{new DataPatch(0, null)}); } @Test(expected = JVMCIError.class) public void testInvalidDataSectionReference() { - CompilationResult result = createEmptyCompilationResult(); - DataSectionReference ref = result.getDataSection().insertData(new Data(1, 1, DataBuilder.zero(1))); - Data data = new Data(1, 1, (buffer, patch) -> { - patch.accept(new DataPatch(buffer.position(), ref)); - buffer.put((byte) 0); - }); - result.getDataSection().insertData(data); - installCode(result); + DataSectionReference ref = new DataSectionReference(); + ref.setOffset(0); + installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 16, new DataPatch[]{new DataPatch(0, ref)}); } @Test(expected = JVMCIError.class) public void testInvalidNarrowMethodInDataSection() { - CompilationResult result = createEmptyCompilationResult(); HotSpotConstant c = (HotSpotConstant) dummyMethod.getEncoding(); - Data data = new Data(4, 4, (buffer, patch) -> { - patch.accept(new DataPatch(buffer.position(), new ConstantReference((VMConstant) c.compress()))); - buffer.putInt(0); - }); - result.getDataSection().insertData(data); - installCode(result); + ConstantReference ref = new ConstantReference((VMConstant) c.compress()); + installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 16, new DataPatch[]{new DataPatch(0, ref)}); } @Test(expected = NullPointerException.class) public void testNullConstantInDataSection() { - CompilationResult result = createEmptyCompilationResult(); - Data data = new Data(1, 1, (buffer, patch) -> { - patch.accept(new DataPatch(buffer.position(), new ConstantReference(null))); - }); - result.getDataSection().insertData(data); - installCode(result); + ConstantReference ref = new ConstantReference(null); + installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 16, new DataPatch[]{new DataPatch(0, ref)}); } @Test(expected = JVMCIError.class) public void testInvalidConstantInDataSection() { - CompilationResult result = createEmptyCompilationResult(); - Data data = new Data(1, 1, (buffer, patch) -> { - patch.accept(new DataPatch(buffer.position(), new ConstantReference(new InvalidVMConstant()))); - }); - result.getDataSection().insertData(data); - installCode(result); + ConstantReference ref = new ConstantReference(new InvalidVMConstant()); + installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 16, new DataPatch[]{new DataPatch(0, ref)}); } @Test(expected = NullPointerException.class) public void testNullReferenceInCode() { - CompilationResult result = createEmptyCompilationResult(); - result.recordDataPatch(0, null); - installCode(result); + installEmptyCode(new Site[]{new DataPatch(0, null)}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = NullPointerException.class) public void testNullConstantInCode() { - CompilationResult result = createEmptyCompilationResult(); - result.recordDataPatch(0, new ConstantReference(null)); - installCode(result); + ConstantReference ref = new ConstantReference(null); + installEmptyCode(new Site[]{new DataPatch(0, ref)}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = JVMCIError.class) public void testInvalidConstantInCode() { - CompilationResult result = createEmptyCompilationResult(); - result.recordDataPatch(0, new ConstantReference(new InvalidVMConstant())); - installCode(result); + ConstantReference ref = new ConstantReference(new InvalidVMConstant()); + installEmptyCode(new Site[]{new DataPatch(0, ref)}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = JVMCIError.class) public void testInvalidReference() { - CompilationResult result = createEmptyCompilationResult(); - result.recordDataPatch(0, new InvalidReference()); - installCode(result); + InvalidReference ref = new InvalidReference(); + installEmptyCode(new Site[]{new DataPatch(0, ref)}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = JVMCIError.class) public void testOutOfBoundsDataSectionReference() { - CompilationResult result = createEmptyCompilationResult(); DataSectionReference ref = new DataSectionReference(); ref.setOffset(0x1000); - result.recordDataPatch(0, ref); - installCode(result); + installEmptyCode(new Site[]{new DataPatch(0, ref)}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = JVMCIError.class) public void testInvalidMark() { - CompilationResult result = createEmptyCompilationResult(); - result.recordMark(0, new Object()); - installCode(result); + installEmptyCode(new Site[]{new Mark(0, new Object())}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = JVMCIError.class) public void testInvalidMarkInt() { - CompilationResult result = createEmptyCompilationResult(); - result.recordMark(0, -1); - installCode(result); + installEmptyCode(new Site[]{new Mark(0, -1)}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = NullPointerException.class) - public void testNullInfopoint() { - CompilationResult result = createEmptyCompilationResult(); - result.addInfopoint(null); - installCode(result); + public void testNullSite() { + installEmptyCode(new Site[]{null}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = JVMCIError.class) public void testInfopointMissingDebugInfo() { - CompilationResult result = createEmptyCompilationResult(); - result.addInfopoint(new Infopoint(0, null, InfopointReason.METHOD_START)); - installCode(result); + Infopoint info = new Infopoint(0, null, InfopointReason.METHOD_START); + installEmptyCode(new Site[]{info}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = JVMCIError.class) public void testSafepointMissingDebugInfo() { - CompilationResult result = createEmptyCompilationResult(); - result.addInfopoint(new Infopoint(0, null, InfopointReason.SAFEPOINT)); - installCode(result); + Infopoint info = new Infopoint(0, null, InfopointReason.SAFEPOINT); + installEmptyCode(new Site[]{info}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } } diff --git a/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java b/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java index ede956c1b82..e95d5cea6dc 100644 --- a/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java +++ b/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -30,24 +30,26 @@ package compiler.jvmci.errors; -import static jdk.vm.ci.code.CompilationResult.Infopoint; - import jdk.vm.ci.code.BytecodeFrame; -import jdk.vm.ci.code.CompilationResult; import jdk.vm.ci.code.DebugInfo; -import jdk.vm.ci.code.InfopointReason; import jdk.vm.ci.code.Location; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.StackSlot; import jdk.vm.ci.code.VirtualObject; +import jdk.vm.ci.code.site.DataPatch; +import jdk.vm.ci.code.site.Infopoint; +import jdk.vm.ci.code.site.InfopointReason; +import jdk.vm.ci.code.site.Site; +import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotCompiledCode.Comment; import jdk.vm.ci.hotspot.HotSpotReferenceMap; +import jdk.vm.ci.meta.Assumptions.Assumption; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.JavaValue; import jdk.vm.ci.meta.LIRKind; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.Value; -import jdk.vm.ci.common.JVMCIError; import org.junit.Test; @@ -67,10 +69,7 @@ public class TestInvalidDebugInfo extends CodeInstallerTest { BytecodeFrame frame = new BytecodeFrame(null, dummyMethod, 0, false, false, values, slotKinds, locals, stack, locks); DebugInfo info = new DebugInfo(frame, vobj); info.setReferenceMap(new HotSpotReferenceMap(new Location[0], new Location[0], new int[0], 8)); - - CompilationResult result = createEmptyCompilationResult(); - result.addInfopoint(new Infopoint(0, info, InfopointReason.SAFEPOINT)); - installCode(result); + installEmptyCode(new Site[]{new Infopoint(0, info, InfopointReason.SAFEPOINT)}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = NullPointerException.class) diff --git a/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java b/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java index df0b60adb0f..f5efaf91375 100644 --- a/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java +++ b/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -30,21 +30,22 @@ package compiler.jvmci.errors; -import static jdk.vm.ci.code.CompilationResult.Infopoint; - import jdk.vm.ci.code.BytecodePosition; -import jdk.vm.ci.code.CompilationResult; import jdk.vm.ci.code.DebugInfo; -import jdk.vm.ci.code.InfopointReason; import jdk.vm.ci.code.Location; import jdk.vm.ci.code.ReferenceMap; import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.site.DataPatch; +import jdk.vm.ci.code.site.Infopoint; +import jdk.vm.ci.code.site.InfopointReason; +import jdk.vm.ci.code.site.Site; +import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotCompiledCode.Comment; import jdk.vm.ci.hotspot.HotSpotReferenceMap; import jdk.vm.ci.hotspot.HotSpotVMConfig; +import jdk.vm.ci.meta.Assumptions.Assumption; import jdk.vm.ci.meta.JavaKind; -import jdk.vm.ci.meta.LIRKind; import jdk.vm.ci.meta.PlatformKind; -import jdk.vm.ci.common.JVMCIError; import org.junit.Test; @@ -60,10 +61,7 @@ public class TestInvalidOopMap extends CodeInstallerTest { BytecodePosition pos = new BytecodePosition(null, dummyMethod, 0); DebugInfo info = new DebugInfo(pos); info.setReferenceMap(refMap); - - CompilationResult result = createEmptyCompilationResult(); - result.addInfopoint(new Infopoint(0, info, InfopointReason.SAFEPOINT)); - installCode(result); + installEmptyCode(new Site[]{new Infopoint(0, info, InfopointReason.SAFEPOINT)}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = NullPointerException.class) diff --git a/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java b/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java index a1dfa84924c..2b9d8c9332e 100644 --- a/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java +++ b/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java @@ -58,10 +58,15 @@ import compiler.jvmci.common.testcases.SimpleClass; import jdk.test.lib.Asserts; import java.lang.reflect.Method; import jdk.vm.ci.hotspot.HotSpotVMEventListener; -import jdk.vm.ci.code.CompilationResult; +import jdk.vm.ci.code.CompiledCode; import jdk.vm.ci.code.InstalledCode; +import jdk.vm.ci.code.site.DataPatch; +import jdk.vm.ci.code.site.Site; +import jdk.vm.ci.meta.Assumptions.Assumption; +import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; -import jdk.vm.ci.hotspot.HotSpotCompilationRequest; +import jdk.vm.ci.hotspot.HotSpotCompiledCode; +import jdk.vm.ci.hotspot.HotSpotCompiledCode.Comment; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; @@ -102,17 +107,15 @@ public class JvmciNotifyInstallEventTest implements HotSpotVMEventListener { } HotSpotResolvedJavaMethod method = CTVMUtilities .getResolvedMethod(SimpleClass.class, testMethod); - CompilationResult compResult = new CompilationResult(METHOD_NAME); - HotSpotCompilationRequest compRequest = new HotSpotCompilationRequest(method, -1, 0L); - // to pass sanity check of default -1 - compResult.setTotalFrameSize(0); - compResult.close(); - codeCache.installCode(compRequest, compResult, /* installedCode = */ null, /* speculationLog = */ null, + HotSpotCompiledCode compiledCode = new HotSpotCompiledCode(METHOD_NAME, new byte[0], 0, new Site[0], + new Assumption[0], new ResolvedJavaMethod[]{method}, new Comment[0], new byte[0], 16, + new DataPatch[0], false, 0, 0); + codeCache.installCode(method, compiledCode, /* installedCode = */ null, /* speculationLog = */ null, /* isDefault = */ false); Asserts.assertEQ(gotInstallNotification, 1, "Got unexpected event count after 1st install attempt"); // since "empty" compilation result is ok, a second attempt should be ok - codeCache.installCode(compRequest, compResult, /* installedCode = */ null, /* speculationLog = */ null, + codeCache.installCode(method, compiledCode, /* installedCode = */ null, /* speculationLog = */ null, /* isDefault = */ false); Asserts.assertEQ(gotInstallNotification, 2, "Got unexpected event count after 2nd install attempt"); @@ -120,7 +123,7 @@ public class JvmciNotifyInstallEventTest implements HotSpotVMEventListener { @Override public void notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider, - InstalledCode installedCode, CompilationResult compResult) { + InstalledCode installedCode, CompiledCode compiledCode) { gotInstallNotification++; } } diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java index bb3da636e2c..13dd0999fee 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java @@ -264,21 +264,37 @@ public class TestResolvedJavaMethod extends MethodUniverse { } } - @Test(timeout = 1000L) - public void getAnnotationTest() throws NoSuchMethodException { - ResolvedJavaMethod method = metaAccess.lookupJavaMethod(getClass().getDeclaredMethod("getAnnotationTest")); - Test annotation = method.getAnnotation(Test.class); - assertNotNull(annotation); - assertEquals(1000L, annotation.timeout()); + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.METHOD) + @interface TestAnnotation { + long value(); } - @Test(timeout = 1000L) + @Test + @TestAnnotation(value = 1000L) + public void getAnnotationTest() throws NoSuchMethodException { + ResolvedJavaMethod method = metaAccess.lookupJavaMethod(getClass().getDeclaredMethod("getAnnotationTest")); + TestAnnotation annotation = method.getAnnotation(TestAnnotation.class); + assertNotNull(annotation); + assertEquals(1000L, annotation.value()); + } + + @Test + @TestAnnotation(value = 1000L) public void getAnnotationsTest() throws NoSuchMethodException { ResolvedJavaMethod method = metaAccess.lookupJavaMethod(getClass().getDeclaredMethod("getAnnotationsTest")); Annotation[] annotations = method.getAnnotations(); assertNotNull(annotations); - assertEquals(1, annotations.length); - assertEquals(1000L, ((Test) annotations[0]).timeout()); + assertEquals(2, annotations.length); + TestAnnotation annotation = null; + for (Annotation a : annotations) { + if (a instanceof TestAnnotation) { + annotation = (TestAnnotation) a; + break; + } + } + assertNotNull(annotation); + assertEquals(1000L, annotation.value()); } @Retention(RetentionPolicy.RUNTIME) diff --git a/hotspot/test/compiler/loopopts/BadPredicateAfterPartialPeel.java b/hotspot/test/compiler/loopopts/BadPredicateAfterPartialPeel.java new file mode 100644 index 00000000000..186f1cc1a7d --- /dev/null +++ b/hotspot/test/compiler/loopopts/BadPredicateAfterPartialPeel.java @@ -0,0 +1,312 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/** + * @test + * @bug 8146792 + * @summary Predicate moved after partial peel may lead to broken graph + * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileOnly=BadPredicateAfterPartialPeel::m -XX:CompileCommand=dontinline,BadPredicateAfterPartialPeel::not_inlined* -XX:CompileCommand=quiet BadPredicateAfterPartialPeel + * + */ + +public class BadPredicateAfterPartialPeel { + + static void not_inlined1() {} + static void not_inlined4() {} + + static int m_helper(int i, int i3, int i4) { + return i3 == 4 ? i4 : i; + } + + static float[] array = new float[1000]; + static int[] array2 = new int[1000]; + + boolean flag; + int j; + + static void m(BadPredicateAfterPartialPeel o1, BadPredicateAfterPartialPeel o2, BadPredicateAfterPartialPeel o, int i4) { + int i1 = 1; + + // To delay partial peeling to the loop opts pass right before CCP + int i2 = 0; + for (; i2 < 10; i2 += i1); + i2 = i2 / 10; + + // Simplified during CCP: + int i3 = 2; + for (; i3 < 4; i3 *= 2); + + // Loop is partial peeled right before CCP + int i = 0; + boolean b = true; + + not_inlined1(); + + array[0] = -1; + do { + // peeled section starts here + o.flag = false; + o.j = 0; + + if (b) { + // The following store will be pinned between + // predicates and the loop after partial peeling. All + // control flow will be optimized out and so nothing + // will prevent predicates from being moved out the + // loop. + array[i] = 0; + } + if (array[0] != 0) { + } + if (i >= 10) { + // peeled section ends here + return; + } + i += i2; + b = false; + int i5 = m_helper(i, i3, i4); // This will be simpliflied during CCP + if (array[i5] != 0) { // and this will become a predicate + } + if (o2.flag) { + } + // A bunch of stuff to grow loop body size and prevent peeling: + array2[0] = 0; + array2[1] = 0; + array2[2] = 0; + array2[3] = 0; + array2[4] = 0; + array2[5] = 0; + array2[6] = 0; + array2[7] = 0; + array2[8] = 0; + array2[9] = 0; + array2[10] = 0; + array2[11] = 0; + array2[12] = 0; + array2[13] = 0; + array2[14] = 0; + array2[15] = 0; + array2[16] = 0; + array2[17] = 0; + array2[18] = 0; + array2[19] = 0; + array2[20] = 0; + array2[21] = 0; + array2[22] = 0; + array2[23] = 0; + array2[24] = 0; + array2[25] = 0; + array2[26] = 0; + array2[27] = 0; + array2[28] = 0; + array2[29] = 0; + array2[30] = 0; + array2[31] = 0; + array2[32] = 0; + array2[33] = 0; + array2[34] = 0; + array2[35] = 0; + array2[36] = 0; + array2[37] = 0; + array2[38] = 0; + array2[39] = 0; + array2[40] = 0; + array2[41] = 0; + array2[42] = 0; + array2[43] = 0; + array2[44] = 0; + array2[45] = 0; + array2[46] = 0; + array2[47] = 0; + array2[48] = 0; + array2[49] = 0; + array2[50] = 0; + array2[51] = 0; + array2[52] = 0; + array2[53] = 0; + array2[54] = 0; + array2[55] = 0; + array2[56] = 0; + array2[57] = 0; + array2[58] = 0; + array2[59] = 0; + array2[60] = 0; + array2[61] = 0; + array2[62] = 0; + array2[63] = 0; + array2[64] = 0; + array2[65] = 0; + array2[66] = 0; + array2[67] = 0; + array2[68] = 0; + array2[69] = 0; + array2[70] = 0; + array2[71] = 0; + array2[72] = 0; + array2[73] = 0; + array2[74] = 0; + array2[75] = 0; + array2[76] = 0; + array2[77] = 0; + array2[78] = 0; + array2[79] = 0; + array2[80] = 0; + array2[81] = 0; + array2[82] = 0; + array2[83] = 0; + array2[84] = 0; + array2[85] = 0; + array2[86] = 0; + array2[87] = 0; + array2[88] = 0; + array2[89] = 0; + array2[90] = 0; + array2[91] = 0; + array2[92] = 0; + array2[93] = 0; + array2[94] = 0; + array2[95] = 0; + array2[96] = 0; + array2[97] = 0; + array2[98] = 0; + array2[99] = 0; + + array2[100] = 0; + array2[101] = 0; + array2[102] = 0; + array2[103] = 0; + array2[104] = 0; + array2[105] = 0; + array2[106] = 0; + array2[107] = 0; + array2[108] = 0; + array2[109] = 0; + array2[110] = 0; + array2[111] = 0; + array2[112] = 0; + array2[113] = 0; + array2[114] = 0; + array2[115] = 0; + array2[116] = 0; + array2[117] = 0; + array2[118] = 0; + array2[119] = 0; + array2[120] = 0; + array2[121] = 0; + array2[122] = 0; + array2[123] = 0; + array2[124] = 0; + array2[125] = 0; + array2[126] = 0; + array2[127] = 0; + array2[128] = 0; + array2[129] = 0; + array2[130] = 0; + array2[131] = 0; + array2[132] = 0; + array2[133] = 0; + array2[134] = 0; + array2[135] = 0; + array2[136] = 0; + array2[137] = 0; + array2[138] = 0; + array2[139] = 0; + array2[140] = 0; + array2[141] = 0; + array2[142] = 0; + array2[143] = 0; + array2[144] = 0; + array2[145] = 0; + array2[146] = 0; + array2[147] = 0; + array2[148] = 0; + array2[149] = 0; + array2[150] = 0; + array2[151] = 0; + array2[152] = 0; + array2[153] = 0; + array2[154] = 0; + array2[155] = 0; + array2[156] = 0; + array2[157] = 0; + array2[158] = 0; + array2[159] = 0; + array2[160] = 0; + array2[161] = 0; + array2[162] = 0; + array2[163] = 0; + array2[164] = 0; + array2[165] = 0; + array2[166] = 0; + array2[167] = 0; + array2[168] = 0; + array2[169] = 0; + array2[170] = 0; + array2[171] = 0; + array2[172] = 0; + array2[173] = 0; + array2[174] = 0; + array2[175] = 0; + array2[176] = 0; + array2[177] = 0; + array2[178] = 0; + array2[179] = 0; + array2[180] = 0; + array2[181] = 0; + array2[182] = 0; + array2[183] = 0; + array2[184] = 0; + array2[185] = 0; + array2[186] = 0; + array2[187] = 0; + array2[188] = 0; + array2[189] = 0; + array2[190] = 0; + array2[191] = 0; + array2[192] = 0; + array2[193] = 0; + array2[194] = 0; + array2[195] = 0; + array2[196] = 0; + array2[197] = 0; + array2[198] = 0; + array2[199] = 0; + if (o1.j >= 20) { + break; + } + o1.j++; + } while(true); + not_inlined4(); + } + + static public void main(String[] args) { + BadPredicateAfterPartialPeel o1 = new BadPredicateAfterPartialPeel(); + BadPredicateAfterPartialPeel o2 = new BadPredicateAfterPartialPeel(); + for (int i = 0; i < 20000; i++) { + o1.j = 0; + m(o1, o2, o2, 0); + m_helper(i, 2, i); // pollute profile + } + } +} diff --git a/hotspot/test/compiler/loopopts/TestLoopPeeling.java b/hotspot/test/compiler/loopopts/TestLoopPeeling.java new file mode 100644 index 00000000000..d2d2e3d7848 --- /dev/null +++ b/hotspot/test/compiler/loopopts/TestLoopPeeling.java @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8078262 + * @summary Tests correct dominator information after loop peeling. + * @run main/othervm -Xcomp -XX:CompileCommand=compileonly,TestLoopPeeling::test* TestLoopPeeling + */ +public class TestLoopPeeling { + + public int[] array = new int[100]; + + public static void main(String args[]) { + TestLoopPeeling test = new TestLoopPeeling(); + try { + test.testArrayAccess(0, 1); + test.testArrayAllocation(0, 1); + } catch (Exception e) { + // Ignore exceptions + } + } + + public void testArrayAccess(int index, int inc) { + int storeIndex = -1; + + for (; index < 10; index += inc) { + // This loop invariant check triggers loop peeling because it can + // be moved out of the loop (see 'IdealLoopTree::policy_peeling'). + if (inc == 42) return; + + // This loop variant usage of LShiftL( ConvI2L( Phi(storeIndex) ) ) + // prevents the split if optimization that would otherwise clone the + // LShiftL and ConvI2L nodes and assign them to their corresponding array + // address computation (see 'PhaseIdealLoop::split_if_with_blocks_post'). + if (storeIndex > 0 && array[storeIndex] == 42) return; + + if (index == 42) { + // This store and the corresponding range check are moved out of the + // loop and both used after old loop and the peeled iteration exit. + // For the peeled iteration, storeIndex is always -1 and the ConvI2L + // is replaced by TOP. However, the range check is not folded because + // we don't do the split if optimization in PhaseIdealLoop2. + // As a result, we have a (dead) control path from the peeled iteration + // to the StoreI but the data path is removed. + array[storeIndex] = 1; + return; + } + + storeIndex++; + } + } + + public byte[] testArrayAllocation(int index, int inc) { + int allocationCount = -1; + byte[] result; + + for (; index < 10; index += inc) { + // This loop invariant check triggers loop peeling because it can + // be moved out of the loop (see 'IdealLoopTree::policy_peeling'). + if (inc == 42) return null; + + if (index == 42) { + // This allocation and the corresponding size check are moved out of the + // loop and both used after old loop and the peeled iteration exit. + // For the peeled iteration, allocationCount is always -1 and the ConvI2L + // is replaced by TOP. However, the size check is not folded because + // we don't do the split if optimization in PhaseIdealLoop2. + // As a result, we have a (dead) control path from the peeled iteration + // to the allocation but the data path is removed. + result = new byte[allocationCount]; + return result; + } + + allocationCount++; + } + return null; + } +} + diff --git a/hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java b/hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java index c769b5b5aba..689b7f40be7 100644 --- a/hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java +++ b/hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java @@ -28,6 +28,7 @@ * @summary Test that C2 flag UseCountedLoopSafepoints ensures a safepoint is kept in a CountedLoop * @library /testlibrary * @modules java.base + * @ignore 8146096 * @run main UseCountedLoopSafepoints */ diff --git a/hotspot/test/compiler/loopopts/superword/TestBestAlign.java b/hotspot/test/compiler/loopopts/superword/TestBestAlign.java index 9063798e63a..9609859701d 100644 --- a/hotspot/test/compiler/loopopts/superword/TestBestAlign.java +++ b/hotspot/test/compiler/loopopts/superword/TestBestAlign.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 SAP AG. All Rights Reserved. + * Copyright (c) 2015 SAP SE. 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 diff --git a/hotspot/test/compiler/membars/DekkerTest.java b/hotspot/test/compiler/membars/DekkerTest.java index bef045701ec..83eb923c6f2 100644 --- a/hotspot/test/compiler/membars/DekkerTest.java +++ b/hotspot/test/compiler/membars/DekkerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 SAP AG. All Rights Reserved. + * Copyright (c) 2013 SAP SE. 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 diff --git a/hotspot/test/compiler/memoryinitialization/ZeroTLABTest.java b/hotspot/test/compiler/memoryinitialization/ZeroTLABTest.java new file mode 100644 index 00000000000..9be412a6db2 --- /dev/null +++ b/hotspot/test/compiler/memoryinitialization/ZeroTLABTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * @test + * @bug 8086053 + * @run main/othervm -Xcomp -XX:+UseTLAB -XX:+ZeroTLAB ZeroTLABTest + * @run main/othervm -Xcomp -XX:+UseTLAB -XX:-ZeroTLAB ZeroTLABTest + * @run main/othervm -Xcomp -XX:-UseTLAB -XX:+ZeroTLAB ZeroTLABTest + * @run main/othervm -Xcomp -XX:-UseTLAB -XX:-ZeroTLAB ZeroTLABTest + */ +public class ZeroTLABTest { + public static void main(String args[]) { + System.out.println("Test PASSED"); + } +} diff --git a/hotspot/test/compiler/runtime/7141637/SpreadNullArg.java b/hotspot/test/compiler/runtime/7141637/SpreadNullArg.java index 195e106d542..fac5d4723a0 100644 --- a/hotspot/test/compiler/runtime/7141637/SpreadNullArg.java +++ b/hotspot/test/compiler/runtime/7141637/SpreadNullArg.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 SAP AG. All Rights Reserved. + * Copyright (c) 2011 SAP SE. 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 diff --git a/hotspot/test/compiler/stringopts/TestOptimizeStringConcat.java b/hotspot/test/compiler/stringopts/TestOptimizeStringConcat.java index 771ffb0bd68..2f0ec3c0353 100644 --- a/hotspot/test/compiler/stringopts/TestOptimizeStringConcat.java +++ b/hotspot/test/compiler/stringopts/TestOptimizeStringConcat.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 SAP AG. All Rights Reserved. + * Copyright (c) 2015 SAP SE. 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 diff --git a/hotspot/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java b/hotspot/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java index f12972c5cd2..f4e0f776f7e 100644 --- a/hotspot/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java +++ b/hotspot/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 SAP AG. All Rights Reserved. + * Copyright (c) 2015 SAP SE. 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 diff --git a/hotspot/test/gc/6845368/bigobj.java b/hotspot/test/gc/TestBigObj.java similarity index 99% rename from hotspot/test/gc/6845368/bigobj.java rename to hotspot/test/gc/TestBigObj.java index 5185326bb4a..299e46b3068 100644 --- a/hotspot/test/gc/6845368/bigobj.java +++ b/hotspot/test/gc/TestBigObj.java @@ -1,10 +1,32 @@ /* - @test - @bug 6845368 - @summary ensure gc updates references > 64K bytes from the start of the obj - @author John Coomes - @run main/othervm/timeout=720 -Xmx64m bigobj -*/ + * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test TestBigObj + * @bug 6845368 + * @summary ensure gc updates references > 64K bytes from the start of the obj + * @run main/othervm/timeout=720 -Xmx64m -verbose:gc TestBigObj + */ // Allocate an object with a block of reference fields that starts more // than 64K bytes from the start of the object. This is done with @@ -21,13 +43,16 @@ // block to a known object, provoke GC, then make sure the field was // updated properly. -public class bigobj extends bigparent { +public class TestBigObj extends BigParent { + public static Object trash; public static void main(String argv[]) { - bigobj c = new bigobj(); + TestBigObj c = new TestBigObj(); Object o = c.o = new Object(); // Provoke GC so o is moved (if this is a moving collector). - for (int i = 0; i < 64 * 1024 * 1024; i++) new Object(); + for (int i = 0; i < 64 * 1024 * 1024; i++) { + trash = new Object(); + } if (o != c.o) { System.out.println("failed: o=" + o + " != c.o=" + c.o); @@ -38,7 +63,7 @@ public class bigobj extends bigparent { Object o; } -class bigparent { +class BigParent { public long l00001; public long l00002; public long l00003; diff --git a/hotspot/test/gc/7072527/TestFullGCCount.java b/hotspot/test/gc/TestFullGCCount.java similarity index 89% rename from hotspot/test/gc/7072527/TestFullGCCount.java rename to hotspot/test/gc/TestFullGCCount.java index 6732a01c355..9e5dddf4d7d 100644 --- a/hotspot/test/gc/7072527/TestFullGCCount.java +++ b/hotspot/test/gc/TestFullGCCount.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, 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 @@ -22,14 +22,18 @@ */ /* - * @test TestFullGCount.java + * @test TestFullGCCount.java * @bug 7072527 * @summary CMS: JMM GC counters overcount in some cases * @modules java.management * @run main/othervm -Xlog:gc TestFullGCCount */ -import java.util.*; -import java.lang.management.*; + +import java.lang.management.GarbageCollectorMXBean; +import java.lang.management.ManagementFactory; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; /* * Originally for a specific failure in CMS, this test now monitors all @@ -43,12 +47,12 @@ public class TestFullGCCount { int iterations = 20; boolean failed = false; String errorMessage = ""; - HashMap counts = new HashMap(); + HashMap counts = new HashMap<>(); // Prime the collection of count lists for all collectors. for (int i = 0; i < collectors.size(); i++) { GarbageCollectorMXBean collector = collectors.get(i); - counts.put(collector.getName(), new ArrayList(iterations)); + counts.put(collector.getName(), new ArrayList<>(iterations)); } // Perform some gc, record collector counts. diff --git a/hotspot/test/gc/TestVerifySubSet.java b/hotspot/test/gc/TestVerifySubSet.java new file mode 100644 index 00000000000..ca201633bba --- /dev/null +++ b/hotspot/test/gc/TestVerifySubSet.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test TestVerifySubSet.java + * @key gc + * @bug 8072725 + * @summary Test VerifySubSet option + * @library /testlibrary + * @modules java.base/sun.misc + * java.management + */ + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; +import java.util.ArrayList; +import java.util.Collections; + +class RunSystemGC { + public static void main(String args[]) throws Exception { + System.gc(); + } +} + +public class TestVerifySubSet { + private static String[] getTestJavaOpts() { + String testVmOptsStr = System.getProperty("test.java.opts"); + if (!testVmOptsStr.isEmpty()) { + return testVmOptsStr.split(" "); + } else { + return new String[] {}; + } + } + + private static OutputAnalyzer runTest(String subset) throws Exception { + ArrayList vmOpts = new ArrayList(); + + Collections.addAll(vmOpts, getTestJavaOpts()); + Collections.addAll(vmOpts, new String[] {"-XX:+UnlockDiagnosticVMOptions", + "-XX:+VerifyBeforeGC", + "-XX:+VerifyAfterGC", + "-Xlog:gc+verify=debug", + "-XX:VerifySubSet="+subset, + RunSystemGC.class.getName()}); + ProcessBuilder pb = + ProcessTools.createJavaProcessBuilder(vmOpts.toArray(new String[vmOpts.size()])); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + + System.out.println("Output:\n" + output.getOutput()); + return output; + } + + public static void main(String args[]) throws Exception { + + OutputAnalyzer output; + + output = runTest("heap, threads, codecache, metaspace"); + output.shouldContain("Heap"); + output.shouldContain("Threads"); + output.shouldContain("CodeCache"); + output.shouldContain("MetaspaceAux"); + output.shouldNotContain("SymbolTable"); + output.shouldNotContain("StringTable"); + output.shouldNotContain("SystemDictionary"); + output.shouldNotContain("CodeCache Oops"); + output.shouldHaveExitValue(0); + + output = runTest("hello, threads, codecache, metaspace"); + output.shouldContain("memory sub-system is unknown, please correct it"); + output.shouldNotContain("Threads"); + output.shouldNotContain("CodeCache"); + output.shouldNotContain("MetaspaceAux"); + output.shouldHaveExitValue(1); + } +} diff --git a/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java b/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java index e9045709c59..e9abbf7563c 100644 --- a/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java +++ b/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2013, 2016, 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 @@ -25,7 +25,7 @@ * @test TestInitialTenuringThreshold * @key gc * @bug 8014765 - * @requires vm.gc=="Parallel" + * @requires vm.gc=="Parallel" | vm.gc=="null" * @summary Tests argument processing for initial tenuring threshold * @library /testlibrary * @modules java.base/sun.misc diff --git a/hotspot/test/gc/arguments/TestNewSizeThreadIncrease.java b/hotspot/test/gc/arguments/TestNewSizeThreadIncrease.java new file mode 100644 index 00000000000..2422baec386 --- /dev/null +++ b/hotspot/test/gc/arguments/TestNewSizeThreadIncrease.java @@ -0,0 +1,123 @@ +/* +* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* This code is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 only, as +* published by the Free Software Foundation. +* +* This code is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +* version 2 for more details (a copy is included in the LICENSE file that +* accompanied this code). +* +* You should have received a copy of the GNU General Public License version +* 2 along with this work; if not, write to the Free Software Foundation, +* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +* or visit www.oracle.com if you need additional information or have any +* questions. +*/ + +/* + * @test TestNewSizeThreadIncrease + * @key gc + * @bug 8144527 + * @summary Tests argument processing for NewSizeThreadIncrease + * @library /testlibrary + * @requires vm.gc=="Serial" | vm.gc=="null" + * @modules java.base/sun.misc + * java.management + */ + + +import jdk.test.lib.*; + +// Range of NewSizeThreadIncrease is 0 ~ max_uintx. +// Total of 5 threads will be created (1 GCTest thread and 4 TestThread). +public class TestNewSizeThreadIncrease { + static final String VALID_VALUE = "2097152"; // 2MB + + // This value will make an overflow of 'thread count * NewSizeThreadIncrease' at DefNewGeneration::compute_new_size(). + // = (max_uintx / 5) + 1, = (18446744073709551615 / 5) + 1 + static String INVALID_VALUE_1 = "3689348814741910324"; + + // This string is contained when compute_new_size() expands or shrinks. + static final String LOG_NEWSIZE_CHANGED = "New generation size "; + + public static void main(String[] args) throws Exception { + if (Platform.is32bit()) { + // (max_uintx / 5) + 1, 4294967295/5 + 1 + INVALID_VALUE_1 = "858993460"; + } + + // New size will be applied as NewSizeThreadIncrease is small enough to expand. + runNewSizeThreadIncreaseTest(VALID_VALUE, true); + + // New size will be ignored as 'thread count * NewSizeThreadIncrease' overflows. + runNewSizeThreadIncreaseTest(INVALID_VALUE_1, false); + } + + static void runNewSizeThreadIncreaseTest(String expectedValue, boolean isNewsizeChanged) throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseSerialGC", + "-Xms96M", + "-Xmx128M", + "-XX:NewRatio=2", + "-Xlog:gc+heap+ergo=debug", + "-XX:NewSizeThreadIncrease="+expectedValue, + GCTest.class.getName()); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + + output.shouldHaveExitValue(0); + + if (isNewsizeChanged) { + output.shouldContain(LOG_NEWSIZE_CHANGED); + } else { + output.shouldNotContain(LOG_NEWSIZE_CHANGED); + } + } + + static class GCTest { + + static final int MAX_THREADS_COUNT = 4; + static TestThread threads[] = new TestThread[MAX_THREADS_COUNT]; + + public static void main(String[] args) { + + System.out.println("Creating garbage"); + + for (int i=0; i getCls(ClassLoader classLoader, Path wrkDir, String classNamePrefix) + throws IOException, ClassNotFoundException { + return Helpers.generateCompileAndLoad(classLoader, Helpers.enumNameToClassName(name()) + "Class", + expectedInstanceSize(), wrkDir, classNamePrefix); + } + + /** + * @return G1SampleClass instance expected size + */ + public abstract long expectedInstanceSize(); +} diff --git a/hotspot/test/gc/g1/humongousObjects/TestHumongousMovement.java b/hotspot/test/gc/g1/humongousObjects/TestHumongousMovement.java new file mode 100644 index 00000000000..66ca21bf05e --- /dev/null +++ b/hotspot/test/gc/g1/humongousObjects/TestHumongousMovement.java @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package gc.g1.humongousObjects; + +import gc.testlibrary.Helpers; +import jdk.test.lib.Asserts; +import jdk.test.lib.Utils; +import sun.hotspot.WhiteBox; + +import java.io.PrintStream; +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import java.util.stream.Collectors; + +/** + * @test TestHumongousMovement + * @summary Checks that Humongous objects are not moved during GC + * @requires vm.gc=="G1" | vm.gc=="null" + * @library /testlibrary /test/lib / + * @modules java.management + * @build sun.hotspot.WhiteBox + * gc.testlibrary.Helpers + * gc.g1.humongousObjects.TestHumongousMovement + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:G1HeapRegionSize=1M -Xms200m -Xmx200m -XX:InitiatingHeapOccupancyPercent=100 + * -Xlog:gc=info:file=TestHumongousMovement.log + * gc.g1.humongousObjects.TestHumongousMovement + */ + +public class TestHumongousMovement { + + private static class AllocationData { + private final byte[] allocation; + public final BigInteger objectAddress; + + public AllocationData(byte[] byteArray) { + allocation = byteArray; + objectAddress = new BigInteger(Long.toUnsignedString((WB.getObjectAddress(allocation)))); + } + + public boolean isAddressChanged() { + return !new BigInteger(Long.toUnsignedString((WB.getObjectAddress(allocation)))).equals(objectAddress); + } + + public void printDetails(PrintStream out) { + BigInteger objectAddressAfterGC = + new BigInteger(Long.toUnsignedString((WB.getObjectAddress(allocation)))); + + out.println(String.format("Object stored address = %d\nObject address after GC = %d\n" + + "They are %sequals", objectAddress, + objectAddressAfterGC, !objectAddress.equals(objectAddressAfterGC) ? "not " : "")); + } + + } + + private static final WhiteBox WB = WhiteBox.getWhiteBox(); + + // How many allocated humongous objects should be deleted + private static final double HUMONGOUS_OBJECTS_DELETED_FACTOR = 0.5D; + // How many of free g1 regions should be used for humongous allocations + private static final double ALLOCATED_HUMONGOUS_REGIONS_FACTOR = 0.25D; + + public static void main(String[] args) { + + int g1RegionSize = WB.g1RegionSize(); + int byteArrayMemoryOverhead = Helpers.detectByteArrayAllocationOverhead(); + + System.out.println("Total " + WB.g1NumMaxRegions() + " regions"); + System.out.println("Total " + WB.g1NumFreeRegions() + " free regions"); + + int regionsToAllocate = (int) (WB.g1NumFreeRegions() * ALLOCATED_HUMONGOUS_REGIONS_FACTOR); + + // Sanity check + Asserts.assertGreaterThan(regionsToAllocate, 0, "Test Bug: no regions to allocate"); + + System.out.println("Allocating " + regionsToAllocate + " humongous objects, each 90% of g1 region size"); + + List allocations = new ArrayList<>(); + + // 90 % of maximum byte[] that takes one region + int hSize = (int) ((g1RegionSize - byteArrayMemoryOverhead) * 0.9); + + // Sanity check + Asserts.assertGreaterThan(hSize, g1RegionSize / 2, "Test Bug: allocation size is not humongous"); + + for (int i = 0; i < regionsToAllocate; ++i) { + allocations.add(new AllocationData(new byte[hSize])); + } + + Random rnd = Utils.getRandomInstance(); + + int toDelete = (int) (allocations.size() * HUMONGOUS_OBJECTS_DELETED_FACTOR); + + for (int i = 0; i < toDelete; ++i) { + allocations.remove(rnd.nextInt(allocations.size())); + } + + WB.fullGC(); + + List movedObjects = allocations.stream() + .filter(AllocationData::isAddressChanged) + .collect(Collectors.toList()); + + if (movedObjects.size() > 0) { + System.out.println("Test failed - some humongous objects moved after Full GC"); + movedObjects.stream().forEach(a -> a.printDetails(System.out)); + throw new Error("Test failed - some humongous objects moved after Full GC"); + } else { + System.out.println("Passed"); + } + } +} diff --git a/hotspot/test/gc/g1/humongousObjects/TestHumongousNonArrayAllocation.java b/hotspot/test/gc/g1/humongousObjects/TestHumongousNonArrayAllocation.java new file mode 100644 index 00000000000..118c3114b0c --- /dev/null +++ b/hotspot/test/gc/g1/humongousObjects/TestHumongousNonArrayAllocation.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package gc.g1.humongousObjects; + +import jdk.test.lib.Asserts; +import sun.hotspot.WhiteBox; + +import java.io.IOException; +import java.net.URL; +import java.net.URLClassLoader; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +/** + * @test gc.g1.humongousObjects.TestHumongousNonArrayAllocation + * @summary Checks that huge class' instances (ie with huge amount of fields) are allocated successfully + * @requires vm.gc=="G1" | vm.gc=="null" + * @requires vm.opt.G1HeapRegionSize == "null" | vm.opt.G1HeapRegionSize == "1M" + * @library /testlibrary /test/lib / + * @modules java.management + * @build sun.hotspot.WhiteBox + * gc.testlibrary.Helpers + * gc.g1.humongousObjects.G1SampleClass + * gc.g1.humongousObjects.TestHumongousNonArrayAllocation + * + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * + * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:G1HeapRegionSize=1M + * gc.g1.humongousObjects.TestHumongousNonArrayAllocation LARGEST_NON_HUMONGOUS + * + * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:G1HeapRegionSize=1M + * gc.g1.humongousObjects.TestHumongousNonArrayAllocation SMALLEST_HUMONGOUS + * + * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:G1HeapRegionSize=1M + * gc.g1.humongousObjects.TestHumongousNonArrayAllocation ONE_REGION_HUMONGOUS + * + * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:G1HeapRegionSize=1M + * gc.g1.humongousObjects.TestHumongousNonArrayAllocation TWO_REGION_HUMONGOUS + * + * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:G1HeapRegionSize=1M + * gc.g1.humongousObjects.TestHumongousNonArrayAllocation MORE_THAN_TWO_REGION_HUMONGOUS + * + */ + +/** + * The test for objects which are instances of classes with a huge amount of fields. It's an alternative way to create + * a humongous object rather to allocate a long array. + * The size of a class object depends on the field declared in the class. So, the tests generates such classes to cover + * the following cases: + * largest non-humongous object (exactly half a region) + * smallest humongous object (half a region + sizeof(long)) + * humongous object that takes exactly one region + * humongous object that takes more than one region (region + sizeof(long)) + * humongous object that takes more than two regions (region * 2 + sizeof(long)) + * + */ +public class TestHumongousNonArrayAllocation { + private static final WhiteBox WB = WhiteBox.getWhiteBox(); + private static final String CLASS_NAME_PREFIX = TestHumongousNonArrayAllocation.class.getSimpleName() + "_"; + + public static void main(String[] args) throws ClassNotFoundException, InstantiationException, + IllegalAccessException, IOException { + + if (args.length != 1) { + throw new Error("Test Bug: Expected class name wasn't provided as command line argument"); + } + G1SampleClass sampleClass = G1SampleClass.valueOf(args[0]); + + Path wrkDir = Files.createTempDirectory(Paths.get(""), CLASS_NAME_PREFIX); + URL[] url = {wrkDir.toUri().toURL()}; + URLClassLoader urlLoader = new URLClassLoader(url); + + Object sampleObject; + try { + sampleObject = sampleClass.getCls(urlLoader, wrkDir, CLASS_NAME_PREFIX).newInstance(); + } catch (Throwable throwable) { + throw new AssertionError("Test Bug: Cannot create object of provided class", throwable); + } + + boolean isHumongous = WB.g1IsHumongous(sampleObject); + boolean shouldBeHumongous = (sampleClass.expectedInstanceSize() > (WB.g1RegionSize() / 2)); + + // Sanity check + Asserts.assertEquals(WB.getObjectSize(sampleObject), sampleClass.expectedInstanceSize(), + String.format("Test Bug: Object of class %s is expected to take %d bytes but it takes %d.", + sampleClass.name(), sampleClass.expectedInstanceSize(), WB.getObjectSize(sampleObject))); + + // Test check + Asserts.assertEquals(isHumongous, shouldBeHumongous, + String.format("Object of class %s is expected to be %shumongous but it is not", + sampleClass.name(), (shouldBeHumongous ? "" : "non-"))); + } + +} diff --git a/hotspot/test/runtime/7100935/TestConjointAtomicArraycopy.java b/hotspot/test/runtime/7100935/TestConjointAtomicArraycopy.java index 3e1711888ab..6f82740cd72 100644 --- a/hotspot/test/runtime/7100935/TestConjointAtomicArraycopy.java +++ b/hotspot/test/runtime/7100935/TestConjointAtomicArraycopy.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 SAP AG. All Rights Reserved. + * Copyright (c) 2011 SAP SE. 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 diff --git a/hotspot/test/runtime/7100935/TestShortArraycopy.java b/hotspot/test/runtime/7100935/TestShortArraycopy.java index 81b048912e3..edcbcbbf51e 100644 --- a/hotspot/test/runtime/7100935/TestShortArraycopy.java +++ b/hotspot/test/runtime/7100935/TestShortArraycopy.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 SAP AG. All Rights Reserved. + * Copyright (c) 2011 SAP SE. 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 diff --git a/hotspot/test/runtime/7107135/Test.java b/hotspot/test/runtime/7107135/Test.java index 84f3ab3393f..9b489347bd4 100644 --- a/hotspot/test/runtime/7107135/Test.java +++ b/hotspot/test/runtime/7107135/Test.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002-2013, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 SAP AG. All Rights Reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 SAP SE. 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 diff --git a/hotspot/test/runtime/7107135/Test7107135.sh b/hotspot/test/runtime/7107135/Test7107135.sh index 30604ff6313..5371b3a2d95 100644 --- a/hotspot/test/runtime/7107135/Test7107135.sh +++ b/hotspot/test/runtime/7107135/Test7107135.sh @@ -2,7 +2,7 @@ # # Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 2011 SAP AG. All Rights Reserved. +# Copyright (c) 2011 SAP SE. 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 diff --git a/hotspot/test/runtime/7107135/TestMT.java b/hotspot/test/runtime/7107135/TestMT.java index edea698ac8c..4fc297dcd03 100644 --- a/hotspot/test/runtime/7107135/TestMT.java +++ b/hotspot/test/runtime/7107135/TestMT.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002-2013, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 SAP AG. All Rights Reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 SAP SE. 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 diff --git a/hotspot/test/runtime/7107135/test.c b/hotspot/test/runtime/7107135/test.c index 602063f640e..3e39eaeb7f2 100644 --- a/hotspot/test/runtime/7107135/test.c +++ b/hotspot/test/runtime/7107135/test.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002-2013, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 SAP AG. All Rights Reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 SAP SE. 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 diff --git a/hotspot/test/runtime/7158988/FieldMonitor.java b/hotspot/test/runtime/7158988/FieldMonitor.java index 42b82768530..cfe210ce69d 100644 --- a/hotspot/test/runtime/7158988/FieldMonitor.java +++ b/hotspot/test/runtime/7158988/FieldMonitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 SAP AG. All Rights Reserved. + * Copyright (c) 2012 SAP SE. 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 diff --git a/hotspot/test/runtime/7158988/TestPostFieldModification.java b/hotspot/test/runtime/7158988/TestPostFieldModification.java index d730003b267..8f51d4d32c4 100644 --- a/hotspot/test/runtime/7158988/TestPostFieldModification.java +++ b/hotspot/test/runtime/7158988/TestPostFieldModification.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 SAP AG. All Rights Reserved. + * Copyright (c) 2012 SAP SE. 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 diff --git a/hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java b/hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java index fe952cdaf2e..f762017bff2 100644 --- a/hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java +++ b/hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java @@ -135,12 +135,6 @@ public class TestOptionsWithRanges { excludeTestMaxRange("VMThreadStackSize"); - /* - * JDK-8145027 - * Temporarily exclude as current range/constraint is not enough for some option combinations. - */ - excludeTestRange("NUMAInterleaveGranularity"); - /* * Remove parameters controlling the code cache. As these * parameters have implications on the physical memory diff --git a/hotspot/test/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java b/hotspot/test/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java index 12ee773c196..de7ed44b05a 100644 --- a/hotspot/test/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java +++ b/hotspot/test/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java @@ -285,6 +285,8 @@ public class TestVMOptionsFile { } private static void testVMOptions() throws Exception { + ProcessBuilder pb; + /* Check that empty VM Option file is accepted without errors */ addVMOptionsFile(VM_OPTION_FILE_EMPTY); @@ -385,6 +387,33 @@ public class TestVMOptionsFile { checkProperty("my.property", "value" + REPEAT_COUNT); checkVMOption("MinHeapFreeRatio", "17"); checkVMOption("MaxHeapFreeRatio", "85"); + + /* Pass VM Option file in _JAVA_OPTIONS environment variable */ + addVMParam("-showversion"); + addVMOptionsToCheck("SurvivorRatio", "MinHeapFreeRatio"); + pb = createProcessBuilder(); + + updateEnvironment(pb, JAVA_OPTIONS, "-XX:VMOptionsFile=" + getAbsolutePathFromSource(VM_OPTION_FILE_1)); + + runJavaCheckExitValue(pb, JVM_SUCCESS); + outputShouldContain("interpreted mode"); + checkProperty("optfile_1", "option_file_1"); + checkVMOption("SurvivorRatio", "16"); + checkVMOption("MinHeapFreeRatio", "22"); + + /* Pass VM Option file in JAVA_TOOL_OPTIONS environment variable */ + addVMOptionsToCheck("UseGCOverheadLimit", "NewRatio", "MinHeapFreeRatio", "MaxFDLimit", "AlwaysPreTouch"); + pb = createProcessBuilder(); + + updateEnvironment(pb, JAVA_TOOL_OPTIONS, "-XX:VMOptionsFile=" + VM_OPTION_FILE_2); + + runJavaCheckExitValue(pb, JVM_SUCCESS); + checkProperty("javax.net.ssl.keyStorePassword", "someVALUE123+"); + checkVMOption("UseGCOverheadLimit", "true"); + checkVMOption("NewRatio", "4"); + checkVMOption("MinHeapFreeRatio", "3"); + checkVMOption("MaxFDLimit", "true"); + checkVMOption("AlwaysPreTouch", "false"); } private static ProcessBuilder prepareTestCase(int testCase) throws Exception { @@ -548,13 +577,13 @@ public class TestVMOptionsFile { addVMOptionsFile(VM_OPTION_FILE_WITH_SAME_VM_OPTION_FILE); runJavaCheckExitValue(JVM_FAIL_WITH_EXIT_CODE_1); - outputShouldContain("The VM Options file can only be specified once and only on the command line."); + outputShouldContain("A VM options file may not refer to a VM options file. Specification of '-XX:VMOptionsFile=' in the options file"); /* Pass VM option file with VM option file option in it */ addVMOptionsFile(VM_OPTION_FILE_WITH_VM_OPTION_FILE); runJavaCheckExitValue(JVM_FAIL_WITH_EXIT_CODE_1); - outputShouldContain("The VM Options file can only be specified once and only on the command line."); + outputShouldContain("A VM options file may not refer to a VM options file. Specification of '-XX:VMOptionsFile=' in the options file"); /* Pass VM option file which is not accessible (without read permissions) */ addVMOptionsFile(getAbsolutePathFromSource(VM_OPTION_FILE_WITHOUT_READ_PERMISSIONS)); @@ -567,7 +596,7 @@ public class TestVMOptionsFile { addVMOptionsFile(VM_OPTION_FILE_2); runJavaCheckExitValue(JVM_FAIL_WITH_EXIT_CODE_1); - outputShouldContain("The VM Options file can only be specified once and only on the command line."); + outputShouldContain("is already specified in the"); /* Pass empty option file i.e. pass "-XX:VMOptionsFile=" */ addVMOptionsFile(""); @@ -586,22 +615,6 @@ public class TestVMOptionsFile { runJavaCheckExitValue(JVM_FAIL_WITH_EXIT_CODE_1); outputShouldContain("Unmatched quote in"); - - /* Pass VM Option file in _JAVA_OPTIONS environment variable */ - pb = createProcessBuilder(); - - updateEnvironment(pb, JAVA_OPTIONS, "-XX:VMOptionsFile=" + getAbsolutePathFromSource(VM_OPTION_FILE_1)); - - runJavaCheckExitValue(pb, JVM_FAIL_WITH_EXIT_CODE_1); - outputShouldContain("VM options file is only supported on the command line"); - - /* Pass VM Option file in JAVA_TOOL_OPTIONS environment variable */ - pb = createProcessBuilder(); - - updateEnvironment(pb, JAVA_TOOL_OPTIONS, "-XX:VMOptionsFile=" + getAbsolutePathFromSource(VM_OPTION_FILE_1)); - - runJavaCheckExitValue(pb, JVM_FAIL_WITH_EXIT_CODE_1); - outputShouldContain("VM options file is only supported on the command line"); } public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java b/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java index 37119150c5a..8386a55ca98 100644 --- a/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java +++ b/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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 @@ -43,10 +43,6 @@ public class SharedBaseAddress { }; public static void main(String[] args) throws Exception { - // Known issue on Solaris-Sparc - // @ignore JDK-8044600 - if (Platform.isSolaris() && Platform.isSparc()) - return; for (String testEntry : testTable) { String filename = "SharedBaseAddress" + testEntry + ".jsa"; diff --git a/hotspot/test/runtime/Unsafe/AllocateInstance.java b/hotspot/test/runtime/Unsafe/AllocateInstance.java index 9beb7219e0b..4393a081de4 100644 --- a/hotspot/test/runtime/Unsafe/AllocateInstance.java +++ b/hotspot/test/runtime/Unsafe/AllocateInstance.java @@ -35,21 +35,7 @@ import sun.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class AllocateInstance { - public static void main(String args[]) throws Exception { - Unsafe unsafe = Utils.getUnsafe(); - - // allocateInstance() should not result in a call to the constructor - TestClass tc = (TestClass)unsafe.allocateInstance(TestClass.class); - assertFalse(tc.calledConstructor); - - // allocateInstance() on an abstract class should result in an InstantiationException - try { - AbstractClass ac = (AbstractClass)unsafe.allocateInstance(AbstractClass.class); - throw new RuntimeException("Did not get expected InstantiationException"); - } catch (InstantiationException e) { - // Expected - } - } + static final Unsafe UNSAFE = Utils.getUnsafe(); class TestClass { public boolean calledConstructor = false; @@ -59,7 +45,41 @@ public class AllocateInstance { } } + static void testConstructorCall() throws InstantiationException { + // allocateInstance() should not result in a call to the constructor + TestClass tc = (TestClass)UNSAFE.allocateInstance(TestClass.class); + assertFalse(tc.calledConstructor); + } + abstract class AbstractClass { public AbstractClass() {} } + + static void testAbstractClass() { + try { + AbstractClass ac = (AbstractClass) UNSAFE.allocateInstance(AbstractClass.class); + throw new AssertionError("Should throw InstantiationException for an abstract class"); + } catch (InstantiationException e) { + // Expected + } + } + + interface AnInterface {} + + static void testInterface() { + try { + AnInterface ai = (AnInterface) UNSAFE.allocateInstance(AnInterface.class); + throw new AssertionError("Should throw InstantiationException for an interface"); + } catch (InstantiationException e) { + // Expected + } + } + + public static void main(String args[]) throws Exception { + for (int i = 0; i < 20_000; i++) { + testConstructorCall(); + testAbstractClass(); + testInterface(); + } + } } diff --git a/hotspot/test/runtime/logging/ClassB.java b/hotspot/test/runtime/logging/ClassB.java new file mode 100644 index 00000000000..0642e13c572 --- /dev/null +++ b/hotspot/test/runtime/logging/ClassB.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import p2.D; + +interface InterfaceA { + public void Method1(); + public void Method2(); +} + +class ClassA implements InterfaceA { + public void Method1() { + System.out.println("ClassA's Method1"); + } + public void Method2() { + System.out.println("ClassA's Method2"); + } + public void Method3() { + System.out.println("ClassA's Method3"); + } + public void Method4() { + System.out.println("ClassA's Method4"); + } +} + +public class ClassB extends ClassA { + public void Method1() { + System.out.println("ClassB's Method1"); + } + public void Method3() { + System.out.println("ClassB's Method3"); + } + public static void main(String[] args) throws Exception { + ClassB classBObj = new ClassB(); + classBObj.Method1(); + classBObj.Method2(); + classBObj.Method3(); + classBObj.Method4(); + ClassA classAObj = new ClassA(); + classAObj.Method1(); + classAObj.Method2(); + classAObj.Method3(); + classAObj.Method4(); + D classD = new D(); + D.loadD(); + } +} diff --git a/hotspot/test/runtime/logging/ClassResolutionTest.java b/hotspot/test/runtime/logging/ClassResolutionTest.java new file mode 100644 index 00000000000..84d06c4eebb --- /dev/null +++ b/hotspot/test/runtime/logging/ClassResolutionTest.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test ClassResolutionTest + * @bug 8144874 + * @library /testlibrary + * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools + * @run driver ClassResolutionTest + */ + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; +import java.lang.ref.WeakReference; +import java.lang.reflect.Method; + +public class ClassResolutionTest { + + public static class ClassResolutionTestMain { + + public static class Thing1 { + public static int getThingNumber() { + return 1; + } + }; + public static class Thing1Handler { + public static int getThingNumber() { + return Thing1.getThingNumber(); + } + }; + + public static void main(String... args) throws Exception { + Thing1Handler.getThingNumber(); + } + } + + public static void main(String... args) throws Exception { + + // (1) classresolve should turn on. + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-Xlog:classresolve=info", ClassResolutionTestMain.class.getName()); + OutputAnalyzer o = new OutputAnalyzer(pb.start()); + o.shouldContain("[classresolve] ClassResolutionTest$ClassResolutionTestMain$Thing1Handler ClassResolutionTest$ClassResolutionTestMain$Thing1"); + + // (2) classresolve should turn off. + pb = ProcessTools.createJavaProcessBuilder( + "-Xlog", "-Xlog:classresolve=off", ClassResolutionTestMain.class.getName()); + o = new OutputAnalyzer(pb.start()); + o.shouldNotContain("[classresolve]"); + + // (3) TraceClassResolution should turn on. + pb = ProcessTools.createJavaProcessBuilder( + "-XX:+TraceClassResolution", ClassResolutionTestMain.class.getName()); + o = new OutputAnalyzer(pb.start()); + o.shouldContain("[classresolve] ClassResolutionTest$ClassResolutionTestMain$Thing1Handler ClassResolutionTest$ClassResolutionTestMain$Thing1"); + + // (4) TraceClassResolution should turn off. + pb = ProcessTools.createJavaProcessBuilder( + "-Xlog", "-XX:-TraceClassResolution", ClassResolutionTestMain.class.getName()); + o = new OutputAnalyzer(pb.start()); + o.shouldNotContain("[classresolve]"); + + + }; +} diff --git a/hotspot/test/runtime/logging/ExceptionsTest.java b/hotspot/test/runtime/logging/ExceptionsTest.java index 0fefed85e9d..bac3dd0cdb0 100644 --- a/hotspot/test/runtime/logging/ExceptionsTest.java +++ b/hotspot/test/runtime/logging/ExceptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ public class ExceptionsTest { OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain(""); output.shouldContain(" thrown in interpreter method "); - output.shouldContain(") thrown in compiled method "); + output.shouldContain(" thrown in compiled method "); output.shouldContain("Exception 2 caught."); output.shouldHaveExitValue(0); } diff --git a/hotspot/test/runtime/logging/ItablesTest.java b/hotspot/test/runtime/logging/ItablesTest.java new file mode 100644 index 00000000000..4cad4392bad --- /dev/null +++ b/hotspot/test/runtime/logging/ItablesTest.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8141564 + * @summary itables=trace should have logging from each of the statements + * in the code + * @library /testlibrary + * @ignore 8146435 + * @compile ClassB.java + * @modules java.base/sun.misc + * java.management + * @run driver ItablesTest + */ + +import jdk.test.lib.*; + +public class ItablesTest { + public static void main(String[] args) throws Exception { + if (Platform.isDebugBuild()) { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-Xlog:itables=trace", "ClassB"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain(": Initializing itables for ClassB"); + output.shouldContain(": Initializing itable indices for interface "); + output.shouldContain("vtable index "); + output.shouldContain("itable index "); + output.shouldContain("target: ClassB.Method1()V, method_holder: ClassB target_method flags: public"); + output.shouldContain("invokeinterface resolved method: caller-class"); + output.shouldContain("invokespecial resolved method: caller-class:ClassB"); + output.shouldContain("invokespecial selected method: resolved-class:ClassB"); + output.shouldContain("invokeinterface selected method: receiver-class"); + output.shouldContain("Resolving: klass: "); + output.shouldHaveExitValue(0); + } + } +} diff --git a/hotspot/test/runtime/logging/VtablesTest.java b/hotspot/test/runtime/logging/VtablesTest.java new file mode 100644 index 00000000000..e31d4cde2fc --- /dev/null +++ b/hotspot/test/runtime/logging/VtablesTest.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8141564 + * @summary vtables=trace should have logging from each of the statements in the code + * @library /testlibrary + * @compile ClassB.java + * p1/A.java + * p2/B.jcod + * p1/C.java + * p2/D.java + * @modules java.base/sun.misc + * java.management + * @run driver VtablesTest + */ + +import jdk.test.lib.*; + +public class VtablesTest { + public static void main(String[] args) throws Exception { + if (Platform.isDebugBuild()) { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-Xlog:vtables=trace", "ClassB"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("copy vtable from ClassA to ClassB"); + output.shouldContain("Initializing: ClassB"); + output.shouldContain("adding ClassB.Method1()V"); + output.shouldContain("] overriding with ClassB::ClassB.Method2()V"); + output.shouldContain("invokevirtual resolved method: caller-class:ClassB"); + output.shouldContain("invokevirtual selected method: receiver-class:ClassB"); + output.shouldContain("NOT overriding with p2.D::p2.D.nooverride()V"); + output.shouldHaveExitValue(0); + + pb = ProcessTools.createJavaProcessBuilder("-Xlog:vtables=trace", "p1/C"); + output = new OutputAnalyzer(pb.start()); + output.shouldContain("transitive overriding superclass "); + output.shouldHaveExitValue(0); + } + } +} + diff --git a/hotspot/test/runtime/logging/p1/A.java b/hotspot/test/runtime/logging/p1/A.java new file mode 100644 index 00000000000..57d2ca57cf8 --- /dev/null +++ b/hotspot/test/runtime/logging/p1/A.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package p1; + +public class A { + public void test() { System.out.println("In A's test method"); } + void nooverride() {} +} diff --git a/hotspot/test/runtime/logging/p1/C.java b/hotspot/test/runtime/logging/p1/C.java new file mode 100644 index 00000000000..5624726aa7e --- /dev/null +++ b/hotspot/test/runtime/logging/p1/C.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package p1; + +import p2.B; + +public class C extends B { + public void test() { System.out.println("In C's test method"); } + public static void main(String args[]) { + C c = new C(); + c.test(); + } +} diff --git a/hotspot/test/runtime/logging/p2/B.jcod b/hotspot/test/runtime/logging/p2/B.jcod new file mode 100644 index 00000000000..724c180aa16 --- /dev/null +++ b/hotspot/test/runtime/logging/p2/B.jcod @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +class p2/B { + 0xCAFEBABE; + 0; // minor version + 52; // version + [28] { // Constant Pool + ; // first element is empty + Method #6 #14; // #1 at 0x0A + Field #15 #16; // #2 at 0x0F + String #17; // #3 at 0x14 + Method #18 #19; // #4 at 0x17 + class #20; // #5 at 0x1C + class #21; // #6 at 0x1F + Utf8 ""; // #7 at 0x22 + Utf8 "()V"; // #8 at 0x2B + Utf8 "Code"; // #9 at 0x31 + Utf8 "LineNumberTable"; // #10 at 0x38 + Utf8 "test"; // #11 at 0x4A + Utf8 "SourceFile"; // #12 at 0x52 + Utf8 "B.java"; // #13 at 0x5F + NameAndType #7 #8; // #14 at 0x68 + class #22; // #15 at 0x6D + NameAndType #23 #24; // #16 at 0x70 + Utf8 "In B's test method"; // #17 at 0x75 + class #25; // #18 at 0x8A + NameAndType #26 #27; // #19 at 0x8D + Utf8 "p2/B"; // #20 at 0x92 + Utf8 "p1/A"; // #21 at 0x99 + Utf8 "java/lang/System"; // #22 at 0xA0 + Utf8 "out"; // #23 at 0xB3 + Utf8 "Ljava/io/PrintStream;"; // #24 at 0xB9 + Utf8 "java/io/PrintStream"; // #25 at 0xD1 + Utf8 "println"; // #26 at 0xE7 + Utf8 "(Ljava/lang/String;)V"; // #27 at 0xF1 + } // Constant Pool + + 0x0021; // access + #5;// this_cpx + #6;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [0] { // fields + } // fields + + [2] { // methods + { // Member at 0x0115 + 0x0001; // access + #7; // name_cpx + #8; // sig_cpx + [1] { // Attributes + Attr(#9, 29) { // Code at 0x011D + 1; // max_stack + 1; // max_locals + Bytes[5]{ + 0x2AB70001B1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x0134 + [1] { // LineNumberTable + 0 5; // at 0x0140 + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member at 0x0140 + 0x0000; // access + #11; // name_cpx + #8; // sig_cpx + [1] { // Attributes + Attr(#9, 33) { // Code at 0x0148 + 2; // max_stack + 1; // max_locals + Bytes[9]{ + 0xB200021203B60004; + 0xB1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x0163 + [1] { // LineNumberTable + 0 6; // at 0x016F + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [1] { // Attributes + Attr(#12, 2) { // SourceFile at 0x0171 + #13; + } // end SourceFile + } // Attributes +} // end class p2/B diff --git a/hotspot/test/runtime/logging/p2/D.java b/hotspot/test/runtime/logging/p2/D.java new file mode 100644 index 00000000000..05f366fabfc --- /dev/null +++ b/hotspot/test/runtime/logging/p2/D.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package p2; + +public class D extends p1.A { + void nooverride() {} + public static void loadD() {} +} diff --git a/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java b/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java index 95307f682f7..0201e2ceeec 100644 --- a/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java +++ b/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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 @@ -80,7 +80,8 @@ public class CodelistTest { // int compileLevel = Integer.parseInt(parts[1]); String methodPrintedInLogFormat = parts[2]; - // skip inits, clinits and methodHandles - they can not be reflected + // skip inits, clinits, methodHandles and getUnsafe - + // they can not be reflected if (methodPrintedInLogFormat.contains("")) { continue; } @@ -93,6 +94,9 @@ public class CodelistTest { if (methodPrintedInLogFormat.contains("sun.misc.Unsafe.getUnsafe")) { continue; } + if (methodPrintedInLogFormat.contains("jdk.internal.misc.Unsafe.getUnsafe")) { + continue; + } MethodIdentifierParser mf = new MethodIdentifierParser(methodPrintedInLogFormat); Method m = null; diff --git a/hotspot/test/serviceability/jvmti/8036666/GetObjectLockCount.java b/hotspot/test/serviceability/jvmti/8036666/GetObjectLockCount.java index 47e4104bd3d..404f4dd0468 100644 --- a/hotspot/test/serviceability/jvmti/8036666/GetObjectLockCount.java +++ b/hotspot/test/serviceability/jvmti/8036666/GetObjectLockCount.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 SAP AG. All Rights Reserved. + * Copyright (c) 2014 SAP SE. 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 diff --git a/hotspot/test/serviceability/jvmti/8036666/RecursiveObjectLock.java b/hotspot/test/serviceability/jvmti/8036666/RecursiveObjectLock.java index d1a35edd6c3..55107e9b0ee 100644 --- a/hotspot/test/serviceability/jvmti/8036666/RecursiveObjectLock.java +++ b/hotspot/test/serviceability/jvmti/8036666/RecursiveObjectLock.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 SAP AG. All Rights Reserved. + * Copyright (c) 2014 SAP SE. 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 diff --git a/hotspot/test/serviceability/tmtools/jstack/DaemonThreadTest.java b/hotspot/test/serviceability/tmtools/jstack/DaemonThreadTest.java new file mode 100644 index 00000000000..6b154ecc890 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/DaemonThreadTest.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary Create daemon and non-deamon threads. + * Check the correctness of thread's status from jstack. + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * + * @run main/othervm -XX:+UsePerfData DaemonThreadTest + */ +import common.ToolResults; +import utils.*; + +public class DaemonThreadTest { + + static class NormalThread extends Thread { + + NormalThread() { + } + + @Override + public void run() { + Utils.sleep(); + } + + } + + static class DaemonThread extends Thread { + + DaemonThread() { + setDaemon(true); + } + + @Override + public void run() { + Utils.sleep(); + } + + } + + public static void main(String[] args) throws Exception { + testNoDaemon(); + testDaemon(); + } + + private static void testNoDaemon() throws Exception { + testThread(new NormalThread(), ""); + } + + private static void testDaemon() throws Exception { + testThread(new DaemonThread(), "daemon"); + } + + private static void testThread(Thread thread, String expectedType) throws Exception { + // Start the thread + thread.start(); + + // Run jstack tool and collect the output + JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid()); + ToolResults results = jstackTool.measure(); + + // Analyze the jstack output for the correct thread type + JStack jstack = new DefaultFormat().parse(results.getStdoutString()); + ThreadStack ti = jstack.getThreadStack(thread.getName()); + + if (!ti.getType().trim().equals(expectedType)) { + throw new RuntimeException("incorrect thread type '" + ti.getType() + "' for the thread '" + thread.getName() + "'"); + } + + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/JstackTool.java b/hotspot/test/serviceability/tmtools/jstack/JstackTool.java new file mode 100644 index 00000000000..0bc4c799ecb --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/JstackTool.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import common.TmTool; +import common.ToolResults; + +/** + * This tool executes "jstack " and returns the results + */ +public class JstackTool extends TmTool { + + public JstackTool(long pid) { + super(ToolResults.class, "jstack", String.valueOf(pid)); + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/SpreadLockTest.java b/hotspot/test/serviceability/tmtools/jstack/SpreadLockTest.java new file mode 100644 index 00000000000..92bd5e5c90a --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/SpreadLockTest.java @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary Create a thread which stops in methods a(), a()->b(), a()->b()->c(), + * synchronizing on one monitor inside of each method. + * After checking that lock info is correct invoke another method + * and get the lock again. Repeat this action. + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * + * @run main/othervm -XX:+UsePerfData SpreadLockTest + */ +import common.ToolResults; +import java.util.Iterator; +import utils.*; + +class SpreadLockDebuggee extends Thread { + + static final String THREAD_NAME = "MyThread"; + + SpreadLockDebuggee() { + setName(THREAD_NAME); + } + + Object monitor = new Object(); + + public void c() { + synchronized (monitor) { + Utils.sleep(); + } + } + + public void b() { + synchronized (monitor) { + try { + while (true) { + Thread.sleep(Long.MAX_VALUE); + } + } catch (InterruptedException e) { + c(); + } + } + } + + public void a() { + synchronized (monitor) { + try { + while (true) { + Thread.sleep(Long.MAX_VALUE); + } + } catch (InterruptedException e) { + b(); + } + } + } + + @Override + public void run() { + a(); + } + +} + +public class SpreadLockTest { + + public static void main(String[] args) throws Exception { + new SpreadLockTest().doTest(); + } + + private void doTest() throws Exception { + SpreadLockDebuggee debuggee = new SpreadLockDebuggee(); + + // Start in method a() + debuggee.start(); + + // Collect output from the jstack tool + JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid()); + ToolResults results1 = jstackTool.measure(); + + // Go to method b() + debuggee.interrupt(); + + // Collect output from the jstack tool + ToolResults results2 = jstackTool.measure(); + + // Go to method c() + debuggee.interrupt(); + + // Collect output from the jstack tool + ToolResults results3 = jstackTool.measure(); + + analyse(results1.getStdoutString(), results2.getStdoutString(), results3.getStdoutString()); + } + + // Analyzing the outputs from the 3 jstack runs + public void analyse(String result1, String result2, String result3) { + String jstackStr1 = result1; + String jstackStr2 = result2; + String jstackStr3 = result3; + + if (jstackStr1 == null) { + throw new RuntimeException("First jstack output is empty"); + } + if (jstackStr2 == null) { + throw new RuntimeException("Second jstack output is empty"); + } + if (jstackStr3 == null) { + throw new RuntimeException("Third jstack output is empty"); + } + + Format format = new DefaultFormat(); + JStack jstack1 = format.parse(jstackStr1); + JStack jstack2 = format.parse(jstackStr2); + JStack jstack3 = format.parse(jstackStr3); + + ThreadStack ts1 = jstack1.getThreadStack(SpreadLockDebuggee.THREAD_NAME); + ThreadStack ts2 = jstack2.getThreadStack(SpreadLockDebuggee.THREAD_NAME); + ThreadStack ts3 = jstack3.getThreadStack(SpreadLockDebuggee.THREAD_NAME); + + if (ts1 == null || ts2 == null || ts3 == null) { + throw new RuntimeException( + "One of thread stack trace is null in the first jstack output : " + + ts1 + ", " + ts2 + ", " + ts3); + } + + MonitorInfo[] monitorInfo = new MonitorInfo[6]; + int counter = 0; + + Iterator it = ts1.getStack().iterator(); + while (it.hasNext()) { + MethodInfo mi = it.next(); + if (mi.getName().startsWith(SpreadLockDebuggee.class.getName() + ".a")) { + monitorInfo[counter++] = haveToHaveOneLock(mi); + } + } + + it = ts2.getStack().iterator(); + while (it.hasNext()) { + MethodInfo mi = it.next(); + if (mi.getName().startsWith(SpreadLockDebuggee.class.getName() + ".a") + || mi.getName().startsWith(SpreadLockDebuggee.class.getName() + ".b")) { + monitorInfo[counter++] = haveToHaveOneLock(mi); + } + } + + it = ts3.getStack().iterator(); + while (it.hasNext()) { + MethodInfo mi = it.next(); + if (mi.getName().startsWith(SpreadLockDebuggee.class.getName() + ".a") + || mi.getName().startsWith(SpreadLockDebuggee.class.getName() + ".b") + || mi.getName().startsWith(SpreadLockDebuggee.class.getName() + ".c")) { + monitorInfo[counter++] = haveToHaveOneLock(mi); + } + } + + System.out.println("All monitors found - passed"); + + } + + private MonitorInfo haveToHaveOneLock(MethodInfo mi) { + if (mi.getLocks().size() == 1) { + System.out.println("Method \"" + mi.getName() + + "\" contain 1 lock - correct"); + return mi.getLocks().getFirst(); + } else { + throw new RuntimeException("Lock count (" + + mi.getLocks().size() + ") is incorrect in method \"" + + mi.getName() + "\""); + } + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/ThreadNamesTest.java b/hotspot/test/serviceability/tmtools/jstack/ThreadNamesTest.java new file mode 100644 index 00000000000..c5943d11e98 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/ThreadNamesTest.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary Checks that jstack correctly prints the thread names + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * + * @run main/othervm -XX:+UsePerfData ThreadNamesTest + */ +import common.ToolResults; +import utils.*; + +public class ThreadNamesTest { + + private static final String STRANGE_NAME = "-_?+!@#$%^*()"; + private static final String LONG_NAME = "loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"; + + static class NamedThread extends Thread { + + NamedThread(String name) { + setName(name); + } + + @Override + public void run() { + Utils.sleep(); + } + } + + public static void main(String[] args) throws Exception { + testWithName(STRANGE_NAME); + testWithName(""); + testWithName(LONG_NAME); + } + + private static void testWithName(String name) throws Exception { + // Start a thread with some strange name + NamedThread thread = new NamedThread(name); + thread.start(); + + // Run jstack tool and collect the output + JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid()); + ToolResults results = jstackTool.measure(); + + // Analyze the jstack output for the strange thread name + JStack jstack1 = new DefaultFormat().parse(results.getStdoutString()); + ThreadStack ti1 = jstack1.getThreadStack(name); + + if (ti1 == null) { + throw new RuntimeException("jstack output doesn't contain thread info for the thread '" + name + "'"); + } + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/TraveledLockTest.java b/hotspot/test/serviceability/tmtools/jstack/TraveledLockTest.java new file mode 100644 index 00000000000..9f478158a3f --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/TraveledLockTest.java @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary Create a thread which stops in methods a(), a()->b(), a()->b()->c(), + * synchronizing on one monitor inside of each method. + * After checking that lock info is correct free the lock and + * invoke another method. Repeat this action. + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * + * @run main/othervm -XX:+UsePerfData TraveledLockTest + */ +import common.ToolResults; +import java.util.Iterator; +import utils.*; + +class TraveledLockDebuggee extends Thread { + + static final String THREAD_NAME = "MyThread"; + + TraveledLockDebuggee() { + setName(THREAD_NAME); + } + + Object monitor = new Object(); + + public void c() { + synchronized (monitor) { + Utils.sleep(); + } + } + + public void b() { + try { + synchronized (monitor) { + while (true) { + Thread.sleep(Long.MAX_VALUE); + } + } + } catch (InterruptedException e) { + c(); + } + } + + public void a() { + try { + synchronized (monitor) { + while (true) { + Thread.sleep(Long.MAX_VALUE); + } + } + } catch (InterruptedException e) { + b(); + } + } + + public void run() { + a(); + } + +} + +public class TraveledLockTest { + + public static void main(String[] args) throws Exception { + new TraveledLockTest().doTest(); + } + + private void doTest() throws Exception { + TraveledLockDebuggee debuggee = new TraveledLockDebuggee(); + + // Start in method a() + debuggee.start(); + + // Collect output from the jstack tool + JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid()); + ToolResults results1 = jstackTool.measure(); + + // Go to method b() + debuggee.interrupt(); + + // Collect output from the jstack tool + ToolResults results2 = jstackTool.measure(); + + // Go to method c() + debuggee.interrupt(); + + // Collect output from the jstack tool + ToolResults results3 = jstackTool.measure(); + + analyse(results1.getStdoutString(), results2.getStdoutString(), results3.getStdoutString()); + } + + // Analyzsing the outputs from the 3 jstack runs + public void analyse(String results1, String results2, String results3) { + + String jstackStr1 = results1; + String jstackStr2 = results2; + String jstackStr3 = results3; + + if (jstackStr1 == null) { + throw new RuntimeException("First jstack output is empty"); + } + if (jstackStr2 == null) { + throw new RuntimeException("Second jstack output is empty"); + } + if (jstackStr3 == null) { + throw new RuntimeException("Third jstack output is empty"); + } + + Format format = new DefaultFormat(); + JStack jstack1 = format.parse(jstackStr1); + JStack jstack2 = format.parse(jstackStr2); + JStack jstack3 = format.parse(jstackStr3); + + ThreadStack ts1 = jstack1.getThreadStack(TraveledLockDebuggee.THREAD_NAME); + ThreadStack ts2 = jstack2.getThreadStack(TraveledLockDebuggee.THREAD_NAME); + ThreadStack ts3 = jstack3.getThreadStack(TraveledLockDebuggee.THREAD_NAME); + + if (ts1 == null || ts2 == null || ts3 == null) { + throw new RuntimeException( + "One of thread stack trace is null in the first jstack output : " + + ts1 + ", " + ts2 + ", " + ts3); + } + + MonitorInfo monitorInfo1 = null; + MonitorInfo monitorInfo2 = null; + MonitorInfo monitorInfo3 = null; + + Iterator it = ts1.getStack().iterator(); + while (it.hasNext()) { + MethodInfo mi = it.next(); + if (mi.getName().startsWith(TraveledLockDebuggee.class.getName() + ".a")) { + monitorInfo1 = haveToHaveOneLock(mi); + } + } + + it = ts2.getStack().iterator(); + while (it.hasNext()) { + MethodInfo mi = it.next(); + if (mi.getName().startsWith(TraveledLockDebuggee.class.getName() + ".a")) { + haveToBeEmpty(mi); + } else if (mi.getName().startsWith(TraveledLockDebuggee.class.getName() + ".b")) { + monitorInfo2 = haveToHaveOneLock(mi); + } + } + + it = ts3.getStack().iterator(); + while (it.hasNext()) { + MethodInfo mi = it.next(); + if (mi.getName().startsWith(TraveledLockDebuggee.class.getName() + ".a") + || mi.getName().startsWith(TraveledLockDebuggee.class.getName() + ".b")) { + haveToBeEmpty(mi); + } else if (mi.getName().startsWith(TraveledLockDebuggee.class.getName() + ".c")) { + monitorInfo3 = haveToHaveOneLock(mi); + } + } + + System.out.println("All monitors found - passed"); + } + + private MonitorInfo haveToHaveOneLock(MethodInfo mi) { + if (mi.getLocks().size() == 1) { + System.out.println("Method \"" + mi.getName() + + "\" contain 1 lock - correct"); + return mi.getLocks().getFirst(); + } else { + throw new RuntimeException("Lock count (" + + mi.getLocks().size() + ") is incorrect in method \"" + + mi.getName() + "\""); + } + } + + private void haveToBeEmpty(MethodInfo mi) { + if (mi.getLocks().size() == 0) { + System.out.println("Method \"" + mi.getName() + + "\" does not lock anything - correct"); + } else { + throw new RuntimeException( + "Unexpected lock found in method \"" + mi.getName() + "\""); + } + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java b/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java new file mode 100644 index 00000000000..75b04597cd2 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary Call Object.wait() method. Check that monitor information + * presented in the stack is correct. Call notifyAll method + * monitor info have to disappear from the stack. + * Repeats the same scenario calling interrupt() method + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * + * @run main/othervm -XX:+UsePerfData WaitNotifyThreadTest + */ +import common.ToolResults; +import java.util.Iterator; +import utils.*; + +public class WaitNotifyThreadTest { + + private Object monitor = new Object(); + private final String OBJECT = "a java.lang.Object"; + private final String OBJECT_WAIT = "java.lang.Object.wait"; + + interface Action { + + void doAction(Thread thread); + } + + class ActionNotify implements Action { + + @Override + public void doAction(Thread thread) { + //Notify the waiting thread, so it stops waiting and sleeps + synchronized (monitor) { + monitor.notifyAll(); + } + } + } + + class ActionInterrupt implements Action { + + @Override + public void doAction(Thread thread) { + // Interrupt the thread + thread.interrupt(); + } + } + + class WaitThread extends Thread { + + @Override + public void run() { + try { + synchronized (monitor) { + monitor.wait(); + } + } catch (InterruptedException x) { + + } + Utils.sleep(); + } + } + + public static void main(String[] args) throws Exception { + new WaitNotifyThreadTest().doTest(); + } + + private void doTest() throws Exception { + // Verify stack trace consistency when notifying the thread + doTest(new ActionNotify()); + + // Verify stack trace consistency when interrupting the thread + doTest(new ActionInterrupt()); + } + + private void doTest(Action action) throws Exception { + + final String WAITING_THREAD_NAME = "MyWaitingThread"; + + // Start athread that just waits + WaitThread waitThread = new WaitThread(); + waitThread.setName(WAITING_THREAD_NAME); + waitThread.start(); + + // Collect output from the jstack tool + JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid()); + ToolResults results = jstackTool.measure(); + + // Analyze the jstack output for the patterns needed + JStack jstack1 = new DefaultFormat().parse(results.getStdoutString()); + ThreadStack ti1 = jstack1.getThreadStack(WAITING_THREAD_NAME); + analyzeThreadStackWaiting(ti1); + + action.doAction(waitThread); + + // Collect output from the jstack tool again + results = jstackTool.measure(); + + // Analyze the output again + JStack jstack2 = new DefaultFormat().parse(results.getStdoutString()); + ThreadStack ti2 = jstack2.getThreadStack(WAITING_THREAD_NAME); + analyzeThreadStackNoWaiting(ti2); + + } + + private void analyzeThreadStackWaiting(ThreadStack ti1) { + Iterator it = ti1.getStack().iterator(); + + String monitorAddress = null; + while (it.hasNext()) { + MethodInfo mi = it.next(); + if (mi.getName().startsWith(OBJECT_WAIT) && mi.getCompilationUnit() == null /*native method*/) { + if (mi.getLocks().size() == 1) { + MonitorInfo monInfo = mi.getLocks().getFirst(); + if (monInfo.getType().equals("waiting on") + && monInfo.getMonitorClass().equals(OBJECT)) { + monitorAddress = monInfo.getMonitorAddress(); + } else { + System.err.println("Error: incorrect monitor info: " + monInfo.getType() + ", " + monInfo.getMonitorClass()); + throw new RuntimeException("Incorrect lock record in " + + OBJECT_WAIT + " method"); + } + + } else { + throw new RuntimeException(OBJECT_WAIT + + " method has to contain one lock record bu it contains " + mi.getLocks().size()); + } + } + + if (mi.getName().startsWith("WaitThread.run")) { + if (monitorAddress == null) { + throw new RuntimeException("Cannot found monitor info associated with " + OBJECT_WAIT + " method"); + } + + int numLocks = mi.getLocks().size(); + for (int i = 0; i < numLocks - 1; ++i) { + assertMonitorInfo("waiting to re-lock in wait()", mi.getLocks().get(i), monitorAddress); + } + assertMonitorInfo("locked", mi.getLocks().getLast(), monitorAddress); + } + } + + } + + private void assertMonitorInfo(String expectedMessage, MonitorInfo monInfo, String monitorAddress) { + if (monInfo.getType().equals(expectedMessage) + && monInfo.getMonitorClass().equals(OBJECT + "11") + && monInfo.getMonitorAddress().equals( + monitorAddress)) { + System.out.println("Correct monitor info found"); + } else { + System.err.println("Error: incorrect monitor info: " + monInfo.getType() + ", " + monInfo.getMonitorClass() + ", " + monInfo.getMonitorAddress()); + System.err.println("Expected: " + expectedMessage + ", a java.lang.Object, " + monitorAddress); + throw new RuntimeException("Incorrect lock record in 'run' method"); + } + } + + private void analyzeThreadStackNoWaiting(ThreadStack ti2) { + Iterator it = ti2.getStack().iterator(); + + while (it.hasNext()) { + MethodInfo mi = it.next(); + if (mi.getLocks().size() != 0) { + throw new RuntimeException("Unexpected lock record in " + + mi.getName() + " method"); + } + } + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/utils/Consts.java b/hotspot/test/serviceability/tmtools/jstack/utils/Consts.java new file mode 100644 index 00000000000..0a85cb0a153 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/utils/Consts.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package utils; + +/** + * + * Class includes reused constants across jstack's tests + * + */ +public class Consts { + + public static final String UNKNOWN = "XXXXXX"; + public static final String JNI_GLOBAL_REF = "JNI global references: "; + public static final String SCENARIO_NAME = "scenario"; + public static final String SEPARATOR = " "; + + public static String REENTRANT_LOCK_NONFAIR = "a java.util.concurrent.locks.ReentrantLock$NonfairSync"; + public static String REENTRANT_LOCK_FAIR = "a java.util.concurrent.locks.ReentrantLock$FairSync"; + public static final String FFORMAT_REENTRANT_LOCK_NONFAIR = "a java/util/concurrent/locks/ReentrantLock$NonfairSync"; + public static final String FFORMAT_REENTRANT_LOCK_FAIR = "a java/util/concurrent/locks/ReentrantLock$FairSync"; + + public static String REENTRANT_RW_LOCK_NONFAIR = "a java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync"; + public static String REENTRANT_RW_LOCK_FAIR = "a java.util.concurrent.locks.ReentrantReadWriteLock$FairSync"; + public static final String FFORMAT_REENTRANT_RW_LOCK_NONFAIR = "a java/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync"; + public static final String FFORMAT_REENTRANT_RW_LOCK_FAIR = "a java/util/concurrent/locks/ReentrantReadWriteLock$FairSync"; + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/utils/DefaultFormat.java b/hotspot/test/serviceability/tmtools/jstack/utils/DefaultFormat.java new file mode 100644 index 00000000000..4c753a5c0c9 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/utils/DefaultFormat.java @@ -0,0 +1,266 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package utils; + +import java.util.Map; +import java.util.Scanner; +import java.util.regex.MatchResult; + +/** + * + * jstack default format 2008-03-05 18:36:26 Full thread dump Java HotSpot(TM) + * Client VM (11.0-b11 mixed mode): + * + * "Thread-16" #10 daemon prio=3 os_prio=0 tid=0x0814d800 nid=0x1d runnable + * [0xf394d000..0xf394d9f0] java.lang.Thread.State: RUNNABLE at + * java.net.SocketInputStream.socketRead0(Native Method) at + * java.net.SocketInputStream.read(SocketInputStream.java:129) at + * java.net.SocketInputStream.read(SocketInputStream.java:182) at + * java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2249) + * at + * java.io.ObjectInputStream$BlockDataInputStream.peek(ObjectInputStream.java:2542) + * at + * java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2552) + * at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1297) at + * java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at + * tmtools.share.debuggee.DebuggeeProtocolHandler.run(DebuggeeProtocolHandler.java:32) + * + * Locked ownable synchronizers: - None .... + * + * Note that os_prio field is optional and will be printed only if JVM was able + * to get native thread priority. + */ +public class DefaultFormat implements Format { + + protected String threadInfoPattern() { + return "^\"(.*)\"\\s(#\\d+\\s|)(daemon\\s|)prio=(.+)\\s(os_prio=(.+)\\s|)tid=(.+)\\snid=(.+)\\s(" + + Consts.UNKNOWN + + "|runnable|waiting\\son\\scondition|in\\sObject\\.wait\\(\\)|waiting\\sfor\\smonitor\\sentry)((.*))$"; + } + + protected String methodInfoPattern() { + return "^\\s+at\\s(.+)\\((.*?)(\\:|\\))((.*?))\\)?$"; + } + + protected String extendedStatusPattern() { + return "\\s+java\\.lang\\.Thread\\.State\\:\\s((.+))$"; + } + + protected String jniGlobalRefInfoPattern() { + return "^JNI\\sglobal\\sreferences:\\s((.+))$"; + } + + protected String monitorInfoPattern() { + return "^\\s+\\-\\s(locked|waiting\\son|waiting\\sto\\slock)\\s\\<(.*)\\>\\s\\(((.*))\\)$"; + } + + protected String vmVersionInfoPattern() { + return "Full\\sthread\\sdump\\s.*"; + } + + protected String ownableSynchronizersPattern() { + return "^\\s+\\-\\s(\\<.*\\>\\s\\(((.*))\\)|None)$"; + } + + public JStack parse(String stack) { + JStack result = new JStack(); + Scanner scanner = new Scanner(stack); + + // parsing thread stacks + ThreadStack currentThreadStack = null; + MethodInfo currentMethodInfo = null; + + try { + while (scanner.hasNextLine()) { + String line = scanner.nextLine(); + if (line.matches(threadInfoPattern())) { + currentThreadStack = parseThreadInfo(line); + result.addThreadStack(currentThreadStack.getThreadName(), currentThreadStack); + } else if (line.matches(methodInfoPattern())) { + currentMethodInfo = parseMethodInfo(line); + currentThreadStack.addMethod(currentMethodInfo); + } else if (line.matches(monitorInfoPattern())) { + MonitorInfo mi = parseMonitorInfo(line); + currentMethodInfo.getLocks().add(mi); + } else if (line.matches(extendedStatusPattern())) { + currentThreadStack.setExtendedStatus(parseExtendedStatus(line)); + } else if (line.matches(vmVersionInfoPattern())) { + result.setVmVersion(line); + } else if (line.matches(ownableSynchronizersPattern())) { + currentThreadStack.getLockOSList().add(parseLockInfo(line)); + } else if (line.matches(jniGlobalRefInfoPattern())) { + result.setJniGlobalReferences(parseJNIGlobalRefs(line)); + } else if (line.length() != 0) { + System.err.println("[Warning] Unknown string: " + line); + } + } + + scanner.close(); + + } catch (NullPointerException e) { + e.printStackTrace(); + throw new RuntimeException("Unexpected format in jstack output"); + } + + return result; + } + + private MonitorInfo parseMonitorInfo(String line) { + Scanner s = new Scanner(line); + s.findInLine(monitorInfoPattern()); + MonitorInfo mi = new MonitorInfo(); + MatchResult res = s.match(); + + mi.setType(res.group(1)); + mi.setMonitorAddress(res.group(2)); + mi.setMonitorClass(res.group(3)); + + return mi; + } + + protected String parseExtendedStatus(String line) { + Scanner s = new Scanner(line); + s.findInLine(extendedStatusPattern()); + String result = s.match().group(1); + s.close(); + return result; + } + + protected String parseJNIGlobalRefs(String line) { + Scanner s = new Scanner(line); + s.findInLine(jniGlobalRefInfoPattern()); + String result = s.match().group(1); + s.close(); + return result; + } + + protected ThreadStack parseThreadInfo(String threadInfo) { + Scanner s = new Scanner(threadInfo); + ThreadStack result = new ThreadStack(); + + // parsing thread info + s.findInLine(threadInfoPattern()); + MatchResult res = s.match(); + + result.setThreadName(res.group(1)); + + result.setType(res.group(3)); + + result.setPriority(res.group(4)); + result.setTid(res.group(7)); + result.setNid(res.group(8)); + result.setStatus(res.group(9)); + + s.close(); + return result; + } + + protected MethodInfo parseMethodInfo(String line) { + + MethodInfo result = new MethodInfo(); + Scanner s = new Scanner(line); + + s.findInLine(methodInfoPattern()); + MatchResult rexp = s.match(); + if (rexp.group(4) != null && rexp.group(4).length() > 0) { + // line " at tmtools.jstack.share.utils.Utils.sleep(Utils.java:29)" + result.setName(rexp.group(1)); + result.setCompilationUnit(rexp.group(2)); + result.setLine(rexp.group(4)); + + } else { + // line " at java.lang.Thread.sleep(Native Method)" + result.setName(rexp.group(1)); + } + + s.close(); + return result; + } + + public String dumpStackTraces() { + StringBuffer result = new StringBuffer(); + Map stacks = Thread.getAllStackTraces(); + + // adding data and vm version + result.append(Consts.UNKNOWN + "\n"); + result.append(Consts.UNKNOWN + "\n\n"); + + for (Thread t : stacks.keySet()) { + + result.append("\"" + t.getName() + "\""); + result.append(Consts.SEPARATOR); + + // status + if (t.isDaemon()) { + result.append("daemon"); + result.append(Consts.SEPARATOR); + } + + // priority + result.append("prio=" + t.getPriority()); + result.append(Consts.SEPARATOR); + + // tid + result.append("tid=" + Consts.UNKNOWN); + result.append(Consts.SEPARATOR); + + // nid + result.append("nid=" + Consts.UNKNOWN); + result.append(Consts.SEPARATOR); + + // status + result.append(Consts.UNKNOWN); + result.append(Consts.SEPARATOR); + + result.append("\n"); + + // extended status + result.append(" java.lang.Thread.State: " + + String.valueOf(Thread.currentThread().getState())); + result.append(Consts.SEPARATOR); + result.append("\n"); + + for (StackTraceElement st : stacks.get(t)) { + result.append(" at " + st.toString() + "\n"); + } + result.append("\n"); + } + + result.append(Consts.JNI_GLOBAL_REF + Consts.UNKNOWN + "\n"); + return result.toString(); + } + + protected LockInfo parseLockInfo(String line) { + LockInfo res = new LockInfo(); + + Scanner s = new Scanner(line); + s.findInLine(ownableSynchronizersPattern()); + + MatchResult matchRes = s.match(); + String lock = matchRes.group(1).equals("None") ? matchRes.group(1) : matchRes.group(2); + res.setLock(lock); + + return res; + } + +} diff --git a/hotspot/src/share/vm/oops/typeArrayOop.cpp b/hotspot/test/serviceability/tmtools/jstack/utils/Format.java similarity index 81% rename from hotspot/src/share/vm/oops/typeArrayOop.cpp rename to hotspot/test/serviceability/tmtools/jstack/utils/Format.java index d3551e0cf3f..43ad5edbacc 100644 --- a/hotspot/src/share/vm/oops/typeArrayOop.cpp +++ b/hotspot/test/serviceability/tmtools/jstack/utils/Format.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -19,11 +19,16 @@ * 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 utils; + +/** + * + * Base class for all formats * */ +public interface Format { -#include "precompiled.hpp" -#include "oops/oop.inline.hpp" -#include "oops/typeArrayOop.hpp" + public JStack parse(String stack); -// <> +} diff --git a/hotspot/test/serviceability/tmtools/jstack/utils/JStack.java b/hotspot/test/serviceability/tmtools/jstack/utils/JStack.java new file mode 100644 index 00000000000..1aa23eef052 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/utils/JStack.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package utils; + +import java.util.HashMap; + +/** + * + * Represents stack of all threads + some extra information + * + */ +public class JStack { + + private String date; + private String vmVersion; + private HashMap threads = new HashMap(); + private String jniGlobalReferences; + + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public String getVmVersion() { + return vmVersion; + } + + public void setVmVersion(String vmVersion) { + this.vmVersion = vmVersion; + } + + public HashMap getThreads() { + return threads; + } + + public void setThreads(HashMap threads) { + this.threads = threads; + } + + public void addThreadStack(String threadName, ThreadStack ts) { + System.out.println("Adding thread stack for thread: " + threadName); + threads.put(threadName, ts); + } + + public String getJniGlobalReferences() { + return jniGlobalReferences; + } + + public void setJniGlobalReferences(String jniGlobalReferences) { + this.jniGlobalReferences = jniGlobalReferences; + } + + public ThreadStack getThreadStack(String threadName) { + return threads.get(threadName); + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/utils/LockInfo.java b/hotspot/test/serviceability/tmtools/jstack/utils/LockInfo.java new file mode 100644 index 00000000000..8637041bba5 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/utils/LockInfo.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package utils; + +/** + * + * Represents lock info string + * + */ +public class LockInfo { + + private String lock; + + public String getLock() { + return lock; + } + + public void setLock(String lock) { + this.lock = lock; + } +} diff --git a/hotspot/test/serviceability/tmtools/jstack/utils/MethodInfo.java b/hotspot/test/serviceability/tmtools/jstack/utils/MethodInfo.java new file mode 100644 index 00000000000..7cfc40b3860 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/utils/MethodInfo.java @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package utils; + +import java.util.LinkedList; + +/** + * + * Represents method info string + * + */ +public class MethodInfo { + + private String name; + private String compilationUnit; + private String args; + private String bci; + private String line; + private String frameType; + + private LinkedList locks = new LinkedList(); + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCompilationUnit() { + return compilationUnit; + } + + public void setCompilationUnit(String compilationUnit) { + this.compilationUnit = compilationUnit; + } + + public String getArgs() { + return args; + } + + public void setArgs(String args) { + this.args = args; + } + + public String getBci() { + return bci; + } + + public void setBci(String bci) { + this.bci = bci; + } + + public String getLine() { + return line; + } + + public void setLine(String line) { + this.line = line; + } + + public String getFrameType() { + return frameType; + } + + public void setFrameType(String frameType) { + this.frameType = frameType; + } + + public LinkedList getLocks() { + return locks; + } + + public void setLocks(LinkedList locks) { + this.locks = locks; + } + + public boolean equals(MethodInfo another) { + + boolean result = true; + + if (!Utils.compareStrings(name, another.name)) { + Utils.log("name", name, another.name); + result = false; + } + + if (!Utils.compareStrings(compilationUnit, another.compilationUnit)) { + Utils.log("compilationUnit", compilationUnit, another.compilationUnit); + result = false; + } + + /* + if (!Utils.compareStrings(args, another.args)) { + Utils.log("args", args, another.args); + result = false; + } + + if (!Utils.compareStrings(bci, another.bci)) { + Utils.log("bci", bci, another.bci); + result = false; + } + + if (!Utils.compareStrings(frameType, another.frameType)) { + Utils.log("frameType", frameType, another.frameType); + result = false; + } + */ + if (!Utils.compareStrings(line, another.line)) { + Utils.log("line", line, another.line); + result = false; + } + + return result; + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/utils/MonitorInfo.java b/hotspot/test/serviceability/tmtools/jstack/utils/MonitorInfo.java new file mode 100644 index 00000000000..e94033d6662 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/utils/MonitorInfo.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package utils; + +/** + * + * Represents monitor info string + * + */ +public class MonitorInfo { + + private String type; + private String monitorAddress; + private String monitorClass; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getMonitorAddress() { + return monitorAddress; + } + + public void setMonitorAddress(String monitorAddress) { + this.monitorAddress = monitorAddress; + } + + public String getMonitorClass() { + return monitorClass; + } + + public void setMonitorClass(String monitorClass) { + this.monitorClass = monitorClass; + } + + public boolean equals(MonitorInfo another) { + if (!type.equals(another.type)) { + Utils.log("type", type, another.type); + return false; + } + + if (!monitorAddress.equals(another.monitorAddress)) { + Utils.log("monitorAddress", monitorAddress, another.monitorAddress); + return false; + } + + if (!monitorClass.equals(another.monitorClass)) { + Utils.log("monitorClass", monitorClass, another.monitorClass); + return false; + } + + return true; + } + + public String toString() { + return type + " <" + monitorAddress + "> (" + monitorClass + ")"; + } +} diff --git a/hotspot/test/serviceability/tmtools/jstack/utils/ThreadStack.java b/hotspot/test/serviceability/tmtools/jstack/utils/ThreadStack.java new file mode 100644 index 00000000000..5e92fb8d2dc --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/utils/ThreadStack.java @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package utils; + +import java.util.Iterator; +import java.util.LinkedList; + +/** + * + * Represents the stack of the thread + * + */ +public class ThreadStack { + + private String threadType; // Thread / RealtimeThread / NoHeapRealtimeThread + private String threadName; + private String type; //daemon or not + private String priority; + private String tid; + private String nid; + + /** + * runnable or waiting on condition + */ + private String status; + private String pointerRange; + + /** + * i.e. java.lang.Thread.State: WAITING (on object monitor) + */ + private String extendedStatus; + + private LinkedList stack = new LinkedList(); + + private LinkedList lockOSList = new LinkedList(); + + public String getThreadName() { + return threadName; + } + + public void setThreadName(String threadName) { + this.threadName = threadName; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getPriority() { + return priority; + } + + public void setPriority(String priority) { + this.priority = priority; + } + + public String getTid() { + return tid; + } + + public void setTid(String tid) { + this.tid = tid; + } + + public String getNid() { + return nid; + } + + public void setNid(String nid) { + this.nid = nid; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getPointerRange() { + return pointerRange; + } + + public void setPointerRange(String pointerRange) { + this.pointerRange = pointerRange; + } + + public String getExtendedStatus() { + return extendedStatus; + } + + public void setExtendedStatus(String extendedStatus) { + this.extendedStatus = extendedStatus; + } + + public LinkedList getStack() { + return stack; + } + + public LinkedList getLockOSList() { + return lockOSList; + } + + public void setLockOSList(LinkedList lockOSList) { + this.lockOSList = lockOSList; + } + + public void addMethod(MethodInfo mi) { + stack.add(mi); + } + + public boolean hasEqualStack(ThreadStack another) { + boolean result = true; + + Iterator it1 = stack.iterator(); + Iterator it2 = another.stack.iterator(); + + while (it1.hasNext() && it2.hasNext()) { + + MethodInfo mi1 = it1.next(); + MethodInfo mi2 = it2.next(); + + if (mi1 == null && mi2 == null) { + break; + } + + boolean oneOfMethodInfoIsNull = mi1 == null && mi2 != null || mi1 != null && mi2 == null; + + if (oneOfMethodInfoIsNull || !mi1.equals(mi2)) { + result = false; + } + } + + if (it1.hasNext() || it2.hasNext()) { + Utils.log("stack sizes", String.valueOf(stack.size()), String.valueOf(another.stack.size())); + result = false; + } + + return result; + } + + public String getThreadType() { + return threadType; + } + + public void setThreadType(String threadType) { + this.threadType = threadType; + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/utils/Utils.java b/hotspot/test/serviceability/tmtools/jstack/utils/Utils.java new file mode 100644 index 00000000000..33e0414486f --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/utils/Utils.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package utils; + +public class Utils { + + public static void log(String field, String val1, String val2) { + System.out.println(field + " mismatch. " + val1 + " vs " + val2); + } + + public static boolean compareStrings(String s1, String s2) { + + if (s1 != null && s1.equals(Consts.UNKNOWN) + || s2 != null && s2.equals(Consts.UNKNOWN)) { + return true; + } + + if (s1 == null && s2 != null || s1 != null && s2 == null) { + return false; + } + + if (s1 == null || s2 == null) { + return true; + } + return s1.equals(s2); + } + + public static void sleep() { + try { + while (true) { + Thread.sleep(Long.MAX_VALUE); + } + } catch (InterruptedException e) { + } + } +} diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java b/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java new file mode 100644 index 00000000000..e695ca3d9bb --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import utils.*; + +/* + * @test + * @summary Test checks the consistency of the output + * displayed with jstat -gccapacity. + * @library /test/lib/share/classes + * @library ../share + * @ignore 8147848 + * @build common.* + * @build utils.* + * @run main/othervm -XX:+UsePerfData GcCapacityTest + */ +public class GcCapacityTest { + + public static void main(String[] args) throws Exception { + + // We will be running "jstat -gc" tool + JstatGcCapacityTool jstatGcTool = new JstatGcCapacityTool(ProcessHandle.current().getPid()); + + // Run once and get the results asserting that they are reasonable + JstatGcCapacityResults measurement1 = jstatGcTool.measure(); + measurement1.assertConsistency(); + + // Provoke a gc and verify the changed values + GcProvoker gcProvoker = GcProvoker.createGcProvoker(); + gcProvoker.provokeGc(); + JstatGcCapacityResults measurement2 = jstatGcTool.measure(); + measurement2.assertConsistency(); + + // Assert that the GC events count has increased + JstatResults.assertGCEventsIncreased(measurement1, measurement2); + + // Provoke a gc again and verify the changed values + gcProvoker.provokeGc(); + JstatGcCapacityResults measurement3 = jstatGcTool.measure(); + measurement3.assertConsistency(); + + // Assert that the GC events count has increased + JstatResults.assertGCEventsIncreased(measurement1, measurement2); + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java new file mode 100644 index 00000000000..b233f770d61 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary Test checks output displayed with jstat -gccause. + * Test scenario: + * test several times provokes garbage collection in the debuggee application and after each garbage + * collection runs jstat. jstat should show that after garbage collection number of GC events and garbage + * collection time increase. + * @library /test/lib/share/classes + * @library ../share + * @ignore 8147848 + * @build common.* + * @build utils.* + * + * @run main/othervm -XX:+UsePerfData GcCauseTest01 + */ +import utils.*; + +public class GcCauseTest01 { + + public static void main(String[] args) throws Exception { + + // We will be running "jstat -gc" tool + JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().getPid()); + + // Run once and get the results asserting that they are reasonable + JstatGcCauseResults measurement1 = jstatGcTool.measure(); + measurement1.assertConsistency(); + + GcProvoker gcProvoker = GcProvoker.createGcProvoker(); + + // Provoke GC then run the tool again and get the results asserting that they are reasonable + gcProvoker.provokeGc(); + JstatGcCauseResults measurement2 = jstatGcTool.measure(); + measurement2.assertConsistency(); + + // Assert the increase in GC events and time between the measurements + JstatResults.assertGCEventsIncreased(measurement1, measurement2); + JstatResults.assertGCTimeIncreased(measurement1, measurement2); + + // Provoke GC 3rd time then run the tool 3rd time twice and get the results + // asserting that they are reasonable + gcProvoker.provokeGc(); + JstatGcCauseResults measurement3 = jstatGcTool.measure(); + measurement3.assertConsistency(); + + // Assert the increase in GC events and time between the measurements + JstatResults.assertGCEventsIncreased(measurement2, measurement3); + JstatResults.assertGCTimeIncreased(measurement2, measurement3); + } +} diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest02.java b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest02.java new file mode 100644 index 00000000000..bc8f0058034 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest02.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary Test checks output displayed with jstat -gccause. + * Test scenario: + * tests forces debuggee application eat ~70% of heap and runs jstat. + * jstat should show that ~70% of heap (OC/OU ~= 70%). + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * @build utils.* + * + * @run main/othervm -XX:+UsePerfData -Xms128M -XX:MaxMetaspaceSize=128M GcCauseTest02 + */ +import utils.*; + +public class GcCauseTest02 { + + private final static float targetMemoryUsagePercent = 0.7f; + + public static void main(String[] args) throws Exception { + + // We will be running "jstat -gc" tool + JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().getPid()); + + // Run once and get the results asserting that they are reasonable + JstatGcCauseResults measurement1 = jstatGcTool.measure(); + measurement1.assertConsistency(); + + GcProvoker gcProvoker = GcProvoker.createGcProvoker(); + + // Eat metaspace and heap then run the tool again and get the results asserting that they are reasonable + gcProvoker.eatMetaspaceAndHeap(targetMemoryUsagePercent); + JstatGcCauseResults measurement2 = jstatGcTool.measure(); + measurement2.assertConsistency(); + + // Assert that space has been utilized acordingly + JstatResults.assertSpaceUtilization(measurement2, targetMemoryUsagePercent); + } +} diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest03.java b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest03.java new file mode 100644 index 00000000000..1ebb98b00b5 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest03.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary Test checks output displayed with jstat -gccause. + * Test scenario: + * test forces debuggee application call System.gc(), runs jstat and checks that + * cause of last garbage collection displayed by jstat (LGCC) is 'System.gc()'. + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * @build utils.* + * + * @run main/othervm -XX:+UsePerfData -Xms128M -XX:MaxMetaspaceSize=128M GcCauseTest03 + */ +import utils.*; + +public class GcCauseTest03 { + + private final static float targetMemoryUsagePercent = 0.7f; + + public static void main(String[] args) throws Exception { + + // We will be running "jstat -gc" tool + JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().getPid()); + + System.gc(); + + // Run once and get the results asserting that they are reasonable + JstatGcCauseResults measurement = jstatGcTool.measure(); + measurement.assertConsistency(); + + if (measurement.valueExists("LGCC")) { + if (!"System.gc()".equals(measurement.getStringValue("LGCC"))) { + throw new RuntimeException("Unexpected GC cause: " + measurement.getStringValue("LGCC") + ", expected System.gc()"); + } + } + + } +} diff --git a/hotspot/test/serviceability/tmtools/jstat/GcNewTest.java b/hotspot/test/serviceability/tmtools/jstat/GcNewTest.java new file mode 100644 index 00000000000..e91ee8ecdf6 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/GcNewTest.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import utils.*; +/* + * @test + * @summary Test checks output displayed with jstat -gcnew. + * Test scenario: + * test several times provokes garbage collection in the debuggee application and after each garbage + * collection runs jstat. jstat should show that after garbage collection number of GC events and garbage + * collection time increase. + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * @build utils.* + * @run main/othervm -XX:+UsePerfData GcNewTest + */ + +public class GcNewTest { + + public static void main(String[] args) throws Exception { + + // We will be running "jstat -gc" tool + JstatGcNewTool jstatGcTool = new JstatGcNewTool(ProcessHandle.current().getPid()); + + // Run once and get the results asserting that they are reasonable + JstatGcNewResults measurement1 = jstatGcTool.measure(); + measurement1.assertConsistency(); + + GcProvoker gcProvoker = GcProvoker.createGcProvoker(); + + // Provoke GC and run the tool again + gcProvoker.provokeGc(); + JstatGcNewResults measurement2 = jstatGcTool.measure(); + measurement2.assertConsistency(); + + // Assert the increase in GC events and time between the measurements + assertThat(measurement2.getFloatValue("YGC") > measurement1.getFloatValue("YGC"), "YGC didn't increase between measurements 1 and 2"); + assertThat(measurement2.getFloatValue("YGCT") > measurement1.getFloatValue("YGCT"), "YGCT time didn't increase between measurements 1 and 2"); + + // Provoke GC and run the tool again + gcProvoker.provokeGc(); + JstatGcNewResults measurement3 = jstatGcTool.measure(); + measurement3.assertConsistency(); + + // Assert the increase in GC events and time between the measurements + assertThat(measurement3.getFloatValue("YGC") > measurement2.getFloatValue("YGC"), "YGC didn't increase between measurements 1 and 2"); + assertThat(measurement3.getFloatValue("YGCT") > measurement2.getFloatValue("YGCT"), "YGCT time didn't increase between measurements 1 and 2"); + + } + + private static void assertThat(boolean result, String message) { + if (!result) { + throw new RuntimeException(message); + }; + } +} diff --git a/hotspot/test/serviceability/tmtools/jstat/GcTest01.java b/hotspot/test/serviceability/tmtools/jstat/GcTest01.java new file mode 100644 index 00000000000..6b1c92bda8e --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/GcTest01.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary Test checks output displayed with jstat -gc. + * Test scenario: + * test several times provokes garbage collection + * in the debuggee application + * and after each garbage collection runs jstat. + * jstat should show that after garbage collection + * number of GC events and garbage + * collection time increase. + * @library /test/lib/share/classes + * @library ../share + * @ignore 8147848 + * @build common.* + * @build utils.* + * + * @run main/othervm -XX:+UsePerfData GcTest01 + */ +import utils.*; + +public class GcTest01 { + + public static void main(String[] args) throws Exception { + + // We will be running "jstat -gc" tool + JstatGcTool jstatGcTool = new JstatGcTool(ProcessHandle.current().getPid()); + + // Run once and get the results asserting that they are reasonable + JstatGcResults measurement1 = jstatGcTool.measure(); + measurement1.assertConsistency(); + + GcProvoker gcProvoker = GcProvoker.createGcProvoker(); + + // Provoke GC then run the tool again and get the results + // asserting that they are reasonable + gcProvoker.provokeGc(); + JstatGcResults measurement2 = jstatGcTool.measure(); + measurement2.assertConsistency(); + + // Assert the increase in GC events and time between the measurements + JstatResults.assertGCEventsIncreased(measurement1, measurement2); + JstatResults.assertGCTimeIncreased(measurement1, measurement2); + + // Provoke GC again and get the results + // asserting that they are reasonable + gcProvoker.provokeGc(); + JstatGcResults measurement3 = jstatGcTool.measure(); + measurement3.assertConsistency(); + + // Assert the increase in GC events and time between the measurements + JstatResults.assertGCEventsIncreased(measurement2, measurement3); + JstatResults.assertGCTimeIncreased(measurement2, measurement3); + + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/GcTest02.java b/hotspot/test/serviceability/tmtools/jstat/GcTest02.java new file mode 100644 index 00000000000..c2e55229688 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/GcTest02.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import utils.*; +/* + * @test + * @summary Test checks output displayed with jstat -gc. + * Test scenario: + * tests forces debuggee application eat ~70% of heap and runs jstat. + * jstat should show that ~70% of heap is utilized (OC/OU ~= 70%). + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * @build utils.* + * @run main/othervm -XX:+UsePerfData -Xms128M -XX:MaxMetaspaceSize=128M GcTest02 + */ + +public class GcTest02 { + + private final static float targetMemoryUsagePercent = 0.7f; + + public static void main(String[] args) throws Exception { + + // We will be running "jstat -gc" tool + JstatGcTool jstatGcTool = new JstatGcTool(ProcessHandle.current().getPid()); + + // Run once and get the results asserting that they are reasonable + JstatGcResults measurement1 = jstatGcTool.measure(); + measurement1.assertConsistency(); + + GcProvoker gcProvoker = GcProvoker.createGcProvoker(); + + // Eat metaspace and heap then run the tool again and get the results asserting that they are reasonable + gcProvoker.eatMetaspaceAndHeap(targetMemoryUsagePercent); + JstatGcResults measurement2 = jstatGcTool.measure(); + measurement2.assertConsistency(); + + // Assert that space has been utilized acordingly + JstatResults.assertSpaceUtilization(measurement2, targetMemoryUsagePercent); + } + + private static void assertThat(boolean result, String message) { + if (!result) { + throw new RuntimeException(message); + }; + } +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/ClassLoadUtils.java b/hotspot/test/serviceability/tmtools/jstat/utils/ClassLoadUtils.java new file mode 100644 index 00000000000..f233d62d174 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/ClassLoadUtils.java @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package utils; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.FileInputStream; + +public class ClassLoadUtils { + + private ClassLoadUtils() { + } + + /** + * Get filename of class file from classpath for given class name. + * + * @param className class name + * @return filename or null if not found + */ + public static String getClassPath(String className) { + String fileName = className.replace(".", File.separator) + ".class"; + String[] classPath = System.getProperty("java.class.path").split(File.pathSeparator); + File target = null; + int i; + for (i = 0; i < classPath.length; ++i) { + target = new File(classPath[i] + File.separator + fileName); + System.out.println("Try: " + target); + if (target.exists()) { + break; + } + } + if (i != classPath.length) { + return classPath[i]; + } + return null; + } + + /** + * Get filename of class file from classpath for given class name. + * + * @param className class name + * @return filename or null if not found + */ + public static String getClassPathFileName(String className) { + String fileName = className.replace(".", File.separator) + ".class"; + String[] classPath = System.getProperty("java.class.path").split(File.pathSeparator); + File target = null; + int i; + for (i = 0; i < classPath.length; ++i) { + target = new File(classPath[i] + File.separator + fileName); + System.out.println("Try: " + target); + if (target.exists()) { + break; + } + } + if (i != classPath.length) { + try { + return target.getCanonicalPath(); + } catch (IOException e) { + return null; + } + } + return null; + } + + public static String getRedefineClassFileName(String dir, String className) { + String fileName = getClassPathFileName(className); + if (fileName == null) { + return null; + } + if (fileName.contains("classes")) { + return fileName.replace("classes", dir); + } else { + String classPath = getClassPath(className); + if (classPath != null) { + return classPath + File.separator + "newclass" + File.separator + className.replace(".", File.separator) + ".class"; + } else { + return null; + } + } + } + + /** + * Get filename of class file which is to be redefined. + */ + public static String getRedefineClassFileName(String className) { + return getRedefineClassFileName("newclass", className); + } + + /** + * Read whole file. + * + * @param file file + * @return contents of file as byte array + */ + public static byte[] readFile(File file) throws IOException { + InputStream in = new FileInputStream(file); + long countl = file.length(); + if (countl > Integer.MAX_VALUE) { + throw new IOException("File is too huge"); + } + int count = (int) countl; + byte[] buffer = new byte[count]; + int n = 0; + try { + while (n < count) { + int k = in.read(buffer, n, count - n); + if (k < 0) { + throw new IOException("Unexpected EOF"); + } + n += k; + } + } finally { + in.close(); + } + return buffer; + } + + /** + * Read whole file. + * + * @param name file name + * @return contents of file as byte array + */ + public static byte[] readFile(String name) throws IOException { + return readFile(new File(name)); + } +} diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp b/hotspot/test/serviceability/tmtools/jstat/utils/GcProvoker.java similarity index 55% rename from hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp rename to hotspot/test/serviceability/tmtools/jstat/utils/GcProvoker.java index 285b6f2306a..697b4225452 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp +++ b/hotspot/test/serviceability/tmtools/jstat/utils/GcProvoker.java @@ -1,6 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, 2015 SAP AG. All rights reserved. + * Copyright (c) 2015, 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 @@ -20,23 +19,37 @@ * 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 utils; + +/** + * This is an interface used to provoke GC and perform other GC-related + * procedures * */ +public interface GcProvoker { -#ifndef CPU_PPC_VM_TEMPLATEINTERPRETER_PPC_HPP -#define CPU_PPC_VM_TEMPLATEINTERPRETER_PPC_HPP + /** + * The default implementation + * + * @return the default GC provoker + */ + public static GcProvoker createGcProvoker() { + return new GcProvokerImpl(); + } - protected: + /** + * This method provokes a GC + */ + public void provokeGc(); - // Size of interpreter code. Increase if too small. Interpreter will - // fail with a guarantee ("not enough space for interpreter generation"); - // if too small. - // Run with +PrintInterpreter to get the VM to print out the size. - // Max size with JVMTI - const static int InterpreterCodeSize = 230*K; + /** + * Eats heap and metaspace Upon exit targetMemoryUsagePercent percents of + * heap and metaspace is have been eaten + * + * @param targetMemoryUsagePercent how many percent of heap and metaspace to + * eat + */ + public void eatMetaspaceAndHeap(float targetMemoryUsagePercent); - public: - // Support abs and sqrt like in compiler. - // For others we can use a normal (native) entry. - static bool math_entry_available(AbstractInterpreter::MethodKind kind); -#endif // CPU_PPC_VM_TEMPLATEINTERPRETER_PPC_HPP +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java b/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java new file mode 100644 index 00000000000..309a5bd76db --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package utils; + +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryPoolMXBean; +import java.lang.management.MemoryUsage; +import java.util.ArrayList; +import java.util.List; + +/** + * + * Utilities to provoke GC in various ways + */ +public class GcProvokerImpl implements GcProvoker { + + private static List eatenMetaspace; + private static List eatenMemory; + + static List eatHeapMemory(float targetUsage) { + long maxMemory = Runtime.getRuntime().maxMemory(); + // uses fixed small objects to avoid Humongous objects allocation in G1 + int memoryChunk = 2048; + List list = new ArrayList<>(); + float used = 0; + while (used < targetUsage * maxMemory) { + try { + list.add(new byte[memoryChunk]); + used += memoryChunk; + } catch (OutOfMemoryError e) { + list = null; + throw new RuntimeException("Unexpected OOME while eating " + targetUsage + " of heap memory."); + } + } + return list; + } + + @Override + public void provokeGc() { + for (int i = 0; i < 3; i++) { + long edenSize = Pools.getEdenCommittedSize(); + long heapSize = Pools.getHeapCommittedSize(); + float targetPercent = ((float) edenSize) / (heapSize); + if ((targetPercent <= 0) || (targetPercent > 1.0)) { + throw new RuntimeException("Error in the percent calculation" + " (eden size: " + edenSize + ", heap size: " + heapSize + ", calculated eden percent: " + targetPercent + ")"); + } + eatHeapMemory(targetPercent); + eatHeapMemory(targetPercent); + System.gc(); + } + } + + @Override + public void eatMetaspaceAndHeap(float targetMemoryUsagePercent) { + eatenMemory = eatHeapMemory(targetMemoryUsagePercent); + eatenMetaspace = eatMetaspace(targetMemoryUsagePercent); + } + + private static List eatMetaspace(float targetUsage) { + List list = new ArrayList<>(); + final String metaspacePoolName = "Metaspace"; + MemoryPoolMXBean metaspacePool = null; + for (MemoryPoolMXBean pool : ManagementFactory.getMemoryPoolMXBeans()) { + if (pool.getName().contains(metaspacePoolName)) { + metaspacePool = pool; + break; + } + } + if (metaspacePool == null) { + throw new RuntimeException("MXBean for Metaspace pool wasn't found"); + } + float currentUsage; + GeneratedClassProducer gp = new GeneratedClassProducer(); + do { + try { + list.add(gp.create(0)); + } catch (OutOfMemoryError oome) { + list = null; + throw new RuntimeException("Unexpected OOME while eating " + targetUsage + " of Metaspace."); + } + MemoryUsage memoryUsage = metaspacePool.getUsage(); + currentUsage = (((float) memoryUsage.getUsed()) / memoryUsage.getMax()); + } while (currentUsage < targetUsage); + return list; + } + + public GcProvokerImpl() { + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/GeneratedClassProducer.java b/hotspot/test/serviceability/tmtools/jstat/utils/GeneratedClassProducer.java new file mode 100644 index 00000000000..e93498750c6 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/GeneratedClassProducer.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package utils; + +/** + * Garbage producer that creates classes loaded with GeneratingClassLoader. + * + * Note: this class is not thread-safe. + */ +class GeneratedClassProducer { + + private int number; + private String className; + private StringBuilder sb = new StringBuilder(); + private int minPerClassLoader = 50; + private int maxPerClassLoader = 150; + private int count; + private GeneratingClassLoader loader = new GeneratingClassLoader(); + + GeneratedClassProducer() { + this(GeneratingClassLoader.DEFAULT_CLASSNAME); + } + + GeneratedClassProducer(String className) { + this.className = className; + } + + String getNewName() { + sb.delete(0, sb.length()); + sb.append("Class"); + sb.append(number); + int n = loader.getNameLength() - sb.length(); + for (int i = 0; i < n; ++i) { + sb.append('_'); + } + return sb.toString(); + } + + Class create(long memory) { + try { + if (number++ > maxPerClassLoader || loader == null) { + loader = new GeneratingClassLoader(className); + count = 50; + number = 0; + } + return loader.loadClass(getNewName()); + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } + } +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/GeneratingClassLoader.java b/hotspot/test/serviceability/tmtools/jstat/utils/GeneratingClassLoader.java new file mode 100644 index 00000000000..fd819d88422 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/GeneratingClassLoader.java @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package utils; + +import java.io.*; +import java.util.*; + +/** + * Classloader that generates classes on the fly. + * + * This classloader can load classes with name starting with 'Class'. It will + * use TemplateClass as template and will replace class name in the bytecode of + * template class. It can be used for example to detect memory leaks in class + * loading or to quickly fill PermGen. + */ +class GeneratingClassLoader extends ClassLoader { + + public synchronized Class loadClass(String name) throws ClassNotFoundException { + return loadClass(name, false); + } + + public synchronized Class loadClass(String name, boolean resolve) + throws ClassNotFoundException { + Class c = findLoadedClass(name); + if (c != null) { + return c; + } + if (!name.startsWith(PREFIX)) { + return super.loadClass(name, resolve); + } + if (name.length() != templateClassName.length()) { + throw new ClassNotFoundException("Only can load classes with name.length() = " + getNameLength() + " got: '" + name + "' length: " + name.length()); + } + byte[] bytecode = getPatchedByteCode(name); + c = defineClass(name, bytecode, 0, bytecode.length); + if (resolve) { + resolveClass(c); + } + return c; + } + + /** + * Create generating class loader that will use class file for given class + * from classpath as template. + */ + GeneratingClassLoader(String templateClassName) { + this.templateClassName = templateClassName; + classPath = System.getProperty("java.class.path").split(File.pathSeparator); + try { + templateClassNameBytes = templateClassName.getBytes(encoding); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + } + + /** + * Create generating class loader that will use class file for + * nsk.share.classload.TemplateClass as template. + */ + GeneratingClassLoader() { + this(TemplateClass.class.getName()); + } + + int getNameLength() { + return templateClassName.length(); + } + + String getPrefix() { + return PREFIX; + } + + String getClassName(int number) { + StringBuffer sb = new StringBuffer(); + sb.append(PREFIX); + sb.append(number); + int n = templateClassName.length() - sb.length(); + for (int i = 0; i < n; ++i) { + sb.append("_"); + } + return sb.toString(); + } + + private byte[] getPatchedByteCode(String name) throws ClassNotFoundException { + try { + byte[] bytecode = getByteCode(); + String fname = name.replace(".", File.separator); + byte[] replaceBytes = fname.getBytes(encoding); + for (int offset : offsets) { + for (int i = 0; i < replaceBytes.length; ++i) { + bytecode[offset + i] = replaceBytes[i]; + } + } + return bytecode; + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + } + + private byte[] getByteCode() throws ClassNotFoundException { + if (bytecode == null) { + readByteCode(); + } + if (offsets == null) { + getOffsets(bytecode); + if (offsets == null) { + throw new RuntimeException("Class name not found in template class file"); + } + } + return (byte[]) bytecode.clone(); + } + + private void readByteCode() throws ClassNotFoundException { + String fname = templateClassName.replace(".", File.separator) + ".class"; + File target = null; + for (int i = 0; i < classPath.length; ++i) { + target = new File(classPath[i] + File.separator + fname); + if (target.exists()) { + break; + } + } + + if (target == null || !target.exists()) { + throw new ClassNotFoundException("File not found: " + target); + } + try { + bytecode = ClassLoadUtils.readFile(target); + } catch (IOException e) { + throw new ClassNotFoundException(templateClassName, e); + } + } + + private void getOffsets(byte[] bytecode) { + List offsets = new ArrayList(); + if (this.offsets == null) { + String pname = templateClassName.replace(".", "/"); + try { + byte[] pnameb = pname.getBytes(encoding); + int i = 0; + while (true) { + while (i < bytecode.length) { + int j = 0; + while (j < pnameb.length && bytecode[i + j] == pnameb[j]) { + ++j; + } + if (j == pnameb.length) { + break; + } + i++; + } + if (i == bytecode.length) { + break; + } + offsets.add(new Integer(i)); + i++; + } + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + this.offsets = new int[offsets.size()]; + for (int i = 0; i < offsets.size(); ++i) { + this.offsets[i] = offsets.get(i).intValue(); + } + } + } + + static final String DEFAULT_CLASSNAME = TemplateClass.class.getName(); + static final String PREFIX = "Class"; + + private final String[] classPath; + private byte[] bytecode; + private int[] offsets; + private final String encoding = "UTF8"; + private final String templateClassName; + private final byte[] templateClassNameBytes; +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java new file mode 100644 index 00000000000..c4eb9bdbda2 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * Results of running the JstatGcTool ("jstat -gccapacity ") + * + * Output example: + * NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC YGC FGC + * 41984.0 671744.0 41984.0 5248.0 5248.0 31488.0 83968.0 1343488.0 83968.0 83968.0 512.0 110592.0 4480.0 0 0 + + * Output description: + * NGCMN Minimum new generation capacity (KB). + * NGCMX Maximum new generation capacity (KB). + * NGC Current new generation capacity (KB). + * S0C Current survivor space 0 capacity (KB). + * S1C Current survivor space 1 capacity (KB). + * EC Current eden space capacity (KB). + * OGCMN Minimum old generation capacity (KB). + * OGCMX Maximum old generation capacity (KB). + * OGC Current old generation capacity (KB). + * OC Current old space capacity (KB). + * MCMN Minimum metaspace capacity (KB). + * MCMX Maximum metaspace capacity (KB). + * MC Current metaspace capacity (KB). + * YGC Number of Young generation GC Events. + * FGC Number of Full GC Events. + */ +package utils; + +import common.ToolResults; +import java.lang.management.GarbageCollectorMXBean; +import java.lang.management.ManagementFactory; +import java.util.Arrays; +import java.util.List; + +public class JstatGcCapacityResults extends JstatResults { + + public JstatGcCapacityResults(ToolResults rawResults) { + super(rawResults); + } + + /** + * Checks the overall consistency of the results reported by the tool + */ + public void assertConsistency() { + + // Check exit code + assertThat(getExitCode() == 0, "Unexpected exit code: " + getExitCode()); + + // Check Young Gen consistency + float NGCMN = getFloatValue("NGCMN"); + float NGCMX = getFloatValue("NGCMX"); + assertThat(NGCMX >= NGCMN, "NGCMN > NGCMX (min generation capacity > max generation capacity)"); + + float NGC = getFloatValue("NGC"); + assertThat(NGC >= NGCMN, "NGC < NGCMN (generation capacity < min generation capacity)"); + assertThat(NGC <= NGCMX, "NGC > NGCMX (generation capacity > max generation capacity)"); + + float S0C = getFloatValue("S0C"); + assertThat(S0C < NGC, "S0C >= NGC (survivor space 0 capacity >= new generation capacity)"); + + float S1C = getFloatValue("S1C"); + assertThat(S1C < NGC, "S1C >= NGC (survivor space 1 capacity >= new generation capacity)"); + + float EC = getFloatValue("EC"); + assertThat(EC <= NGC, "EC > NGC (eden space capacity > new generation capacity)"); + + // Verify relative size of NGC and S0C + S1C + EC. + // The rule depends on if the tenured GC is parallel or not. + // For parallell GC: NGC >= S0C + S1C + EC + // For non-parallell GC: NGC == S0C + S1C + EC + boolean isTenuredParallelGC = isTenuredParallelGC(); + String errMsg = String.format( + "NGC %s (S0C + S1C + EC) (NGC = %.1f, S0C = %.1f, S1C = %.1f, EC = %.1f, (S0C + S1C + EC) = %.1f)", + isTenuredParallelGC ? "<" : "!=", NGC, S0C, S1C, EC, S0C + S1C + EC); + if (isTenuredParallelGC) { + assertThat(NGC >= S0C + S1C + EC, errMsg); + } else { + assertThat(checkFloatIsSum(NGC, S0C, S1C, EC), errMsg); + } + + // Check Old Gen consistency + float OGCMN = getFloatValue("OGCMN"); + float OGCMX = getFloatValue("OGCMX"); + assertThat(OGCMX >= OGCMN, "OGCMN > OGCMX (min generation capacity > max generation capacity)"); + + float OGC = getFloatValue("OGC"); + assertThat(OGC >= OGCMN, "OGC < OGCMN (generation capacity < min generation capacity)"); + assertThat(OGC <= OGCMX, "OGC > OGCMX (generation capacity > max generation capacity)"); + float OC = getFloatValue("OC"); + assertThat(OC == OGC, "OC != OGC (old generation capacity != old space capacity (these values should be equal since old space is made up only from one old generation))"); + + // Check Metaspace consistency + float MCMN = getFloatValue("MCMN"); + float MCMX = getFloatValue("MCMX"); + assertThat(MCMX >= MCMN, "MCMN > MCMX (min generation capacity > max generation capacity)"); + float MC = getFloatValue("MC"); + assertThat(MC >= MCMN, "MC < MCMN (generation capacity < min generation capacity)"); + assertThat(MC <= MCMX, "MGC > MCMX (generation capacity > max generation capacity)"); + + + } + + /** + * Check if the tenured generation are currently using a parallel GC. + */ + protected static boolean isTenuredParallelGC() { + // Currently the only parallel GC for the tenured generation is PS MarkSweep. + List parallelGCs = Arrays.asList(new String[] { "PS MarkSweep"}); + try { + List beans = ManagementFactory.getGarbageCollectorMXBeans(); + for (GarbageCollectorMXBean bean : beans) { + if (parallelGCs.contains(bean.getName())) { + return true; + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return false; + } + + private static final float FLOAT_COMPARISON_TOLERANCE = 0.0011f; + + private static boolean checkFloatIsSum(float sum, float... floats) { + for (float f : floats) { + sum -= f; + } + + return Math.abs(sum) <= FLOAT_COMPARISON_TOLERANCE; + } + + private void assertThat(boolean b, String message) { + if (!b) { + throw new RuntimeException(message); + } + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityTool.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityTool.java new file mode 100644 index 00000000000..74cffa150ce --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityTool.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package utils; + +import common.TmTool; + +/** + * This tool executes "jstat -gccapacity " and returns the results as + * JstatGcCapacityoolResults + */ +public class JstatGcCapacityTool extends TmTool { + + public JstatGcCapacityTool(long pid) { + super(JstatGcCapacityResults.class, "jstat", "-gccapacity " + pid); + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseResults.java new file mode 100644 index 00000000000..3bb708dd7ba --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseResults.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * Results of running the JstatGcTool ("jstat -gccause ") + * + * Output example: + * S0 S1 E O M CCS YGC YGCT FGC FGCT GCT LGCC GCC + * 0.00 6.25 46.19 0.34 57.98 54.63 15305 1270.551 0 0.000 1270.551 Allocation Failure No GC + + * Output description: + * S0 Survivor space 0 utilization as a percentage of the space's current capacity. + * S1 Survivor space 1 utilization as a percentage of the space's current capacity. + * E Eden space utilization as a percentage of the space's current capacity. + * O Old space utilization as a percentage of the space's current capacity. + * M Metaspace utilization as a percentage of the space's current capacity. + * CCS Compressed Class Space + * YGC Number of young generation GC events. + * YGCT Young generation garbage collection time. + * FGC Number of full GC events. + * FGCT Full garbage collection time. + * GCT Total garbage collection time. + * LGCC Cause of last Garbage Collection. + * GCC Cause of current Garbage Collection. + */ +package utils; + +import common.ToolResults; + +public class JstatGcCauseResults extends JstatResults { + + public JstatGcCauseResults(ToolResults rawResults) { + super(rawResults); + } + + /** + * Checks the overall consistency of the results reported by the tool + */ + public void assertConsistency() { + + assertThat(getExitCode() == 0, "Unexpected exit code: " + getExitCode()); + + int YGC = getIntValue("YGC"); + float YGCT = getFloatValue("YGCT"); + assertThat(YGCT >= 0, "Incorrect time value for YGCT"); + if (YGC > 0) { + assertThat(YGCT > 0, "Number of young generation GC Events is " + YGC + ", but YGCT is 0"); + } + + float GCT = getFloatValue("GCT"); + assertThat(GCT >= 0, "Incorrect time value for GCT"); + assertThat(GCT >= YGCT, "GCT < YGCT (total garbage collection time < young generation garbage collection time)"); + + int FGC = getIntValue("FGC"); + float FGCT = getFloatValue("FGCT"); + assertThat(FGCT >= 0, "Incorrect time value for FGCT"); + if (FGC > 0) { + assertThat(FGCT > 0, "Number of full GC events is " + FGC + ", but FGCT is 0"); + } + + assertThat(GCT >= FGCT, "GCT < YGCT (total garbage collection time < full generation garbage collection time)"); + + assertThat(checkFloatIsSum(GCT, YGCT, FGCT), "GCT != (YGCT + FGCT) " + "(GCT = " + GCT + ", YGCT = " + YGCT + + ", FGCT = " + FGCT + ", (YCGT + FGCT) = " + (YGCT + FGCT) + ")"); + } + + private static final float FLOAT_COMPARISON_TOLERANCE = 0.0011f; + + private static boolean checkFloatIsSum(float sum, float... floats) { + for (float f : floats) { + sum -= f; + } + + return Math.abs(sum) <= FLOAT_COMPARISON_TOLERANCE; + } + + private void assertThat(boolean b, String message) { + if (!b) { + throw new RuntimeException(message); + } + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseTool.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseTool.java new file mode 100644 index 00000000000..c0dd36d8abb --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseTool.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package utils; + +import common.TmTool; + +/** + * This tool executes "jstat -gc " and returns the results as + * JstatGcToolResults + */ +public class JstatGcCauseTool extends TmTool { + + public JstatGcCauseTool(long pid) { + super(JstatGcCauseResults.class, "jstat", "-gc " + pid); + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewResults.java new file mode 100644 index 00000000000..24ff4490b80 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewResults.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * Results of running the JstatGcTool ("jstat -gcnew ") + * + * Output example: + * S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT + * 11264.0 11264.0 0.0 0.0 15 15 0.0 67584.0 1351.7 0 0.000 + + * Output description: + * S0C Current survivor space 0 capacity (KB). + * S1C Current survivor space 1 capacity (KB). + * S0U Survivor space 0 utilization (KB). + * S1U Survivor space 1 utilization (KB). + * TT Tenuring threshold. + * MTT Maximum tenuring threshold. + * DSS Desired survivor size (KB). + * EC Current eden space capacity (KB). + * EU Eden space utilization (KB). + * YGC Number of young generation GC events. + * YGCT Young generation garbage collection time. + */ +package utils; + +import common.ToolResults; + +public class JstatGcNewResults extends JstatResults { + + public JstatGcNewResults(ToolResults rawResults) { + super(rawResults); + } + + /** + * Checks the overall consistency of the results reported by the tool + */ + public void assertConsistency() { + + assertThat(getExitCode() == 0, "Unexpected exit code: " + getExitCode()); + + float S0C = getFloatValue("S0C"); + float S0U = getFloatValue("S0U"); + + assertThat(S0U <= S0C, "S0U > S0C (utilization > capacity)"); + + float S1C = getFloatValue("S1C"); + float S1U = getFloatValue("S1U"); + + assertThat(S1U <= S1C, "S1U > S1C (utilization > capacity)"); + + float EC = getFloatValue("EC"); + float EU = getFloatValue("EU"); + + assertThat(EU <= EC, "EU > EC (utilization > capacity)"); + + int YGC = getIntValue("YGC"); + float YGCT = getFloatValue("YGCT"); + + if (YGC > 0) { + assertThat(YGCT > 0, "Number of young generation GC Events is " + YGC + ", but YGCT is 0"); + } + + int TT = getIntValue("TT"); + int MTT = getIntValue("MTT"); + assertThat(TT <= MTT, "TT > MTT (tenuring threshold > maximum tenuring threshold)"); + } + + private void assertThat(boolean b, String message) { + if (!b) { + throw new RuntimeException(message); + } + } +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewTool.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewTool.java new file mode 100644 index 00000000000..ed3f20a6c20 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewTool.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package utils; + +import common.TmTool; + +/** + * This tool executes "jstat -gcnew " and returns the results as + * JstatGcNewResults + */ +public class JstatGcNewTool extends TmTool { + + public JstatGcNewTool(long pid) { + super(JstatGcNewResults.class, "jstat", "-gcnew " + pid); + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcResults.java new file mode 100644 index 00000000000..95905418a37 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcResults.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * Results of running the JstatGcTool ("jstat -gc ") + * + * Output example: + * (S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT + * 512.0 512.0 32.0 0.0 288768.0 168160.6 83968.0 288.1 4864.0 2820.3 512.0 279.7 18510 1559.208 0 0.000 1559.208 + * + * Output description: + * S0C Current survivor space 0 capacity (KB). + * S1C Current survivor space 1 capacity (KB). + * S0U Survivor space 0 utilization (KB). + * S1U Survivor space 1 utilization (KB). + * EC Current eden space capacity (KB). + * EU Eden space utilization (KB). + * OC Current old space capacity (KB). + * OU Old space utilization (KB). + * MC Current metaspace capacity (KB). + * MU Metaspace utilization (KB). + * CCSC Compressed Class Space capacity + * CCSU Compressed Class Space utilization + * YGC Number of young generation GC Events. + * YGCT Young generation garbage collection time. + * FGC Number of full GC events. + * FGCT Full garbage collection time. + * GCT Total garbage collection time. + * + */ +package utils; + +import common.ToolResults; + +public class JstatGcResults extends JstatResults { + + public JstatGcResults(ToolResults rawResults) { + super(rawResults); + } + + /** + * Checks the overall consistency of the results reported by the tool + */ + public void assertConsistency() { + + assertThat(getExitCode() == 0, "Unexpected exit code: " + getExitCode()); + + float OC = getFloatValue("OC"); + float OU = getFloatValue("OU"); + assertThat(OU <= OC, "OU > OC (utilization > capacity)"); + + float MC = getFloatValue("MC"); + float MU = getFloatValue("MU"); + assertThat(MU <= MC, "MU > MC (utilization > capacity)"); + + float CCSC = getFloatValue("CCSC"); + float CCSU = getFloatValue("CCSU"); + assertThat(CCSU <= CCSC, "CCSU > CCSC (utilization > capacity)"); + + float S0C = getFloatValue("S0C"); + float S0U = getFloatValue("S0U"); + assertThat(S0U <= S0C, "S0U > S0C (utilization > capacity)"); + + float S1C = getFloatValue("S1C"); + float S1U = getFloatValue("S1U"); + assertThat(S1U <= S1C, "S1U > S1C (utilization > capacity)"); + + float EC = getFloatValue("EC"); + float EU = getFloatValue("EU"); + assertThat(EU <= EC, "EU > EC (utilization > capacity)"); + + int YGC = getIntValue("YGC"); + float YGCT = getFloatValue("YGCT"); + assertThat(YGCT >= 0, "Incorrect time value for YGCT"); + if (YGC > 0) { + assertThat(YGCT > 0, "Number of young generation GC Events is " + YGC + ", but YGCT is 0"); + } + + float GCT = getFloatValue("GCT"); + assertThat(GCT >= 0, "Incorrect time value for GCT"); + assertThat(GCT >= YGCT, "GCT < YGCT (total garbage collection time < young generation garbage collection time)"); + + int FGC = getIntValue("FGC"); + float FGCT = getFloatValue("FGCT"); + assertThat(FGCT >= 0, "Incorrect time value for FGCT"); + if (FGC > 0) { + assertThat(FGCT > 0, "Number of full GC events is " + FGC + ", but FGCT is 0"); + } + + assertThat(GCT >= FGCT, "GCT < YGCT (total garbage collection time < full generation garbage collection time)"); + + assertThat(checkFloatIsSum(GCT, YGCT, FGCT), "GCT != (YGCT + FGCT) " + "(GCT = " + GCT + ", YGCT = " + YGCT + + ", FGCT = " + FGCT + ", (YCGT + FGCT) = " + (YGCT + FGCT) + ")"); + } + + private static final float FLOAT_COMPARISON_TOLERANCE = 0.0011f; + + private static boolean checkFloatIsSum(float sum, float... floats) { + for (float f : floats) { + sum -= f; + } + + return Math.abs(sum) <= FLOAT_COMPARISON_TOLERANCE; + } + + private void assertThat(boolean b, String message) { + if (!b) { + throw new RuntimeException(message); + } + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcTool.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcTool.java new file mode 100644 index 00000000000..e046768a46f --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcTool.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package utils; + +import common.TmTool; + +/** + * This tool executes "jstat -gc " and returns the results as + * JstatGcToolResults + */ +public class JstatGcTool extends TmTool { + + public JstatGcTool(long pid) { + super(JstatGcResults.class, "jstat", "-gc " + pid); + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatResults.java new file mode 100644 index 00000000000..d4f961051f8 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatResults.java @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package utils; + +import common.ToolResults; + +/** + * Results of running the jstat tool Concrete subclasses will detail the jstat + * tool options + */ +abstract public class JstatResults extends ToolResults { + + public JstatResults(ToolResults rawResults) { + super(rawResults); + } + + /** + * Gets a string result from the column labeled 'name' + * + * @param name - name of the column + * @return the result + */ + public String getStringValue(String name) { + int valueNdx = new StringOfValues(getStdoutLine(0)).getIndex(name); + return new StringOfValues(getStdoutLine(1)).getValue(valueNdx); + } + + /** + * Gets a float result from the column labeled 'name' + * + * @param name - name of the column + * @return the result + */ + public float getFloatValue(String name) { + int valueNdx = new StringOfValues(getStdoutLine(0)).getIndex(name); + return Float.valueOf(new StringOfValues(getStdoutLine(1)).getValue(valueNdx)); + } + + /** + * Gets an integer result from the column labeled 'name' + * + * @param name - name of the column + * @return the result + */ + public int getIntValue(String name) { + int valueNdx = new StringOfValues(getStdoutLine(0)).getIndex(name); + return Integer.valueOf(new StringOfValues(getStdoutLine(1)).getValue(valueNdx)); + } + + /** + * Checks if a column with a given name exists + * + * @param name - name of the column + * @return true if the column exist, false otherwise + */ + public boolean valueExists(String name) { + return new StringOfValues(getStdoutLine(0)).getIndex(name) != -1; + } + + /** + * Helper function to assert the increase of the GC events between 2 + * measurements + * + * @param measurement1 -first measurement + * @param measurement2 -first measurement + */ + public static void assertGCEventsIncreased(JstatResults measurement1, JstatResults measurement2) { + assertThat(measurement2.getFloatValue("YGC") > measurement1.getFloatValue("YGC"), "YGC didn't increase between measurements 1 and 2"); + assertThat(measurement2.getFloatValue("FGC") > measurement1.getFloatValue("FGC"), "FGC didn't increase between measurements 2 and 3"); + } + + /** + * Helper function to assert the increase of the GC time between 2 + * measurements + * + * @param measurement1 -first measurement + * @param measurement2 -first measurement + */ + public static void assertGCTimeIncreased(JstatResults measurement1, JstatResults measurement2) { + assertThat(measurement2.getFloatValue("YGCT") > measurement1.getFloatValue("YGCT"), "YGCT time didn't increase between measurements 1 and 2"); + assertThat(measurement2.getFloatValue("FGCT") > measurement1.getFloatValue("FGCT"), "FGCT time didn't increase between measurements 1 and 2"); + assertThat(measurement2.getFloatValue("GCT") > measurement1.getFloatValue("GCT"), "GCT time didn't increase between measurements 1 and 2"); + } + + /** + * Helper function to assert the utilization of the space + * + * @param measurement - measurement results to analyze + * @param targetMemoryUsagePercent -assert that not less than this amount of + * space has been utilized + */ + public static void assertSpaceUtilization(JstatResults measurement, float targetMemoryUsagePercent) { + + if (measurement.valueExists("OU")) { + float OC = measurement.getFloatValue("OC"); + float OU = measurement.getFloatValue("OU"); + assertThat((OU / OC) > targetMemoryUsagePercent, "Old space utilization should be > " + + (targetMemoryUsagePercent * 100) + "%, actually OU / OC = " + (OU / OC)); + } + + if (measurement.valueExists("MU")) { + float MC = measurement.getFloatValue("MC"); + float MU = measurement.getFloatValue("MU"); + assertThat((MU / MC) > targetMemoryUsagePercent, "Metaspace utilization should be > " + + (targetMemoryUsagePercent * 100) + "%, actually MU / MC = " + (MU / MC)); + } + + if (measurement.valueExists("O")) { + float O = measurement.getFloatValue("O"); + assertThat(O > targetMemoryUsagePercent * 100, "Old space utilization should be > " + + (targetMemoryUsagePercent * 100) + "%, actually O = " + O); + } + + if (measurement.valueExists("M")) { + float M = measurement.getFloatValue("M"); + assertThat(M > targetMemoryUsagePercent * 100, "Metaspace utilization should be > " + + (targetMemoryUsagePercent * 100) + "%, actually M = " + M); + } + } + + private static void assertThat(boolean result, String message) { + if (!result) { + throw new RuntimeException(message); + } + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/Pools.java b/hotspot/test/serviceability/tmtools/jstat/utils/Pools.java new file mode 100644 index 00000000000..3d9b8e96b77 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/Pools.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package utils; + +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryPoolMXBean; + +/** + * Utility to obtain memory pools statistics + * + */ +public class Pools { + + private static final String EDEN_SPACE_POOL = "Eden Space"; + private static final String OLD_GEN_POOL = "Old Gen"; + private static final String METASPACE_POOL = "Metaspace"; + private static final String SURVIVOR_SPACE = "Survivor Space"; + + public static long getNGMaxSize() { + // NewGen is consists of Eden and two Survivor spaces + return getPoolMaxSize(EDEN_SPACE_POOL) + 2 * getPoolMaxSize(SURVIVOR_SPACE); + } + + public static long getHeapCommittedSize() { + return ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getCommitted() / 1024; + } + + public static long getEdenCommittedSize() { + return getPoolCommittedSize(EDEN_SPACE_POOL); + } + + public static long getOldGenCommittedSize() { + return getPoolCommittedSize(OLD_GEN_POOL); + } + + public static long getMetaspaceCommittedSize() { + return getPoolCommittedSize(METASPACE_POOL); + } + + private static long getPoolMaxSize(String poolName) { + long result; + MemoryPoolMXBean pool = findPool(poolName); + if (pool != null) { + if (pool.getUsage().getMax() == -1) { + result = -1; + } else { + result = pool.getUsage().getCommitted() / 1024; + } + } else { + throw new RuntimeException("Pool '" + poolName + "' wasn't found"); + } + log("Max size of the pool '" + poolName + "' is " + result); + return result; + } + + private static long getPoolCommittedSize(String poolName) { + long result; + MemoryPoolMXBean pool = findPool(poolName); + if (pool != null) { + if (pool.getUsage().getCommitted() == -1) { + result = -1; + } else { + result = pool.getUsage().getCommitted() / 1024; + } + } else { + throw new RuntimeException("Pool '" + poolName + "' wasn't found"); + } + log("Committed size of the pool '" + poolName + "' is " + result); + return result; + } + + private static MemoryPoolMXBean findPool(String poolName) { + for (MemoryPoolMXBean pool : ManagementFactory.getMemoryPoolMXBeans()) { + if (pool.getName().contains(poolName)) { + return pool; + } + } + return null; + } + + private static void log(String s) { + System.out.println(s); + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/StringOfValues.java b/hotspot/test/serviceability/tmtools/jstat/utils/StringOfValues.java new file mode 100644 index 00000000000..275d0e7e5c0 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/StringOfValues.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package utils; + +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + +/** + * Helper class to get the values from tools output + */ +class StringOfValues { + + private List values; + + StringOfValues(String s) { + this.values = new ArrayList<>(); + StringTokenizer st = new StringTokenizer(s); + while (st.hasMoreTokens()) { + values.add(st.nextToken()); + } + } + + int getIndex(String val) { + for (int ndx = 0; ndx < values.size(); ++ndx) { + if (values.get(ndx).equals(val)) { + return ndx; + } + } + return -1; + } + + String getValue(int ndx) { + return values.get(ndx); + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/TemplateClass.java b/hotspot/test/serviceability/tmtools/jstat/utils/TemplateClass.java new file mode 100644 index 00000000000..2168abc0ffe --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/TemplateClass.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package utils; + +class TemplateClass { +} diff --git a/hotspot/test/serviceability/tmtools/share/common/TmTool.java b/hotspot/test/serviceability/tmtools/share/common/TmTool.java new file mode 100644 index 00000000000..cdcc8f5123b --- /dev/null +++ b/hotspot/test/serviceability/tmtools/share/common/TmTool.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + + */ +package common; + +import java.nio.file.Path; +import java.nio.file.Paths; +import jdk.test.lib.Platform; + +/** + * A tool, such as jstat, jmap, etc Specific tools are defined as subclasses + * parameterized by their corresponding ToolResults subclasses + */ +public abstract class TmTool { + + private final Class resultsClz; + private final String cmdLine; + + public TmTool(Class resultsClz, String toolName, String otherArgs) { + this.resultsClz = resultsClz; + this.cmdLine = adjustForTestJava(toolName) + " " + otherArgs; + } + + /** + * Runs the tool to completion and returns the results + * + * @return the tool results + * @throws Exception if anything goes wrong + */ + public T measure() throws Exception { + ToolRunner runner = new ToolRunner(cmdLine); + ToolResults rawResults = runner.runToCompletion(); + System.out.println("Process output: " + rawResults); + return resultsClz.getDeclaredConstructor(ToolResults.class).newInstance(rawResults); + } + + private String adjustForTestJava(String toolName) { + // We need to make sure we are running the tol from the JDK under testing + String jdkPath = System.getProperty("test.jdk"); + if (jdkPath == null || !Paths.get(jdkPath).toFile().exists()) { + throw new RuntimeException("property test.jdk not not set"); + } + Path toolPath = Paths.get("bin", toolName + (Platform.isWindows() ? ".exe" : "")); + return Paths.get(jdkPath, toolPath.toString()).toString(); + } + +} diff --git a/hotspot/test/serviceability/tmtools/share/common/ToolResults.java b/hotspot/test/serviceability/tmtools/share/common/ToolResults.java new file mode 100644 index 00000000000..057c51598f9 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/share/common/ToolResults.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package common; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * Common results of running an executable such as the saved exit code, the + * saved stdout and stderr + */ +public class ToolResults { + + public int getExitCode() { + return exitCode; + } + + public List getStdout() { + return stdout; + } + + public List getStderr() { + return stderr; + } + + public String getStdoutString() { + return stdout.stream().collect(Collectors.joining(System.getProperty("line.separator"))); + } + + /** + * Helper function to return a specified line from the saved stdout + * + * @return the line indexed with ndx from the saved stdout. The indexes are + * zero-based so that getStdoutLine(0) returns the first line. + */ + public String getStdoutLine(int ndx) { + return stdout.get(ndx); + } + + public ToolResults(int exitCode, List stdin, List stderr) { + this.exitCode = exitCode; + this.stdout = stdin; + this.stderr = stderr; + } + + public ToolResults(ToolResults rawResults) { + this(rawResults.exitCode, rawResults.stdout, rawResults.stderr); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("Exit code: ").append(exitCode).append("\n"); + sb.append("stdout:"); + stdout.stream().forEach((s) -> { + sb.append(s).append("\n"); + }); + sb.append("stderr:"); + stderr.stream().forEach((s) -> { + sb.append(s).append("\n"); + }); + return sb.toString(); + } + + private final int exitCode; + private final List stdout; + private final List stderr; + +} diff --git a/hotspot/test/serviceability/tmtools/share/common/ToolRunner.java b/hotspot/test/serviceability/tmtools/share/common/ToolRunner.java new file mode 100644 index 00000000000..b9ca940ca13 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/share/common/ToolRunner.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package common; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.StringTokenizer; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +/** + * This class starts a process specified by the passed command line waits till + * the process completes and returns the process exit code and stdout and stderr + * output as ToolResults + */ +class ToolRunner { + + private final List cmdArgs = new LinkedList<>(); + + ToolRunner(String cmdLine) { + StringTokenizer st = new StringTokenizer(cmdLine); + while (st.hasMoreTokens()) { + cmdArgs.add(st.nextToken()); + } + } + + /** + * Starts the process, waits for the process completion and returns the + * results + * + * @return process results + * @throws Exception if anything goes wrong + */ + ToolResults runToCompletion() throws Exception { + + ProcessBuilder pb = new ProcessBuilder(cmdArgs); + OutputAnalyzer oa = ProcessTools.executeProcess(pb); + + return new ToolResults(oa.getExitValue(), + stringToList(oa.getStdout()), + stringToList(oa.getStderr())); + + } + + private static List stringToList(String s) throws IOException { + BufferedReader reader = new BufferedReader(new StringReader(s)); + List strings = new ArrayList<>(); + for (String line = reader.readLine(); line != null; line = reader.readLine()) { + strings.add(line); + } + reader.close(); + return strings; + } +} diff --git a/hotspot/test/testlibrary/ClassFileInstaller.java b/hotspot/test/testlibrary/ClassFileInstaller.java index 303e96e5a87..4e042dacde4 100644 --- a/hotspot/test/testlibrary/ClassFileInstaller.java +++ b/hotspot/test/testlibrary/ClassFileInstaller.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -21,6 +21,7 @@ * questions. */ +import java.io.FileNotFoundException; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; @@ -42,6 +43,9 @@ public class ClassFileInstaller { // Convert dotted class name to a path to a class file String pathName = arg.replace('.', '/').concat(".class"); InputStream is = cl.getResourceAsStream(pathName); + if (is == null) { + throw new FileNotFoundException(pathName); + } // Create the class file's package directory Path p = Paths.get(pathName); diff --git a/jdk/.hgtags b/jdk/.hgtags index a0ad6c5e122..99f6d153fb3 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -346,3 +346,4 @@ e1a789be1535741274c9779f4d4ca3495196b5c3 jdk-9+99 5e8370fb3ed925335164afe340d1e54beab2d4d5 jdk-9+101 6eb3c8132e489dab81adde4ce29844904ce15482 jdk-9+102 eee1ced1d8e78293f2a004af818ca474387dbebf jdk-9+103 +8faf1aec77a9517c69d2f4d8dd146429852ace7f jdk-9+104 diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk index abd7edc0021..ad58edb2823 100644 --- a/jdk/make/lib/Awt2dLibraries.gmk +++ b/jdk/make/lib/Awt2dLibraries.gmk @@ -235,6 +235,13 @@ ifeq ($(OPENJDK_TARGET_OS), linux) LIBAWT_MAPFILE := endif +# Turn off all warnings for debug_mem.c This is needed because the specific warning +# about initializing a declared 'extern' cannot be turned off individually. Only +# applies to debug builds. +ifeq ($(TOOLCHAIN_TYPE), gcc) + BUILD_LIBAWT_debug_mem.c_CFLAGS := -w +endif + $(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \ LIBRARY := awt, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ @@ -248,7 +255,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \ DISABLED_WARNINGS_clang := logical-op-parentheses extern-initializer, \ DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \ DISABLED_WARNINGS_microsoft := 4297 4244 4267 4996, \ - WARNINGS_AS_ERRORS_gcc := false, \ ASFLAGS := $(LIBAWT_ASFLAGS), \ MAPFILE := $(LIBAWT_MAPFILE), \ LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -343,6 +349,19 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),) LIBAWT_XAWT_LIBS += -lpthread endif + ifeq ($(TOOLCHAIN_TYPE), gcc) + # Turn off all warnings for the following files since they contain warnings + # that cannot be turned of individually. + # redefining a macro + BUILD_LIBAWT_XAWT_gtk2_interface.c_CFLAGS := -w + # comparison between pointer and integer + BUILD_LIBAWT_XAWT_awt_Font.c_CFLAGS := -w + # initializing a declared 'extern' + BUILD_LIBAWT_XAWT_debug_mem.c_CFLAGS := -w + # decimal constant is unsigned only in ISO C90 (JAVASE_EMBEDDED) + BUILD_LIBAWT_XAWT_XToolkit.c_CFLAGS := -w + endif + $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT, \ LIBRARY := awt_xawt, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ @@ -356,7 +375,6 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),) format-security int-to-pointer-cast parentheses, \ DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \ E_ASSIGNMENT_TYPE_MISMATCH E_NON_CONST_INIT, \ - WARNINGS_AS_ERRORS_gcc := false, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_xawt/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN) \ @@ -658,8 +676,11 @@ endif LIBFONTMANAGER_CFLAGS += $(FONT_HEADERS) $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS -# Turn off aliasing with GCC for ExtensionSubtables.cpp -ifeq ($(OPENJDK_TARGET_OS), linux) +ifeq ($(TOOLCHAIN_TYPE), gcc) + # Turn off all warnings for sunFont.c. This is needed because the specific warning + # about discarding 'const' qualifier cannot be turned off individually. + BUILD_LIBFONTMANAGER_sunFont.c_CFLAGS := -w + # Turn off aliasing with GCC for ExtensionSubtables.cpp BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing endif @@ -674,14 +695,20 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \ OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \ CFLAGS_windows = -DCC_NOEX, \ - DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast reorder \ - delete-non-virtual-dtor type-limits missing-field-initializers, \ + DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast \ + type-limits missing-field-initializers, \ + DISABLED_WARNINGS_CXX_gcc := reorder delete-non-virtual-dtor strict-overflow \ + maybe-uninitialized, \ DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \ tautological-constant-out-of-range-compare int-to-pointer-cast, \ - DISABLED_WARNINGS_solstudio := truncwarn, \ + DISABLED_WARNINGS_C_solstudio = \ + E_INTEGER_OVERFLOW_DETECTED \ + E_ARG_INCOMPATIBLE_WITH_ARG_L \ + E_ENUM_VAL_OVERFLOWS_INT_MAX, \ + DISABLED_WARNINGS_CXX_solstudio := \ + truncwarn wvarhidenmem wvarhidemem wbadlkginit identexpected \ + hidevf w_novirtualdescr arrowrtn2, \ DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090 4996 4146 4334, \ - WARNINGS_AS_ERRORS_gcc := false, \ - WARNINGS_AS_ERRORS_solstudio := false, \ MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \ LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ diff --git a/jdk/make/lib/CoreLibraries.gmk b/jdk/make/lib/CoreLibraries.gmk index 5cbeb4b03f7..ea7c7f3c991 100644 --- a/jdk/make/lib/CoreLibraries.gmk +++ b/jdk/make/lib/CoreLibraries.gmk @@ -247,6 +247,13 @@ ifeq ($(OPENJDK_TARGET_OS), aix) LIBJIMAGE_TOOLCHAIN := TOOLCHAIN_LINK_CXX endif # OPENJDK_TARGET_OS aix +JIMAGELIB_CPPFLAGS := \ + -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \ + -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \ + -I$(JDK_TOPDIR)/src/java.base/share/native/libjimage \ + -I$(SUPPORT_OUTPUTDIR)/headers/java.base \ + # + $(eval $(call SetupNativeCompilation,BUILD_LIBJIMAGE, \ LIBRARY := jimage, \ TOOLCHAIN := $(LIBJIMAGE_TOOLCHAIN), \ @@ -255,12 +262,8 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJIMAGE, \ SRC := $(JDK_TOPDIR)/src/java.base/share/native/libjimage \ $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjimage, \ EXCLUDES := $(LIBJIMAGE_EXCLUDES), \ - CFLAGS := $(CFLAGS_JDKLIB) \ - $(JIMAGELIB_CPPFLAGS) \ - -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \ - -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \ - -I$(JDK_TOPDIR)/src/java.base/share/native/libjimage \ - -I$(SUPPORT_OUTPUTDIR)/headers/java.base, \ + CFLAGS := $(CFLAGS_JDKLIB) $(JIMAGELIB_CPPFLAGS), \ + CXXFLAGS := $(CXXFLAGS_JDKLIB) $(JIMAGELIB_CPPFLAGS), \ CFLAGS_unix := -UDEBUG, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjimage/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ diff --git a/jdk/make/mapfiles/libjava/mapfile-vers b/jdk/make/mapfiles/libjava/mapfile-vers index 3ec9f530b2d..faf1cc130fe 100644 --- a/jdk/make/mapfiles/libjava/mapfile-vers +++ b/jdk/make/mapfiles/libjava/mapfile-vers @@ -250,6 +250,7 @@ SUNWprivate_1.1 { Java_sun_misc_Signal_raise0; Java_sun_reflect_ConstantPool_getClassAt0; Java_sun_reflect_ConstantPool_getClassAtIfLoaded0; + Java_sun_reflect_ConstantPool_getClassRefIndexAt0; Java_sun_reflect_ConstantPool_getDoubleAt0; Java_sun_reflect_ConstantPool_getFieldAt0; Java_sun_reflect_ConstantPool_getFieldAtIfLoaded0; @@ -259,8 +260,11 @@ SUNWprivate_1.1 { Java_sun_reflect_ConstantPool_getMemberRefInfoAt0; Java_sun_reflect_ConstantPool_getMethodAt0; Java_sun_reflect_ConstantPool_getMethodAtIfLoaded0; + Java_sun_reflect_ConstantPool_getNameAndTypeRefIndexAt0; + Java_sun_reflect_ConstantPool_getNameAndTypeRefInfoAt0; Java_sun_reflect_ConstantPool_getSize0; Java_sun_reflect_ConstantPool_getStringAt0; + Java_sun_reflect_ConstantPool_getTagAt0; Java_sun_reflect_ConstantPool_getUTF8At0; Java_java_io_Console_istty; Java_java_io_Console_encoding; diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/AESCrypt.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/AESCrypt.java index 21acfccded0..4556e0242ef 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/AESCrypt.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/AESCrypt.java @@ -351,8 +351,8 @@ final class AESCrypt extends SymmetricCipher implements AESConstants */ void encryptBlock(byte[] in, int inOffset, byte[] out, int outOffset) { - cryptBlockCheck(in, inOffset); - cryptBlockCheck(out, outOffset); + Objects.checkFromIndexSize(inOffset, AES_BLOCK_SIZE, in.length); + Objects.checkFromIndexSize(outOffset, AES_BLOCK_SIZE, out.length); implEncryptBlock(in, inOffset, out, outOffset); } @@ -430,8 +430,8 @@ final class AESCrypt extends SymmetricCipher implements AESConstants */ void decryptBlock(byte[] in, int inOffset, byte[] out, int outOffset) { - cryptBlockCheck(in, inOffset); - cryptBlockCheck(out, outOffset); + Objects.checkFromIndexSize(inOffset, AES_BLOCK_SIZE, in.length); + Objects.checkFromIndexSize(outOffset, AES_BLOCK_SIZE, out.length); implDecryptBlock(in, inOffset, out, outOffset); } @@ -593,26 +593,6 @@ final class AESCrypt extends SymmetricCipher implements AESConstants out[outOffset ] = (byte)(Si[(a0 ) & 0xFF] ^ (t1 )); } - // Used to perform all checks required by the Java semantics - // (i.e., null checks and bounds checks) on the input parameters - // to encryptBlock and to decryptBlock. - // Normally, the Java Runtime performs these checks, however, as - // encryptBlock and decryptBlock are possibly replaced with - // compiler intrinsics, the JDK performs the required checks instead. - // Does not check accesses to class-internal (private) arrays. - private static void cryptBlockCheck(byte[] array, int offset) { - Objects.requireNonNull(array); - - if (offset < 0 || offset >= array.length) { - throw new ArrayIndexOutOfBoundsException(offset); - } - - int largestIndex = offset + AES_BLOCK_SIZE - 1; - if (largestIndex < 0 || largestIndex >= array.length) { - throw new ArrayIndexOutOfBoundsException(largestIndex); - } - } - /** * Expand a user-supplied key material into a session key. * diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java index 684be4f0d76..da6c10a7956 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java @@ -173,9 +173,9 @@ final class CounterMode extends FeedbackCipher { */ private int crypt(byte[] in, int inOff, int len, byte[] out, int outOff) { - cryptBlockCheck(in, inOff, len); - cryptBlockCheck(out, outOff, len); - return implCrypt(in, inOff, len, out, outOff); + Objects.checkFromIndexSize(inOff, len, in.length); + Objects.checkFromIndexSize(outOff, len, out.length); + return implCrypt(in, inOff, len, out, outOff); } // Implementation of crpyt() method. Possibly replaced with a compiler intrinsic. @@ -193,22 +193,4 @@ final class CounterMode extends FeedbackCipher { return result; } - // Used to perform all checks required by the Java semantics - // (i.e., null checks and bounds checks) on the input parameters to crypt(). - // Normally, the Java Runtime performs these checks, however, as crypt() is - // possibly replaced with compiler intrinsic, the JDK performs the - // required checks instead. - // Does not check accesses to class-internal (private) arrays. - private static void cryptBlockCheck(byte[] array, int offset, int len) { - Objects.requireNonNull(array); - - if (offset < 0 || len < 0 || offset >= array.length) { - throw new ArrayIndexOutOfBoundsException(offset); - } - - int largestIndex = offset + len - 1; - if (largestIndex < 0 || largestIndex >= array.length) { - throw new ArrayIndexOutOfBoundsException(largestIndex); - } - } } diff --git a/jdk/src/java.base/share/classes/java/lang/Long.java b/jdk/src/java.base/share/classes/java/lang/Long.java index 48019cd31b3..ae93a7ca827 100644 --- a/jdk/src/java.base/share/classes/java/lang/Long.java +++ b/jdk/src/java.base/share/classes/java/lang/Long.java @@ -401,18 +401,6 @@ public final class Long extends Number implements Comparable { * @param offset the offset in the destination buffer to start at * @param len the number of characters to write */ - static void formatUnsignedLong(long val, int shift, char[] buf, int offset, int len) { - // assert shift > 0 && shift <=5 : "Illegal shift value"; - // assert offset >= 0 && offset < buf.length : "illegal offset"; - // assert len > 0 && (offset + len) <= buf.length : "illegal length"; - int charPos = offset + len; - int radix = 1 << shift; - int mask = radix - 1; - do { - buf[--charPos] = Integer.digits[((int) val) & mask]; - val >>>= shift; - } while (charPos > offset); - } /** byte[]/LATIN1 version */ static void formatUnsignedLong0(long val, int shift, byte[] buf, int offset, int len) { @@ -436,6 +424,39 @@ public final class Long extends Number implements Comparable { } while (charPos > offset); } + static String fastUUID(long lsb, long msb) { + if (COMPACT_STRINGS) { + byte[] buf = new byte[36]; + formatUnsignedLong0(lsb, 4, buf, 24, 12); + formatUnsignedLong0(lsb >>> 48, 4, buf, 19, 4); + formatUnsignedLong0(msb, 4, buf, 14, 4); + formatUnsignedLong0(msb >>> 16, 4, buf, 9, 4); + formatUnsignedLong0(msb >>> 32, 4, buf, 0, 8); + + buf[23] = '-'; + buf[18] = '-'; + buf[13] = '-'; + buf[8] = '-'; + + return new String(buf, LATIN1); + } else { + byte[] buf = new byte[72]; + + formatUnsignedLong0UTF16(lsb, 4, buf, 24, 12); + formatUnsignedLong0UTF16(lsb >>> 48, 4, buf, 19, 4); + formatUnsignedLong0UTF16(msb, 4, buf, 14, 4); + formatUnsignedLong0UTF16(msb >>> 16, 4, buf, 9, 4); + formatUnsignedLong0UTF16(msb >>> 32, 4, buf, 0, 8); + + StringUTF16.putChar(buf, 23, '-'); + StringUTF16.putChar(buf, 18, '-'); + StringUTF16.putChar(buf, 13, '-'); + StringUTF16.putChar(buf, 8, '-'); + + return new String(buf, UTF16); + } + } + /** * Returns a {@code String} object representing the specified * {@code long}. The argument is converted to signed decimal diff --git a/jdk/src/java.base/share/classes/java/lang/StringConcatHelper.java b/jdk/src/java.base/share/classes/java/lang/StringConcatHelper.java index d9517e5226f..1504e6ff37d 100644 --- a/jdk/src/java.base/share/classes/java/lang/StringConcatHelper.java +++ b/jdk/src/java.base/share/classes/java/lang/StringConcatHelper.java @@ -342,4 +342,12 @@ final class StringConcatHelper { return new String(buf, coder); } + /** + * Provides the initial coder for the String. + * @return initial coder + */ + static byte initialCoder() { + return String.COMPACT_STRINGS ? String.LATIN1 : String.UTF16; + } + } diff --git a/jdk/src/java.base/share/classes/java/lang/System.java b/jdk/src/java.base/share/classes/java/lang/System.java index 16b1e6b57e3..1919264ce52 100644 --- a/jdk/src/java.base/share/classes/java/lang/System.java +++ b/jdk/src/java.base/share/classes/java/lang/System.java @@ -1911,11 +1911,8 @@ public final class System { public void invokeFinalize(Object o) throws Throwable { o.finalize(); } - public void formatUnsignedLong(long val, int shift, char[] buf, int offset, int len) { - Long.formatUnsignedLong(val, shift, buf, offset, len); - } - public void formatUnsignedInt(int val, int shift, char[] buf, int offset, int len) { - Integer.formatUnsignedInt(val, shift, buf, offset, len); + public String fastUUID(long lsb, long msb) { + return Long.fastUUID(lsb, msb); } }); } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java index f00be9c067e..e9bb8046246 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java @@ -30,7 +30,7 @@ import java.lang.reflect.Field; import static java.lang.invoke.MethodHandleNatives.Constants.*; import static java.lang.invoke.MethodHandleStatics.*; import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP; -import sun.misc.Cleaner; +import jdk.internal.ref.Cleaner; /** * The JVM interface for the method handles package is all here. diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java index 4925829a985..45908f1ea23 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java @@ -1043,7 +1043,8 @@ assertEquals(""+l, (String) MH_this.invokeExact(subl)); // Listie method * @param specialCaller the proposed calling class to perform the {@code invokespecial} * @return the desired method handle * @throws NoSuchMethodException if the method does not exist - * @throws IllegalAccessException if access checking fails + * @throws IllegalAccessException if access checking fails, + * or if the method is {@code static}, * or if the method's variable arity modifier bit * is set and {@code asVarargsCollector} fails * @exception SecurityException if a security manager is present and it @@ -1275,7 +1276,8 @@ return mh1; * @param m the reflected method * @param specialCaller the class nominally calling the method * @return a method handle which can invoke the reflected method - * @throws IllegalAccessException if access checking fails + * @throws IllegalAccessException if access checking fails, + * or if the method is {@code static}, * or if the method's variable arity modifier bit * is set and {@code asVarargsCollector} fails * @throws NullPointerException if any argument is null diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java b/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java index 016c939a285..008a4161bd5 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java @@ -30,7 +30,7 @@ import jdk.internal.org.objectweb.asm.Label; import jdk.internal.org.objectweb.asm.MethodVisitor; import jdk.internal.org.objectweb.asm.Opcodes; import jdk.internal.vm.annotation.ForceInline; -import sun.misc.Unsafe; +import jdk.internal.misc.Unsafe; import java.lang.invoke.MethodHandles.Lookup; import java.security.AccessController; @@ -957,6 +957,22 @@ public final class StringConcatFactory { storage trimming, which defeats the purpose of exact strategies. */ + /* + The logic for this check is as follows: + + Stack before: Op: + (SB) dup, dup + (SB, SB, SB) capacity() + (int, SB, SB) swap + (SB, int, SB) toString() + (S, int, SB) length() + (int, int, SB) if_icmpeq + (SB) + + Note that it leaves the same StringBuilder on exit, like the one on enter. + */ + + mv.visitInsn(DUP); mv.visitInsn(DUP); mv.visitMethodInsn( @@ -967,7 +983,7 @@ public final class StringConcatFactory { false ); - mv.visitIntInsn(ISTORE, 0); + mv.visitInsn(SWAP); mv.visitMethodInsn( INVOKEVIRTUAL, @@ -977,8 +993,6 @@ public final class StringConcatFactory { false ); - mv.visitInsn(DUP); - mv.visitMethodInsn( INVOKEVIRTUAL, "java/lang/String", @@ -987,8 +1001,6 @@ public final class StringConcatFactory { false ); - mv.visitIntInsn(ILOAD, 0); - Label l0 = new Label(); mv.visitJumpInsn(IF_ICMPEQ, l0); @@ -1003,16 +1015,16 @@ public final class StringConcatFactory { mv.visitInsn(ATHROW); mv.visitLabel(l0); - } else { - mv.visitMethodInsn( - INVOKEVIRTUAL, - "java/lang/StringBuilder", - "toString", - "()Ljava/lang/String;", - false - ); } + mv.visitMethodInsn( + INVOKEVIRTUAL, + "java/lang/StringBuilder", + "toString", + "()Ljava/lang/String;", + false + ); + mv.visitInsn(ARETURN); mv.visitMaxs(-1, -1); @@ -1485,7 +1497,7 @@ public final class StringConcatFactory { // // The method handle shape after all length and coder mixers is: // (int, byte, )String = ("index", "coder", ) - byte initialCoder = 0; // initial coder + byte initialCoder = INITIAL_CODER; int initialLen = 0; // initial length, in characters for (RecipeElement el : recipe.getElements()) { switch (el.getTag()) { @@ -1618,11 +1630,14 @@ public final class StringConcatFactory { private static final ConcurrentMap, MethodHandle> LENGTH_MIXERS; private static final ConcurrentMap, MethodHandle> CODER_MIXERS; private static final Class STRING_HELPER; + private static final byte INITIAL_CODER; static { try { STRING_HELPER = Class.forName("java.lang.StringConcatHelper"); - } catch (ClassNotFoundException e) { + MethodHandle initCoder = lookupStatic(Lookup.IMPL_LOOKUP, STRING_HELPER, "initialCoder", byte.class); + INITIAL_CODER = (byte) initCoder.invoke(); + } catch (Throwable e) { throw new AssertionError(e); } diff --git a/jdk/src/java.base/share/classes/java/lang/ref/Reference.java b/jdk/src/java.base/share/classes/java/lang/ref/Reference.java index 0f06a6c937f..0a6728d007e 100644 --- a/jdk/src/java.base/share/classes/java/lang/ref/Reference.java +++ b/jdk/src/java.base/share/classes/java/lang/ref/Reference.java @@ -26,10 +26,10 @@ package java.lang.ref; import jdk.internal.vm.annotation.DontInline; -import sun.misc.Cleaner; import jdk.internal.HotSpotIntrinsicCandidate; import jdk.internal.misc.JavaLangRefAccess; import jdk.internal.misc.SharedSecrets; +import jdk.internal.ref.Cleaner; /** * Abstract base class for reference objects. This class defines the diff --git a/jdk/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template b/jdk/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template index 16e495a4fba..76aa4a9c61b 100644 --- a/jdk/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template +++ b/jdk/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template @@ -28,9 +28,9 @@ package java.nio; import java.io.FileDescriptor; -import sun.misc.Cleaner; import jdk.internal.misc.Unsafe; import jdk.internal.misc.VM; +import jdk.internal.ref.Cleaner; import sun.nio.ch.DirectBuffer; diff --git a/jdk/src/java.base/share/classes/java/nio/file/Files.java b/jdk/src/java.base/share/classes/java/nio/file/Files.java index 3fb7fe28c94..8f8a50434e7 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/Files.java +++ b/jdk/src/java.base/share/classes/java/nio/file/Files.java @@ -1898,7 +1898,7 @@ public final class Files { * many file systems. * *

The attribute-list component is a comma separated list of - * zero or more names of attributes to read. If the list contains the value + * one or more names of attributes to read. If the list contains the value * {@code "*"} then all attributes are read. Attributes that are not supported * are ignored and will not be present in the returned map. It is * implementation specific if all attributes are read as an atomic operation @@ -1948,7 +1948,7 @@ public final class Files { * @throws UnsupportedOperationException * if the attribute view is not available * @throws IllegalArgumentException - * if no attributes are specified or an unrecognized attributes is + * if no attributes are specified or an unrecognized attribute is * specified * @throws IOException * if an I/O error occurs diff --git a/jdk/src/java.base/share/classes/java/nio/file/Path.java b/jdk/src/java.base/share/classes/java/nio/file/Path.java index ac497c3c0cf..e7307e65640 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/Path.java +++ b/jdk/src/java.base/share/classes/java/nio/file/Path.java @@ -150,7 +150,7 @@ public interface Path * #normalize normalize} method, to eliminate redundant names, for cases where * shell-like navigation is required. * - *

If this path has one or more elements, and no root component, then + *

If this path has more than one element, and no root component, then * this method is equivalent to evaluating the expression: *

      * subpath(0, getNameCount()-1);
diff --git a/jdk/src/java.base/share/classes/java/security/SecureRandom.java b/jdk/src/java.base/share/classes/java/security/SecureRandom.java
index 543b7abd98f..d7495f4ad52 100644
--- a/jdk/src/java.base/share/classes/java/security/SecureRandom.java
+++ b/jdk/src/java.base/share/classes/java/security/SecureRandom.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2016, 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
@@ -472,7 +472,7 @@ public class SecureRandom extends java.util.Random {
      * @param bytes the array to be filled in with random bytes.
      */
     @Override
-    public synchronized void nextBytes(byte[] bytes) {
+    public void nextBytes(byte[] bytes) {
         secureRandomSpi.engineNextBytes(bytes);
     }
 
diff --git a/jdk/src/java.base/share/classes/java/time/Duration.java b/jdk/src/java.base/share/classes/java/time/Duration.java
index 646d7109fd3..af7abfe4226 100644
--- a/jdk/src/java.base/share/classes/java/time/Duration.java
+++ b/jdk/src/java.base/share/classes/java/time/Duration.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, 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
@@ -62,6 +62,7 @@
 package java.time;
 
 import static java.time.LocalTime.MINUTES_PER_HOUR;
+import static java.time.LocalTime.NANOS_PER_MILLI;
 import static java.time.LocalTime.NANOS_PER_SECOND;
 import static java.time.LocalTime.SECONDS_PER_DAY;
 import static java.time.LocalTime.SECONDS_PER_HOUR;
@@ -1214,8 +1215,16 @@ public final class Duration
      * @throws ArithmeticException if numeric overflow occurs
      */
     public long toMillis() {
-        long millis = Math.multiplyExact(seconds, 1000);
-        millis = Math.addExact(millis, nanos / 1000_000);
+        long tempSeconds = seconds;
+        long tempNanos = nanos;
+        if (tempSeconds < 0) {
+            // change the seconds and nano value to
+            // handle Long.MIN_VALUE case
+            tempSeconds = tempSeconds + 1;
+            tempNanos = tempNanos - NANOS_PER_SECOND;
+        }
+        long millis = Math.multiplyExact(tempSeconds, 1000);
+        millis = Math.addExact(millis, tempNanos / NANOS_PER_MILLI);
         return millis;
     }
 
@@ -1229,8 +1238,16 @@ public final class Duration
      * @throws ArithmeticException if numeric overflow occurs
      */
     public long toNanos() {
-        long totalNanos = Math.multiplyExact(seconds, NANOS_PER_SECOND);
-        totalNanos = Math.addExact(totalNanos, nanos);
+        long tempSeconds = seconds;
+        long tempNanos = nanos;
+        if (tempSeconds < 0) {
+            // change the seconds and nano value to
+            // handle Long.MIN_VALUE case
+            tempSeconds = tempSeconds + 1;
+            tempNanos = tempNanos - NANOS_PER_SECOND;
+        }
+        long totalNanos = Math.multiplyExact(tempSeconds, NANOS_PER_SECOND);
+        totalNanos = Math.addExact(totalNanos, tempNanos);
         return totalNanos;
     }
 
diff --git a/jdk/src/java.base/share/classes/java/time/LocalDate.java b/jdk/src/java.base/share/classes/java/time/LocalDate.java
index 3d8c034fa91..940f21f0f1e 100644
--- a/jdk/src/java.base/share/classes/java/time/LocalDate.java
+++ b/jdk/src/java.base/share/classes/java/time/LocalDate.java
@@ -100,6 +100,8 @@ import java.time.temporal.ValueRange;
 import java.time.zone.ZoneOffsetTransition;
 import java.time.zone.ZoneRules;
 import java.util.Objects;
+import java.util.stream.LongStream;
+import java.util.stream.Stream;
 
 /**
  * A date without a time-zone in the ISO-8601 calendar system,
@@ -1715,6 +1717,89 @@ public final class LocalDate
         return Period.of(Math.toIntExact(years), months, days);
     }
 
+    /**
+     * Returns a sequential ordered stream of dates. The returned stream starts from this date
+     * (inclusive) and goes to {@code endExclusive} (exclusive) by an incremental step of 1 day.
+     * 

+ * This method is equivalent to {@code datesUntil(endExclusive, Period.ofDays(1))}. + * + * @param endExclusive the end date, exclusive, not null + * @return a sequential {@code Stream} for the range of {@code LocalDate} values + * @throws IllegalArgumentException if end date is before this date + * @since 9 + */ + public Stream datesUntil(LocalDate endExclusive) { + long end = endExclusive.toEpochDay(); + long start = toEpochDay(); + if (end < start) { + throw new IllegalArgumentException(endExclusive + " < " + this); + } + return LongStream.range(start, end).mapToObj(LocalDate::ofEpochDay); + } + + /** + * Returns a sequential ordered stream of dates by given incremental step. The returned stream + * starts from this date (inclusive) and goes to {@code endExclusive} (exclusive). + *

+ * The n-th date which appears in the stream is equal to {@code this.plus(step.multipliedBy(n))} + * (but the result of step multiplication never overflows). For example, if this date is + * {@code 2015-01-31}, the end date is {@code 2015-05-01} and the step is 1 month, then the + * stream contains {@code 2015-01-31}, {@code 2015-02-28}, {@code 2015-03-31}, and + * {@code 2015-04-30}. + * + * @param endExclusive the end date, exclusive, not null + * @param step the non-zero, non-negative {@code Period} which represents the step. + * @return a sequential {@code Stream} for the range of {@code LocalDate} values + * @throws IllegalArgumentException if step is zero, or {@code step.getDays()} and + * {@code step.toTotalMonths()} have opposite sign, or end date is before this date + * and step is positive, or end date is after this date and step is negative + * @since 9 + */ + public Stream datesUntil(LocalDate endExclusive, Period step) { + if (step.isZero()) { + throw new IllegalArgumentException("step is zero"); + } + long end = endExclusive.toEpochDay(); + long start = toEpochDay(); + long until = end - start; + long months = step.toTotalMonths(); + long days = step.getDays(); + if ((months < 0 && days > 0) || (months > 0 && days < 0)) { + throw new IllegalArgumentException("period months and days are of opposite sign"); + } + if (until == 0) { + return Stream.empty(); + } + int sign = months > 0 || days > 0 ? 1 : -1; + if (sign < 0 ^ until < 0) { + throw new IllegalArgumentException(endExclusive + (sign < 0 ? " > " : " < ") + this); + } + if (months == 0) { + long steps = (until - sign) / days; // non-negative + return LongStream.rangeClosed(0, steps).mapToObj( + n -> LocalDate.ofEpochDay(start + n * days)); + } + // 48699/1600 = 365.2425/12, no overflow, non-negative result + long steps = until * 1600 / (months * 48699 + days * 1600) + 1; + long addMonths = months * steps; + long addDays = days * steps; + long maxAddMonths = months > 0 ? MAX.getProlepticMonth() - getProlepticMonth() + : getProlepticMonth() - MIN.getProlepticMonth(); + // adjust steps estimation + if (addMonths * sign > maxAddMonths + || (plusMonths(addMonths).toEpochDay() + addDays) * sign >= end * sign) { + steps--; + addMonths -= months; + addDays -= days; + if (addMonths * sign > maxAddMonths + || (plusMonths(addMonths).toEpochDay() + addDays) * sign >= end * sign) { + steps--; + } + } + return LongStream.rangeClosed(0, steps).mapToObj( + n -> this.plusMonths(months * n).plusDays(days * n)); + } + /** * Formats this date using the specified formatter. *

diff --git a/jdk/src/java.base/share/classes/java/util/UUID.java b/jdk/src/java.base/share/classes/java/util/UUID.java index a7f5f6bc63e..db9e907110b 100644 --- a/jdk/src/java.base/share/classes/java/util/UUID.java +++ b/jdk/src/java.base/share/classes/java/util/UUID.java @@ -392,17 +392,7 @@ public final class UUID implements java.io.Serializable, Comparable { * @return A string representation of this {@code UUID} */ public String toString() { - char[] chars = new char[36]; - jla.formatUnsignedLong(mostSigBits >> 32, 4, chars, 0, 8); - chars[8] = '-'; - jla.formatUnsignedLong(mostSigBits >> 16, 4, chars, 9, 4); - chars[13] = '-'; - jla.formatUnsignedLong(mostSigBits, 4, chars, 14, 4); - chars[18] = '-'; - jla.formatUnsignedLong(leastSigBits >> 48, 4, chars, 19, 4); - chars[23] = '-'; - jla.formatUnsignedLong(leastSigBits, 4, chars, 24, 12); - return jla.newStringUnsafe(chars); + return jla.fastUUID(leastSigBits, mostSigBits); } /** diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/TimeUnit.java b/jdk/src/java.base/share/classes/java/util/concurrent/TimeUnit.java index 44268d97fbd..1395886faa5 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/TimeUnit.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/TimeUnit.java @@ -35,6 +35,9 @@ package java.util.concurrent; +import java.time.temporal.ChronoUnit; +import java.util.Objects; + /** * A {@code TimeUnit} represents time durations at a given unit of * granularity and provides utility methods to convert across units, @@ -390,4 +393,48 @@ public enum TimeUnit { } } + /** + * Converts this {@code TimeUnit} to the equivalent {@code ChronoUnit}. + * + * @return the converted equivalent ChronoUnit + * @since 9 + */ + public ChronoUnit toChronoUnit() { + switch (this) { + case NANOSECONDS: return ChronoUnit.NANOS; + case MICROSECONDS: return ChronoUnit.MICROS; + case MILLISECONDS: return ChronoUnit.MILLIS; + case SECONDS: return ChronoUnit.SECONDS; + case MINUTES: return ChronoUnit.MINUTES; + case HOURS: return ChronoUnit.HOURS; + case DAYS: return ChronoUnit.DAYS; + default: throw new AssertionError(); + } + } + + /** + * Converts a {@code ChronoUnit} to the equivalent {@code TimeUnit}. + * + * @param chronoUnit the ChronoUnit to convert + * @return the converted equivalent TimeUnit + * @throws IllegalArgumentException if {@code chronoUnit} has no + * equivalent TimeUnit + * @throws NullPointerException if {@code chronoUnit} is null + * @since 9 + */ + public static TimeUnit of(ChronoUnit chronoUnit) { + switch (Objects.requireNonNull(chronoUnit, "chronoUnit")) { + case NANOS: return TimeUnit.NANOSECONDS; + case MICROS: return TimeUnit.MICROSECONDS; + case MILLIS: return TimeUnit.MILLISECONDS; + case SECONDS: return TimeUnit.SECONDS; + case MINUTES: return TimeUnit.MINUTES; + case HOURS: return TimeUnit.HOURS; + case DAYS: return TimeUnit.DAYS; + default: + throw new IllegalArgumentException( + "No TimeUnit equivalent for " + chronoUnit); + } + } + } diff --git a/jdk/src/java.base/share/classes/java/util/stream/FindOps.java b/jdk/src/java.base/share/classes/java/util/stream/FindOps.java index 5926e79dd4d..45e1d697de0 100644 --- a/jdk/src/java.base/share/classes/java/util/stream/FindOps.java +++ b/jdk/src/java.base/share/classes/java/util/stream/FindOps.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -107,7 +107,7 @@ final class FindOps { */ private static final class FindOp implements TerminalOp { private final StreamShape shape; - final boolean mustFindFirst; + final int opFlags; final O emptyValue; final Predicate presentPredicate; final Supplier> sinkSupplier; @@ -129,7 +129,7 @@ final class FindOps { O emptyValue, Predicate presentPredicate, Supplier> sinkSupplier) { - this.mustFindFirst = mustFindFirst; + this.opFlags = StreamOpFlag.IS_SHORT_CIRCUIT | (mustFindFirst ? 0 : StreamOpFlag.NOT_ORDERED); this.shape = shape; this.emptyValue = emptyValue; this.presentPredicate = presentPredicate; @@ -138,7 +138,7 @@ final class FindOps { @Override public int getOpFlags() { - return StreamOpFlag.IS_SHORT_CIRCUIT | (mustFindFirst ? 0 : StreamOpFlag.NOT_ORDERED); + return opFlags; } @Override @@ -156,7 +156,10 @@ final class FindOps { @Override public O evaluateParallel(PipelineHelper helper, Spliterator spliterator) { - return new FindTask<>(this, helper, spliterator).invoke(); + // This takes into account the upstream ops flags and the terminal + // op flags and therefore takes into account findFirst or findAny + boolean mustFindFirst = StreamOpFlag.ORDERED.isKnown(helper.getStreamAndOpFlags()); + return new FindTask<>(this, mustFindFirst, helper, spliterator).invoke(); } } @@ -250,16 +253,20 @@ final class FindOps { private static final class FindTask extends AbstractShortCircuitTask> { private final FindOp op; + private final boolean mustFindFirst; FindTask(FindOp op, + boolean mustFindFirst, PipelineHelper helper, Spliterator spliterator) { super(helper, spliterator); + this.mustFindFirst = mustFindFirst; this.op = op; } FindTask(FindTask parent, Spliterator spliterator) { super(parent, spliterator); + this.mustFindFirst = parent.mustFindFirst; this.op = parent.op; } @@ -283,7 +290,7 @@ final class FindOps { @Override protected O doLeaf() { O result = helper.wrapAndCopyInto(op.sinkSupplier.get(), spliterator).get(); - if (!op.mustFindFirst) { + if (!mustFindFirst) { if (result != null) shortCircuit(result); return null; @@ -300,7 +307,7 @@ final class FindOps { @Override public void onCompletion(CountedCompleter caller) { - if (op.mustFindFirst) { + if (mustFindFirst) { for (FindTask child = leftChild, p = null; child != p; p = child, child = rightChild) { O result = child.getLocalResult(); diff --git a/jdk/src/java.base/share/classes/java/util/stream/SliceOps.java b/jdk/src/java.base/share/classes/java/util/stream/SliceOps.java index 68a84f8512b..e771b1f00f6 100644 --- a/jdk/src/java.base/share/classes/java/util/stream/SliceOps.java +++ b/jdk/src/java.base/share/classes/java/util/stream/SliceOps.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -139,7 +139,7 @@ final class SliceOps { } else { // @@@ OOMEs will occur for LongStream.range(0, Long.MAX_VALUE).filter(i -> true).limit(n) - // regardless of the value of n + // when n * parallelismLevel is sufficiently large. // Need to adjust the target size of splitting for the // SliceTask from say (size / k) to say min(size / k, 1 << 14) // This will limit the size of the buffers created at the leaf nodes @@ -604,8 +604,15 @@ final class SliceOps { return nb.build(); } else { - Node node = helper.wrapAndCopyInto(helper.makeNodeBuilder(-1, generator), - spliterator).build(); + final Node.Builder nb = op.makeNodeBuilder(-1, generator); + if (targetOffset == 0) { // limit only + Sink opSink = op.opWrapSink(helper.getStreamAndOpFlags(), nb); + helper.copyIntoWithCancel(helper.wrapSink(opSink), spliterator); + } + else { + helper.wrapAndCopyInto(nb, spliterator); + } + Node node = nb.build(); thisNodeSize = node.count(); completed = true; spliterator = null; diff --git a/jdk/src/java.base/share/classes/java/util/stream/StreamSpliterators.java b/jdk/src/java.base/share/classes/java/util/stream/StreamSpliterators.java index 20d112d44f3..7e8d81150a8 100644 --- a/jdk/src/java.base/share/classes/java/util/stream/StreamSpliterators.java +++ b/jdk/src/java.base/share/classes/java/util/stream/StreamSpliterators.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -186,7 +186,7 @@ class StreamSpliterators { @Override public Spliterator trySplit() { - if (isParallel && !finished) { + if (isParallel && buffer == null && !finished) { init(); Spliterator split = spliterator.trySplit(); diff --git a/jdk/src/java.base/share/classes/jdk/Version.java b/jdk/src/java.base/share/classes/jdk/Version.java new file mode 100644 index 00000000000..9ce9ec9314d --- /dev/null +++ b/jdk/src/java.base/share/classes/jdk/Version.java @@ -0,0 +1,609 @@ +/* + * Copyright (c) 2015, 2016, 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 jdk; + +import java.math.BigInteger; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + +/** + * A representation of the JDK version-string which contains a version + * number optionally followed by pre-release and build information. + * + *

Version numbers

+ * + * A version number, {@code $VNUM}, is a non-empty sequence of + * non-negative integer numerals, without leading or trailing zeroes, + * separated by period characters (U+002E); i.e., it matches the regular + * expression {@code ^[1-9][0-9]*(((\.0)*\.[1-9][0-9]*)*)*$}. The sequence may + * be of arbitrary length but the first three elements are assigned specific + * meanings, as follows: + * + *
+ *     $MAJOR.$MINOR.$SECURITY
+ * 
+ * + *
    + * + *
  • {@code $MAJOR} --- The major version number, + * incremented for a major release that contains significant new features as + * specified in a new edition of the Java SE Platform Specification, + * e.g., JSR 337 + * for Java SE 8. Features may be removed in a major release, given + * advance notice at least one major release ahead of time, and incompatible + * changes may be made when justified. The {@code $MAJOR} version number of + * JDK 8 was {@code 8}; the {@code $MAJOR} version number of JDK 9 + * is {@code 9}.

  • + * + *
  • {@code $MINOR} --- The minor version number, + * incremented for a minor update release that may contain compatible bug + * fixes, revisions to standard APIs mandated by a Maintenance Release of + * the relevant Platform Specification, and implementation features outside + * the scope of that Specification such as new JDK-specific APIs, additional + * service providers, new garbage collectors, and ports to new hardware + * architectures. {@code $MINOR} is reset to zero when {@code $MAJOR} is + * incremented.

  • + * + *
  • {@code $SECURITY} --- The security level, + * incremented for a security-update release that contains critical fixes + * including those necessary to improve security. {@code $SECURITY} is reset + * to zero only when {@code $MAJOR} is incremented. A higher + * value of {@code $SECURITY} for a given {@code $MAJOR} value, therefore, + * always indicates a more secure release, regardless of the value of {@code + * $MINOR}.

  • + * + *
+ * + *

The fourth and later elements of a version number are free for use by + * downstream consumers of the JDK code base. Such a consumer may, + * e.g., use the fourth element to identify patch releases which + * contain a small number of critical non-security fixes in addition to the + * security fixes in the corresponding security release.

+ * + *

The version number does not include trailing zero elements; + * i.e., {@code $SECURITY} is omitted if it has the value zero, and + * {@code $MINOR} is omitted if both {@code $MINOR} and {@code $SECURITY} have + * the value zero.

+ * + *

The sequence of numerals in a version number is compared to another + * such sequence in numerical, pointwise fashion; e.g., {@code 9.9.1} + * is less than {@code 9.10.0}. If one sequence is shorter than another then + * the missing elements of the shorter sequence are considered to be zero; + * e.g., {@code 9.1.2} is equal to {@code 9.1.2.0} but less than + * {@code 9.1.2.1}.

+ * + *

Version strings

+ * + *

A version string {@code $VSTR} consists of a version number + * {@code $VNUM}, as described above, optionally followed by pre-release and + * build information, in the format

+ * + *
+ *     $VNUM(-$PRE)?(\+($BUILD)?(-$OPT)?)?
+ * 
+ * + *

where:

+ * + *
    + * + *
  • {@code $PRE}, matching {@code ([a-zA-Z0-9]+)} --- + * A pre-release identifier. Typically {@code ea}, for an early-access + * release that's under active development and potentially unstable, or {@code + * internal}, for an internal developer build. + * + *

  • {@code $BUILD}, matching {@code + * (0|[1-9][0-9]*)} --- The build number, incremented for each promoted build. + * {@code $BUILD} is reset to {@code 1} when any portion of {@code $VNUM} is + * incremented.

    + * + *
  • {@code $OPT}, matching {@code ([-a-zA-Z0-9\.]+)} + * --- Additional build information, if desired. In the case of an {@code + * internal} build this will often contain the date and time of the + * build.

    + * + *
+ * + *

When comparing two version strings the value of {@code $OPT}, if + * present, may or may not be significant depending on the chosen comparison + * method. The comparison methods {@link #compareTo(Version) compareTo()} and + * {@link #compareToIgnoreOpt(Version) compareToIgnoreOpt{}} should be used + * consistently with the corresponding methods {@link #equals(Object) equals()} + * and {@link #equalsIgnoreOpt(Object) equalsIgnoreOpt()}.

+ * + *

A short version string ({@code $SVSTR}), often useful in less + * formal contexts, is simply {@code $VNUM} optionally ended with {@code + * -$PRE}.

+ * + * @since 9 + */ +public final class Version + implements Comparable +{ + private final List version; + private final Optional pre; + private final Optional build; + private final Optional optional; + + private static Version current; + + // $VNUM(-$PRE)?(\+($BUILD)?(\-$OPT)?)? + // RE limits the format of version strings + // ([1-9][0-9]*(?:(?:\.0)*\.[1-9][0-9]*)*)(?:-([a-zA-Z0-9]+))?(?:(\+)(0|[1-9][0-9]*)?)?(?:-([-a-zA-Z0-9.]+))? + + private static final String VNUM + = "(?[1-9][0-9]*(?:(?:\\.0)*\\.[1-9][0-9]*)*)"; + private static final String VNUM_GROUP = "VNUM"; + + private static final String PRE = "(?:-(?
[a-zA-Z0-9]+))?";
+    private static final String PRE_GROUP   = "PRE";
+
+    private static final String BUILD
+        = "(?:(?\\+)(?0|[1-9][0-9]*)?)?";
+    private static final String PLUS_GROUP  = "PLUS";
+    private static final String BUILD_GROUP = "BUILD";
+
+    private static final String OPT      = "(?:-(?[-a-zA-Z0-9.]+))?";
+    private static final String OPT_GROUP   = "OPT";
+
+    private static final String VSTR_FORMAT
+        = "^" + VNUM + PRE + BUILD + OPT + "$";
+    private static final Pattern VSTR_PATTERN = Pattern.compile(VSTR_FORMAT);
+
+    /**
+     * Constructs a valid JDK version string containing a
+     * version number followed by pre-release and build
+     * information.
+     *
+     * @param  s
+     *         A string to be interpreted as a version
+     *
+     * @throws  IllegalArgumentException
+     *          If the given string cannot be interpreted a valid version
+     *
+     * @throws  NullPointerException
+     *          If {@code s} is {@code null}
+     *
+     * @throws  NumberFormatException
+     *          If an element of the version number or the build number cannot
+     *          be represented as an {@link Integer}
+     */
+    private Version(String s) {
+        if (s == null)
+            throw new NullPointerException();
+
+        Matcher m = VSTR_PATTERN.matcher(s);
+        if (!m.matches())
+            throw new IllegalArgumentException("Invalid version string: '"
+                                               + s + "'");
+
+        // $VNUM is a dot-separated list of integers of arbitrary length
+        version
+            = Collections.unmodifiableList(
+                  Arrays.stream(m.group(VNUM_GROUP).split("\\."))
+                  .map(Integer::parseInt)
+                  .collect(Collectors.toList()));
+
+        pre = Optional.ofNullable(m.group(PRE_GROUP));
+
+        String b = m.group(BUILD_GROUP);
+        // $BUILD is an integer
+        build = (b == null)
+             ? Optional.empty()
+             : Optional.ofNullable(Integer.parseInt(b));
+
+        optional = Optional.ofNullable(m.group(OPT_GROUP));
+
+        // empty '+'
+        if ((m.group(PLUS_GROUP) != null) && !build.isPresent()) {
+            if (optional.isPresent()) {
+                if (pre.isPresent())
+                    throw new IllegalArgumentException("'+' found with"
+                        + " pre-release and optional components:'" + s + "'");
+            } else {
+                throw new IllegalArgumentException("'+' found with neither"
+                    + " build or optional components: '" + s + "'");
+            }
+        }
+    }
+
+    /**
+     * Parses the given string as a valid JDK version string containing a version number followed by pre-release and
+     * build information.
+     *
+     * @param  s
+     *         A string to interpret as a version
+     *
+     * @throws  IllegalArgumentException
+     *          If the given string cannot be interpreted a valid version
+     *
+     * @throws  NullPointerException
+     *          If the given string is {@code null}
+     *
+     * @throws  NumberFormatException
+     *          If an element of the version number or the build number cannot
+     *          be represented as an {@link Integer}
+     *
+     * @return  This version
+     */
+    public static Version parse(String s) {
+        return new Version(s);
+    }
+
+    /**
+     * Returns {@code System.getProperty("java.version")} as a Version.
+     *
+     * @throws  SecurityException
+     *          If a security manager exists and its {@link
+     *          SecurityManager#checkPropertyAccess(String)
+     *          checkPropertyAccess} method does not allow access to the
+     *          system property "java.version"
+     *
+     * @return  {@code System.getProperty("java.version")} as a Version
+     */
+    public static Version current() {
+        if (current == null) {
+            current = parse(AccessController.doPrivileged(
+                new PrivilegedAction<>() {
+                    public String run() {
+                        return System.getProperty("java.version");
+                    }
+                }));
+        }
+        return current;
+    }
+
+    /**
+     * Returns the major version number.
+     *
+     * @return  The major version number
+     */
+    public int major() {
+        return version.get(0);
+    }
+
+    /**
+     * Returns the minor version number or zero if it was
+     * not set.
+     *
+     * @return  The minor version number or zero if it was not set
+     */
+    public int minor() {
+        return (version.size() > 1 ? version.get(1) : 0);
+    }
+
+    /**
+     * Returns the security version number or zero if
+     * it was not set.
+     *
+     * @return  The security version number or zero if it was not set
+     */
+    public int security() {
+        return (version.size() > 2 ? version.get(2) : 0);
+    }
+
+    /**
+     * Returns an unmodifiable {@link java.util.List List} of the
+     * integer numerals contained in the version
+     * number.  The {@code List} always contains at least one
+     * element corresponding to the major version
+     * number.
+     *
+     * @return  An unmodifiable list of the integer numerals
+     *          contained in the version number
+     */
+    public List version() {
+        return version;
+    }
+
+    /**
+     * Returns the optional pre-release information.
+     *
+     * @return  The optional pre-release information as a String
+     */
+    public Optional pre() {
+        return pre;
+    }
+
+    /**
+     * Returns the build number.
+     *
+     * @return The optional build number.
+     */
+    public Optional build() {
+        return build;
+    }
+
+    /**
+     * Returns optional additional identifying build
+     * information.
+     *
+     * @return  Additional build information as a String
+     */
+    public Optional optional() {
+        return optional;
+    }
+
+    /**
+     * Compares this version to another.
+     *
+     * 

Each of the components in the version is + * compared in the follow order of precedence: version numbers, + * pre-release identifiers, build numbers, optional build information.

+ * + *

Comparison begins by examining the sequence of version numbers. If + * one sequence is shorter than another, then the missing elements of the + * shorter sequence are considered to be zero.

+ * + *

A version with a pre-release identifier is always considered to be + * less than a version without one. Pre-release identifiers are compared + * numerically when they consist only of digits, and lexicographically + * otherwise. Numeric identifiers are considered to be less than + * non-numeric identifiers.

+ * + *

A version without a build number is always less than one with a + * build number; otherwise build numbers are compared numerically.

+ * + *

The optional build information is compared lexicographically. + * During this comparison, a version with optional build information is + * considered to be greater than a version without one.

+ * + *

A version is not comparable to any other type of object. + * + * @param ob + * The object to be compared + * + * @return A negative integer, zero, or a positive integer if this + * {@code Version} is less than, equal to, or greater than the + * given {@code Version} + * + * @throws NullPointerException + * If the given object is {@code null} + */ + @Override + public int compareTo(Version ob) { + return compare(ob, false); + } + + /** + * Compares this version to another disregarding optional build + * information. + * + *

Two versions are compared by examining the version string as + * described in {@link #compareTo(Version)} with the exception that the + * optional build information is always ignored.

+ * + *

A version is not comparable to any other type of object. + * + * @param ob + * The object to be compared + * + * @return A negative integer, zero, or a positive integer if this + * {@code Version} is less than, equal to, or greater than the + * given {@code Version} + * + * @throws NullPointerException + * If the given object is {@code null} + */ + public int compareToIgnoreOpt(Version ob) { + return compare(ob, true); + } + + private int compare(Version ob, boolean ignoreOpt) { + if (ob == null) + throw new NullPointerException("Invalid argument"); + + int ret = compareVersion(ob); + if (ret != 0) + return ret; + + ret = comparePre(ob); + if (ret != 0) + return ret; + + ret = compareBuild(ob); + if (ret != 0) + return ret; + + if (!ignoreOpt) + return compareOpt(ob); + + return 0; + } + + private int compareVersion(Version ob) { + int size = version.size(); + int oSize = ob.version().size(); + int min = Math.min(size, oSize); + for (int i = 0; i < min; i++) { + Integer val = version.get(i); + Integer oVal = ob.version().get(i); + if (val != oVal) + return val - oVal; + } + if (size != oSize) + return size - oSize; + return 0; + } + + private int comparePre(Version ob) { + Optional oPre = ob.pre(); + if (!pre.isPresent()) { + if (oPre.isPresent()) + return 1; + } else { + if (!oPre.isPresent()) + return -1; + String val = pre.get(); + String oVal = oPre.get(); + if (val.matches("\\d+")) { + return (oVal.matches("\\d+") + ? (new BigInteger(val)).compareTo(new BigInteger(oVal)) + : -1); + } else { + return (oVal.matches("\\d+") + ? 1 + : val.compareTo(oVal)); + } + } + return 0; + } + + private int compareBuild(Version ob) { + Optional oBuild = ob.build(); + if (oBuild.isPresent()) { + return (build.isPresent() + ? build.get().compareTo(oBuild.get()) + : 1); + } else if (build.isPresent()) { + return -1; + } + return 0; + } + + private int compareOpt(Version ob) { + Optional oOpt = ob.optional(); + if (!optional.isPresent()) { + if (oOpt.isPresent()) + return -1; + } else { + if (!oOpt.isPresent()) + return 1; + return optional.get().compareTo(oOpt.get()); + } + return 0; + } + + /** + * Returns a string representation of this version. + * + * @return The version string + */ + @Override + public String toString() { + StringBuilder sb + = new StringBuilder(version.stream() + .map(Object::toString) + .collect(Collectors.joining("."))); + pre.ifPresent(v -> sb.append("-").append(v)); + + if (build.isPresent()) { + sb.append("+").append(build.get()); + if (optional.isPresent()) + sb.append("-").append(optional.get()); + } else { + if (optional.isPresent()) { + sb.append(pre.isPresent() ? "-" : "+-"); + sb.append(optional.get()); + } + } + + return sb.toString(); + } + + /** + * Determines whether this {@code Version} is equal to another object. + * + *

Two {@code Version}s are equal if and only if they represent the + * same version string. + * + *

This method satisfies the general contract of the {@link + * Object#equals(Object) Object.equals} method.

+ * + * @param ob + * The object to which this {@code Version} is to be compared + * + * @return {@code true} if, and only if, the given object is a {@code + * Version} that is identical to this {@code Version} + * + */ + @Override + public boolean equals(Object ob) { + boolean ret = equalsIgnoreOpt(ob); + if (!ret) + return false; + + Version that = (Version)ob; + return (this.optional().equals(that.optional())); + } + + /** + * Determines whether this {@code Version} is equal to another + * disregarding optional build information. + * + *

Two {@code Version}s are equal if and only if they represent the + * same version string disregarding the optional build information. + * + * @param ob + * The object to which this {@code Version} is to be compared + * + * @return {@code true} if, and only if, the given object is a {@code + * Version} that is identical to this {@code Version} + * ignoring the optinal build information + * + */ + public boolean equalsIgnoreOpt(Object ob) { + if (this == ob) + return true; + if (!(ob instanceof Version)) + return false; + + Version that = (Version)ob; + return (this.version().equals(that.version()) + && this.pre().equals(that.pre()) + && this.build().equals(that.build())); + } + + /** + * Returns the hash code of this version. + * + *

This method satisfies the general contract of the {@link + * Object#hashCode Object.hashCode} method. + * + * @return The hashcode of this version + */ + @Override + public int hashCode() { + int h = 1; + int p = 17; + + h = p * h + version.hashCode(); + h = p * h + pre.hashCode(); + h = p * h + build.hashCode(); + h = p * h + optional.hashCode(); + + return h; + } +} diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java index c513894a086..75ba73da5b2 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java +++ b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java @@ -124,12 +124,7 @@ public interface JavaLangAccess { void invokeFinalize(Object o) throws Throwable; /** - * Invokes Long.formatUnsignedLong(long val, int shift, char[] buf, int offset, int len) + * Invokes Long.fastUUID */ - void formatUnsignedLong(long val, int shift, char[] buf, int offset, int len); - - /** - * Invokes Integer.formatUnsignedInt(long val, int shift, char[] buf, int offset, int len) - */ - void formatUnsignedInt(int val, int shift, char[] buf, int offset, int len); + String fastUUID(long lsb, long msb); } diff --git a/jdk/src/java.base/share/classes/sun/misc/Cleaner.java b/jdk/src/java.base/share/classes/jdk/internal/ref/Cleaner.java similarity index 95% rename from jdk/src/java.base/share/classes/sun/misc/Cleaner.java rename to jdk/src/java.base/share/classes/jdk/internal/ref/Cleaner.java index ea473a17712..84c0f618a91 100644 --- a/jdk/src/java.base/share/classes/sun/misc/Cleaner.java +++ b/jdk/src/java.base/share/classes/jdk/internal/ref/Cleaner.java @@ -23,7 +23,7 @@ * questions. */ -package sun.misc; +package jdk.internal.ref; import java.lang.ref.*; import java.security.AccessController; @@ -58,6 +58,7 @@ import java.security.PrivilegedAction; public class Cleaner extends PhantomReference + implements Runnable { // Dummy reference queue, needed because the PhantomReference constructor @@ -153,4 +154,11 @@ public class Cleaner } } + @Override public void run() { + SecurityManager security = System.getSecurityManager(); + if (security != null) + security.checkPackageAccess("jdk.internal.ref"); + this.clean(); + } + } diff --git a/jdk/src/java.base/share/classes/sun/nio/ch/DirectBuffer.java b/jdk/src/java.base/share/classes/sun/nio/ch/DirectBuffer.java index 577ed7b16da..cba31015f0c 100644 --- a/jdk/src/java.base/share/classes/sun/nio/ch/DirectBuffer.java +++ b/jdk/src/java.base/share/classes/sun/nio/ch/DirectBuffer.java @@ -25,7 +25,7 @@ package sun.nio.ch; -import sun.misc.Cleaner; +import jdk.internal.ref.Cleaner; public interface DirectBuffer { diff --git a/jdk/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java b/jdk/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java index 1c4e1ca5075..671fe79efcc 100644 --- a/jdk/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java +++ b/jdk/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java @@ -47,7 +47,7 @@ import java.util.List; import jdk.internal.misc.JavaIOFileDescriptorAccess; import jdk.internal.misc.JavaNioAccess; import jdk.internal.misc.SharedSecrets; -import sun.misc.Cleaner; +import jdk.internal.ref.Cleaner; import sun.security.action.GetPropertyAction; public class FileChannelImpl diff --git a/jdk/src/java.base/share/classes/sun/nio/ch/IOVecWrapper.java b/jdk/src/java.base/share/classes/sun/nio/ch/IOVecWrapper.java index 0b09fe752bf..d2c03a34fea 100644 --- a/jdk/src/java.base/share/classes/sun/nio/ch/IOVecWrapper.java +++ b/jdk/src/java.base/share/classes/sun/nio/ch/IOVecWrapper.java @@ -26,7 +26,7 @@ package sun.nio.ch; import java.nio.ByteBuffer; -import sun.misc.*; +import jdk.internal.ref.Cleaner; /** diff --git a/jdk/src/java.base/share/classes/sun/nio/ch/Util.java b/jdk/src/java.base/share/classes/sun/nio/ch/Util.java index f2095540180..a580b82c4d0 100644 --- a/jdk/src/java.base/share/classes/sun/nio/ch/Util.java +++ b/jdk/src/java.base/share/classes/sun/nio/ch/Util.java @@ -33,7 +33,7 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.util.*; import jdk.internal.misc.Unsafe; -import sun.misc.Cleaner; +import jdk.internal.ref.Cleaner; import sun.security.action.GetPropertyAction; diff --git a/jdk/src/java.base/share/classes/sun/nio/fs/NativeBuffer.java b/jdk/src/java.base/share/classes/sun/nio/fs/NativeBuffer.java index 8acc0c198a1..91efac348e8 100644 --- a/jdk/src/java.base/share/classes/sun/nio/fs/NativeBuffer.java +++ b/jdk/src/java.base/share/classes/sun/nio/fs/NativeBuffer.java @@ -26,7 +26,7 @@ package sun.nio.fs; import jdk.internal.misc.Unsafe; -import sun.misc.Cleaner; +import jdk.internal.ref.Cleaner; /** * A light-weight buffer in native memory. diff --git a/jdk/src/java.base/share/classes/sun/reflect/ConstantPool.java b/jdk/src/java.base/share/classes/sun/reflect/ConstantPool.java index 03a5c189f7c..b813519bf2c 100644 --- a/jdk/src/java.base/share/classes/sun/reflect/ConstantPool.java +++ b/jdk/src/java.base/share/classes/sun/reflect/ConstantPool.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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 @@ -36,6 +36,10 @@ public class ConstantPool { public int getSize() { return getSize0 (constantPoolOop); } public Class getClassAt (int index) { return getClassAt0 (constantPoolOop, index); } public Class getClassAtIfLoaded (int index) { return getClassAtIfLoaded0 (constantPoolOop, index); } + // Returns a class reference index for a method or a field. + public int getClassRefIndexAt(int index) { + return getClassRefIndexAt0(constantPoolOop, index); + } // Returns either a Method or Constructor. // Static initializers are returned as Method objects. public Member getMethodAt (int index) { return getMethodAt0 (constantPoolOop, index); } @@ -45,13 +49,56 @@ public class ConstantPool { // Fetches the class name, member (field, method or interface // method) name, and type descriptor as an array of three Strings public String[] getMemberRefInfoAt (int index) { return getMemberRefInfoAt0 (constantPoolOop, index); } + // Returns a name and type reference index for a method, a field or an invokedynamic. + public int getNameAndTypeRefIndexAt(int index) { + return getNameAndTypeRefIndexAt0(constantPoolOop, index); + } + // Fetches the name and type from name_and_type index as an array of two Strings + public String[] getNameAndTypeRefInfoAt(int index) { + return getNameAndTypeRefInfoAt0(constantPoolOop, index); + } public int getIntAt (int index) { return getIntAt0 (constantPoolOop, index); } public long getLongAt (int index) { return getLongAt0 (constantPoolOop, index); } public float getFloatAt (int index) { return getFloatAt0 (constantPoolOop, index); } public double getDoubleAt (int index) { return getDoubleAt0 (constantPoolOop, index); } public String getStringAt (int index) { return getStringAt0 (constantPoolOop, index); } public String getUTF8At (int index) { return getUTF8At0 (constantPoolOop, index); } + public Tag getTagAt(int index) { + return Tag.valueOf(getTagAt0(constantPoolOop, index)); + } + public static enum Tag { + UTF8(1), + INTEGER(3), + FLOAT(4), + LONG(5), + DOUBLE(6), + CLASS(7), + STRING(8), + FIELDREF(9), + METHODREF(10), + INTERFACEMETHODREF(11), + NAMEANDTYPE(12), + METHODHANDLE(15), + METHODTYPE(16), + INVOKEDYNAMIC(18), + INVALID(0); + + private final int tagCode; + + private Tag(int tagCode) { + this.tagCode = tagCode; + } + + private static Tag valueOf(byte v) { + for (Tag tag : Tag.values()) { + if (tag.tagCode == v) { + return tag; + } + } + throw new IllegalArgumentException("Unknown constant pool tag code " + v); + } + } //--------------------------------------------------------------------------- // Internals only below this point // @@ -66,15 +113,19 @@ public class ConstantPool { private native int getSize0 (Object constantPoolOop); private native Class getClassAt0 (Object constantPoolOop, int index); private native Class getClassAtIfLoaded0 (Object constantPoolOop, int index); + private native int getClassRefIndexAt0 (Object constantPoolOop, int index); private native Member getMethodAt0 (Object constantPoolOop, int index); private native Member getMethodAtIfLoaded0(Object constantPoolOop, int index); private native Field getFieldAt0 (Object constantPoolOop, int index); private native Field getFieldAtIfLoaded0 (Object constantPoolOop, int index); private native String[] getMemberRefInfoAt0 (Object constantPoolOop, int index); + private native int getNameAndTypeRefIndexAt0(Object constantPoolOop, int index); + private native String[] getNameAndTypeRefInfoAt0(Object constantPoolOop, int index); private native int getIntAt0 (Object constantPoolOop, int index); private native long getLongAt0 (Object constantPoolOop, int index); private native float getFloatAt0 (Object constantPoolOop, int index); private native double getDoubleAt0 (Object constantPoolOop, int index); private native String getStringAt0 (Object constantPoolOop, int index); private native String getUTF8At0 (Object constantPoolOop, int index); + private native byte getTagAt0 (Object constantPoolOop, int index); } diff --git a/jdk/src/java.base/share/classes/sun/security/jca/ProviderList.java b/jdk/src/java.base/share/classes/sun/security/jca/ProviderList.java index 9f9c86d99e2..1db2d089932 100644 --- a/jdk/src/java.base/share/classes/sun/security/jca/ProviderList.java +++ b/jdk/src/java.base/share/classes/sun/security/jca/ProviderList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, 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 @@ -653,6 +653,7 @@ public final class ProviderList { String type = null; String algorithm; String provider; + String alternateName = null; PreferredEntry(String t, String p) { int i = t.indexOf('.'); @@ -664,6 +665,11 @@ public final class ProviderList { } provider = p; + if (algorithm.compareToIgnoreCase("SHA1") == 0) { + alternateName = "SHA-1"; + } else if (algorithm.compareToIgnoreCase("SHA-1") == 0) { + alternateName = "SHA1"; + } } boolean match(String t, String a) { @@ -685,6 +691,15 @@ public final class ProviderList { return true; } + if (alternateName != null && + a.compareToIgnoreCase(alternateName) == 0) { + if (debug != null) { + debug.println("Config entry found (alternateName): " + + toString()); + } + return true; + } + // No match return false; } diff --git a/jdk/src/java.base/share/conf/security/java.security b/jdk/src/java.base/share/conf/security/java.security index be48902f550..e71a2c3ff8d 100644 --- a/jdk/src/java.base/share/conf/security/java.security +++ b/jdk/src/java.base/share/conf/security/java.security @@ -109,7 +109,8 @@ security.provider.tbd=sun.security.pkcs11.SunPKCS11 # jdk.security.provider.preferred=AES/GCM/NoPadding:SunJCE, \ # MessageDigest.SHA-256:SUN #ifdef solaris-sparc -jdk.security.provider.preferred=AES:SunJCE, SHA-256:SUN, SHA-384:SUN, SHA-512:SUN +jdk.security.provider.preferred=AES:SunJCE, SHA1:SUN, SHA-224:SUN, \ + SHA-256:SUN, SHA-384:SUN, SHA-512:SUN #endif #ifdef solaris-x86 jdk.security.provider.preferred=AES:SunJCE, RSA:SunRsaSign diff --git a/jdk/src/java.base/share/native/include/jvm.h b/jdk/src/java.base/share/native/include/jvm.h index 2f65c1a2e97..99f7c7f8be4 100644 --- a/jdk/src/java.base/share/native/include/jvm.h +++ b/jdk/src/java.base/share/native/include/jvm.h @@ -63,7 +63,7 @@ extern "C" { * class. */ -#define JVM_INTERFACE_VERSION 4 +#define JVM_INTERFACE_VERSION 5 JNIEXPORT jint JNICALL JVM_GetInterfaceVersion(void); @@ -502,6 +502,9 @@ JNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAt JNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAtIfLoaded (JNIEnv *env, jobject unused, jobject jcpool, jint index); +JNIEXPORT jint JNICALL JVM_ConstantPoolGetClassRefIndexAt +(JNIEnv *env, jobject obj, jobject unused, jint index); + JNIEXPORT jobject JNICALL JVM_ConstantPoolGetMethodAt (JNIEnv *env, jobject unused, jobject jcpool, jint index); @@ -517,6 +520,12 @@ JNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAtIfLoaded JNIEXPORT jobjectArray JNICALL JVM_ConstantPoolGetMemberRefInfoAt (JNIEnv *env, jobject unused, jobject jcpool, jint index); +JNIEXPORT jint JNICALL JVM_ConstantPoolGetNameAndTypeRefIndexAt +(JNIEnv *env, jobject obj, jobject unused, jint index); + +JNIEXPORT jobjectArray JNICALL JVM_ConstantPoolGetNameAndTypeRefInfoAt +(JNIEnv *env, jobject obj, jobject unused, jint index); + JNIEXPORT jint JNICALL JVM_ConstantPoolGetIntAt (JNIEnv *env, jobject unused, jobject jcpool, jint index); @@ -535,6 +544,9 @@ JNIEXPORT jstring JNICALL JVM_ConstantPoolGetStringAt JNIEXPORT jstring JNICALL JVM_ConstantPoolGetUTF8At (JNIEnv *env, jobject unused, jobject jcpool, jint index); +JNIEXPORT jbyte JNICALL JVM_ConstantPoolGetTagAt +(JNIEnv *env, jobject unused, jobject jcpool, jint index); + /* * Parameter reflection */ diff --git a/jdk/src/java.base/share/native/libjava/ConstantPool.c b/jdk/src/java.base/share/native/libjava/ConstantPool.c index 1a29f003ba4..f7f744144e3 100644 --- a/jdk/src/java.base/share/native/libjava/ConstantPool.c +++ b/jdk/src/java.base/share/native/libjava/ConstantPool.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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 @@ -44,6 +44,12 @@ JNIEXPORT jclass JNICALL Java_sun_reflect_ConstantPool_getClassAtIfLoaded0 return JVM_ConstantPoolGetClassAtIfLoaded(env, unused, jcpool, index); } +JNIEXPORT jint JNICALL Java_sun_reflect_ConstantPool_getClassRefIndexAt0 +(JNIEnv *env, jobject unused, jobject jcpool, jint index) +{ + return JVM_ConstantPoolGetClassRefIndexAt(env, unused, jcpool, index); +} + JNIEXPORT jobject JNICALL Java_sun_reflect_ConstantPool_getMethodAt0 (JNIEnv *env, jobject unused, jobject jcpool, jint index) { @@ -74,6 +80,18 @@ JNIEXPORT jobjectArray JNICALL Java_sun_reflect_ConstantPool_getMemberRefInfoAt0 return JVM_ConstantPoolGetMemberRefInfoAt(env, unused, jcpool, index); } +JNIEXPORT jint JNICALL Java_sun_reflect_ConstantPool_getNameAndTypeRefIndexAt0 +(JNIEnv *env, jobject unused, jobject jcpool, jint index) +{ + return JVM_ConstantPoolGetNameAndTypeRefIndexAt(env, unused, jcpool, index); +} + +JNIEXPORT jobjectArray JNICALL Java_sun_reflect_ConstantPool_getNameAndTypeRefInfoAt0 +(JNIEnv *env, jobject unused, jobject jcpool, jint index) +{ + return JVM_ConstantPoolGetNameAndTypeRefInfoAt(env, unused, jcpool, index); +} + JNIEXPORT jint JNICALL Java_sun_reflect_ConstantPool_getIntAt0 (JNIEnv *env, jobject unused, jobject jcpool, jint index) { @@ -109,3 +127,10 @@ JNIEXPORT jstring JNICALL Java_sun_reflect_ConstantPool_getUTF8At0 { return JVM_ConstantPoolGetUTF8At(env, unused, jcpool, index); } + +JNIEXPORT jbyte JNICALL Java_sun_reflect_ConstantPool_getTagAt0 +(JNIEnv *env, jobject unused, jobject jcpool, jint index) +{ + return JVM_ConstantPoolGetTagAt(env, unused, jcpool, index); +} + diff --git a/jdk/src/java.base/share/native/libjimage/ImageNativeSubstrate.cpp b/jdk/src/java.base/share/native/libjimage/ImageNativeSubstrate.cpp index 32aa7d0c29f..124995dd0a2 100644 --- a/jdk/src/java.base/share/native/libjimage/ImageNativeSubstrate.cpp +++ b/jdk/src/java.base/share/native/libjimage/ImageNativeSubstrate.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -210,7 +210,7 @@ static jlong* JIMAGE_FindAttributes(JNIEnv *env, jlong* rawAttributes, jbyte* ra // Locate resource location data. ImageLocation location; bool found = reader->find_location(path, location); - delete path; + delete[] path; // Resource not found. if (!found) return NULL; // Expand stream into array. diff --git a/jdk/src/java.base/share/native/libjimage/imageDecompressor.cpp b/jdk/src/java.base/share/native/libjimage/imageDecompressor.cpp index e3110f060ab..edf88b5e85b 100644 --- a/jdk/src/java.base/share/native/libjimage/imageDecompressor.cpp +++ b/jdk/src/java.base/share/native/libjimage/imageDecompressor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -86,7 +86,7 @@ void ImageDecompressor::image_decompressor_init() { } void ImageDecompressor::image_decompressor_close() { - delete _decompressors; + delete[] _decompressors; } /* @@ -135,13 +135,13 @@ void ImageDecompressor::decompress_resource(u1* compressed, u1* uncompressed, decompressor->decompress_resource(compressed_resource, decompressed_resource, &_header, strings); if (compressed_resource_base != compressed) { - delete compressed_resource_base; + delete[] compressed_resource_base; } compressed_resource = decompressed_resource; } } while (has_header); memcpy(uncompressed, decompressed_resource, uncompressed_size); - delete decompressed_resource; + delete[] decompressed_resource; } // Zip decompressor @@ -190,8 +190,8 @@ void SharedStringDecompressor::decompress_resource(u1* data, { // String in Strings table *uncompressed_resource = 1; uncompressed_resource += 1; - int i = decompress_int(data); - const char * string = strings->get(i); + int k = decompress_int(data); + const char * string = strings->get(k); int str_length = (int) strlen(string); Endian::set_java(uncompressed_resource, str_length); uncompressed_resource += 2; @@ -241,7 +241,7 @@ void SharedStringDecompressor::decompress_resource(u1* data, *fullpkg = '/'; memcpy(uncompressed_resource, pkg_base, len); uncompressed_resource += len; - delete pkg_base; + delete[] pkg_base; desc_length += len; } else { // Empty package // Nothing to do. diff --git a/jdk/src/java.base/unix/classes/sun/security/provider/NativePRNG.java b/jdk/src/java.base/unix/classes/sun/security/provider/NativePRNG.java index c591fe806c6..f19b7e48a48 100644 --- a/jdk/src/java.base/unix/classes/sun/security/provider/NativePRNG.java +++ b/jdk/src/java.base/unix/classes/sun/security/provider/NativePRNG.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,8 @@ package sun.security.provider; import java.io.*; import java.net.*; import java.security.*; +import java.util.Arrays; + import sun.security.util.Debug; /** @@ -334,7 +336,9 @@ public final class NativePRNG extends SecureRandomSpi { private static final long MAX_BUFFER_TIME = 100; // size of the "next" buffer - private static final int BUFFER_SIZE = 32; + private static final int MAX_BUFFER_SIZE = 65536; + private static final int MIN_BUFFER_SIZE = 32; + private int bufferSize = 256; // Holder for the seedFile. Used if we ever add seed material. File seedFile; @@ -351,7 +355,7 @@ public final class NativePRNG extends SecureRandomSpi { private volatile sun.security.provider.SecureRandom mixRandom; // buffer for next bits - private final byte[] nextBuffer; + private byte[] nextBuffer; // number of bytes left in nextBuffer private int buffered; @@ -359,6 +363,16 @@ public final class NativePRNG extends SecureRandomSpi { // time we read the data into the nextBuffer private long lastRead; + // Count for the number of buffer size changes requests + // Positive value in increase size, negative to lower it. + private int change_buffer = 0; + + // Request limit to trigger an increase in nextBuffer size + private static final int REQ_LIMIT_INC = 1000; + + // Request limit to trigger a decrease in nextBuffer size + private static final int REQ_LIMIT_DEC = -100; + // mutex lock for nextBytes() private final Object LOCK_GET_BYTES = new Object(); @@ -373,7 +387,7 @@ public final class NativePRNG extends SecureRandomSpi { this.seedFile = seedFile; seedIn = FileInputStreamPool.getInputStream(seedFile); nextIn = FileInputStreamPool.getInputStream(nextFile); - nextBuffer = new byte[BUFFER_SIZE]; + nextBuffer = new byte[bufferSize]; } // get the SHA1PRNG for mixing @@ -466,9 +480,47 @@ public final class NativePRNG extends SecureRandomSpi { // if not, read new bytes private void ensureBufferValid() throws IOException { long time = System.currentTimeMillis(); - if ((buffered > 0) && (time - lastRead < MAX_BUFFER_TIME)) { - return; + int new_buffer_size = 0; + + // Check if buffer has bytes available that are not too old + if (buffered > 0) { + if (time - lastRead < MAX_BUFFER_TIME) { + return; + } else { + // byte is old, so subtract from counter to shrink buffer + change_buffer--; + } + } else { + // No bytes available, so add to count to increase buffer + change_buffer++; } + + // If counter has it a limit, increase or decrease size + if (change_buffer > REQ_LIMIT_INC) { + new_buffer_size = nextBuffer.length * 2; + } else if (change_buffer < REQ_LIMIT_DEC) { + new_buffer_size = nextBuffer.length / 2; + } + + // If buffer size is to be changed, replace nextBuffer. + if (new_buffer_size > 0) { + if (new_buffer_size <= MAX_BUFFER_SIZE && + new_buffer_size >= MIN_BUFFER_SIZE) { + nextBuffer = new byte[new_buffer_size]; + if (debug != null) { + debug.println("Buffer size changed to " + + new_buffer_size); + } + } else { + if (debug != null) { + debug.println("Buffer reached limit: " + + nextBuffer.length); + } + } + change_buffer = 0; + } + + // Load fresh random bytes into nextBuffer lastRead = time; readFully(nextIn, nextBuffer); buffered = nextBuffer.length; @@ -478,24 +530,40 @@ public final class NativePRNG extends SecureRandomSpi { // read from "next" and XOR with bytes generated by the // mixing SHA1PRNG private void implNextBytes(byte[] data) { - synchronized (LOCK_GET_BYTES) { try { getMixRandom().engineNextBytes(data); - int len = data.length; + int data_len = data.length; int ofs = 0; - while (len > 0) { - ensureBufferValid(); - int bufferOfs = nextBuffer.length - buffered; - while ((len > 0) && (buffered > 0)) { - data[ofs++] ^= nextBuffer[bufferOfs++]; - len--; - buffered--; + int len; + int buf_pos; + int localofs; + byte[] localBuffer; + + while (data_len > 0) { + synchronized (LOCK_GET_BYTES) { + ensureBufferValid(); + buf_pos = nextBuffer.length - buffered; + if (data_len > buffered) { + len = buffered; + buffered = 0; + } else { + len = data_len; + buffered -= len; + } + localBuffer = Arrays.copyOfRange(nextBuffer, buf_pos, + buf_pos + len); } + localofs = 0; + while (len > localofs) { + data[ofs] ^= localBuffer[localofs]; + ofs++; + localofs++; + } + data_len -= len; } - } catch (IOException e) { + } catch (IOException e){ throw new ProviderException("nextBytes() failed", e); } - } } - } + } } diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/Application.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/Application.java index 19d1edd43dc..3535b4ae3d6 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/Application.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/Application.java @@ -39,7 +39,7 @@ import sun.lwawt.LWWindowPeer; import sun.lwawt.macosx.CPlatformWindow; /** - * The Application class allows you to integrate your Java application with the native Mac OS X environment. + * The {@code Application} class allows you to integrate your Java application with the native Mac OS X environment. * You can provide your Mac OS X users a greatly enhanced experience by implementing a few basic handlers for standard system events. * * For example: @@ -142,7 +142,7 @@ public class Application { /** * Installs a handler to show a custom About window for your application. * - * Setting the {@link AboutHandler} to null reverts it to the default Cocoa About window. + * Setting the {@link AboutHandler} to {@code null} reverts it to the default Cocoa About window. * * @param aboutHandler the handler to respond to the {@link AboutHandler#handleAbout()} message * @since Java for Mac OS X 10.6 Update 3 @@ -155,7 +155,7 @@ public class Application { /** * Installs a handler to create the Preferences menu item in your application's app menu. * - * Setting the {@link PreferencesHandler} to null will remove the Preferences item from the app menu. + * Setting the {@link PreferencesHandler} to {@code null} will remove the Preferences item from the app menu. * * @param preferencesHandler * @since Java for Mac OS X 10.6 Update 3 @@ -167,8 +167,8 @@ public class Application { /** * Installs the handler which is notified when the application is asked to open a list of files. - * The {@link OpenFilesHandler#openFiles(AppEvent.OpenFilesEvent)} notifications are only sent if the Java app is a bundled application, with a CFBundleDocumentTypes array present in it's Info.plist. - * See the Info.plist Key Reference for more information about adding a CFBundleDocumentTypes key to your app's Info.plist. + * The {@link OpenFilesHandler#openFiles(AppEvent.OpenFilesEvent)} notifications are only sent if the Java app is a bundled application, with a {@code CFBundleDocumentTypes} array present in it's Info.plist. + * See the Info.plist Key Reference for more information about adding a {@code CFBundleDocumentTypes} key to your app's Info.plist. * * @param openFileHandler * @since Java for Mac OS X 10.6 Update 3 @@ -180,8 +180,8 @@ public class Application { /** * Installs the handler which is notified when the application is asked to print a list of files. - * The {@link PrintFilesHandler#printFiles(AppEvent.PrintFilesEvent)} notifications are only sent if the Java app is a bundled application, with a CFBundleDocumentTypes array present in it's Info.plist. - * See the Info.plist Key Reference for more information about adding a CFBundleDocumentTypes key to your app's Info.plist. + * The {@link PrintFilesHandler#printFiles(AppEvent.PrintFilesEvent)} notifications are only sent if the Java app is a bundled application, with a {@code CFBundleDocumentTypes} array present in it's Info.plist. + * See the Info.plist Key Reference for more information about adding a {@code CFBundleDocumentTypes} key to your app's Info.plist. * * @param printFileHandler * @since Java for Mac OS X 10.6 Update 3 @@ -193,10 +193,10 @@ public class Application { /** * Installs the handler which is notified when the application is asked to open a URL. - * The {@link OpenURIHandler#openURI(AppEvent.OpenURIEvent)} notifications are only sent if the Java app is a bundled application, with a CFBundleURLTypes array present in it's Info.plist. - * See the Info.plist Key Reference for more information about adding a CFBundleURLTypes key to your app's Info.plist. + * The {@link OpenURIHandler#openURI(AppEvent.OpenURIEvent)} notifications are only sent if the Java app is a bundled application, with a {@code CFBundleURLTypes} array present in it's Info.plist. + * See the Info.plist Key Reference for more information about adding a {@code CFBundleURLTypes} key to your app's Info.plist. * - * Setting the handler to null causes all {@link OpenURIHandler#openURI(AppEvent.OpenURIEvent)} requests to be enqueued until another handler is set. + * Setting the handler to {@code null} causes all {@link OpenURIHandler#openURI(AppEvent.OpenURIEvent)} requests to be enqueued until another handler is set. * * @param openURIHandler * @since Java for Mac OS X 10.6 Update 3 @@ -209,7 +209,7 @@ public class Application { /** * Installs the handler which determines if the application should quit. * The handler is passed a one-shot {@link QuitResponse} which can cancel or proceed with the quit. - * Setting the handler to null causes all quit requests to directly perform the default {@link QuitStrategy}. + * Setting the handler to {@code null} causes all quit requests to directly perform the default {@link QuitStrategy}. * * @param quitHandler the handler that is called when the application is asked to quit * @since Java for Mac OS X 10.6 Update 3 @@ -432,11 +432,11 @@ public class Application { /** * Enables the Preferences item in the application menu. The ApplicationListener receives a callback for - * selection of the Preferences item in the application menu only if this is set to true. + * selection of the Preferences item in the application menu only if this is set to {@code true}. * * If a Preferences item isn't present, this method adds and enables it. * - * @param enable specifies whether the Preferences item in the application menu should be enabled (true) or not (false) + * @param enable specifies whether the Preferences item in the application menu should be enabled ({@code true}) or not ({@code false}) * * @deprecated no replacement * @since 1.4 @@ -449,12 +449,12 @@ public class Application { /** * Enables the About item in the application menu. The ApplicationListener receives a callback for - * selection of the About item in the application menu only if this is set to true. Because AWT supplies - * a standard About window when an application may not, by default this is set to true. + * selection of the About item in the application menu only if this is set to {@code true}. Because AWT supplies + * a standard About window when an application may not, by default this is set to {@code true}. * * If the About item isn't present, this method adds and enables it. * - * @param enable specifies whether the About item in the application menu should be enabled (true) or not (false) + * @param enable specifies whether the About item in the application menu should be enabled ({@code true}) or not ({@code false}) * * @deprecated no replacement * @since 1.4 @@ -553,7 +553,7 @@ public class Application { } /** - * @deprecated Use java.awt.MouseInfo.getPointerInfo().getLocation(). + * @deprecated Use {@code java.awt.MouseInfo.getPointerInfo().getLocation()}. * * @since 1.4 */ diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationAdapter.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationAdapter.java index bf78e586311..17339373153 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationAdapter.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationAdapter.java @@ -26,7 +26,7 @@ package com.apple.eawt; /** - * An abstract adapter class for receiving ApplicationEvents. + * An abstract adapter class for receiving {@code ApplicationEvents}. * * ApplicationEvents are deprecated. Use individual app event listeners or handlers instead. * diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationEvent.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationEvent.java index 908c8257b01..0cfe0741682 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationEvent.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationEvent.java @@ -50,9 +50,9 @@ public class ApplicationEvent extends EventObject { /** * Determines whether an ApplicationListener has acted on a particular event. - * An event is marked as having been handled with setHandled(true). + * An event is marked as having been handled with {@code setHandled(true)}. * - * @return true if the event has been handled, otherwise false + * @return {@code true} if the event has been handled, otherwise {@code false} * * @since 1.4 * @deprecated @@ -65,10 +65,10 @@ public class ApplicationEvent extends EventObject { /** * Marks the event as handled. * After this method handles an ApplicationEvent, it may be useful to specify that it has been handled. - * This is usually used in conjunction with getHandled(). - * Set to true to designate that this event has been handled. By default it is false. + * This is usually used in conjunction with {@code getHandled()}. + * Set to {@code true} to designate that this event has been handled. By default it is {@code false}. * - * @param state true if the event has been handled, otherwise false. + * @param state {@code true} if the event has been handled, otherwise {@code false}. * * @since 1.4 * @deprecated @@ -84,7 +84,7 @@ public class ApplicationEvent extends EventObject { * For example, the Print and Open events refer to specific files. * For these cases, this returns the appropriate file name. * - * @return the full path to the file associated with the event, if applicable, otherwise null + * @return the full path to the file associated with the event, if applicable, otherwise {@code null} * * @since 1.4 * @deprecated use {@link OpenFilesHandler} or {@link PrintFilesHandler} instead diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationListener.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationListener.java index 14e3386134e..ea2efcf0ede 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationListener.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationListener.java @@ -53,9 +53,9 @@ import java.util.EventListener; @Deprecated public interface ApplicationListener extends EventListener { /** - * Called when the user selects the About item in the application menu. If event is not handled by - * setting isHandled(true), a default About window consisting of the application's name and icon is - * displayed. To display a custom About window, designate the event as being handled and display the + * Called when the user selects the About item in the application menu. If {@code event} is not handled by + * setting {@code isHandled(true)}, a default About window consisting of the application's name and icon is + * displayed. To display a custom About window, designate the {@code event} as being handled and display the * appropriate About window. * * @param event an ApplicationEvent initiated by the user choosing About in the application menu @@ -99,7 +99,7 @@ public interface ApplicationListener extends EventListener { * Called when the Preference item in the application menu is selected. Native Mac OS X applications make their * Preferences window available through the application menu. Java applications are automatically given an application * menu in Mac OS X. By default, the Preferences item is disabled in that menu. If you are deploying an application - * on Mac OS X, you should enable the preferences item with setEnabledPreferencesMenu(true) in the + * on Mac OS X, you should enable the preferences item with {@code setEnabledPreferencesMenu(true)} in the * Application object and then display your Preferences window in this handler. * * @param event triggered when the user selects Preferences from the application menu @@ -130,8 +130,8 @@ public interface ApplicationListener extends EventListener { * application menu, when the user types Command-Q, or when the user control clicks on your application icon in the * Dock and chooses Quit. You can either accept or reject the request to quit. You might want to reject the request * to quit if the user has unsaved work. Reject the request, move into your code to save changes, then quit your - * application. To accept the request to quit, and terminate the application, set isHandled(true) for the - * event. To reject the quit, set isHandled(false). + * application. To accept the request to quit, and terminate the application, set {@code isHandled(true)} for the + * {@code event}. To reject the quit, set {@code isHandled(false)}. * * @param event a Quit Application event * @deprecated use {@link QuitHandler} and {@link QuitResponse} diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/OpenURIHandler.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/OpenURIHandler.java index 3197f1528f5..1964344f94a 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/OpenURIHandler.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/OpenURIHandler.java @@ -29,8 +29,8 @@ import com.apple.eawt.AppEvent.OpenURIEvent; /** * An implementor is notified when the application is asked to open a URI. - * The application only sends {@link com.apple.eawt.EAWTEvent.OpenURIEvent}s when it has been launched as a bundled Mac application, and it's Info.plist claims URL schemes in it's CFBundleURLTypes entry. - * See the Info.plist Key Reference for more information about adding a CFBundleURLTypes key to your app's Info.plist. + * The application only sends {@link com.apple.eawt.EAWTEvent.OpenURIEvent}s when it has been launched as a bundled Mac application, and it's Info.plist claims URL schemes in it's {@code CFBundleURLTypes} entry. + * See the Info.plist Key Reference for more information about adding a {@code CFBundleURLTypes} key to your app's Info.plist. * * @see Application#setOpenURIHandler(OpenURIHandler) * diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/QuitStrategy.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/QuitStrategy.java index 89c8be0465f..a0140d9ba78 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/QuitStrategy.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/QuitStrategy.java @@ -38,7 +38,7 @@ package com.apple.eawt; */ public enum QuitStrategy { /** - * Shuts down the application by calling System.exit(0). This is the default strategy. + * Shuts down the application by calling {@code System.exit(0)}. This is the default strategy. */ SYSTEM_EXIT_0, diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eio/FileManager.java b/jdk/src/java.desktop/macosx/classes/com/apple/eio/FileManager.java index 5dec385d5aa..90841e426c0 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/eio/FileManager.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/eio/FileManager.java @@ -32,19 +32,19 @@ import java.io.*; * attributes. These attributes in turn are dependent on HFS and HFS+ file systems. As such, it is important to recognize * their limitation when writing code that must function well across multiple platforms.

* - * In addition to file name suffixes, Mac OS X can use Finder attributes like file type and creator codes to - * identify and handle files. These codes are unique 4-byte identifiers. The file type is a string that describes the - * contents of a file. For example, the file type APPL identifies the file as an application and therefore - * executable. A file type of TEXT means that the file contains raw text. Any application that can read raw - * text can open a file of type TEXT. Applications that use proprietary file types might assign their files a proprietary - * file type code. + * In addition to file name suffixes, Mac OS X can use Finder attributes like file {@code type} and {@code creator} codes to + * identify and handle files. These codes are unique 4-byte identifiers. The file {@code type} is a string that describes the + * contents of a file. For example, the file type {@code APPL} identifies the file as an application and therefore + * executable. A file type of {@code TEXT} means that the file contains raw text. Any application that can read raw + * text can open a file of type {@code TEXT}. Applications that use proprietary file types might assign their files a proprietary + * file {@code type} code. *

- * To identify the application that can handle a document, the Finder can look at the creator. For example, if a user - * double-clicks on a document with the ttxt creator, it opens up in Text Edit, the application registered - * with the ttxt creator code. Note that the creator + * To identify the application that can handle a document, the Finder can look at the {@code creator}. For example, if a user + * double-clicks on a document with the {@code ttxt creator}, it opens up in Text Edit, the application registered + * with the {@code ttxt creator} code. Note that the {@code creator} * code can be set to any application, not necessarily the application that created it. For example, if you - * use an editor to create an HTML document, you might want to assign a browser's creator code for the file rather than - * the HTML editor's creator code. Double-clicking on the document then opens the appropriate browser rather than the + * use an editor to create an HTML document, you might want to assign a browser's {@code creator} code for the file rather than + * the HTML editor's {@code creator} code. Double-clicking on the document then opens the appropriate browser rather than the *HTML editor. *

* If you plan to publicly distribute your application, you must register its creator and any proprietary file types with the Apple @@ -126,7 +126,7 @@ public class FileManager { } /** - * Sets the file type and creator codes for a file or folder. + * Sets the file {@code type} and {@code creator} codes for a file or folder. * * @since 1.4 */ @@ -140,7 +140,7 @@ public class FileManager { private static native void _setFileTypeAndCreator(String filename, int type, int creator) throws IOException; /** - * Sets the file type code for a file or folder. + * Sets the file {@code type} code for a file or folder. * * @since 1.4 */ @@ -154,7 +154,7 @@ public class FileManager { private static native void _setFileType(String filename, int type) throws IOException; /** - * Sets the file creator code for a file or folder. + * Sets the file {@code creator} code for a file or folder. * * @since 1.4 */ @@ -168,7 +168,7 @@ public class FileManager { private static native void _setFileCreator(String filename, int creator) throws IOException; /** - * Obtains the file type code for a file or folder. + * Obtains the file {@code type} code for a file or folder. * * @since 1.4 */ @@ -182,7 +182,7 @@ public class FileManager { private static native int _getFileType(String filename) throws IOException; /** - * Obtains the file creator code for a file or folder. + * Obtains the file {@code creator} code for a file or folder. * * @since 1.4 */ @@ -200,11 +200,11 @@ public class FileManager { * Locates a folder of a particular type. Mac OS X recognizes certain specific folders that have distinct purposes. * For example, the user's desktop or temporary folder. These folders have corresponding codes. Given one of these codes, * this method returns the path to that particular folder. Certain folders of a given type may appear in more than - * one domain. For example, although there is only one root folder, there are multiple pref - * folders. If this method is called to find the pref folder, it will return the first one it finds, - * the user's preferences folder in ~/Library/Preferences. To explicitly locate a folder in a certain - * domain use findFolder(short domain, int folderType) or findFolder(short domain, int folderType, - * boolean createIfNeeded). + * one domain. For example, although there is only one {@code root} folder, there are multiple {@code pref} + * folders. If this method is called to find the {@code pref} folder, it will return the first one it finds, + * the user's preferences folder in {@code ~/Library/Preferences}. To explicitly locate a folder in a certain + * domain use {@code findFolder(short domain, int folderType)} or + * {@code findFolder(short domain, int folderType, boolean createIfNeeded)}. * * @return the path to the folder searched for * @@ -215,8 +215,8 @@ public class FileManager { } /** - * Locates a folder of a particular type, within a given domain. Similar to findFolder(int folderType) - * except that the domain to look in can be specified. Valid values for domaininclude: + * Locates a folder of a particular type, within a given domain. Similar to {@code findFolder(int folderType)} + * except that the domain to look in can be specified. Valid values for {@code domain} include: *

*
user
*
The User domain contains resources specific to the user who is currently logged in
@@ -239,12 +239,12 @@ public class FileManager { /** * Locates a folder of a particular type within a given domain and optionally creating the folder if it does - * not exist. The behavior is similar to findFolder(int folderType) and - * findFolder(short domain, int folderType) except that it can create the folder if it does not already exist. + * not exist. The behavior is similar to {@code findFolder(int folderType)} and + * {@code findFolder(short domain, int folderType)} except that it can create the folder if it does not already exist. * * @param createIfNeeded - * set to true, by setting to false the behavior will be the - * same as findFolder(short domain, int folderType, boolean createIfNeeded) + * set to {@code true}, by setting to {@code false} the behavior will be the + * same as {@code findFolder(short domain, int folderType, boolean createIfNeeded)} * @return the path to the folder searched for * * @since 1.4 @@ -263,9 +263,9 @@ public class FileManager { /** - * Opens the path specified by a URL in the appropriate application for that URL. HTTP URL's (http://) - * open in the default browser as set in the Internet pane of System Preferences. File (file://) and - * FTP URL's (ftp://) open in the Finder. Note that opening an FTP URL will prompt the user for where + * Opens the path specified by a URL in the appropriate application for that URL. HTTP URL's ({@code http://}) + * open in the default browser as set in the Internet pane of System Preferences. File ({@code file://}) and + * FTP URL's ({@code ftp://}) open in the Finder. Note that opening an FTP URL will prompt the user for where * they want to save the downloaded file(s). * * @param url diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileSystemModel.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileSystemModel.java index 887ab5c8bd3..05eddcea4d8 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileSystemModel.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileSystemModel.java @@ -26,6 +26,7 @@ package com.apple.laf; +import java.awt.ComponentOrientation; import java.beans.*; import java.io.File; import java.util.*; @@ -85,6 +86,15 @@ class AquaFileSystemModel extends AbstractTableModel implements PropertyChangeLi } else if (prop == JFileChooser.FILE_SELECTION_MODE_CHANGED_PROPERTY) { invalidateFileCache(); validateFileCache(); + } else if (prop.equals("componentOrientation")) { + ComponentOrientation o = (ComponentOrientation) e.getNewValue(); + JFileChooser cc = (JFileChooser) e.getSource(); + if (o != e.getOldValue()) { + cc.applyComponentOrientation(o); + } + fFileList.setComponentOrientation(o); + fFileList.getParent().getParent().setComponentOrientation(o); + } if (prop == SORT_BY_CHANGED) {// $ Ought to just resort fSortNames = (((Integer)e.getNewValue()).intValue() == 0); diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameManager.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameManager.java index 49a9a19d201..c2ce10b0e4a 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameManager.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameManager.java @@ -105,7 +105,9 @@ public class AquaInternalFrameManager extends DefaultDesktopManager { // Position depends on *current* position of frame, unlike super which reuses the first position final Rectangle r = getBoundsForIconOf(f); desktopIcon.setBounds(r.x, r.y, r.width, r.height); - + if (!wasIcon(f)) { + setWasIcon(f, Boolean.TRUE); + } c = f.getParent(); if (c == null) return; diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java index 530b5c6d999..74b40511795 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java @@ -295,9 +295,9 @@ public class AquaInternalFrameUI extends BasicInternalFrameUI implements SwingCo } /** - * Installs necessary mouse handlers on newPane + * Installs necessary mouse handlers on {@code newPane} * and adds it to the frame. - * Reverse process for the currentPane. + * Reverse process for the {@code currentPane}. */ @Override protected void replacePane(final JComponent currentPane, final JComponent newPane) { diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java index 44b9be288f5..f04d42de03b 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java @@ -82,9 +82,9 @@ public class AquaLookAndFeel extends BasicLookAndFeel { } /** - * Returns true if the LookAndFeel returned - * RootPaneUI instances support providing Window decorations - * in a JRootPane. + * Returns true if the {@code LookAndFeel} returned + * {@code RootPaneUI} instances support providing Window decorations + * in a {@code JRootPane}. *

* The default implementation returns false, subclasses that support * Window decorations should override this and return true. @@ -174,20 +174,20 @@ public class AquaLookAndFeel extends BasicLookAndFeel { } /** - * Returns an ActionMap. + * Returns an {@code ActionMap}. *

- * This ActionMap contains Actions that + * This {@code ActionMap} contains {@code Actions} that * embody the ability to render an auditory cue. These auditory * cues map onto user and system activities that may be useful * for an end user to know about (such as a dialog box appearing). *

- * At the appropriate time in a JComponent UI's lifecycle, + * At the appropriate time in a {@code JComponent} UI's lifecycle, * the ComponentUI is responsible for getting the appropriate - * Action out of the ActionMap and passing - * it on to playSound. + * {@code Action} out of the {@code ActionMap} and passing + * it on to {@code playSound}. *

- * The Actions in this ActionMap are - * created by the createAudioAction method. + * The {@code Actions} in this {@code ActionMap} are + * created by the {@code createAudioAction} method. * * @return an ActionMap containing Actions * responsible for rendering auditory cues diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaOptionPaneUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaOptionPaneUI.java index c1a57e503df..c62eab5f08b 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaOptionPaneUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaOptionPaneUI.java @@ -47,7 +47,7 @@ public class AquaOptionPaneUI extends BasicOptionPaneUI { /** * Creates and returns a Container containin the buttons. The buttons - * are created by calling getButtons. + * are created by calling {@code getButtons}. */ protected Container createButtonArea() { final Container bottom = super.createButtonArea(); @@ -141,5 +141,27 @@ public class AquaOptionPaneUI extends BasicOptionPaneUI { xLocation += xOffset; } } + + @Override + public Dimension minimumLayoutSize(Container c) { + if (c != null) { + Component[] children = c.getComponents(); + if (children != null && children.length > 0) { + int numChildren = children.length; + Insets cInsets = c.getInsets(); + int extraHeight = cInsets.top + cInsets.bottom; + int extraWidth = cInsets.left + cInsets.right; + int okCancelButtonWidth = extraWidth + + (kOKCancelButtonWidth * numChildren) + + (numChildren - 1) * padding; + int okbuttonHeight = extraHeight + kButtonHeight; + Dimension minSize = super.minimumLayoutSize(c); + return new Dimension(Math.max(minSize.width, + okCancelButtonWidth), + Math.max(minSize.height, okbuttonHeight)); + } + } + return new Dimension(0, 0); + } } } diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java index 1ac16c320b7..9f5f09bbd1e 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java @@ -180,10 +180,19 @@ public class AquaProgressBarUI extends ProgressBarUI implements ChangeListener, final int width = progressBar.getWidth() - (i.right + i.left); final int height = progressBar.getHeight() - (i.bottom + i.top); + Graphics2D g2 = (Graphics2D) g; + final AffineTransform savedAT = g2.getTransform(); + if (!progressBar.getComponentOrientation().isLeftToRight()) { + //Scale operation: Flips component about pivot + //Translate operation: Moves component back into original position + g2.scale(-1, 1); + g2.translate(-progressBar.getWidth(), 0); + } painter.paint(g, progressBar, i.left, i.top, width, height); + g2.setTransform(savedAT); if (progressBar.isStringPainted() && !progressBar.isIndeterminate()) { - paintString(g, i.left, i.top, width, height); + paintString(g, i.left, i.top, width, height); } } diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaRootPaneUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaRootPaneUI.java index 3ab83b037c8..a4e179645a9 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaRootPaneUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaRootPaneUI.java @@ -164,7 +164,7 @@ public class AquaRootPaneUI extends BasicRootPaneUI implements AncestorListener, /** * Invoked when a property changes on the root pane. If the event - * indicates the defaultButton has changed, this will + * indicates the {@code defaultButton} has changed, this will * update the animation. * If the enabled state changed, it will start or stop the animation */ diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaSpinnerUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaSpinnerUI.java index d2d9a76500b..219e739bcfb 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaSpinnerUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaSpinnerUI.java @@ -22,7 +22,6 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ - package com.apple.laf; import java.awt.*; @@ -45,33 +44,37 @@ import com.apple.laf.AquaUtils.RecyclableSingleton; import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor; /** - * This is originally derived from BasicSpinnerUI, but they made everything private - * so we can't subclass! + * This is originally derived from BasicSpinnerUI, but they made everything + * private so we can't subclass! */ public class AquaSpinnerUI extends SpinnerUI { + private static final RecyclableSingleton propertyChangeListener = new RecyclableSingletonFromDefaultConstructor<>(PropertyChangeHandler.class); + static PropertyChangeListener getPropertyChangeListener() { return propertyChangeListener.get(); } private static final RecyclableSingleton nextButtonHandler = new RecyclableSingleton() { - @Override - protected ArrowButtonHandler getInstance() { - return new ArrowButtonHandler("increment", true); - } - }; + @Override + protected ArrowButtonHandler getInstance() { + return new ArrowButtonHandler("increment", true); + } + }; + static ArrowButtonHandler getNextButtonHandler() { return nextButtonHandler.get(); } private static final RecyclableSingleton previousButtonHandler = new RecyclableSingleton() { - @Override - protected ArrowButtonHandler getInstance() { - return new ArrowButtonHandler("decrement", false); - } - }; + @Override + protected ArrowButtonHandler getInstance() { + return new ArrowButtonHandler("decrement", false); + } + }; + static ArrowButtonHandler getPreviousButtonHandler() { return previousButtonHandler.get(); } @@ -92,9 +95,10 @@ public class AquaSpinnerUI extends SpinnerUI { } boolean wasOpaque; + @Override public void installUI(final JComponent c) { - this.spinner = (JSpinner)c; + this.spinner = (JSpinner) c; installDefaults(); installListeners(); next = createNextButton(); @@ -110,8 +114,7 @@ public class AquaSpinnerUI extends SpinnerUI { installKeyboardActions(); // this doesn't work because JSpinner calls setOpaque(true) directly in it's constructor - // LookAndFeel.installProperty(spinner, "opaque", Boolean.FALSE); - + // LookAndFeel.installProperty(spinner, "opaque", Boolean.FALSE); // ...so we have to handle the is/was opaque ourselves wasOpaque = spinner.isOpaque(); spinner.setOpaque(false); @@ -208,6 +211,7 @@ public class AquaSpinnerUI extends SpinnerUI { @SuppressWarnings("serial") // Superclass is not serializable across versions class TransparentButton extends JButton implements SwingConstants { + boolean interceptRepaints = false; public TransparentButton() { @@ -219,14 +223,17 @@ public class AquaSpinnerUI extends SpinnerUI { } @Override - public void paint(final Graphics g) {} + public void paint(final Graphics g) { + } @Override public void repaint() { // only intercept repaints if we are after this has been initialized // otherwise we can't talk to our containing class if (interceptRepaints) { - if (spinPainter == null) return; + if (spinPainter == null) { + return; + } spinPainter.repaint(); } super.repaint(); @@ -246,7 +253,9 @@ public class AquaSpinnerUI extends SpinnerUI { } protected void fixupEditor(final JComponent editor) { - if (!(editor instanceof DefaultEditor)) return; + if (!(editor instanceof DefaultEditor)) { + return; + } editor.setOpaque(false); editor.setInheritsPopupMenu(true); @@ -255,7 +264,7 @@ public class AquaSpinnerUI extends SpinnerUI { editor.setFont(new FontUIResource(spinner.getFont())); } - final JFormattedTextField editorTextField = ((DefaultEditor)editor).getTextField(); + final JFormattedTextField editorTextField = ((DefaultEditor) editor).getTextField(); if (editorTextField.getFont() instanceof UIResource) { editorTextField.setFont(new FontUIResource(spinner.getFont())); } @@ -277,7 +286,7 @@ public class AquaSpinnerUI extends SpinnerUI { child.setEnabled(enabled); if (child instanceof Container) { - updateEnabledState((Container)child, enabled); + updateEnabledState((Container) child, enabled); } } } @@ -290,13 +299,13 @@ public class AquaSpinnerUI extends SpinnerUI { private InputMap getInputMap(final int condition) { if (condition == JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) { - return (InputMap)UIManager.get("Spinner.ancestorInputMap"); + return (InputMap) UIManager.get("Spinner.ancestorInputMap"); } return null; } private ActionMap getActionMap() { - ActionMap map = (ActionMap)UIManager.get("Spinner.actionMap"); + ActionMap map = (ActionMap) UIManager.get("Spinner.actionMap"); if (map == null) { map = createActionMap(); @@ -316,6 +325,7 @@ public class AquaSpinnerUI extends SpinnerUI { @SuppressWarnings("serial") // Superclass is not serializable across versions private static class ArrowButtonHandler extends AbstractAction implements MouseListener { + final javax.swing.Timer autoRepeatTimer; final boolean isNext; JSpinner spinner = null; @@ -330,9 +340,9 @@ public class AquaSpinnerUI extends SpinnerUI { private JSpinner eventToSpinner(final AWTEvent e) { Object src = e.getSource(); while ((src instanceof Component) && !(src instanceof JSpinner)) { - src = ((Component)src).getParent(); + src = ((Component) src).getParent(); } - return (src instanceof JSpinner) ? (JSpinner)src : null; + return (src instanceof JSpinner) ? (JSpinner) src : null; } @Override @@ -342,13 +352,15 @@ public class AquaSpinnerUI extends SpinnerUI { spinner = eventToSpinner(e); } - if (spinner == null) return; + if (spinner == null) { + return; + } try { final int calendarField = getCalendarField(spinner); spinner.commitEdit(); if (calendarField != -1) { - ((SpinnerDateModel)spinner.getModel()).setCalendarField(calendarField); + ((SpinnerDateModel) spinner.getModel()).setCalendarField(calendarField); } final Object value = (isNext) ? spinner.getNextValue() : spinner.getPreviousValue(); if (value != null) { @@ -368,37 +380,46 @@ public class AquaSpinnerUI extends SpinnerUI { */ private void select(final JSpinner spinnerComponent) { final JComponent editor = spinnerComponent.getEditor(); - if (!(editor instanceof JSpinner.DateEditor)) return; + if (!(editor instanceof JSpinner.DateEditor)) { + return; + } - final JSpinner.DateEditor dateEditor = (JSpinner.DateEditor)editor; + final JSpinner.DateEditor dateEditor = (JSpinner.DateEditor) editor; final JFormattedTextField ftf = dateEditor.getTextField(); final Format format = dateEditor.getFormat(); Object value; - if (format == null || (value = spinnerComponent.getValue()) == null) return; + if (format == null || (value = spinnerComponent.getValue()) == null) { + return; + } final SpinnerDateModel model = dateEditor.getModel(); final DateFormat.Field field = DateFormat.Field.ofCalendarField(model.getCalendarField()); - if (field == null) return; + if (field == null) { + return; + } try { final AttributedCharacterIterator iterator = format.formatToCharacterIterator(value); if (!select(ftf, iterator, field) && field == DateFormat.Field.HOUR0) { select(ftf, iterator, DateFormat.Field.HOUR1); } - } catch (final IllegalArgumentException iae) {} + } catch (final IllegalArgumentException iae) { + } } /** - * Selects the passed in field, returning true if it is found, - * false otherwise. + * Selects the passed in field, returning true if it is found, false + * otherwise. */ private boolean select(final JFormattedTextField ftf, final AttributedCharacterIterator iterator, final DateFormat.Field field) { final int max = ftf.getDocument().getLength(); iterator.first(); do { - final Map attrs = iterator.getAttributes(); - if (attrs == null || !attrs.containsKey(field)) continue; + final Map attrs = iterator.getAttributes(); + if (attrs == null || !attrs.containsKey(field)) { + continue; + } final int start = iterator.getRunStart(field); final int end = iterator.getRunLimit(field); @@ -412,29 +433,35 @@ public class AquaSpinnerUI extends SpinnerUI { } /** - * Returns the calendarField under the start of the selection, or - * -1 if there is no valid calendar field under the selection (or - * the spinner isn't editing dates. + * Returns the calendarField under the start of the selection, or -1 if + * there is no valid calendar field under the selection (or the spinner + * isn't editing dates. */ private int getCalendarField(final JSpinner spinnerComponent) { final JComponent editor = spinnerComponent.getEditor(); - if (!(editor instanceof JSpinner.DateEditor)) return -1; + if (!(editor instanceof JSpinner.DateEditor)) { + return -1; + } - final JSpinner.DateEditor dateEditor = (JSpinner.DateEditor)editor; + final JSpinner.DateEditor dateEditor = (JSpinner.DateEditor) editor; final JFormattedTextField ftf = dateEditor.getTextField(); final int start = ftf.getSelectionStart(); final JFormattedTextField.AbstractFormatter formatter = ftf.getFormatter(); - if (!(formatter instanceof InternationalFormatter)) return -1; + if (!(formatter instanceof InternationalFormatter)) { + return -1; + } - final Format.Field[] fields = ((InternationalFormatter)formatter).getFields(start); + final Format.Field[] fields = ((InternationalFormatter) formatter).getFields(start); for (final Field element : fields) { - if (!(element instanceof DateFormat.Field)) continue; + if (!(element instanceof DateFormat.Field)) { + continue; + } int calendarField; if (element == DateFormat.Field.HOUR1) { calendarField = Calendar.HOUR; } else { - calendarField = ((DateFormat.Field)element).getCalendarField(); + calendarField = ((DateFormat.Field) element).getCalendarField(); } if (calendarField != -1) { @@ -446,7 +473,9 @@ public class AquaSpinnerUI extends SpinnerUI { @Override public void mousePressed(final MouseEvent e) { - if (!SwingUtilities.isLeftMouseButton(e) || !e.getComponent().isEnabled()) return; + if (!SwingUtilities.isLeftMouseButton(e) || !e.getComponent().isEnabled()) { + return; + } spinner = eventToSpinner(e); autoRepeatTimer.start(); @@ -460,26 +489,35 @@ public class AquaSpinnerUI extends SpinnerUI { } @Override - public void mouseClicked(final MouseEvent e) {} + public void mouseClicked(final MouseEvent e) { + } + @Override - public void mouseEntered(final MouseEvent e) {} + public void mouseEntered(final MouseEvent e) { + } + @Override - public void mouseExited(final MouseEvent e) {} + public void mouseExited(final MouseEvent e) { + } /** - * Requests focus on a child of the spinner if the spinner doesn't - * have focus. + * Requests focus on a child of the spinner if the spinner doesn't have + * focus. */ private void focusSpinnerIfNecessary() { final Component fo = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); - if (!spinner.isRequestFocusEnabled() || (fo != null && (SwingUtilities.isDescendingFrom(fo, spinner)))) return; + if (!spinner.isRequestFocusEnabled() || (fo != null && (SwingUtilities.isDescendingFrom(fo, spinner)))) { + return; + } Container root = spinner; if (!root.isFocusCycleRoot()) { root = root.getFocusCycleRootAncestor(); } - if (root == null) return; + if (root == null) { + return; + } final FocusTraversalPolicy ftp = root.getFocusTraversalPolicy(); final Component child = ftp.getComponentAfter(root, spinner); @@ -491,6 +529,7 @@ public class AquaSpinnerUI extends SpinnerUI { @SuppressWarnings("serial") // Superclass is not serializable across versions class SpinPainter extends JComponent { + final AquaPainter painter = AquaPainter.create(JRSUIStateFactory.getSpinnerArrows()); ButtonModel fTopModel; @@ -551,11 +590,12 @@ public class AquaSpinnerUI extends SpinnerUI { } /** - * A simple layout manager for the editor and the next/previous buttons. - * See the AquaSpinnerUI javadoc for more information about exactly - * how the components are arranged. + * A simple layout manager for the editor and the next/previous buttons. See + * the AquaSpinnerUI javadoc for more information about exactly how the + * components are arranged. */ static class SpinnerLayout implements LayoutManager { + private Component nextButton = null; private Component previousButton = null; private Component editor = null; @@ -656,26 +696,38 @@ public class AquaSpinnerUI extends SpinnerUI { } /** - * Detect JSpinner property changes we're interested in and delegate. Subclasses - * shouldn't need to replace the default propertyChangeListener (although they - * can by overriding createPropertyChangeListener) since all of the interesting - * property changes are delegated to protected methods. + * Detect JSpinner property changes we're interested in and delegate. + * Subclasses shouldn't need to replace the default propertyChangeListener + * (although they can by overriding createPropertyChangeListener) since all + * of the interesting property changes are delegated to protected methods. */ static class PropertyChangeHandler implements PropertyChangeListener { + @Override public void propertyChange(final PropertyChangeEvent e) { final String propertyName = e.getPropertyName(); - final JSpinner spinner = (JSpinner)(e.getSource()); + final JSpinner spinner = (JSpinner) (e.getSource()); final SpinnerUI spinnerUI = spinner.getUI(); if (spinnerUI instanceof AquaSpinnerUI) { - final AquaSpinnerUI ui = (AquaSpinnerUI)spinnerUI; + final AquaSpinnerUI ui = (AquaSpinnerUI) spinnerUI; if ("editor".equals(propertyName)) { - final JComponent oldEditor = (JComponent)e.getOldValue(); - final JComponent newEditor = (JComponent)e.getNewValue(); + final JComponent oldEditor = (JComponent) e.getOldValue(); + final JComponent newEditor = (JComponent) e.getNewValue(); ui.replaceEditor(oldEditor, newEditor); ui.updateEnabledState(); + } else if ("componentOrientation".equals(propertyName)) { + ComponentOrientation o + = (ComponentOrientation) e.getNewValue(); + if (o != e.getOldValue()) { + JComponent editor = spinner.getEditor(); + if (editor != null) { + editor.applyComponentOrientation(o); + } + spinner.revalidate(); + spinner.repaint(); + } } else if ("enabled".equals(propertyName)) { ui.updateEnabledState(); } else if (JComponent.TOOL_TIP_TEXT_KEY.equals(propertyName)) { @@ -683,8 +735,8 @@ public class AquaSpinnerUI extends SpinnerUI { } else if ("font".equals(propertyName)) { JComponent editor = spinner.getEditor(); if (editor instanceof JSpinner.DefaultEditor) { - JTextField tf = - ((JSpinner.DefaultEditor) editor).getTextField(); + JTextField tf + = ((JSpinner.DefaultEditor) editor).getTextField(); if (tf != null) { if (tf.getFont() instanceof UIResource) { tf.setFont(new FontUIResource(spinner.getFont())); @@ -703,12 +755,12 @@ public class AquaSpinnerUI extends SpinnerUI { final Component[] children = spinnerComponent.getComponents(); for (final Component element : children) { if (element instanceof JSpinner.DefaultEditor) { - final JTextField tf = ((JSpinner.DefaultEditor)element).getTextField(); + final JTextField tf = ((JSpinner.DefaultEditor) element).getTextField(); if (tf != null) { tf.setToolTipText(toolTipText); } } else if (element instanceof JComponent) { - ((JComponent)element).setToolTipText(toolTipText); + ((JComponent) element).setToolTipText(toolTipText); } } } diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java index 94d69294407..92df95b6db2 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java @@ -235,9 +235,9 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing } /** - * Invoked by installUI to create + * Invoked by {@code installUI} to create * a layout manager object to manage - * the JTabbedPane. + * the {@code JTabbedPane}. * * @return a layout manager object * @@ -536,7 +536,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing /** * Sets the tab the mouse is over by location. This is a cover method - * for setRolloverTab(tabForCoordinate(x, y, false)). + * for {@code setRolloverTab(tabForCoordinate(x, y, false))}. */ private void setRolloverTab(final int x, final int y) { // NOTE: @@ -547,8 +547,8 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing } /** - * Sets the tab the mouse is currently over to index. - * index will be -1 if the mouse is no longer over any + * Sets the tab the mouse is currently over to {@code index}. + * {@code index} will be -1 if the mouse is no longer over any * tab. No checking is done to ensure the passed in index identifies a * valid tab. * @@ -676,7 +676,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing /** * Returns the amount the baseline is offset by. This is typically - * the same as getTabLabelShiftY. + * the same as {@code getTabLabelShiftY}. * * @return amount to offset the baseline by * @since 1.6 @@ -765,10 +765,10 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing /** * Paints the tabs in the tab area. * Invoked by paint(). - * The graphics parameter must be a valid Graphics + * The graphics parameter must be a valid {@code Graphics} * object. Tab placement may be either: - * JTabbedPane.TOP, JTabbedPane.BOTTOM, - * JTabbedPane.LEFT, or JTabbedPane.RIGHT. + * {@code JTabbedPane.TOP}, {@code JTabbedPane.BOTTOM}, + * {@code JTabbedPane.LEFT}, or {@code JTabbedPane.RIGHT}. * The selected index must be a valid tabbed pane tab index (0 to * tab count - 1, inclusive) or -1 if no tab is currently selected. * The handling of invalid parameters is unspecified. @@ -1406,7 +1406,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing * designated Rectangle object (rather than instantiating and returning * a new Rectangle each time). The tab index parameter must be a valid * tabbed pane tab index (0 to tab count - 1, inclusive). The destination - * rectangle parameter must be a valid Rectangle instance. + * rectangle parameter must be a valid {@code Rectangle} instance. * The handling of invalid parameters is unspecified. * * @param tabIndex the index of the tab @@ -3717,7 +3717,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing /** * An ActionMap that populates its contents as necessary. The - * contents are populated by invoking the loadActionMap + * contents are populated by invoking the {@code loadActionMap} * method on the passed in Object. * * @version 1.6, 11/17/05 @@ -3726,14 +3726,14 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing @SuppressWarnings("serial") // Superclass is not serializable across versions static class LazyActionMap extends ActionMapUIResource { /** - * Object to invoke loadActionMap on. This may be + * Object to invoke {@code loadActionMap} on. This may be * a Class object. */ private transient Object _loader; /** * Installs an ActionMap that will be populated by invoking the - * loadActionMap method on the specified Class + * {@code loadActionMap} method on the specified Class * when necessary. *

* This should be used if the ActionMap can be shared. @@ -3755,7 +3755,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing /** * Returns an ActionMap that will be populated by invoking the - * loadActionMap method on the specified Class + * {@code loadActionMap} method on the specified Class * when necessary. *

* This should be used if the ActionMap can be shared. diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTreeUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTreeUI.java index 1b73f2a987a..2de5975051a 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTreeUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTreeUI.java @@ -179,8 +179,8 @@ public class AquaTreeUI extends BasicTreeUI { } /** - * Paints the expand (toggle) part of a row. The receiver should NOT modify clipBounds, or - * insets. + * Paints the expand (toggle) part of a row. The receiver should NOT modify {@code clipBounds}, or + * {@code insets}. */ protected void paintExpandControl(final Graphics g, final Rectangle clipBounds, final Insets insets, final Rectangle bounds, final TreePath path, final int row, final boolean isExpanded, final boolean hasBeenExpanded, final boolean isLeaf) { final Object value = path.getLastPathComponent(); diff --git a/jdk/src/java.desktop/macosx/classes/sun/font/NativeFont.java b/jdk/src/java.desktop/macosx/classes/sun/font/NativeFont.java index 0eb6db7e6e0..d3203da3980 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/font/NativeFont.java +++ b/jdk/src/java.desktop/macosx/classes/sun/font/NativeFont.java @@ -41,7 +41,7 @@ public class NativeFont extends PhysicalFont { /** * Verifies native font is accessible. - * @throws FontFormatException - if the font can't be located. + * @throws FontFormatException if the font can't be located. */ public NativeFont(String platName, boolean isBitmapDelegate) throws FontFormatException { diff --git a/jdk/src/java.desktop/macosx/classes/sun/java2d/DataBufferNIOInt.java b/jdk/src/java.desktop/macosx/classes/sun/java2d/DataBufferNIOInt.java index 08f5ef206e9..8447ba159d1 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/java2d/DataBufferNIOInt.java +++ b/jdk/src/java.desktop/macosx/classes/sun/java2d/DataBufferNIOInt.java @@ -37,10 +37,10 @@ public final class DataBufferNIOInt extends DataBuffer { IntBuffer bankdata[]; /** - * Constructs an integer-based DataBuffer with a single bank + * Constructs an integer-based {@code DataBuffer} with a single bank * and the specified size. * - * @param size The size of the DataBuffer. + * @param size The size of the {@code DataBuffer}. */ public DataBufferNIOInt(int size) { super(TYPE_INT,size); @@ -51,7 +51,7 @@ public final class DataBufferNIOInt extends DataBuffer { } /** - * Returns the default (first) IntBuffer in DataBuffer. + * Returns the default (first) IntBuffer in {@code DataBuffer}. * * @return The first IntBuffer. */ @@ -70,7 +70,7 @@ public final class DataBufferNIOInt extends DataBuffer { } /** - * Returns the default (first) int data array in DataBuffer. + * Returns the default (first) int data array in {@code DataBuffer}. * * @return The first integer data array. */ @@ -137,7 +137,7 @@ public final class DataBufferNIOInt extends DataBuffer { /** * Sets the requested data array element in the specified bank - * to the integer value i. + * to the integer value {@code i}. * @param bank The bank in which you want to set the data array element. * @param i The data array element you want to set. * @param val The integer value to which you want to set the specified data array element. diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDesktopPeer.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDesktopPeer.java index 39e5afe9f81..1bc37a7aa46 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDesktopPeer.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDesktopPeer.java @@ -33,7 +33,7 @@ import java.net.URI; /** - * Concrete implementation of the interface DesktopPeer for MacOS X + * Concrete implementation of the interface {@code DesktopPeer} for MacOS X * * @see DesktopPeer */ diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java index a1606d2f959..276e0f9260a 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java @@ -101,7 +101,7 @@ public class CInputMethod extends InputMethodAdapter { * method. * * @param context the input method context for this input method - * @exception NullPointerException if context is null + * @exception NullPointerException if {@code context} is null */ public void setInputMethodContext(InputMethodContext context) { fIMContext = context; @@ -124,7 +124,7 @@ public class CInputMethod extends InputMethodAdapter { * * @param lang locale to input * @return whether the specified locale is supported - * @exception NullPointerException if locale is null + * @exception NullPointerException if {@code locale} is null */ public boolean setLocale(Locale lang) { return setLocale(lang, false); @@ -205,7 +205,7 @@ public class CInputMethod extends InputMethodAdapter { * are dispatched to the current input method for this component before * they are dispatched to the component's methods or event listeners. * The input method decides whether it needs to handle the event. If it - * does, it also calls the event's consume method; this + * does, it also calls the event's {@code consume} method; this * causes the event to not get dispatched to the component's event * processing methods or event listeners. *

@@ -216,7 +216,7 @@ public class CInputMethod extends InputMethodAdapter { * This method is called by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}. * * @param event the event being dispatched to the input method - * @exception NullPointerException if event is null + * @exception NullPointerException if {@code event} is null */ public void dispatchEvent(final AWTEvent event) { // No-op for Mac OS X. diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java index 5457b1f291a..8d8c00b6a19 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java @@ -75,8 +75,7 @@ final class CPlatformResponder { jclickCount = clickCount; } - int jmodifiers = NSEvent.nsToJavaMouseModifiers(buttonNumber, - modifierFlags); + int jmodifiers = NSEvent.nsToJavaModifiers(modifierFlags); boolean jpopupTrigger = NSEvent.isPopupTrigger(jmodifiers); eventNotifier.notifyMouseEvent(jeventType, System.currentTimeMillis(), jbuttonNumber, @@ -90,9 +89,7 @@ final class CPlatformResponder { void handleScrollEvent(final int x, final int y, final int absX, final int absY, final int modifierFlags, final double deltaX, final double deltaY) { - final int buttonNumber = CocoaConstants.kCGMouseButtonCenter; - int jmodifiers = NSEvent.nsToJavaMouseModifiers(buttonNumber, - modifierFlags); + int jmodifiers = NSEvent.nsToJavaModifiers(modifierFlags); final boolean isShift = (jmodifiers & InputEvent.SHIFT_DOWN_MASK) != 0; // Vertical scroll. @@ -187,8 +184,7 @@ final class CPlatformResponder { postsTyped = false; } - - int jmodifiers = NSEvent.nsToJavaKeyModifiers(modifierFlags); + int jmodifiers = NSEvent.nsToJavaModifiers(modifierFlags); long when = System.currentTimeMillis(); if (jeventType == KeyEvent.KEY_PRESSED) { diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterDevice.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterDevice.java index c47b213b3a7..7450508cdfb 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterDevice.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterDevice.java @@ -35,8 +35,8 @@ public class CPrinterDevice extends GraphicsDevice { } /** - * Returns the type of this GraphicsDevice. - * @return the type of this GraphicsDevice, which can + * Returns the type of this {@code GraphicsDevice}. + * @return the type of this {@code GraphicsDevice}, which can * either be TYPE_RASTER_SCREEN, TYPE_PRINTER or TYPE_IMAGE_BUFFER. * @see #TYPE_RASTER_SCREEN * @see #TYPE_PRINTER @@ -48,30 +48,30 @@ public class CPrinterDevice extends GraphicsDevice { /** * Returns the identification string associated with this - * GraphicsDevice. - * @return a String that is the identification - * of this GraphicsDevice. + * {@code GraphicsDevice}. + * @return a {@code String} that is the identification + * of this {@code GraphicsDevice}. */ public String getIDstring() { return ("Printer"); } /** - * Returns all of the GraphicsConfiguration - * objects associated with this GraphicsDevice. - * @return an array of GraphicsConfiguration + * Returns all of the {@code GraphicsConfiguration} + * objects associated with this {@code GraphicsDevice}. + * @return an array of {@code GraphicsConfiguration} * objects that are associated with this - * GraphicsDevice. + * {@code GraphicsDevice}. */ public GraphicsConfiguration[] getConfigurations() { return new GraphicsConfiguration[] { gc }; } /** - * Returns the default GraphicsConfiguration - * associated with this GraphicsDevice. - * @return the default GraphicsConfiguration - * of this GraphicsDevice. + * Returns the default {@code GraphicsConfiguration} + * associated with this {@code GraphicsDevice}. + * @return the default {@code GraphicsConfiguration} + * of this {@code GraphicsDevice}. */ public GraphicsConfiguration getDefaultConfiguration() { return gc; diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterGraphicsConfig.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterGraphicsConfig.java index 89363a5b907..64f564abc1c 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterGraphicsConfig.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterGraphicsConfig.java @@ -49,9 +49,9 @@ public class CPrinterGraphicsConfig extends GraphicsConfiguration { /** * Returns the {@link GraphicsDevice} associated with this - * GraphicsConfiguration. - * @return a GraphicsDevice object that is - * associated with this GraphicsConfiguration. + * {@code GraphicsConfiguration}. + * @return a {@code GraphicsDevice} object that is + * associated with this {@code GraphicsConfiguration}. */ public GraphicsDevice getDevice() { return gd; @@ -59,16 +59,16 @@ public class CPrinterGraphicsConfig extends GraphicsConfiguration { /** * Returns a {@link BufferedImage} with a data layout and color model - * compatible with this GraphicsConfiguration. This + * compatible with this {@code GraphicsConfiguration}. This * method has nothing to do with memory-mapping - * a device. The returned BufferedImage has + * a device. The returned {@code BufferedImage} has * a layout and color model that is closest to this native device * configuration and can therefore be optimally blitted to this * device. - * @param width the width of the returned BufferedImage - * @param height the height of the returned BufferedImage - * @return a BufferedImage whose data layout and color - * model is compatible with this GraphicsConfiguration. + * @param width the width of the returned {@code BufferedImage} + * @param height the height of the returned {@code BufferedImage} + * @return a {@code BufferedImage} whose data layout and color + * model is compatible with this {@code GraphicsConfiguration}. */ public BufferedImage createCompatibleImage(int width, int height) { return createCompatibleImage(width, height, Transparency.OPAQUE); @@ -76,15 +76,15 @@ public class CPrinterGraphicsConfig extends GraphicsConfiguration { /** * Returns a {@link VolatileImage} with a data layout and color model - * compatible with this GraphicsConfiguration. - * The returned VolatileImage + * compatible with this {@code GraphicsConfiguration}. + * The returned {@code VolatileImage} * may have data that is stored optimally for the underlying graphics * device and may therefore benefit from platform-specific rendering * acceleration. - * @param width the width of the returned VolatileImage - * @param height the height of the returned VolatileImage - * @return a VolatileImage whose data layout and color - * model is compatible with this GraphicsConfiguration. + * @param width the width of the returned {@code VolatileImage} + * @param height the height of the returned {@code VolatileImage} + * @return a {@code VolatileImage} whose data layout and color + * model is compatible with this {@code GraphicsConfiguration}. * @see Component#createVolatileImage(int, int) */ public VolatileImage createCompatibleVolatileImage(int width, int height) { @@ -97,18 +97,18 @@ public class CPrinterGraphicsConfig extends GraphicsConfiguration { } /** - * Returns a BufferedImage that supports the specified + * Returns a {@code BufferedImage} that supports the specified * transparency and has a data layout and color model - * compatible with this GraphicsConfiguration. This + * compatible with this {@code GraphicsConfiguration}. This * method has nothing to do with memory-mapping - * a device. The returned BufferedImage has a layout and + * a device. The returned {@code BufferedImage} has a layout and * color model that can be optimally blitted to a device - * with this GraphicsConfiguration. - * @param width the width of the returned BufferedImage - * @param height the height of the returned BufferedImage + * with this {@code GraphicsConfiguration}. + * @param width the width of the returned {@code BufferedImage} + * @param height the height of the returned {@code BufferedImage} * @param transparency the specified transparency mode - * @return a BufferedImage whose data layout and color - * model is compatible with this GraphicsConfiguration + * @return a {@code BufferedImage} whose data layout and color + * model is compatible with this {@code GraphicsConfiguration} * and also supports the specified transparency. * @see Transparency#OPAQUE * @see Transparency#BITMASK @@ -121,21 +121,21 @@ public class CPrinterGraphicsConfig extends GraphicsConfiguration { /** * Returns the {@link ColorModel} associated with this - * GraphicsConfiguration. - * @return a ColorModel object that is associated with - * this GraphicsConfiguration. + * {@code GraphicsConfiguration}. + * @return a {@code ColorModel} object that is associated with + * this {@code GraphicsConfiguration}. */ public ColorModel getColorModel() { return getColorModel(Transparency.OPAQUE); } /** - * Returns the ColorModel associated with this - * GraphicsConfiguration that supports the specified + * Returns the {@code ColorModel} associated with this + * {@code GraphicsConfiguration} that supports the specified * transparency. * @param transparency the specified transparency mode - * @return a ColorModel object that is associated with - * this GraphicsConfiguration and supports the + * @return a {@code ColorModel} object that is associated with + * this {@code GraphicsConfiguration} and supports the * specified transparency. */ public ColorModel getColorModel(int transparency) { @@ -144,22 +144,22 @@ public class CPrinterGraphicsConfig extends GraphicsConfiguration { /** * Returns the default {@link AffineTransform} for this - * GraphicsConfiguration. This - * AffineTransform is typically the Identity transform - * for most normal screens. The default AffineTransform + * {@code GraphicsConfiguration}. This + * {@code AffineTransform} is typically the Identity transform + * for most normal screens. The default {@code AffineTransform} * maps coordinates onto the device such that 72 user space * coordinate units measure approximately 1 inch in device * space. The normalizing transform can be used to make * this mapping more exact. Coordinates in the coordinate space - * defined by the default AffineTransform for screen and + * defined by the default {@code AffineTransform} for screen and * printer devices have the origin in the upper left-hand corner of * the target region of the device, with X coordinates * increasing to the right and Y coordinates increasing downwards. * For image buffers not associated with a device, such as those not - * created by createCompatibleImage, - * this AffineTransform is the Identity transform. - * @return the default AffineTransform for this - * GraphicsConfiguration. + * created by {@code createCompatibleImage}, + * this {@code AffineTransform} is the Identity transform. + * @return the default {@code AffineTransform} for this + * {@code GraphicsConfiguration}. */ public AffineTransform getDefaultTransform() { return new AffineTransform(); @@ -167,9 +167,9 @@ public class CPrinterGraphicsConfig extends GraphicsConfiguration { /** * - * Returns a AffineTransform that can be concatenated - * with the default AffineTransform - * of a GraphicsConfiguration so that 72 units in user + * Returns a {@code AffineTransform} that can be concatenated + * with the default {@code AffineTransform} + * of a {@code GraphicsConfiguration} so that 72 units in user * space equals 1 inch in device space. *

* For a particular {@link Graphics2D}, g, one @@ -181,16 +181,16 @@ public class CPrinterGraphicsConfig extends GraphicsConfiguration { * g.setTransform(gc.getDefaultTransform()); * g.transform(gc.getNormalizingTransform()); * - * Note that sometimes this AffineTransform is identity, + * Note that sometimes this {@code AffineTransform} is identity, * such as for printers or metafile output, and that this - * AffineTransform is only as accurate as the information + * {@code AffineTransform} is only as accurate as the information * supplied by the underlying system. For image buffers not * associated with a device, such as those not created by - * createCompatibleImage, this - * AffineTransform is the Identity transform + * {@code createCompatibleImage}, this + * {@code AffineTransform} is the Identity transform * since there is no valid distance measurement. - * @return an AffineTransform to concatenate to the - * default AffineTransform so that 72 units in user + * @return an {@code AffineTransform} to concatenate to the + * default {@code AffineTransform} so that 72 units in user * space is mapped to 1 inch in device space. */ public AffineTransform getNormalizingTransform() { @@ -198,12 +198,12 @@ public class CPrinterGraphicsConfig extends GraphicsConfiguration { } /** - * Returns the bounds of the GraphicsConfiguration + * Returns the bounds of the {@code GraphicsConfiguration} * in the device coordinates. In a multi-screen environment * with a virtual device, the bounds can have negative X * or Y origins. * @return the bounds of the area covered by this - * GraphicsConfiguration. + * {@code GraphicsConfiguration}. * @since 1.3 */ public Rectangle getBounds() { diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java index c28e83bfbf2..491b257765f 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java @@ -83,13 +83,13 @@ public final class CPrinterJob extends RasterPrinterJob { * to these native print services. * To present the cross platform print dialog for all services, * including native ones instead use - * printDialog(PrintRequestAttributeSet). + * {@code printDialog(PrintRequestAttributeSet)}. *

* PrinterJob implementations which can use PrintService's will update * the PrintService for this PrinterJob to reflect the new service * selected by the user. - * @return true if the user does not cancel the dialog; - * false otherwise. + * @return {@code true} if the user does not cancel the dialog; + * {@code false} otherwise. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. * @see java.awt.GraphicsEnvironment#isHeadless @@ -117,19 +117,19 @@ public final class CPrinterJob extends RasterPrinterJob { /** * Displays a dialog that allows modification of a - * PageFormat instance. - * The page argument is used to initialize controls + * {@code PageFormat} instance. + * The {@code page} argument is used to initialize controls * in the page setup dialog. * If the user cancels the dialog then this method returns the - * original page object unmodified. + * original {@code page} object unmodified. * If the user okays the dialog then this method returns a new - * PageFormat object with the indicated changes. - * In either case, the original page object is + * {@code PageFormat} object with the indicated changes. + * In either case, the original {@code page} object is * not modified. - * @param page the default PageFormat presented to the + * @param page the default {@code PageFormat} presented to the * user for modification - * @return the original page object if the dialog - * is cancelled; a new PageFormat object + * @return the original {@code page} object if the dialog + * is cancelled; a new {@code PageFormat} object * containing the format indicated by the user if the * dialog is acknowledged. * @exception HeadlessException if GraphicsEnvironment.isHeadless() @@ -157,11 +157,11 @@ public final class CPrinterJob extends RasterPrinterJob { } /** - * Clones the PageFormat argument and alters the + * Clones the {@code PageFormat} argument and alters the * clone to describe a default page size and orientation. - * @param page the PageFormat to be cloned and altered - * @return clone of page, altered to describe a default - * PageFormat. + * @param page the {@code PageFormat} to be cloned and altered + * @return clone of {@code page}, altered to describe a default + * {@code PageFormat}. */ @Override public PageFormat defaultPage(PageFormat page) { diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java index e8bdb1fe6c8..940858e1d4f 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java @@ -73,7 +73,7 @@ class CRobot implements RobotPeer { * Presses one or more mouse buttons. * * @param buttons the button mask (combination of - * InputEvent.BUTTON1/2/3_MASK) + * {@code InputEvent.BUTTON1/2/3_MASK}) */ @Override public void mousePress(int buttons) { @@ -87,7 +87,7 @@ class CRobot implements RobotPeer { * Releases one or more mouse buttons. * * @param buttons the button mask (combination of - * InputEvent.BUTTON1/2/3_MASK) + * {@code InputEvent.BUTTON1/2/3_MASK}) */ @Override public void mouseRelease(int buttons) { @@ -133,14 +133,14 @@ class CRobot implements RobotPeer { * Presses a given key. *

* Key codes that have more than one physical key associated with them - * (e.g. KeyEvent.VK_SHIFT could mean either the + * (e.g. {@code KeyEvent.VK_SHIFT} could mean either the * left or right shift key) will map to the left key. *

* Assumes that the * peer implementations will throw an exception for other bogus * values e.g. -1, 999999 * - * @param keycode the key to press (e.g. KeyEvent.VK_A) + * @param keycode the key to press (e.g. {@code KeyEvent.VK_A}) */ @Override public void keyPress(final int keycode) { @@ -151,14 +151,14 @@ class CRobot implements RobotPeer { * Releases a given key. *

* Key codes that have more than one physical key associated with them - * (e.g. KeyEvent.VK_SHIFT could mean either the + * (e.g. {@code KeyEvent.VK_SHIFT} could mean either the * left or right shift key) will map to the left key. *

* Assumes that the * peer implementations will throw an exception for other bogus * values e.g. -1, 999999 * - * @param keycode the key to release (e.g. KeyEvent.VK_A) + * @param keycode the key to release (e.g. {@code KeyEvent.VK_A}) */ @Override public void keyRelease(final int keycode) { diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java index 0e0d0a475e0..2d82a2eb1c1 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java @@ -214,7 +214,7 @@ public class CTrayIcon extends CFRetainedResource implements TrayIconPeer { jclickCount = nsEvent.getClickCount(); } - int jmodifiers = NSEvent.nsToJavaMouseModifiers(buttonNumber, + int jmodifiers = NSEvent.nsToJavaModifiers( nsEvent.getModifierFlags()); boolean isPopupTrigger = NSEvent.isPopupTrigger(jmodifiers); diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java index 8f9e1459103..cc3d345eb9f 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java @@ -515,13 +515,13 @@ public final class LWCToolkit extends LWToolkit { * key for menu shortcuts. *

* Menu shortcuts, which are embodied in the - * MenuShortcut class, are handled by the - * MenuBar class. + * {@code MenuShortcut} class, are handled by the + * {@code MenuBar} class. *

- * By default, this method returns Event.CTRL_MASK. + * By default, this method returns {@code Event.CTRL_MASK}. * Toolkit implementations should override this method if the * Control key isn't the correct key for accelerators. - * @return the modifier mask on the Event class + * @return the modifier mask on the {@code Event} class * that is used for menu shortcuts on this toolkit. * @see java.awt.MenuBar * @see java.awt.MenuShortcut diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/NSEvent.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/NSEvent.java index d30a39cdfb9..290e52965a3 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/NSEvent.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/NSEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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 @@ -231,16 +231,14 @@ final class NSEvent { return jeventType; } - /* - * Converts NSEvent mouse modifiers to AWT mouse modifiers. + /** + * Converts NSEvent key modifiers to AWT key modifiers. Note that this + * method adds the current mouse state as a mouse modifiers. + * + * @param modifierFlags the NSEvent key modifiers + * @return the java key and mouse modifiers */ - static native int nsToJavaMouseModifiers(int buttonNumber, - int modifierFlags); - - /* - * Converts NSEvent key modifiers to AWT key modifiers. - */ - static native int nsToJavaKeyModifiers(int modifierFlags); + static native int nsToJavaModifiers(int modifierFlags); /* * Converts NSEvent key info to AWT key info. diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m index 51bacfcd5e4..07bb7fab938 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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 @@ -579,7 +579,7 @@ NSUInteger JavaModifiersToNsKeyModifiers(jint javaModifiers, BOOL isExtMods) } -jint GetJavaMouseModifiers(NSInteger button, NSUInteger modifierFlags) +jint GetJavaMouseModifiers(NSUInteger modifierFlags) { // Mousing needs the key modifiers jint modifiers = NsKeyModifiersToJavaModifiers(modifierFlags, YES); @@ -632,38 +632,18 @@ Java_java_awt_AWTEvent_nativeSetSource /* * Class: sun_lwawt_macosx_NSEvent - * Method: nsToJavaMouseModifiers + * Method: nsToJavaModifiers * Signature: (II)I */ JNIEXPORT jint JNICALL -Java_sun_lwawt_macosx_NSEvent_nsToJavaMouseModifiers -(JNIEnv *env, jclass cls, jint buttonNumber, jint modifierFlags) -{ - jint jmodifiers = 0; - -JNF_COCOA_ENTER(env); - - jmodifiers = GetJavaMouseModifiers(buttonNumber, modifierFlags); - -JNF_COCOA_EXIT(env); - - return jmodifiers; -} - -/* - * Class: sun_lwawt_macosx_NSEvent - * Method: nsToJavaKeyModifiers - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_sun_lwawt_macosx_NSEvent_nsToJavaKeyModifiers +Java_sun_lwawt_macosx_NSEvent_nsToJavaModifiers (JNIEnv *env, jclass cls, jint modifierFlags) { jint jmodifiers = 0; JNF_COCOA_ENTER(env); - jmodifiers = NsKeyModifiersToJavaModifiers(modifierFlags, YES); + jmodifiers = GetJavaMouseModifiers(modifierFlags); JNF_COCOA_EXIT(env); diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m index 994bda41982..79cdf5bf7a3 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m @@ -562,6 +562,17 @@ CGGI_CreateImageForGlyph (CGGI_GlyphCanvas *canvas, const CGGlyph glyph, GlyphInfo *info, const CGGI_RenderingMode *mode) { + if (isnan(info->topLeftX) || isnan(info->topLeftY)) { + // Explicitly set glyphInfo width/height to be 0 to ensure + // zero length glyph image is copied into GlyphInfo from canvas + info->width = 0; + info->height = 0; + + // copy the "empty" glyph from the canvas into the info + (*mode->glyphDescriptor->copyFxnPtr)(canvas, info); + return; + } + // clean the canvas CGGI_ClearCanvas(canvas, info); @@ -570,7 +581,6 @@ CGGI_CreateImageForGlyph -info->topLeftX, canvas->image->height + info->topLeftY, &glyph, 1); - // copy the glyph from the canvas into the info (*mode->glyphDescriptor->copyFxnPtr)(canvas, info); } diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphOutlines.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphOutlines.m index 29a579f66b4..4fde4a3825d 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphOutlines.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphOutlines.m @@ -259,6 +259,10 @@ AWTGetGlyphOutline(CGGlyph *glyphs, NSFont *font, OSStatus status = noErr; + if ( isnan(tx->a) || isnan(tx->b) || isnan(tx->c) || + isnan(tx->d) || isnan(tx->tx) || isnan(tx->ty)) { + return status; + } glyphs = glyphs + inStartIndex; // advanceArray = advanceArray + inStartIndex; // TODO(cpc): use advance diff --git a/jdk/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileReader b/jdk/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileReader index 624dac1c026..f0536e70d0e 100644 --- a/jdk/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileReader +++ b/jdk/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileReader @@ -3,4 +3,5 @@ com.sun.media.sound.AuFileReader com.sun.media.sound.AiffFileReader com.sun.media.sound.WaveFileReader com.sun.media.sound.WaveFloatFileReader +com.sun.media.sound.WaveExtensibleFileReader com.sun.media.sound.SoftMidiAudioFileReader diff --git a/jdk/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileWriter b/jdk/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileWriter index bd84a769a36..83ac2b98105 100644 --- a/jdk/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileWriter +++ b/jdk/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileWriter @@ -2,3 +2,4 @@ com.sun.media.sound.AuFileWriter com.sun.media.sound.AiffFileWriter com.sun.media.sound.WaveFileWriter +com.sun.media.sound.WaveFloatFileWriter diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java index 27a935d715a..5809fff5f25 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java @@ -74,7 +74,7 @@ import com.sun.imageio.plugins.common.I18N; /** This class is the Java Image IO plugin reader for BMP images. * It may subsample the image, clip the image, select sub-bands, * and shift the decoded image origin if the proper decoding parameter - * are set in the provided ImageReadParam. + * are set in the provided {@code ImageReadParam}. * * This class supports Microsoft Windows Bitmap Version 3-5, * as well as OS/2 Bitmap Version 2.x (for single-image BMP file). @@ -159,8 +159,8 @@ public class BMPImageReader extends ImageReader implements BMPConstants { /** source and destination bands. */ private int[] sourceBands, destBands; - /** Constructs BMPImageReader from the provided - * ImageReaderSpi. + /** Constructs {@code BMPImageReader} from the provided + * {@code ImageReaderSpi}. */ public BMPImageReader(ImageReaderSpi originator) { super(originator); @@ -1681,8 +1681,8 @@ public class BMPImageReader extends ImageReader implements BMPConstants { /** Decodes the jpeg/png image embedded in the bitmap using any jpeg * ImageIO-style plugin. * - * @param bi The destination BufferedImage. - * @param bmpParam The ImageReadParam for decoding this + * @param bi The destination {@code BufferedImage}. + * @param bmpParam The {@code ImageReadParam} for decoding this * BMP image. The parameters for subregion, band selection and * subsampling are used in decoding the jpeg image. */ diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java index fd90e2edbb7..164aa9769ae 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java @@ -69,7 +69,7 @@ import com.sun.imageio.plugins.common.I18N; * a BMP format. * * The encoding process may clip, subsample using the parameters - * specified in the ImageWriteParam. + * specified in the {@code ImageWriteParam}. * * @see javax.imageio.plugins.bmp.BMPImageWriteParam */ @@ -88,8 +88,8 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { private short[] spixels; private int[] ipixels; - /** Constructs BMPImageWriter based on the provided - * ImageWriterSpi. + /** Constructs {@code BMPImageWriter} based on the provided + * {@code ImageWriterSpi}. */ public BMPImageWriter(ImageWriterSpi originator) { super(originator); diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/BogusColorSpace.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/BogusColorSpace.java index 81924044610..b6f73efc712 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/BogusColorSpace.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/BogusColorSpace.java @@ -28,7 +28,7 @@ package com.sun.imageio.plugins.common; import java.awt.color.ColorSpace; /** - * A dummy ColorSpace to enable ColorModel + * A dummy {@code ColorSpace} to enable {@code ColorModel} * for image data which do not have an innate color representation. */ @SuppressWarnings("serial") // JDK-implementation class @@ -37,8 +37,8 @@ public class BogusColorSpace extends ColorSpace { * Return the type given the number of components. * * @param numComponents The number of components in the - * ColorSpace. - * @exception IllegalArgumentException if numComponents + * {@code ColorSpace}. + * @exception IllegalArgumentException if {@code numComponents} * is less than 1. */ private static int getType(int numComponents) { @@ -62,11 +62,11 @@ public class BogusColorSpace extends ColorSpace { } /** - * Constructs a bogus ColorSpace. + * Constructs a bogus {@code ColorSpace}. * * @param numComponents The number of components in the - * ColorSpace. - * @exception IllegalArgumentException if numComponents + * {@code ColorSpace}. + * @exception IllegalArgumentException if {@code numComponents} * is less than 1. */ public BogusColorSpace(int numComponents) { diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/I18NImpl.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/I18NImpl.java index 4c6d36ac695..c2885cf5a8e 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/I18NImpl.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/I18NImpl.java @@ -37,9 +37,9 @@ import java.net.URL; * the file from the jar as the package name is included automatically. * *

Extenders need only provide a static method - * getString(String) which calls the static method in this + * {@code getString(String)} which calls the static method in this * class with the name of the invoking class and returns a - * String. + * {@code String}. */ public class I18NImpl { /** diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ImageUtil.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ImageUtil.java index ddaad6e78d6..b7fa186896b 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ImageUtil.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ImageUtil.java @@ -58,35 +58,35 @@ import javax.imageio.spi.ImageWriterSpi; public class ImageUtil { /** - * Creates a ColorModel that may be used with the - * specified SampleModel. If a suitable - * ColorModel cannot be found, this method returns - * null. + * Creates a {@code ColorModel} that may be used with the + * specified {@code SampleModel}. If a suitable + * {@code ColorModel} cannot be found, this method returns + * {@code null}. * - *

Suitable ColorModels are guaranteed to exist - * for all instances of ComponentSampleModel. - * For 1- and 3- banded SampleModels, the returned - * ColorModel will be opaque. For 2- and 4-banded - * SampleModels, the output will use alpha transparency + *

Suitable {@code ColorModel}s are guaranteed to exist + * for all instances of {@code ComponentSampleModel}. + * For 1- and 3- banded {@code SampleModel}s, the returned + * {@code ColorModel} will be opaque. For 2- and 4-banded + * {@code SampleModel}s, the output will use alpha transparency * which is not premultiplied. 1- and 2-banded data will use a - * grayscale ColorSpace, and 3- and 4-banded data a sRGB - * ColorSpace. Data with 5 or more bands will have a - * BogusColorSpace.

+ * grayscale {@code ColorSpace}, and 3- and 4-banded data a sRGB + * {@code ColorSpace}. Data with 5 or more bands will have a + * {@code BogusColorSpace}.

* - *

An instance of DirectColorModel will be created for - * instances of SinglePixelPackedSampleModel with no more + *

An instance of {@code DirectColorModel} will be created for + * instances of {@code SinglePixelPackedSampleModel} with no more * than 4 bands.

* - *

An instance of IndexColorModel will be created for - * instances of MultiPixelPackedSampleModel. The colormap - * will be a grayscale ramp with 1 << numberOfBits + *

An instance of {@code IndexColorModel} will be created for + * instances of {@code MultiPixelPackedSampleModel}. The colormap + * will be a grayscale ramp with 1 << numberOfBits * entries ranging from zero to at most 255.

* - * @return An instance of ColorModel that is suitable for - * the supplied SampleModel, or null. + * @return An instance of {@code ColorModel} that is suitable for + * the supplied {@code SampleModel}, or {@code null}. * - * @throws IllegalArgumentException If sampleModel is - * null. + * @throws IllegalArgumentException If {@code sampleModel} is + * {@code null}. */ public static final ColorModel createColorModel(SampleModel sampleModel) { // Check the parameter. @@ -194,19 +194,19 @@ public class ImageUtil { } /** - * For the case of binary data (isBinary() returns - * true), return the binary data as a packed byte array. + * For the case of binary data ({@code isBinary()} returns + * {@code true}), return the binary data as a packed byte array. * The data will be packed as eight bits per byte with no bit offset, * i.e., the first bit in each image line will be the left-most of the * first byte of the line. The line stride in bytes will be - * (int)((getWidth()+7)/8). The length of the returned - * array will be the line stride multiplied by getHeight() + * {@code (int)((getWidth()+7)/8)}. The length of the returned + * array will be the line stride multiplied by {@code getHeight()} * * @return the binary data as a packed array of bytes with zero offset - * of null if the data are not binary. - * @throws IllegalArgumentException if isBinary() returns - * false with the SampleModel of the - * supplied Raster as argument. + * of {@code null} if the data are not binary. + * @throws IllegalArgumentException if {@code isBinary()} returns + * {@code false} with the {@code SampleModel} of the + * supplied {@code Raster} as argument. */ public static byte[] getPackedBinaryData(Raster raster, Rectangle rect) { @@ -387,11 +387,11 @@ public class ImageUtil { /** * Returns the binary data unpacked into an array of bytes. - * The line stride will be the width of the Raster. + * The line stride will be the width of the {@code Raster}. * - * @throws IllegalArgumentException if isBinary() returns - * false with the SampleModel of the - * supplied Raster as argument. + * @throws IllegalArgumentException if {@code isBinary()} returns + * {@code false} with the {@code SampleModel} of the + * supplied {@code Raster} as argument. */ public static byte[] getUnpackedBinaryData(Raster raster, Rectangle rect) { @@ -467,13 +467,13 @@ public class ImageUtil { } /** - * Sets the supplied Raster's data from an array + * Sets the supplied {@code Raster}'s data from an array * of packed binary data of the form returned by - * getPackedBinaryData(). + * {@code getPackedBinaryData()}. * - * @throws IllegalArgumentException if isBinary() returns - * false with the SampleModel of the - * supplied Raster as argument. + * @throws IllegalArgumentException if {@code isBinary()} returns + * {@code false} with the {@code SampleModel} of the + * supplied {@code Raster} as argument. */ public static void setPackedBinaryData(byte[] binaryDataArray, WritableRaster raster, @@ -713,16 +713,16 @@ public class ImageUtil { } /** - * Copies data into the packed array of the Raster + * Copies data into the packed array of the {@code Raster} * from an array of unpacked data of the form returned by - * getUnpackedBinaryData(). + * {@code getUnpackedBinaryData()}. * *

If the data are binary, then the target bit will be set if * and only if the corresponding byte is non-zero. * - * @throws IllegalArgumentException if isBinary() returns - * false with the SampleModel of the - * supplied Raster as argument. + * @throws IllegalArgumentException if {@code isBinary()} returns + * {@code false} with the {@code SampleModel} of the + * supplied {@code Raster} as argument. */ public static void setUnpackedBinaryData(byte[] bdata, WritableRaster raster, @@ -983,7 +983,7 @@ public class ImageUtil { * @param g The green channel color indices. * @param b The blue channel color indices. * @return If all the indices have 256 entries, and are identical mappings, - * return true; otherwise, return false. + * return {@code true}; otherwise, return {@code false}. */ public static boolean isIndicesForGrayscale(byte[] r, byte[] g, byte[] b) { if (r.length != g.length || r.length != b.length) @@ -1004,7 +1004,7 @@ public class ImageUtil { return true; } - /** Converts the provided object to String */ + /** Converts the provided object to {@code String} */ public static String convertObjectToString(Object obj) { if (obj == null) return ""; @@ -1035,10 +1035,10 @@ public class ImageUtil { } - /** Checks that the provided ImageWriter can encode - * the provided ImageTypeSpecifier or not. If not, an - * IIOException will be thrown. - * @param writer The provided ImageWriter. + /** Checks that the provided {@code ImageWriter} can encode + * the provided {@code ImageTypeSpecifier} or not. If not, an + * {@code IIOException} will be thrown. + * @param writer The provided {@code ImageWriter}. * @param type The image to be tested. * @throws IIOException If the writer cannot encoded the provided image. */ @@ -1053,12 +1053,12 @@ public class ImageUtil { } } - /** Checks that the provided ImageWriter can encode - * the provided ColorModel and SampleModel. - * If not, an IIOException will be thrown. - * @param writer The provided ImageWriter. - * @param colorModel The provided ColorModel. - * @param sampleModel The provided SampleModel. + /** Checks that the provided {@code ImageWriter} can encode + * the provided {@code ColorModel} and {@code SampleModel}. + * If not, an {@code IIOException} will be thrown. + * @param writer The provided {@code ImageWriter}. + * @param colorModel The provided {@code ColorModel}. + * @param sampleModel The provided {@code SampleModel}. * @throws IIOException If the writer cannot encoded the provided image. */ public static final void canEncodeImage(ImageWriter writer, diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/LZWStringTable.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/LZWStringTable.java index c90ed4b2b44..645c8e7fc54 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/LZWStringTable.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/LZWStringTable.java @@ -31,9 +31,9 @@ import java.io.PrintStream; * General purpose LZW String Table. * Extracted from GIFEncoder by Adam Doppelt * Comments added by Robin Luiten - * expandCode added by Robin Luiten + * {@code expandCode} added by Robin Luiten * The strLen table to give quick access to the lenght of an expanded - * code for use by the expandCode method added by Robin. + * code for use by the {@code expandCode} method added by Robin. **/ public class LZWStringTable { /** codesize + Reserved Codes */ diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/PaletteBuilder.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/PaletteBuilder.java index 35506ecdca5..4eae8a8f402 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/PaletteBuilder.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/PaletteBuilder.java @@ -70,19 +70,19 @@ public class PaletteBuilder { /** * Creates an image representing given image - * src using IndexColorModel. + * {@code src} using {@code IndexColorModel}. * * Lossless conversion is not always possible (e.g. if number * of colors in the given image exceeds maximum palette size). * Result image then is an approximation constructed by octree * quantization method. * - * @exception IllegalArgumentException if src is - * null. + * @exception IllegalArgumentException if {@code src} is + * {@code null}. * * @exception UnsupportedOperationException if implemented method - * is unable to create approximation of src - * and canCreatePalette returns false. + * is unable to create approximation of {@code src} + * and {@code canCreatePalette} returns {@code false}. * * @see createIndexColorModel * @@ -97,15 +97,15 @@ public class PaletteBuilder { /** * Creates an palette representing colors from given image - * img. If number of colors in the given image exceeds + * {@code img}. If number of colors in the given image exceeds * maximum palette size closest colors would be merged. * - * @exception IllegalArgumentException if img is - * null. + * @exception IllegalArgumentException if {@code img} is + * {@code null}. * * @exception UnsupportedOperationException if implemented method - * is unable to create approximation of img - * and canCreatePalette returns false. + * is unable to create approximation of {@code img} + * and {@code canCreatePalette} returns {@code false}. * * @see createIndexedImage * @@ -119,17 +119,17 @@ public class PaletteBuilder { } /** - * Returns true if PaletteBuilder is able to create + * Returns {@code true} if PaletteBuilder is able to create * palette for given image type. * - * @param type an instance of ImageTypeSpecifier to be + * @param type an instance of {@code ImageTypeSpecifier} to be * indexed. * - * @return true if the PaletteBuilder + * @return {@code true} if the {@code PaletteBuilder} * is likely to be able to create palette for this image type. * - * @exception IllegalArgumentException if type - * is null. + * @exception IllegalArgumentException if {@code type} + * is {@code null}. */ public static boolean canCreatePalette(ImageTypeSpecifier type) { if (type == null) { @@ -139,17 +139,17 @@ public class PaletteBuilder { } /** - * Returns true if PaletteBuilder is able to create + * Returns {@code true} if PaletteBuilder is able to create * palette for given rendered image. * - * @param image an instance of RenderedImage to be + * @param image an instance of {@code RenderedImage} to be * indexed. * - * @return true if the PaletteBuilder + * @return {@code true} if the {@code PaletteBuilder} * is likely to be able to create palette for this image type. * - * @exception IllegalArgumentException if image - * is null. + * @exception IllegalArgumentException if {@code image} + * is {@code null}. */ public static boolean canCreatePalette(RenderedImage image) { if (image == null) { diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ReaderUtil.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ReaderUtil.java index cedc428c3b4..0f8d1d66a28 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ReaderUtil.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ReaderUtil.java @@ -134,25 +134,25 @@ public class ReaderUtil { * pixels that will be written during a particular decoding pass. * The intent is to simplify the work done by readers in combining * the source region, source subsampling, and destination offset - * information obtained from the ImageReadParam with + * information obtained from the {@code ImageReadParam} with * the offsets and periods of a progressive or interlaced decoding * pass. * - * @param sourceRegion a Rectangle containing the + * @param sourceRegion a {@code Rectangle} containing the * source region being read, offset by the source subsampling * offsets, and clipped against the source bounds, as returned by - * the getSourceRegion method. - * @param destinationOffset a Point containing the + * the {@code getSourceRegion} method. + * @param destinationOffset a {@code Point} containing the * coordinates of the upper-left pixel to be written in the * destination. * @param dstMinX the smallest X coordinate (inclusive) of the - * destination Raster. + * destination {@code Raster}. * @param dstMinY the smallest Y coordinate (inclusive) of the - * destination Raster. + * destination {@code Raster}. * @param dstMaxX the largest X coordinate (inclusive) of the destination - * Raster. + * {@code Raster}. * @param dstMaxY the largest Y coordinate (inclusive) of the destination - * Raster. + * {@code Raster}. * @param sourceXSubsampling the X subsampling factor. * @param sourceYSubsampling the Y subsampling factor. * @param passXStart the smallest source X coordinate (inclusive) @@ -168,7 +168,7 @@ public class ReaderUtil { * @param passPeriodY the Y period (vertical spacing between * pixels) of the current progressive pass. * - * @return an array of 6 ints containing the + * @return an array of 6 {@code int}s containing the * destination min X, min Y, width, height, X period and Y period * of the region that will be updated. */ diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java index 82814627077..74ac23eb62e 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java @@ -1017,7 +1017,7 @@ public class GIFImageReader extends ImageReader { /** * Remove all settings including global settings such as - * Locales and listeners, as well as stream settings. + * {@code Locale}s and listeners, as well as stream settings. */ public void reset() { super.reset(); diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageWriter.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageWriter.java index 0c4fc02e038..afb81aa2307 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageWriter.java @@ -70,7 +70,7 @@ public class GIFImageWriter extends ImageWriter { GIFWritableImageMetadata.NATIVE_FORMAT_NAME; /** - * The output case to an ImageOutputStream. + * The {@code output} case to an {@code ImageOutputStream}. */ private ImageOutputStream stream = null; @@ -272,7 +272,7 @@ public class GIFImageWriter extends ImageWriter { } /** - * Merges inData into outData. The supplied + * Merges {@code inData} into {@code outData}. The supplied * metadata format name is attempted first and failing that the standard * metadata format name is attempted. */ @@ -554,8 +554,8 @@ public class GIFImageWriter extends ImageWriter { * * @param writeHeader Whether to write the header. * @param writeTrailer Whether to write the trailer. - * @param sm The stream metadata or null if - * writeHeader is false. + * @param sm The stream metadata or {@code null} if + * {@code writeHeader} is {@code false}. * @param iioimage The image and image metadata. * @param p The write parameters. * @@ -564,10 +564,10 @@ public class GIFImageWriter extends ImageWriter { * greater than 8. * @throws IllegalArgumentException if the color component size is * greater than 8. - * @throws IllegalArgumentException if writeHeader is - * true and sm is null. - * @throws IllegalArgumentException if writeHeader is - * false and a sequence is not being written. + * @throws IllegalArgumentException if {@code writeHeader} is + * {@code true} and {@code sm} is {@code null}. + * @throws IllegalArgumentException if {@code writeHeader} is + * {@code false} and a sequence is not being written. */ private void write(boolean writeHeader, boolean writeTrailer, diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFMetadata.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFMetadata.java index 7e03f0fb98a..3aca0e5c356 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFMetadata.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFMetadata.java @@ -32,7 +32,7 @@ import org.w3c.dom.Node; /** * Class which adds utility DOM element attribute access methods to - * IIOMetadata for subclass use. + * {@code IIOMetadata} for subclass use. */ abstract class GIFMetadata extends IIOMetadata { diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/COMMarkerSegment.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/COMMarkerSegment.java index c53cf35c865..d4a996ee3ee 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/COMMarkerSegment.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/COMMarkerSegment.java @@ -39,7 +39,7 @@ import org.w3c.dom.Node; * comment data as it is read from the stream. If the marker segment is * constructed from a String, then local default encoding is assumed * when creating the byte array. If the marker segment is created from - * an IIOMetadataNode, the user object, if present is + * an {@code IIOMetadataNode}, the user object, if present is * assumed to be a byte array containing the comment data. If there is * no user object then the comment attribute is used to create the * byte array, again assuming the default local encoding. @@ -49,7 +49,7 @@ class COMMarkerSegment extends MarkerSegment { /** * Constructs a marker segment from the given buffer, which contains - * data from an ImageInputStream. This is used when + * data from an {@code ImageInputStream}. This is used when * reading metadata from a stream. */ COMMarkerSegment(JPEGBuffer buffer) throws IOException { @@ -69,7 +69,7 @@ class COMMarkerSegment extends MarkerSegment { /** * Constructs a marker segment from a native tree node. If the node - * is an IIOMetadataNode and contains a user object, + * is an {@code IIOMetadataNode} and contains a user object, * that object is used rather than the string attribute. If the * string attribute is used, the default encoding is used. */ @@ -103,7 +103,7 @@ class COMMarkerSegment extends MarkerSegment { } /** - * Returns an IIOMetadataNode containing the data array + * Returns an {@code IIOMetadataNode} containing the data array * as a user object and a string encoded using ISO-8895-1, as an * attribute. */ diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java index fb59d7b2119..b42eec68d10 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java @@ -90,7 +90,7 @@ class JFIFMarkerSegment extends MarkerSegment { private final boolean debug = false; /** - * Set to true when reading the chunks of an + * Set to {@code true} when reading the chunks of an * ICC profile. All chunks are consolidated to create a single * "segment" containing all the chunks. This flag is a state * variable identifying whether to construct a new segment or @@ -594,10 +594,10 @@ class JFIFMarkerSegment extends MarkerSegment { /** * Writes out a default JFIF marker segment to the given - * output stream. If thumbnails is not null, + * output stream. If {@code thumbnails} is not {@code null}, * writes out the set of thumbnail images as JFXX marker segments, or * incorporated into the JFIF segment if appropriate. - * If iccProfile is not null, + * If {@code iccProfile} is not {@code null}, * writes out the profile after the JFIF segment using as many APP2 * marker segments as necessary. */ diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEG.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEG.java index e18e9509e22..8acbf84bd8a 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEG.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEG.java @@ -36,7 +36,7 @@ import java.awt.color.ICC_ColorSpace; /** * A class containing JPEG-related constants, definitions, and * static methods. This class and its constants must be public so that - * JPEGImageWriteParam can see it. + * {@code JPEGImageWriteParam} can see it. */ public class JPEG { @@ -234,10 +234,10 @@ public class JPEG { public static final float DEFAULT_QUALITY = 0.75F; /** - * Returns true if the given ColorSpace + * Returns {@code true} if the given {@code ColorSpace} * object is an instance of ICC_ColorSpace but is not one of the - * standard ColorSpaces returned by - * ColorSpace.getInstance(). + * standard {@code ColorSpaces} returned by + * {@code ColorSpace.getInstance()}. */ static boolean isNonStandardICC(ColorSpace cs) { boolean retval = false; @@ -255,8 +255,8 @@ public class JPEG { /** - * Returns true if the given imageType can be used - * in a JFIF file. If input is true, then the + * Returns {@code true} if the given imageType can be used + * in a JFIF file. If {@code input} is true, then the * image type is considered before colorspace conversion. */ static boolean isJFIFcompliant(ImageTypeSpecifier imageType, @@ -295,7 +295,7 @@ public class JPEG { /** * Given an image type, return the Adobe transform corresponding to * that type, or ADOBE_IMPOSSIBLE if the image type is incompatible - * with an Adobe marker segment. If input is true, then + * with an Adobe marker segment. If {@code input} is true, then * the image type is considered before colorspace conversion. */ static int transformForType(ImageTypeSpecifier imageType, boolean input) { diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGBuffer.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGBuffer.java index 60bdbf08772..9c2f8b26088 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGBuffer.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGBuffer.java @@ -75,12 +75,12 @@ class JPEGBuffer { } /** - * Ensures that there are at least count bytes available + * Ensures that there are at least {@code count} bytes available * in the buffer, loading more data and moving any remaining * bytes to the front. A count of 0 means to just fill the buffer. * If the count is larger than the buffer size, just fills the buffer. * If the end of the stream is encountered before a non-0 count can - * be satisfied, an IIOException is thrown with the + * be satisfied, an {@code IIOException} is thrown with the * message "Image Format Error". */ void loadBuf(int count) throws IOException { @@ -122,7 +122,7 @@ class JPEGBuffer { * the buffer and then reading directly from the stream * if necessary. The buffer is left in an appropriate * state. If the end of the stream is encountered, an - * IIOException is thrown with the + * {@code IIOException} is thrown with the * message "Image Format Error". */ void readData(byte [] data) throws IOException { @@ -149,9 +149,9 @@ class JPEGBuffer { } /** - * Skips count bytes, leaving the buffer + * Skips {@code count} bytes, leaving the buffer * in an appropriate state. If the end of the stream is - * encountered, an IIOException is thrown with the + * encountered, an {@code IIOException} is thrown with the * message "Image Format Error". */ void skipData(int count) throws IOException { @@ -195,8 +195,8 @@ class JPEGBuffer { * the buffer as necessary. The buffer position is left * pointing to the first non-0xff byte after a run of * 0xff bytes. If the end of the stream is encountered, - * an EOI marker is inserted into the buffer and true - * is returned. Otherwise returns false. + * an EOI marker is inserted into the buffer and {@code true} + * is returned. Otherwise returns {@code false}. */ boolean scanForFF(JPEGImageReader reader) throws IOException { boolean retval = false; diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java index 5a0e560f9ae..1773b200f65 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java @@ -544,7 +544,7 @@ public class JPEGImageReader extends ImageReader { } /** - * Returns true if there is an image beyond + * Returns {@code true} if there is an image beyond * the current stream position. Does not disturb the * stream position. */ @@ -614,13 +614,13 @@ public class JPEGImageReader extends ImageReader { /** * Read in the header information starting from the current - * stream position, returning true if the + * stream position, returning {@code true} if the * header was a tables-only image. After this call, the * native IJG decompression struct will contain the image * information required by most query calls below * (e.g. getWidth, getHeight, etc.), if the header was not * a tables-only image. - * If reset is true, the state of the IJG + * If reset is {@code true}, the state of the IJG * object is reset so that it can read a header again. * This happens automatically if the header was a tables-only * image. @@ -867,7 +867,7 @@ public class JPEGImageReader extends ImageReader { * Checks the implied color conversion between the stream and * the target image, altering the IJG output color space if necessary. * If a java color conversion is required, then this sets up - * convert. + * {@code convert}. * If bands are being rearranged at all (either source or destination * bands are specified in the param), then the default color * conversions are assumed to be correct. @@ -1394,7 +1394,7 @@ public class JPEGImageReader extends ImageReader { } /** - * Returns true if the read was aborted. + * Returns {@code true} if the read was aborted. */ private native boolean readImage(long structPointer, byte [] buffer, @@ -1788,6 +1788,8 @@ class ImageTypeProducer { case JPEG.JCS_GRAYSCALE: return ImageTypeSpecifier.createFromBufferedImageType (BufferedImage.TYPE_BYTE_GRAY); + case JPEG.JCS_YCbCr: + //there is no YCbCr raw type so by default we assume it as RGB case JPEG.JCS_RGB: return ImageTypeSpecifier.createInterleaved(JPEG.JCS.sRGB, JPEG.bOffsRGB, diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java index bc24343f9ba..12b94711cff 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java @@ -1130,10 +1130,10 @@ public class JPEGImageWriter extends ImageWriter { /* * from jpeg_metadata.html: * If no stream metadata is supplied to - * ImageWriter.prepareWriteSequence, then no + * {@code ImageWriter.prepareWriteSequence}, then no * tables-only image is written. If stream metadata containing * no tables is supplied to - * ImageWriter.prepareWriteSequence, then a tables-only + * {@code ImageWriter.prepareWriteSequence}, then a tables-only * image containing default visually lossless tables is written. */ if (streamMetadata != null) { @@ -1699,7 +1699,7 @@ public class JPEGImageWriter extends ImageWriter { private native void setDest(long structPointer); /** - * Returns true if the write was aborted. + * Returns {@code true} if the write was aborted. */ private native boolean writeImage(long structPointer, byte [] data, diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java index 7975efda580..e560a53f3ca 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java @@ -66,17 +66,17 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable { private static final boolean debug = false; /** - * A copy of markerSequence, created the first time the - * markerSequence is modified. This is used by reset + * A copy of {@code markerSequence}, created the first time the + * {@code markerSequence} is modified. This is used by reset * to restore the original state. */ private List resetSequence = null; /** - * Set to true when reading a thumbnail stored as + * Set to {@code true} when reading a thumbnail stored as * JPEG. This is used to enforce the prohibition of JFIF thumbnails * containing any JFIF marker segments, and to ensure generation of - * a correct native subtree during getAsTree. + * a correct native subtree during {@code getAsTree}. */ private boolean inThumb = false; @@ -93,7 +93,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable { /////// Package-access variables /** - * All data is a list of MarkerSegment objects. + * All data is a list of {@code MarkerSegment} objects. * When accessing the list, use the tag to identify the particular * subclass. Any JFIF marker segment must be the first element * of the list if it is present, and any JFXX or APP2ICC marker @@ -132,17 +132,17 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable { } /* - * Constructs a JPEGMetadata object by reading the - * contents of an ImageInputStream. Has package-only + * Constructs a {@code JPEGMetadata} object by reading the + * contents of an {@code ImageInputStream}. Has package-only * access. * * @param isStream A boolean indicating whether this object will be * stream or image metadata. * @param isThumb A boolean indicating whether this metadata object * is for an image or for a thumbnail stored as JPEG. - * @param iis An ImageInputStream from which to read + * @param iis An {@code ImageInputStream} from which to read * the metadata. - * @param reader The JPEGImageReader calling this + * @param reader The {@code JPEGImageReader} calling this * constructor, to which warnings should be sent. */ JPEGMetadata(boolean isStream, @@ -365,7 +365,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable { } /** - * Constructs a default stream JPEGMetadata object appropriate + * Constructs a default stream {@code JPEGMetadata} object appropriate * for the given write parameters. */ JPEGMetadata(ImageWriteParam param, JPEGImageWriter writer) { @@ -398,7 +398,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable { } /** - * Constructs a default image JPEGMetadata object appropriate + * Constructs a default image {@code JPEGMetadata} object appropriate * for the given image type and write parameters. */ JPEGMetadata(ImageTypeSpecifier imageType, @@ -2248,7 +2248,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable { /** * Check that this metadata object is in a consistent state and - * return true if it is or false + * return {@code true} if it is or {@code false} * otherwise. All the constructors and modifiers should call * this method at the end to guarantee that the data is always * consistent, as the writer relies on this. diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadataFormat.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadataFormat.java index 63dce67b055..475cc36359e 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadataFormat.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadataFormat.java @@ -133,12 +133,12 @@ abstract class JPEGMetadataFormat extends IIOMetadataFormatImpl { } /** - * Returns true if the named element occurs in the + * Returns {@code true} if the named element occurs in the * subtree of the format starting with the node named by - * subtreeName, including the node - * itself. subtreeName may be any node in + * {@code subtreeName}, including the node + * itself. {@code subtreeName} may be any node in * the format. If it is not, an - * IllegalArgumentException is thrown. + * {@code IllegalArgumentException} is thrown. */ protected boolean isInSubtree(String elementName, String subtreeName) { diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java index 2952635b7f2..6f51fee8b8a 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java @@ -51,8 +51,8 @@ class MarkerSegment implements Cloneable { boolean unknown = false; // Set to true if the tag is not recognized /** - * Constructor for creating MarkerSegments by reading - * from an ImageInputStream. + * Constructor for creating {@code MarkerSegment}s by reading + * from an {@code ImageInputStream}. */ MarkerSegment(JPEGBuffer buffer) throws IOException { diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java index 278882e5385..e58c7af8b18 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java @@ -26,16 +26,13 @@ package com.sun.imageio.plugins.png; import java.awt.Rectangle; -import java.awt.image.ColorModel; import java.awt.image.IndexColorModel; import java.awt.image.Raster; import java.awt.image.WritableRaster; import java.awt.image.RenderedImage; import java.awt.image.SampleModel; import java.io.ByteArrayOutputStream; -import java.io.DataOutput; import java.io.IOException; -import java.io.OutputStream; import java.util.Iterator; import java.util.Locale; import java.util.zip.Deflater; @@ -46,14 +43,13 @@ import javax.imageio.ImageTypeSpecifier; import javax.imageio.ImageWriteParam; import javax.imageio.ImageWriter; import javax.imageio.metadata.IIOMetadata; -import javax.imageio.metadata.IIOMetadata; import javax.imageio.spi.ImageWriterSpi; import javax.imageio.stream.ImageOutputStream; import javax.imageio.stream.ImageOutputStreamImpl; -class CRC { +final class CRC { - private static int[] crcTable = new int[256]; + private static final int[] crcTable = new int[256]; private int crc = 0xffffffff; static { @@ -72,23 +68,25 @@ class CRC { } } - public CRC() {} + CRC() {} - public void reset() { + void reset() { crc = 0xffffffff; } - public void update(byte[] data, int off, int len) { + void update(byte[] data, int off, int len) { + int c = crc; for (int n = 0; n < len; n++) { - crc = crcTable[(crc ^ data[off + n]) & 0xff] ^ (crc >>> 8); + c = crcTable[(c ^ data[off + n]) & 0xff] ^ (c >>> 8); } + crc = c; } - public void update(int data) { + void update(int data) { crc = crcTable[(crc ^ data) & 0xff] ^ (crc >>> 8); } - public int getValue() { + int getValue() { return crc ^ 0xffffffff; } } @@ -96,11 +94,11 @@ class CRC { final class ChunkStream extends ImageOutputStreamImpl { - private ImageOutputStream stream; - private long startPos; - private CRC crc = new CRC(); + private final ImageOutputStream stream; + private final long startPos; + private final CRC crc = new CRC(); - public ChunkStream(int type, ImageOutputStream stream) throws IOException { + ChunkStream(int type, ImageOutputStream stream) throws IOException { this.stream = stream; this.startPos = stream.getStreamPosition(); @@ -108,25 +106,29 @@ final class ChunkStream extends ImageOutputStreamImpl { writeInt(type); } + @Override public int read() throws IOException { throw new RuntimeException("Method not available"); } + @Override public int read(byte[] b, int off, int len) throws IOException { throw new RuntimeException("Method not available"); } + @Override public void write(byte[] b, int off, int len) throws IOException { crc.update(b, off, len); stream.write(b, off, len); } + @Override public void write(int b) throws IOException { crc.update(b); stream.write(b); } - public void finish() throws IOException { + void finish() throws IOException { // Write CRC stream.writeInt(crc.getValue()); @@ -140,6 +142,7 @@ final class ChunkStream extends ImageOutputStreamImpl { stream.flushBefore(pos); } + @Override protected void finalize() throws Throwable { // Empty finalizer (for improved performance; no need to call // super.finalize() in this case) @@ -150,24 +153,29 @@ final class ChunkStream extends ImageOutputStreamImpl { // fixed length. final class IDATOutputStream extends ImageOutputStreamImpl { - private static byte[] chunkType = { + private static final byte[] chunkType = { (byte)'I', (byte)'D', (byte)'A', (byte)'T' }; - private ImageOutputStream stream; - private int chunkLength; + private final ImageOutputStream stream; + private final int chunkLength; private long startPos; - private CRC crc = new CRC(); + private final CRC crc = new CRC(); - Deflater def = new Deflater(Deflater.BEST_COMPRESSION); - byte[] buf = new byte[512]; + private final Deflater def; + private final byte[] buf = new byte[512]; + // reused 1 byte[] array: + private final byte[] wbuf1 = new byte[1]; private int bytesRemaining; - public IDATOutputStream(ImageOutputStream stream, int chunkLength) - throws IOException { + IDATOutputStream(ImageOutputStream stream, int chunkLength, + int deflaterLevel) throws IOException + { this.stream = stream; this.chunkLength = chunkLength; + this.def = new Deflater(deflaterLevel); + startChunk(); } @@ -206,14 +214,17 @@ final class IDATOutputStream extends ImageOutputStreamImpl { } } + @Override public int read() throws IOException { throw new RuntimeException("Method not available"); } + @Override public int read(byte[] b, int off, int len) throws IOException { throw new RuntimeException("Method not available"); } + @Override public void write(byte[] b, int off, int len) throws IOException { if (len == 0) { return; @@ -227,7 +238,7 @@ final class IDATOutputStream extends ImageOutputStreamImpl { } } - public void deflate() throws IOException { + void deflate() throws IOException { int len = def.deflate(buf, 0, buf.length); int off = 0; @@ -247,13 +258,13 @@ final class IDATOutputStream extends ImageOutputStreamImpl { } } + @Override public void write(int b) throws IOException { - byte[] wbuf = new byte[1]; - wbuf[0] = (byte)b; - write(wbuf, 0, 1); + wbuf1[0] = (byte)b; + write(wbuf1, 0, 1); } - public void finish() throws IOException { + void finish() throws IOException { try { if (!def.finished()) { def.finish(); @@ -267,6 +278,7 @@ final class IDATOutputStream extends ImageOutputStreamImpl { } } + @Override protected void finalize() throws Throwable { // Empty finalizer (for improved performance; no need to call // super.finalize() in this case) @@ -274,18 +286,76 @@ final class IDATOutputStream extends ImageOutputStreamImpl { } -class PNGImageWriteParam extends ImageWriteParam { +final class PNGImageWriteParam extends ImageWriteParam { - public PNGImageWriteParam(Locale locale) { + /** Default quality level = 0.5 ie medium compression */ + private static final float DEFAULT_QUALITY = 0.5f; + + private static final String[] compressionNames = {"Deflate"}; + private static final float[] qualityVals = { 0.00F, 0.30F, 0.75F, 1.00F }; + private static final String[] qualityDescs = { + "High compression", // 0.00 -> 0.30 + "Medium compression", // 0.30 -> 0.75 + "Low compression" // 0.75 -> 1.00 + }; + + PNGImageWriteParam(Locale locale) { super(); this.canWriteProgressive = true; this.locale = locale; + this.canWriteCompressed = true; + this.compressionTypes = compressionNames; + this.compressionType = compressionTypes[0]; + this.compressionMode = MODE_DEFAULT; + this.compressionQuality = DEFAULT_QUALITY; + } + + /** + * Removes any previous compression quality setting. + * + *

The default implementation resets the compression quality + * to 0.5F. + * + * @exception IllegalStateException if the compression mode is not + * MODE_EXPLICIT. + */ + @Override + public void unsetCompression() { + super.unsetCompression(); + this.compressionType = compressionTypes[0]; + this.compressionQuality = DEFAULT_QUALITY; + } + + /** + * Returns true since the PNG plug-in only supports + * lossless compression. + * + * @return true. + */ + @Override + public boolean isCompressionLossless() { + return true; + } + + @Override + public String[] getCompressionQualityDescriptions() { + super.getCompressionQualityDescriptions(); + return qualityDescs.clone(); + } + + @Override + public float[] getCompressionQualityValues() { + super.getCompressionQualityValues(); + return qualityVals.clone(); } } /** */ -public class PNGImageWriter extends ImageWriter { +public final class PNGImageWriter extends ImageWriter { + + /** Default compression level = 4 ie medium compression */ + private static final int DEFAULT_COMPRESSION_LEVEL = 4; ImageOutputStream stream = null; @@ -334,6 +404,7 @@ public class PNGImageWriter extends ImageWriter { super(originatingProvider); } + @Override public void setOutput(Object output) { super.setOutput(output); if (output != null) { @@ -346,16 +417,17 @@ public class PNGImageWriter extends ImageWriter { } } - private static int[] allowedProgressivePasses = { 1, 7 }; - + @Override public ImageWriteParam getDefaultWriteParam() { return new PNGImageWriteParam(getLocale()); } + @Override public IIOMetadata getDefaultStreamMetadata(ImageWriteParam param) { return null; } + @Override public IIOMetadata getDefaultImageMetadata(ImageTypeSpecifier imageType, ImageWriteParam param) { PNGMetadata m = new PNGMetadata(); @@ -363,11 +435,13 @@ public class PNGImageWriter extends ImageWriter { return m; } + @Override public IIOMetadata convertStreamMetadata(IIOMetadata inData, ImageWriteParam param) { return null; } + @Override public IIOMetadata convertImageMetadata(IIOMetadata inData, ImageTypeSpecifier imageType, ImageWriteParam param) { @@ -934,8 +1008,11 @@ public class PNGImageWriter extends ImageWriter { } // Use sourceXOffset, etc. - private void write_IDAT(RenderedImage image) throws IOException { - IDATOutputStream ios = new IDATOutputStream(stream, 32768); + private void write_IDAT(RenderedImage image, int deflaterLevel) + throws IOException + { + IDATOutputStream ios = new IDATOutputStream(stream, 32768, + deflaterLevel); try { if (metadata.IHDR_interlaceMethod == 1) { for (int i = 0; i < 7; i++) { @@ -1028,6 +1105,7 @@ public class PNGImageWriter extends ImageWriter { } } + @Override public void write(IIOMetadata streamMetadata, IIOImage image, ImageWriteParam param) throws IIOException { @@ -1110,7 +1188,23 @@ public class PNGImageWriter extends ImageWriter { metadata = new PNGMetadata(); } + // reset compression level to default: + int deflaterLevel = DEFAULT_COMPRESSION_LEVEL; + if (param != null) { + switch(param.getCompressionMode()) { + case ImageWriteParam.MODE_DISABLED: + deflaterLevel = Deflater.NO_COMPRESSION; + break; + case ImageWriteParam.MODE_EXPLICIT: + float quality = param.getCompressionQuality(); + if (quality >= 0f && quality <= 1f) { + deflaterLevel = 9 - Math.round(9f * quality); + } + break; + default: + } + // Use Adam7 interlacing if set in write param switch (param.getProgressiveMode()) { case ImageWriteParam.MODE_DEFAULT: @@ -1119,8 +1213,9 @@ public class PNGImageWriter extends ImageWriter { case ImageWriteParam.MODE_DISABLED: metadata.IHDR_interlaceMethod = 0; break; - // MODE_COPY_FROM_METADATA should alreay be taken care of + // MODE_COPY_FROM_METADATA should already be taken care of // MODE_EXPLICIT is not allowed + default: } } @@ -1165,7 +1260,7 @@ public class PNGImageWriter extends ImageWriter { writeUnknownChunks(); - write_IDAT(im); + write_IDAT(im, deflaterLevel); if (abortRequested()) { processWriteAborted(); diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java index f02dd4391f0..2c7720c7f19 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java @@ -254,7 +254,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable { /** * Sets the IHDR_bitDepth and IHDR_colorType variables. - * The numBands parameter is necessary since + * The {@code numBands} parameter is necessary since * we may only be writing a subset of the image bands. */ public void initialize(ImageTypeSpecifier imageType, int numBands) { diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java index e8f4a5d05b3..c60a98c793b 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java @@ -362,9 +362,9 @@ public class TIFFIFD extends TIFFDirectory { offsets.add(f); } + List byteCounts = new ArrayList<>(); if (offsets.size() > 0) { // StripByteCounts - List byteCounts = new ArrayList<>(); f = getTIFFField(BaselineTIFFTagSet.TAG_STRIP_BYTE_COUNTS); if (f != null) { if (f.getCount() != count) { @@ -415,6 +415,12 @@ public class TIFFIFD extends TIFFDirectory { } } + // Ensure there is at least a data pointer for JPEG interchange format or + // both data offsets and byte counts for other compression types. + if (jpegOffset == null && (offsets.size() == 0 || byteCounts.size() == 0)) { + throw new IIOException("Insufficient data offsets or byte counts"); + } + // JPEGQTables - one 64-byte table for each offset. f = getTIFFField(BaselineTIFFTagSet.TAG_JPEG_Q_TABLES); if (f != null) { @@ -480,14 +486,16 @@ public class TIFFIFD extends TIFFDirectory { stream.skipBytes(4); continue; } - int count = (int)stream.readUnsignedInt(); + long longCount = stream.readUnsignedInt(); // Get the associated TIFFTag. TIFFTag tag = getTag(tagNumber, tagSetList); - // Ignore unknown fields. + // Ignore unknown fields, fields with unknown type, and fields + // with count out of int range. if((tag == null && ignoreUnknownFields) - || (tag != null && !tag.isDataTypeOK(type))) { + || (tag != null && !tag.isDataTypeOK(type)) + || longCount > Integer.MAX_VALUE) { // Skip the value/offset so as to leave the stream // position at the start of the next IFD entry. stream.skipBytes(4); @@ -496,6 +504,8 @@ public class TIFFIFD extends TIFFDirectory { continue; } + int count = (int)longCount; + if (tag == null) { tag = new TIFFTag(TIFFTag.UNKNOWN_TAG_NAME, tagNumber, 1 << type, count); @@ -518,7 +528,14 @@ public class TIFFIFD extends TIFFDirectory { } } - int size = count*sizeOfType; + long longSize = longCount*sizeOfType; + if (longSize > Integer.MAX_VALUE) { + // Continue with the next IFD entry. + stream.skipBytes(4); + continue; + } + int size = (int)longSize; + if (size > 4 || tag.isIFDPointer()) { // The IFD entry value is a pointer to the actual field value. long offset = stream.readUnsignedInt(); diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java index 6a90e0677c9..ea819e9e968 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java @@ -266,6 +266,8 @@ public class TIFFImageWriter extends ImageWriter { super.setOutput(output); if (output != null) { + reset(); + if (!(output instanceof ImageOutputStream)) { throw new IllegalArgumentException ("output not an ImageOutputStream!"); diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReader.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReader.java index 1bab31408c8..a9edc1e2c3a 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReader.java @@ -50,7 +50,7 @@ import com.sun.imageio.plugins.common.ReaderUtil; /** This class is the Java Image IO plugin reader for WBMP images. * It may subsample the image, clip the image, * and shift the decoded image origin if the proper decoding parameter - * are set in the provided WBMPImageReadParam. + * are set in the provided {@code WBMPImageReadParam}. */ public class WBMPImageReader extends ImageReader { /** The input stream where reads from */ @@ -69,8 +69,8 @@ public class WBMPImageReader extends ImageReader { private WBMPMetadata metadata; - /** Constructs WBMPImageReader from the provided - * ImageReaderSpi. + /** Constructs {@code WBMPImageReader} from the provided + * {@code ImageReaderSpi}. */ public WBMPImageReader(ImageReaderSpi originator) { super(originator); diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageWriter.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageWriter.java index 45d3187b2c8..8fd3a459fe1 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageWriter.java @@ -57,7 +57,7 @@ import com.sun.imageio.plugins.common.I18N; * a WBMP format. * * The encoding process may clip, subsample using the parameters - * specified in the ImageWriteParam. + * specified in the {@code ImageWriteParam}. * * @see com.sun.media.imageio.plugins.WBMPImageWriteParam */ @@ -92,8 +92,8 @@ public class WBMPImageWriter extends ImageWriter { return multiBytes; } - /** Constructs WBMPImageWriter based on the provided - * ImageWriterSpi. + /** Constructs {@code WBMPImageWriter} based on the provided + * {@code ImageWriterSpi}. */ public WBMPImageWriter(ImageWriterSpi originator) { super(originator); diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AiffFileWriter.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AiffFileWriter.java index 5e9e3c45cce..0a4788df804 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AiffFileWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AiffFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, 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 @@ -25,23 +25,22 @@ package com.sun.media.sound; -import java.io.File; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - import java.io.BufferedOutputStream; -import java.io.DataOutputStream; -import java.io.FileOutputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.io.RandomAccessFile; import java.io.SequenceInputStream; import java.util.Objects; import javax.sound.sampled.AudioFileFormat; -import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; //$$fb this class is buggy. Should be replaced in future. @@ -63,6 +62,7 @@ public final class AiffFileWriter extends SunFileWriter { // METHODS TO IMPLEMENT AudioFileWriter + @Override public AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream) { AudioFileFormat.Type[] filetypes = new AudioFileFormat.Type[types.length]; @@ -84,6 +84,7 @@ public final class AiffFileWriter extends SunFileWriter { } + @Override public int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException { Objects.requireNonNull(stream); Objects.requireNonNull(fileType); @@ -106,6 +107,7 @@ public final class AiffFileWriter extends SunFileWriter { } + @Override public int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException { Objects.requireNonNull(stream); Objects.requireNonNull(fileType); @@ -160,6 +162,9 @@ public final class AiffFileWriter extends SunFileWriter { * Throws IllegalArgumentException if not supported. */ private AudioFileFormat getAudioFileFormat(AudioFileFormat.Type type, AudioInputStream stream) { + if (!isFileTypeSupported(type, stream)) { + throw new IllegalArgumentException("File type " + type + " not supported."); + } AudioFormat format = null; AiffFileFormat fileFormat = null; @@ -177,10 +182,6 @@ public final class AiffFileWriter extends SunFileWriter { int fileSize; boolean convert8to16 = false; - if( !types[0].equals(type) ) { - throw new IllegalArgumentException("File type " + type + " not supported."); - } - if( (AudioFormat.Encoding.ALAW.equals(streamEncoding)) || (AudioFormat.Encoding.ULAW.equals(streamEncoding)) ) { diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AlawCodec.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AlawCodec.java index fcc0e709f2b..e117348dbdf 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AlawCodec.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AlawCodec.java @@ -135,45 +135,48 @@ public final class AlawCodec extends SunCodec { AudioFormat sourceFormat = sourceStream.getFormat(); AudioFormat.Encoding sourceEncoding = sourceFormat.getEncoding(); + if( !isConversionSupported(targetEncoding,sourceStream.getFormat()) ) { + throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString()); + } if( sourceEncoding.equals( targetEncoding ) ) { return sourceStream; - } else { - AudioFormat targetFormat = null; - if( !isConversionSupported(targetEncoding,sourceStream.getFormat()) ) { - throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString()); - } - if( sourceEncoding.equals( AudioFormat.Encoding.ALAW ) && - targetEncoding.equals( AudioFormat.Encoding.PCM_SIGNED ) ) { - - targetFormat = new AudioFormat( targetEncoding, - sourceFormat.getSampleRate(), - 16, - sourceFormat.getChannels(), - 2*sourceFormat.getChannels(), - sourceFormat.getSampleRate(), - sourceFormat.isBigEndian()); - - } else if( sourceEncoding.equals( AudioFormat.Encoding.PCM_SIGNED ) && - targetEncoding.equals( AudioFormat.Encoding.ALAW ) ) { - - targetFormat = new AudioFormat( targetEncoding, - sourceFormat.getSampleRate(), - 8, - sourceFormat.getChannels(), - sourceFormat.getChannels(), - sourceFormat.getSampleRate(), - false); - } else { - throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString()); - } - return getAudioInputStream( targetFormat, sourceStream ); } + AudioFormat targetFormat = null; + if( sourceEncoding.equals( AudioFormat.Encoding.ALAW ) && + targetEncoding.equals( AudioFormat.Encoding.PCM_SIGNED ) ) { + + targetFormat = new AudioFormat( targetEncoding, + sourceFormat.getSampleRate(), + 16, + sourceFormat.getChannels(), + 2*sourceFormat.getChannels(), + sourceFormat.getSampleRate(), + sourceFormat.isBigEndian()); + + } else if( sourceEncoding.equals( AudioFormat.Encoding.PCM_SIGNED ) && + targetEncoding.equals( AudioFormat.Encoding.ALAW ) ) { + + targetFormat = new AudioFormat( targetEncoding, + sourceFormat.getSampleRate(), + 8, + sourceFormat.getChannels(), + sourceFormat.getChannels(), + sourceFormat.getSampleRate(), + false); + } else { + throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString()); + } + return getConvertedStream(targetFormat, sourceStream); } /** * use old code... */ public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream){ + if (!isConversionSupported(targetFormat, sourceStream.getFormat())) + throw new IllegalArgumentException("Unsupported conversion: " + + sourceStream.getFormat().toString() + " to " + + targetFormat.toString()); return getConvertedStream( targetFormat, sourceStream ); } @@ -218,33 +221,28 @@ public final class AlawCodec extends SunCodec { Vector formats = new Vector<>(); AudioFormat format; - if ( AudioFormat.Encoding.PCM_SIGNED.equals(inputFormat.getEncoding())) { + if (inputFormat.getSampleSizeInBits() == 16 + && AudioFormat.Encoding.PCM_SIGNED.equals(inputFormat.getEncoding())) { format = new AudioFormat(AudioFormat.Encoding.ALAW, - inputFormat.getSampleRate(), - 8, + inputFormat.getSampleRate(), 8, inputFormat.getChannels(), inputFormat.getChannels(), - inputFormat.getSampleRate(), - false ); + inputFormat.getSampleRate(), false); formats.addElement(format); } - - if (AudioFormat.Encoding.ALAW.equals(inputFormat.getEncoding())) { + if (inputFormat.getSampleSizeInBits() == 8 + && AudioFormat.Encoding.ALAW.equals(inputFormat.getEncoding())) { format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, - inputFormat.getSampleRate(), - 16, + inputFormat.getSampleRate(), 16, inputFormat.getChannels(), - inputFormat.getChannels()*2, - inputFormat.getSampleRate(), - false ); + inputFormat.getChannels() * 2, + inputFormat.getSampleRate(), false); formats.addElement(format); format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, - inputFormat.getSampleRate(), - 16, + inputFormat.getSampleRate(), 16, inputFormat.getChannels(), - inputFormat.getChannels()*2, - inputFormat.getSampleRate(), - true ); + inputFormat.getChannels() * 2, + inputFormat.getSampleRate(), true); formats.addElement(format); } @@ -256,7 +254,7 @@ public final class AlawCodec extends SunCodec { } - final class AlawCodecStream extends AudioInputStream { + private final class AlawCodecStream extends AudioInputStream { // tempBuffer required only for encoding (when encode is true) private static final int tempBufferSize = 64; @@ -446,5 +444,12 @@ public final class AlawCodec extends SunCodec { return (i - off); } } + + @Override + public long skip(final long n) throws IOException { + // Implementation of this method assumes that we support + // encoding/decoding from/to 8/16 bits only + return encode ? super.skip(n * 2) / 2 : super.skip(n / 2) * 2; + } } // end class AlawCodecStream } // end class ALAW diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileFormat.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileFormat.java index 185efb9e6b0..7a8c5bc6a68 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileFormat.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, 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 @@ -25,24 +25,18 @@ package com.sun.media.sound; - import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; - /** * AU file format. * * @author Jan Borgersen */ - final class AuFileFormat extends AudioFileFormat { // magic numbers - static final int AU_SUN_MAGIC = 0x2e736e64; - static final int AU_SUN_INV_MAGIC = 0x646e732e; - static final int AU_DEC_MAGIC = 0x2e736400; - static final int AU_DEC_INV_MAGIC = 0x0064732e; + static final int AU_SUN_MAGIC = 0x2e736e64; // ".snd" // encodings static final int AU_ULAW_8 = 1; /* 8-bit ISDN u-law */ @@ -62,11 +56,6 @@ final class AuFileFormat extends AudioFileFormat { private int auType; - AuFileFormat( AudioFileFormat aff ) { - - this( aff.getType(), aff.getByteLength(), aff.getFormat(), aff.getFrameLength() ); - } - AuFileFormat(AudioFileFormat.Type type, int lengthInBytes, AudioFormat format, int lengthInFrames) { super(type,lengthInBytes,format,lengthInFrames); @@ -94,12 +83,9 @@ final class AuFileFormat extends AudioFileFormat { auType = AU_LINEAR_32; } } - } public int getAuType() { - return auType; } - } diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java index 7e83180dffa..180f45c9076 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java @@ -46,45 +46,25 @@ public final class AuFileReader extends SunFileReader { @Override public AudioFileFormat getAudioFileFormatImpl(final InputStream stream) throws UnsupportedAudioFileException, IOException { - boolean bigendian = false; - int headerSize = -1; - int dataSize = -1; - int encoding_local = -1; - int sampleRate = -1; - int frameRate = -1; - int frameSize = -1; - int channels = -1; - final int sampleSizeInBits; - int length = 0; - int nread = 0; - AudioFormat.Encoding encoding = null; - - DataInputStream dis = new DataInputStream( stream ); - - final int magic = dis.readInt(); nread += 4; - - if (! (magic == AuFileFormat.AU_SUN_MAGIC) || (magic == AuFileFormat.AU_DEC_MAGIC) || - (magic == AuFileFormat.AU_SUN_INV_MAGIC) || (magic == AuFileFormat.AU_DEC_INV_MAGIC) ) { + final DataInputStream dis = new DataInputStream(stream); + final int magic = dis.readInt(); + if (magic != AuFileFormat.AU_SUN_MAGIC) { // not AU, throw exception throw new UnsupportedAudioFileException("not an AU file"); } - if ((magic == AuFileFormat.AU_SUN_MAGIC) || (magic == AuFileFormat.AU_DEC_MAGIC)) { - bigendian = true; // otherwise little-endian - } - - headerSize = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4; - dataSize = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4; - encoding_local = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4; - sampleRate = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4; - channels = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4; + final int headerSize = dis.readInt(); + final int dataSize = dis.readInt(); + final int encoding_local = dis.readInt(); + final int sampleRate = dis.readInt(); + final int channels = dis.readInt(); if (channels <= 0) { throw new UnsupportedAudioFileException("Invalid number of channels"); } - frameRate = sampleRate; - + final int sampleSizeInBits; + final AudioFormat.Encoding encoding; switch (encoding_local) { case AuFileFormat.AU_ULAW_8: encoding = AudioFormat.Encoding.ULAW; @@ -138,24 +118,24 @@ public final class AuFileReader extends SunFileReader { break; */ default: - // unsupported filetype, throw exception - throw new UnsupportedAudioFileException("not a valid AU file"); + // unsupported filetype, throw exception + throw new UnsupportedAudioFileException("not a valid AU file"); } - frameSize = calculatePCMFrameSize(sampleSizeInBits, channels); + final int frameSize = calculatePCMFrameSize(sampleSizeInBits, channels); //$$fb 2002-11-02: fix for 4629669: AU file reader: problems with empty files - if( dataSize < 0 ) { + final int length; + if (dataSize < 0) { length = AudioSystem.NOT_SPECIFIED; } else { //$$fb 2003-10-20: fix for 4940459: AudioInputStream.getFrameLength() returns 0 instead of NOT_SPECIFIED length = dataSize / frameSize; } // now seek past the header - dis.skipBytes(headerSize - nread); - AudioFormat format = new AudioFormat(encoding, sampleRate, - sampleSizeInBits, channels, - frameSize, (float) frameRate, - bigendian); + dis.skipBytes(headerSize - AuFileFormat.AU_HEADERSIZE); + final AudioFormat format = new AudioFormat(encoding, sampleRate, + sampleSizeInBits, channels, + frameSize, sampleRate, true); return new AuFileFormat(AudioFileFormat.Type.AU, dataSize + headerSize, format, length); } diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileWriter.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileWriter.java index 1c2ccf5b74c..b498c916435 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, 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 @@ -25,26 +25,24 @@ package com.sun.media.sound; -import java.io.File; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - import java.io.BufferedOutputStream; -import java.io.DataOutputStream; -import java.io.FileOutputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.io.RandomAccessFile; import java.io.SequenceInputStream; import java.util.Objects; import javax.sound.sampled.AudioFileFormat; -import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; - /** * AU file writer. * @@ -52,8 +50,10 @@ import javax.sound.sampled.AudioSystem; */ public final class AuFileWriter extends SunFileWriter { - //$$fb value for length field if length is not known - public static final int UNKNOWN_SIZE=-1; + /** + * Value for length field if length is not known. + */ + private static final int UNKNOWN_SIZE = -1; /** * Constructs a new AuFileWriter object. @@ -62,6 +62,7 @@ public final class AuFileWriter extends SunFileWriter { super(new AudioFileFormat.Type[]{AudioFileFormat.Type.AU}); } + @Override public AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream) { AudioFileFormat.Type[] filetypes = new AudioFileFormat.Type[types.length]; @@ -82,7 +83,7 @@ public final class AuFileWriter extends SunFileWriter { return new AudioFileFormat.Type[0]; } - + @Override public int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException { Objects.requireNonNull(stream); Objects.requireNonNull(fileType); @@ -96,13 +97,10 @@ public final class AuFileWriter extends SunFileWriter { // throws IllegalArgumentException if not supported AuFileFormat auFileFormat = (AuFileFormat)getAudioFileFormat(fileType, stream); - - int bytesWritten = writeAuFile(stream, auFileFormat, out); - return bytesWritten; + return writeAuFile(stream, auFileFormat, out); } - - + @Override public int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException { Objects.requireNonNull(stream); Objects.requireNonNull(fileType); @@ -137,7 +135,6 @@ public final class AuFileWriter extends SunFileWriter { return bytesWritten; } - // ------------------------------------------------------------- /** @@ -145,6 +142,9 @@ public final class AuFileWriter extends SunFileWriter { * Throws IllegalArgumentException if not supported. */ private AudioFileFormat getAudioFileFormat(AudioFileFormat.Type type, AudioInputStream stream) { + if (!isFileTypeSupported(type, stream)) { + throw new IllegalArgumentException("File type " + type + " not supported."); + } AudioFormat format = null; AuFileFormat fileFormat = null; @@ -154,17 +154,9 @@ public final class AuFileWriter extends SunFileWriter { AudioFormat.Encoding streamEncoding = streamFormat.getEncoding(); - float sampleRate; int sampleSizeInBits; - int channels; - int frameSize; - float frameRate; int fileSize; - if( !types[0].equals(type) ) { - throw new IllegalArgumentException("File type " + type + " not supported."); - } - if( (AudioFormat.Encoding.ALAW.equals(streamEncoding)) || (AudioFormat.Encoding.ULAW.equals(streamEncoding)) ) { @@ -206,14 +198,12 @@ public final class AuFileWriter extends SunFileWriter { return fileFormat; } - - private InputStream getFileStream(AuFileFormat auFileFormat, InputStream audioStream) throws IOException { + private InputStream getFileStream(AuFileFormat auFileFormat, AudioInputStream audioStream) throws IOException { // private method ... assumes auFileFormat is a supported file type AudioFormat format = auFileFormat.getFormat(); - int magic = AuFileFormat.AU_SUN_MAGIC; int headerSize = AuFileFormat.AU_HEADERSIZE; long dataSize = auFileFormat.getFrameLength(); //$$fb fix for Bug 4351296 @@ -225,9 +215,6 @@ public final class AuFileWriter extends SunFileWriter { int encoding_local = auFileFormat.getAuType(); int sampleRate = (int)format.getSampleRate(); int channels = format.getChannels(); - //$$fb below is the fix for 4297100. - //boolean bigendian = format.isBigEndian(); - boolean bigendian = true; // force bigendian byte header[] = null; ByteArrayInputStream headerStream = null; @@ -243,54 +230,37 @@ public final class AuFileWriter extends SunFileWriter { codedAudioStream = audioStream; - if( audioStream instanceof AudioInputStream ) { + audioStreamFormat = audioStream.getFormat(); + encoding = audioStreamFormat.getEncoding(); + + //$$ fb 2001-07-13: Bug 4391108 + if( (AudioFormat.Encoding.PCM_UNSIGNED.equals(encoding)) || + (AudioFormat.Encoding.PCM_SIGNED.equals(encoding) + && !audioStreamFormat.isBigEndian()) ) { + // We always write big endian au files, this is by far the standard + codedAudioStream = AudioSystem.getAudioInputStream( new AudioFormat ( + AudioFormat.Encoding.PCM_SIGNED, + audioStreamFormat.getSampleRate(), + audioStreamFormat.getSampleSizeInBits(), + audioStreamFormat.getChannels(), + audioStreamFormat.getFrameSize(), + audioStreamFormat.getFrameRate(), + true), + audioStream ); - audioStreamFormat = ((AudioInputStream)audioStream).getFormat(); - encoding = audioStreamFormat.getEncoding(); - - //$$ fb 2001-07-13: Bug 4391108 - if( (AudioFormat.Encoding.PCM_UNSIGNED.equals(encoding)) || - (AudioFormat.Encoding.PCM_SIGNED.equals(encoding) - && bigendian != audioStreamFormat.isBigEndian()) ) { - - // plug in the transcoder to convert to PCM_SIGNED, bigendian - // NOTE: little endian AU is not common, so we're always converting - // to big endian unless the passed in audioFileFormat is little. - // $$fb this NOTE is superseded. We always write big endian au files, this is by far the standard. - codedAudioStream = AudioSystem.getAudioInputStream( new AudioFormat ( - AudioFormat.Encoding.PCM_SIGNED, - audioStreamFormat.getSampleRate(), - audioStreamFormat.getSampleSizeInBits(), - audioStreamFormat.getChannels(), - audioStreamFormat.getFrameSize(), - audioStreamFormat.getFrameRate(), - bigendian), - (AudioInputStream)audioStream ); - - - } } baos = new ByteArrayOutputStream(); dos = new DataOutputStream(baos); - if (bigendian) { - dos.writeInt(AuFileFormat.AU_SUN_MAGIC); - dos.writeInt(headerSize); - dos.writeInt((int)dataSizeInBytes); - dos.writeInt(encoding_local); - dos.writeInt(sampleRate); - dos.writeInt(channels); - } else { - dos.writeInt(AuFileFormat.AU_SUN_INV_MAGIC); - dos.writeInt(big2little(headerSize)); - dos.writeInt(big2little((int)dataSizeInBytes)); - dos.writeInt(big2little(encoding_local)); - dos.writeInt(big2little(sampleRate)); - dos.writeInt(big2little(channels)); - } + dos.writeInt(AuFileFormat.AU_SUN_MAGIC); + dos.writeInt(headerSize); + dos.writeInt((int)dataSizeInBytes); + dos.writeInt(encoding_local); + dos.writeInt(sampleRate); + dos.writeInt(channels); // Now create a new InputStream from headerStream and the InputStream // in audioStream @@ -304,7 +274,7 @@ public final class AuFileWriter extends SunFileWriter { return auStream; } - private int writeAuFile(InputStream in, AuFileFormat auFileFormat, OutputStream out) throws IOException { + private int writeAuFile(AudioInputStream in, AuFileFormat auFileFormat, OutputStream out) throws IOException { int bytesRead = 0; int bytesWritten = 0; @@ -332,6 +302,4 @@ public final class AuFileWriter extends SunFileWriter { return bytesWritten; } - - } diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java index a1e522afb40..21ee186cb71 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java @@ -22,6 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package com.sun.media.sound; import java.io.IOException; @@ -475,6 +476,11 @@ public final class AudioFloatFormatConverter extends FormatConversionProvider { public AudioInputStream getAudioInputStream(Encoding targetEncoding, AudioInputStream sourceStream) { + if (!isConversionSupported(targetEncoding, sourceStream.getFormat())) { + throw new IllegalArgumentException( + "Unsupported conversion: " + sourceStream.getFormat() + .toString() + " to " + targetEncoding.toString()); + } if (sourceStream.getFormat().getEncoding().equals(targetEncoding)) return sourceStream; AudioFormat format = sourceStream.getFormat(); diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizer.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizer.java index 786b7ba97bf..7479357c580 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizer.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizer.java @@ -32,9 +32,9 @@ import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.SourceDataLine; /** - * AudioSynthesizer is a Synthesizer - * which renders it's output audio into SourceDataLine - * or AudioInputStream. + * {@code AudioSynthesizer} is a {@code Synthesizer} + * which renders it's output audio into {@code SourceDataLine} + * or {@code AudioInputStream}. * * @see MidiSystem#getSynthesizer * @see Synthesizer @@ -59,7 +59,7 @@ public interface AudioSynthesizer extends Synthesizer { * Gets information about the possible properties for the synthesizer. * * @param info a proposed list of tag/value pairs that will be sent on open. - * @return an array of AudioSynthesizerPropertyInfo objects + * @return an array of {@code AudioSynthesizerPropertyInfo} objects * describing possible properties. This array may be an empty array if * no properties are required. */ @@ -68,7 +68,7 @@ public interface AudioSynthesizer extends Synthesizer { /** * Opens the synthesizer and starts rendering audio into - * SourceDataLine. + * {@code SourceDataLine}. * *

An application opening a synthesizer explicitly with this call * has to close the synthesizer by calling {@link #close}. This is @@ -77,13 +77,13 @@ public interface AudioSynthesizer extends Synthesizer { * *

Note that some synthesizers, once closed, cannot be reopened. * Attempts to reopen such a synthesizer will always result in - * a MidiUnavailableException. + * a {@code MidiUnavailableException}. * - * @param line which AudioSynthesizer writes output audio into. - * If line is null, then line from system default mixer is used. - * @param info a Map object containing + * @param line which {@code AudioSynthesizer} writes output audio into. + * If {@code line} is null, then line from system default mixer is used. + * @param info a {@code Map} object containing * properties for additional configuration supported by synthesizer. - * If info is null then default settings are used. + * If {@code info} is null then default settings are used. * * @throws MidiUnavailableException thrown if the synthesizer cannot be * opened due to resource restrictions. @@ -98,7 +98,7 @@ public interface AudioSynthesizer extends Synthesizer { /** * Opens the synthesizer and renders audio into returned - * AudioInputStream. + * {@code AudioInputStream}. * *

An application opening a synthesizer explicitly with this call * has to close the synthesizer by calling {@link #close}. This is @@ -107,13 +107,13 @@ public interface AudioSynthesizer extends Synthesizer { * *

Note that some synthesizers, once closed, cannot be reopened. * Attempts to reopen such a synthesizer will always result in - * a MidiUnavailableException. + * a {@code MidiUnavailableException}. * - * @param targetFormat specifies the AudioFormat - * used in returned AudioInputStream. - * @param info a Map object containing + * @param targetFormat specifies the {@code AudioFormat} + * used in returned {@code AudioInputStream}. + * @param info a {@code Map} object containing * properties for additional configuration supported by synthesizer. - * If info is null then default settings are used. + * If {@code info} is null then default settings are used. * * @throws MidiUnavailableException thrown if the synthesizer cannot be * opened due to resource restrictions. diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java index 16bfaa20790..3fadc82e448 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java @@ -25,16 +25,16 @@ package com.sun.media.sound; /** - * Information about property used in opening AudioSynthesizer. + * Information about property used in opening {@code AudioSynthesizer}. * * @author Karl Helgason */ public final class AudioSynthesizerPropertyInfo { /** - * Constructs a AudioSynthesizerPropertyInfo object with a given - * name and value. The description and choices - * are initialized by null values. + * Constructs a {@code AudioSynthesizerPropertyInfo} object with a given + * name and value. The {@code description} and {@code choices} + * are initialized by {@code null} values. * * @param name the name of the property * @param value the current value or class used for values. @@ -60,18 +60,18 @@ public final class AudioSynthesizerPropertyInfo { */ public String description = null; /** - * The value field specifies the current value of + * The {@code value} field specifies the current value of * the property. */ public Object value = null; /** - * The valueClass field specifies class - * used in value field. + * The {@code valueClass} field specifies class + * used in {@code value} field. */ public Class valueClass = null; /** * An array of possible values if the value for the field - * AudioSynthesizerPropertyInfo.value may be selected + * {@code AudioSynthesizerPropertyInfo.value} may be selected * from a particular set of values; otherwise null. */ public Object[] choices = null; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/MidiUtils.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/MidiUtils.java index a56b5eca48e..b68750ad416 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/MidiUtils.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/MidiUtils.java @@ -250,7 +250,7 @@ public final class MidiUtils { /** * Binary search for the event indexes of the track * - * @param tick - tick number of index to be found in array + * @param tick tick number of index to be found in array * @return index in track which is on or after "tick". * if no entries are found that follow after tick, track.size() is returned */ diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/PCMtoPCMCodec.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/PCMtoPCMCodec.java index 6ef8268f34c..5ba0558099d 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/PCMtoPCMCodec.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/PCMtoPCMCodec.java @@ -33,7 +33,6 @@ import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; - /** * Converts among signed/unsigned and little/big endianness of sampled. * @@ -52,11 +51,6 @@ public final class PCMtoPCMCodec extends SunCodec { AudioFormat.Encoding.PCM_UNSIGNED, }; - - - private static final int tempBufferSize = 64; - private byte tempBuffer [] = null; - /** * Constructs a new PCMtoPCM codec object. */ @@ -67,21 +61,31 @@ public final class PCMtoPCMCodec extends SunCodec { // NEW CODE + public AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat) { - /** - */ - public AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat){ - - if( sourceFormat.getEncoding().equals( AudioFormat.Encoding.PCM_SIGNED ) || - sourceFormat.getEncoding().equals( AudioFormat.Encoding.PCM_UNSIGNED ) ) { - - AudioFormat.Encoding encs[] = new AudioFormat.Encoding[2]; - encs[0] = AudioFormat.Encoding.PCM_SIGNED; - encs[1] = AudioFormat.Encoding.PCM_UNSIGNED; - return encs; - } else { - return new AudioFormat.Encoding[0]; + final int sampleSize = sourceFormat.getSampleSizeInBits(); + AudioFormat.Encoding encoding = sourceFormat.getEncoding(); + if (sampleSize == 8) { + if (encoding.equals(AudioFormat.Encoding.PCM_SIGNED)) { + return new AudioFormat.Encoding[]{ + AudioFormat.Encoding.PCM_UNSIGNED + }; } + if (encoding.equals(AudioFormat.Encoding.PCM_UNSIGNED)) { + return new AudioFormat.Encoding[]{ + AudioFormat.Encoding.PCM_SIGNED + }; + } + } else if (sampleSize == 16) { + if (encoding.equals(AudioFormat.Encoding.PCM_SIGNED) + || encoding.equals(AudioFormat.Encoding.PCM_UNSIGNED)) { + return new AudioFormat.Encoding[]{ + AudioFormat.Encoding.PCM_UNSIGNED, + AudioFormat.Encoding.PCM_SIGNED + }; + } + } + return new AudioFormat.Encoding[0]; } @@ -125,7 +129,7 @@ public final class PCMtoPCMCodec extends SunCodec { sourceFormat.getFrameRate(), sourceFormat.isBigEndian() ); - return getAudioInputStream( targetFormat, sourceStream ); + return getConvertedStream(targetFormat, sourceStream); } else { throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString() ); @@ -136,7 +140,10 @@ public final class PCMtoPCMCodec extends SunCodec { * use old code */ public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream){ - + if (!isConversionSupported(targetFormat, sourceStream.getFormat())) + throw new IllegalArgumentException("Unsupported conversion: " + + sourceStream.getFormat().toString() + " to " + + targetFormat.toString()); return getConvertedStream( targetFormat, sourceStream ); } @@ -166,7 +173,6 @@ public final class PCMtoPCMCodec extends SunCodec { } else { cs = (AudioInputStream) (new PCMtoPCMCodecStream(stream, outputFormat)); - tempBuffer = new byte[tempBufferSize]; } return cs; } diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftControl.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftControl.java index 85b3d276c71..e36295742c8 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftControl.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftControl.java @@ -25,7 +25,7 @@ package com.sun.media.sound; /** - * SoftControl are the basic controls + * {@code SoftControl} are the basic controls * used for control-rate processing. * * @author Karl Helgason diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMidiAudioFileReader.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMidiAudioFileReader.java index caf80f0e737..715cfcf9e76 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMidiAudioFileReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMidiAudioFileReader.java @@ -25,6 +25,7 @@ package com.sun.media.sound; +import java.io.EOFException; import java.io.IOException; import java.io.InputStream; @@ -131,7 +132,8 @@ public final class SoftMidiAudioFileReader extends SunFileReader { stream.mark(200); try { return getAudioInputStream(MidiSystem.getSequence(stream)); - } catch (final InvalidMidiDataException ignored) { + } catch (InvalidMidiDataException | EOFException ignored) { + // stream is unsupported or the header is less than was expected stream.reset(); throw new UnsupportedAudioFileException(); } diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunCodec.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunCodec.java index 232789352c5..773fea0e515 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunCodec.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunCodec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, 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 @@ -26,11 +26,8 @@ package com.sun.media.sound; import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.AudioInputStream; - import javax.sound.sampled.spi.FormatConversionProvider; - /** * A codec can encode and/or decode audio data. It provides an * AudioInputStream from which processed data may be read. @@ -73,23 +70,4 @@ abstract class SunCodec extends FormatConversionProvider { System.arraycopy(outputEncodings, 0, encodings, 0, outputEncodings.length); return encodings; } - - /** - */ - public abstract AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat); - - - /** - */ - public abstract AudioFormat[] getTargetFormats(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat); - - - /** - */ - public abstract AudioInputStream getAudioInputStream(AudioFormat.Encoding targetEncoding, AudioInputStream sourceStream); - /** - */ - public abstract AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream); - - } diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java index bca1a5616ce..a9e40ff33c5 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java @@ -27,6 +27,7 @@ package com.sun.media.sound; import java.io.BufferedInputStream; import java.io.DataInputStream; +import java.io.EOFException; import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -51,6 +52,9 @@ abstract class SunFileReader extends AudioFileReader { stream.mark(200); // The biggest value which was historically used try { return getAudioFileFormatImpl(stream); + } catch (final EOFException ignored) { + // the header is less than was expected + throw new UnsupportedAudioFileException(); } finally { stream.reset(); } @@ -61,6 +65,9 @@ abstract class SunFileReader extends AudioFileReader { throws UnsupportedAudioFileException, IOException { try (InputStream is = url.openStream()) { return getAudioFileFormatImpl(new BufferedInputStream(is)); + } catch (final EOFException ignored) { + // the header is less than was expected + throw new UnsupportedAudioFileException(); } } @@ -69,6 +76,9 @@ abstract class SunFileReader extends AudioFileReader { throws UnsupportedAudioFileException, IOException { try (InputStream is = new FileInputStream(file)) { return getAudioFileFormatImpl(new BufferedInputStream(is)); + } catch (final EOFException ignored) { + // the header is less than was expected + throw new UnsupportedAudioFileException(); } } @@ -82,9 +92,10 @@ abstract class SunFileReader extends AudioFileReader { // beginning of the audio data, so return an AudioInputStream return new AudioInputStream(stream, fileFormat.getFormat(), fileFormat.getFrameLength()); - } catch (final UnsupportedAudioFileException e) { + } catch (UnsupportedAudioFileException | EOFException ignored) { + // stream is unsupported or the header is less than was expected stream.reset(); - throw e; + throw new UnsupportedAudioFileException(); } } @@ -125,6 +136,9 @@ abstract class SunFileReader extends AudioFileReader { * @throws UnsupportedAudioFileException if the stream does not point to * valid audio file data recognized by the system * @throws IOException if an I/O exception occurs + * @throws EOFException is used incorrectly by our readers instead of + * UnsupportedAudioFileException if the header is less than was + * expected */ abstract AudioFileFormat getAudioFileFormatImpl(InputStream stream) throws UnsupportedAudioFileException, IOException; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileWriter.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileWriter.java index d771bad119e..8e9cf96889d 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, 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 @@ -25,19 +25,13 @@ package com.sun.media.sound; -import java.io.File; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; import java.io.DataInputStream; +import java.io.IOException; +import java.io.InputStream; import javax.sound.sampled.AudioFileFormat; -import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.spi.AudioFileWriter; - - - /** * Abstract File Writer class. * @@ -75,14 +69,6 @@ abstract class SunFileWriter extends AudioFileWriter { return localArray; } - - public abstract AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream); - - public abstract int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException; - - public abstract int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException; - - // HELPER METHODS diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/UlawCodec.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/UlawCodec.java index dc088ee459c..9dfcb444efd 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/UlawCodec.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/UlawCodec.java @@ -26,13 +26,12 @@ package com.sun.media.sound; import java.io.IOException; - import java.util.Objects; import java.util.Vector; import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.AudioSystem; import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; /** @@ -126,43 +125,46 @@ public final class UlawCodec extends SunCodec { AudioFormat sourceFormat = sourceStream.getFormat(); AudioFormat.Encoding sourceEncoding = sourceFormat.getEncoding(); + if (!isConversionSupported(targetEncoding,sourceStream.getFormat())) { + throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString()); + } if (sourceEncoding.equals(targetEncoding)) { return sourceStream; - } else { - AudioFormat targetFormat = null; - if (!isConversionSupported(targetEncoding,sourceStream.getFormat())) { - throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString()); - } - if (AudioFormat.Encoding.ULAW.equals(sourceEncoding) && - AudioFormat.Encoding.PCM_SIGNED.equals(targetEncoding) ) { - targetFormat = new AudioFormat( targetEncoding, - sourceFormat.getSampleRate(), - 16, - sourceFormat.getChannels(), - 2*sourceFormat.getChannels(), - sourceFormat.getSampleRate(), - sourceFormat.isBigEndian()); - } else if (AudioFormat.Encoding.PCM_SIGNED.equals(sourceEncoding) && - AudioFormat.Encoding.ULAW.equals(targetEncoding)) { - targetFormat = new AudioFormat( targetEncoding, - sourceFormat.getSampleRate(), - 8, - sourceFormat.getChannels(), - sourceFormat.getChannels(), - sourceFormat.getSampleRate(), - false); - } else { - throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString()); - } - - return getAudioInputStream( targetFormat, sourceStream ); } + AudioFormat targetFormat = null; + if (AudioFormat.Encoding.ULAW.equals(sourceEncoding) && + AudioFormat.Encoding.PCM_SIGNED.equals(targetEncoding) ) { + targetFormat = new AudioFormat( targetEncoding, + sourceFormat.getSampleRate(), + 16, + sourceFormat.getChannels(), + 2*sourceFormat.getChannels(), + sourceFormat.getSampleRate(), + sourceFormat.isBigEndian()); + } else if (AudioFormat.Encoding.PCM_SIGNED.equals(sourceEncoding) && + AudioFormat.Encoding.ULAW.equals(targetEncoding)) { + targetFormat = new AudioFormat( targetEncoding, + sourceFormat.getSampleRate(), + 8, + sourceFormat.getChannels(), + sourceFormat.getChannels(), + sourceFormat.getSampleRate(), + false); + } else { + throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString()); + } + + return getConvertedStream(targetFormat, sourceStream); } /** * use old code... */ public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream){ + if (!isConversionSupported(targetFormat, sourceStream.getFormat())) + throw new IllegalArgumentException("Unsupported conversion: " + + sourceStream.getFormat().toString() + " to " + + targetFormat.toString()); return getConvertedStream(targetFormat, sourceStream); } @@ -215,24 +217,20 @@ public final class UlawCodec extends SunCodec { false ); formats.addElement(format); } - - if (AudioFormat.Encoding.ULAW.equals(inputFormat.getEncoding())) { + if (inputFormat.getSampleSizeInBits() == 8 + && AudioFormat.Encoding.ULAW.equals(inputFormat.getEncoding())) { format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, - inputFormat.getSampleRate(), - 16, + inputFormat.getSampleRate(), 16, inputFormat.getChannels(), - inputFormat.getChannels()*2, - inputFormat.getSampleRate(), - false ); + inputFormat.getChannels() * 2, + inputFormat.getSampleRate(), false); formats.addElement(format); format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, - inputFormat.getSampleRate(), - 16, + inputFormat.getSampleRate(), 16, inputFormat.getChannels(), - inputFormat.getChannels()*2, - inputFormat.getSampleRate(), - true ); + inputFormat.getChannels() * 2, + inputFormat.getSampleRate(), true); formats.addElement(format); } @@ -244,7 +242,7 @@ public final class UlawCodec extends SunCodec { } - class UlawCodecStream extends AudioInputStream { + private final class UlawCodecStream extends AudioInputStream { private static final int tempBufferSize = 64; private byte tempBuffer [] = null; @@ -416,6 +414,12 @@ public final class UlawCodec extends SunCodec { return (i - off); } } - } // end class UlawCodecStream + @Override + public long skip(final long n) throws IOException { + // Implementation of this method assumes that we support + // encoding/decoding from/to 8/16 bits only + return encode ? super.skip(n * 2) / 2 : super.skip(n / 2) * 2; + } + } // end class UlawCodecStream } // end class ULAW diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java index b238e9da66e..240c6d27c58 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, 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 @@ -124,7 +124,6 @@ public final class WaveExtensibleFileReader extends SunFileReader { return false; return true; } - } private static final String[] channelnames = { "FL", "FR", "FC", "LF", @@ -196,9 +195,9 @@ public final class WaveExtensibleFileReader extends SunFileReader { fmt_found = true; int format = chunk.readUnsignedShort(); - if (format != 0xFFFE) - throw new UnsupportedAudioFileException(); // WAVE_FORMAT_EXTENSIBLE - // only + if (format != WaveFileFormat.WAVE_FORMAT_EXTENSIBLE) { + throw new UnsupportedAudioFileException(); + } channels = chunk.readUnsignedShort(); samplerate = chunk.readUnsignedInt(); /* framerate = */chunk.readUnsignedInt(); diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFileFormat.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFileFormat.java index af9c7160e7e..9bf8c9200ad 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFileFormat.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFileFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,13 +28,11 @@ package com.sun.media.sound; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; - /** * WAVE file format class. * * @author Jan Borgersen */ - final class WaveFileFormat extends AudioFileFormat { /** @@ -53,15 +51,16 @@ final class WaveFileFormat extends AudioFileFormat { private static final int STANDARD_FMT_CHUNK_SIZE = 16; // magic numbers - static final int RIFF_MAGIC = 1380533830; - static final int WAVE_MAGIC = 1463899717; - static final int FMT_MAGIC = 0x666d7420; // "fmt " - static final int DATA_MAGIC = 0x64617461; // "data" + static final int RIFF_MAGIC = 1380533830; + static final int WAVE_MAGIC = 1463899717; + static final int FMT_MAGIC = 0x666d7420; // "fmt " + static final int DATA_MAGIC = 0x64617461; // "data" // encodings static final int WAVE_FORMAT_UNKNOWN = 0x0000; static final int WAVE_FORMAT_PCM = 0x0001; static final int WAVE_FORMAT_ADPCM = 0x0002; + static final int WAVE_FORMAT_IEEE_FLOAT= 0x0003; static final int WAVE_FORMAT_ALAW = 0x0006; static final int WAVE_FORMAT_MULAW = 0x0007; static final int WAVE_FORMAT_OKI_ADPCM = 0x0010; @@ -72,12 +71,7 @@ final class WaveFileFormat extends AudioFileFormat { static final int WAVE_IBM_FORMAT_ADPCM = 0x0103; static final int WAVE_FORMAT_DVI_ADPCM = 0x0011; static final int WAVE_FORMAT_SX7383 = 0x1C07; - - - WaveFileFormat( AudioFileFormat aff ) { - - this( aff.getType(), aff.getByteLength(), aff.getFormat(), aff.getFrameLength() ); - } + static final int WAVE_FORMAT_EXTENSIBLE= 0xFFFE; WaveFileFormat(AudioFileFormat.Type type, int lengthInBytes, AudioFormat format, int lengthInFrames) { @@ -98,7 +92,6 @@ final class WaveFileFormat extends AudioFileFormat { } int getWaveType() { - return waveType; } diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFileWriter.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFileWriter.java index 199364c94f4..752afc512c9 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFileWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, 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 @@ -25,23 +25,22 @@ package com.sun.media.sound; -import java.io.File; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - import java.io.BufferedOutputStream; -import java.io.DataOutputStream; -import java.io.FileOutputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.io.RandomAccessFile; import java.io.SequenceInputStream; import java.util.Objects; import javax.sound.sampled.AudioFileFormat; -import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; //$$fb this class is buggy. Should be replaced in future. @@ -53,27 +52,6 @@ import javax.sound.sampled.AudioSystem; */ public final class WaveFileWriter extends SunFileWriter { - // magic numbers - static final int RIFF_MAGIC = 1380533830; - static final int WAVE_MAGIC = 1463899717; - static final int FMT_MAGIC = 0x666d7420; // "fmt " - static final int DATA_MAGIC = 0x64617461; // "data" - - // encodings - static final int WAVE_FORMAT_UNKNOWN = 0x0000; - static final int WAVE_FORMAT_PCM = 0x0001; - static final int WAVE_FORMAT_ADPCM = 0x0002; - static final int WAVE_FORMAT_ALAW = 0x0006; - static final int WAVE_FORMAT_MULAW = 0x0007; - static final int WAVE_FORMAT_OKI_ADPCM = 0x0010; - static final int WAVE_FORMAT_DIGISTD = 0x0015; - static final int WAVE_FORMAT_DIGIFIX = 0x0016; - static final int WAVE_IBM_FORMAT_MULAW = 0x0101; - static final int WAVE_IBM_FORMAT_ALAW = 0x0102; - static final int WAVE_IBM_FORMAT_ADPCM = 0x0103; - static final int WAVE_FORMAT_DVI_ADPCM = 0x0011; - static final int WAVE_FORMAT_SX7383 = 0x1C07; - /** * Constructs a new WaveFileWriter object. */ @@ -81,10 +59,7 @@ public final class WaveFileWriter extends SunFileWriter { super(new AudioFileFormat.Type[]{AudioFileFormat.Type.WAVE}); } - - // METHODS TO IMPLEMENT AudioFileWriter - - + @Override public AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream) { AudioFileFormat.Type[] filetypes = new AudioFileFormat.Type[types.length]; @@ -106,6 +81,7 @@ public final class WaveFileWriter extends SunFileWriter { } + @Override public int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException { Objects.requireNonNull(stream); Objects.requireNonNull(fileType); @@ -125,11 +101,11 @@ public final class WaveFileWriter extends SunFileWriter { throw new IOException("stream length not specified"); } - int bytesWritten = writeWaveFile(stream, waveFileFormat, out); - return bytesWritten; + return writeWaveFile(stream, waveFileFormat, out); } + @Override public int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException { Objects.requireNonNull(stream); Objects.requireNonNull(fileType); @@ -173,6 +149,9 @@ public final class WaveFileWriter extends SunFileWriter { * Throws IllegalArgumentException if not supported. */ private AudioFileFormat getAudioFileFormat(AudioFileFormat.Type type, AudioInputStream stream) { + if (!isFileTypeSupported(type, stream)) { + throw new IllegalArgumentException("File type " + type + " not supported."); + } AudioFormat format = null; WaveFileFormat fileFormat = null; AudioFormat.Encoding encoding = AudioFormat.Encoding.PCM_SIGNED; @@ -187,9 +166,6 @@ public final class WaveFileWriter extends SunFileWriter { float frameRate; int fileSize; - if (!types[0].equals(type)) { - throw new IllegalArgumentException("File type " + type + " not supported."); - } int waveType = WaveFileFormat.WAVE_FORMAT_PCM; if( AudioFormat.Encoding.ALAW.equals(streamEncoding) || @@ -198,9 +174,9 @@ public final class WaveFileWriter extends SunFileWriter { encoding = streamEncoding; sampleSizeInBits = streamFormat.getSampleSizeInBits(); if (streamEncoding.equals(AudioFormat.Encoding.ALAW)) { - waveType = WAVE_FORMAT_ALAW; + waveType = WaveFileFormat.WAVE_FORMAT_ALAW; } else { - waveType = WAVE_FORMAT_MULAW; + waveType = WaveFileFormat.WAVE_FORMAT_MULAW; } } else if ( streamFormat.getSampleSizeInBits()==8 ) { encoding = AudioFormat.Encoding.PCM_UNSIGNED; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileReader.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileReader.java index 3fe278fc70c..afecd0e34be 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, 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 @@ -67,8 +67,9 @@ public final class WaveFloatFileReader extends SunFileReader { fmt_found = true; int format = chunk.readUnsignedShort(); - if (format != 3) // WAVE_FORMAT_IEEE_FLOAT only + if (format != WaveFileFormat.WAVE_FORMAT_IEEE_FLOAT) { throw new UnsupportedAudioFileException(); + } channels = chunk.readUnsignedShort(); samplerate = chunk.readUnsignedInt(); /* framerate = */chunk.readUnsignedInt(); diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileWriter.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileWriter.java index 2845083384a..b2529f48f5c 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2016, 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 @@ -22,18 +22,20 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package com.sun.media.sound; import java.io.File; import java.io.IOException; import java.io.OutputStream; +import java.util.Objects; import javax.sound.sampled.AudioFileFormat; +import javax.sound.sampled.AudioFileFormat.Type; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioFormat.Encoding; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; -import javax.sound.sampled.AudioFileFormat.Type; import javax.sound.sampled.spi.AudioFileWriter; /** @@ -43,10 +45,12 @@ import javax.sound.sampled.spi.AudioFileWriter; */ public final class WaveFloatFileWriter extends AudioFileWriter { + @Override public Type[] getAudioFileTypes() { - return new Type[] { Type.WAVE }; + return new Type[]{Type.WAVE}; } + @Override public Type[] getAudioFileTypes(AudioInputStream stream) { if (!stream.getFormat().getEncoding().equals(Encoding.PCM_FLOAT)) @@ -92,18 +96,22 @@ public final class WaveFloatFileWriter extends AudioFileWriter { this.out = out; } + @Override public void write(int b) throws IOException { out.write(b); } + @Override public void flush() throws IOException { out.flush(); } + @Override public void write(byte[] b, int off, int len) throws IOException { out.write(b, off, len); } + @Override public void write(byte[] b) throws IOException { out.write(b); } @@ -118,8 +126,12 @@ public final class WaveFloatFileWriter extends AudioFileWriter { return AudioSystem.getAudioInputStream(targetFormat, ais); } + @Override public int write(AudioInputStream stream, Type fileType, OutputStream out) throws IOException { + Objects.requireNonNull(stream); + Objects.requireNonNull(fileType); + Objects.requireNonNull(out); checkFormat(fileType, stream); if (stream.getFormat().isBigEndian()) @@ -131,8 +143,13 @@ public final class WaveFloatFileWriter extends AudioFileWriter { return fpointer; } + @Override public int write(AudioInputStream stream, Type fileType, File out) throws IOException { + Objects.requireNonNull(stream); + Objects.requireNonNull(fileType); + Objects.requireNonNull(out); + checkFormat(fileType, stream); if (stream.getFormat().isBigEndian()) stream = toLittleEndian(stream); @@ -142,5 +159,4 @@ public final class WaveFloatFileWriter extends AudioFileWriter { writer.close(); return fpointer; } - } diff --git a/jdk/src/java.desktop/share/classes/java/applet/Applet.java b/jdk/src/java.desktop/share/classes/java/applet/Applet.java index aed6eae421b..0e02c9cb054 100644 --- a/jdk/src/java.desktop/share/classes/java/applet/Applet.java +++ b/jdk/src/java.desktop/share/classes/java/applet/Applet.java @@ -38,9 +38,9 @@ import javax.accessibility.*; * An applet is a small program that is intended not to be run on * its own, but rather to be embedded inside another application. *

- * The Applet class must be the superclass of any + * The {@code Applet} class must be the superclass of any * applet that is to be embedded in a Web page or viewed by the Java - * Applet Viewer. The Applet class provides a standard + * Applet Viewer. The {@code Applet} class provides a standard * interface between applets and their environment. * * @author Arthur van Hoff @@ -52,10 +52,10 @@ public class Applet extends Panel { /** * Constructs a new Applet. *

- * Note: Many methods in java.applet.Applet + * Note: Many methods in {@code java.applet.Applet} * may be invoked by the applet only after the applet is * fully constructed; applet should avoid calling methods - * in java.applet.Applet in the constructor. + * in {@code java.applet.Applet} in the constructor. * * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. @@ -88,8 +88,8 @@ public class Applet extends Panel { * Read an applet from an object input stream. * @param s an object input stream. * @exception HeadlessException if - * GraphicsEnvironment.isHeadless() returns - * true + * {@code GraphicsEnvironment.isHeadless()} returns + * {@code true} * @serial * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.4 @@ -104,9 +104,9 @@ public class Applet extends Panel { /** * Sets this applet's stub. This is done automatically by the system. - *

If there is a security manager, its checkPermission + *

If there is a security manager, its {@code checkPermission} * method is called with the - * AWTPermission("setAppletStub") + * {@code AWTPermission("setAppletStub")} * permission if a stub has already been set. * @param stub the new stub. * @exception SecurityException if the caller cannot set the stub @@ -123,11 +123,11 @@ public class Applet extends Panel { /** * Determines if this applet is active. An applet is marked active - * just before its start method is called. It becomes - * inactive just before its stop method is called. + * just before its {@code start} method is called. It becomes + * inactive just before its {@code stop} method is called. * - * @return true if the applet is active; - * false otherwise. + * @return {@code true} if the applet is active; + * {@code false} otherwise. * @see java.applet.Applet#start() * @see java.applet.Applet#stop() */ @@ -179,14 +179,14 @@ public class Applet extends Panel { * </applet> * *

- * then a call to getParameter("Color") returns the - * value "blue". + * then a call to {@code getParameter("Color")} returns the + * value {@code "blue"}. *

- * The name argument is case insensitive. + * The {@code name} argument is case insensitive. * * @param name a parameter name. * @return the value of the named parameter, - * or null if not set. + * or {@code null} if not set. */ public String getParameter(String name) { return stub.getParameter(name); @@ -260,8 +260,8 @@ public class Applet extends Panel { } /** - * Returns an Image object that can then be painted on - * the screen. The url that is passed as an argument + * Returns an {@code Image} object that can then be painted on + * the screen. The {@code url} that is passed as an argument * must specify an absolute URL. *

* This method always returns immediately, whether or not the image @@ -278,10 +278,10 @@ public class Applet extends Panel { } /** - * Returns an Image object that can then be painted on - * the screen. The url argument must specify an absolute - * URL. The name argument is a specifier that is - * relative to the url argument. + * Returns an {@code Image} object that can then be painted on + * the screen. The {@code url} argument must specify an absolute + * URL. The {@code name} argument is a specifier that is + * relative to the {@code url} argument. *

* This method always returns immediately, whether or not the image * exists. When this applet attempts to draw the image on the screen, @@ -290,7 +290,7 @@ public class Applet extends Panel { * * @param url an absolute URL giving the base location of the image. * @param name the location of the image, relative to the - * url argument. + * {@code url} argument. * @return the image at the specified URL. * @see java.awt.Image */ @@ -315,8 +315,8 @@ public class Applet extends Panel { } /** - * Returns the AudioClip object specified by the - * URL argument. + * Returns the {@code AudioClip} object specified by the + * {@code URL} argument. *

* This method always returns immediately, whether or not the audio * clip exists. When this applet attempts to play the audio clip, the @@ -331,8 +331,8 @@ public class Applet extends Panel { } /** - * Returns the AudioClip object specified by the - * URL and name arguments. + * Returns the {@code AudioClip} object specified by the + * {@code URL} and {@code name} arguments. *

* This method always returns immediately, whether or not the audio * clip exists. When this applet attempts to play the audio clip, the @@ -341,7 +341,7 @@ public class Applet extends Panel { * @param url an absolute URL giving the base location of the * audio clip. * @param name the location of the audio clip, relative to the - * url argument. + * {@code url} argument. * @return the audio clip at the specified URL. * @see java.applet.AudioClip */ @@ -355,11 +355,11 @@ public class Applet extends Panel { /** * Returns information about this applet. An applet should override - * this method to return a String containing information + * this method to return a {@code String} containing information * about the author, version, and copyright of the applet. *

* The implementation of this method provided by the - * Applet class returns null. + * {@code Applet} class returns {@code null}. * * @return a string containing information about the author, version, and * copyright of the applet. @@ -388,10 +388,10 @@ public class Applet extends Panel { /** * Returns information about the parameters that are understood by * this applet. An applet should override this method to return an - * array of Strings describing these parameters. + * array of {@code Strings} describing these parameters. *

* Each element of the array should be a set of three - * Strings containing the name, the type, and a + * {@code Strings} containing the name, the type, and a * description. For example: *

      * String pinfo[][] = {
@@ -402,7 +402,7 @@ public class Applet extends Panel {
      * 
*

* The implementation of this method provided by the - * Applet class returns null. + * {@code Applet} class returns {@code null}. * * @return an array describing the parameters this applet looks for. */ @@ -430,7 +430,7 @@ public class Applet extends Panel { * @param url an absolute URL giving the base location of the * audio clip. * @param name the location of the audio clip, relative to the - * url argument. + * {@code url} argument. */ public void play(URL url, String name) { AudioClip clip = getAudioClip(url, name); @@ -442,16 +442,16 @@ public class Applet extends Panel { /** * Called by the browser or applet viewer to inform * this applet that it has been loaded into the system. It is always - * called before the first time that the start method is + * called before the first time that the {@code start} method is * called. *

- * A subclass of Applet should override this method if + * A subclass of {@code Applet} should override this method if * it has initialization to perform. For example, an applet with - * threads would use the init method to create the - * threads and the destroy method to kill them. + * threads would use the {@code init} method to create the + * threads and the {@code destroy} method to kill them. *

* The implementation of this method provided by the - * Applet class does nothing. + * {@code Applet} class does nothing. * * @see java.applet.Applet#destroy() * @see java.applet.Applet#start() @@ -463,25 +463,25 @@ public class Applet extends Panel { /** * Called by the browser or applet viewer to inform * this applet that it should start its execution. It is called after - * the init method and each time the applet is revisited + * the {@code init} method and each time the applet is revisited * in a Web page. *

- * A subclass of Applet should override this method if + * A subclass of {@code Applet} should override this method if * it has any operation that it wants to perform each time the Web * page containing it is visited. For example, an applet with - * animation might want to use the start method to - * resume animation, and the stop method to suspend the + * animation might want to use the {@code start} method to + * resume animation, and the {@code stop} method to suspend the * animation. *

- * Note: some methods, such as getLocationOnScreen, can only + * Note: some methods, such as {@code getLocationOnScreen}, can only * provide meaningful results if the applet is showing. Because - * isShowing returns false when the applet's - * start is first called, methods requiring - * isShowing to return true should be called from - * a ComponentListener. + * {@code isShowing} returns {@code false} when the applet's + * {@code start} is first called, methods requiring + * {@code isShowing} to return {@code true} should be called from + * a {@code ComponentListener}. *

* The implementation of this method provided by the - * Applet class does nothing. + * {@code Applet} class does nothing. * * @see java.applet.Applet#destroy() * @see java.applet.Applet#init() @@ -498,15 +498,15 @@ public class Applet extends Panel { * the Web page that contains this applet has been replaced by * another page, and also just before the applet is to be destroyed. *

- * A subclass of Applet should override this method if + * A subclass of {@code Applet} should override this method if * it has any operation that it wants to perform each time the Web * page containing it is no longer visible. For example, an applet - * with animation might want to use the start method to - * resume animation, and the stop method to suspend the + * with animation might want to use the {@code start} method to + * resume animation, and the {@code stop} method to suspend the * animation. *

* The implementation of this method provided by the - * Applet class does nothing. + * {@code Applet} class does nothing. * * @see java.applet.Applet#destroy() * @see java.applet.Applet#init() @@ -517,17 +517,17 @@ public class Applet extends Panel { /** * Called by the browser or applet viewer to inform * this applet that it is being reclaimed and that it should destroy - * any resources that it has allocated. The stop method - * will always be called before destroy. + * any resources that it has allocated. The {@code stop} method + * will always be called before {@code destroy}. *

- * A subclass of Applet should override this method if + * A subclass of {@code Applet} should override this method if * it has any operation that it wants to perform before it is * destroyed. For example, an applet with threads would use the - * init method to create the threads and the - * destroy method to kill them. + * {@code init} method to create the threads and the + * {@code destroy} method to kill them. *

* The implementation of this method provided by the - * Applet class does nothing. + * {@code Applet} class does nothing. * * @see java.applet.Applet#init() * @see java.applet.Applet#start() @@ -561,7 +561,7 @@ public class Applet extends Panel { /** * This class implements accessibility support for the - * Applet class. It provides an implementation of the + * {@code Applet} class. It provides an implementation of the * Java Accessibility API appropriate to applet user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/applet/AudioClip.java b/jdk/src/java.desktop/share/classes/java/applet/AudioClip.java index 8356e492e49..f935fa4965b 100644 --- a/jdk/src/java.desktop/share/classes/java/applet/AudioClip.java +++ b/jdk/src/java.desktop/share/classes/java/applet/AudioClip.java @@ -26,8 +26,8 @@ package java.applet; /** - * The AudioClip interface is a simple abstraction for - * playing a sound clip. Multiple AudioClip items can be + * The {@code AudioClip} interface is a simple abstraction for + * playing a sound clip. Multiple {@code AudioClip} items can be * playing at the same time, and the resulting sound is mixed * together to produce a composite. * diff --git a/jdk/src/java.desktop/share/classes/java/awt/AWTError.java b/jdk/src/java.desktop/share/classes/java/awt/AWTError.java index 1110a6450c0..6ea6a2adb97 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/AWTError.java +++ b/jdk/src/java.desktop/share/classes/java/awt/AWTError.java @@ -38,7 +38,7 @@ public class AWTError extends Error { private static final long serialVersionUID = -1819846354050686206L; /** - * Constructs an instance of AWTError with the specified + * Constructs an instance of {@code AWTError} with the specified * detail message. * @param msg the detail message. * @since 1.0 diff --git a/jdk/src/java.desktop/share/classes/java/awt/AWTEvent.java b/jdk/src/java.desktop/share/classes/java/awt/AWTEvent.java index 04c4effeafa..1c723aeb133 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/AWTEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/AWTEvent.java @@ -410,11 +410,11 @@ public abstract class AWTEvent extends EventObject { } /** - * Returns a string representing the state of this Event. + * Returns a string representing the state of this {@code Event}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return a string representation of this event */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/AWTEventMulticaster.java b/jdk/src/java.desktop/share/classes/java/awt/AWTEventMulticaster.java index 8297188f1f9..a9f102643f4 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/AWTEventMulticaster.java +++ b/jdk/src/java.desktop/share/classes/java/awt/AWTEventMulticaster.java @@ -122,9 +122,9 @@ public class AWTEventMulticaster implements /** * Creates an event multicaster instance which chains listener-a - * with listener-b. Input parameters a and b - * should not be null, though implementations may vary in - * choosing whether or not to throw NullPointerException + * with listener-b. Input parameters {@code a} and {@code b} + * should not be {@code null}, though implementations may vary in + * choosing whether or not to throw {@code NullPointerException} * in that case. * @param a listener-a * @param b listener-b @@ -1078,30 +1078,30 @@ public class AWTEventMulticaster implements /** * Returns an array of all the objects chained as * FooListeners by the specified - * java.util.EventListener. + * {@code java.util.EventListener}. * FooListeners are chained by the - * AWTEventMulticaster using the + * {@code AWTEventMulticaster} using the * addFooListener method. - * If a null listener is specified, this method returns an + * If a {@code null} listener is specified, this method returns an * empty array. If the specified listener is not an instance of - * AWTEventMulticaster, this method returns an array which + * {@code AWTEventMulticaster}, this method returns an array which * contains only the specified listener. If no such listeners are chained, * this method returns an empty array. * * @param the listener type - * @param l the specified java.util.EventListener + * @param l the specified {@code java.util.EventListener} * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects chained as * FooListeners by the specified multicast * listener, or an empty array if no such listeners have been * chained by the specified multicast listener * @exception NullPointerException if the specified * {@code listenertype} parameter is {@code null} - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @since 1.4 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/AWTException.java b/jdk/src/java.desktop/share/classes/java/awt/AWTException.java index 0ffe52cd00a..5518643b3f5 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/AWTException.java +++ b/jdk/src/java.desktop/share/classes/java/awt/AWTException.java @@ -38,9 +38,9 @@ public class AWTException extends Exception { private static final long serialVersionUID = -1900414231151323879L; /** - * Constructs an instance of AWTException with the + * Constructs an instance of {@code AWTException} with the * specified detail message. A detail message is an - * instance of String that describes this particular + * instance of {@code String} that describes this particular * exception. * @param msg the detail message * @since 1.0 diff --git a/jdk/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java b/jdk/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java index f49b16badd2..6e85f2b1bbf 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java +++ b/jdk/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java @@ -37,22 +37,22 @@ import java.lang.reflect.Field; import sun.swing.SwingAccessor; /** - * An AWTKeyStroke represents a key action on the - * keyboard, or equivalent input device. AWTKeyStrokes + * An {@code AWTKeyStroke} represents a key action on the + * keyboard, or equivalent input device. {@code AWTKeyStroke}s * can correspond to only a press or release of a - * particular key, just as KEY_PRESSED and - * KEY_RELEASED KeyEvents do; + * particular key, just as {@code KEY_PRESSED} and + * {@code KEY_RELEASED KeyEvent}s do; * alternately, they can correspond to typing a specific Java character, just - * as KEY_TYPED KeyEvents do. - * In all cases, AWTKeyStrokes can specify modifiers + * as {@code KEY_TYPED KeyEvent}s do. + * In all cases, {@code AWTKeyStroke}s can specify modifiers * (alt, shift, control, meta, altGraph, or a combination thereof) which must be present * during the action for an exact match. *

- * AWTKeyStrokes are immutable, and are intended + * {@code AWTKeyStrokes} are immutable, and are intended * to be unique. Client code should never create an - * AWTKeyStroke on its own, but should instead use - * a variant of getAWTKeyStroke. Client use of these factory - * methods allows the AWTKeyStroke implementation + * {@code AWTKeyStroke} on its own, but should instead use + * a variant of {@code getAWTKeyStroke}. Client use of these factory + * methods allows the {@code AWTKeyStroke} implementation * to cache and share instances efficiently. * * @see #getAWTKeyStroke @@ -88,17 +88,17 @@ public class AWTKeyStroke implements Serializable { } /** - * Constructs an AWTKeyStroke with default values. + * Constructs an {@code AWTKeyStroke} with default values. * The default values used are: * * * * - * + * * * * - * + * * * * @@ -106,12 +106,12 @@ public class AWTKeyStroke implements Serializable { * * * - * + * * *
PropertyDefault Value
Key CharKeyEvent.CHAR_UNDEFINED{@code KeyEvent.CHAR_UNDEFINED}
Key CodeKeyEvent.VK_UNDEFINED{@code KeyEvent.VK_UNDEFINED}
Modifiers
On key release?false{@code false}
* - * AWTKeyStrokes should not be constructed - * by client code. Use a variant of getAWTKeyStroke + * {@code AWTKeyStroke}s should not be constructed + * by client code. Use a variant of {@code getAWTKeyStroke} * instead. * * @see #getAWTKeyStroke @@ -120,17 +120,17 @@ public class AWTKeyStroke implements Serializable { } /** - * Constructs an AWTKeyStroke with the specified - * values. AWTKeyStrokes should not be constructed - * by client code. Use a variant of getAWTKeyStroke + * Constructs an {@code AWTKeyStroke} with the specified + * values. {@code AWTKeyStroke}s should not be constructed + * by client code. Use a variant of {@code getAWTKeyStroke} * instead. * * @param keyChar the character value for a keyboard key - * @param keyCode the key code for this AWTKeyStroke + * @param keyCode the key code for this {@code AWTKeyStroke} * @param modifiers a bitwise-ored combination of any modifiers - * @param onKeyRelease true if this - * AWTKeyStroke corresponds - * to a key release; false otherwise + * @param onKeyRelease {@code true} if this + * {@code AWTKeyStroke} corresponds + * to a key release; {@code false} otherwise * @see #getAWTKeyStroke */ protected AWTKeyStroke(char keyChar, int keyCode, int modifiers, @@ -185,12 +185,12 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns a shared instance of an AWTKeyStroke - * that represents a KEY_TYPED event for the + * Returns a shared instance of an {@code AWTKeyStroke} + * that represents a {@code KEY_TYPED} event for the * specified character. * * @param keyChar the character value for a keyboard key - * @return an AWTKeyStroke object for that key + * @return an {@code AWTKeyStroke} object for that key */ public static AWTKeyStroke getAWTKeyStroke(char keyChar) { return getCachedStroke(keyChar, KeyEvent.VK_UNDEFINED, 0, false); @@ -202,7 +202,7 @@ public class AWTKeyStroke implements Serializable { * specified Character object and a set of modifiers. Note * that the first parameter is of type Character rather than * char. This is to avoid inadvertent clashes with - * calls to getAWTKeyStroke(int keyCode, int modifiers). + * calls to {@code getAWTKeyStroke(int keyCode, int modifiers)}. * * The modifiers consist of any combination of following:

    *
  • java.awt.event.InputEvent.SHIFT_DOWN_MASK @@ -227,9 +227,9 @@ public class AWTKeyStroke implements Serializable { * * @param keyChar the Character object for a keyboard character * @param modifiers a bitwise-ored combination of any modifiers - * @return an AWTKeyStroke object for that key - * @throws IllegalArgumentException if keyChar is - * null + * @return an {@code AWTKeyStroke} object for that key + * @throws IllegalArgumentException if {@code keyChar} is + * {@code null} * * @see java.awt.event.InputEvent */ @@ -243,19 +243,19 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns a shared instance of an AWTKeyStroke, + * Returns a shared instance of an {@code AWTKeyStroke}, * given a numeric key code and a set of modifiers, specifying * whether the key is activated when it is pressed or released. *

    * The "virtual key" constants defined in - * java.awt.event.KeyEvent can be + * {@code java.awt.event.KeyEvent} can be * used to specify the key code. For example:

      - *
    • java.awt.event.KeyEvent.VK_ENTER - *
    • java.awt.event.KeyEvent.VK_TAB - *
    • java.awt.event.KeyEvent.VK_SPACE + *
    • {@code java.awt.event.KeyEvent.VK_ENTER} + *
    • {@code java.awt.event.KeyEvent.VK_TAB} + *
    • {@code java.awt.event.KeyEvent.VK_SPACE} *
    * Alternatively, the key code may be obtained by calling - * java.awt.event.KeyEvent.getExtendedKeyCodeForChar. + * {@code java.awt.event.KeyEvent.getExtendedKeyCodeForChar}. * * The modifiers consist of any combination of:
      *
    • java.awt.event.InputEvent.SHIFT_DOWN_MASK @@ -279,8 +279,8 @@ public class AWTKeyStroke implements Serializable { * * @param keyCode an int specifying the numeric code for a keyboard key * @param modifiers a bitwise-ored combination of any modifiers - * @param onKeyRelease true if the AWTKeyStroke - * should represent a key release; false otherwise + * @param onKeyRelease {@code true} if the {@code AWTKeyStroke} + * should represent a key release; {@code false} otherwise * @return an AWTKeyStroke object for that key * * @see java.awt.event.KeyEvent @@ -293,16 +293,16 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns a shared instance of an AWTKeyStroke, + * Returns a shared instance of an {@code AWTKeyStroke}, * given a numeric key code and a set of modifiers. The returned - * AWTKeyStroke will correspond to a key press. + * {@code AWTKeyStroke} will correspond to a key press. *

      * The "virtual key" constants defined in - * java.awt.event.KeyEvent can be + * {@code java.awt.event.KeyEvent} can be * used to specify the key code. For example:

        - *
      • java.awt.event.KeyEvent.VK_ENTER - *
      • java.awt.event.KeyEvent.VK_TAB - *
      • java.awt.event.KeyEvent.VK_SPACE + *
      • {@code java.awt.event.KeyEvent.VK_ENTER} + *
      • {@code java.awt.event.KeyEvent.VK_TAB} + *
      • {@code java.awt.event.KeyEvent.VK_SPACE} *
      * The modifiers consist of any combination of:
        *
      • java.awt.event.InputEvent.SHIFT_DOWN_MASK @@ -326,7 +326,7 @@ public class AWTKeyStroke implements Serializable { * * @param keyCode an int specifying the numeric code for a keyboard key * @param modifiers a bitwise-ored combination of any modifiers - * @return an AWTKeyStroke object for that key + * @return an {@code AWTKeyStroke} object for that key * * @see java.awt.event.KeyEvent * @see java.awt.event.InputEvent @@ -337,18 +337,18 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns an AWTKeyStroke which represents the - * stroke which generated a given KeyEvent. + * Returns an {@code AWTKeyStroke} which represents the + * stroke which generated a given {@code KeyEvent}. *

        - * This method obtains the keyChar from a KeyTyped - * event, and the keyCode from a KeyPressed or - * KeyReleased event. The KeyEvent modifiers are - * obtained for all three types of KeyEvent. + * This method obtains the keyChar from a {@code KeyTyped} + * event, and the keyCode from a {@code KeyPressed} or + * {@code KeyReleased} event. The {@code KeyEvent} modifiers are + * obtained for all three types of {@code KeyEvent}. * - * @param anEvent the KeyEvent from which to - * obtain the AWTKeyStroke - * @throws NullPointerException if anEvent is null - * @return the AWTKeyStroke that precipitated the event + * @param anEvent the {@code KeyEvent} from which to + * obtain the {@code AWTKeyStroke} + * @throws NullPointerException if {@code anEvent} is null + * @return the {@code AWTKeyStroke} that precipitated the event */ public static AWTKeyStroke getAWTKeyStrokeForEvent(KeyEvent anEvent) { int id = anEvent.getID(); @@ -371,7 +371,7 @@ public class AWTKeyStroke implements Serializable { } /** - * Parses a string and returns an AWTKeyStroke. + * Parses a string and returns an {@code AWTKeyStroke}. * The string must have the following syntax: *

              *    <modifiers>* (<typedID> | <pressedReleasedID>)
        @@ -393,8 +393,8 @@ public class AWTKeyStroke implements Serializable {
              * 
        * * @param s a String formatted as described above - * @return an AWTKeyStroke object for that String - * @throws IllegalArgumentException if s is null, + * @return an {@code AWTKeyStroke} object for that String + * @throws IllegalArgumentException if {@code s} is {@code null}, * or is formatted incorrectly */ public static AWTKeyStroke getAWTKeyStroke(String s) { @@ -500,8 +500,8 @@ public class AWTKeyStroke implements Serializable { } /** * Returns the integer constant for the KeyEvent.VK field named - * key. This will throw an - * IllegalArgumentException if key is + * {@code key}. This will throw an + * {@code IllegalArgumentException} if {@code key} is * not a valid constant. */ private static int getVKValue(String key) { @@ -527,7 +527,7 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns the character for this AWTKeyStroke. + * Returns the character for this {@code AWTKeyStroke}. * * @return a char value * @see #getAWTKeyStroke(char) @@ -538,7 +538,7 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns the numeric key code for this AWTKeyStroke. + * Returns the numeric key code for this {@code AWTKeyStroke}. * * @return an int containing the key code value * @see #getAWTKeyStroke(int,int) @@ -549,7 +549,7 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns the modifier keys for this AWTKeyStroke. + * Returns the modifier keys for this {@code AWTKeyStroke}. * * @return an int containing the modifiers * @see #getAWTKeyStroke(int,int) @@ -559,10 +559,10 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns whether this AWTKeyStroke represents a key release. + * Returns whether this {@code AWTKeyStroke} represents a key release. * - * @return true if this AWTKeyStroke - * represents a key release; false otherwise + * @return {@code true} if this {@code AWTKeyStroke} + * represents a key release; {@code false} otherwise * @see #getAWTKeyStroke(int,int,boolean) */ public final boolean isOnKeyRelease() { @@ -570,12 +570,12 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns the type of KeyEvent which corresponds to - * this AWTKeyStroke. + * Returns the type of {@code KeyEvent} which corresponds to + * this {@code AWTKeyStroke}. * - * @return KeyEvent.KEY_PRESSED, - * KeyEvent.KEY_TYPED, - * or KeyEvent.KEY_RELEASED + * @return {@code KeyEvent.KEY_PRESSED}, + * {@code KeyEvent.KEY_TYPED}, + * or {@code KeyEvent.KEY_RELEASED} * @see java.awt.event.KeyEvent */ public final int getKeyEventType() { @@ -617,8 +617,8 @@ public class AWTKeyStroke implements Serializable { /** * Returns a string that displays and identifies this object's properties. - * The String returned by this method can be passed - * as a parameter to getAWTKeyStroke(String) to produce + * The {@code String} returned by this method can be passed + * as a parameter to {@code getAWTKeyStroke(String)} to produce * a key stroke equal to this key stroke. * * @return a String representation of this object @@ -695,8 +695,8 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns a cached instance of AWTKeyStroke (or a subclass of - * AWTKeyStroke) which is equal to this instance. + * Returns a cached instance of {@code AWTKeyStroke} (or a subclass of + * {@code AWTKeyStroke}) which is equal to this instance. * * @return a cached instance which is equal to this instance * @throws java.io.ObjectStreamException if a serialization problem occurs diff --git a/jdk/src/java.desktop/share/classes/java/awt/AWTPermission.java b/jdk/src/java.desktop/share/classes/java/awt/AWTPermission.java index a201670bec8..5eedadb383b 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/AWTPermission.java +++ b/jdk/src/java.desktop/share/classes/java/awt/AWTPermission.java @@ -29,7 +29,7 @@ import java.security.BasicPermission; /** * This class is for AWT permissions. - * An AWTPermission contains a target name but + * An {@code AWTPermission} contains a target name but * no actions list; you either have the named permission * or you don't. * @@ -39,7 +39,7 @@ import java.security.BasicPermission; * Also, an asterisk could be used to represent all AWT permissions. * *

        - * The following table lists all the possible AWTPermission + * The following table lists all the possible {@code AWTPermission} * target names, and for each provides a description of what the * permission allows and a discussion of the risks of granting code * the permission. @@ -125,12 +125,12 @@ import java.security.BasicPermission; * * * replaceKeyboardFocusManager - * Sets the KeyboardFocusManager for + * Sets the {@code KeyboardFocusManager} for * a particular thread. - * When SecurityManager is installed, the invoking + * When {@code SecurityManager} is installed, the invoking * thread must be granted this permission in order to replace - * the current KeyboardFocusManager. If permission - * is not granted, a SecurityException will be thrown. + * the current {@code KeyboardFocusManager}. If permission + * is not granted, a {@code SecurityException} will be thrown. * * * @@ -201,15 +201,15 @@ public final class AWTPermission extends BasicPermission { private static final long serialVersionUID = 8890392402588814465L; /** - * Creates a new AWTPermission with the specified name. - * The name is the symbolic name of the AWTPermission, + * Creates a new {@code AWTPermission} with the specified name. + * The name is the symbolic name of the {@code AWTPermission}, * such as "topLevelWindow", "systemClipboard", etc. An asterisk * may be used to indicate all AWT permissions. * * @param name the name of the AWTPermission * - * @throws NullPointerException if name is null. - * @throws IllegalArgumentException if name is empty. + * @throws NullPointerException if {@code name} is {@code null}. + * @throws IllegalArgumentException if {@code name} is empty. */ public AWTPermission(String name) @@ -218,15 +218,15 @@ public final class AWTPermission extends BasicPermission { } /** - * Creates a new AWTPermission object with the specified name. - * The name is the symbolic name of the AWTPermission, and the - * actions string is currently unused and should be null. + * Creates a new {@code AWTPermission} object with the specified name. + * The name is the symbolic name of the {@code AWTPermission}, and the + * actions string is currently unused and should be {@code null}. * - * @param name the name of the AWTPermission - * @param actions should be null + * @param name the name of the {@code AWTPermission} + * @param actions should be {@code null} * - * @throws NullPointerException if name is null. - * @throws IllegalArgumentException if name is empty. + * @throws NullPointerException if {@code name} is {@code null}. + * @throws IllegalArgumentException if {@code name} is empty. */ public AWTPermission(String name, String actions) diff --git a/jdk/src/java.desktop/share/classes/java/awt/ActiveEvent.java b/jdk/src/java.desktop/share/classes/java/awt/ActiveEvent.java index e7dbd875938..857eea54668 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/ActiveEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/ActiveEvent.java @@ -28,19 +28,19 @@ package java.awt; /** * An interface for events that know how to dispatch themselves. * By implementing this interface an event can be placed upon the event - * queue and its dispatch() method will be called when the event - * is dispatched, using the EventDispatchThread. + * queue and its {@code dispatch()} method will be called when the event + * is dispatched, using the {@code EventDispatchThread}. *

        * This is a very useful mechanism for avoiding deadlocks. If * a thread is executing in a critical section (i.e., it has entered * one or more monitors), calling other synchronized code may * cause deadlocks. To avoid the potential deadlocks, an - * ActiveEvent can be created to run the second section of + * {@code ActiveEvent} can be created to run the second section of * code at later time. If there is contention on the monitor, * the second thread will simply block until the first thread * has finished its work and exited its monitors. *

        - * For security reasons, it is often desirable to use an ActiveEvent + * For security reasons, it is often desirable to use an {@code ActiveEvent} * to avoid calling untrusted code from a critical thread. For * instance, peer implementations can use this facility to avoid * making calls into user code from a system thread. Doing so avoids diff --git a/jdk/src/java.desktop/share/classes/java/awt/Adjustable.java b/jdk/src/java.desktop/share/classes/java/awt/Adjustable.java index 6193a07c965..916dbf0b28f 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Adjustable.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Adjustable.java @@ -39,25 +39,25 @@ import java.lang.annotation.Native; public interface Adjustable { /** - * Indicates that the Adjustable has horizontal orientation. + * Indicates that the {@code Adjustable} has horizontal orientation. */ @Native public static final int HORIZONTAL = 0; /** - * Indicates that the Adjustable has vertical orientation. + * Indicates that the {@code Adjustable} has vertical orientation. */ @Native public static final int VERTICAL = 1; /** - * Indicates that the Adjustable has no orientation. + * Indicates that the {@code Adjustable} has no orientation. */ @Native public static final int NO_ORIENTATION = 2; /** * Gets the orientation of the adjustable object. * @return the orientation of the adjustable object; - * either HORIZONTAL, VERTICAL, - * or NO_ORIENTATION + * either {@code HORIZONTAL}, {@code VERTICAL}, + * or {@code NO_ORIENTATION} */ int getOrientation(); @@ -124,15 +124,15 @@ public interface Adjustable { /** * Sets the current value of the adjustable object. If - * the value supplied is less than minimum - * or greater than maximum - visibleAmount, + * the value supplied is less than {@code minimum} + * or greater than {@code maximum} - {@code visibleAmount}, * then one of those values is substituted, as appropriate. *

        * Calling this method does not fire an - * AdjustmentEvent. + * {@code AdjustmentEvent}. * - * @param v the current value, between minimum - * and maximum - visibleAmount + * @param v the current value, between {@code minimum} + * and {@code maximum} - {@code visibleAmount} */ void setValue(int v); diff --git a/jdk/src/java.desktop/share/classes/java/awt/AlphaComposite.java b/jdk/src/java.desktop/share/classes/java/awt/AlphaComposite.java index 1c5b7426986..dc650632d08 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/AlphaComposite.java +++ b/jdk/src/java.desktop/share/classes/java/awt/AlphaComposite.java @@ -30,7 +30,7 @@ import java.lang.annotation.Native; import sun.java2d.SunCompositeContext; /** - * The AlphaComposite class implements basic alpha + * The {@code AlphaComposite} class implements basic alpha * compositing rules for combining source and destination colors * to achieve blending and transparency effects with graphics and * images. @@ -44,7 +44,7 @@ import sun.java2d.SunCompositeContext; *

        * This class extends the standard equations defined by Porter and * Duff to include one additional factor. - * An instance of the AlphaComposite class can contain + * An instance of the {@code AlphaComposite} class can contain * an alpha value that is used to modify the opacity or coverage of * every source pixel before it is used in the blending equations. * @@ -52,7 +52,7 @@ import sun.java2d.SunCompositeContext; * It is important to note that the equations defined by the Porter * and Duff paper are all defined to operate on color components * that are premultiplied by their corresponding alpha components. - * Since the ColorModel and Raster classes + * Since the {@code ColorModel} and {@code Raster} classes * allow the storage of pixel data in either premultiplied or * non-premultiplied form, all input data must be normalized into * premultiplied form before applying the equations and all results @@ -96,7 +96,7 @@ import sun.java2d.SunCompositeContext; * that specify visual effects. * For example, * the description for - * SRC_OVER + * {@code SRC_OVER} * specifies that Fs = 1 and Fd = (1-As). * Once a set of equations for determining the blending factors is * known they can then be applied to each pixel to produce a result @@ -128,12 +128,12 @@ import sun.java2d.SunCompositeContext; *

        Preparing Inputs

        * *

        - * The AlphaComposite class defines an additional alpha + * The {@code AlphaComposite} class defines an additional alpha * value that is applied to the source alpha. * This value is applied as if an implicit SRC_IN rule were first * applied to the source pixel against a pixel with the indicated * alpha by multiplying both the raw source alpha and the raw - * source colors by the alpha in the AlphaComposite. + * source colors by the alpha in the {@code AlphaComposite}. * This leads to the following equation for producing the alpha * used in the Porter and Duff blending equation: * @@ -141,7 +141,7 @@ import sun.java2d.SunCompositeContext; * As = Asr * Aac * * All of the raw source color components need to be multiplied - * by the alpha in the AlphaComposite instance. + * by the alpha in the {@code AlphaComposite} instance. * Additionally, if the source was not in premultiplied form * then the color components also need to be multiplied by the * source alpha. @@ -196,11 +196,11 @@ import sun.java2d.SunCompositeContext; * *

        * For performance reasons, it is preferable that - * Raster objects passed to the compose + * {@code Raster} objects passed to the {@code compose} * method of a {@link CompositeContext} object created by the - * AlphaComposite class have premultiplied data. - * If either the source Raster - * or the destination Raster + * {@code AlphaComposite} class have premultiplied data. + * If either the source {@code Raster} + * or the destination {@code Raster} * is not premultiplied, however, * appropriate conversions are performed before and after the compositing * operation. @@ -210,7 +210,7 @@ import sun.java2d.SunCompositeContext; *

          *
        • * Many sources, such as some of the opaque image types listed - * in the BufferedImage class, do not store alpha values + * in the {@code BufferedImage} class, do not store alpha values * for their pixels. Such sources supply an alpha of 1.0 for * all of their pixels. * @@ -237,7 +237,7 @@ import sun.java2d.SunCompositeContext; * that does not separately store * color components is not a * good candidate for any type of translucent blending. - * For example, BufferedImage.TYPE_BYTE_INDEXED + * For example, {@code BufferedImage.TYPE_BYTE_INDEXED} * should not be used as a destination for a blending operation * because every operation * can introduce large errors, due to @@ -277,7 +277,7 @@ import sun.java2d.SunCompositeContext; *

          * If integer math were being used and this value were being * composited in - * SRC + * {@code SRC} * mode with no extra alpha, then the math would * indicate that the results were (in integer format): * @@ -510,21 +510,21 @@ public final class AlphaComposite implements Composite { @Native public static final int XOR = 12; /** - * AlphaComposite object that implements the opaque CLEAR rule + * {@code AlphaComposite} object that implements the opaque CLEAR rule * with an alpha of 1.0f. * @see #CLEAR */ public static final AlphaComposite Clear = new AlphaComposite(CLEAR); /** - * AlphaComposite object that implements the opaque SRC rule + * {@code AlphaComposite} object that implements the opaque SRC rule * with an alpha of 1.0f. * @see #SRC */ public static final AlphaComposite Src = new AlphaComposite(SRC); /** - * AlphaComposite object that implements the opaque DST rule + * {@code AlphaComposite} object that implements the opaque DST rule * with an alpha of 1.0f. * @see #DST * @since 1.4 @@ -532,49 +532,49 @@ public final class AlphaComposite implements Composite { public static final AlphaComposite Dst = new AlphaComposite(DST); /** - * AlphaComposite object that implements the opaque SRC_OVER rule + * {@code AlphaComposite} object that implements the opaque SRC_OVER rule * with an alpha of 1.0f. * @see #SRC_OVER */ public static final AlphaComposite SrcOver = new AlphaComposite(SRC_OVER); /** - * AlphaComposite object that implements the opaque DST_OVER rule + * {@code AlphaComposite} object that implements the opaque DST_OVER rule * with an alpha of 1.0f. * @see #DST_OVER */ public static final AlphaComposite DstOver = new AlphaComposite(DST_OVER); /** - * AlphaComposite object that implements the opaque SRC_IN rule + * {@code AlphaComposite} object that implements the opaque SRC_IN rule * with an alpha of 1.0f. * @see #SRC_IN */ public static final AlphaComposite SrcIn = new AlphaComposite(SRC_IN); /** - * AlphaComposite object that implements the opaque DST_IN rule + * {@code AlphaComposite} object that implements the opaque DST_IN rule * with an alpha of 1.0f. * @see #DST_IN */ public static final AlphaComposite DstIn = new AlphaComposite(DST_IN); /** - * AlphaComposite object that implements the opaque SRC_OUT rule + * {@code AlphaComposite} object that implements the opaque SRC_OUT rule * with an alpha of 1.0f. * @see #SRC_OUT */ public static final AlphaComposite SrcOut = new AlphaComposite(SRC_OUT); /** - * AlphaComposite object that implements the opaque DST_OUT rule + * {@code AlphaComposite} object that implements the opaque DST_OUT rule * with an alpha of 1.0f. * @see #DST_OUT */ public static final AlphaComposite DstOut = new AlphaComposite(DST_OUT); /** - * AlphaComposite object that implements the opaque SRC_ATOP rule + * {@code AlphaComposite} object that implements the opaque SRC_ATOP rule * with an alpha of 1.0f. * @see #SRC_ATOP * @since 1.4 @@ -582,7 +582,7 @@ public final class AlphaComposite implements Composite { public static final AlphaComposite SrcAtop = new AlphaComposite(SRC_ATOP); /** - * AlphaComposite object that implements the opaque DST_ATOP rule + * {@code AlphaComposite} object that implements the opaque DST_ATOP rule * with an alpha of 1.0f. * @see #DST_ATOP * @since 1.4 @@ -590,7 +590,7 @@ public final class AlphaComposite implements Composite { public static final AlphaComposite DstAtop = new AlphaComposite(DST_ATOP); /** - * AlphaComposite object that implements the opaque XOR rule + * {@code AlphaComposite} object that implements the opaque XOR rule * with an alpha of 1.0f. * @see #XOR * @since 1.4 @@ -620,11 +620,11 @@ public final class AlphaComposite implements Composite { } /** - * Creates an AlphaComposite object with the specified rule. + * Creates an {@code AlphaComposite} object with the specified rule. * * @param rule the compositing rule * @return the {@code AlphaComposite} object created - * @throws IllegalArgumentException if rule is not one of + * @throws IllegalArgumentException if {@code rule} is not one of * the following: {@link #CLEAR}, {@link #SRC}, {@link #DST}, * {@link #SRC_OVER}, {@link #DST_OVER}, {@link #SRC_IN}, * {@link #DST_IN}, {@link #SRC_OUT}, {@link #DST_OUT}, @@ -662,19 +662,19 @@ public final class AlphaComposite implements Composite { } /** - * Creates an AlphaComposite object with the specified rule and + * Creates an {@code AlphaComposite} object with the specified rule and * the constant alpha to multiply with the alpha of the source. * The source is multiplied with the specified alpha before being composited * with the destination. * * @param rule the compositing rule * @param alpha the constant alpha to be multiplied with the alpha of - * the source. alpha must be a floating point number in the + * the source. {@code alpha} must be a floating point number in the * inclusive range [0.0, 1.0]. * @return the {@code AlphaComposite} object created * @throws IllegalArgumentException if - * alpha is less than 0.0 or greater than 1.0, or if - * rule is not one of + * {@code alpha} is less than 0.0 or greater than 1.0, or if + * {@code rule} is not one of * the following: {@link #CLEAR}, {@link #SRC}, {@link #DST}, * {@link #SRC_OVER}, {@link #DST_OVER}, {@link #SRC_IN}, * {@link #DST_IN}, {@link #SRC_OUT}, {@link #DST_OUT}, @@ -692,8 +692,8 @@ public final class AlphaComposite implements Composite { * The context contains state that is used in performing * the compositing operation. * @param srcColorModel the {@link ColorModel} of the source - * @param dstColorModel the ColorModel of the destination - * @return the CompositeContext object to be used to perform + * @param dstColorModel the {@code ColorModel} of the destination + * @return the {@code CompositeContext} object to be used to perform * compositing operations. */ public CompositeContext createContext(ColorModel srcColorModel, @@ -703,32 +703,32 @@ public final class AlphaComposite implements Composite { } /** - * Returns the alpha value of this AlphaComposite. If this - * AlphaComposite does not have an alpha value, 1.0 is returned. - * @return the alpha value of this AlphaComposite. + * Returns the alpha value of this {@code AlphaComposite}. If this + * {@code AlphaComposite} does not have an alpha value, 1.0 is returned. + * @return the alpha value of this {@code AlphaComposite}. */ public float getAlpha() { return extraAlpha; } /** - * Returns the compositing rule of this AlphaComposite. - * @return the compositing rule of this AlphaComposite. + * Returns the compositing rule of this {@code AlphaComposite}. + * @return the compositing rule of this {@code AlphaComposite}. */ public int getRule() { return rule; } /** - * Returns a similar AlphaComposite object that uses + * Returns a similar {@code AlphaComposite} object that uses * the specified compositing rule. * If this object already uses the specified compositing rule, * this object is returned. - * @return an AlphaComposite object derived from + * @return an {@code AlphaComposite} object derived from * this object that uses the specified compositing rule. * @param rule the compositing rule * @throws IllegalArgumentException if - * rule is not one of + * {@code rule} is not one of * the following: {@link #CLEAR}, {@link #SRC}, {@link #DST}, * {@link #SRC_OVER}, {@link #DST_OVER}, {@link #SRC_IN}, * {@link #DST_IN}, {@link #SRC_OUT}, {@link #DST_OUT}, @@ -742,17 +742,17 @@ public final class AlphaComposite implements Composite { } /** - * Returns a similar AlphaComposite object that uses + * Returns a similar {@code AlphaComposite} object that uses * the specified alpha value. * If this object already has the specified alpha value, * this object is returned. - * @return an AlphaComposite object derived from + * @return an {@code AlphaComposite} object derived from * this object that uses the specified alpha value. * @param alpha the constant alpha to be multiplied with the alpha of - * the source. alpha must be a floating point number in the + * the source. {@code alpha} must be a floating point number in the * inclusive range [0.0, 1.0]. * @throws IllegalArgumentException if - * alpha is less than 0.0 or greater than 1.0 + * {@code alpha} is less than 0.0 or greater than 1.0 * @since 1.6 */ public AlphaComposite derive(float alpha) { @@ -771,16 +771,16 @@ public final class AlphaComposite implements Composite { /** * Determines whether the specified object is equal to this - * AlphaComposite. + * {@code AlphaComposite}. *

          - * The result is true if and only if - * the argument is not null and is an - * AlphaComposite object that has the same + * The result is {@code true} if and only if + * the argument is not {@code null} and is an + * {@code AlphaComposite} object that has the same * compositing rule and alpha value as this object. * - * @param obj the Object to test for equality - * @return true if obj equals this - * AlphaComposite; false otherwise. + * @param obj the {@code Object} to test for equality + * @return {@code true} if {@code obj} equals this + * {@code AlphaComposite}; {@code false} otherwise. */ public boolean equals(Object obj) { if (!(obj instanceof AlphaComposite)) { diff --git a/jdk/src/java.desktop/share/classes/java/awt/BorderLayout.java b/jdk/src/java.desktop/share/classes/java/awt/BorderLayout.java index 4720e895892..4b23f936ad3 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/BorderLayout.java +++ b/jdk/src/java.desktop/share/classes/java/awt/BorderLayout.java @@ -33,8 +33,8 @@ import java.util.Hashtable; * north, south, east, west, and center. * Each region may contain no more than one component, and * is identified by a corresponding constant: - * NORTH, SOUTH, EAST, - * WEST, and CENTER. When adding a + * {@code NORTH}, {@code SOUTH}, {@code EAST}, + * {@code WEST}, and {@code CENTER}. When adding a * component to a container with a border layout, use one of these * five constants, for example: *

          @@ -42,55 +42,55 @@ import java.util.Hashtable;
            *    p.setLayout(new BorderLayout());
            *    p.add(new Button("Okay"), BorderLayout.SOUTH);
            * 
          - * As a convenience, BorderLayout interprets the + * As a convenience, {@code BorderLayout} interprets the * absence of a string specification the same as the constant - * CENTER: + * {@code CENTER}: *
            *    Panel p2 = new Panel();
            *    p2.setLayout(new BorderLayout());
            *    p2.add(new TextArea());  // Same as p.add(new TextArea(), BorderLayout.CENTER);
            * 
          *

          - * In addition, BorderLayout supports the relative - * positioning constants, PAGE_START, PAGE_END, - * LINE_START, and LINE_END. - * In a container whose ComponentOrientation is set to - * ComponentOrientation.LEFT_TO_RIGHT, these constants map to - * NORTH, SOUTH, WEST, and - * EAST, respectively. + * In addition, {@code BorderLayout} supports the relative + * positioning constants, {@code PAGE_START}, {@code PAGE_END}, + * {@code LINE_START}, and {@code LINE_END}. + * In a container whose {@code ComponentOrientation} is set to + * {@code ComponentOrientation.LEFT_TO_RIGHT}, these constants map to + * {@code NORTH}, {@code SOUTH}, {@code WEST}, and + * {@code EAST}, respectively. *

          - * For compatibility with previous releases, BorderLayout - * also includes the relative positioning constants BEFORE_FIRST_LINE, - * AFTER_LAST_LINE, BEFORE_LINE_BEGINS and - * AFTER_LINE_ENDS. These are equivalent to - * PAGE_START, PAGE_END, LINE_START - * and LINE_END respectively. For + * For compatibility with previous releases, {@code BorderLayout} + * also includes the relative positioning constants {@code BEFORE_FIRST_LINE}, + * {@code AFTER_LAST_LINE}, {@code BEFORE_LINE_BEGINS} and + * {@code AFTER_LINE_ENDS}. These are equivalent to + * {@code PAGE_START}, {@code PAGE_END}, {@code LINE_START} + * and {@code LINE_END} respectively. For * consistency with the relative positioning constants used by other * components, the latter constants are preferred. *

          * Mixing both absolute and relative positioning constants can lead to * unpredictable results. If * you use both types, the relative constants will take precedence. - * For example, if you add components using both the NORTH - * and PAGE_START constants in a container whose - * orientation is LEFT_TO_RIGHT, only the - * PAGE_START will be laid out. + * For example, if you add components using both the {@code NORTH} + * and {@code PAGE_START} constants in a container whose + * orientation is {@code LEFT_TO_RIGHT}, only the + * {@code PAGE_START} will be laid out. *

          * NOTE: Currently (in the Java 2 platform v1.2), - * BorderLayout does not support vertical - * orientations. The isVertical setting on the container's - * ComponentOrientation is not respected. + * {@code BorderLayout} does not support vertical + * orientations. The {@code isVertical} setting on the container's + * {@code ComponentOrientation} is not respected. *

          * The components are laid out according to their * preferred sizes and the constraints of the container's size. - * The NORTH and SOUTH components may - * be stretched horizontally; the EAST and - * WEST components may be stretched vertically; - * the CENTER component may stretch both horizontally + * The {@code NORTH} and {@code SOUTH} components may + * be stretched horizontally; the {@code EAST} and + * {@code WEST} components may be stretched vertically; + * the {@code CENTER} component may stretch both horizontally * and vertically to fill any space left over. *

          * Here is an example of five buttons in an applet laid out using - * the BorderLayout layout manager: + * the {@code BorderLayout} layout manager: *

          * Diagram of an applet demonstrating BorderLayout.
@@ -126,7 +126,7 @@ public class BorderLayout implements LayoutManager2,
     /**
      * Constructs a border layout with the horizontal gaps
      * between components.
-     * The horizontal gap is specified by <code>hgap</code>.
+     * The horizontal gap is specified by {@code hgap}.
      *
      * @see #getHgap()
      * @see #setHgap(int)
@@ -138,7 +138,7 @@ public class BorderLayout implements LayoutManager2,
     /**
      * Constructs a border layout with the vertical gaps
      * between components.
-     * The vertical gap is specified by <code>vgap</code>.
+     * The vertical gap is specified by {@code vgap}.
      *
      * @see #getVgap()
      * @see #setVgap(int)
@@ -208,10 +208,10 @@ public class BorderLayout implements LayoutManager2,
      * north, south, east, west or center.
      * mixing the two types of constants can lead to unpredictable results.  If
      * you use both types, the relative constants will take precedence.
-     * For example, if you add components using both the <code>NORTH</code>
-     * and <code>BEFORE_FIRST_LINE</code> constants in a container whose
-     * orientation is <code>LEFT_TO_RIGHT</code>, only the
-     * <code>BEFORE_FIRST_LINE</code> will be laid out.
+     * For example, if you add components using both the {@code NORTH}
+     * and {@code BEFORE_FIRST_LINE} constants in a container whose
+     * orientation is {@code LEFT_TO_RIGHT}, only the
+     * {@code BEFORE_FIRST_LINE} will be laid out.
      * This will be the same for lastLine, firstItem, lastItem.
      * @serial
      */
@@ -355,8 +355,8 @@ public class BorderLayout implements LayoutManager2,
     /**
      * Constructs a border layout with the specified gaps
      * between components.
-     * The horizontal gap is specified by <code>hgap</code>
-     * and the vertical gap is specified by <code>vgap</code>.
+     * The horizontal gap is specified by {@code hgap}
+     * and the vertical gap is specified by {@code vgap}.
      * @param   hgap   the horizontal gap.
      * @param   vgap   the vertical gap.
      */
@@ -408,13 +408,13 @@ public class BorderLayout implements LayoutManager2,
     /**
      * Adds the specified component to the layout, using the specified
      * constraint object.  For border layouts, the constraint must be
-     * one of the following constants:  <code>NORTH</code>,
-     * <code>SOUTH</code>, <code>EAST</code>,
-     * <code>WEST</code>, or <code>CENTER</code>.
+     * one of the following constants:  {@code NORTH},
+     * {@code SOUTH}, {@code EAST},
+     * {@code WEST}, or {@code CENTER}.
      * <p>
      * Most applications do not call this method directly. This method
      * is called when a component is added to a container using the
-     * <code>Container.add</code> method with the same argument types.
+     * {@code Container.add} method with the same argument types.
      * @param   comp         the component to be added.
      * @param   constraints  an object that specifies how and where
      *                       the component is added to the layout.
@@ -434,7 +434,7 @@ public class BorderLayout implements LayoutManager2,
     }
 
     /**
-     * @deprecated  replaced by <code>addLayoutComponent(Component, Object)</code>.
+     * @deprecated  replaced by {@code addLayoutComponent(Component, Object)}.
      */
     @Deprecated
     public void addLayoutComponent(String name, Component comp) {
@@ -472,8 +472,8 @@ public class BorderLayout implements LayoutManager2,
 
     /**
      * Removes the specified component from this border layout. This
-     * method is called when a container calls its <code>remove</code> or
-     * <code>removeAll</code> methods. Most applications do not call this
+     * method is called when a container calls its {@code remove} or
+     * {@code removeAll} methods. Most applications do not call this
      * method directly.
      * @param   comp   the component to be removed.
      * @see     java.awt.Container#remove(java.awt.Component)
@@ -507,12 +507,12 @@ public class BorderLayout implements LayoutManager2,
     /**
      * Gets the component that was added using the given constraint
      *
-     * @param   constraints  the desired constraint, one of <code>CENTER</code>,
-     *                       <code>NORTH</code>, <code>SOUTH</code>,
-     *                       <code>WEST</code>, <code>EAST</code>,
-     *                       <code>PAGE_START</code>, <code>PAGE_END</code>,
-     *                       <code>LINE_START</code>, <code>LINE_END</code>
-     * @return  the component at the given location, or <code>null</code> if
+     * @param   constraints  the desired constraint, one of {@code CENTER},
+     *                       {@code NORTH}, {@code SOUTH},
+     *                       {@code WEST}, {@code EAST},
+     *                       {@code PAGE_START}, {@code PAGE_END},
+     *                       {@code LINE_START}, {@code LINE_END}
+     * @return  the component at the given location, or {@code null} if
      *          the location is empty
      * @exception   IllegalArgumentException  if the constraint object is
      *              not one of the nine specified constants
@@ -546,21 +546,21 @@ public class BorderLayout implements LayoutManager2,
 
     /**
      * Returns the component that corresponds to the given constraint location
-     * based on the target <code>Container</code>'s component orientation.
-     * Components added with the relative constraints <code>PAGE_START</code>,
-     * <code>PAGE_END</code>, <code>LINE_START</code>, and <code>LINE_END</code>
+     * based on the target {@code Container}'s component orientation.
+     * Components added with the relative constraints {@code PAGE_START},
+     * {@code PAGE_END}, {@code LINE_START}, and {@code LINE_END}
      * take precedence over components added with the explicit constraints
-     * <code>NORTH</code>, <code>SOUTH</code>, <code>WEST</code>, and <code>EAST</code>.
-     * The <code>Container</code>'s component orientation is used to determine the location of components
-     * added with <code>LINE_START</code> and <code>LINE_END</code>.
+     * {@code NORTH}, {@code SOUTH}, {@code WEST}, and {@code EAST}.
+     * The {@code Container}'s component orientation is used to determine the location of components
+     * added with {@code LINE_START} and {@code LINE_END}.
      *
-     * @param   constraints     the desired absolute position, one of <code>CENTER</code>,
-     *                          <code>NORTH</code>, <code>SOUTH</code>,
-     *                          <code>EAST</code>, <code>WEST</code>
+     * @param   constraints     the desired absolute position, one of {@code CENTER},
+     *                          {@code NORTH}, {@code SOUTH},
+     *                          {@code EAST}, {@code WEST}
      * @param   target     the {@code Container} used to obtain
      *                     the constraint location based on the target
      *                     {@code Container}'s component orientation.
-     * @return  the component at the given location, or <code>null</code> if
+     * @return  the component at the given location, or {@code null} if
      *          the location is empty
      * @exception   IllegalArgumentException  if the constraint object is
      *              not one of the five specified constants
@@ -634,11 +634,11 @@ public class BorderLayout implements LayoutManager2,
     }
 
     /**
-     * Determines the minimum size of the <code>target</code> container
+     * Determines the minimum size of the {@code target} container
      * using this layout manager.
      * <p>
      * This method is called when a container calls its
-     * <code>getMinimumSize</code> method. Most applications do not call
+     * {@code getMinimumSize} method. Most applications do not call
      * this method directly.
      * @param   target   the container in which to do the layout.
      * @return  the minimum dimensions needed to lay out the subcomponents
@@ -689,12 +689,12 @@ public class BorderLayout implements LayoutManager2,
     }
 
     /**
-     * Determines the preferred size of the <code>target</code>
+     * Determines the preferred size of the {@code target}
      * container using this layout manager, based on the components
      * in the container.
      * <p>
      * Most applications do not call this method directly. This method
-     * is called when a container calls its <code>getPreferredSize</code>
+     * is called when a container calls its {@code getPreferredSize}
      * method.
      * @param   target   the container in which to do the layout.
      * @return  the preferred dimensions to lay out the subcomponents
@@ -790,16 +790,16 @@ public class BorderLayout implements LayoutManager2,
      * <p>
      * This method actually reshapes the components in the specified
      * container in order to satisfy the constraints of this
-     * <code>BorderLayout</code> object. The <code>NORTH</code>
-     * and <code>SOUTH</code> components, if any, are placed at
+     * {@code BorderLayout} object. The {@code NORTH}
+     * and {@code SOUTH} components, if any, are placed at
      * the top and bottom of the container, respectively. The
-     * <code>WEST</code> and <code>EAST</code> components are
+     * {@code WEST} and {@code EAST} components are
      * then placed on the left and right, respectively. Finally,
-     * the <code>CENTER</code> object is placed in any remaining
+     * the {@code CENTER} object is placed in any remaining
      * space in the middle.
      * <p>
      * Most applications do not call this method directly. This method
-     * is called when a container calls its <code>doLayout</code> method.
+     * is called when a container calls its {@code doLayout} method.
      * @param   target   the container in which to do the layout.
      * @see     java.awt.Container
      * @see     java.awt.Container#doLayout()
diff --git a/jdk/src/java.desktop/share/classes/java/awt/BufferCapabilities.java b/jdk/src/java.desktop/share/classes/java/awt/BufferCapabilities.java
index 2da7ac335bc..1b3b5576d83 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/BufferCapabilities.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/BufferCapabilities.java
@@ -42,13 +42,13 @@ public class BufferCapabilities implements Cloneable {
     /**
      * Creates a new object for specifying buffering capabilities
      * @param frontCaps the capabilities of the front buffer; cannot be
-     * <code>null</code>
+     * {@code null}
      * @param backCaps the capabilities of the back and intermediate buffers;
-     * cannot be <code>null</code>
+     * cannot be {@code null}
      * @param flipContents the contents of the back buffer after page-flipping,
-     * <code>null</code> if page flipping is not used (implies blitting)
+     * {@code null} if page flipping is not used (implies blitting)
      * @exception IllegalArgumentException if frontCaps or backCaps are
-     * <code>null</code>
+     * {@code null}
      */
     public BufferCapabilities(ImageCapabilities frontCaps,
         ImageCapabilities backCaps, FlipContents flipContents) {
@@ -83,8 +83,8 @@ public class BufferCapabilities implements Cloneable {
      * more back buffers by switching the video pointer (or by copying memory
      * internally).  A non-flipping set of
      * buffers uses blitting to copy the contents from one buffer to
-     * another; when this is the case, <code>getFlipContents</code> returns
-     * <code>null</code>
+     * another; when this is the case, {@code getFlipContents} returns
+     * {@code null}
      */
     public boolean isPageFlipping() {
         return (getFlipContents() != null);
@@ -92,12 +92,12 @@ public class BufferCapabilities implements Cloneable {
 
     /**
      * @return the resulting contents of the back buffer after page-flipping.
-     * This value is <code>null</code> when the <code>isPageFlipping</code>
-     * returns <code>false</code>, implying blitting.  It can be one of
-     * <code>FlipContents.UNDEFINED</code>
-     * (the assumed default), <code>FlipContents.BACKGROUND</code>,
-     * <code>FlipContents.PRIOR</code>, or
-     * <code>FlipContents.COPIED</code>.
+     * This value is {@code null} when the {@code isPageFlipping}
+     * returns {@code false}, implying blitting.  It can be one of
+     * {@code FlipContents.UNDEFINED}
+     * (the assumed default), {@code FlipContents.BACKGROUND},
+     * {@code FlipContents.PRIOR}, or
+     * {@code FlipContents.COPIED}.
      * @see #isPageFlipping
      * @see FlipContents#UNDEFINED
      * @see FlipContents#BACKGROUND
@@ -110,7 +110,7 @@ public class BufferCapabilities implements Cloneable {
 
     /**
      * @return whether page flipping is only available in full-screen mode.  If this
-     * is <code>true</code>, full-screen exclusive mode is required for
+     * is {@code true}, full-screen exclusive mode is required for
      * page-flipping.
      * @see #isPageFlipping
      * @see GraphicsDevice#setFullScreenWindow
@@ -158,7 +158,7 @@ public class BufferCapabilities implements Cloneable {
             { UNDEFINED, the + * When flip contents are {@code UNDEFINED}, the * contents of the back buffer are undefined after flipping. * @see #isPageFlipping * @see #getFlipContents @@ -170,7 +170,7 @@ public class BufferCapabilities implements Cloneable { new FlipContents(I_UNDEFINED); /** - * When flip contents are BACKGROUND, the + * When flip contents are {@code BACKGROUND}, the * contents of the back buffer are cleared with the background color after * flipping. * @see #isPageFlipping @@ -183,7 +183,7 @@ public class BufferCapabilities implements Cloneable { new FlipContents(I_BACKGROUND); /** - * When flip contents are PRIOR, the + * When flip contents are {@code PRIOR}, the * contents of the back buffer are the prior contents of the front buffer * (a true page flip). * @see #isPageFlipping @@ -196,7 +196,7 @@ public class BufferCapabilities implements Cloneable { new FlipContents(I_PRIOR); /** - * When flip contents are COPIED, the + * When flip contents are {@code COPIED}, the * contents of the back buffer are copied to the front buffer when * flipping. * @see #isPageFlipping diff --git a/jdk/src/java.desktop/share/classes/java/awt/Button.java b/jdk/src/java.desktop/share/classes/java/awt/Button.java index faa8068cf8c..66cbc8cbbe9 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Button.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Button.java @@ -37,7 +37,7 @@ import javax.accessibility.*; /** * This class creates a labeled button. The application can cause * some action to happen when the button is pushed. This image - * depicts three views of a "Quit" button as it appears + * depicts three views of a "{@code Quit}" button as it appears * under the Solaris operating system: *

          * The following context describes the graphic * The gesture of clicking on a button with the mouse - * is associated with one instance of ActionEvent, + * is associated with one instance of {@code ActionEvent}, * which is sent out when the mouse is both pressed and released * over the button. If an application is interested in knowing * when the button has been pressed but not released, as a separate - * gesture, it can specialize processMouseEvent, + * gesture, it can specialize {@code processMouseEvent}, * or it can register itself as a listener for mouse events by - * calling addMouseListener. Both of these methods are - * defined by Component, the abstract superclass of + * calling {@code addMouseListener}. Both of these methods are + * defined by {@code Component}, the abstract superclass of * all components. *

          * When a button is pressed and released, AWT sends an instance - * of ActionEvent to the button, by calling - * processEvent on the button. The button's - * processEvent method receives all events + * of {@code ActionEvent} to the button, by calling + * {@code processEvent} on the button. The button's + * {@code processEvent} method receives all events * for the button; it passes an action event along by - * calling its own processActionEvent method. + * calling its own {@code processActionEvent} method. * The latter method passes the action event on to any action * listeners that have registered an interest in action * events generated by this button. *

          * If an application wants to perform some action based on * a button being pressed and released, it should implement - * ActionListener and register the new listener + * {@code ActionListener} and register the new listener * to receive events from this button, by calling the button's - * addActionListener method. The application can + * {@code addActionListener} method. The application can * make use of the button's action command as a messaging protocol. * * @author Sami Shaio @@ -144,7 +144,7 @@ public class Button extends Component implements Accessible { * Constructs a button with the specified label. * * @param label a string label for the button, or - * null for no label + * {@code null} for no label * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless @@ -182,7 +182,7 @@ public class Button extends Component implements Accessible { /** * Gets the label of this button. * - * @return the button's label, or null + * @return the button's label, or {@code null} * if the button has no label. * @see java.awt.Button#setLabel */ @@ -193,7 +193,7 @@ public class Button extends Component implements Accessible { /** * Sets the button's label to be the specified string. * - * @param label the new label, or null + * @param label the new label, or {@code null} * if the button has no label. * @see java.awt.Button#getLabel */ @@ -225,7 +225,7 @@ public class Button extends Component implements Accessible { * * @param command a string used to set the button's * action command. - * If the string is null then the action command + * If the string is {@code null} then the action command * is set to match the label of the button. * @see java.awt.event.ActionEvent * @since 1.1 @@ -236,7 +236,7 @@ public class Button extends Component implements Accessible { /** * Returns the command name of the action event fired by this button. - * If the command name is null (default) then this method + * If the command name is {@code null} (default) then this method * returns the label of the button. * * @return the action command name (or label) for this button @@ -292,7 +292,7 @@ public class Button extends Component implements Accessible { * Returns an array of all the action listeners * registered on this button. * - * @return all of this button's ActionListeners + * @return all of this button's {@code ActionListener}s * or an empty array if no action * listeners are currently registered * @@ -308,16 +308,16 @@ public class Button extends Component implements Accessible { /** * Returns an array of all the objects currently registered * as FooListeners - * upon this Button. + * upon this {@code Button}. * FooListeners are registered using the * addFooListener method. * *

          - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * Button b + * {@code Button b} * for its action listeners with the following code: * *

          ActionListener[] als = (ActionListener[])(b.getListeners(ActionListener.class));
          @@ -326,14 +326,14 @@ public class Button extends Component implements Accessible { * * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this button, * or an empty array if no such * listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @see #getActionListeners * @since 1.3 @@ -362,10 +362,10 @@ public class Button extends Component implements Accessible { /** * Processes events on this button. If an event is - * an instance of ActionEvent, this method invokes - * the processActionEvent method. Otherwise, - * it invokes processEvent on the superclass. - *

          Note that if the event parameter is null + * an instance of {@code ActionEvent}, this method invokes + * the {@code processActionEvent} method. Otherwise, + * it invokes {@code processEvent} on the superclass. + *

          Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -385,17 +385,17 @@ public class Button extends Component implements Accessible { /** * Processes action events occurring on this button * by dispatching them to any registered - * ActionListener objects. + * {@code ActionListener} objects. *

          * This method is not called unless action events are * enabled for this button. Action events are enabled * when one of the following occurs: *

            - *
          • An ActionListener object is registered - * via addActionListener. - *
          • Action events are enabled via enableEvents. + *
          • An {@code ActionListener} object is registered + * via {@code addActionListener}. + *
          • Action events are enabled via {@code enableEvents}. *
          - *

          Note that if the event parameter is null + *

          Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -413,11 +413,11 @@ public class Button extends Component implements Accessible { } /** - * Returns a string representing the state of this Button. + * Returns a string representing the state of this {@code Button}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this button */ @@ -437,19 +437,19 @@ public class Button extends Component implements Accessible { /** * Writes default serializable fields to stream. Writes - * a list of serializable ActionListeners + * a list of serializable {@code ActionListeners} * as optional data. The non-serializable - * ActionListeners are detected and + * {@code ActionListeners} are detected and * no attempt is made to serialize them. * - * @serialData null terminated sequence of 0 or - * more pairs: the pair consists of a String - * and an Object; the String + * @serialData {@code null} terminated sequence of 0 or + * more pairs: the pair consists of a {@code String} + * and an {@code Object}; the {@code String} * indicates the type of object and is one of the following: - * actionListenerK indicating an - * ActionListener object + * {@code actionListenerK} indicating an + * {@code ActionListener} object * - * @param s the ObjectOutputStream to write + * @param s the {@code ObjectOutputStream} to write * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see java.awt.Component#actionListenerK * @see #readObject(ObjectInputStream) @@ -464,15 +464,15 @@ public class Button extends Component implements Accessible { } /** - * Reads the ObjectInputStream and if - * it isn't null adds a listener to + * Reads the {@code ObjectInputStream} and if + * it isn't {@code null} adds a listener to * receive action events fired by the button. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns - * true + * {@code GraphicsEnvironment.isHeadless} returns + * {@code true} * @serial * @see #removeActionListener(ActionListener) * @see #addActionListener(ActionListener) @@ -503,15 +503,15 @@ public class Button extends Component implements Accessible { //////////////// /** - * Gets the AccessibleContext associated with - * this Button. For buttons, the - * AccessibleContext takes the form of an - * AccessibleAWTButton. - * A new AccessibleAWTButton instance is + * Gets the {@code AccessibleContext} associated with + * this {@code Button}. For buttons, the + * {@code AccessibleContext} takes the form of an + * {@code AccessibleAWTButton}. + * A new {@code AccessibleAWTButton} instance is * created if necessary. * - * @return an AccessibleAWTButton that serves as the - * AccessibleContext of this Button + * @return an {@code AccessibleAWTButton} that serves as the + * {@code AccessibleContext} of this {@code Button} * @since 1.3 */ @BeanProperty(expert = true, description @@ -525,7 +525,7 @@ public class Button extends Component implements Accessible { /** * This class implements accessibility support for the - * Button class. It provides an implementation of the + * {@code Button} class. It provides an implementation of the * Java Accessibility API appropriate to button user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Canvas.java b/jdk/src/java.desktop/share/classes/java/awt/Canvas.java index 166d664a31b..9d1762f0674 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Canvas.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Canvas.java @@ -29,13 +29,13 @@ import java.awt.peer.CanvasPeer; import javax.accessibility.*; /** - * A Canvas component represents a blank rectangular + * A {@code Canvas} component represents a blank rectangular * area of the screen onto which the application can draw or from * which the application can trap input events from the user. *

          - * An application must subclass the Canvas class in + * An application must subclass the {@code Canvas} class in * order to get useful functionality such as creating a custom - * component. The paint method must be overridden + * component. The {@code paint} method must be overridden * in order to perform custom graphics on the canvas. * * @author Sami Shaio @@ -108,7 +108,7 @@ public class Canvas extends Component implements Accessible { /** * Paints this canvas. *

          - * Most applications that subclass Canvas should + * Most applications that subclass {@code Canvas} should * override this method in order to perform some useful operation * (typically, custom painting of the canvas). * The default operation is simply to clear the canvas. @@ -126,10 +126,10 @@ public class Canvas extends Component implements Accessible { /** * Updates this canvas. *

          - * This method is called in response to a call to repaint. + * This method is called in response to a call to {@code repaint}. * The canvas is first cleared by filling it with the background * color, and then completely redrawn by calling this canvas's - * paint method. + * {@code paint} method. * Note: applications that override this method should either call * super.update(g) or incorporate the functionality described * above into their own code. @@ -151,7 +151,7 @@ public class Canvas extends Component implements Accessible { * Creates a new strategy for multi-buffering on this component. * Multi-buffering is useful for rendering performance. This method * attempts to create the best strategy available with the number of - * buffers supplied. It will always create a BufferStrategy + * buffers supplied. It will always create a {@code BufferStrategy} * with that number of buffers. * A page-flipping strategy is attempted first, then a blitting strategy * using accelerated buffers. Finally, an unaccelerated blitting @@ -180,13 +180,13 @@ public class Canvas extends Component implements Accessible { * is called, the existing buffer strategy for this component is discarded. * @param numBuffers number of buffers to create * @param caps the required capabilities for creating the buffer strategy; - * cannot be null + * cannot be {@code null} * @exception AWTException if the capabilities supplied could not be * supported or met; this may happen, for example, if there is not enough * accelerated memory currently available, or if page flipping is specified * but not possible. * @exception IllegalArgumentException if numBuffers is less than 1, or if - * caps is null + * caps is {@code null} * @see #getBufferStrategy * @since 1.4 */ @@ -196,8 +196,8 @@ public class Canvas extends Component implements Accessible { } /** - * Returns the BufferStrategy used by this component. This - * method will return null if a BufferStrategy has not yet + * Returns the {@code BufferStrategy} used by this component. This + * method will return null if a {@code BufferStrategy} has not yet * been created or has been disposed. * * @return the buffer strategy used by this component @@ -232,7 +232,7 @@ public class Canvas extends Component implements Accessible { /** * This class implements accessibility support for the - * Canvas class. It provides an implementation of the + * {@code Canvas} class. It provides an implementation of the * Java Accessibility API appropriate to canvas user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/CardLayout.java b/jdk/src/java.desktop/share/classes/java/awt/CardLayout.java index 9f14d622a15..e7523e1921e 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/CardLayout.java +++ b/jdk/src/java.desktop/share/classes/java/awt/CardLayout.java @@ -36,15 +36,15 @@ import java.io.ObjectStreamField; import java.io.IOException; /** - * A CardLayout object is a layout manager for a + * A {@code CardLayout} object is a layout manager for a * container. It treats each component in the container as a card. * Only one card is visible at a time, and the container acts as * a stack of cards. The first component added to a - * CardLayout object is the visible component when the + * {@code CardLayout} object is the visible component when the * container is first displayed. *

          * The ordering of cards is determined by the container's own internal - * ordering of its component objects. CardLayout + * ordering of its component objects. {@code CardLayout} * defines a set of methods that allow an application to flip * through these cards sequentially, or to show a specified card. * The {@link CardLayout#addLayoutComponent} @@ -188,10 +188,10 @@ public class CardLayout implements LayoutManager2, /** * Adds the specified component to this card layout's internal - * table of names. The object specified by constraints + * table of names. The object specified by {@code constraints} * must be a string. The card layout stores this string as a key-value * pair that can be used for random access to a particular card. - * By calling the show method, an application can + * By calling the {@code show} method, an application can * display the component with the specified name. * @param comp the component to be added. * @param constraints a tag that identifies a particular @@ -214,7 +214,7 @@ public class CardLayout implements LayoutManager2, /** * @deprecated replaced by - * addLayoutComponent(Component, Object). + * {@code addLayoutComponent(Component, Object)}. */ @Deprecated public void addLayoutComponent(String name, Component comp) { @@ -365,7 +365,7 @@ public class CardLayout implements LayoutManager2, /** * Lays out the specified container using this card layout. *

          - * Each component in the parent container is reshaped + * Each component in the {@code parent} container is reshaped * to be the size of the container, minus space for surrounding * insets, horizontal gaps, and vertical gaps. * @@ -515,7 +515,7 @@ public class CardLayout implements LayoutManager2, /** * Flips to the component that was added to this layout with the - * specified name, using addLayoutComponent. + * specified {@code name}, using {@code addLayoutComponent}. * If no such component exists, then nothing happens. * @param parent the parent container in which to do the layout * @param name the component name diff --git a/jdk/src/java.desktop/share/classes/java/awt/Checkbox.java b/jdk/src/java.desktop/share/classes/java/awt/Checkbox.java index 4604b6262a6..bf7f9406158 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Checkbox.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Checkbox.java @@ -35,7 +35,7 @@ import javax.accessibility.*; /** * A check box is a graphical component that can be in either an - * "on" (true) or "off" (false) state. + * "on" ({@code true}) or "off" ({@code false}) state. * Clicking on a check box changes its state from * "on" to "off," or from "off" to "on." *

          @@ -55,14 +55,14 @@ import javax.accessibility.*; * The following context describes the graphic. *

          - * The button labeled one is in the "on" state, and the + * The button labeled {@code one} is in the "on" state, and the * other two are in the "off" state. In this example, which uses the - * GridLayout class, the states of the three check + * {@code GridLayout} class, the states of the three check * boxes are set independently. *

          * Alternatively, several check boxes can be grouped together under * the control of a single object, using the - * CheckboxGroup class. + * {@code CheckboxGroup} class. * In a check box group, at most one button can be in the "on" * state at any given time. Clicking on a check box to turn it on * forces any other check box in the same group that is on @@ -93,7 +93,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { String label; /** - * The state of the Checkbox. + * The state of the {@code Checkbox}. * @serial * @see #getState() * @see #setState(boolean) @@ -150,10 +150,10 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { * any check box group. * * @param label a string label for this check box, - * or null for no label. + * or {@code null} for no label. * @exception HeadlessException if - * GraphicsEnvironment.isHeadless - * returns true + * {@code GraphicsEnvironment.isHeadless} + * returns {@code true} * @see java.awt.GraphicsEnvironment#isHeadless */ public Checkbox(String label) throws HeadlessException { @@ -166,11 +166,11 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { * This check box is not part of any check box group. * * @param label a string label for this check box, - * or null for no label + * or {@code null} for no label * @param state the initial state of this check box * @exception HeadlessException if - * GraphicsEnvironment.isHeadless - * returns true + * {@code GraphicsEnvironment.isHeadless} + * returns {@code true} * @see java.awt.GraphicsEnvironment#isHeadless */ public Checkbox(String label, boolean state) throws HeadlessException { @@ -182,13 +182,13 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { * specified state, and in the specified check box group. * * @param label a string label for this check box, - * or null for no label. + * or {@code null} for no label. * @param state the initial state of this check box. * @param group a check box group for this check box, - * or null for no group. + * or {@code null} for no group. * @exception HeadlessException if - * GraphicsEnvironment.isHeadless - * returns true + * {@code GraphicsEnvironment.isHeadless} + * returns {@code true} * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.1 */ @@ -208,13 +208,13 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { * check box group, and set to the specified state. * * @param label a string label for this check box, - * or null for no label. + * or {@code null} for no label. * @param group a check box group for this check box, - * or null for no group. + * or {@code null} for no group. * @param state the initial state of this check box. * @exception HeadlessException if - * GraphicsEnvironment.isHeadless - * returns true + * {@code GraphicsEnvironment.isHeadless} + * returns {@code true} * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.1 */ @@ -225,7 +225,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * Constructs a name for this component. Called by - * getName when the name is null. + * {@code getName} when the name is {@code null}. * * @return a name for this component */ @@ -252,7 +252,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * Gets the label of this check box. * - * @return the label of this check box, or null + * @return the label of this check box, or {@code null} * if this check box has no label. * @see #setLabel(String) */ @@ -264,7 +264,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { * Sets this check box's label to be the string argument. * * @param label a string to set as the new label, or - * null for no label. + * {@code null} for no label. * @see #getLabel */ public void setLabel(String label) { @@ -290,8 +290,8 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * Determines whether this check box is in the "on" or "off" state. - * The boolean value true indicates the "on" state, - * and false indicates the "off" state. + * The boolean value {@code true} indicates the "on" state, + * and {@code false} indicates the "off" state. * * @return the state of this check box, as a boolean value * @see #setState @@ -302,14 +302,14 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * Sets the state of this check box to the specified state. - * The boolean value true indicates the "on" state, - * and false indicates the "off" state. + * The boolean value {@code true} indicates the "on" state, + * and {@code false} indicates the "off" state. * *

          Note that this method should be primarily used to * initialize the state of the checkbox. Programmatically * setting the state of the checkbox will not trigger - * an ItemEvent. The only way to trigger an - * ItemEvent is by user interaction. + * an {@code ItemEvent}. The only way to trigger an + * {@code ItemEvent} is by user interaction. * * @param state the boolean state of the check box * @see #getState @@ -343,7 +343,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * Determines this check box's group. - * @return this check box's group, or null + * @return this check box's group, or {@code null} * if the check box is not part of a check box group. * @see #setCheckboxGroup(CheckboxGroup) */ @@ -356,14 +356,14 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { * If this check box is already in a different check box group, * it is first taken out of that group. *

          - * If the state of this check box is true and the new + * If the state of this check box is {@code true} and the new * group already has a check box selected, this check box's state - * is changed to false. If the state of this check - * box is true and the new group has no check box + * is changed to {@code false}. If the state of this check + * box is {@code true} and the new group has no check box * selected, this check box becomes the selected checkbox for - * the new group and its state is true. + * the new group and its state is {@code true}. * - * @param g the new check box group, or null + * @param g the new check box group, or {@code null} * to remove this check box from any check box group * @see #getCheckboxGroup */ @@ -458,7 +458,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { * Returns an array of all the item listeners * registered on this checkbox. * - * @return all of this checkbox's ItemListeners + * @return all of this checkbox's {@code ItemListener}s * or an empty array if no item * listeners are currently registered * @@ -475,16 +475,16 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * Returns an array of all the objects currently registered * as FooListeners - * upon this Checkbox. + * upon this {@code Checkbox}. * FooListeners are registered using the * addFooListener method. * *

          - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * Checkbox c + * {@code Checkbox c} * for its item listeners with the following code: * *

          ItemListener[] ils = (ItemListener[])(c.getListeners(ItemListener.class));
          @@ -493,14 +493,14 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { * * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this checkbox, * or an empty array if no such * listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @see #getItemListeners * @since 1.3 @@ -529,10 +529,10 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * Processes events on this check box. - * If the event is an instance of ItemEvent, - * this method invokes the processItemEvent method. - * Otherwise, it calls its superclass's processEvent method. - *

          Note that if the event parameter is null + * If the event is an instance of {@code ItemEvent}, + * this method invokes the {@code processItemEvent} method. + * Otherwise, it calls its superclass's {@code processEvent} method. + *

          Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -552,17 +552,17 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * Processes item events occurring on this check box by * dispatching them to any registered - * ItemListener objects. + * {@code ItemListener} objects. *

          * This method is not called unless item events are * enabled for this component. Item events are enabled * when one of the following occurs: *

            - *
          • An ItemListener object is registered - * via addItemListener. - *
          • Item events are enabled via enableEvents. + *
          • An {@code ItemListener} object is registered + * via {@code addItemListener}. + *
          • Item events are enabled via {@code enableEvents}. *
          - *

          Note that if the event parameter is null + *

          Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -581,11 +581,11 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { } /** - * Returns a string representing the state of this Checkbox. + * Returns a string representing the state of this {@code Checkbox}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this check box */ @@ -610,18 +610,18 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * Writes default serializable fields to stream. Writes - * a list of serializable ItemListeners + * a list of serializable {@code ItemListeners} * as optional data. The non-serializable - * ItemListeners are detected and + * {@code ItemListeners} are detected and * no attempt is made to serialize them. * - * @param s the ObjectOutputStream to write - * @serialData null terminated sequence of 0 - * or more pairs; the pair consists of a String - * and an Object; the String indicates + * @param s the {@code ObjectOutputStream} to write + * @serialData {@code null} terminated sequence of 0 + * or more pairs; the pair consists of a {@code String} + * and an {@code Object}; the {@code String} indicates * the type of object and is one of the following: - * itemListenerK indicating an - * ItemListener object + * {@code itemListenerK} indicating an + * {@code ItemListener} object * * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see java.awt.Component#itemListenerK @@ -637,15 +637,15 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { } /** - * Reads the ObjectInputStream and if it - * isn't null adds a listener to receive - * item events fired by the Checkbox. + * Reads the {@code ObjectInputStream} and if it + * isn't {@code null} adds a listener to receive + * item events fired by the {@code Checkbox}. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns - * true + * {@code GraphicsEnvironment.isHeadless} returns + * {@code true} * @serial * @see #removeItemListener(ItemListener) * @see #addItemListener(ItemListener) @@ -700,7 +700,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * This class implements accessibility support for the - * Checkbox class. It provides an implementation of the + * {@code Checkbox} class. It provides an implementation of the * Java Accessibility API appropriate to checkbox user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/CheckboxMenuItem.java b/jdk/src/java.desktop/share/classes/java/awt/CheckboxMenuItem.java index aba3f37798e..470ad9a17d0 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/CheckboxMenuItem.java +++ b/jdk/src/java.desktop/share/classes/java/awt/CheckboxMenuItem.java @@ -40,20 +40,20 @@ import sun.awt.AWTAccessor; * "on" to "off" or from "off" to "on." *

          * The following picture depicts a menu which contains an instance - * of CheckBoxMenuItem: + * of {@code CheckBoxMenuItem}: *

          * Menu labeled Examples, containing items Basic, Simple, Check, and More Examples. The Check item is a CheckBoxMenuItem instance, in the off state. *

          - * The item labeled Check shows a check box menu item + * The item labeled {@code Check} shows a check box menu item * in its "off" state. *

          * When a check box menu item is selected, AWT sends an item event to - * the item. Since the event is an instance of ItemEvent, - * the processEvent method examines the event and passes - * it along to processItemEvent. The latter method redirects - * the event to any ItemListener objects that have + * the item. Since the event is an instance of {@code ItemEvent}, + * the {@code processEvent} method examines the event and passes + * it along to {@code processItemEvent}. The latter method redirects + * the event to any {@code ItemListener} objects that have * registered an interest in item events generated by this menu item. * * @author Sami Shaio @@ -113,7 +113,7 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access * The item's state is initially set to "off." * @param label a string label for the check box menu item, - * or null for an unlabeled menu item. + * or {@code null} for an unlabeled menu item. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless @@ -125,10 +125,10 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access /** * Create a check box menu item with the specified label and state. * @param label a string label for the check box menu item, - * or null for an unlabeled menu item. + * or {@code null} for an unlabeled menu item. * @param state the initial state of the menu item, where - * true indicates "on" and - * false indicates "off." + * {@code true} indicates "on" and + * {@code false} indicates "off." * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless @@ -170,8 +170,8 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access * is "on" or "off." * * @return the state of this check box menu item, where - * true indicates "on" and - * false indicates "off" + * {@code true} indicates "on" and + * {@code false} indicates "off" * @see #setState */ public boolean getState() { @@ -180,18 +180,18 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access /** * Sets this check box menu item to the specified state. - * The boolean value true indicates "on" while - * false indicates "off." + * The boolean value {@code true} indicates "on" while + * {@code false} indicates "off." * *

          Note that this method should be primarily used to * initialize the state of the check box menu item. * Programmatically setting the state of the check box * menu item will not trigger - * an ItemEvent. The only way to trigger an - * ItemEvent is by user interaction. + * an {@code ItemEvent}. The only way to trigger an + * {@code ItemEvent} is by user interaction. * - * @param b true if the check box - * menu item is on, otherwise false + * @param b {@code true} if the check box + * menu item is on, otherwise {@code false} * @see #getState */ public synchronized void setState(boolean b) { @@ -265,7 +265,7 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access * Returns an array of all the item listeners * registered on this checkbox menuitem. * - * @return all of this checkbox menuitem's ItemListeners + * @return all of this checkbox menuitem's {@code ItemListener}s * or an empty array if no item * listeners are currently registered * @@ -282,16 +282,16 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access /** * Returns an array of all the objects currently registered * as FooListeners - * upon this CheckboxMenuItem. + * upon this {@code CheckboxMenuItem}. * FooListeners are registered using the * addFooListener method. * *

          - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * CheckboxMenuItem c + * {@code CheckboxMenuItem c} * for its item listeners with the following code: * *

          ItemListener[] ils = (ItemListener[])(c.getListeners(ItemListener.class));
          @@ -300,14 +300,14 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access * * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this checkbox menuitem, * or an empty array if no such * listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @see #getItemListeners * @since 1.3 @@ -336,13 +336,13 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access /** * Processes events on this check box menu item. - * If the event is an instance of ItemEvent, - * this method invokes the processItemEvent method. + * If the event is an instance of {@code ItemEvent}, + * this method invokes the {@code processItemEvent} method. * If the event is not an item event, - * it invokes processEvent on the superclass. + * it invokes {@code processEvent} on the superclass. *

          * Check box menu items currently support only item events. - *

          Note that if the event parameter is null + *

          Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -361,17 +361,17 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access /** * Processes item events occurring on this check box menu item by - * dispatching them to any registered ItemListener objects. + * dispatching them to any registered {@code ItemListener} objects. *

          * This method is not called unless item events are * enabled for this menu item. Item events are enabled * when one of the following occurs: *

            - *
          • An ItemListener object is registered - * via addItemListener. - *
          • Item events are enabled via enableEvents. + *
          • An {@code ItemListener} object is registered + * via {@code addItemListener}. + *
          • Item events are enabled via {@code enableEvents}. *
          - *

          Note that if the event parameter is null + *

          Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -403,11 +403,11 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access /** * Returns a string representing the state of this - * CheckBoxMenuItem. This + * {@code CheckBoxMenuItem}. This * method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this check box menu item */ @@ -426,18 +426,18 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access /** * Writes default serializable fields to stream. Writes - * a list of serializable ItemListeners + * a list of serializable {@code ItemListeners} * as optional data. The non-serializable - * ItemListeners are detected and + * {@code ItemListeners} are detected and * no attempt is made to serialize them. * - * @param s the ObjectOutputStream to write - * @serialData null terminated sequence of - * 0 or more pairs; the pair consists of a String - * and an Object; the String indicates + * @param s the {@code ObjectOutputStream} to write + * @serialData {@code null} terminated sequence of + * 0 or more pairs; the pair consists of a {@code String} + * and an {@code Object}; the {@code String} indicates * the type of object and is one of the following: - * itemListenerK indicating an - * ItemListener object + * {@code itemListenerK} indicating an + * {@code ItemListener} object * * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see java.awt.Component#itemListenerK @@ -453,12 +453,12 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access } /* - * Reads the ObjectInputStream and if it - * isn't null adds a listener to receive - * item events fired by the Checkbox menu item. + * Reads the {@code ObjectInputStream} and if it + * isn't {@code null} adds a listener to receive + * item events fired by the {@code Checkbox} menu item. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @serial * @see removeActionListener() * @see addActionListener() @@ -515,7 +515,7 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access * subclassed by menu component developers. *

          * This class implements accessibility support for the - * CheckboxMenuItem class. It provides an implementation + * {@code CheckboxMenuItem} class. It provides an implementation * of the Java Accessibility API appropriate to checkbox menu item * user-interface elements. * @since 1.3 diff --git a/jdk/src/java.desktop/share/classes/java/awt/Choice.java b/jdk/src/java.desktop/share/classes/java/awt/Choice.java index d638e45a7a7..e12beb142c2 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Choice.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Choice.java @@ -36,7 +36,7 @@ import javax.accessibility.*; /** - * The Choice class presents a pop-up menu of choices. + * The {@code Choice} class presents a pop-up menu of choices. * The current choice is displayed as the title of the menu. *

          * The following code example produces a pop-up menu: @@ -54,17 +54,17 @@ import javax.accessibility.*; * The following text describes the graphic *

          - * In the picture, "Green" is the current choice. + * In the picture, {@code "Green"} is the current choice. * Pushing the mouse button down on the object causes a menu to * appear with the current choice highlighted. *

          * Some native platforms do not support arbitrary resizing of - * Choice components and the behavior of - * setSize()/getSize() is bound by + * {@code Choice} components and the behavior of + * {@code setSize()/getSize()} is bound by * such limitations. - * Native GUI Choice components' size are often bound by such + * Native GUI {@code Choice} components' size are often bound by such * attributes as font size and length of items contained within - * the Choice. + * the {@code Choice}. * * @author Sami Shaio * @author Arthur van Hoff @@ -72,8 +72,8 @@ import javax.accessibility.*; */ public class Choice extends Component implements ItemSelectable, Accessible { /** - * The items for the Choice. - * This can be a null value. + * The items for the {@code Choice}. + * This can be a {@code null} value. * @serial * @see #add(String) * @see #addItem(String) @@ -85,7 +85,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { Vector pItems; /** - * The index of the current choice for this Choice + * The index of the current choice for this {@code Choice} * or -1 if nothing is selected. * @serial * @see #getSelectedItem() @@ -117,7 +117,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { *

          * By default, the first item added to the choice menu becomes the * selected item, until a different selection is made by the user - * by calling one of the select methods. + * by calling one of the {@code select} methods. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless @@ -131,7 +131,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Constructs a name for this component. Called by - * getName when the name is null. + * {@code getName} when the name is {@code null}. */ String constructComponentName() { synchronized (Choice.class) { @@ -140,9 +140,9 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Creates the Choice's peer. This peer allows us + * Creates the {@code Choice}'s peer. This peer allows us * to change the look - * of the Choice without changing its functionality. + * of the {@code Choice} without changing its functionality. * @see java.awt.Component#getToolkit() */ public void addNotify() { @@ -154,9 +154,9 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Returns the number of items in this Choice menu. + * Returns the number of items in this {@code Choice} menu. * - * @return the number of items in this Choice menu + * @return the number of items in this {@code Choice} menu * @see #getItem * @since 1.1 */ @@ -169,7 +169,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { * * @return the number of items in this {@code Choice} menu * @deprecated As of JDK version 1.1, - * replaced by getItemCount(). + * replaced by {@code getItemCount()}. */ @Deprecated public int countItems() { @@ -178,7 +178,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Gets the string at the specified index in this - * Choice menu. + * {@code Choice} menu. * * @param index the index at which to begin * @return the item at the specified index @@ -197,10 +197,10 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Adds an item to this Choice menu. + * Adds an item to this {@code Choice} menu. * @param item the item to be added * @exception NullPointerException if the item's value is - * null + * {@code null} * @since 1.1 */ public void add(String item) { @@ -209,12 +209,12 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Obsolete as of Java 2 platform v1.1. Please use the - * add method instead. + * {@code add} method instead. *

          - * Adds an item to this Choice menu. + * Adds an item to this {@code Choice} menu. * @param item the item to be added * @exception NullPointerException if the item's value is equal to - * null + * {@code null} */ public void addItem(String item) { synchronized (this) { @@ -226,14 +226,14 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Inserts an item to this Choice, - * but does not invalidate the Choice. + * Inserts an item to this {@code Choice}, + * but does not invalidate the {@code Choice}. * Client methods must provide their own synchronization before * invoking this method. * @param item the item to be added * @param index the new item position * @exception NullPointerException if the item's value is equal to - * null + * {@code null} */ private void insertNoInvalidate(String item, int index) { if (item == null) { @@ -255,10 +255,10 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Inserts the item into this choice at the specified position. * Existing items at an index greater than or equal to - * index are shifted up by one to accommodate - * the new item. If index is greater than or + * {@code index} are shifted up by one to accommodate + * the new item. If {@code index} is greater than or * equal to the number of items in this choice, - * item is added to the end of this choice. + * {@code item} is added to the end of this choice. *

          * If the item is the first one being added to the choice, * then the item becomes selected. Otherwise, if the @@ -266,7 +266,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { * item in the choice becomes the selected item. If the * selected item was no among those shifted, it remains * the selected item. - * @param item the non-null item to be inserted + * @param item the non-{@code null} item to be inserted * @param index the position at which the item should be inserted * @exception IllegalArgumentException if index is less than 0 */ @@ -286,14 +286,14 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Removes the first occurrence of item - * from the Choice menu. If the item + * Removes the first occurrence of {@code item} + * from the {@code Choice} menu. If the item * being removed is the currently selected item, * then the first item in the choice becomes the * selected item. Otherwise, the currently selected * item remains selected (and the selected index is * updated accordingly). - * @param item the item to remove from this Choice menu + * @param item the item to remove from this {@code Choice} menu * @exception IllegalArgumentException if the item doesn't * exist in the choice menu * @since 1.1 @@ -336,8 +336,8 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Removes an item from the Choice at the - * specified position, but does not invalidate the Choice. + * Removes an item from the {@code Choice} at the + * specified position, but does not invalidate the {@code Choice}. * Client methods must provide their * own synchronization before invoking this method. * @param position the position of the item @@ -389,7 +389,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Returns an array (length 1) containing the currently selected - * item. If this choice has no items, returns null. + * item. If this choice has no items, returns {@code null}. * @see ItemSelectable */ public synchronized Object[] getSelectedObjects() { @@ -414,14 +414,14 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Sets the selected item in this Choice menu to be the + * Sets the selected item in this {@code Choice} menu to be the * item at the specified position. * *

          Note that this method should be primarily used to * initially select an item in this component. * Programmatically calling this method will not trigger - * an ItemEvent. The only way to trigger an - * ItemEvent is by user interaction. + * an {@code ItemEvent}. The only way to trigger an + * {@code ItemEvent} is by user interaction. * * @param pos the position of the selected item * @exception IllegalArgumentException if the specified @@ -444,7 +444,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Sets the selected item in this Choice menu + * Sets the selected item in this {@code Choice} menu * to be the item whose name is equal to the specified string. * If more than one item matches (is equal to) the specified string, * the one with the smallest index is selected. @@ -452,8 +452,8 @@ public class Choice extends Component implements ItemSelectable, Accessible { *

          Note that this method should be primarily used to * initially select an item in this component. * Programmatically calling this method will not trigger - * an ItemEvent. The only way to trigger an - * ItemEvent is by user interaction. + * an {@code ItemEvent}. The only way to trigger an + * {@code ItemEvent} is by user interaction. * * @param str the specified string * @see #getSelectedItem @@ -468,9 +468,9 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Adds the specified item listener to receive item events from - * this Choice menu. Item events are sent in response - * to user input, but not in response to calls to select. - * If l is null, no exception is thrown and no action + * this {@code Choice} menu. Item events are sent in response + * to user input, but not in response to calls to {@code select}. + * If l is {@code null}, no exception is thrown and no action * is performed. *

          Refer to AWT Threading Issues for details on AWT's threading model. @@ -492,8 +492,8 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Removes the specified item listener so that it no longer receives - * item events from this Choice menu. - * If l is null, no exception is thrown and no + * item events from this {@code Choice} menu. + * If l is {@code null}, no exception is thrown and no * action is performed. *

          Refer to AWT Threading Issues for details on AWT's threading model. @@ -515,7 +515,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { * Returns an array of all the item listeners * registered on this choice. * - * @return all of this choice's ItemListeners + * @return all of this choice's {@code ItemListener}s * or an empty array if no item * listeners are currently registered * @@ -532,16 +532,16 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Returns an array of all the objects currently registered * as FooListeners - * upon this Choice. + * upon this {@code Choice}. * FooListeners are registered using the * addFooListener method. * *

          - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * Choice c + * {@code Choice c} * for its item listeners with the following code: * *

          ItemListener[] ils = (ItemListener[])(c.getListeners(ItemListener.class));
          @@ -550,14 +550,14 @@ public class Choice extends Component implements ItemSelectable, Accessible { * * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this choice, * or an empty array if no such * listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @see #getItemListeners * @since 1.3 @@ -586,10 +586,10 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Processes events on this choice. If the event is an - * instance of ItemEvent, it invokes the - * processItemEvent method. Otherwise, it calls its - * superclass's processEvent method. - *

          Note that if the event parameter is null + * instance of {@code ItemEvent}, it invokes the + * {@code processItemEvent} method. Otherwise, it calls its + * superclass's {@code processEvent} method. + *

          Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -607,19 +607,19 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Processes item events occurring on this Choice + * Processes item events occurring on this {@code Choice} * menu by dispatching them to any registered - * ItemListener objects. + * {@code ItemListener} objects. *

          * This method is not called unless item events are * enabled for this component. Item events are enabled * when one of the following occurs: *

            - *
          • An ItemListener object is registered - * via addItemListener. - *
          • Item events are enabled via enableEvents. + *
          • An {@code ItemListener} object is registered + * via {@code addItemListener}. + *
          • Item events are enabled via {@code enableEvents}. *
          - *

          Note that if the event parameter is null + *

          Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -638,13 +638,13 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Returns a string representing the state of this Choice + * Returns a string representing the state of this {@code Choice} * menu. This method is intended to be used only for debugging purposes, * and the content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * - * @return the parameter string of this Choice menu + * @return the parameter string of this {@code Choice} menu */ protected String paramString() { return super.paramString() + ",current=" + getSelectedItem(); @@ -662,18 +662,18 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Writes default serializable fields to stream. Writes - * a list of serializable ItemListeners + * a list of serializable {@code ItemListeners} * as optional data. The non-serializable - * ItemListeners are detected and + * {@code ItemListeners} are detected and * no attempt is made to serialize them. * - * @param s the ObjectOutputStream to write - * @serialData null terminated sequence of 0 - * or more pairs; the pair consists of a String - * and an Object; the String indicates + * @param s the {@code ObjectOutputStream} to write + * @serialData {@code null} terminated sequence of 0 + * or more pairs; the pair consists of a {@code String} + * and an {@code Object}; the {@code String} indicates * the type of object and is one of the following: - * itemListenerK indicating an - * ItemListener object + * {@code itemListenerK} indicating an + * {@code ItemListener} object * * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see java.awt.Component#itemListenerK @@ -689,15 +689,15 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Reads the ObjectInputStream and if it - * isn't null adds a listener to receive - * item events fired by the Choice item. + * Reads the {@code ObjectInputStream} and if it + * isn't {@code null} adds a listener to receive + * item events fired by the {@code Choice} item. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns - * true + * {@code GraphicsEnvironment.isHeadless} returns + * {@code true} * @serial * @see #removeItemListener(ItemListener) * @see #addItemListener(ItemListener) @@ -733,14 +733,14 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** - * Gets the AccessibleContext associated with this - * Choice. For Choice components, - * the AccessibleContext takes the form of an - * AccessibleAWTChoice. A new AccessibleAWTChoice + * Gets the {@code AccessibleContext} associated with this + * {@code Choice}. For {@code Choice} components, + * the {@code AccessibleContext} takes the form of an + * {@code AccessibleAWTChoice}. A new {@code AccessibleAWTChoice} * instance is created if necessary. * - * @return an AccessibleAWTChoice that serves as the - * AccessibleContext of this Choice + * @return an {@code AccessibleAWTChoice} that serves as the + * {@code AccessibleContext} of this {@code Choice} * @since 1.3 */ public AccessibleContext getAccessibleContext() { @@ -752,7 +752,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * This class implements accessibility support for the - * Choice class. It provides an implementation of the + * {@code Choice} class. It provides an implementation of the * Java Accessibility API appropriate to choice user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Color.java b/jdk/src/java.desktop/share/classes/java/awt/Color.java index da62fc631da..559a429ef22 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Color.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Color.java @@ -32,7 +32,7 @@ import java.awt.geom.Rectangle2D; import java.awt.color.ColorSpace; /** - * The Color class is used to encapsulate colors in the default + * The {@code Color} class is used to encapsulate colors in the default * sRGB color space or colors in arbitrary color spaces identified by a * {@link ColorSpace}. Every color has an implicit alpha value of 1.0 or * an explicit one provided in the constructor. The alpha value @@ -41,8 +41,8 @@ import java.awt.color.ColorSpace; * An alpha value of 1.0 or 255 means that the color is completely * opaque and an alpha value of 0 or 0.0 means that the color is * completely transparent. - * When constructing a Color with an explicit alpha or - * getting the color/alpha components of a Color, the color + * When constructing a {@code Color} with an explicit alpha or + * getting the color/alpha components of a {@code Color}, the color * components are never premultiplied by the alpha component. *

          * The default color space for the Java 2D(tm) API is sRGB, a proposed @@ -210,11 +210,11 @@ public class Color implements Paint, java.io.Serializable { int value; /** - * The color value in the default sRGB ColorSpace as - * float components (no alpha). - * If null after object construction, this must be an + * The color value in the default sRGB {@code ColorSpace} as + * {@code float} components (no alpha). + * If {@code null} after object construction, this must be an * sRGB color constructed with 8-bit precision, so compute from the - * int color value. + * {@code int} color value. * @serial * @see #getRGBColorComponents * @see #getRGBComponents @@ -222,11 +222,11 @@ public class Color implements Paint, java.io.Serializable { private float frgbvalue[] = null; /** - * The color value in the native ColorSpace as - * float components (no alpha). - * If null after object construction, this must be an + * The color value in the native {@code ColorSpace} as + * {@code float} components (no alpha). + * If {@code null} after object construction, this must be an * sRGB color constructed with 8-bit precision, so compute from the - * int color value. + * {@code int} color value. * @serial * @see #getRGBColorComponents * @see #getRGBComponents @@ -234,9 +234,9 @@ public class Color implements Paint, java.io.Serializable { private float fvalue[] = null; /** - * The alpha value as a float component. - * If frgbvalue is null, this is not valid - * data, so compute from the int color value. + * The alpha value as a {@code float} component. + * If {@code frgbvalue} is {@code null}, this is not valid + * data, so compute from the {@code int} color value. * @serial * @see #getRGBComponents * @see #getComponents @@ -244,7 +244,7 @@ public class Color implements Paint, java.io.Serializable { private float falpha = 0.0f; /** - * The ColorSpace. If null, then it's + * The {@code ColorSpace}. If {@code null}, then it's * default is sRGB. * @serial * @see #getColor @@ -313,9 +313,9 @@ public class Color implements Paint, java.io.Serializable { } /** - * Checks the color float components supplied for + * Checks the color {@code float} components supplied for * validity. - * Throws an IllegalArgumentException if the value is out + * Throws an {@code IllegalArgumentException} if the value is out * of range. * @param r the Red component * @param g the Green component @@ -354,8 +354,8 @@ public class Color implements Paint, java.io.Serializable { * available for a given output device. * Alpha is defaulted to 255. * - * @throws IllegalArgumentException if r, g - * or b are outside of the range + * @throws IllegalArgumentException if {@code r}, {@code g} + * or {@code b} are outside of the range * 0 to 255, inclusive * @param r the red component * @param g the green component @@ -373,8 +373,8 @@ public class Color implements Paint, java.io.Serializable { * Creates an sRGB color with the specified red, green, blue, and alpha * values in the range (0 - 255). * - * @throws IllegalArgumentException if r, g, - * b or a are outside of the range + * @throws IllegalArgumentException if {@code r}, {@code g}, + * {@code b} or {@code a} are outside of the range * 0 to 255, inclusive * @param r the red component * @param g the green component @@ -418,12 +418,12 @@ public class Color implements Paint, java.io.Serializable { * Creates an sRGB color with the specified combined RGBA value consisting * of the alpha component in bits 24-31, the red component in bits 16-23, * the green component in bits 8-15, and the blue component in bits 0-7. - * If the hasalpha argument is false, alpha + * If the {@code hasalpha} argument is {@code false}, alpha * is defaulted to 255. * * @param rgba the combined RGBA components - * @param hasalpha true if the alpha bits are valid; - * false otherwise + * @param hasalpha {@code true} if the alpha bits are valid; + * {@code false} otherwise * @see java.awt.image.ColorModel#getRGBdefault * @see #getRed * @see #getGreen @@ -446,8 +446,8 @@ public class Color implements Paint, java.io.Serializable { * match given the color space available for a particular output * device. * - * @throws IllegalArgumentException if r, g - * or b are outside of the range + * @throws IllegalArgumentException if {@code r}, {@code g} + * or {@code b} are outside of the range * 0.0 to 1.0, inclusive * @param r the red component * @param g the green component @@ -473,8 +473,8 @@ public class Color implements Paint, java.io.Serializable { * alpha values in the range (0.0 - 1.0). The actual color * used in rendering depends on finding the best match given the * color space available for a particular output device. - * @throws IllegalArgumentException if r, g - * b or a are outside of the range + * @throws IllegalArgumentException if {@code r}, {@code g} + * {@code b} or {@code a} are outside of the range * 0.0 to 1.0, inclusive * @param r the red component * @param g the green component @@ -497,19 +497,19 @@ public class Color implements Paint, java.io.Serializable { } /** - * Creates a color in the specified ColorSpace - * with the color components specified in the float + * Creates a color in the specified {@code ColorSpace} + * with the color components specified in the {@code float} * array and the specified alpha. The number of components is - * determined by the type of the ColorSpace. For + * determined by the type of the {@code ColorSpace}. For * example, RGB requires 3 components, but CMYK requires 4 * components. - * @param cspace the ColorSpace to be used to + * @param cspace the {@code ColorSpace} to be used to * interpret the components * @param components an arbitrary number of color components - * that is compatible with the ColorSpace + * that is compatible with the {@code ColorSpace} * @param alpha alpha value * @throws IllegalArgumentException if any of the values in the - * components array or alpha is + * {@code components} array or {@code alpha} is * outside of the range 0.0 to 1.0 * @see #getComponents * @see #getColorComponents @@ -592,7 +592,7 @@ public class Color implements Paint, java.io.Serializable { * (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are * blue). * @return the RGB value of the color in the default sRGB - * ColorModel. + * {@code ColorModel}. * @see java.awt.image.ColorModel#getRGBdefault * @see #getRed * @see #getGreen @@ -606,19 +606,19 @@ public class Color implements Paint, java.io.Serializable { private static final double FACTOR = 0.7; /** - * Creates a new Color that is a brighter version of this - * Color. + * Creates a new {@code Color} that is a brighter version of this + * {@code Color}. *

          * This method applies an arbitrary scale factor to each of the three RGB - * components of this Color to create a brighter version - * of this Color. + * components of this {@code Color} to create a brighter version + * of this {@code Color}. * The {@code alpha} value is preserved. - * Although brighter and - * darker are inverse operations, the results of a + * Although {@code brighter} and + * {@code darker} are inverse operations, the results of a * series of invocations of these two methods might be inconsistent * because of rounding errors. - * @return a new Color object that is - * a brighter version of this Color + * @return a new {@code Color} object that is + * a brighter version of this {@code Color} * with the same {@code alpha} value. * @see java.awt.Color#darker * @since 1.0 @@ -649,19 +649,19 @@ public class Color implements Paint, java.io.Serializable { } /** - * Creates a new Color that is a darker version of this - * Color. + * Creates a new {@code Color} that is a darker version of this + * {@code Color}. *

          * This method applies an arbitrary scale factor to each of the three RGB - * components of this Color to create a darker version of - * this Color. + * components of this {@code Color} to create a darker version of + * this {@code Color}. * The {@code alpha} value is preserved. - * Although brighter and - * darker are inverse operations, the results of a series + * Although {@code brighter} and + * {@code darker} are inverse operations, the results of a series * of invocations of these two methods might be inconsistent because * of rounding errors. - * @return a new Color object that is - * a darker version of this Color + * @return a new {@code Color} object that is + * a darker version of this {@code Color} * with the same {@code alpha} value. * @see java.awt.Color#brighter * @since 1.0 @@ -674,7 +674,7 @@ public class Color implements Paint, java.io.Serializable { } /** - * Computes the hash code for this Color. + * Computes the hash code for this {@code Color}. * @return a hash code value for this object. * @since 1.0 */ @@ -684,15 +684,15 @@ public class Color implements Paint, java.io.Serializable { /** * Determines whether another object is equal to this - * Color. + * {@code Color}. *

          - * The result is true if and only if the argument is not - * null and is a Color object that has the same + * The result is {@code true} if and only if the argument is not + * {@code null} and is a {@code Color} object that has the same * red, green, blue, and alpha values as this object. * @param obj the object to test for equality with this - * Color - * @return true if the objects are the same; - * false otherwise. + * {@code Color} + * @return {@code true} if the objects are the same; + * {@code false} otherwise. * @since 1.0 */ public boolean equals(Object obj) { @@ -700,25 +700,25 @@ public class Color implements Paint, java.io.Serializable { } /** - * Returns a string representation of this Color. This + * Returns a string representation of this {@code Color}. This * method is intended to be used only for debugging purposes. The * content and format of the returned string might vary between * implementations. The returned string might be empty but cannot - * be null. + * be {@code null}. * - * @return a string representation of this Color. + * @return a string representation of this {@code Color}. */ public String toString() { return getClass().getName() + "[r=" + getRed() + ",g=" + getGreen() + ",b=" + getBlue() + "]"; } /** - * Converts a String to an integer and returns the - * specified opaque Color. This method handles string + * Converts a {@code String} to an integer and returns the + * specified opaque {@code Color}. This method handles string * formats that are used to represent octal and hexadecimal numbers. - * @param nm a String that represents + * @param nm a {@code String} that represents * an opaque color as a 24-bit integer - * @return the new Color object. + * @return the new {@code Color} object. * @see java.lang.Integer#decode * @exception NumberFormatException if the specified string cannot * be interpreted as a decimal, @@ -736,13 +736,13 @@ public class Color implements Paint, java.io.Serializable { *

          * The argument is treated as the name of a system property to * be obtained. The string value of this property is then interpreted - * as an integer which is then converted to a Color + * as an integer which is then converted to a {@code Color} * object. *

          * If the specified property is not found or could not be parsed as - * an integer then null is returned. + * an integer then {@code null} is returned. * @param nm the name of the color property - * @return the Color converted from the system + * @return the {@code Color} converted from the system * property. * @see java.lang.System#getProperty(java.lang.String) * @see java.lang.Integer#getInteger(java.lang.String) @@ -758,16 +758,16 @@ public class Color implements Paint, java.io.Serializable { *

          * The first argument is treated as the name of a system property to * be obtained. The string value of this property is then interpreted - * as an integer which is then converted to a Color + * as an integer which is then converted to a {@code Color} * object. *

          * If the specified property is not found or cannot be parsed as - * an integer then the Color specified by the second + * an integer then the {@code Color} specified by the second * argument is returned instead. * @param nm the name of the color property - * @param v the default Color - * @return the Color converted from the system - * property, or the specified Color. + * @param v the default {@code Color} + * @return the {@code Color} converted from the system + * property, or the specified {@code Color}. * @see java.lang.System#getProperty(java.lang.String) * @see java.lang.Integer#getInteger(java.lang.String) * @see java.awt.Color#Color(int) @@ -787,16 +787,16 @@ public class Color implements Paint, java.io.Serializable { *

          * The first argument is treated as the name of a system property to * be obtained. The string value of this property is then interpreted - * as an integer which is then converted to a Color + * as an integer which is then converted to a {@code Color} * object. *

          * If the specified property is not found or could not be parsed as - * an integer then the integer value v is used instead, - * and is converted to a Color object. + * an integer then the integer value {@code v} is used instead, + * and is converted to a {@code Color} object. * @param nm the name of the color property * @param v the default color value, as an integer - * @return the Color converted from the system - * property or the Color converted from + * @return the {@code Color} converted from the system + * property or the {@code Color} converted from * the specified integer. * @see java.lang.System#getProperty(java.lang.String) * @see java.lang.Integer#getInteger(java.lang.String) @@ -813,19 +813,19 @@ public class Color implements Paint, java.io.Serializable { * Converts the components of a color, as specified by the HSB * model, to an equivalent set of values for the default RGB model. *

          - * The saturation and brightness components + * The {@code saturation} and {@code brightness} components * should be floating-point values between zero and one - * (numbers in the range 0.0-1.0). The hue component + * (numbers in the range 0.0-1.0). The {@code hue} component * can be any floating-point number. The floor of this number is * subtracted from it to create a fraction between 0 and 1. This * fractional number is then multiplied by 360 to produce the hue * angle in the HSB color model. *

          - * The integer that is returned by HSBtoRGB encodes the + * The integer that is returned by {@code HSBtoRGB} encodes the * value of a color in bits 0-23 of an integer value that is the same * format used by the method {@link #getRGB() getRGB}. * This integer can be supplied as an argument to the - * Color constructor that takes a single integer argument. + * {@code Color} constructor that takes a single integer argument. * @param hue the hue component of the color * @param saturation the saturation of the color * @param brightness the brightness of the color @@ -887,15 +887,15 @@ public class Color implements Paint, java.io.Serializable { * model, to an equivalent set of values for hue, saturation, and * brightness that are the three components of the HSB model. *

          - * If the hsbvals argument is null, then a + * If the {@code hsbvals} argument is {@code null}, then a * new array is allocated to return the result. Otherwise, the method - * returns the array hsbvals, with the values put into + * returns the array {@code hsbvals}, with the values put into * that array. * @param r the red component of the color * @param g the green component of the color * @param b the blue component of the color * @param hsbvals the array used to return the - * three HSB values, or null + * three HSB values, or {@code null} * @return an array of three elements containing the hue, saturation, * and brightness (in that order), of the color with * the indicated red, green, and blue components. @@ -942,12 +942,12 @@ public class Color implements Paint, java.io.Serializable { } /** - * Creates a Color object based on the specified values + * Creates a {@code Color} object based on the specified values * for the HSB color model. *

          - * The s and b components should be + * The {@code s} and {@code b} components should be * floating-point values between zero and one - * (numbers in the range 0.0-1.0). The h component + * (numbers in the range 0.0-1.0). The {@code h} component * can be any floating-point number. The floor of this number is * subtracted from it to create a fraction between 0 and 1. This * fractional number is then multiplied by 360 to produce the hue @@ -955,7 +955,7 @@ public class Color implements Paint, java.io.Serializable { * @param h the hue component * @param s the saturation of the color * @param b the brightness of the color - * @return a Color object with the specified hue, + * @return a {@code Color} object with the specified hue, * saturation, and brightness. * @since 1.0 */ @@ -964,16 +964,16 @@ public class Color implements Paint, java.io.Serializable { } /** - * Returns a float array containing the color and alpha - * components of the Color, as represented in the default + * Returns a {@code float} array containing the color and alpha + * components of the {@code Color}, as represented in the default * sRGB color space. - * If compArray is null, an array of length + * If {@code compArray} is {@code null}, an array of length * 4 is created for the return value. Otherwise, - * compArray must have length 4 or greater, + * {@code compArray} must have length 4 or greater, * and it is filled in with the components and returned. * @param compArray an array that this method fills with * color and alpha components and returns - * @return the RGBA components in a float array. + * @return the RGBA components in a {@code float} array. */ public float[] getRGBComponents(float[] compArray) { float[] f; @@ -997,15 +997,15 @@ public class Color implements Paint, java.io.Serializable { } /** - * Returns a float array containing only the color - * components of the Color, in the default sRGB color - * space. If compArray is null, an array of + * Returns a {@code float} array containing only the color + * components of the {@code Color}, in the default sRGB color + * space. If {@code compArray} is {@code null}, an array of * length 3 is created for the return value. Otherwise, - * compArray must have length 3 or greater, and it is + * {@code compArray} must have length 3 or greater, and it is * filled in with the components and returned. * @param compArray an array that this method fills with color * components and returns - * @return the RGB components in a float array. + * @return the RGB components in a {@code float} array. */ public float[] getRGBColorComponents(float[] compArray) { float[] f; @@ -1027,19 +1027,19 @@ public class Color implements Paint, java.io.Serializable { } /** - * Returns a float array containing the color and alpha - * components of the Color, in the - * ColorSpace of the Color. - * If compArray is null, an array with + * Returns a {@code float} array containing the color and alpha + * components of the {@code Color}, in the + * {@code ColorSpace} of the {@code Color}. + * If {@code compArray} is {@code null}, an array with * length equal to the number of components in the associated - * ColorSpace plus one is created for - * the return value. Otherwise, compArray must have at + * {@code ColorSpace} plus one is created for + * the return value. Otherwise, {@code compArray} must have at * least this length and it is filled in with the components and * returned. * @param compArray an array that this method fills with the color and - * alpha components of this Color in its - * ColorSpace and returns - * @return the color and alpha components in a float + * alpha components of this {@code Color} in its + * {@code ColorSpace} and returns + * @return the color and alpha components in a {@code float} * array. */ public float[] getComponents(float[] compArray) { @@ -1060,19 +1060,19 @@ public class Color implements Paint, java.io.Serializable { } /** - * Returns a float array containing only the color - * components of the Color, in the - * ColorSpace of the Color. - * If compArray is null, an array with + * Returns a {@code float} array containing only the color + * components of the {@code Color}, in the + * {@code ColorSpace} of the {@code Color}. + * If {@code compArray} is {@code null}, an array with * length equal to the number of components in the associated - * ColorSpace is created for - * the return value. Otherwise, compArray must have at + * {@code ColorSpace} is created for + * the return value. Otherwise, {@code compArray} must have at * least this length and it is filled in with the components and * returned. * @param compArray an array that this method fills with the color - * components of this Color in its - * ColorSpace and returns - * @return the color components in a float array. + * components of this {@code Color} in its + * {@code ColorSpace} and returns + * @return the color components in a {@code float} array. */ public float[] getColorComponents(float[] compArray) { if (fvalue == null) @@ -1091,19 +1091,19 @@ public class Color implements Paint, java.io.Serializable { } /** - * Returns a float array containing the color and alpha - * components of the Color, in the - * ColorSpace specified by the cspace - * parameter. If compArray is null, an + * Returns a {@code float} array containing the color and alpha + * components of the {@code Color}, in the + * {@code ColorSpace} specified by the {@code cspace} + * parameter. If {@code compArray} is {@code null}, an * array with length equal to the number of components in - * cspace plus one is created for the return value. - * Otherwise, compArray must have at least this + * {@code cspace} plus one is created for the return value. + * Otherwise, {@code compArray} must have at least this * length, and it is filled in with the components and returned. - * @param cspace a specified ColorSpace + * @param cspace a specified {@code ColorSpace} * @param compArray an array that this method fills with the - * color and alpha components of this Color in - * the specified ColorSpace and returns - * @return the color and alpha components in a float + * color and alpha components of this {@code Color} in + * the specified {@code ColorSpace} and returns + * @return the color and alpha components in a {@code float} * array. */ public float[] getComponents(ColorSpace cspace, float[] compArray) { @@ -1136,19 +1136,19 @@ public class Color implements Paint, java.io.Serializable { } /** - * Returns a float array containing only the color - * components of the Color in the - * ColorSpace specified by the cspace - * parameter. If compArray is null, an array + * Returns a {@code float} array containing only the color + * components of the {@code Color} in the + * {@code ColorSpace} specified by the {@code cspace} + * parameter. If {@code compArray} is {@code null}, an array * with length equal to the number of components in - * cspace is created for the return value. Otherwise, - * compArray must have at least this length, and it is + * {@code cspace} is created for the return value. Otherwise, + * {@code compArray} must have at least this length, and it is * filled in with the components and returned. - * @param cspace a specified ColorSpace + * @param cspace a specified {@code ColorSpace} * @param compArray an array that this method fills with the color - * components of this Color in the specified - * ColorSpace - * @return the color components in a float array. + * components of this {@code Color} in the specified + * {@code ColorSpace} + * @return the color components in a {@code float} array. */ public float[] getColorComponents(ColorSpace cspace, float[] compArray) { if (cs == null) { @@ -1175,8 +1175,8 @@ public class Color implements Paint, java.io.Serializable { } /** - * Returns the ColorSpace of this Color. - * @return this Color object's ColorSpace. + * Returns the {@code ColorSpace} of this {@code Color}. + * @return this {@code Color} object's {@code ColorSpace}. */ public ColorSpace getColorSpace() { if (cs == null) { @@ -1221,9 +1221,9 @@ public class Color implements Paint, java.io.Serializable { } /** - * Returns the transparency mode for this Color. This is - * required to implement the Paint interface. - * @return this Color object's transparency mode. + * Returns the transparency mode for this {@code Color}. This is + * required to implement the {@code Paint} interface. + * @return this {@code Color} object's transparency mode. * @see Paint * @see Transparency * @see #createContext diff --git a/jdk/src/java.desktop/share/classes/java/awt/ColorPaintContext.java b/jdk/src/java.desktop/share/classes/java/awt/ColorPaintContext.java index ae881445a3a..15e296cf525 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/ColorPaintContext.java +++ b/jdk/src/java.desktop/share/classes/java/awt/ColorPaintContext.java @@ -50,7 +50,7 @@ class ColorPaintContext implements PaintContext { * (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are * blue). * @return the RGB value of the color in the default sRGB - * ColorModel. + * {@code ColorModel}. * @see java.awt.image.ColorModel#getRGBdefault * @see #getRed * @see #getGreen diff --git a/jdk/src/java.desktop/share/classes/java/awt/Component.java b/jdk/src/java.desktop/share/classes/java/awt/Component.java index 1d80c9e01e0..663c5f909be 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Component.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Component.java @@ -89,9 +89,9 @@ import sun.util.logging.PlatformLogger; * that can be displayed on the screen and that can interact with the * user. Examples of components are the buttons, checkboxes, and scrollbars * of a typical graphical user interface.

          - * The Component class is the abstract superclass of + * The {@code Component} class is the abstract superclass of * the nonmenu-related Abstract Window Toolkit components. Class - * Component can also be extended directly to create a + * {@code Component} can also be extended directly to create a * lightweight component. A lightweight component is a component that is * not associated with a native window. On the contrary, a heavyweight * component is associated with a native window. The {@link #isLightweight()} @@ -107,10 +107,10 @@ import sun.util.logging.PlatformLogger; * *

          Serialization

          * It is important to note that only AWT listeners which conform - * to the Serializable protocol will be saved when + * to the {@code Serializable} protocol will be saved when * the object is stored. If an AWT object has listeners that * aren't marked serializable, they will be dropped at - * writeObject time. Developers will need, as always, + * {@code writeObject} time. Developers will need, as always, * to consider the implications of making an object serializable. * One situation to watch out for is this: *
          @@ -136,12 +136,12 @@ import sun.util.logging.PlatformLogger;
            *        }
            *    }
            * 
          - * In this example, serializing aButton by itself - * will cause MyApp and everything it refers to + * In this example, serializing {@code aButton} by itself + * will cause {@code MyApp} and everything it refers to * to be serialized as well. The problem is that the listener * is serializable by coincidence, not by design. To separate - * the decisions about MyApp and the - * ActionListener being serializable one can use a + * the decisions about {@code MyApp} and the + * {@code ActionListener} being serializable one can use a * nested class, as in the following example: *
            *    import java.awt.*;
          @@ -194,7 +194,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
           
               /**
                * The peer of the component. The peer implements the component's
          -     * behavior. The peer is set when the Component is
          +     * behavior. The peer is set when the {@code Component} is
                * added to a container that also is a peer.
                * @see #addNotify
                * @see #removeNotify
          @@ -202,14 +202,14 @@ public abstract class Component implements ImageObserver, MenuContainer,
               transient volatile ComponentPeer peer;
           
               /**
          -     * The parent of the object. It may be null
          +     * The parent of the object. It may be {@code null}
                * for top-level components.
                * @see #getParent
                */
               transient Container parent;
           
               /**
          -     * The AppContext of the component. Applets/Plugin may
          +     * The {@code AppContext} of the component. Applets/Plugin may
                * change the AppContext.
                */
               transient AppContext appContext;
          @@ -248,7 +248,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
           
               /**
                * The foreground color for this component.
          -     * foreground can be null.
          +     * {@code foreground} can be {@code null}.
                *
                * @serial
                * @see #getForeground
          @@ -258,7 +258,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
           
               /**
                * The background color for this component.
          -     * background can be null.
          +     * {@code background} can be {@code null}.
                *
                * @serial
                * @see #getBackground
          @@ -268,7 +268,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
           
               /**
                * The font used by this component.
          -     * The font can be null.
          +     * The {@code font} can be {@code null}.
                *
                * @serial
                * @see #getFont
          @@ -278,13 +278,13 @@ public abstract class Component implements ImageObserver, MenuContainer,
           
               /**
                * The font which the peer is currently using.
          -     * (null if no peer exists.)
          +     * ({@code null} if no peer exists.)
                */
               Font        peerFont;
           
               /**
                * The cursor displayed when pointer is over this component.
          -     * This value can be null.
          +     * This value can be {@code null}.
                *
                * @serial
                * @see #getCursor
          @@ -302,10 +302,10 @@ public abstract class Component implements ImageObserver, MenuContainer,
               Locale      locale;
           
               /**
          -     * A reference to a GraphicsConfiguration object
          +     * A reference to a {@code GraphicsConfiguration} object
                * used to describe the characteristics of a graphics
                * destination.
          -     * This value can be null.
          +     * This value can be {@code null}.
                *
                * @since 1.3
                * @serial
          @@ -315,7 +315,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
               private transient volatile GraphicsConfiguration graphicsConfig;
           
               /**
          -     * A reference to a BufferStrategy object
          +     * A reference to a {@code BufferStrategy} object
                * used to manipulate the buffers on this component.
                *
                * @since 1.4
          @@ -367,7 +367,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
               private volatile boolean valid = false;
           
               /**
          -     * The DropTarget associated with this component.
          +     * The {@code DropTarget} associated with this component.
                *
                * @since 1.2
                * @serial
          @@ -384,7 +384,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
           
               /**
                * A component's name.
          -     * This field can be null.
          +     * This field can be {@code null}.
                *
                * @serial
                * @see #getName
          @@ -394,7 +394,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
           
               /**
                * A bool to determine whether the name has
          -     * been set explicitly. nameExplicitlySet will
          +     * been set explicitly. {@code nameExplicitlySet} will
                * be false if the name has not been set and
                * true if it has.
                *
          @@ -523,7 +523,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
               = ComponentOrientation.UNKNOWN;
           
               /**
          -     * newEventsOnly will be true if the event is
          +     * {@code newEventsOnly} will be true if the event is
                * one of the event types enabled for the component.
                * It will then allow for normal processing to
                * continue.  If it is false the event is passed
          @@ -565,13 +565,13 @@ public abstract class Component implements ImageObserver, MenuContainer,
               static final String windowFocusListenerK = "windowFocusL";
           
               /**
          -     * The eventMask is ONLY set by subclasses via
          -     * enableEvents.
          +     * The {@code eventMask} is ONLY set by subclasses via
          +     * {@code enableEvents}.
                * The mask should NOT be set when listeners are registered
                * so that we can distinguish the difference between when
                * listeners request events and subclasses request them.
                * One bit is used to indicate whether input methods are
          -     * enabled; this bit is set by enableInputMethods and is
          +     * enabled; this bit is set by {@code enableInputMethods} and is
                * on by default.
                *
                * @serial
          @@ -604,15 +604,15 @@ public abstract class Component implements ImageObserver, MenuContainer,
               }
           
               /**
          -     * Ease-of-use constant for getAlignmentY().
          +     * Ease-of-use constant for {@code getAlignmentY()}.
                * Specifies an alignment to the top of the component.
                * @see     #getAlignmentY
                */
               public static final float TOP_ALIGNMENT = 0.0f;
           
               /**
          -     * Ease-of-use constant for getAlignmentY and
          -     * getAlignmentX. Specifies an alignment to
          +     * Ease-of-use constant for {@code getAlignmentY} and
          +     * {@code getAlignmentX}. Specifies an alignment to
                * the center of the component
                * @see     #getAlignmentX
                * @see     #getAlignmentY
          @@ -620,21 +620,21 @@ public abstract class Component implements ImageObserver, MenuContainer,
               public static final float CENTER_ALIGNMENT = 0.5f;
           
               /**
          -     * Ease-of-use constant for getAlignmentY.
          +     * Ease-of-use constant for {@code getAlignmentY}.
                * Specifies an alignment to the bottom of the component.
                * @see     #getAlignmentY
                */
               public static final float BOTTOM_ALIGNMENT = 1.0f;
           
               /**
          -     * Ease-of-use constant for getAlignmentX.
          +     * Ease-of-use constant for {@code getAlignmentX}.
                * Specifies an alignment to the left side of the component.
                * @see     #getAlignmentX
                */
               public static final float LEFT_ALIGNMENT = 0.0f;
           
               /**
          -     * Ease-of-use constant for getAlignmentX.
          +     * Ease-of-use constant for {@code getAlignmentX}.
                * Specifies an alignment to the right side of the component.
                * @see     #getAlignmentX
                */
          @@ -646,8 +646,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
               private static final long serialVersionUID = -7644114512714619750L;
           
               /**
          -     * If any PropertyChangeListeners have been registered,
          -     * the changeSupport field describes them.
          +     * If any {@code PropertyChangeListeners} have been registered,
          +     * the {@code changeSupport} field describes them.
                *
                * @serial
                * @since 1.2
          @@ -705,8 +705,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
                * size; not a developer specified minimum size).  For sizes
                * smaller than the minimum size the baseline may change in a way
                * other than the baseline resize behavior indicates.  Similarly,
          -     * as the size approaches Integer.MAX_VALUE and/or
          -     * Short.MAX_VALUE the baseline may change in a way
          +     * as the size approaches {@code Integer.MAX_VALUE} and/or
          +     * {@code Short.MAX_VALUE} the baseline may change in a way
                * other than the baseline resize behavior indicates.
                *
                * @see #getBaselineResizeBehavior
          @@ -716,11 +716,11 @@ public abstract class Component implements ImageObserver, MenuContainer,
               public enum BaselineResizeBehavior {
                   /**
                    * Indicates the baseline remains fixed relative to the
          -         * y-origin.  That is, getBaseline returns
          +         * y-origin.  That is, {@code getBaseline} returns
                    * the same value regardless of the height or width.  For example, a
          -         * JLabel containing non-empty text with a
          -         * vertical alignment of TOP should have a
          -         * baseline type of CONSTANT_ASCENT.
          +         * {@code JLabel} containing non-empty text with a
          +         * vertical alignment of {@code TOP} should have a
          +         * baseline type of {@code CONSTANT_ASCENT}.
                    */
                   CONSTANT_ASCENT,
           
          @@ -728,18 +728,18 @@ public abstract class Component implements ImageObserver, MenuContainer,
                    * Indicates the baseline remains fixed relative to the height
                    * and does not change as the width is varied.  That is, for
                    * any height H the difference between H and
          -         * getBaseline(w, H) is the same.  For example, a
          -         * JLabel containing non-empty text with a
          -         * vertical alignment of BOTTOM should have a
          -         * baseline type of CONSTANT_DESCENT.
          +         * {@code getBaseline(w, H)} is the same.  For example, a
          +         * {@code JLabel} containing non-empty text with a
          +         * vertical alignment of {@code BOTTOM} should have a
          +         * baseline type of {@code CONSTANT_DESCENT}.
                    */
                   CONSTANT_DESCENT,
           
                   /**
                    * Indicates the baseline remains a fixed distance from
                    * the center of the component.  That is, for any height H the
          -         * difference between getBaseline(w, H) and
          -         * H / 2 is the same (plus or minus one depending upon
          +         * difference between {@code getBaseline(w, H)} and
          +         * {@code H / 2} is the same (plus or minus one depending upon
                    * rounding error).
                    * 

          * Because of possible rounding errors it is recommended @@ -988,11 +988,11 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Constructs a new component. Class Component can be + * Constructs a new component. Class {@code Component} can be * extended directly to create a lightweight component that does not * utilize an opaque native window. A lightweight component must be * hosted by a native container somewhere higher up in the component - * tree (for example, by a Frame object). + * tree (for example, by a {@code Frame} object). */ protected Component() { appContext = AppContext.getAppContext(); @@ -1004,8 +1004,8 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Constructs a name for this component. Called by getName - * when the name is null. + * Constructs a name for this component. Called by {@code getName} + * when the name is {@code null}. */ String constructComponentName() { return null; // For strict compliance with prior platform versions, a Component @@ -1071,8 +1071,8 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Associate a DropTarget with this component. - * The Component will receive drops only if it + * Associate a {@code DropTarget} with this component. + * The {@code Component} will receive drops only if it * is enabled. * * @see #isEnabled @@ -1119,8 +1119,8 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Gets the DropTarget associated with this - * Component. + * Gets the {@code DropTarget} associated with this + * {@code Component}. * * @return the drop target */ @@ -1128,18 +1128,18 @@ public abstract class Component implements ImageObserver, MenuContainer, public synchronized DropTarget getDropTarget() { return dropTarget; } /** - * Gets the GraphicsConfiguration associated with this - * Component. - * If the Component has not been assigned a specific - * GraphicsConfiguration, - * the GraphicsConfiguration of the - * Component object's top-level container is + * Gets the {@code GraphicsConfiguration} associated with this + * {@code Component}. + * If the {@code Component} has not been assigned a specific + * {@code GraphicsConfiguration}, + * the {@code GraphicsConfiguration} of the + * {@code Component} object's top-level container is * returned. - * If the Component has been created, but not yet added - * to a Container, this method returns null. + * If the {@code Component} has been created, but not yet added + * to a {@code Container}, this method returns {@code null}. * - * @return the GraphicsConfiguration used by this - * Component or null + * @return the {@code GraphicsConfiguration} used by this + * {@code Component} or {@code null} * @since 1.3 */ public GraphicsConfiguration getGraphicsConfiguration() { @@ -1176,8 +1176,8 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Checks that this component's GraphicsDevice - * idString matches the string argument. + * Checks that this component's {@code GraphicsDevice} + * {@code idString} matches the string argument. */ void checkGD(String stringID) { if (graphicsConfig != null) { @@ -1243,7 +1243,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * In order to account for peers' size requirements, components are invalidated * before they are first shown on the screen. By the time the parent container * is fully realized, all its components will be valid. - * @return true if the component is valid, false + * @return {@code true} if the component is valid, {@code false} * otherwise * @see #validate * @see #invalidate @@ -1268,8 +1268,8 @@ public abstract class Component implements ImageObserver, MenuContainer, * is made undisplayable. A containment hierarchy is made * undisplayable when its ancestor window is disposed. * - * @return true if the component is displayable, - * false otherwise + * @return {@code true} if the component is displayable, + * {@code false} otherwise * @see Container#add(Component) * @see Window#pack * @see Window#show @@ -1285,9 +1285,9 @@ public abstract class Component implements ImageObserver, MenuContainer, * Determines whether this component should be visible when its * parent is visible. Components are * initially visible, with the exception of top level components such - * as Frame objects. - * @return true if the component is visible, - * false otherwise + * as {@code Frame} objects. + * @return {@code true} if the component is visible, + * {@code false} otherwise * @see #setVisible * @since 1.0 */ @@ -1301,9 +1301,9 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Determines whether this component will be displayed on the screen. - * @return true if the component and all of its ancestors + * @return {@code true} if the component and all of its ancestors * until a toplevel window or null parent are visible, - * false otherwise + * {@code false} otherwise */ boolean isRecursivelyVisible() { return visible && (parent == null || parent.isRecursivelyVisible()); @@ -1368,30 +1368,30 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Returns the position of the mouse pointer in this Component's - * coordinate space if the Component is directly under the mouse - * pointer, otherwise returns null. - * If the Component is not showing on the screen, this method - * returns null even if the mouse pointer is above the area - * where the Component would be displayed. - * If the Component is partially or fully obscured by other - * Components or native windows, this method returns a non-null + * Returns the position of the mouse pointer in this {@code Component}'s + * coordinate space if the {@code Component} is directly under the mouse + * pointer, otherwise returns {@code null}. + * If the {@code Component} is not showing on the screen, this method + * returns {@code null} even if the mouse pointer is above the area + * where the {@code Component} would be displayed. + * If the {@code Component} is partially or fully obscured by other + * {@code Component}s or native windows, this method returns a non-null * value only if the mouse pointer is located above the unobscured part of the - * Component. + * {@code Component}. *

          - * For Containers it returns a non-null value if the mouse is - * above the Container itself or above any of its descendants. + * For {@code Container}s it returns a non-null value if the mouse is + * above the {@code Container} itself or above any of its descendants. * Use {@link Container#getMousePosition(boolean)} if you need to exclude children. *

          * Sometimes the exact mouse coordinates are not important, and the only thing - * that matters is whether a specific Component is under the mouse - * pointer. If the return value of this method is null, mouse - * pointer is not directly above the Component. + * that matters is whether a specific {@code Component} is under the mouse + * pointer. If the return value of this method is {@code null}, mouse + * pointer is not directly above the {@code Component}. * * @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true * @see #isShowing * @see Container#getMousePosition - * @return mouse coordinates relative to this Component, or null + * @return mouse coordinates relative to this {@code Component}, or null * @since 1.5 */ public Point getMousePosition() throws HeadlessException { @@ -1436,8 +1436,8 @@ public abstract class Component implements ImageObserver, MenuContainer, *

        • the {@code Component} is obscured by another {@code Component} or * {@code Container}. *
        - * @return true if the component is showing, - * false otherwise + * @return {@code true} if the component is showing, + * {@code false} otherwise * @see #setVisible * @since 1.0 */ @@ -1453,9 +1453,9 @@ public abstract class Component implements ImageObserver, MenuContainer, * Determines whether this component is enabled. An enabled component * can respond to user input and generate events. Components are * enabled initially by default. A component may be enabled or disabled by - * calling its setEnabled method. - * @return true if the component is enabled, - * false otherwise + * calling its {@code setEnabled} method. + * @return {@code true} if the component is enabled, + * {@code false} otherwise * @see #setEnabled * @since 1.0 */ @@ -1473,7 +1473,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Enables or disables this component, depending on the value of the - * parameter b. An enabled component can respond to user + * parameter {@code b}. An enabled component can respond to user * input and generate events. Components are enabled initially by default. * *

        Note: Disabling a lightweight component does not prevent it from @@ -1482,7 +1482,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * in this container from receiving any input events. But disabling a * lightweight container affects only this container. * - * @param b If true, this component is + * @param b If {@code true}, this component is * enabled; otherwise this component is disabled * @see #isEnabled * @see #isLightweight @@ -1494,7 +1494,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * @deprecated As of JDK version 1.1, - * replaced by setEnabled(boolean). + * replaced by {@code setEnabled(boolean)}. */ @Deprecated public void enable() { @@ -1524,7 +1524,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * otherwise {@code false} * * @deprecated As of JDK version 1.1, - * replaced by setEnabled(boolean). + * replaced by {@code setEnabled(boolean)}. */ @Deprecated public void enable(boolean b) { @@ -1537,7 +1537,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * @deprecated As of JDK version 1.1, - * replaced by setEnabled(boolean). + * replaced by {@code setEnabled(boolean)}. */ @Deprecated public void disable() { @@ -1627,12 +1627,12 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Shows or hides this component depending on the value of parameter - * b. + * {@code b}. *

        * This method changes layout-related information, and therefore, * invalidates the component hierarchy. * - * @param b if true, shows this component; + * @param b if {@code true}, shows this component; * otherwise, hides this component * @see #isVisible * @see #invalidate @@ -1644,7 +1644,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * @deprecated As of JDK version 1.1, - * replaced by setVisible(boolean). + * replaced by {@code setVisible(boolean)}. */ @Deprecated public void show() { @@ -1687,7 +1687,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * otherwise {@code false} * * @deprecated As of JDK version 1.1, - * replaced by setVisible(boolean). + * replaced by {@code setVisible(boolean)}. */ @Deprecated public void show(boolean b) { @@ -1712,7 +1712,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * @deprecated As of JDK version 1.1, - * replaced by setVisible(boolean). + * replaced by {@code setVisible(boolean)}. */ @Deprecated public void hide() { @@ -1775,7 +1775,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Sets the foreground color of this component. * @param c the color to become this component's - * foreground color; if this parameter is null + * foreground color; if this parameter is {@code null} * then this component will inherit * the foreground color of its parent * @see #getForeground @@ -1798,11 +1798,11 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns whether the foreground color has been explicitly set for this - * Component. If this method returns false, this Component is + * Component. If this method returns {@code false}, this Component is * inheriting its foreground color from an ancestor. * - * @return true if the foreground color has been explicitly - * set for this Component; false otherwise. + * @return {@code true} if the foreground color has been explicitly + * set for this Component; {@code false} otherwise. * @since 1.4 */ public boolean isForegroundSet() { @@ -1835,7 +1835,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * may differ between operating systems. * * @param c the color to become this component's color; - * if this parameter is null, then this + * if this parameter is {@code null}, then this * component will inherit the background color of its parent * @see #getBackground * @since 1.0 @@ -1857,11 +1857,11 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns whether the background color has been explicitly set for this - * Component. If this method returns false, this Component is + * Component. If this method returns {@code false}, this Component is * inheriting its background color from an ancestor. * - * @return true if the background color has been explicitly - * set for this Component; false otherwise. + * @return {@code true} if the background color has been explicitly + * set for this Component; {@code false} otherwise. * @since 1.4 */ public boolean isBackgroundSet() { @@ -1900,7 +1900,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * invalidates the component hierarchy. * * @param f the font to become this component's font; - * if this parameter is null then this + * if this parameter is {@code null} then this * component will inherit the font of its parent * @see #getFont * @see #invalidate @@ -1935,11 +1935,11 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns whether the font has been explicitly set for this Component. If - * this method returns false, this Component is inheriting its + * this method returns {@code false}, this Component is inheriting its * font from an ancestor. * - * @return true if the font has been explicitly set for this - * Component; false otherwise. + * @return {@code true} if the font has been explicitly set for this + * Component; {@code false} otherwise. * @since 1.4 */ public boolean isFontSet() { @@ -1951,7 +1951,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * @return this component's locale; if this component does not * have a locale, the locale of its parent is returned * @see #setLocale - * @exception IllegalComponentStateException if the Component + * @exception IllegalComponentStateException if the {@code Component} * does not have its own locale and has not yet been added to * a containment hierarchy such that the locale can be determined * from the containing parent @@ -1995,7 +1995,7 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Gets the instance of ColorModel used to display + * Gets the instance of {@code ColorModel} used to display * the component on the output device. * @return the color model used by this component * @see java.awt.image.ColorModel @@ -2020,13 +2020,13 @@ public abstract class Component implements ImageObserver, MenuContainer, *

        * Due to the asynchronous nature of native event handling, this * method can return outdated values (for instance, after several calls - * of setLocation() in rapid succession). For this + * of {@code setLocation()} in rapid succession). For this * reason, the recommended method of obtaining a component's position is - * within java.awt.event.ComponentListener.componentMoved(), + * within {@code java.awt.event.ComponentListener.componentMoved()}, * which is called after the operating system has finished moving the * component. *

        - * @return an instance of Point representing + * @return an instance of {@code Point} representing * the top-left corner of the component's bounds in * the coordinate space of the component's parent * @see #setLocation @@ -2041,7 +2041,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Gets the location of this component in the form of a point * specifying the component's top-left corner in the screen's * coordinate space. - * @return an instance of Point representing + * @return an instance of {@code Point} representing * the top-left corner of the component's bounds in the * coordinate space of the screen * @throws IllegalComponentStateException if the @@ -2087,7 +2087,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * * @return the location of this component's top left corner * @deprecated As of JDK version 1.1, - * replaced by getLocation(). + * replaced by {@code getLocation()}. */ @Deprecated public Point location() { @@ -2100,7 +2100,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Moves this component to a new location. The top-left corner of - * the new location is specified by the x and y + * the new location is specified by the {@code x} and {@code y} * parameters in the coordinate space of this component's parent. *

        * This method changes layout-related information, and therefore, @@ -2128,7 +2128,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * top-left corner in the parent's coordinate space * * @deprecated As of JDK version 1.1, - * replaced by setLocation(int, int). + * replaced by {@code setLocation(int, int)}. */ @Deprecated public void move(int x, int y) { @@ -2140,8 +2140,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Moves this component to a new location. The top-left corner of - * the new location is specified by point p. Point - * p is given in the parent's coordinate space. + * the new location is specified by point {@code p}. Point + * {@code p} is given in the parent's coordinate space. *

        * This method changes layout-related information, and therefore, * invalidates the component hierarchy. @@ -2160,12 +2160,12 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns the size of this component in the form of a - * Dimension object. The height - * field of the Dimension object contains - * this component's height, and the width - * field of the Dimension object contains + * {@code Dimension} object. The {@code height} + * field of the {@code Dimension} object contains + * this component's height, and the {@code width} + * field of the {@code Dimension} object contains * this component's width. - * @return a Dimension object that indicates the + * @return a {@code Dimension} object that indicates the * size of this component * @see #setSize * @since 1.1 @@ -2181,7 +2181,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * @return the {@code Dimension} object that indicates the * size of this component * @deprecated As of JDK version 1.1, - * replaced by getSize(). + * replaced by {@code getSize()}. */ @Deprecated public Dimension size() { @@ -2189,8 +2189,8 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Resizes this component so that it has width width - * and height height. + * Resizes this component so that it has width {@code width} + * and height {@code height}. *

        * This method changes layout-related information, and therefore, * invalidates the component hierarchy. @@ -2212,7 +2212,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * @param width the new width of the component * @param height the new height of the component * @deprecated As of JDK version 1.1, - * replaced by setSize(int, int). + * replaced by {@code setSize(int, int)}. */ @Deprecated public void resize(int width, int height) { @@ -2223,8 +2223,8 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Resizes this component so that it has width d.width - * and height d.height. + * Resizes this component so that it has width {@code d.width} + * and height {@code d.height}. *

        * This method changes layout-related information, and therefore, * invalidates the component hierarchy. @@ -2247,7 +2247,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * * @param d the new size of this component * @deprecated As of JDK version 1.1, - * replaced by setSize(Dimension). + * replaced by {@code setSize(Dimension)}. */ @Deprecated public void resize(Dimension d) { @@ -2256,7 +2256,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Gets the bounds of this component in the form of a - * Rectangle object. The bounds specify this + * {@code Rectangle} object. The bounds specify this * component's width, height, and location relative to * its parent. * @return a rectangle indicating this component's bounds @@ -2273,7 +2273,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * * @return the bounding rectangle for this component * @deprecated As of JDK version 1.1, - * replaced by getBounds(). + * replaced by {@code getBounds()}. */ @Deprecated public Rectangle bounds() { @@ -2282,16 +2282,16 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Moves and resizes this component. The new location of the top-left - * corner is specified by x and y, and the - * new size is specified by width and height. + * corner is specified by {@code x} and {@code y}, and the + * new size is specified by {@code width} and {@code height}. *

        * This method changes layout-related information, and therefore, * invalidates the component hierarchy. * * @param x the new x-coordinate of this component * @param y the new y-coordinate of this component - * @param width the new width of this component - * @param height the new height of this + * @param width the new {@code width} of this component + * @param height the new {@code height} of this * component * @see #getBounds * @see #setLocation(int, int) @@ -2314,7 +2314,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * @param height the height of the rectangle * * @deprecated As of JDK version 1.1, - * replaced by setBounds(int, int, int, int). + * replaced by {@code setBounds(int, int, int, int)}. */ @Deprecated public void reshape(int x, int y, int width, int height) { @@ -2434,10 +2434,10 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Moves and resizes this component to conform to the new - * bounding rectangle r. This component's new - * position is specified by r.x and r.y, - * and its new size is specified by r.width and - * r.height + * bounding rectangle {@code r}. This component's new + * position is specified by {@code r.x} and {@code r.y}, + * and its new size is specified by {@code r.width} and + * {@code r.height} *

        * This method changes layout-related information, and therefore, * invalidates the component hierarchy. @@ -2460,8 +2460,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns the current x coordinate of the components origin. * This method is preferable to writing - * component.getBounds().x, - * or component.getLocation().x because it doesn't + * {@code component.getBounds().x}, + * or {@code component.getLocation().x} because it doesn't * cause any heap allocations. * * @return the current x coordinate of the components origin @@ -2475,8 +2475,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns the current y coordinate of the components origin. * This method is preferable to writing - * component.getBounds().y, - * or component.getLocation().y because it + * {@code component.getBounds().y}, + * or {@code component.getLocation().y} because it * doesn't cause any heap allocations. * * @return the current y coordinate of the components origin @@ -2490,8 +2490,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns the current width of this component. * This method is preferable to writing - * component.getBounds().width, - * or component.getSize().width because it + * {@code component.getBounds().width}, + * or {@code component.getSize().width} because it * doesn't cause any heap allocations. * * @return the current width of this component @@ -2505,8 +2505,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns the current height of this component. * This method is preferable to writing - * component.getBounds().height, - * or component.getSize().height because it + * {@code component.getBounds().height}, + * or {@code component.getSize().height} because it * doesn't cause any heap allocations. * * @return the current height of this component @@ -2518,10 +2518,10 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Stores the bounds of this component into "return value" rv and - * return rv. If rv is null a new - * Rectangle is allocated. - * This version of getBounds is useful if the caller - * wants to avoid allocating a new Rectangle object + * return rv. If rv is {@code null} a new + * {@code Rectangle} is allocated. + * This version of {@code getBounds} is useful if the caller + * wants to avoid allocating a new {@code Rectangle} object * on the heap. * * @param rv the return value, modified to the components bounds @@ -2539,10 +2539,10 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Stores the width/height of this component into "return value" rv - * and return rv. If rv is null a new - * Dimension object is allocated. This version of - * getSize is useful if the caller wants to avoid - * allocating a new Dimension object on the heap. + * and return rv. If rv is {@code null} a new + * {@code Dimension} object is allocated. This version of + * {@code getSize} is useful if the caller wants to avoid + * allocating a new {@code Dimension} object on the heap. * * @param rv the return value, modified to the components size * @return rv @@ -2559,10 +2559,10 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Stores the x,y origin of this component into "return value" rv - * and return rv. If rv is null a new - * Point is allocated. - * This version of getLocation is useful if the - * caller wants to avoid allocating a new Point + * and return rv. If rv is {@code null} a new + * {@code Point} is allocated. + * This version of {@code getLocation} is useful if the + * caller wants to avoid allocating a new {@code Point} * object on the heap. * * @param rv the return value, modified to the components location @@ -2607,12 +2607,12 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * A lightweight component doesn't have a native toolkit peer. - * Subclasses of Component and Container, - * other than the ones defined in this package like Button - * or Scrollbar, are lightweight. + * Subclasses of {@code Component} and {@code Container}, + * other than the ones defined in this package like {@code Button} + * or {@code Scrollbar}, are lightweight. * All of the Swing components are lightweights. *

        - * This method will always return false if this component + * This method will always return {@code false} if this component * is not displayable because it is impossible to determine the * weight of an undisplayable component. * @@ -2628,8 +2628,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Sets the preferred size of this component to a constant - * value. Subsequent calls to getPreferredSize will always - * return this value. Setting the preferred size to null + * value. Subsequent calls to {@code getPreferredSize} will always + * return this value. Setting the preferred size to {@code null} * restores the default behavior. * * @param preferredSize The new preferred size, or null @@ -2656,9 +2656,9 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns true if the preferred size has been set to a - * non-null value otherwise returns false. + * non-{@code null} value otherwise returns false. * - * @return true if setPreferredSize has been invoked + * @return true if {@code setPreferredSize} has been invoked * with a non-null value. * @since 1.5 */ @@ -2683,7 +2683,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * * @return the component's preferred size * @deprecated As of JDK version 1.1, - * replaced by getPreferredSize(). + * replaced by {@code getPreferredSize()}. */ @Deprecated public Dimension preferredSize() { @@ -2704,8 +2704,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Sets the minimum size of this component to a constant - * value. Subsequent calls to getMinimumSize will always - * return this value. Setting the minimum size to null + * value. Subsequent calls to {@code getMinimumSize} will always + * return this value. Setting the minimum size to {@code null} * restores the default behavior. * * @param minimumSize the new minimum size of this component @@ -2730,10 +2730,10 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Returns whether or not setMinimumSize has been + * Returns whether or not {@code setMinimumSize} has been * invoked with a non-null value. * - * @return true if setMinimumSize has been invoked with a + * @return true if {@code setMinimumSize} has been invoked with a * non-null value. * @since 1.5 */ @@ -2756,7 +2756,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * * @return the minimum size of this component * @deprecated As of JDK version 1.1, - * replaced by getMinimumSize(). + * replaced by {@code getMinimumSize()}. */ @Deprecated public Dimension minimumSize() { @@ -2777,11 +2777,11 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Sets the maximum size of this component to a constant - * value. Subsequent calls to getMaximumSize will always - * return this value. Setting the maximum size to null + * value. Subsequent calls to {@code getMaximumSize} will always + * return this value. Setting the maximum size to {@code null} * restores the default behavior. * - * @param maximumSize a Dimension containing the + * @param maximumSize a {@code Dimension} containing the * desired maximum allowable size * @see #getMaximumSize * @see #isMaximumSizeSet @@ -2804,10 +2804,10 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Returns true if the maximum size has been set to a non-null + * Returns true if the maximum size has been set to a non-{@code null} * value otherwise returns false. * - * @return true if maximumSize is non-null, + * @return true if {@code maximumSize} is non-{@code null}, * false otherwise * @since 1.5 */ @@ -2858,16 +2858,16 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns the baseline. The baseline is measured from the top of * the component. This method is primarily meant for - * LayoutManagers to align components along their + * {@code LayoutManager}s to align components along their * baseline. A return value less than 0 indicates this component * does not have a reasonable baseline and that - * LayoutManagers should not align this component on + * {@code LayoutManager}s should not align this component on * its baseline. *

        * The default implementation returns -1. Subclasses that support * baseline should override appropriately. If a value >= 0 is * returned, then the component has a valid baseline for any - * size >= the minimum size and getBaselineResizeBehavior + * size >= the minimum size and {@code getBaselineResizeBehavior} * can be used to determine how the baseline changes with size. * * @param width the width to get the baseline for @@ -2893,15 +2893,15 @@ public abstract class Component implements ImageObserver, MenuContainer, * layout managers and GUI builders. *

        * The default implementation returns - * BaselineResizeBehavior.OTHER. Subclasses that have a + * {@code BaselineResizeBehavior.OTHER}. Subclasses that have a * baseline should override appropriately. Subclasses should - * never return null; if the baseline can not be - * calculated return BaselineResizeBehavior.OTHER. Callers + * never return {@code null}; if the baseline can not be + * calculated return {@code BaselineResizeBehavior.OTHER}. Callers * should first ask for the baseline using - * getBaseline and if a value >= 0 is returned use + * {@code getBaseline} and if a value >= 0 is returned use * this method. It is acceptable for this method to return a - * value other than BaselineResizeBehavior.OTHER even if - * getBaseline returns a value less than 0. + * value other than {@code BaselineResizeBehavior.OTHER} even if + * {@code getBaseline} returns a value less than 0. * * @return an enum indicating how the baseline changes as the component * size changes @@ -2925,7 +2925,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * @deprecated As of JDK version 1.1, - * replaced by doLayout(). + * replaced by {@code doLayout()}. */ @Deprecated public void layout() { @@ -3074,9 +3074,9 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Creates a graphics context for this component. This method will - * return null if this component is currently not + * return {@code null} if this component is currently not * displayable. - * @return a graphics context for this component, or null + * @return a graphics context for this component, or {@code null} * if it has none * @see #paint * @since 1.0 @@ -3138,7 +3138,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * {@link Font Font} class. * @param font the font for which font metrics is to be * obtained - * @return the font metrics for font + * @return the font metrics for {@code font} * @see #getFont * @see java.awt.peer.ComponentPeer#getFontMetrics(Font) * @see Toolkit#getFontMetrics(Font) @@ -3161,19 +3161,19 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Sets the cursor image to the specified cursor. This cursor - * image is displayed when the contains method for + * image is displayed when the {@code contains} method for * this component returns true for the current cursor location, and * this Component is visible, displayable, and enabled. Setting the - * cursor of a Container causes that cursor to be displayed + * cursor of a {@code Container} causes that cursor to be displayed * within all of the container's subcomponents, except for those - * that have a non-null cursor. + * that have a non-{@code null} cursor. *

        * The method may have no visual effect if the Java platform * implementation and/or the native system do not support * changing the mouse cursor shape. * @param cursor One of the constants defined - * by the Cursor class; - * if this parameter is null + * by the {@code Cursor} class; + * if this parameter is {@code null} * then this component will inherit * the cursor of its parent * @see #isEnabled @@ -3213,7 +3213,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Gets the cursor set in the component. If the component does * not have a cursor set, the cursor of its parent is returned. * If no cursor is set in the entire hierarchy, - * Cursor.DEFAULT_CURSOR is returned. + * {@code Cursor.DEFAULT_CURSOR} is returned. * * @return the cursor for this component * @see #setCursor @@ -3238,11 +3238,11 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns whether the cursor has been explicitly set for this Component. - * If this method returns false, this Component is inheriting + * If this method returns {@code false}, this Component is inheriting * its cursor from an ancestor. * - * @return true if the cursor has been explicitly set for this - * Component; false otherwise. + * @return {@code true} if the cursor has been explicitly set for this + * Component; {@code false} otherwise. * @since 1.4 */ public boolean isCursorSet() { @@ -3255,12 +3255,12 @@ public abstract class Component implements ImageObserver, MenuContainer, * This method is called when the contents of the component should * be painted; such as when the component is first being shown or * is damaged and in need of repair. The clip rectangle in the - * Graphics parameter is set to the area + * {@code Graphics} parameter is set to the area * which needs to be painted. - * Subclasses of Component that override this - * method need not call super.paint(g). + * Subclasses of {@code Component} that override this + * method need not call {@code super.paint(g)}. *

        - * For performance reasons, Components with zero width + * For performance reasons, {@code Component}s with zero width * or height aren't considered to need painting when they are first shown, * and also aren't considered to need repair. *

        @@ -3280,21 +3280,21 @@ public abstract class Component implements ImageObserver, MenuContainer, * Updates this component. *

        * If this component is not a lightweight component, the - * AWT calls the update method in response to - * a call to repaint. You can assume that + * AWT calls the {@code update} method in response to + * a call to {@code repaint}. You can assume that * the background is not cleared. *

        - * The update method of Component - * calls this component's paint method to redraw + * The {@code update} method of {@code Component} + * calls this component's {@code paint} method to redraw * this component. This method is commonly overridden by subclasses * which need to do additional work in response to a call to - * repaint. + * {@code repaint}. * Subclasses of Component that override this method should either - * call super.update(g), or call paint(g) - * directly from their update method. + * call {@code super.update(g)}, or call {@code paint(g)} + * directly from their {@code update} method. *

        * The origin of the graphics context, its - * (00) coordinate point, is the + * ({@code 0}, {@code 0}) coordinate point, is the * top-left corner of this component. The clipping region of the * graphics context is the bounding rectangle of this component. * @@ -3317,7 +3317,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Paints this component and all of its subcomponents. *

        * The origin of the graphics context, its - * (00) coordinate point, is the + * ({@code 0}, {@code 0}) coordinate point, is the * top-left corner of this component. The clipping region of the * graphics context is the bounding rectangle of this component. * @@ -3355,9 +3355,9 @@ public abstract class Component implements ImageObserver, MenuContainer, * Repaints this component. *

        * If this component is a lightweight component, this method - * causes a call to this component's paint + * causes a call to this component's {@code paint} * method as soon as possible. Otherwise, this method causes - * a call to this component's update method as soon + * a call to this component's {@code update} method as soon * as possible. *

        * Note: For more information on the paint mechanisms utilitized @@ -3375,8 +3375,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Repaints the component. If this component is a lightweight - * component, this results in a call to paint - * within tm milliseconds. + * component, this results in a call to {@code paint} + * within {@code tm} milliseconds. *

        * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most @@ -3396,9 +3396,9 @@ public abstract class Component implements ImageObserver, MenuContainer, * Repaints the specified rectangle of this component. *

        * If this component is a lightweight component, this method - * causes a call to this component's paint method + * causes a call to this component's {@code paint} method * as soon as possible. Otherwise, this method causes a call to - * this component's update method as soon as possible. + * this component's {@code update} method as soon as possible. *

        * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most @@ -3418,12 +3418,12 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Repaints the specified rectangle of this component within - * tm milliseconds. + * {@code tm} milliseconds. *

        * If this component is a lightweight component, this method causes - * a call to this component's paint method. + * a call to this component's {@code paint} method. * Otherwise, this method causes a call to this component's - * update method. + * {@code update} method. *

        * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most @@ -3481,10 +3481,10 @@ public abstract class Component implements ImageObserver, MenuContainer, * printed or should be printed differently than they are painted. *

        * The default implementation of this method calls the - * paint method. + * {@code paint} method. *

        * The origin of the graphics context, its - * (00) coordinate point, is the + * ({@code 0}, {@code 0}) coordinate point, is the * top-left corner of this component. The clipping region of the * graphics context is the bounding rectangle of this component. * @param g the graphics context to use for printing @@ -3499,7 +3499,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Prints this component and all of its subcomponents. *

        * The origin of the graphics context, its - * (00) coordinate point, is the + * ({@code 0}, {@code 0}) coordinate point, is the * top-left corner of this component. The clipping region of the * graphics context is the bounding rectangle of this component. * @param g the graphics context to use for printing @@ -3542,41 +3542,41 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Repaints the component when the image has changed. - * This imageUpdate method of an ImageObserver + * This {@code imageUpdate} method of an {@code ImageObserver} * is called when more information about an * image which had been previously requested using an asynchronous - * routine such as the drawImage method of - * Graphics becomes available. - * See the definition of imageUpdate for + * routine such as the {@code drawImage} method of + * {@code Graphics} becomes available. + * See the definition of {@code imageUpdate} for * more information on this method and its arguments. *

        - * The imageUpdate method of Component + * The {@code imageUpdate} method of {@code Component} * incrementally draws an image on the component as more of the bits * of the image are available. *

        - * If the system property awt.image.incrementaldraw - * is missing or has the value true, the image is + * If the system property {@code awt.image.incrementaldraw} + * is missing or has the value {@code true}, the image is * incrementally drawn. If the system property has any other value, * then the image is not drawn until it has been completely loaded. *

        * Also, if incremental drawing is in effect, the value of the - * system property awt.image.redrawrate is interpreted + * system property {@code awt.image.redrawrate} is interpreted * as an integer to give the maximum redraw rate, in milliseconds. If * the system property is missing or cannot be interpreted as an * integer, the redraw rate is once every 100ms. *

        - * The interpretation of the x, y, - * width, and height arguments depends on - * the value of the infoflags argument. + * The interpretation of the {@code x}, {@code y}, + * {@code width}, and {@code height} arguments depends on + * the value of the {@code infoflags} argument. * * @param img the image being observed - * @param infoflags see imageUpdate for more information + * @param infoflags see {@code imageUpdate} for more information * @param x the x coordinate * @param y the y coordinate * @param w the width * @param h the height - * @return false if the infoflags indicate that the - * image is completely loaded; true otherwise. + * @return {@code false} if the infoflags indicate that the + * image is completely loaded; {@code true} otherwise. * * @see java.awt.image.ImageObserver * @see Graphics#drawImage(Image, int, int, Color, java.awt.image.ImageObserver) @@ -3699,12 +3699,12 @@ public abstract class Component implements ImageObserver, MenuContainer, * Prepares an image for rendering on this component. The image * data is downloaded asynchronously in another thread and the * appropriate screen representation of the image is generated. - * @param image the Image for which to + * @param image the {@code Image} for which to * prepare a screen representation - * @param observer the ImageObserver object + * @param observer the {@code ImageObserver} object * to be notified as the image is being prepared - * @return true if the image has already been fully - * prepared; false otherwise + * @return {@code true} if the image has already been fully + * prepared; {@code false} otherwise * @since 1.0 */ public boolean prepareImage(Image image, ImageObserver observer) { @@ -3718,14 +3718,14 @@ public abstract class Component implements ImageObserver, MenuContainer, * The image data is downloaded asynchronously in another thread, * and an appropriately scaled screen representation of the image is * generated. - * @param image the instance of Image + * @param image the instance of {@code Image} * for which to prepare a screen representation * @param width the width of the desired screen representation * @param height the height of the desired screen representation - * @param observer the ImageObserver object + * @param observer the {@code ImageObserver} object * to be notified as the image is being prepared - * @return true if the image has already been fully - * prepared; false otherwise + * @return {@code true} if the image has already been fully + * prepared; {@code false} otherwise * @see java.awt.image.ImageObserver * @since 1.0 */ @@ -3748,17 +3748,17 @@ public abstract class Component implements ImageObserver, MenuContainer, * of the specified image. *

        * This method does not cause the image to begin loading. An - * application must use the prepareImage method + * application must use the {@code prepareImage} method * to force the loading of an image. *

        * Information on the flags returned by this method can be found - * with the discussion of the ImageObserver interface. - * @param image the Image object whose status + * with the discussion of the {@code ImageObserver} interface. + * @param image the {@code Image} object whose status * is being checked - * @param observer the ImageObserver + * @param observer the {@code ImageObserver} * object to be notified as the image is being prepared * @return the bitwise inclusive OR of - * ImageObserver flags indicating what + * {@code ImageObserver} flags indicating what * information about the image is currently available * @see #prepareImage(Image, int, int, java.awt.image.ImageObserver) * @see Toolkit#checkImage(Image, int, int, java.awt.image.ImageObserver) @@ -3774,27 +3774,27 @@ public abstract class Component implements ImageObserver, MenuContainer, * of the specified image. *

        * This method does not cause the image to begin loading. An - * application must use the prepareImage method + * application must use the {@code prepareImage} method * to force the loading of an image. *

        - * The checkImage method of Component - * calls its peer's checkImage method to calculate + * The {@code checkImage} method of {@code Component} + * calls its peer's {@code checkImage} method to calculate * the flags. If this component does not yet have a peer, the - * component's toolkit's checkImage method is called + * component's toolkit's {@code checkImage} method is called * instead. *

        * Information on the flags returned by this method can be found - * with the discussion of the ImageObserver interface. - * @param image the Image object whose status + * with the discussion of the {@code ImageObserver} interface. + * @param image the {@code Image} object whose status * is being checked * @param width the width of the scaled version * whose status is to be checked * @param height the height of the scaled version * whose status is to be checked - * @param observer the ImageObserver object + * @param observer the {@code ImageObserver} object * to be notified as the image is being prepared * @return the bitwise inclusive OR of - * ImageObserver flags indicating what + * {@code ImageObserver} flags indicating what * information about the image is currently available * @see #prepareImage(Image, int, int, java.awt.image.ImageObserver) * @see Toolkit#checkImage(Image, int, int, java.awt.image.ImageObserver) @@ -3819,7 +3819,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Creates a new strategy for multi-buffering on this component. * Multi-buffering is useful for rendering performance. This method * attempts to create the best strategy available with the number of - * buffers supplied. It will always create a BufferStrategy + * buffers supplied. It will always create a {@code BufferStrategy} * with that number of buffers. * A page-flipping strategy is attempted first, then a blitting strategy * using accelerated buffers. Finally, an unaccelerated blitting @@ -3880,17 +3880,17 @@ public abstract class Component implements ImageObserver, MenuContainer, * buffer capabilities). *

        * Each time this method - * is called, dispose will be invoked on the existing - * BufferStrategy. + * is called, {@code dispose} will be invoked on the existing + * {@code BufferStrategy}. * @param numBuffers number of buffers to create * @param caps the required capabilities for creating the buffer strategy; - * cannot be null + * cannot be {@code null} * @exception AWTException if the capabilities supplied could not be * supported or met; this may happen, for example, if there is not enough * accelerated memory currently available, or if page flipping is specified * but not possible. * @exception IllegalArgumentException if numBuffers is less than 1, or if - * caps is null + * caps is {@code null} * @see Window#getBufferStrategy() * @see Canvas#getBufferStrategy() * @since 1.4 @@ -3975,7 +3975,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Inner class for flipping buffers on a component. That component must - * be a Canvas or Window or Applet. + * be a {@code Canvas} or {@code Window} or {@code Applet}. * @see Canvas * @see Window * @see Applet @@ -4026,8 +4026,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Creates a new flipping buffer strategy for this component. - * The component must be a Canvas or Window or - * Applet. + * The component must be a {@code Canvas} or {@code Window} or + * {@code Applet}. * @see Canvas * @see Window * @see Applet @@ -4064,14 +4064,14 @@ public abstract class Component implements ImageObserver, MenuContainer, * @param numBuffers number of buffers to create; must be greater than * one * @param caps the capabilities of the buffers. - * BufferCapabilities.isPageFlipping must be - * true. + * {@code BufferCapabilities.isPageFlipping} must be + * {@code true}. * @exception AWTException if the capabilities supplied could not be * supported or met * @exception IllegalStateException if the component has no peer * @exception IllegalArgumentException if numBuffers is less than two, - * or if BufferCapabilities.isPageFlipping is not - * true. + * or if {@code BufferCapabilities.isPageFlipping} is not + * {@code true}. * @see java.awt.BufferCapabilities#isPageFlipping() */ protected void createBuffers(int numBuffers, BufferCapabilities caps) @@ -4152,7 +4152,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * either by copying or by moving the video pointer. * @param flipAction an integer value describing the flipping action * for the contents of the back buffer. This should be one of the - * values of the BufferCapabilities.FlipContents + * values of the {@code BufferCapabilities.FlipContents} * property. * @exception IllegalStateException if the buffers have not yet * been created @@ -4266,7 +4266,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * @return whether the drawing buffer was lost since the last call to - * getDrawGraphics + * {@code getDrawGraphics} */ public boolean contentsLost() { if (drawVBuffer == null) { @@ -4553,7 +4553,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * @return whether the drawing buffer was lost since the last call to - * getDrawGraphics + * {@code getDrawGraphics} */ public boolean contentsLost() { if (backBuffers == null) { @@ -4632,7 +4632,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Inner class for flipping buffers on a component. That component must - * be a Canvas or Window. + * be a {@code Canvas} or {@code Window}. * @see Canvas * @see Window * @see java.awt.image.BufferStrategy @@ -4700,7 +4700,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Checks whether this component "contains" the specified point, - * where x and y are defined to be + * where {@code x} and {@code y} are defined to be * relative to the coordinate system of this component. * * @param x the x coordinate of the point @@ -4753,15 +4753,15 @@ public abstract class Component implements ImageObserver, MenuContainer, * inside a subcomponent that itself has subcomponents, it does not * go looking down the subcomponent tree. *

        - * The locate method of Component simply + * The {@code locate} method of {@code Component} simply * returns the component itself if the (xy) - * coordinate location is inside its bounding box, and null + * coordinate location is inside its bounding box, and {@code null} * otherwise. * @param x the x coordinate * @param y the y coordinate * @return the component or subcomponent that contains the * (xy) location; - * null if the location + * {@code null} if the location * is outside this component * @see #contains(int, int) * @since 1.0 @@ -4801,7 +4801,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * @param e the event to deliver * @deprecated As of JDK version 1.1, - * replaced by dispatchEvent(AWTEvent e). + * replaced by {@code dispatchEvent(AWTEvent e)}. */ @Deprecated public void deliverEvent(Event e) { @@ -4810,8 +4810,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Dispatches an event to this component or one of its sub components. - * Calls processEvent before returning for 1.1-style - * events which have been enabled for the Component. + * Calls {@code processEvent} before returning for 1.1-style + * events which have been enabled for the {@code Component}. * @param e the event */ public final void dispatchEvent(AWTEvent e) { @@ -5279,7 +5279,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Adds the specified component listener to receive component events from * this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5304,7 +5304,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * receives component events from this component. This method performs * no function, nor does it throw an exception, if the listener * specified by the argument was not previously added to this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5326,7 +5326,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the component listeners * registered on this component. * - * @return all ComponentListeners of this component + * @return all {@code ComponentListener}s of this component * or an empty array if no component * listeners are currently registered * @@ -5341,7 +5341,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Adds the specified focus listener to receive focus events from * this component when this component gains input focus. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5372,7 +5372,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * receives focus events from this component. This method performs * no function, nor does it throw an exception, if the listener * specified by the argument was not previously added to this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5395,7 +5395,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the focus listeners * registered on this component. * - * @return all of this component's FocusListeners + * @return all of this component's {@code FocusListener}s * or an empty array if no component * listeners are currently registered * @@ -5411,7 +5411,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Adds the specified hierarchy listener to receive hierarchy changed * events from this component when the hierarchy to which this container * belongs changes. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5449,7 +5449,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * receives hierarchy changed events from this component. This method * performs no function, nor does it throw an exception, if the listener * specified by the argument was not previously added to this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5486,7 +5486,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the hierarchy listeners * registered on this component. * - * @return all of this component's HierarchyListeners + * @return all of this component's {@code HierarchyListener}s * or an empty array if no hierarchy * listeners are currently registered * @@ -5502,7 +5502,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Adds the specified hierarchy bounds listener to receive hierarchy * bounds events from this component when the hierarchy to which this * container belongs changes. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5542,7 +5542,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * receives hierarchy bounds events from this component. This method * performs no function, nor does it throw an exception, if the listener * specified by the argument was not previously added to this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5648,7 +5648,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the hierarchy bounds listeners * registered on this component. * - * @return all of this component's HierarchyBoundsListeners + * @return all of this component's {@code HierarchyBoundsListener}s * or an empty array if no hierarchy bounds * listeners are currently registered * @@ -5704,7 +5704,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * receives key events from this component. This method performs * no function, nor does it throw an exception, if the listener * specified by the argument was not previously added to this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5727,7 +5727,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the key listeners * registered on this component. * - * @return all of this component's KeyListeners + * @return all of this component's {@code KeyListener}s * or an empty array if no key * listeners are currently registered * @@ -5742,7 +5742,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Adds the specified mouse listener to receive mouse events from * this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5773,7 +5773,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * receives mouse events from this component. This method performs * no function, nor does it throw an exception, if the listener * specified by the argument was not previously added to this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5796,7 +5796,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the mouse listeners * registered on this component. * - * @return all of this component's MouseListeners + * @return all of this component's {@code MouseListener}s * or an empty array if no mouse * listeners are currently registered * @@ -5811,7 +5811,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Adds the specified mouse motion listener to receive mouse motion * events from this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5842,7 +5842,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * receives mouse motion events from this component. This method performs * no function, nor does it throw an exception, if the listener * specified by the argument was not previously added to this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5865,7 +5865,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the mouse motion listeners * registered on this component. * - * @return all of this component's MouseMotionListeners + * @return all of this component's {@code MouseMotionListener}s * or an empty array if no mouse motion * listeners are currently registered * @@ -5885,7 +5885,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * For information on how mouse wheel events are dispatched, see * the class description for {@link MouseWheelEvent}. *

        - * If l is null, no exception is thrown and no + * If l is {@code null}, no exception is thrown and no * action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5938,7 +5938,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the mouse wheel listeners * registered on this component. * - * @return all of this component's MouseWheelListeners + * @return all of this component's {@code MouseWheelListener}s * or an empty array if no mouse wheel * listeners are currently registered * @@ -5954,9 +5954,9 @@ public abstract class Component implements ImageObserver, MenuContainer, * Adds the specified input method listener to receive * input method events from this component. A component will * only receive input method events from input methods - * if it also overrides getInputMethodRequests to return an - * InputMethodRequests instance. - * If listener l is null, + * if it also overrides {@code getInputMethodRequests} to return an + * {@code InputMethodRequests} instance. + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5982,7 +5982,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * receives input method events from this component. This method performs * no function, nor does it throw an exception, if the listener * specified by the argument was not previously added to this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -6005,7 +6005,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the input method listeners * registered on this component. * - * @return all of this component's InputMethodListeners + * @return all of this component's {@code InputMethodListener}s * or an empty array if no input method * listeners are currently registered * @@ -6020,16 +6020,16 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns an array of all the objects currently registered * as FooListeners - * upon this Component. + * upon this {@code Component}. * FooListeners are registered using the * addFooListener method. * *

        - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * Component c + * {@code Component c} * for its mouse listeners with the following code: * *

        MouseListener[] mls = (MouseListener[])(c.getListeners(MouseListener.class));
        @@ -6039,13 +6039,13 @@ public abstract class Component implements ImageObserver, MenuContainer, * @param the type of the listeners * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this component, * or an empty array if no such listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * @throws NullPointerException if {@code listenerType} is {@code null} * @see #getComponentListeners * @see #getFocusListeners @@ -6091,11 +6091,11 @@ public abstract class Component implements ImageObserver, MenuContainer, * Gets the input method request handler which supports * requests from input methods for this component. A component * that supports on-the-spot text input must override this - * method to return an InputMethodRequests instance. + * method to return an {@code InputMethodRequests} instance. * At the same time, it also has to handle input method events. * * @return the input method request handler for this component, - * null by default + * {@code null} by default * @see #addInputMethodListener * @since 1.2 */ @@ -6111,7 +6111,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * override this to return a private input context. * * @return the input context used by this component; - * null if no context can be determined + * {@code null} if no context can be determined * @since 1.2 */ public InputContext getInputContext() { @@ -6131,8 +6131,8 @@ public abstract class Component implements ImageObserver, MenuContainer, * that event type is added to the component. *

        * This method only needs to be invoked by subclasses of - * Component which desire to have the specified event - * types delivered to processEvent regardless of whether + * {@code Component} which desire to have the specified event + * types delivered to {@code processEvent} regardless of whether * or not a listener is registered. * @param eventsToEnable the event mask defining the event types * @see #processEvent @@ -6304,28 +6304,28 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Potentially coalesce an event being posted with an existing - * event. This method is called by EventQueue.postEvent + * event. This method is called by {@code EventQueue.postEvent} * if an event with the same ID as the event to be posted is found in * the queue (both events must have this component as their source). * This method either returns a coalesced event which replaces * the existing event (and the new event is then discarded), or - * null to indicate that no combining should be done + * {@code null} to indicate that no combining should be done * (add the second event to the end of the queue). Either event * parameter may be modified and returned, as the other one is discarded - * unless null is returned. + * unless {@code null} is returned. *

        - * This implementation of coalesceEvents coalesces + * This implementation of {@code coalesceEvents} coalesces * two event types: mouse move (and drag) events, * and paint (and update) events. * For mouse move events the last event is always returned, causing * intermediate moves to be discarded. For paint events, the new - * event is coalesced into a complex RepaintArea in the peer. - * The new AWTEvent is always returned. + * event is coalesced into a complex {@code RepaintArea} in the peer. + * The new {@code AWTEvent} is always returned. * - * @param existingEvent the event already on the EventQueue + * @param existingEvent the event already on the {@code EventQueue} * @param newEvent the event being posted to the - * EventQueue - * @return a coalesced event, or null indicating that no + * {@code EventQueue} + * @return a coalesced event, or {@code null} indicating that no * coalescing was done */ protected AWTEvent coalesceEvents(AWTEvent existingEvent, @@ -6338,7 +6338,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * method calls the appropriate * process<event type>Event * method for the given class of event. - *

        Note that if the event parameter is null + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6398,17 +6398,17 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Processes component events occurring on this component by * dispatching them to any registered - * ComponentListener objects. + * {@code ComponentListener} objects. *

        * This method is not called unless component events are * enabled for this component. Component events are enabled * when one of the following occurs: *

          - *
        • A ComponentListener object is registered - * via addComponentListener. - *
        • Component events are enabled via enableEvents. + *
        • A {@code ComponentListener} object is registered + * via {@code addComponentListener}. + *
        • Component events are enabled via {@code enableEvents}. *
        - *

        Note that if the event parameter is null + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6443,33 +6443,33 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Processes focus events occurring on this component by * dispatching them to any registered - * FocusListener objects. + * {@code FocusListener} objects. *

        * This method is not called unless focus events are * enabled for this component. Focus events are enabled * when one of the following occurs: *

          - *
        • A FocusListener object is registered - * via addFocusListener. - *
        • Focus events are enabled via enableEvents. + *
        • A {@code FocusListener} object is registered + * via {@code addFocusListener}. + *
        • Focus events are enabled via {@code enableEvents}. *
        *

        - * If focus events are enabled for a Component, - * the current KeyboardFocusManager determines + * If focus events are enabled for a {@code Component}, + * the current {@code KeyboardFocusManager} determines * whether or not a focus event should be dispatched to - * registered FocusListener objects. If the - * events are to be dispatched, the KeyboardFocusManager - * calls the Component's dispatchEvent - * method, which results in a call to the Component's - * processFocusEvent method. + * registered {@code FocusListener} objects. If the + * events are to be dispatched, the {@code KeyboardFocusManager} + * calls the {@code Component}'s {@code dispatchEvent} + * method, which results in a call to the {@code Component}'s + * {@code processFocusEvent} method. *

        - * If focus events are enabled for a Component, calling - * the Component's dispatchEvent method - * with a FocusEvent as the argument will result in a - * call to the Component's processFocusEvent - * method regardless of the current KeyboardFocusManager. + * If focus events are enabled for a {@code Component}, calling + * the {@code Component}'s {@code dispatchEvent} method + * with a {@code FocusEvent} as the argument will result in a + * call to the {@code Component}'s {@code processFocusEvent} + * method regardless of the current {@code KeyboardFocusManager}. * - *

        Note that if the event parameter is null + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6500,39 +6500,39 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Processes key events occurring on this component by * dispatching them to any registered - * KeyListener objects. + * {@code KeyListener} objects. *

        * This method is not called unless key events are * enabled for this component. Key events are enabled * when one of the following occurs: *

          - *
        • A KeyListener object is registered - * via addKeyListener. - *
        • Key events are enabled via enableEvents. + *
        • A {@code KeyListener} object is registered + * via {@code addKeyListener}. + *
        • Key events are enabled via {@code enableEvents}. *
        * *

        - * If key events are enabled for a Component, - * the current KeyboardFocusManager determines + * If key events are enabled for a {@code Component}, + * the current {@code KeyboardFocusManager} determines * whether or not a key event should be dispatched to - * registered KeyListener objects. The - * DefaultKeyboardFocusManager will not dispatch - * key events to a Component that is not the focus + * registered {@code KeyListener} objects. The + * {@code DefaultKeyboardFocusManager} will not dispatch + * key events to a {@code Component} that is not the focus * owner or is not showing. *

        - * As of J2SE 1.4, KeyEvents are redirected to + * As of J2SE 1.4, {@code KeyEvent}s are redirected to * the focus owner. Please see the * Focus Specification * for further information. *

        - * Calling a Component's dispatchEvent - * method with a KeyEvent as the argument will - * result in a call to the Component's - * processKeyEvent method regardless of the - * current KeyboardFocusManager as long as the + * Calling a {@code Component}'s {@code dispatchEvent} + * method with a {@code KeyEvent} as the argument will + * result in a call to the {@code Component}'s + * {@code processKeyEvent} method regardless of the + * current {@code KeyboardFocusManager} as long as the * component is showing, focused, and enabled, and key events * are enabled on it. - *

        If the event parameter is null + *

        If the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6569,17 +6569,17 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Processes mouse events occurring on this component by * dispatching them to any registered - * MouseListener objects. + * {@code MouseListener} objects. *

        * This method is not called unless mouse events are * enabled for this component. Mouse events are enabled * when one of the following occurs: *

          - *
        • A MouseListener object is registered - * via addMouseListener. - *
        • Mouse events are enabled via enableEvents. + *
        • A {@code MouseListener} object is registered + * via {@code addMouseListener}. + *
        • Mouse events are enabled via {@code enableEvents}. *
        - *

        Note that if the event parameter is null + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6617,17 +6617,17 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Processes mouse motion events occurring on this component by * dispatching them to any registered - * MouseMotionListener objects. + * {@code MouseMotionListener} objects. *

        * This method is not called unless mouse motion events are * enabled for this component. Mouse motion events are enabled * when one of the following occurs: *

          - *
        • A MouseMotionListener object is registered - * via addMouseMotionListener. - *
        • Mouse motion events are enabled via enableEvents. + *
        • A {@code MouseMotionListener} object is registered + * via {@code addMouseMotionListener}. + *
        • Mouse motion events are enabled via {@code enableEvents}. *
        - *

        Note that if the event parameter is null + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6656,21 +6656,21 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Processes mouse wheel events occurring on this component by * dispatching them to any registered - * MouseWheelListener objects. + * {@code MouseWheelListener} objects. *

        * This method is not called unless mouse wheel events are * enabled for this component. Mouse wheel events are enabled * when one of the following occurs: *

          - *
        • A MouseWheelListener object is registered - * via addMouseWheelListener. - *
        • Mouse wheel events are enabled via enableEvents. + *
        • A {@code MouseWheelListener} object is registered + * via {@code addMouseWheelListener}. + *
        • Mouse wheel events are enabled via {@code enableEvents}. *
        *

        * For information on how mouse wheel events are dispatched, see * the class description for {@link MouseWheelEvent}. *

        - * Note that if the event parameter is null + * Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6700,17 +6700,17 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Processes input method events occurring on this component by * dispatching them to any registered - * InputMethodListener objects. + * {@code InputMethodListener} objects. *

        * This method is not called unless input method events * are enabled for this component. Input method events are enabled * when one of the following occurs: *

          - *
        • An InputMethodListener object is registered - * via addInputMethodListener. - *
        • Input method events are enabled via enableEvents. + *
        • An {@code InputMethodListener} object is registered + * via {@code addInputMethodListener}. + *
        • Input method events are enabled via {@code enableEvents}. *
        - *

        Note that if the event parameter is null + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6739,17 +6739,17 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Processes hierarchy events occurring on this component by * dispatching them to any registered - * HierarchyListener objects. + * {@code HierarchyListener} objects. *

        * This method is not called unless hierarchy events * are enabled for this component. Hierarchy events are enabled * when one of the following occurs: *

          - *
        • An HierarchyListener object is registered - * via addHierarchyListener. - *
        • Hierarchy events are enabled via enableEvents. + *
        • An {@code HierarchyListener} object is registered + * via {@code addHierarchyListener}. + *
        • Hierarchy events are enabled via {@code enableEvents}. *
        - *

        Note that if the event parameter is null + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6775,17 +6775,17 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Processes hierarchy bounds events occurring on this component by * dispatching them to any registered - * HierarchyBoundsListener objects. + * {@code HierarchyBoundsListener} objects. *

        * This method is not called unless hierarchy bounds events * are enabled for this component. Hierarchy bounds events are enabled * when one of the following occurs: *

          - *
        • An HierarchyBoundsListener object is registered - * via addHierarchyBoundsListener. - *
        • Hierarchy bounds events are enabled via enableEvents. + *
        • An {@code HierarchyBoundsListener} object is registered + * via {@code addHierarchyBoundsListener}. + *
        • Hierarchy bounds events are enabled via {@code enableEvents}. *
        - *

        Note that if the event parameter is null + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6972,7 +6972,7 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Makes this Component displayable by connecting it to a + * Makes this {@code Component} displayable by connecting it to a * native screen resource. * This method is called internally by the toolkit and should * not be called directly by programs. @@ -7076,12 +7076,12 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Makes this Component undisplayable by destroying it native + * Makes this {@code Component} undisplayable by destroying it native * screen resource. *

        * This method is called by the toolkit internally and should * not be called directly by programs. Code overriding - * this method should call super.removeNotify as + * this method should call {@code super.removeNotify} as * the first line of the overriding method. * * @see #isDisplayable @@ -7193,14 +7193,14 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Returns whether this Component can become the focus + * Returns whether this {@code Component} can become the focus * owner. * - * @return true if this Component is - * focusable; false otherwise + * @return {@code true} if this {@code Component} is + * focusable; {@code false} otherwise * @see #setFocusable * @since 1.1 - * @deprecated As of 1.4, replaced by isFocusable(). + * @deprecated As of 1.4, replaced by {@code isFocusable()}. */ @Deprecated public boolean isFocusTraversable() { @@ -7213,8 +7213,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns whether this Component can be focused. * - * @return true if this Component is focusable; - * false otherwise. + * @return {@code true} if this Component is focusable; + * {@code false} otherwise. * @see #setFocusable * @since 1.4 */ @@ -7334,7 +7334,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns the Set of focus traversal keys for a given traversal operation * for this Component. (See - * setFocusTraversalKeys for a full description of each key.) + * {@code setFocusTraversalKeys} for a full description of each key.) *

        * If a Set of traversal keys has not been explicitly defined for this * Component, then this Component's parent's Set is returned. If no Set @@ -7434,15 +7434,15 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns whether the Set of focus traversal keys for the given focus * traversal operation has been explicitly defined for this Component. If - * this method returns false, this Component is inheriting the + * this method returns {@code false}, this Component is inheriting the * Set from an ancestor, or from the current KeyboardFocusManager. * * @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS - * @return true if the Set of focus traversal keys for the + * @return {@code true} if the Set of focus traversal keys for the * given focus traversal operation has been explicitly defined for - * this Component; false otherwise. + * this Component; {@code false} otherwise. * @throws IllegalArgumentException if id is not one of * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or @@ -7515,12 +7515,12 @@ public abstract class Component implements ImageObserver, MenuContainer, * Window is later focused by the user. *

        * This method cannot be used to set the focus owner to no Component at - * all. Use KeyboardFocusManager.clearGlobalFocusOwner() + * all. Use {@code KeyboardFocusManager.clearGlobalFocusOwner()} * instead. *

        * Because the focus behavior of this method is platform-dependent, * developers are strongly encouraged to use - * requestFocusInWindow when possible. + * {@code requestFocusInWindow} when possible. * *

        Note: Not all focus transfers result from invoking this method. As * such, a component may receive focus without this or any of the other @@ -7543,9 +7543,9 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Requests that this Component get the input focus, - * and that this Component's top-level ancestor - * become the focused Window. This component must be + * Requests that this {@code Component} get the input focus, + * and that this {@code Component}'s top-level ancestor + * become the focused {@code Window}. This component must be * displayable, focusable, visible and all of its ancestors (with * the exception of the top-level Window) must be visible for the * request to be granted. Every effort will be made to honor the @@ -7557,29 +7557,29 @@ public abstract class Component implements ImageObserver, MenuContainer, * will be remembered and will be granted when the window is later * focused by the user. *

        - * This method returns a boolean value. If false is returned, - * the request is guaranteed to fail. If true is + * This method returns a boolean value. If {@code false} is returned, + * the request is guaranteed to fail. If {@code true} is * returned, the request will succeed unless it is vetoed, or an * extraordinary event, such as disposal of the component's peer, occurs * before the request can be granted by the native windowing system. Again, - * while a return value of true indicates that the request is + * while a return value of {@code true} indicates that the request is * likely to succeed, developers must never assume that this component is * the focus owner until this component receives a FOCUS_GAINED event. *

        * This method cannot be used to set the focus owner to no component at - * all. Use KeyboardFocusManager.clearGlobalFocusOwner + * all. Use {@code KeyboardFocusManager.clearGlobalFocusOwner} * instead. *

        * Because the focus behavior of this method is platform-dependent, * developers are strongly encouraged to use - * requestFocusInWindow when possible. + * {@code requestFocusInWindow} when possible. *

        - * Every effort will be made to ensure that FocusEvents + * Every effort will be made to ensure that {@code FocusEvent}s * generated as a * result of this request will have the specified temporary value. However, * because specifying an arbitrary temporary state may not be implementable * on all native windowing systems, correct behavior for this method can be - * guaranteed only for lightweight Components. + * guaranteed only for lightweight {@code Component}s. * This method is not intended * for general use, but exists instead as a hook for lightweight component * libraries, such as Swing. @@ -7592,8 +7592,8 @@ public abstract class Component implements ImageObserver, MenuContainer, * such as when the window loses the focus; for * more information on temporary focus changes see the *Focus Specification - * @return false if the focus change request is guaranteed to - * fail; true if it is likely to succeed + * @return {@code false} if the focus change request is guaranteed to + * fail; {@code true} if it is likely to succeed * @see java.awt.event.FocusEvent * @see #addFocusListener * @see #isFocusable @@ -7619,31 +7619,31 @@ public abstract class Component implements ImageObserver, MenuContainer, * assume that this Component is the focus owner until this * Component receives a FOCUS_GAINED event. *

        - * This method returns a boolean value. If false is returned, - * the request is guaranteed to fail. If true is + * This method returns a boolean value. If {@code false} is returned, + * the request is guaranteed to fail. If {@code true} is * returned, the request will succeed unless it is vetoed, or an * extraordinary event, such as disposal of the Component's peer, occurs * before the request can be granted by the native windowing system. Again, - * while a return value of true indicates that the request is + * while a return value of {@code true} indicates that the request is * likely to succeed, developers must never assume that this Component is * the focus owner until this Component receives a FOCUS_GAINED event. *

        * This method cannot be used to set the focus owner to no Component at - * all. Use KeyboardFocusManager.clearGlobalFocusOwner() + * all. Use {@code KeyboardFocusManager.clearGlobalFocusOwner()} * instead. *

        * The focus behavior of this method can be implemented uniformly across * platforms, and thus developers are strongly encouraged to use this - * method over requestFocus when possible. Code which relies - * on requestFocus may exhibit different focus behavior on + * method over {@code requestFocus} when possible. Code which relies + * on {@code requestFocus} may exhibit different focus behavior on * different platforms. * *

        Note: Not all focus transfers result from invoking this method. As * such, a component may receive focus without this or any of the other * {@code requestFocus} methods of {@code Component} being invoked. * - * @return false if the focus change request is guaranteed to - * fail; true if it is likely to succeed + * @return {@code false} if the focus change request is guaranteed to + * fail; {@code true} if it is likely to succeed * @see #requestFocus * @see java.awt.event.FocusEvent * @see #addFocusListener @@ -7661,9 +7661,9 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Requests that this Component get the input focus, - * if this Component's top-level ancestor is already - * the focused Window. This component must be + * Requests that this {@code Component} get the input focus, + * if this {@code Component}'s top-level ancestor is already + * the focused {@code Window}. This component must be * displayable, focusable, visible and all of its ancestors (with * the exception of the top-level Window) must be visible for the * request to be granted. Every effort will be made to honor the @@ -7671,26 +7671,26 @@ public abstract class Component implements ImageObserver, MenuContainer, * so. Developers must never assume that this component is the * focus owner until this component receives a FOCUS_GAINED event. *

        - * This method returns a boolean value. If false is returned, - * the request is guaranteed to fail. If true is + * This method returns a boolean value. If {@code false} is returned, + * the request is guaranteed to fail. If {@code true} is * returned, the request will succeed unless it is vetoed, or an * extraordinary event, such as disposal of the component's peer, occurs * before the request can be granted by the native windowing system. Again, - * while a return value of true indicates that the request is + * while a return value of {@code true} indicates that the request is * likely to succeed, developers must never assume that this component is * the focus owner until this component receives a FOCUS_GAINED event. *

        * This method cannot be used to set the focus owner to no component at - * all. Use KeyboardFocusManager.clearGlobalFocusOwner + * all. Use {@code KeyboardFocusManager.clearGlobalFocusOwner} * instead. *

        * The focus behavior of this method can be implemented uniformly across * platforms, and thus developers are strongly encouraged to use this - * method over requestFocus when possible. Code which relies - * on requestFocus may exhibit different focus behavior on + * method over {@code requestFocus} when possible. Code which relies + * on {@code requestFocus} may exhibit different focus behavior on * different platforms. *

        - * Every effort will be made to ensure that FocusEvents + * Every effort will be made to ensure that {@code FocusEvent}s * generated as a * result of this request will have the specified temporary value. However, * because specifying an arbitrary temporary state may not be implementable @@ -7707,8 +7707,8 @@ public abstract class Component implements ImageObserver, MenuContainer, * such as when the window loses the focus; for * more information on temporary focus changes see the *Focus Specification - * @return false if the focus change request is guaranteed to - * fail; true if it is likely to succeed + * @return {@code false} if the focus change request is guaranteed to + * fail; {@code true} if it is likely to succeed * @see #requestFocus * @see java.awt.event.FocusEvent * @see #addFocusListener @@ -7943,8 +7943,8 @@ public abstract class Component implements ImageObserver, MenuContainer, * belongs to only a single focus traversal cycle. * * @param container the Container to be tested - * @return true if the specified Container is a focus-cycle- - * root of this Component; false otherwise + * @return {@code true} if the specified Container is a focus-cycle- + * root of this Component; {@code false} otherwise * @see Container#isFocusCycleRoot() * @since 1.4 */ @@ -8125,12 +8125,12 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Returns true if this Component is the + * Returns {@code true} if this {@code Component} is the * focus owner. This method is obsolete, and has been replaced by - * isFocusOwner(). + * {@code isFocusOwner()}. * - * @return true if this Component is the - * focus owner; false otherwise + * @return {@code true} if this {@code Component} is the + * focus owner; {@code false} otherwise * @since 1.2 */ public boolean hasFocus() { @@ -8139,11 +8139,11 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Returns true if this Component is the + * Returns {@code true} if this {@code Component} is the * focus owner. * - * @return true if this Component is the - * focus owner; false otherwise + * @return {@code true} if this {@code Component} is the + * focus owner; {@code false} otherwise * @since 1.4 */ public boolean isFocusOwner() { @@ -8222,7 +8222,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return a string representation of this component's state * @since 1.0 @@ -8247,7 +8247,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Prints a listing of this component to the standard system output - * stream System.out. + * stream {@code System.out}. * @see java.lang.System#out * @since 1.0 */ @@ -8342,10 +8342,10 @@ public abstract class Component implements ImageObserver, MenuContainer, *

      • this Component's maximum size ("maximumSize")
      • *
      • this Component's name ("name")
      • *
      - * Note that if this Component is inheriting a bound property, then no + * Note that if this {@code Component} is inheriting a bound property, then no * event will be fired in response to a change in the inherited property. *

      - * If listener is null, + * If {@code listener} is {@code null}, * no exception is thrown and no action is performed. * * @param listener the property change listener to be added @@ -8394,7 +8394,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the property change listeners * registered on this component. * - * @return all of this component's PropertyChangeListeners + * @return all of this component's {@code PropertyChangeListener}s * or an empty array if no property change * listeners are currently registered * @@ -8431,10 +8431,10 @@ public abstract class Component implements ImageObserver, MenuContainer, *

    • this Component's Set of UP_CYCLE_TRAVERSAL_KEYS * ("upCycleFocusTraversalKeys")
    • *
    - * Note that if this Component is inheriting a bound property, then no + * Note that if this {@code Component} is inheriting a bound property, then no * event will be fired in response to a change in the inherited property. *

    - * If propertyName or listener is null, + * If {@code propertyName} or {@code listener} is {@code null}, * no exception is thrown and no action is taken. * * @param propertyName one of the property names listed above @@ -8459,12 +8459,12 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Removes a PropertyChangeListener from the listener + * Removes a {@code PropertyChangeListener} from the listener * list for a specific property. This method should be used to remove - * PropertyChangeListeners + * {@code PropertyChangeListener}s * that were registered for a specific bound property. *

    - * If propertyName or listener is null, + * If {@code propertyName} or {@code listener} is {@code null}, * no exception is thrown and no action is taken. * * @param propertyName a valid property name @@ -8490,9 +8490,9 @@ public abstract class Component implements ImageObserver, MenuContainer, * with the named property. * * @param propertyName the property name - * @return all of the PropertyChangeListeners associated with + * @return all of the {@code PropertyChangeListener}s associated with * the named property; if no such listeners have been added or - * if propertyName is null, an empty + * if {@code propertyName} is {@code null}, an empty * array is returned * * @see #addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) @@ -8693,7 +8693,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * This hack is for Swing serialization. It will invoke - * the Swing package private method compWriteObjectNotify. + * the Swing package private method {@code compWriteObjectNotify}. */ private void doSwingSerialization() { Package swingPackage = Package.getPackage("javax.swing"); @@ -8747,31 +8747,31 @@ public abstract class Component implements ImageObserver, MenuContainer, * The non-serializable listeners are detected and * no attempt is made to serialize them. * - * @param s the ObjectOutputStream to write - * @serialData null terminated sequence of - * 0 or more pairs; the pair consists of a String - * and an Object; the String indicates + * @param s the {@code ObjectOutputStream} to write + * @serialData {@code null} terminated sequence of + * 0 or more pairs; the pair consists of a {@code String} + * and an {@code Object}; the {@code String} indicates * the type of object and is one of the following (as of 1.4): - * componentListenerK indicating an - * ComponentListener object; - * focusListenerK indicating an - * FocusListener object; - * keyListenerK indicating an - * KeyListener object; - * mouseListenerK indicating an - * MouseListener object; - * mouseMotionListenerK indicating an - * MouseMotionListener object; - * inputMethodListenerK indicating an - * InputMethodListener object; - * hierarchyListenerK indicating an - * HierarchyListener object; - * hierarchyBoundsListenerK indicating an - * HierarchyBoundsListener object; - * mouseWheelListenerK indicating an - * MouseWheelListener object - * @serialData an optional ComponentOrientation - * (after inputMethodListener, as of 1.2) + * {@code componentListenerK} indicating an + * {@code ComponentListener} object; + * {@code focusListenerK} indicating an + * {@code FocusListener} object; + * {@code keyListenerK} indicating an + * {@code KeyListener} object; + * {@code mouseListenerK} indicating an + * {@code MouseListener} object; + * {@code mouseMotionListenerK} indicating an + * {@code MouseMotionListener} object; + * {@code inputMethodListenerK} indicating an + * {@code InputMethodListener} object; + * {@code hierarchyListenerK} indicating an + * {@code HierarchyListener} object; + * {@code hierarchyBoundsListenerK} indicating an + * {@code HierarchyBoundsListener} object; + * {@code mouseWheelListenerK} indicating an + * {@code MouseWheelListener} object + * @serialData an optional {@code ComponentOrientation} + * (after {@code inputMethodListener}, as of 1.2) * * @see AWTEventMulticaster#save(java.io.ObjectOutputStream, java.lang.String, java.util.EventListener) * @see #componentListenerK @@ -8813,12 +8813,12 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Reads the ObjectInputStream and if it isn't - * null adds a listener to receive a variety + * Reads the {@code ObjectInputStream} and if it isn't + * {@code null} adds a listener to receive a variety * of events fired by the component. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @see #writeObject(ObjectOutputStream) */ private void readObject(ObjectInputStream s) @@ -8960,15 +8960,15 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Sets the language-sensitive orientation that is to be used to order * the elements or text within this component. Language-sensitive - * LayoutManager and Component + * {@code LayoutManager} and {@code Component} * subclasses will use this property to * determine how to lay out and draw components. *

    * At construction time, a component's orientation is set to - * ComponentOrientation.UNKNOWN, + * {@code ComponentOrientation.UNKNOWN}, * indicating that it has not been specified * explicitly. The UNKNOWN orientation behaves the same as - * ComponentOrientation.LEFT_TO_RIGHT. + * {@code ComponentOrientation.LEFT_TO_RIGHT}. *

    * To set the orientation of a single component, use this method. * To set the orientation of an entire component @@ -8999,8 +8999,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Retrieves the language-sensitive orientation that is to be used to order - * the elements or text within this component. LayoutManager - * and Component + * the elements or text within this component. {@code LayoutManager} + * and {@code Component} * subclasses that wish to respect orientation should call this method to * get the component's orientation before performing layout or drawing. * @@ -9014,7 +9014,7 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Sets the ComponentOrientation property of this component + * Sets the {@code ComponentOrientation} property of this component * and all components contained within it. *

    * This method changes layout-related information, and therefore, @@ -9023,7 +9023,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * * @param orientation the new component orientation of this component and * the components contained within it. - * @exception NullPointerException if orientation is null. + * @exception NullPointerException if {@code orientation} is null. * @see #setComponentOrientation * @see #getComponentOrientation * @see #invalidate @@ -9091,7 +9091,7 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Returns the Window ancestor of the component. + * Returns the {@code Window} ancestor of the component. * @return Window ancestor of the component or component by itself if it is Window; * null, if component is not a part of window hierarchy */ @@ -9118,16 +9118,16 @@ public abstract class Component implements ImageObserver, MenuContainer, protected AccessibleContext accessibleContext = null; /** - * Gets the AccessibleContext associated - * with this Component. + * Gets the {@code AccessibleContext} associated + * with this {@code Component}. * The method implemented by this base - * class returns null. Classes that extend Component + * class returns null. Classes that extend {@code Component} * should implement this method to return the - * AccessibleContext associated with the subclass. + * {@code AccessibleContext} associated with the subclass. * * - * @return the AccessibleContext of this - * Component + * @return the {@code AccessibleContext} of this + * {@code Component} * @since 1.3 */ public AccessibleContext getAccessibleContext() { @@ -9228,7 +9228,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** - * Adds a PropertyChangeListener to the listener list. + * Adds a {@code PropertyChangeListener} to the listener list. * * @param listener the property change listener to be added */ @@ -9265,7 +9265,7 @@ public abstract class Component implements ImageObserver, MenuContainer, // /** * Gets the accessible name of this object. This should almost never - * return java.awt.Component.getName(), + * return {@code java.awt.Component.getName()}, * as that generally isn't a localized name, * and doesn't have meaning for the user. If the * object is fundamentally a text object (e.g. a menu item), the @@ -9274,7 +9274,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * appropriate String to return. * * @return the localized name of the object -- can be - * null if this + * {@code null} if this * object does not have a name * @see javax.accessibility.AccessibleContext#setAccessibleName */ @@ -9294,7 +9294,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * text document" instead). * * @return the localized description of the object -- can be - * null if this object does not have a description + * {@code null} if this object does not have a description * @see javax.accessibility.AccessibleContext#setAccessibleDescription */ public String getAccessibleDescription() { @@ -9304,7 +9304,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Gets the role of this object. * - * @return an instance of AccessibleRole + * @return an instance of {@code AccessibleRole} * describing the role of the object * @see javax.accessibility.AccessibleRole */ @@ -9315,7 +9315,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Gets the state of this object. * - * @return an instance of AccessibleStateSet + * @return an instance of {@code AccessibleStateSet} * containing the current state set of the object * @see javax.accessibility.AccessibleState */ @@ -9324,13 +9324,13 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Gets the Accessible parent of this object. - * If the parent of this object implements Accessible, - * this method should simply return getParent. + * Gets the {@code Accessible} parent of this object. + * If the parent of this object implements {@code Accessible}, + * this method should simply return {@code getParent}. * - * @return the Accessible parent of this - * object -- can be null if this - * object does not have an Accessible parent + * @return the {@code Accessible} parent of this + * object -- can be {@code null} if this + * object does not have an {@code Accessible} parent */ public Accessible getAccessibleParent() { if (accessibleParent != null) { @@ -9357,7 +9357,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns the number of accessible children in the object. If all - * of the children of this object implement Accessible, + * of the children of this object implement {@code Accessible}, * then this method should return the number of children of this object. * * @return the number of accessible children in the object @@ -9367,10 +9367,10 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Returns the nth Accessible child of the object. + * Returns the nth {@code Accessible} child of the object. * * @param i zero-based index of child - * @return the nth Accessible child of the object + * @return the nth {@code Accessible} child of the object */ public Accessible getAccessibleChild(int i) { return null; // Components don't have children @@ -9386,9 +9386,9 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Gets the AccessibleComponent associated + * Gets the {@code AccessibleComponent} associated * with this object if one exists. - * Otherwise return null. + * Otherwise return {@code null}. * * @return the component */ @@ -9403,7 +9403,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Gets the background color of this object. * * @return the background color, if supported, of the object; - * otherwise, null + * otherwise, {@code null} */ public Color getBackground() { return Component.this.getBackground(); @@ -9411,9 +9411,9 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Sets the background color of this object. - * (For transparency, see isOpaque.) + * (For transparency, see {@code isOpaque}.) * - * @param c the new Color for the background + * @param c the new {@code Color} for the background * @see Component#isOpaque */ public void setBackground(Color c) { @@ -9424,7 +9424,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Gets the foreground color of this object. * * @return the foreground color, if supported, of the object; - * otherwise, null + * otherwise, {@code null} */ public Color getForeground() { return Component.this.getForeground(); @@ -9433,59 +9433,59 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Sets the foreground color of this object. * - * @param c the new Color for the foreground + * @param c the new {@code Color} for the foreground */ public void setForeground(Color c) { Component.this.setForeground(c); } /** - * Gets the Cursor of this object. + * Gets the {@code Cursor} of this object. * - * @return the Cursor, if supported, - * of the object; otherwise, null + * @return the {@code Cursor}, if supported, + * of the object; otherwise, {@code null} */ public Cursor getCursor() { return Component.this.getCursor(); } /** - * Sets the Cursor of this object. + * Sets the {@code Cursor} of this object. *

    * The method may have no visual effect if the Java platform * implementation and/or the native system do not support * changing the mouse cursor shape. - * @param cursor the new Cursor for the object + * @param cursor the new {@code Cursor} for the object */ public void setCursor(Cursor cursor) { Component.this.setCursor(cursor); } /** - * Gets the Font of this object. + * Gets the {@code Font} of this object. * - * @return the Font, if supported, - * for the object; otherwise, null + * @return the {@code Font}, if supported, + * for the object; otherwise, {@code null} */ public Font getFont() { return Component.this.getFont(); } /** - * Sets the Font of this object. + * Sets the {@code Font} of this object. * - * @param f the new Font for the object + * @param f the new {@code Font} for the object */ public void setFont(Font f) { Component.this.setFont(f); } /** - * Gets the FontMetrics of this object. + * Gets the {@code FontMetrics} of this object. * - * @param f the Font - * @return the FontMetrics, if supported, - * the object; otherwise, null + * @param f the {@code Font} + * @return the {@code FontMetrics}, if supported, + * the object; otherwise, {@code null} * @see #getFont */ public FontMetrics getFontMetrics(Font f) { @@ -9533,7 +9533,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * object intends to be visible; however, it may not in fact be * showing on the screen because one of the objects that this object * is contained by is not visible. To determine if an object is - * showing on the screen, use isShowing. + * showing on the screen, use {@code isShowing}. * * @return true if object is visible; otherwise, false */ @@ -9582,9 +9582,9 @@ public abstract class Component implements ImageObserver, MenuContainer, * where the point's x and y coordinates are defined to be relative to * the coordinate system of the object. * - * @param p the Point relative to the + * @param p the {@code Point} relative to the * coordinate system of the object - * @return true if object contains Point; otherwise false + * @return true if object contains {@code Point}; otherwise false */ public boolean contains(Point p) { return Component.this.contains(p); @@ -9594,7 +9594,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns the location of the object on the screen. * * @return location of object on screen -- can be - * null if this object is not on the screen + * {@code null} if this object is not on the screen */ public Point getLocationOnScreen() { synchronized (Component.this.getTreeLock()) { @@ -9613,7 +9613,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * * @return an instance of Point representing the top-left corner of * the object's bounds in the coordinate space of the screen; - * null if this object or its parent are not on the screen + * {@code null} if this object or its parent are not on the screen */ public Point getLocation() { return Component.this.getLocation(); @@ -9633,7 +9633,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * relative to its parent. * * @return a rectangle indicating this component's bounds; - * null if this object is not on the screen + * {@code null} if this object is not on the screen */ public Rectangle getBounds() { return Component.this.getBounds(); @@ -9641,7 +9641,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Sets the bounds of this object in the form of a - * Rectangle object. + * {@code Rectangle} object. * The bounds specify this object's width, height, and location * relative to its parent. * @@ -9653,13 +9653,13 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns the size of this object in the form of a - * Dimension object. The height field of the - * Dimension object contains this object's - * height, and the width field of the Dimension + * {@code Dimension} object. The height field of the + * {@code Dimension} object contains this object's + * height, and the width field of the {@code Dimension} * object contains this object's width. * - * @return a Dimension object that indicates - * the size of this component; null if + * @return a {@code Dimension} object that indicates + * the size of this component; {@code null} if * this object is not on the screen */ public Dimension getSize() { @@ -9669,23 +9669,23 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Resizes this object so that it has width and height. * - * @param d - the dimension specifying the new size of the object + * @param d the dimension specifying the new size of the object */ public void setSize(Dimension d) { Component.this.setSize(d); } /** - * Returns the Accessible child, + * Returns the {@code Accessible} child, * if one exists, contained at the local - * coordinate Point. Otherwise returns - * null. + * coordinate {@code Point}. Otherwise returns + * {@code null}. * * @param p the point defining the top-left corner of - * the Accessible, given in the + * the {@code Accessible}, given in the * coordinate space of the object's parent - * @return the Accessible, if it exists, - * at the specified location; else null + * @return the {@code Accessible}, if it exists, + * at the specified location; else {@code null} */ public Accessible getAccessibleAt(Point p) { return null; // Components don't have children @@ -9759,7 +9759,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Gets the current state set of this object. * - * @return an instance of AccessibleStateSet + * @return an instance of {@code AccessibleStateSet} * containing the current state set of the object * @see AccessibleState */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/ComponentOrientation.java b/jdk/src/java.desktop/share/classes/java/awt/ComponentOrientation.java index 8b67ea0cdde..4df1846a5da 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/ComponentOrientation.java +++ b/jdk/src/java.desktop/share/classes/java/awt/ComponentOrientation.java @@ -72,8 +72,8 @@ import java.util.ResourceBundle; *

  • TL - Mongolian *
* Components whose view and controller code depends on orientation - * should use the isLeftToRight() and - * isHorizontal() methods to + * should use the {@code isLeftToRight()} and + * {@code isHorizontal()} methods to * determine their behavior. They should not include switch-like * code that keys off of the constants, such as: *
diff --git a/jdk/src/java.desktop/share/classes/java/awt/Composite.java b/jdk/src/java.desktop/share/classes/java/awt/Composite.java
index 4ce58a06daa..d86b73abac3 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/Composite.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/Composite.java
@@ -28,39 +28,39 @@ package java.awt;
 import java.awt.image.ColorModel;
 
 /**
- * The Composite interface, along with
+ * The {@code Composite} interface, along with
  * {@link CompositeContext}, defines the methods to compose a draw
  * primitive with the underlying graphics area.
- * After the Composite is set in the
+ * After the {@code Composite} is set in the
  * {@link Graphics2D} context, it combines a shape, text, or an image
  * being rendered with the colors that have already been rendered
  * according to pre-defined rules. The classes
  * implementing this interface provide the rules and a method to create
  * the context for a particular operation.
- * CompositeContext is an environment used by the
- * compositing operation, which is created by the Graphics2D
- * prior to the start of the operation.  CompositeContext
+ * {@code CompositeContext} is an environment used by the
+ * compositing operation, which is created by the {@code Graphics2D}
+ * prior to the start of the operation.  {@code CompositeContext}
  * contains private information and resources needed for a compositing
- * operation.  When the CompositeContext is no longer needed,
- * the Graphics2D object disposes of it in order to reclaim
+ * operation.  When the {@code CompositeContext} is no longer needed,
+ * the {@code Graphics2D} object disposes of it in order to reclaim
  * resources allocated for the operation.
  * 

- * Instances of classes implementing Composite must be - * immutable because the Graphics2D does not clone + * Instances of classes implementing {@code Composite} must be + * immutable because the {@code Graphics2D} does not clone * these objects when they are set as an attribute with the - * setComposite method or when the Graphics2D + * {@code setComposite} method or when the {@code Graphics2D} * object is cloned. This is to avoid undefined rendering behavior of - * Graphics2D, resulting from the modification of - * the Composite object after it has been set in the - * Graphics2D context. + * {@code Graphics2D}, resulting from the modification of + * the {@code Composite} object after it has been set in the + * {@code Graphics2D} context. *

* Since this interface must expose the contents of pixels on the * target device or image to potentially arbitrary code, the use of * custom objects which implement this interface when rendering directly - * to a screen device is governed by the readDisplayPixels + * to a screen device is governed by the {@code readDisplayPixels} * {@link AWTPermission}. The permission check will occur when such - * a custom object is passed to the setComposite method - * of a Graphics2D retrieved from a {@link Component}. + * a custom object is passed to the {@code setComposite} method + * of a {@code Graphics2D} retrieved from a {@link Component}. * @see AlphaComposite * @see CompositeContext * @see Graphics2D#setComposite @@ -71,12 +71,12 @@ public interface Composite { * Creates a context containing state that is used to perform * the compositing operation. In a multi-threaded environment, * several contexts can exist simultaneously for a single - * Composite object. + * {@code Composite} object. * @param srcColorModel the {@link ColorModel} of the source - * @param dstColorModel the ColorModel of the destination + * @param dstColorModel the {@code ColorModel} of the destination * @param hints the hint that the context object uses to choose between * rendering alternatives - * @return the CompositeContext object used to perform the + * @return the {@code CompositeContext} object used to perform the * compositing operation. */ public CompositeContext createContext(ColorModel srcColorModel, diff --git a/jdk/src/java.desktop/share/classes/java/awt/CompositeContext.java b/jdk/src/java.desktop/share/classes/java/awt/CompositeContext.java index 60f2ecd3032..525aee73c28 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/CompositeContext.java +++ b/jdk/src/java.desktop/share/classes/java/awt/CompositeContext.java @@ -29,9 +29,9 @@ import java.awt.image.Raster; import java.awt.image.WritableRaster; /** - * The CompositeContext interface defines the encapsulated + * The {@code CompositeContext} interface defines the encapsulated * and optimized environment for a compositing operation. - * CompositeContext objects maintain state for + * {@code CompositeContext} objects maintain state for * compositing operations. In a multi-threaded environment, several * contexts can exist simultaneously for a single {@link Composite} * object. @@ -49,14 +49,14 @@ public interface CompositeContext { * places the result in the destination * {@link WritableRaster}. Note that the destination * can be the same object as either the first or second - * source. Note that dstIn and - * dstOut must be compatible with the - * dstColorModel passed to the + * source. Note that {@code dstIn} and + * {@code dstOut} must be compatible with the + * {@code dstColorModel} passed to the * {@link Composite#createContext(java.awt.image.ColorModel, java.awt.image.ColorModel, java.awt.RenderingHints) createContext} - * method of the Composite interface. + * method of the {@code Composite} interface. * @param src the first source for the compositing operation * @param dstIn the second source for the compositing operation - * @param dstOut the WritableRaster into which the + * @param dstOut the {@code WritableRaster} into which the * result of the operation is stored * @see Composite */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Container.java b/jdk/src/java.desktop/share/classes/java/awt/Container.java index f3e7b3b5d6e..a16c2f55d97 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Container.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Container.java @@ -183,7 +183,7 @@ public class Container extends Component { /** * A constant which toggles one of the controllable behaviors - * of getMouseEventTarget. It is used to specify whether + * of {@code getMouseEventTarget}. It is used to specify whether * the method can return the Container on which it is originally called * in case if none of its children are the current mouse event targets. * @@ -193,7 +193,7 @@ public class Container extends Component { /** * A constant which toggles one of the controllable behaviors - * of getMouseEventTarget. It is used to specify whether + * of {@code getMouseEventTarget}. It is used to specify whether * the method should search only lightweight components. * * @see #getMouseEventTarget(int, int, boolean) @@ -384,7 +384,7 @@ public class Container extends Component { * Determines the insets of this container, which indicate the size * of the container's border. *

- * A Frame object, for example, has a top inset that + * A {@code Frame} object, for example, has a top inset that * corresponds to the height of the frame's title bar. * @return the insets of this container. * @see Insets @@ -399,7 +399,7 @@ public class Container extends Component { * Returns the insets for this container. * * @deprecated As of JDK version 1.1, - * replaced by getInsets(). + * replaced by {@code getInsets()}. * @return the insets for this container */ @Deprecated @@ -439,7 +439,7 @@ public class Container extends Component { * This is a convenience method for {@link #addImpl}. *

* This method is obsolete as of 1.1. Please use the - * method add(Component, Object) instead. + * method {@code add(Component, Object)} instead. *

* This method changes layout-related information, and therefore, * invalidates the component hierarchy. If the container has already been @@ -471,11 +471,11 @@ public class Container extends Component { * * @param comp the component to be added * @param index the position at which to insert the component, - * or -1 to append the component to the end + * or {@code -1} to append the component to the end * @exception NullPointerException if {@code comp} is {@code null} * @exception IllegalArgumentException if {@code index} is invalid (see * {@link #addImpl} for details) - * @return the component comp + * @return the component {@code comp} * @see #addImpl * @see #remove * @see #invalidate @@ -532,7 +532,7 @@ public class Container extends Component { if (comp.parent == this) { if (index == component.size()) { throw new IllegalArgumentException("illegal component position " + - index + " should be less then " + component.size()); + index + " should be less than " + component.size()); } } checkAddToSelf(comp); @@ -734,40 +734,40 @@ public class Container extends Component { * If the component is a child of some other container, it is * removed from that container before being added to this container. * The important difference between this method and - * java.awt.Container.add(Component, int) is that this method - * doesn't call removeNotify on the component while + * {@code java.awt.Container.add(Component, int)} is that this method + * doesn't call {@code removeNotify} on the component while * removing it from its previous container unless necessary and when * allowed by the underlying native windowing system. This way, if the * component has the keyboard focus, it maintains the focus when * moved to the new position. *

* This property is guaranteed to apply only to lightweight - * non-Container components. + * non-{@code Container} components. *

* This method changes layout-related information, and therefore, * invalidates the component hierarchy. *

* Note: Not all platforms support changing the z-order of * heavyweight components from one container into another without - * the call to removeNotify. There is no way to detect + * the call to {@code removeNotify}. There is no way to detect * whether a platform supports this, so developers shouldn't make * any assumptions. * * @param comp the component to be moved * @param index the position in the container's list to - * insert the component, where getComponentCount() + * insert the component, where {@code getComponentCount()} * appends to the end - * @exception NullPointerException if comp is - * null - * @exception IllegalArgumentException if comp is one of the + * @exception NullPointerException if {@code comp} is + * {@code null} + * @exception IllegalArgumentException if {@code comp} is one of the * container's parents - * @exception IllegalArgumentException if index is not in - * the range [0, getComponentCount()] for moving + * @exception IllegalArgumentException if {@code index} is not in + * the range {@code [0, getComponentCount()]} for moving * between containers, or not in the range - * [0, getComponentCount()-1] for moving inside + * {@code [0, getComponentCount()-1]} for moving inside * a container * @exception IllegalArgumentException if adding a container to itself - * @exception IllegalArgumentException if adding a Window + * @exception IllegalArgumentException if adding a {@code Window} * to a container * @see #getComponentZOrder(java.awt.Component) * @see #invalidate @@ -949,7 +949,7 @@ public class Container extends Component { * * @param comp the component being queried * @return the z-order index of the component; otherwise - * returns -1 if the component is null + * returns -1 if the component is {@code null} * or doesn't belong to the container * @see #setComponentZOrder(java.awt.Component, int) * @since 1.5 @@ -1010,7 +1010,7 @@ public class Container extends Component { * @param comp the component to be added * @param constraints an object expressing layout constraints for this * @param index the position in the container's list at which to insert - * the component; -1 means insert at the end + * the component; {@code -1} means insert at the end * component * @exception NullPointerException if {@code comp} is {@code null} * @exception IllegalArgumentException if {@code index} is invalid (see @@ -1030,20 +1030,20 @@ public class Container extends Component { * Adds the specified component to this container at the specified * index. This method also notifies the layout manager to add * the component to this container's layout using the specified - * constraints object via the addLayoutComponent + * constraints object via the {@code addLayoutComponent} * method. *

* The constraints are * defined by the particular layout manager being used. For - * example, the BorderLayout class defines five - * constraints: BorderLayout.NORTH, - * BorderLayout.SOUTH, BorderLayout.EAST, - * BorderLayout.WEST, and BorderLayout.CENTER. + * example, the {@code BorderLayout} class defines five + * constraints: {@code BorderLayout.NORTH}, + * {@code BorderLayout.SOUTH}, {@code BorderLayout.EAST}, + * {@code BorderLayout.WEST}, and {@code BorderLayout.CENTER}. *

- * The GridBagLayout class requires a - * GridBagConstraints object. Failure to pass + * The {@code GridBagLayout} class requires a + * {@code GridBagConstraints} object. Failure to pass * the correct type of constraints object results in an - * IllegalArgumentException. + * {@code IllegalArgumentException}. *

* If the current layout manager implements {@code LayoutManager2}, then * {@link LayoutManager2#addLayoutComponent(Component,Object)} is invoked on @@ -1061,7 +1061,7 @@ public class Container extends Component { * usually include a call to the superclass's version of the method: * *

- * super.addImpl(comp, constraints, index) + * {@code super.addImpl(comp, constraints, index)} *
*

* This method changes layout-related information, and therefore, @@ -1073,7 +1073,7 @@ public class Container extends Component { * @param constraints an object expressing layout constraints * for this component * @param index the position in the container's list at which to - * insert the component, where -1 + * insert the component, where {@code -1} * means append to the end * @exception IllegalArgumentException if {@code index} is invalid; * if {@code comp} is a child of this container, the valid @@ -1196,11 +1196,11 @@ public class Container extends Component { } /** - * Removes the component, specified by index, + * Removes the component, specified by {@code index}, * from this container. * This method also notifies the layout manager to remove the * component from this container's layout via the - * removeLayoutComponent method. + * {@code removeLayoutComponent} method. *

* This method changes layout-related information, and therefore, * invalidates the component hierarchy. If the container has already been @@ -1263,7 +1263,7 @@ public class Container extends Component { * Removes the specified component from this container. * This method also notifies the layout manager to remove the * component from this container's layout via the - * removeLayoutComponent method. + * {@code removeLayoutComponent} method. *

* This method changes layout-related information, and therefore, * invalidates the component hierarchy. If the container has already been @@ -1292,7 +1292,7 @@ public class Container extends Component { * Removes all the components from this container. * This method also notifies the layout manager to remove the * components from this container's layout via the - * removeLayoutComponent method. + * {@code removeLayoutComponent} method. *

* This method changes layout-related information, and therefore, * invalidates the component hierarchy. If the container has already been @@ -1512,7 +1512,7 @@ public class Container extends Component { /** * Causes this container to lay out its components. Most programs * should not call this method directly, but should invoke - * the validate method instead. + * the {@code validate} method instead. * @see LayoutManager#layoutContainer * @see #setLayout * @see #validate @@ -1524,7 +1524,7 @@ public class Container extends Component { /** * @deprecated As of JDK version 1.1, - * replaced by doLayout(). + * replaced by {@code doLayout()}. */ @Deprecated public void layout() { @@ -1703,7 +1703,7 @@ public class Container extends Component { * Recursively descends the container tree and recomputes the * layout for any subtrees marked as needing it (those marked as * invalid). Synchronization should be provided by the method - * that calls this one: validate. + * that calls this one: {@code validate}. * * @see #doLayout * @see #validate @@ -1791,7 +1791,7 @@ public class Container extends Component { * this method is invoked, rather the {@code LayoutManager} will only * be queried after the {@code Container} becomes invalid. * - * @return an instance of Dimension that represents + * @return an instance of {@code Dimension} that represents * the preferred size of this container. * @see #getMinimumSize * @see #getMaximumSize @@ -1805,7 +1805,7 @@ public class Container extends Component { /** * @deprecated As of JDK version 1.1, - * replaced by getPreferredSize(). + * replaced by {@code getPreferredSize()}. */ @Deprecated public Dimension preferredSize() { @@ -1842,7 +1842,7 @@ public class Container extends Component { * this method is invoked, rather the {@code LayoutManager} will only * be queried after the {@code Container} becomes invalid. * - * @return an instance of Dimension that represents + * @return an instance of {@code Dimension} that represents * the minimum size of this container. * @see #getPreferredSize * @see #getMaximumSize @@ -1857,7 +1857,7 @@ public class Container extends Component { /** * @deprecated As of JDK version 1.1, - * replaced by getMinimumSize(). + * replaced by {@code getMinimumSize()}. */ @Deprecated public Dimension minimumSize() { @@ -1895,7 +1895,7 @@ public class Container extends Component { * this method is invoked, rather the {@code LayoutManager2} will only * be queried after the {@code Container} becomes invalid. * - * @return an instance of Dimension that represents + * @return an instance of {@code Dimension} that represents * the maximum size of this container. * @see #getPreferredSize * @see #getMinimumSize @@ -2169,7 +2169,7 @@ public class Container extends Component { * Returns an array of all the container listeners * registered on this container. * - * @return all of this container's ContainerListeners + * @return all of this container's {@code ContainerListener}s * or an empty array if no container * listeners are currently registered * @@ -2184,16 +2184,16 @@ public class Container extends Component { /** * Returns an array of all the objects currently registered * as FooListeners - * upon this Container. + * upon this {@code Container}. * FooListeners are registered using the * addFooListener method. * *

- * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * Container c + * {@code Container c} * for its container listeners with the following code: * *

ContainerListener[] cls = (ContainerListener[])(c.getListeners(ContainerListener.class));
@@ -2202,13 +2202,13 @@ public class Container extends Component { * * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this container, * or an empty array if no such listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * @exception NullPointerException if {@code listenerType} is {@code null} * * @see #getContainerListeners @@ -2242,10 +2242,10 @@ public class Container extends Component { /** * Processes events on this container. If the event is a - * ContainerEvent, it invokes the - * processContainerEvent method, else it invokes - * its superclass's processEvent. - *

Note that if the event parameter is null + * {@code ContainerEvent}, it invokes the + * {@code processContainerEvent} method, else it invokes + * its superclass's {@code processEvent}. + *

Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -2267,10 +2267,10 @@ public class Container extends Component { * following occurs: *

    *
  • A ContainerListener object is registered via - * addContainerListener - *
  • Container events are enabled via enableEvents + * {@code addContainerListener} + *
  • Container events are enabled via {@code enableEvents} *
- *

Note that if the event parameter is null + *

Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -2365,11 +2365,11 @@ public class Container extends Component { * controllable behaviors. This method searches for the top-most * descendant of this container that contains the given coordinates * and is accepted by the given filter. The search will be constrained to - * lightweight descendants if the last argument is false. + * lightweight descendants if the last argument is {@code false}. * * @param filter EventTargetFilter instance to determine whether the * given component is a valid target for this event. - * @param searchHeavyweights if false, the method + * @param searchHeavyweights if {@code false}, the method * will bypass heavyweight components during the search. */ private Component getMouseEventTarget(int x, int y, boolean includeSelf, @@ -2399,17 +2399,17 @@ public class Container extends Component { * descendants of only lightweight children or only heavyweight children * of this container depending on searchHeavyweightChildren. The search will * be constrained to only lightweight descendants of the searched children - * of this container if searchHeavyweightDescendants is false. + * of this container if searchHeavyweightDescendants is {@code false}. * * @param filter EventTargetFilter instance to determine whether the * selected component is a valid target for this event. - * @param searchHeavyweightChildren if true, the method + * @param searchHeavyweightChildren if {@code true}, the method * will bypass immediate lightweight children during the search. - * If false, the methods will bypass immediate + * If {@code false}, the methods will bypass immediate * heavyweight children during the search. - * @param searchHeavyweightDescendants if false, the method + * @param searchHeavyweightDescendants if {@code false}, the method * will bypass heavyweight descendants which are not immediate - * children during the search. If true, the method + * children during the search. If {@code true}, the method * will traverse both lightweight and heavyweight descendants during * the search. */ @@ -2525,7 +2525,7 @@ public class Container extends Component { /** * @deprecated As of JDK version 1.1, - * replaced by dispatchEvent(AWTEvent e) + * replaced by {@code dispatchEvent(AWTEvent e)} */ @Deprecated public void deliverEvent(Event e) { @@ -2562,7 +2562,7 @@ public class Container extends Component { /** * @deprecated As of JDK version 1.1, - * replaced by getComponentAt(int, int). + * replaced by {@code getComponentAt(int, int)}. */ @Deprecated public Component locate(int x, int y) { @@ -2593,7 +2593,7 @@ public class Container extends Component { * Gets the component that contains the specified point. * @param p the point. * @return returns the component that contains the point, - * or null if the component does + * or {@code null} if the component does * not contain the point. * @see Component#contains * @since 1.1 @@ -2603,22 +2603,22 @@ public class Container extends Component { } /** - * Returns the position of the mouse pointer in this Container's - * coordinate space if the Container is under the mouse pointer, - * otherwise returns null. + * Returns the position of the mouse pointer in this {@code Container}'s + * coordinate space if the {@code Container} is under the mouse pointer, + * otherwise returns {@code null}. * This method is similar to {@link Component#getMousePosition()} with the exception - * that it can take the Container's children into account. - * If allowChildren is false, this method will return - * a non-null value only if the mouse pointer is above the Container + * that it can take the {@code Container}'s children into account. + * If {@code allowChildren} is {@code false}, this method will return + * a non-null value only if the mouse pointer is above the {@code Container} * directly, not above the part obscured by children. - * If allowChildren is true, this method returns - * a non-null value if the mouse pointer is above Container or any + * If {@code allowChildren} is {@code true}, this method returns + * a non-null value if the mouse pointer is above {@code Container} or any * of its descendants. * * @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true * @param allowChildren true if children should be taken into account * @see Component#getMousePosition - * @return mouse coordinates relative to this Component, or null + * @return mouse coordinates relative to this {@code Component}, or null * @since 1.5 */ public Point getMousePosition(boolean allowChildren) throws HeadlessException { @@ -2848,8 +2848,8 @@ public class Container extends Component { * Checks if the component is contained in the component hierarchy of * this container. * @param c the component - * @return true if it is an ancestor; - * false otherwise. + * @return {@code true} if it is an ancestor; + * {@code false} otherwise. * @since 1.1 */ public boolean isAncestorOf(Component c) { @@ -2983,11 +2983,11 @@ public class Container extends Component { /* End of JOptionPane support code */ /** - * Returns a string representing the state of this Container. + * Returns a string representing the state of this {@code Container}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this container */ @@ -3005,8 +3005,8 @@ public class Container extends Component { * stream. The listing starts at the specified indentation. *

* The immediate children of the container are printed with - * an indentation of indent+1. The children - * of those children are printed at indent+2 + * an indentation of {@code indent+1}. The children + * of those children are printed at {@code indent+2} * and so on. * * @param out a print stream @@ -3032,8 +3032,8 @@ public class Container extends Component { * to the specified print writer. *

* The immediate children of the container are printed with - * an indentation of indent+1. The children - * of those children are printed at indent+2 + * an indentation of {@code indent+1}. The children + * of those children are printed at {@code indent+2} * and so on. * * @param out a print writer @@ -3147,7 +3147,7 @@ public class Container extends Component { /** * Returns the Set of focus traversal keys for a given traversal operation * for this Container. (See - * setFocusTraversalKeys for a full description of each key.) + * {@code setFocusTraversalKeys} for a full description of each key.) *

* If a Set of traversal keys has not been explicitly defined for this * Container, then this Container's parent's Set is returned. If no Set @@ -3186,16 +3186,16 @@ public class Container extends Component { /** * Returns whether the Set of focus traversal keys for the given focus * traversal operation has been explicitly defined for this Container. If - * this method returns false, this Container is inheriting the + * this method returns {@code false}, this Container is inheriting the * Set from an ancestor, or from the current KeyboardFocusManager. * * @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or * KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS - * @return true if the Set of focus traversal keys for the + * @return {@code true} if the Set of focus traversal keys for the * given focus traversal operation has been explicitly defined for - * this Component; false otherwise. + * this Component; {@code false} otherwise. * @throws IllegalArgumentException if id is not one of * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, @@ -3218,12 +3218,12 @@ public class Container extends Component { * root belongs to only a single focus traversal cycle. Containers which * are focus cycle roots belong to two cycles: one rooted at the Container * itself, and one rooted at the Container's nearest focus-cycle-root - * ancestor. This method will return true for both such + * ancestor. This method will return {@code true} for both such * Containers in this case. * * @param container the Container to be tested - * @return true if the specified Container is a focus-cycle- - * root of this Container; false otherwise + * @return {@code true} if the specified Container is a focus-cycle- + * root of this Container; {@code false} otherwise * @see #isFocusCycleRoot() * @since 1.4 */ @@ -3390,11 +3390,11 @@ public class Container extends Component { /** * Returns whether the focus traversal policy has been explicitly set for - * this Container. If this method returns false, this + * this Container. If this method returns {@code false}, this * Container will inherit its focus traversal policy from an ancestor. * - * @return true if the focus traversal policy has been - * explicitly set for this Container; false otherwise. + * @return {@code true} if the focus traversal policy has been + * explicitly set for this Container; {@code false} otherwise. * @since 1.4 */ public boolean isFocusTraversalPolicySet() { @@ -3458,7 +3458,7 @@ public class Container extends Component { /** * Sets whether this container will be used to provide focus * traversal policy. Container with this property as - * true will be used to acquire focus traversal policy + * {@code true} will be used to acquire focus traversal policy * instead of closest focus cycle root ancestor. * @param provider indicates whether this container will be used to * provide focus traversal policy @@ -3478,7 +3478,7 @@ public class Container extends Component { /** * Returns whether this container provides focus traversal - * policy. If this property is set to true then when + * policy. If this property is set to {@code true} then when * keyboard focus manager searches container hierarchy for focus * traversal policy and encounters this container before any other * container with this property as true or focus cycle roots then @@ -3488,8 +3488,8 @@ public class Container extends Component { * @see #getFocusTraversalPolicy * @see #setFocusCycleRoot * @see #setFocusTraversalPolicyProvider - * @return true if this container provides focus traversal - * policy, false otherwise + * @return {@code true} if this container provides focus traversal + * policy, {@code false} otherwise * @since 1.5 */ public final boolean isFocusTraversalPolicyProvider() { @@ -3539,7 +3539,7 @@ public class Container extends Component { } /** - * Sets the ComponentOrientation property of this container + * Sets the {@code ComponentOrientation} property of this container * and all components contained within it. *

* This method changes layout-related information, and therefore, @@ -3547,7 +3547,7 @@ public class Container extends Component { * * @param o the new component orientation of this container and * the components contained within it. - * @exception NullPointerException if orientation is null. + * @exception NullPointerException if {@code orientation} is null. * @see Component#setComponentOrientation * @see Component#getComponentOrientation * @see #invalidate @@ -3650,26 +3650,26 @@ public class Container extends Component { private int containerSerializedDataVersion = 1; /** - * Serializes this Container to the specified - * ObjectOutputStream. + * Serializes this {@code Container} to the specified + * {@code ObjectOutputStream}. *

    *
  • Writes default serializable fields to the stream.
  • *
  • Writes a list of serializable ContainerListener(s) as optional * data. The non-serializable ContainerListener(s) are detected and * no attempt is made to serialize them.
  • *
  • Write this Container's FocusTraversalPolicy if and only if it - * is Serializable; otherwise, null is written.
  • + * is Serializable; otherwise, {@code null} is written. *
* - * @param s the ObjectOutputStream to write - * @serialData null terminated sequence of 0 or more pairs; - * the pair consists of a String and Object; - * the String indicates the type of object and + * @param s the {@code ObjectOutputStream} to write + * @serialData {@code null} terminated sequence of 0 or more pairs; + * the pair consists of a {@code String} and {@code Object}; + * the {@code String} indicates the type of object and * is one of the following: - * containerListenerK indicating an - * ContainerListener object; - * the Container's FocusTraversalPolicy, - * or null + * {@code containerListenerK} indicating an + * {@code ContainerListener} object; + * the {@code Container}'s {@code FocusTraversalPolicy}, + * or {@code null} * * @see AWTEventMulticaster#save(java.io.ObjectOutputStream, java.lang.String, java.util.EventListener) * @see Container#containerListenerK @@ -3698,8 +3698,8 @@ public class Container extends Component { } /** - * Deserializes this Container from the specified - * ObjectInputStream. + * Deserializes this {@code Container} from the specified + * {@code ObjectInputStream}. *
    *
  • Reads default serializable fields from the stream.
  • *
  • Reads a list of serializable ContainerListener(s) as optional @@ -3708,7 +3708,7 @@ public class Container extends Component { * as optional data.
  • *
* - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @serial * @see #addContainerListener * @see #writeObject(ObjectOutputStream) @@ -3796,7 +3796,7 @@ public class Container extends Component { /** * Returns the number of accessible children in the object. If all - * of the children of this object implement Accessible, + * of the children of this object implement {@code Accessible}, * then this method should return the number of children of this object. * * @return the number of accessible children in the object @@ -3806,24 +3806,24 @@ public class Container extends Component { } /** - * Returns the nth Accessible child of the object. + * Returns the nth {@code Accessible} child of the object. * * @param i zero-based index of child - * @return the nth Accessible child of the object + * @return the nth {@code Accessible} child of the object */ public Accessible getAccessibleChild(int i) { return Container.this.getAccessibleChild(i); } /** - * Returns the Accessible child, if one exists, - * contained at the local coordinate Point. + * Returns the {@code Accessible} child, if one exists, + * contained at the local coordinate {@code Point}. * * @param p the point defining the top-left corner of the - * Accessible, given in the coordinate space + * {@code Accessible}, given in the coordinate space * of the object's parent - * @return the Accessible, if it exists, - * at the specified location; else null + * @return the {@code Accessible}, if it exists, + * at the specified location; else {@code null} */ public Accessible getAccessibleAt(Point p) { return Container.this.getAccessibleAt(p); @@ -3842,7 +3842,7 @@ public class Container extends Component { protected ContainerListener accessibleContainerHandler = null; /** - * Fire PropertyChange listener, if one is registered, + * Fire {@code PropertyChange} listener, if one is registered, * when children are added or removed. * @since 1.3 */ @@ -3898,15 +3898,15 @@ public class Container extends Component { } // inner class AccessibleAWTContainer /** - * Returns the Accessible child contained at the local - * coordinate Point, if one exists. Otherwise - * returns null. + * Returns the {@code Accessible} child contained at the local + * coordinate {@code Point}, if one exists. Otherwise + * returns {@code null}. * * @param p the point defining the top-left corner of the - * Accessible, given in the coordinate space + * {@code Accessible}, given in the coordinate space * of the object's parent - * @return the Accessible at the specified location, - * if it exists; otherwise null + * @return the {@code Accessible} at the specified location, + * if it exists; otherwise {@code null} */ Accessible getAccessibleAt(Point p) { synchronized (getTreeLock()) { @@ -3962,7 +3962,7 @@ public class Container extends Component { /** * Returns the number of accessible children in the object. If all - * of the children of this object implement Accessible, + * of the children of this object implement {@code Accessible}, * then this method should return the number of children of this object. * * @return the number of accessible children in the object @@ -3981,10 +3981,10 @@ public class Container extends Component { } /** - * Returns the nth Accessible child of the object. + * Returns the nth {@code Accessible} child of the object. * * @param i zero-based index of child - * @return the nth Accessible child of the object + * @return the nth {@code Accessible} child of the object */ Accessible getAccessibleChild(int i) { synchronized (getTreeLock()) { diff --git a/jdk/src/java.desktop/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java b/jdk/src/java.desktop/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java index 312149763df..d23e672779c 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java +++ b/jdk/src/java.desktop/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java @@ -33,18 +33,18 @@ import sun.util.logging.PlatformLogger; * of child Components in a Container. From a particular focus cycle root, the * policy makes a pre-order traversal of the Component hierarchy, and traverses * a Container's children according to the ordering of the array returned by - * Container.getComponents(). Portions of the hierarchy that are + * {@code Container.getComponents()}. Portions of the hierarchy that are * not visible and displayable will not be searched. *

* By default, ContainerOrderFocusTraversalPolicy implicitly transfers focus * down-cycle. That is, during normal forward focus traversal, the Component * traversed after a focus cycle root will be the focus-cycle-root's default * Component to focus. This behavior can be disabled using the - * setImplicitDownCycleTraversal method. + * {@code setImplicitDownCycleTraversal} method. *

* By default, methods of this class will return a Component only if it is * visible, displayable, enabled, and focusable. Subclasses can modify this - * behavior by overriding the accept method. + * behavior by overriding the {@code accept} method. *

* This policy takes into account focus traversal @@ -193,7 +193,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy * focus down-cycle. That is, during normal forward focus traversal, the * Component traversed after a focus cycle root will be the focus-cycle- * root's default Component to focus. This behavior can be disabled using - * the setImplicitDownCycleTraversal method. + * the {@code setImplicitDownCycleTraversal} method. *

* If aContainer is focus * traversal policy provider, the focus is always transferred down-cycle. @@ -519,7 +519,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy * Returns the default Component to focus. This Component will be the first * to receive focus when traversing down into a new focus traversal cycle * rooted at aContainer. The default implementation of this method - * returns the same Component as getFirstComponent. + * returns the same Component as {@code getFirstComponent}. * * @param aContainer the focus cycle root or focus traversal policy provider whose default * Component is to be returned @@ -534,12 +534,12 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy /** * Sets whether this ContainerOrderFocusTraversalPolicy transfers focus - * down-cycle implicitly. If true, during normal forward focus + * down-cycle implicitly. If {@code true}, during normal forward focus * traversal, the Component traversed after a focus cycle root will be the - * focus-cycle-root's default Component to focus. If false, + * focus-cycle-root's default Component to focus. If {@code false}, * the next Component in the focus traversal cycle rooted at the specified * focus cycle root will be traversed instead. The default value for this - * property is true. + * property is {@code true}. * * @param implicitDownCycleTraversal whether this * ContainerOrderFocusTraversalPolicy transfers focus down-cycle @@ -553,9 +553,9 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy /** * Returns whether this ContainerOrderFocusTraversalPolicy transfers focus - * down-cycle implicitly. If true, during normal forward focus + * down-cycle implicitly. If {@code true}, during normal forward focus * traversal, the Component traversed after a focus cycle root will be the - * focus-cycle-root's default Component to focus. If false, + * focus-cycle-root's default Component to focus. If {@code false}, * the next Component in the focus traversal cycle rooted at the specified * focus cycle root will be traversed instead. * @@ -575,8 +575,8 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy * * @param aComponent the Component whose fitness as a focus owner is to * be tested - * @return true if aComponent is visible, displayable, - * enabled, and focusable; false otherwise + * @return {@code true} if aComponent is visible, displayable, + * enabled, and focusable; {@code false} otherwise */ protected boolean accept(Component aComponent) { if (!aComponent.canBeFocusOwner()) { diff --git a/jdk/src/java.desktop/share/classes/java/awt/Cursor.java b/jdk/src/java.desktop/share/classes/java/awt/Cursor.java index 0ca5a3060ad..77f5b130b34 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Cursor.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Cursor.java @@ -146,7 +146,7 @@ public class Cursor implements java.io.Serializable { /** * The chosen cursor type initially set to - * the DEFAULT_CURSOR. + * the {@code DEFAULT_CURSOR}. * * @serial * @see #getType() @@ -283,7 +283,7 @@ public class Cursor implements java.io.Serializable { * @param name a string describing the desired system-specific custom cursor * @return the system specific custom cursor named * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns true + * {@code GraphicsEnvironment.isHeadless} returns true * @exception AWTException in case of erroneous retrieving of the cursor */ public static Cursor getSystemCustomCursor(final String name) diff --git a/jdk/src/java.desktop/share/classes/java/awt/DefaultFocusTraversalPolicy.java b/jdk/src/java.desktop/share/classes/java/awt/DefaultFocusTraversalPolicy.java index 508de7d9bc9..a93cbf4d92a 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/DefaultFocusTraversalPolicy.java +++ b/jdk/src/java.desktop/share/classes/java/awt/DefaultFocusTraversalPolicy.java @@ -32,13 +32,13 @@ import java.awt.peer.ComponentPeer; * of child Components in a Container. From a particular focus cycle root, the * policy makes a pre-order traversal of the Component hierarchy, and traverses * a Container's children according to the ordering of the array returned by - * Container.getComponents(). Portions of the hierarchy that are + * {@code Container.getComponents()}. Portions of the hierarchy that are * not visible and displayable will not be searched. *

* If client code has explicitly set the focusability of a Component by either - * overriding Component.isFocusTraversable() or - * Component.isFocusable(), or by calling - * Component.setFocusable(), then a DefaultFocusTraversalPolicy + * overriding {@code Component.isFocusTraversable()} or + * {@code Component.isFocusable()}, or by calling + * {@code Component.setFocusable()}, then a DefaultFocusTraversalPolicy * behaves exactly like a ContainerOrderFocusTraversalPolicy. If, however, the * Component is relying on default focusability, then a * DefaultFocusTraversalPolicy will reject all Components with non-focusable @@ -80,9 +80,9 @@ public class DefaultFocusTraversalPolicy * focus owner. The Component must be visible, displayable, and enabled * to be accepted. If client code has explicitly set the focusability * of the Component by either overriding - * Component.isFocusTraversable() or - * Component.isFocusable(), or by calling - * Component.setFocusable(), then the Component will be + * {@code Component.isFocusTraversable()} or + * {@code Component.isFocusable()}, or by calling + * {@code Component.setFocusable()}, then the Component will be * accepted if and only if it is focusable. If, however, the Component is * relying on default focusability, then all Canvases, Labels, Panels, * Scrollbars, ScrollPanes, Windows, and lightweight Components will be @@ -90,8 +90,8 @@ public class DefaultFocusTraversalPolicy * * @param aComponent the Component whose fitness as a focus owner is to * be tested - * @return true if aComponent meets the above requirements; - * false otherwise + * @return {@code true} if aComponent meets the above requirements; + * {@code false} otherwise */ protected boolean accept(Component aComponent) { if (!(aComponent.isVisible() && aComponent.isDisplayable() && diff --git a/jdk/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java b/jdk/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java index d6ef4d61fdd..b6f1bcfbe4e 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java +++ b/jdk/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java @@ -309,12 +309,12 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { * related to focus, and all KeyEvents. These events are dispatched based * on the KeyboardFocusManager's notion of the focus owner and the focused * and active Windows, sometimes overriding the source of the specified - * AWTEvent. If this method returns false, then the AWT event + * AWTEvent. If this method returns {@code false}, then the AWT event * dispatcher will attempt to dispatch the event itself. * * @param e the AWTEvent to be dispatched - * @return true if this method dispatched the event; - * false otherwise + * @return {@code true} if this method dispatched the event; + * {@code false} otherwise */ public boolean dispatchEvent(AWTEvent e) { if (focusLog.isLoggable(PlatformLogger.Level.FINE) && (e instanceof WindowEvent || e instanceof FocusEvent)) { @@ -778,7 +778,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { } /** - * Called by dispatchEvent if no other + * Called by {@code dispatchEvent} if no other * KeyEventDispatcher in the dispatcher chain dispatched the KeyEvent, or * if no other KeyEventDispatchers are registered. If the event has not * been consumed, its target is enabled, and the focus owner is not null, @@ -787,13 +787,13 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { * KeyEventPostProcessors. After all this operations are finished, * the event is passed to peers for processing. *

- * In all cases, this method returns true, since + * In all cases, this method returns {@code true}, since * DefaultKeyboardFocusManager is designed so that neither - * dispatchEvent, nor the AWT event dispatcher, should take + * {@code dispatchEvent}, nor the AWT event dispatcher, should take * further action on the event in any situation. * * @param e the KeyEvent to be dispatched - * @return true + * @return {@code true} * @see Component#dispatchEvent */ public boolean dispatchKeyEvent(KeyEvent e) { @@ -841,13 +841,13 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { } /** - * This method will be called by dispatchKeyEvent. It will + * This method will be called by {@code dispatchKeyEvent}. It will * handle any unconsumed KeyEvents that map to an AWT - * MenuShortcut by consuming the event and activating the + * {@code MenuShortcut} by consuming the event and activating the * shortcut. * * @param e the KeyEvent to post-process - * @return true + * @return {@code true} * @see #dispatchKeyEvent * @see MenuShortcut */ @@ -998,7 +998,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { } /** - * Returns true if there are some marker associated with component comp + * Returns true if there are some marker associated with component {@code comp} * in a markers' queue * @since 1.5 */ @@ -1201,7 +1201,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { * the focus owner. KeyEvents with timestamps later than the specified * timestamp will be enqueued until the specified Component receives a * FOCUS_GAINED event, or the AWT cancels the delay request by invoking - * dequeueKeyEvents or discardKeyEvents. + * {@code dequeueKeyEvents} or {@code discardKeyEvents}. * * @param after timestamp of current event, or the current, system time if * the current event has no timestamp, or the AWT cannot determine @@ -1241,15 +1241,15 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { /** * Releases for normal dispatching to the current focus owner all * KeyEvents which were enqueued because of a call to - * enqueueKeyEvents with the same timestamp and Component. + * {@code enqueueKeyEvents} with the same timestamp and Component. * If the given timestamp is less than zero, the outstanding enqueue * request for the given Component with the oldest timestamp (if * any) should be cancelled. * * @param after the timestamp specified in the call to - * enqueueKeyEvents, or any value < 0 + * {@code enqueueKeyEvents}, or any value < 0 * @param untilFocused the Component specified in the call to - * enqueueKeyEvents + * {@code enqueueKeyEvents} * @see #enqueueKeyEvents * @see #discardKeyEvents */ @@ -1292,11 +1292,11 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { /** * Discards all KeyEvents which were enqueued because of one or more calls - * to enqueueKeyEvents with the specified Component, or one of + * to {@code enqueueKeyEvents} with the specified Component, or one of * its descendants. * * @param comp the Component specified in one or more calls to - * enqueueKeyEvents, or a parent of such a Component + * {@code enqueueKeyEvents}, or a parent of such a Component * @see #enqueueKeyEvents * @see #dequeueKeyEvents */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Desktop.java b/jdk/src/java.desktop/share/classes/java/awt/Desktop.java index d134a4d218a..96f3d57e235 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Desktop.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Desktop.java @@ -127,7 +127,7 @@ public class Desktop { } /** - * Returns the Desktop instance of the current + * Returns the {@code Desktop} instance of the current * browser context. On some platforms the Desktop API may not be * supported; use the {@link #isDesktopSupported} method to * determine if the current desktop is supported. @@ -162,8 +162,8 @@ public class Desktop { * If it's supported, use {@link #getDesktop()} to retrieve an * instance. * - * @return true if this class is supported on the - * current platform; false otherwise + * @return {@code true} if this class is supported on the + * current platform; {@code false} otherwise * @see #getDesktop() */ public static boolean isDesktopSupported(){ @@ -186,8 +186,8 @@ public class Desktop { * action method will throw an {@link IOException}. * * @param action the specified {@link Action} - * @return true if the specified action is supported on - * the current platform; false otherwise + * @return {@code true} if the specified action is supported on + * the current platform; {@code false} otherwise * @see Desktop.Action */ public boolean isSupported(Action action) { @@ -230,8 +230,8 @@ public class Desktop { /** - * Calls to the security manager's checkPermission method with - * an AWTPermission("showWindowWithoutWarningBanner") + * Calls to the security manager's {@code checkPermission} method with + * an {@code AWTPermission("showWindowWithoutWarningBanner")} * permission. */ private void checkAWTPermission(){ @@ -259,7 +259,7 @@ public class Desktop { * @throws SecurityException if a security manager exists and its * {@link java.lang.SecurityManager#checkRead(java.lang.String)} * method denies read access to the file, or it denies the - * AWTPermission("showWindowWithoutWarningBanner") + * {@code AWTPermission("showWindowWithoutWarningBanner")} * permission, or the calling thread is not allowed to create a * subprocess * @see java.awt.AWTPermission @@ -290,7 +290,7 @@ public class Desktop { * method denies read access to the file, or {@link * java.lang.SecurityManager#checkWrite(java.lang.String)} method * denies write access to the file, or it denies the - * AWTPermission("showWindowWithoutWarningBanner") + * {@code AWTPermission("showWindowWithoutWarningBanner")} * permission, or the calling thread is not allowed to create a * subprocess * @see java.awt.AWTPermission @@ -361,7 +361,7 @@ public class Desktop { * failed to be launched * @throws SecurityException if a security manager exists and it * denies the - * AWTPermission("showWindowWithoutWarningBanner") + * {@code AWTPermission("showWindowWithoutWarningBanner")} * permission, or the calling thread is not allowed to create a * subprocess; and not invoked from within an applet or Java Web Started * application @@ -415,7 +415,7 @@ public class Desktop { * found, or it fails to be launched * @throws SecurityException if a security manager exists and it * denies the - * AWTPermission("showWindowWithoutWarningBanner") + * {@code AWTPermission("showWindowWithoutWarningBanner")} * permission, or the calling thread is not allowed to create a * subprocess * @see java.awt.AWTPermission @@ -438,7 +438,7 @@ public class Desktop { * client, filling the message fields specified by a {@code * mailto:} URI. * - *

A mailto: URI can specify message fields + *

A {@code mailto:} URI can specify message fields * including "to", "cc", "subject", * "body", etc. See The mailto URL @@ -449,14 +449,14 @@ public class Desktop { * @throws NullPointerException if the specified URI is {@code * null} * @throws IllegalArgumentException if the URI scheme is not - * "mailto" + * {@code "mailto"} * @throws UnsupportedOperationException if the current platform * does not support the {@link Desktop.Action#MAIL} action * @throws IOException if the user default mail client is not * found or fails to be launched * @throws SecurityException if a security manager exists and it * denies the - * AWTPermission("showWindowWithoutWarningBanner") + * {@code AWTPermission("showWindowWithoutWarningBanner")} * permission, or the calling thread is not allowed to create a * subprocess * @see java.net.URI diff --git a/jdk/src/java.desktop/share/classes/java/awt/Dialog.java b/jdk/src/java.desktop/share/classes/java/awt/Dialog.java index 84fb5e77e37..79e66b54798 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Dialog.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Dialog.java @@ -46,22 +46,22 @@ import java.security.AccessControlException; * * The size of the dialog includes any area designated for the * border. The dimensions of the border area can be obtained - * using the getInsets method, however, since + * using the {@code getInsets} method, however, since * these dimensions are platform-dependent, a valid insets * value cannot be obtained until the dialog is made displayable - * by either calling pack or show. + * by either calling {@code pack} or {@code show}. * Since the border area is included in the overall size of the * dialog, the border effectively obscures a portion of the dialog, * constraining the area available for rendering and/or displaying * subcomponents to the rectangle which has an upper-left corner - * location of (insets.left, insets.top), and has a size of - * width - (insets.left + insets.right) by - * height - (insets.top + insets.bottom). + * location of {@code (insets.left, insets.top)}, and has a size of + * {@code width - (insets.left + insets.right)} by + * {@code height - (insets.top + insets.bottom)}. *

- * The default layout for a dialog is BorderLayout. + * The default layout for a dialog is {@code BorderLayout}. *

* A dialog may have its native decorations (i.e. Frame & Titlebar) turned off - * with setUndecorated. This can only be done while the dialog + * with {@code setUndecorated}. This can only be done while the dialog * is not {@link Component#isDisplayable() displayable}. *

* A dialog may have another window as its owner when it's constructed. When @@ -69,7 +69,7 @@ import java.security.AccessControlException; * automatically be hidden from the user. When the owner window is subsequently * restored, the dialog is made visible to the user again. *

- * In a multi-screen environment, you can create a Dialog + * In a multi-screen environment, you can create a {@code Dialog} * on a different screen device than its owner. See {@link java.awt.Frame} for * more information. *

@@ -80,11 +80,11 @@ import java.security.AccessControlException; * specification for details. *

* Dialogs are capable of generating the following - * WindowEvents: - * WindowOpened, WindowClosing, - * WindowClosed, WindowActivated, - * WindowDeactivated, WindowGainedFocus, - * WindowLostFocus. + * {@code WindowEvents}: + * {@code WindowOpened}, {@code WindowClosing}, + * {@code WindowClosed}, {@code WindowActivated}, + * {@code WindowDeactivated}, {@code WindowGainedFocus}, + * {@code WindowLostFocus}. * * @see WindowEvent * @see Window#addWindowListener @@ -117,7 +117,7 @@ public class Dialog extends Window { /** * This field indicates whether the dialog is undecorated. * This property can only be changed while the dialog is not displayable. - * undecorated will be true if the dialog is + * {@code undecorated} will be true if the dialog is * undecorated, otherwise it will be false. * * @serial @@ -134,7 +134,7 @@ public class Dialog extends Window { * Modal dialogs block all input to some top-level windows. * Whether a particular window is blocked depends on dialog's type * of modality; this is called the "scope of blocking". The - * ModalityType enum specifies modal types and their + * {@code ModalityType} enum specifies modal types and their * associated scopes. * * @see Dialog#getModalityType @@ -145,11 +145,11 @@ public class Dialog extends Window { */ public static enum ModalityType { /** - * MODELESS dialog doesn't block any top-level windows. + * {@code MODELESS} dialog doesn't block any top-level windows. */ MODELESS, /** - * A DOCUMENT_MODAL dialog blocks input to all top-level windows + * A {@code DOCUMENT_MODAL} dialog blocks input to all top-level windows * from the same document except those from its own child hierarchy. * A document is a top-level window without an owner. It may contain child * windows that, together with the top-level window are treated as a single @@ -158,7 +158,7 @@ public class Dialog extends Window { */ DOCUMENT_MODAL, /** - * An APPLICATION_MODAL dialog blocks all top-level windows + * An {@code APPLICATION_MODAL} dialog blocks all top-level windows * from the same Java application except those from its own child hierarchy. * If there are several applets launched in a browser, they can be * treated either as separate applications or a single one. This behavior @@ -166,18 +166,18 @@ public class Dialog extends Window { */ APPLICATION_MODAL, /** - * A TOOLKIT_MODAL dialog blocks all top-level windows run + * A {@code TOOLKIT_MODAL} dialog blocks all top-level windows run * from the same toolkit except those from its own child hierarchy. If there * are several applets launched in a browser, all of them run with the same * toolkit; thus, a toolkit-modal dialog displayed by an applet may affect * other applets and all windows of the browser instance which embeds the * Java runtime environment for this toolkit. - * Special AWTPermission "toolkitModality" must be granted to use - * toolkit-modal dialogs. If a TOOLKIT_MODAL dialog is being created - * and this permission is not granted, a SecurityException will be + * Special {@code AWTPermission} "toolkitModality" must be granted to use + * toolkit-modal dialogs. If a {@code TOOLKIT_MODAL} dialog is being created + * and this permission is not granted, a {@code SecurityException} will be * thrown, and no dialog will be created. If a modality type is being changed - * to TOOLKIT_MODAL and this permission is not granted, a - * SecurityException will be thrown, and the modality type will + * to {@code TOOLKIT_MODAL} and this permission is not granted, a + * {@code SecurityException} will be thrown, and the modality type will * be left unchanged. */ TOOLKIT_MODAL @@ -185,8 +185,8 @@ public class Dialog extends Window { /** * Default modality type for modal dialogs. The default modality type is - * APPLICATION_MODAL. Calling the oldstyle setModal(true) - * is equal to setModalityType(DEFAULT_MODALITY_TYPE). + * {@code APPLICATION_MODAL}. Calling the oldstyle {@code setModal(true)} + * is equal to {@code setModalityType(DEFAULT_MODALITY_TYPE)}. * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#setModal @@ -245,20 +245,20 @@ public class Dialog extends Window { */ NO_EXCLUDE, /** - * APPLICATION_EXCLUDE indicates that a top-level window + * {@code APPLICATION_EXCLUDE} indicates that a top-level window * won't be blocked by any application-modal dialogs. Also, it isn't * blocked by document-modal dialogs from outside of its child hierarchy. */ APPLICATION_EXCLUDE, /** - * TOOLKIT_EXCLUDE indicates that a top-level window + * {@code TOOLKIT_EXCLUDE} indicates that a top-level window * won't be blocked by application-modal or toolkit-modal dialogs. Also, * it isn't blocked by document-modal dialogs from outside of its * child hierarchy. - * The "toolkitModality" AWTPermission must be granted + * The "toolkitModality" {@code AWTPermission} must be granted * for this exclusion. If an exclusion property is being changed to - * TOOLKIT_EXCLUDE and this permission is not granted, a - * SecurityException will be thrown, and the exclusion + * {@code TOOLKIT_EXCLUDE} and this permission is not granted, a + * {@code SecurityException} will be thrown, and the exclusion * property will be left unchanged. */ TOOLKIT_EXCLUDE @@ -313,15 +313,15 @@ public class Dialog extends Window { private static final long serialVersionUID = 5920926903803293709L; /** - * Constructs an initially invisible, modeless Dialog with - * the specified owner Frame and an empty title. + * Constructs an initially invisible, modeless {@code Dialog} with + * the specified owner {@code Frame} and an empty title. * - * @param owner the owner of the dialog or null if + * @param owner the owner of the dialog or {@code null} if * this dialog has no owner - * @exception java.lang.IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * @exception java.lang.IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.GraphicsEnvironment#isHeadless * @see Component#setSize @@ -332,19 +332,19 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible Dialog with the specified - * owner Frame and modality and an empty title. + * Constructs an initially invisible {@code Dialog} with the specified + * owner {@code Frame} and modality and an empty title. * - * @param owner the owner of the dialog or null if + * @param owner the owner of the dialog or {@code null} if * this dialog has no owner * @param modal specifies whether dialog blocks user input to other top-level - * windows when shown. If false, the dialog is MODELESS; - * if true, the modality type property is set to - * DEFAULT_MODALITY_TYPE - * @exception java.lang.IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * windows when shown. If {@code false}, the dialog is {@code MODELESS}; + * if {@code true}, the modality type property is set to + * {@code DEFAULT_MODALITY_TYPE} + * @exception java.lang.IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS @@ -358,17 +358,17 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible, modeless Dialog with - * the specified owner Frame and title. + * Constructs an initially invisible, modeless {@code Dialog} with + * the specified owner {@code Frame} and title. * - * @param owner the owner of the dialog or null if + * @param owner the owner of the dialog or {@code null} if * this dialog has no owner - * @param title the title of the dialog or null if this dialog + * @param title the title of the dialog or {@code null} if this dialog * has no title - * @exception IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * @exception IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.GraphicsEnvironment#isHeadless * @see Component#setSize @@ -379,21 +379,21 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible Dialog with the - * specified owner Frame, title and modality. + * Constructs an initially invisible {@code Dialog} with the + * specified owner {@code Frame}, title and modality. * - * @param owner the owner of the dialog or null if + * @param owner the owner of the dialog or {@code null} if * this dialog has no owner - * @param title the title of the dialog or null if this dialog + * @param title the title of the dialog or {@code null} if this dialog * has no title * @param modal specifies whether dialog blocks user input to other top-level - * windows when shown. If false, the dialog is MODELESS; - * if true, the modality type property is set to - * DEFAULT_MODALITY_TYPE - * @exception java.lang.IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * windows when shown. If {@code false}, the dialog is {@code MODELESS}; + * if {@code true}, the modality type property is set to + * {@code DEFAULT_MODALITY_TYPE} + * @exception java.lang.IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS @@ -409,23 +409,23 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible Dialog with the specified owner - * Frame, title, modality, and GraphicsConfiguration. - * @param owner the owner of the dialog or null if this dialog + * Constructs an initially invisible {@code Dialog} with the specified owner + * {@code Frame}, title, modality, and {@code GraphicsConfiguration}. + * @param owner the owner of the dialog or {@code null} if this dialog * has no owner - * @param title the title of the dialog or null if this dialog + * @param title the title of the dialog or {@code null} if this dialog * has no title * @param modal specifies whether dialog blocks user input to other top-level - * windows when shown. If false, the dialog is MODELESS; - * if true, the modality type property is set to - * DEFAULT_MODALITY_TYPE - * @param gc the GraphicsConfiguration of the target screen device; - * if null, the default system GraphicsConfiguration + * windows when shown. If {@code false}, the dialog is {@code MODELESS}; + * if {@code true}, the modality type property is set to + * {@code DEFAULT_MODALITY_TYPE} + * @param gc the {@code GraphicsConfiguration} of the target screen device; + * if {@code null}, the default system {@code GraphicsConfiguration} * is assumed - * @exception java.lang.IllegalArgumentException if gc + * @exception java.lang.IllegalArgumentException if {@code gc} * is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS @@ -443,15 +443,15 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible, modeless Dialog with - * the specified owner Dialog and an empty title. + * Constructs an initially invisible, modeless {@code Dialog} with + * the specified owner {@code Dialog} and an empty title. * - * @param owner the owner of the dialog or null if this + * @param owner the owner of the dialog or {@code null} if this * dialog has no owner - * @exception java.lang.IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * @exception java.lang.IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.2 */ @@ -460,17 +460,17 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible, modeless Dialog - * with the specified owner Dialog and title. + * Constructs an initially invisible, modeless {@code Dialog} + * with the specified owner {@code Dialog} and title. * - * @param owner the owner of the dialog or null if this + * @param owner the owner of the dialog or {@code null} if this * has no owner - * @param title the title of the dialog or null if this dialog + * @param title the title of the dialog or {@code null} if this dialog * has no title - * @exception java.lang.IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * @exception java.lang.IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.2 @@ -480,21 +480,21 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible Dialog with the - * specified owner Dialog, title, and modality. + * Constructs an initially invisible {@code Dialog} with the + * specified owner {@code Dialog}, title, and modality. * - * @param owner the owner of the dialog or null if this + * @param owner the owner of the dialog or {@code null} if this * dialog has no owner - * @param title the title of the dialog or null if this + * @param title the title of the dialog or {@code null} if this * dialog has no title * @param modal specifies whether dialog blocks user input to other top-level - * windows when shown. If false, the dialog is MODELESS; - * if true, the modality type property is set to - * DEFAULT_MODALITY_TYPE - * @exception IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * windows when shown. If {@code false}, the dialog is {@code MODELESS}; + * if {@code true}, the modality type property is set to + * {@code DEFAULT_MODALITY_TYPE} + * @exception IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS @@ -510,25 +510,25 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible Dialog with the - * specified owner Dialog, title, modality and - * GraphicsConfiguration. + * Constructs an initially invisible {@code Dialog} with the + * specified owner {@code Dialog}, title, modality and + * {@code GraphicsConfiguration}. * - * @param owner the owner of the dialog or null if this + * @param owner the owner of the dialog or {@code null} if this * dialog has no owner - * @param title the title of the dialog or null if this + * @param title the title of the dialog or {@code null} if this * dialog has no title * @param modal specifies whether dialog blocks user input to other top-level - * windows when shown. If false, the dialog is MODELESS; - * if true, the modality type property is set to - * DEFAULT_MODALITY_TYPE - * @param gc the GraphicsConfiguration of the target screen device; - * if null, the default system GraphicsConfiguration + * windows when shown. If {@code false}, the dialog is {@code MODELESS}; + * if {@code true}, the modality type property is set to + * {@code DEFAULT_MODALITY_TYPE} + * @param gc the {@code GraphicsConfiguration} of the target screen device; + * if {@code null}, the default system {@code GraphicsConfiguration} * is assumed - * @exception java.lang.IllegalArgumentException if gc + * @exception java.lang.IllegalArgumentException if {@code gc} * is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS @@ -547,20 +547,20 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible, modeless Dialog with the - * specified owner Window and an empty title. + * Constructs an initially invisible, modeless {@code Dialog} with the + * specified owner {@code Window} and an empty title. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any - * of their descendants or null + * of their descendants or {@code null} * - * @exception java.lang.IllegalArgumentException if the owner + * @exception java.lang.IllegalArgumentException if the {@code owner} * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} - * @exception java.lang.IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * @exception java.lang.IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.GraphicsEnvironment#isHeadless * @@ -571,22 +571,22 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible, modeless Dialog with - * the specified owner Window and title. + * Constructs an initially invisible, modeless {@code Dialog} with + * the specified owner {@code Window} and title. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any - * of their descendants or null - * @param title the title of the dialog or null if this dialog + * of their descendants or {@code null} + * @param title the title of the dialog or {@code null} if this dialog * has no title * - * @exception java.lang.IllegalArgumentException if the owner + * @exception java.lang.IllegalArgumentException if the {@code owner} * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} - * @exception java.lang.IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * @exception java.lang.IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.GraphicsEnvironment#isHeadless * @@ -597,25 +597,25 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible Dialog with the - * specified owner Window and modality and an empty title. + * Constructs an initially invisible {@code Dialog} with the + * specified owner {@code Window} and modality and an empty title. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any - * of their descendants or null + * of their descendants or {@code null} * @param modalityType specifies whether dialog blocks input to other - * windows when shown. null value and unsupported modality - * types are equivalent to MODELESS + * windows when shown. {@code null} value and unsupported modality + * types are equivalent to {@code MODELESS} * - * @exception java.lang.IllegalArgumentException if the owner + * @exception java.lang.IllegalArgumentException if the {@code owner} * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} - * @exception java.lang.IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * @exception java.lang.IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * @exception SecurityException if the calling thread does not have permission - * to create modal dialogs with the given modalityType + * to create modal dialogs with the given {@code modalityType} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#setModal @@ -630,27 +630,27 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible Dialog with the - * specified owner Window, title and modality. + * Constructs an initially invisible {@code Dialog} with the + * specified owner {@code Window}, title and modality. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any - * of their descendants or null - * @param title the title of the dialog or null if this dialog + * of their descendants or {@code null} + * @param title the title of the dialog or {@code null} if this dialog * has no title * @param modalityType specifies whether dialog blocks input to other - * windows when shown. null value and unsupported modality - * types are equivalent to MODELESS + * windows when shown. {@code null} value and unsupported modality + * types are equivalent to {@code MODELESS} * - * @exception java.lang.IllegalArgumentException if the owner + * @exception java.lang.IllegalArgumentException if the {@code owner} * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} - * @exception java.lang.IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * @exception java.lang.IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * @exception SecurityException if the calling thread does not have permission - * to create modal dialogs with the given modalityType + * to create modal dialogs with the given {@code modalityType} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#setModal @@ -677,31 +677,31 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible Dialog with the - * specified owner Window, title, modality and - * GraphicsConfiguration. + * Constructs an initially invisible {@code Dialog} with the + * specified owner {@code Window}, title, modality and + * {@code GraphicsConfiguration}. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any - * of their descendants or null - * @param title the title of the dialog or null if this dialog + * of their descendants or {@code null} + * @param title the title of the dialog or {@code null} if this dialog * has no title * @param modalityType specifies whether dialog blocks input to other - * windows when shown. null value and unsupported modality - * types are equivalent to MODELESS - * @param gc the GraphicsConfiguration of the target screen device; - * if null, the default system GraphicsConfiguration + * windows when shown. {@code null} value and unsupported modality + * types are equivalent to {@code MODELESS} + * @param gc the {@code GraphicsConfiguration} of the target screen device; + * if {@code null}, the default system {@code GraphicsConfiguration} * is assumed * - * @exception java.lang.IllegalArgumentException if the owner + * @exception java.lang.IllegalArgumentException if the {@code owner} * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} - * @exception java.lang.IllegalArgumentException if gc + * @exception java.lang.IllegalArgumentException if {@code gc} * is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * @exception SecurityException if the calling thread does not have permission - * to create modal dialogs with the given modalityType + * to create modal dialogs with the given {@code modalityType} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#setModal @@ -766,8 +766,8 @@ public class Dialog extends Window { * This method is obsolete and is kept for backwards compatibility only. * Use {@link #getModalityType getModalityType()} instead. * - * @return true if this dialog window is modal; - * false otherwise + * @return {@code true} if this dialog window is modal; + * {@code false} otherwise * * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE * @see java.awt.Dialog.ModalityType#MODELESS @@ -792,10 +792,10 @@ public class Dialog extends Window { * until it is hidden and then shown again. * * @param modal specifies whether dialog blocks input to other windows - * when shown; calling to setModal(true) is equivalent to - * setModalityType(Dialog.DEFAULT_MODALITY_TYPE), and - * calling to setModal(false) is equivalent to - * setModalityType(Dialog.ModalityType.MODELESS) + * when shown; calling to {@code setModal(true)} is equivalent to + * {@code setModalityType(Dialog.DEFAULT_MODALITY_TYPE)}, and + * calling to {@code setModal(false)} is equivalent to + * {@code setModalityType(Dialog.ModalityType.MODELESS)} * * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE * @see java.awt.Dialog.ModalityType#MODELESS @@ -827,18 +827,18 @@ public class Dialog extends Window { * Sets the modality type for this dialog. See {@link * java.awt.Dialog.ModalityType ModalityType} for possible modality types. *

- * If the given modality type is not supported, MODELESS - * is used. You may want to call getModalityType() after calling + * If the given modality type is not supported, {@code MODELESS} + * is used. You may want to call {@code getModalityType()} after calling * this method to ensure that the modality type has been set. *

* Note: changing modality of the visible dialog may have no effect * until it is hidden and then shown again. * * @param type specifies whether dialog blocks input to other - * windows when shown. null value and unsupported modality - * types are equivalent to MODELESS + * windows when shown. {@code null} value and unsupported modality + * types are equivalent to {@code MODELESS} * @exception SecurityException if the calling thread does not have permission - * to create modal dialogs with the given modalityType + * to create modal dialogs with the given {@code modalityType} * * @see java.awt.Dialog#getModalityType * @see java.awt.Toolkit#isModalityTypeSupported @@ -866,7 +866,7 @@ public class Dialog extends Window { * Gets the title of the dialog. The title is displayed in the * dialog's border. * @return the title of this dialog window. The title may be - * null. + * {@code null}. * @see java.awt.Dialog#setTitle */ public String getTitle() { @@ -1193,8 +1193,8 @@ public class Dialog extends Window { /** * Indicates whether this dialog is resizable by the user. * By default, all dialogs are initially resizable. - * @return true if the user can resize the dialog; - * false otherwise. + * @return {@code true} if the user can resize the dialog; + * {@code false} otherwise. * @see java.awt.Dialog#setResizable */ public boolean isResizable() { @@ -1203,8 +1203,8 @@ public class Dialog extends Window { /** * Sets whether this dialog is resizable by the user. - * @param resizable true if the user can - * resize this dialog; false otherwise. + * @param resizable {@code true} if the user can + * resize this dialog; {@code false} otherwise. * @see java.awt.Dialog#isResizable */ public void setResizable(boolean resizable) { @@ -1283,8 +1283,8 @@ public class Dialog extends Window { /** * Indicates whether this dialog is undecorated. * By default, all dialogs are initially decorated. - * @return true if dialog is undecorated; - * false otherwise. + * @return {@code true} if dialog is undecorated; + * {@code false} otherwise. * @see java.awt.Dialog#setUndecorated * @since 1.4 */ @@ -1336,7 +1336,7 @@ public class Dialog extends Window { * method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this dialog window. */ @@ -1647,7 +1647,7 @@ public class Dialog extends Window { /** * This class implements accessibility support for the - * Dialog class. It provides an implementation of the + * {@code Dialog} class. It provides an implementation of the * Java Accessibility API appropriate to dialog user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Dimension.java b/jdk/src/java.desktop/share/classes/java/awt/Dimension.java index c368668de5d..9b2b3ff8730 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Dimension.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Dimension.java @@ -29,19 +29,19 @@ import java.awt.geom.Dimension2D; import java.beans.Transient; /** - * The Dimension class encapsulates the width and + * The {@code Dimension} class encapsulates the width and * height of a component (in integer precision) in a single object. * The class is * associated with certain properties of components. Several methods - * defined by the Component class and the - * LayoutManager interface return a - * Dimension object. + * defined by the {@code Component} class and the + * {@code LayoutManager} interface return a + * {@code Dimension} object. *

- * Normally the values of width - * and height are non-negative integers. + * Normally the values of {@code width} + * and {@code height} are non-negative integers. * The constructors that allow you to create a dimension do * not prevent you from setting a negative value for these properties. - * If the value of width or height is + * If the value of {@code width} or {@code height} is * negative, the behavior of some methods defined by other objects is * undefined. * @@ -92,7 +92,7 @@ public class Dimension extends Dimension2D implements java.io.Serializable { } /** - * Creates an instance of Dimension with a width + * Creates an instance of {@code Dimension} with a width * of zero and a height of zero. */ public Dimension() { @@ -100,19 +100,19 @@ public class Dimension extends Dimension2D implements java.io.Serializable { } /** - * Creates an instance of Dimension whose width + * Creates an instance of {@code Dimension} whose width * and height are the same as for the specified dimension. * * @param d the specified dimension for the - * width and - * height values + * {@code width} and + * {@code height} values */ public Dimension(Dimension d) { this(d.width, d.height); } /** - * Constructs a Dimension and initializes + * Constructs a {@code Dimension} and initializes * it to the specified width and specified height. * * @param width the specified width @@ -140,14 +140,14 @@ public class Dimension extends Dimension2D implements java.io.Serializable { } /** - * Sets the size of this Dimension object to + * Sets the size of this {@code Dimension} object to * the specified width and height in double precision. - * Note that if width or height - * are larger than Integer.MAX_VALUE, they will - * be reset to Integer.MAX_VALUE. + * Note that if {@code width} or {@code height} + * are larger than {@code Integer.MAX_VALUE}, they will + * be reset to {@code Integer.MAX_VALUE}. * - * @param width the new width for the Dimension object - * @param height the new height for the Dimension object + * @param width the new width for the {@code Dimension} object + * @param height the new height for the {@code Dimension} object * @since 1.2 */ public void setSize(double width, double height) { @@ -156,12 +156,12 @@ public class Dimension extends Dimension2D implements java.io.Serializable { } /** - * Gets the size of this Dimension object. + * Gets the size of this {@code Dimension} object. * This method is included for completeness, to parallel the - * getSize method defined by Component. + * {@code getSize} method defined by {@code Component}. * * @return the size of this dimension, a new instance of - * Dimension with the same width and height + * {@code Dimension} with the same width and height * @see java.awt.Dimension#setSize * @see java.awt.Component#getSize * @since 1.1 @@ -172,10 +172,10 @@ public class Dimension extends Dimension2D implements java.io.Serializable { } /** - * Sets the size of this Dimension object to the specified size. + * Sets the size of this {@code Dimension} object to the specified size. * This method is included for completeness, to parallel the - * setSize method defined by Component. - * @param d the new size for this Dimension object + * {@code setSize} method defined by {@code Component}. + * @param d the new size for this {@code Dimension} object * @see java.awt.Dimension#getSize * @see java.awt.Component#setSize * @since 1.1 @@ -185,13 +185,13 @@ public class Dimension extends Dimension2D implements java.io.Serializable { } /** - * Sets the size of this Dimension object + * Sets the size of this {@code Dimension} object * to the specified width and height. * This method is included for completeness, to parallel the - * setSize method defined by Component. + * {@code setSize} method defined by {@code Component}. * - * @param width the new width for this Dimension object - * @param height the new height for this Dimension object + * @param width the new width for this {@code Dimension} object + * @param height the new height for this {@code Dimension} object * @see java.awt.Dimension#getSize * @see java.awt.Component#setSize * @since 1.1 @@ -213,9 +213,9 @@ public class Dimension extends Dimension2D implements java.io.Serializable { } /** - * Returns the hash code for this Dimension. + * Returns the hash code for this {@code Dimension}. * - * @return a hash code for this Dimension + * @return a hash code for this {@code Dimension} */ public int hashCode() { int sum = width + height; @@ -224,13 +224,13 @@ public class Dimension extends Dimension2D implements java.io.Serializable { /** * Returns a string representation of the values of this - * Dimension object's height and - * width fields. This method is intended to be used only + * {@code Dimension} object's {@code height} and + * {@code width} fields. This method is intended to be used only * for debugging purposes, and the content and format of the returned * string may vary between implementations. The returned string may be - * empty but may not be null. + * empty but may not be {@code null}. * - * @return a string representation of this Dimension + * @return a string representation of this {@code Dimension} * object */ public String toString() { diff --git a/jdk/src/java.desktop/share/classes/java/awt/DisplayMode.java b/jdk/src/java.desktop/share/classes/java/awt/DisplayMode.java index 12730fde5f4..3dafedb2be8 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/DisplayMode.java +++ b/jdk/src/java.desktop/share/classes/java/awt/DisplayMode.java @@ -28,8 +28,8 @@ package java.awt; import java.lang.annotation.Native; /** - * The DisplayMode class encapsulates the bit depth, height, - * width, and refresh rate of a GraphicsDevice. The ability to + * The {@code DisplayMode} class encapsulates the bit depth, height, + * width, and refresh rate of a {@code GraphicsDevice}. The ability to * change graphics device's display mode is platform- and * configuration-dependent and may not always be available * (see {@link GraphicsDevice#isDisplayChangeSupported}). @@ -57,10 +57,10 @@ public final class DisplayMode { * @param width the width of the display, in pixels * @param height the height of the display, in pixels * @param bitDepth the bit depth of the display, in bits per - * pixel. This can be BIT_DEPTH_MULTI if multiple + * pixel. This can be {@code BIT_DEPTH_MULTI} if multiple * bit depths are available. * @param refreshRate the refresh rate of the display, in hertz. - * This can be REFRESH_RATE_UNKNOWN if the + * This can be {@code REFRESH_RATE_UNKNOWN} if the * information is not available. * @see #BIT_DEPTH_MULTI * @see #REFRESH_RATE_UNKNOWN @@ -96,7 +96,7 @@ public final class DisplayMode { /** * Returns the bit depth of the display, in bits per pixel. This may be - * BIT_DEPTH_MULTI if multiple bit depths are supported in + * {@code BIT_DEPTH_MULTI} if multiple bit depths are supported in * this display mode. * * @return the bit depth of the display, in bits per pixel. @@ -114,7 +114,7 @@ public final class DisplayMode { /** * Returns the refresh rate of the display, in hertz. This may be - * REFRESH_RATE_UNKNOWN if the information is not available. + * {@code REFRESH_RATE_UNKNOWN} if the information is not available. * * @return the refresh rate of the display, in hertz. * @see #REFRESH_RATE_UNKNOWN diff --git a/jdk/src/java.desktop/share/classes/java/awt/Event.java b/jdk/src/java.desktop/share/classes/java/awt/Event.java index 4235bfaa4dd..b00b09876ea 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Event.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Event.java @@ -28,14 +28,14 @@ import java.awt.event.*; import java.io.*; /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

- * Event is a platform-independent class that + * {@code Event} is a platform-independent class that * encapsulates events from the platform's Graphical User * Interface in the Java 1.0 event model. In Java 1.1 - * and later versions, the Event class is maintained + * and later versions, the {@code Event} class is maintained * only for backwards compatibility. The information in this * class description is provided to assist programmers in * converting Java 1.0 programs to the new event model. @@ -43,18 +43,18 @@ import java.io.*; * In the Java 1.0 event model, an event contains an * {@link Event#id} field * that indicates what type of event it is and which other - * Event variables are relevant for the event. + * {@code Event} variables are relevant for the event. *

* For keyboard events, {@link Event#key} * contains a value indicating which key was activated, and * {@link Event#modifiers} contains the * modifiers for that event. For the KEY_PRESS and KEY_RELEASE - * event ids, the value of key is the unicode + * event ids, the value of {@code key} is the unicode * character code for the key. For KEY_ACTION and - * KEY_ACTION_RELEASE, the value of key is + * KEY_ACTION_RELEASE, the value of {@code key} is * one of the defined action-key identifiers in the - * Event class (PGUP, - * PGDN, F1, F2, etc). + * {@code Event} class ({@code PGUP}, + * {@code PGDN}, {@code F1}, {@code F2}, etc). * * @author Sami Shaio * @since 1.0 @@ -293,7 +293,7 @@ public class Event implements java.io.Serializable { /** * The user has pressed a non-ASCII action key. - * The key field contains a value that indicates + * The {@code key} field contains a value that indicates * that the event occurred on one of the action keys, which * comprise the 12 function keys, the arrow (cursor) keys, * Page Up, Page Down, Home, End, Print Screen, Scroll Lock, @@ -303,7 +303,7 @@ public class Event implements java.io.Serializable { /** * The user has released a non-ASCII action key. - * The key field contains a value that indicates + * The {@code key} field contains a value that indicates * that the event occurred on one of the action keys, which * comprise the 12 function keys, the arrow (cursor) keys, * Page Up, Page Down, Home, End, Print Screen, Scroll Lock, @@ -315,9 +315,9 @@ public class Event implements java.io.Serializable { private static final int MOUSE_EVENT = 500; /** - * The user has pressed the mouse button. The ALT_MASK + * The user has pressed the mouse button. The {@code ALT_MASK} * flag indicates that the middle button has been pressed. - * The META_MASKflag indicates that the + * The {@code META_MASK} flag indicates that the * right button has been pressed. * @see java.awt.Event#ALT_MASK * @see java.awt.Event#META_MASK @@ -325,9 +325,9 @@ public class Event implements java.io.Serializable { public static final int MOUSE_DOWN = 1 + MOUSE_EVENT; /** - * The user has released the mouse button. The ALT_MASK + * The user has released the mouse button. The {@code ALT_MASK} * flag indicates that the middle button has been released. - * The META_MASKflag indicates that the + * The {@code META_MASK} flag indicates that the * right button has been released. * @see java.awt.Event#ALT_MASK * @see java.awt.Event#META_MASK @@ -351,8 +351,8 @@ public class Event implements java.io.Serializable { /** * The user has moved the mouse with a button pressed. The - * ALT_MASK flag indicates that the middle - * button is being pressed. The META_MASK flag indicates + * {@code ALT_MASK} flag indicates that the middle + * button is being pressed. The {@code META_MASK} flag indicates * that the right button is being pressed. * @see java.awt.Event#ALT_MASK * @see java.awt.Event#META_MASK @@ -466,7 +466,7 @@ public class Event implements java.io.Serializable { /** * Indicates which type of event the event is, and which - * other Event variables are relevant for the event. + * other {@code Event} variables are relevant for the event. * This has been replaced by AWTEvent.getID() * * @serial @@ -518,9 +518,9 @@ public class Event implements java.io.Serializable { public int modifiers; /** - * For MOUSE_DOWN events, this field indicates the + * For {@code MOUSE_DOWN} events, this field indicates the * number of consecutive clicks. For other events, its value is - * 0. + * {@code 0}. * This field has been replaced by MouseEvent.getClickCount(). * * @serial @@ -531,7 +531,7 @@ public class Event implements java.io.Serializable { /** * An arbitrary argument of the event. The value of this field * depends on the type of event. - * arg has been replaced by event specific property. + * {@code arg} has been replaced by event specific property. * * @serial */ @@ -608,11 +608,11 @@ public class Event implements java.io.Serializable { private static native void initIDs(); /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

- * Creates an instance of Event with the specified target + * Creates an instance of {@code Event} with the specified target * component, time stamp, event type, x and y * coordinates, keyboard key, state of the modifier keys, and * argument. @@ -659,14 +659,14 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

- * Creates an instance of Event, with the specified target + * Creates an instance of {@code Event}, with the specified target * component, time stamp, event type, x and y * coordinates, keyboard key, state of the modifier keys, and an - * argument set to null. + * argument set to {@code null}. * @param target the target component. * @param when the time stamp. * @param id the event type. @@ -680,11 +680,11 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

- * Creates an instance of Event with the specified + * Creates an instance of {@code Event} with the specified * target component, event type, and argument. * @param target the target component. * @param id the event type. @@ -695,9 +695,9 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

* Translates this event so that its x and y * coordinates are increased by dx and dy, @@ -716,13 +716,13 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

* Checks if the Shift key is down. - * @return true if the key is down; - * false otherwise. + * @return {@code true} if the key is down; + * {@code false} otherwise. * @see java.awt.Event#modifiers * @see java.awt.Event#controlDown * @see java.awt.Event#metaDown @@ -732,13 +732,13 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

* Checks if the Control key is down. - * @return true if the key is down; - * false otherwise. + * @return {@code true} if the key is down; + * {@code false} otherwise. * @see java.awt.Event#modifiers * @see java.awt.Event#shiftDown * @see java.awt.Event#metaDown @@ -748,14 +748,14 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

* Checks if the Meta key is down. * - * @return true if the key is down; - * false otherwise. + * @return {@code true} if the key is down; + * {@code false} otherwise. * @see java.awt.Event#modifiers * @see java.awt.Event#shiftDown * @see java.awt.Event#controlDown @@ -765,9 +765,9 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. */ void consume() { switch(id) { @@ -783,18 +783,18 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. */ boolean isConsumed() { return consumed; } /* - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

* Returns the integer key-code associated with the key in this event, * as described in java.awt.Event. @@ -810,9 +810,9 @@ public class Event implements java.io.Serializable { } /* - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

* Returns a new KeyEvent char which corresponds to the int key * of this old event. @@ -827,15 +827,15 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

- * Returns a string representing the state of this Event. + * Returns a string representing the state of this {@code Event}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this event */ @@ -863,9 +863,9 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

* Returns a representation of this event's values as a string. * @return a string that represents the event and the values diff --git a/jdk/src/java.desktop/share/classes/java/awt/EventFilter.java b/jdk/src/java.desktop/share/classes/java/awt/EventFilter.java index 0ee077ad466..d034e1a0aac 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/EventFilter.java +++ b/jdk/src/java.desktop/share/classes/java/awt/EventFilter.java @@ -27,27 +27,27 @@ package java.awt; interface EventFilter { /** - * Enumeration for possible values for acceptEvent(AWTEvent ev) method. + * Enumeration for possible values for {@code acceptEvent(AWTEvent ev)} method. * @see EventDispatchThread#pumpEventsForFilter */ static enum FilterAction { /** * ACCEPT means that this filter do not filter the event and allows other * active filters to proceed it. If all the active filters accept the event, it - * is dispatched by the EventDispatchThread + * is dispatched by the {@code EventDispatchThread} * @see EventDispatchThread#pumpEventsForFilter */ ACCEPT, /** * REJECT means that this filter filter the event. No other filters are queried, - * and the event is not dispatched by the EventDispatchedThread + * and the event is not dispatched by the {@code EventDispatchedThread} * @see EventDispatchThread#pumpEventsForFilter */ REJECT, /** * ACCEPT_IMMEDIATELY means that this filter do not filter the event, no other * filters are queried and to proceed it, and it is dispatched by the - * EventDispatchThread + * {@code EventDispatchThread} * It is not recommended to use ACCEPT_IMMEDIATELY as there may be some active * filters not queried yet that do not accept this event. It is primarily used * by modal filters. diff --git a/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java b/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java index 84bcc5b11fb..6dc5fb44b58 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java +++ b/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java @@ -51,36 +51,36 @@ import jdk.internal.misc.SharedSecrets; import jdk.internal.misc.JavaSecurityAccess; /** - * EventQueue is a platform-independent class + * {@code EventQueue} is a platform-independent class * that queues events, both from the underlying peer classes * and from trusted application classes. *

* It encapsulates asynchronous event dispatch machinery which * extracts events from the queue and dispatches them by calling * {@link #dispatchEvent(AWTEvent) dispatchEvent(AWTEvent)} method - * on this EventQueue with the event to be dispatched + * on this {@code EventQueue} with the event to be dispatched * as an argument. The particular behavior of this machinery is * implementation-dependent. The only requirements are that events * which were actually enqueued to this queue (note that events - * being posted to the EventQueue can be coalesced) + * being posted to the {@code EventQueue} can be coalesced) * are dispatched: *

*
Sequentially. *
That is, it is not permitted that several events from * this queue are dispatched simultaneously. *
In the same order as they are enqueued. - *
That is, if AWTEvent A is enqueued - * to the EventQueue before - * AWTEvent B then event B will not be + *
That is, if {@code AWTEvent} A is enqueued + * to the {@code EventQueue} before + * {@code AWTEvent} B then event B will not be * dispatched before event A. *
*

* Some browsers partition applets in different code bases into * separate contexts, and establish walls between these contexts. - * In such a scenario, there will be one EventQueue + * In such a scenario, there will be one {@code EventQueue} * per context. Other browsers place all applets into the same * context, implying that there will be only a single, global - * EventQueue for all applets. This behavior is + * {@code EventQueue} for all applets. This behavior is * implementation-dependent. Consult your browser's documentation * for more information. *

@@ -251,14 +251,14 @@ public class EventQueue { } /** - * Posts a 1.1-style event to the EventQueue. + * Posts a 1.1-style event to the {@code EventQueue}. * If there is an existing event on the queue with the same ID - * and event source, the source Component's - * coalesceEvents method will be called. + * and event source, the source {@code Component}'s + * {@code coalesceEvents} method will be called. * - * @param theEvent an instance of java.awt.AWTEvent, + * @param theEvent an instance of {@code java.awt.AWTEvent}, * or a subclass of it - * @throws NullPointerException if theEvent is null + * @throws NullPointerException if {@code theEvent} is {@code null} */ public void postEvent(AWTEvent theEvent) { SunToolkit.flushPendingEvents(appContext); @@ -266,12 +266,12 @@ public class EventQueue { } /** - * Posts a 1.1-style event to the EventQueue. + * Posts a 1.1-style event to the {@code EventQueue}. * If there is an existing event on the queue with the same ID - * and event source, the source Component's - * coalesceEvents method will be called. + * and event source, the source {@code Component}'s + * {@code coalesceEvents} method will be called. * - * @param theEvent an instance of java.awt.AWTEvent, + * @param theEvent an instance of {@code java.awt.AWTEvent}, * or a subclass of it */ private final void postEventPrivate(AWTEvent theEvent) { @@ -320,7 +320,7 @@ public class EventQueue { * Posts the event to the internal Queue of specified priority, * coalescing as appropriate. * - * @param theEvent an instance of java.awt.AWTEvent, + * @param theEvent an instance of {@code java.awt.AWTEvent}, * or a subclass of it * @param priority the desired priority of the event */ @@ -532,10 +532,10 @@ public class EventQueue { } /** - * Removes an event from the EventQueue and + * Removes an event from the {@code EventQueue} and * returns it. This method will block until an event has * been posted by another thread. - * @return the next AWTEvent + * @return the next {@code AWTEvent} * @exception InterruptedException * if any thread has interrupted this thread */ @@ -617,7 +617,7 @@ public class EventQueue { } /** - * Returns the first event on the EventQueue + * Returns the first event on the {@code EventQueue} * without removing it. * @return the first event */ @@ -639,7 +639,7 @@ public class EventQueue { /** * Returns the first event with the specified id, if any. * @param id the id of the type of event desired - * @return the first event of the specified id or null + * @return the first event of the specified id or {@code null} * if there is no such event */ public AWTEvent peekEvent(int id) { @@ -696,9 +696,9 @@ public class EventQueue { * * * - * @param event an instance of java.awt.AWTEvent, + * @param event an instance of {@code java.awt.AWTEvent}, * or a subclass of it - * @throws NullPointerException if event is null + * @throws NullPointerException if {@code event} is {@code null} * @since 1.2 */ protected void dispatchEvent(final AWTEvent event) { @@ -777,23 +777,23 @@ public class EventQueue { /** * Returns the timestamp of the most recent event that had a timestamp, and - * that was dispatched from the EventQueue associated with the + * that was dispatched from the {@code EventQueue} associated with the * calling thread. If an event with a timestamp is currently being * dispatched, its timestamp will be returned. If no events have yet * been dispatched, the EventQueue's initialization time will be * returned instead.In the current version of - * the JDK, only InputEvents, - * ActionEvents, and InvocationEvents have + * the JDK, only {@code InputEvent}s, + * {@code ActionEvent}s, and {@code InvocationEvent}s have * timestamps; however, future versions of the JDK may add timestamps to * additional event types. Note that this method should only be invoked * from an application's {@link #isDispatchThread event dispatching thread}. * If this method is * invoked from another thread, the current system time (as reported by - * System.currentTimeMillis()) will be returned instead. + * {@code System.currentTimeMillis()}) will be returned instead. * - * @return the timestamp of the last InputEvent, - * ActionEvent, or InvocationEvent to be - * dispatched, or System.currentTimeMillis() if this + * @return the timestamp of the last {@code InputEvent}, + * {@code ActionEvent}, or {@code InvocationEvent} to be + * dispatched, or {@code System.currentTimeMillis()} if this * method is invoked on a thread other than an event dispatching * thread * @see java.awt.event.InputEvent#getWhen @@ -831,7 +831,7 @@ public class EventQueue { /** * Returns the event currently being dispatched by the - * EventQueue associated with the calling thread. This is + * {@code EventQueue} associated with the calling thread. This is * useful if a method needs access to the event, but was not designed to * receive a reference to it as an argument. Note that this method should * only be invoked from an application's event dispatching thread. If this @@ -856,14 +856,14 @@ public class EventQueue { } /** - * Replaces the existing EventQueue with the specified one. - * Any pending events are transferred to the new EventQueue + * Replaces the existing {@code EventQueue} with the specified one. + * Any pending events are transferred to the new {@code EventQueue} * for processing by it. * - * @param newEventQueue an EventQueue + * @param newEventQueue an {@code EventQueue} * (or subclass thereof) instance to be use * @see java.awt.EventQueue#pop - * @throws NullPointerException if newEventQueue is null + * @throws NullPointerException if {@code newEventQueue} is {@code null} * @since 1.2 */ public void push(EventQueue newEventQueue) { @@ -921,15 +921,15 @@ public class EventQueue { } /** - * Stops dispatching events using this EventQueue. + * Stops dispatching events using this {@code EventQueue}. * Any pending events are transferred to the previous - * EventQueue for processing. + * {@code EventQueue} for processing. *

* Warning: To avoid deadlock, do not declare this method * synchronized in a subclass. * * @exception EmptyStackException if no previous push was made - * on this EventQueue + * on this {@code EventQueue} * @see java.awt.EventQueue#push * @since 1.2 */ @@ -1122,10 +1122,10 @@ public class EventQueue { } /* - * Gets the EventDispatchThread for this - * EventQueue. + * Gets the {@code EventDispatchThread} for this + * {@code EventQueue}. * @return the event dispatch thread associated with this event queue - * or null if this event queue doesn't have a + * or {@code null} if this event queue doesn't have a * working thread associated with it * @see java.awt.EventQueue#initDispatchThread * @see java.awt.EventQueue#detachDispatchThread @@ -1141,15 +1141,15 @@ public class EventQueue { /* * Removes any pending events for the specified source object. - * If removeAllEvents parameter is true then all + * If removeAllEvents parameter is {@code true} then all * events for the specified source object are removed, if it - * is false then SequencedEvent, SentEvent, - * FocusEvent, WindowEvent, KeyEvent, - * and InputMethodEvent are kept in the queue, but all other + * is {@code false} then {@code SequencedEvent}, {@code SentEvent}, + * {@code FocusEvent}, {@code WindowEvent}, {@code KeyEvent}, + * and {@code InputMethodEvent} are kept in the queue, but all other * events are removed. * * This method is normally called by the source's - * removeNotify method. + * {@code removeNotify} method. */ final void removeSourceEvents(Object source, boolean removeAllEvents) { SunToolkit.flushPendingEvents(appContext); @@ -1249,12 +1249,12 @@ public class EventQueue { } /** - * Causes runnable to have its run + * Causes {@code runnable} to have its {@code run} * method called in the {@link #isDispatchThread dispatch thread} of * {@link Toolkit#getSystemEventQueue the system EventQueue}. * This will happen after all pending events are processed. * - * @param runnable the Runnable whose run + * @param runnable the {@code Runnable} whose {@code run} * method should be executed * asynchronously in the * {@link #isDispatchThread event dispatch thread} @@ -1270,7 +1270,7 @@ public class EventQueue { } /** - * Causes runnable to have its run + * Causes {@code runnable} to have its {@code run} * method called in the {@link #isDispatchThread dispatch thread} of * {@link Toolkit#getSystemEventQueue the system EventQueue}. * This will happen after all pending events are processed. @@ -1278,7 +1278,7 @@ public class EventQueue { * will throw an Error if called from the * {@link #isDispatchThread event dispatcher thread}. * - * @param runnable the Runnable whose run + * @param runnable the {@code Runnable} whose {@code run} * method should be executed * synchronously in the * {@link #isDispatchThread event dispatch thread} @@ -1286,7 +1286,7 @@ public class EventQueue { * @exception InterruptedException if any thread has * interrupted this thread * @exception InvocationTargetException if an throwable is thrown - * when running runnable + * when running {@code runnable} * @see #invokeLater * @see Toolkit#getSystemEventQueue * @see #isDispatchThread diff --git a/jdk/src/java.desktop/share/classes/java/awt/FileDialog.java b/jdk/src/java.desktop/share/classes/java/awt/FileDialog.java index 5b9c17d58ce..197458fa536 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/FileDialog.java +++ b/jdk/src/java.desktop/share/classes/java/awt/FileDialog.java @@ -32,11 +32,11 @@ import java.io.File; import sun.awt.AWTAccessor; /** - * The FileDialog class displays a dialog window + * The {@code FileDialog} class displays a dialog window * from which the user can select a file. *

* Since it is a modal dialog, when the application calls - * its show method to display the dialog, + * its {@code show} method to display the dialog, * it blocks the rest of the application until the user has * chosen a file. * @@ -61,10 +61,10 @@ public class FileDialog extends Dialog { public static final int SAVE = 1; /* - * There are two FileDialog modes: LOAD and - * SAVE. + * There are two {@code FileDialog} modes: {@code LOAD} and + * {@code SAVE}. * This integer will represent one or the other. - * If the mode is not specified it will default to LOAD. + * If the mode is not specified it will default to {@code LOAD}. * * @serial * @see getMode() @@ -76,7 +76,7 @@ public class FileDialog extends Dialog { /* * The string specifying the directory to display - * in the file dialog. This variable may be null. + * in the file dialog. This variable may be {@code null}. * * @serial * @see getDirectory() @@ -87,7 +87,7 @@ public class FileDialog extends Dialog { /* * The string specifying the initial value of the * filename text field in the file dialog. - * This variable may be null. + * This variable may be {@code null}. * * @serial * @see getFile() @@ -118,7 +118,7 @@ public class FileDialog extends Dialog { * The filter used as the file dialog's filename filter. * The file dialog will only be displaying files whose * names are accepted by this filter. - * This variable may be null. + * This variable may be {@code null}. * * @serial * @see #getFilenameFilter() @@ -173,7 +173,7 @@ public class FileDialog extends Dialog { /** * Creates a file dialog for loading a file. The title of the * file dialog is initially empty. This is a convenience method for - * FileDialog(parent, "", LOAD). + * {@code FileDialog(parent, "", LOAD)}. *

* Note: Some platforms may not support * showing the user-specified title in a file dialog. @@ -192,7 +192,7 @@ public class FileDialog extends Dialog { * Creates a file dialog window with the specified title for loading * a file. The files shown are those in the current directory. * This is a convenience method for - * FileDialog(parent, title, LOAD). + * {@code FileDialog(parent, title, LOAD)}. *

* Note: Some platforms may not support * showing the user-specified title in a file dialog. @@ -211,10 +211,10 @@ public class FileDialog extends Dialog { * Creates a file dialog window with the specified title for loading * or saving a file. *

- * If the value of mode is LOAD, then the + * If the value of {@code mode} is {@code LOAD}, then the * file dialog is finding a file to read, and the files shown are those * in the current directory. If the value of - * mode is SAVE, the file dialog is finding + * {@code mode} is {@code SAVE}, the file dialog is finding * a place to write a file. *

* Note: Some platforms may not support @@ -226,7 +226,7 @@ public class FileDialog extends Dialog { * @param parent the owner of the dialog * @param title the title of the dialog * @param mode the mode of the dialog; either - * FileDialog.LOAD or FileDialog.SAVE + * {@code FileDialog.LOAD} or {@code FileDialog.SAVE} * @exception IllegalArgumentException if an illegal file * dialog mode is supplied * @see java.awt.FileDialog#LOAD @@ -241,7 +241,7 @@ public class FileDialog extends Dialog { /** * Creates a file dialog for loading a file. The title of the * file dialog is initially empty. This is a convenience method for - * FileDialog(parent, "", LOAD). + * {@code FileDialog(parent, "", LOAD)}. *

* Note: Some platforms may not support * showing the user-specified title in a file dialog. @@ -250,13 +250,13 @@ public class FileDialog extends Dialog { * displayed. * * @param parent the owner of the dialog - * @exception java.lang.IllegalArgumentException if the parent's - * GraphicsConfiguration + * @exception java.lang.IllegalArgumentException if the {@code parent}'s + * {@code GraphicsConfiguration} * is not from a screen device; - * @exception java.lang.IllegalArgumentException if parent - * is null; this exception is always thrown when - * GraphicsEnvironment.isHeadless - * returns true + * @exception java.lang.IllegalArgumentException if {@code parent} + * is {@code null}; this exception is always thrown when + * {@code GraphicsEnvironment.isHeadless} + * returns {@code true} * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.5 */ @@ -268,7 +268,7 @@ public class FileDialog extends Dialog { * Creates a file dialog window with the specified title for loading * a file. The files shown are those in the current directory. * This is a convenience method for - * FileDialog(parent, title, LOAD). + * {@code FileDialog(parent, title, LOAD)}. *

* Note: Some platforms may not support * showing the user-specified title in a file dialog. @@ -277,16 +277,16 @@ public class FileDialog extends Dialog { * displayed. * * @param parent the owner of the dialog - * @param title the title of the dialog; a null value + * @param title the title of the dialog; a {@code null} value * will be accepted without causing a - * NullPointerException to be thrown - * @exception java.lang.IllegalArgumentException if the parent's - * GraphicsConfiguration + * {@code NullPointerException} to be thrown + * @exception java.lang.IllegalArgumentException if the {@code parent}'s + * {@code GraphicsConfiguration} * is not from a screen device; - * @exception java.lang.IllegalArgumentException if parent - * is null; this exception is always thrown when - * GraphicsEnvironment.isHeadless - * returns true + * @exception java.lang.IllegalArgumentException if {@code parent} + * is {@code null}; this exception is always thrown when + * {@code GraphicsEnvironment.isHeadless} + * returns {@code true} * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.5 */ @@ -298,10 +298,10 @@ public class FileDialog extends Dialog { * Creates a file dialog window with the specified title for loading * or saving a file. *

- * If the value of mode is LOAD, then the + * If the value of {@code mode} is {@code LOAD}, then the * file dialog is finding a file to read, and the files shown are those * in the current directory. If the value of - * mode is SAVE, the file dialog is finding + * {@code mode} is {@code SAVE}, the file dialog is finding * a place to write a file. *

* Note: Some platforms may not support @@ -311,20 +311,20 @@ public class FileDialog extends Dialog { * displayed. * * @param parent the owner of the dialog - * @param title the title of the dialog; a null value + * @param title the title of the dialog; a {@code null} value * will be accepted without causing a - * NullPointerException to be thrown + * {@code NullPointerException} to be thrown * @param mode the mode of the dialog; either - * FileDialog.LOAD or FileDialog.SAVE + * {@code FileDialog.LOAD} or {@code FileDialog.SAVE} * @exception java.lang.IllegalArgumentException if an illegal * file dialog mode is supplied; - * @exception java.lang.IllegalArgumentException if the parent's - * GraphicsConfiguration + * @exception java.lang.IllegalArgumentException if the {@code parent}'s + * {@code GraphicsConfiguration} * is not from a screen device; - * @exception java.lang.IllegalArgumentException if parent - * is null; this exception is always thrown when - * GraphicsEnvironment.isHeadless - * returns true + * @exception java.lang.IllegalArgumentException if {@code parent} + * is {@code null}; this exception is always thrown when + * {@code GraphicsEnvironment.isHeadless} + * returns {@code true} * @see java.awt.GraphicsEnvironment#isHeadless * @see java.awt.FileDialog#LOAD * @see java.awt.FileDialog#SAVE @@ -353,8 +353,8 @@ public class FileDialog extends Dialog { /** - * Constructs a name for this component. Called by getName() - * when the name is null. + * Constructs a name for this component. Called by {@code getName()} + * when the name is {@code null}. */ String constructComponentName() { synchronized (FileDialog.class) { @@ -382,8 +382,8 @@ public class FileDialog extends Dialog { * or for saving to a file. * * @return the mode of this file dialog window, either - * FileDialog.LOAD or - * FileDialog.SAVE + * {@code FileDialog.LOAD} or + * {@code FileDialog.SAVE} * @see java.awt.FileDialog#LOAD * @see java.awt.FileDialog#SAVE * @see java.awt.FileDialog#setMode @@ -393,13 +393,13 @@ public class FileDialog extends Dialog { } /** - * Sets the mode of the file dialog. If mode is not - * a legal value, an exception will be thrown and mode + * Sets the mode of the file dialog. If {@code mode} is not + * a legal value, an exception will be thrown and {@code mode} * will not be set. * * @param mode the mode for this file dialog, either - * FileDialog.LOAD or - * FileDialog.SAVE + * {@code FileDialog.LOAD} or + * {@code FileDialog.SAVE} * @see java.awt.FileDialog#LOAD * @see java.awt.FileDialog#SAVE * @see java.awt.FileDialog#getMode @@ -421,8 +421,8 @@ public class FileDialog extends Dialog { /** * Gets the directory of this file dialog. * - * @return the (potentially null or invalid) - * directory of this FileDialog + * @return the (potentially {@code null} or invalid) + * directory of this {@code FileDialog} * @see java.awt.FileDialog#setDirectory */ public String getDirectory() { @@ -431,14 +431,14 @@ public class FileDialog extends Dialog { /** * Sets the directory of this file dialog window to be the - * specified directory. Specifying a null or an + * specified directory. Specifying a {@code null} or an * invalid directory implies an implementation-defined default. * This default will not be realized, however, until the user - * has selected a file. Until this point, getDirectory() + * has selected a file. Until this point, {@code getDirectory()} * will return the value passed into this method. *

* Specifying "" as the directory is exactly equivalent to - * specifying null as the directory. + * specifying {@code null} as the directory. * * @param dir the specified directory * @see java.awt.FileDialog#getDirectory @@ -453,10 +453,10 @@ public class FileDialog extends Dialog { /** * Gets the selected file of this file dialog. If the user - * selected CANCEL, the returned file is null. + * selected {@code CANCEL}, the returned file is {@code null}. * * @return the currently selected file of this file dialog window, - * or null if none is selected + * or {@code null} if none is selected * @see java.awt.FileDialog#setFile */ public String getFile() { @@ -592,12 +592,12 @@ public class FileDialog extends Dialog { } /** - * Reads the ObjectInputStream and performs + * Reads the {@code ObjectInputStream} and performs * a backwards compatibility check by converting - * either a dir or a file - * equal to an empty string to null. + * either a {@code dir} or a {@code file} + * equal to an empty string to {@code null}. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read */ private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException @@ -614,11 +614,11 @@ public class FileDialog extends Dialog { } /** - * Returns a string representing the state of this FileDialog + * Returns a string representing the state of this {@code FileDialog} * window. This method is intended to be used only for debugging purposes, * and the content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this file dialog window */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/FlowLayout.java b/jdk/src/java.desktop/share/classes/java/awt/FlowLayout.java index 4405620de13..7cdfe67619b 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/FlowLayout.java +++ b/jdk/src/java.desktop/share/classes/java/awt/FlowLayout.java @@ -30,16 +30,16 @@ import java.io.IOException; /** * A flow layout arranges components in a directional flow, much * like lines of text in a paragraph. The flow direction is - * determined by the container's componentOrientation + * determined by the container's {@code componentOrientation} * property and may be one of two values: *

    - *
  • ComponentOrientation.LEFT_TO_RIGHT - *
  • ComponentOrientation.RIGHT_TO_LEFT + *
  • {@code ComponentOrientation.LEFT_TO_RIGHT} + *
  • {@code ComponentOrientation.RIGHT_TO_LEFT} *
* Flow layouts are typically used * to arrange buttons in a panel. It arranges buttons * horizontally until no more buttons fit on the same line. - * The line alignment is determined by the align + * The line alignment is determined by the {@code align} * property. The possible values are: *
* * @see Paint @@ -65,19 +65,19 @@ public class GradientPaint implements Paint { boolean cyclic; /** - * Constructs a simple acyclic GradientPaint object. + * Constructs a simple acyclic {@code GradientPaint} object. * @param x1 x coordinate of the first specified - * Point in user space + * {@code Point} in user space * @param y1 y coordinate of the first specified - * Point in user space - * @param color1 Color at the first specified - * Point + * {@code Point} in user space + * @param color1 {@code Color} at the first specified + * {@code Point} * @param x2 x coordinate of the second specified - * Point in user space + * {@code Point} in user space * @param y2 y coordinate of the second specified - * Point in user space - * @param color2 Color at the second specified - * Point + * {@code Point} in user space + * @param color2 {@code Color} at the second specified + * {@code Point} * @throws NullPointerException if either one of colors is null */ public GradientPaint(float x1, @@ -97,13 +97,13 @@ public class GradientPaint implements Paint { } /** - * Constructs a simple acyclic GradientPaint object. - * @param pt1 the first specified Point in user space - * @param color1 Color at the first specified - * Point - * @param pt2 the second specified Point in user space - * @param color2 Color at the second specified - * Point + * Constructs a simple acyclic {@code GradientPaint} object. + * @param pt1 the first specified {@code Point} in user space + * @param color1 {@code Color} at the first specified + * {@code Point} + * @param pt2 the second specified {@code Point} in user space + * @param color2 {@code Color} at the second specified + * {@code Point} * @throws NullPointerException if either one of colors or points * is null */ @@ -123,22 +123,22 @@ public class GradientPaint implements Paint { } /** - * Constructs either a cyclic or acyclic GradientPaint - * object depending on the boolean parameter. + * Constructs either a cyclic or acyclic {@code GradientPaint} + * object depending on the {@code boolean} parameter. * @param x1 x coordinate of the first specified - * Point in user space + * {@code Point} in user space * @param y1 y coordinate of the first specified - * Point in user space - * @param color1 Color at the first specified - * Point + * {@code Point} in user space + * @param color1 {@code Color} at the first specified + * {@code Point} * @param x2 x coordinate of the second specified - * Point in user space + * {@code Point} in user space * @param y2 y coordinate of the second specified - * Point in user space - * @param color2 Color at the second specified - * Point - * @param cyclic true if the gradient pattern should cycle - * repeatedly between the two colors; false otherwise + * {@code Point} in user space + * @param color2 {@code Color} at the second specified + * {@code Point} + * @param cyclic {@code true} if the gradient pattern should cycle + * repeatedly between the two colors; {@code false} otherwise */ public GradientPaint(float x1, float y1, @@ -152,18 +152,18 @@ public class GradientPaint implements Paint { } /** - * Constructs either a cyclic or acyclic GradientPaint - * object depending on the boolean parameter. - * @param pt1 the first specified Point + * Constructs either a cyclic or acyclic {@code GradientPaint} + * object depending on the {@code boolean} parameter. + * @param pt1 the first specified {@code Point} * in user space - * @param color1 Color at the first specified - * Point - * @param pt2 the second specified Point + * @param color1 {@code Color} at the first specified + * {@code Point} + * @param pt2 the second specified {@code Point} * in user space - * @param color2 Color at the second specified - * Point - * @param cyclic true if the gradient pattern should cycle - * repeatedly between the two colors; false otherwise + * @param color2 {@code Color} at the second specified + * {@code Point} + * @param cyclic {@code true} if the gradient pattern should cycle + * repeatedly between the two colors; {@code false} otherwise * @throws NullPointerException if either one of colors or points * is null */ @@ -181,7 +181,7 @@ public class GradientPaint implements Paint { * Returns a copy of the point P1 that anchors the first color. * @return a {@link Point2D} object that is a copy of the point * that anchors the first color of this - * GradientPaint. + * {@code GradientPaint}. */ public Point2D getPoint1() { return new Point2D.Float(p1.x, p1.y); @@ -189,7 +189,7 @@ public class GradientPaint implements Paint { /** * Returns the color C1 anchored by the point P1. - * @return a Color object that is the color + * @return a {@code Color} object that is the color * anchored by P1. */ public Color getColor1() { @@ -200,7 +200,7 @@ public class GradientPaint implements Paint { * Returns a copy of the point P2 which anchors the second color. * @return a {@link Point2D} object that is a copy of the point * that anchors the second color of this - * GradientPaint. + * {@code GradientPaint}. */ public Point2D getPoint2() { return new Point2D.Float(p2.x, p2.y); @@ -208,7 +208,7 @@ public class GradientPaint implements Paint { /** * Returns the color C2 anchored by the point P2. - * @return a Color object that is the color + * @return a {@code Color} object that is the color * anchored by P2. */ public Color getColor2() { @@ -216,10 +216,10 @@ public class GradientPaint implements Paint { } /** - * Returns true if the gradient cycles repeatedly + * Returns {@code true} if the gradient cycles repeatedly * between the two colors C1 and C2. - * @return true if the gradient cycles repeatedly - * between the two colors; false otherwise. + * @return {@code true} if the gradient cycles repeatedly + * between the two colors; {@code false} otherwise. */ public boolean isCyclic() { return cyclic; @@ -264,8 +264,8 @@ public class GradientPaint implements Paint { } /** - * Returns the transparency mode for this GradientPaint. - * @return an integer value representing this GradientPaint + * Returns the transparency mode for this {@code GradientPaint}. + * @return an integer value representing this {@code GradientPaint} * object's transparency mode. * @see Transparency */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Graphics.java b/jdk/src/java.desktop/share/classes/java/awt/Graphics.java index b517cf65390..932a89d5ade 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Graphics.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Graphics.java @@ -31,17 +31,17 @@ import java.awt.image.ImageObserver; import java.text.AttributedCharacterIterator; /** - * The Graphics class is the abstract base class for + * The {@code Graphics} class is the abstract base class for * all graphics contexts that allow an application to draw onto * components that are realized on various devices, as well as * onto off-screen images. *

- * A Graphics object encapsulates state information needed + * A {@code Graphics} object encapsulates state information needed * for the basic rendering operations that Java supports. This * state information includes the following properties: * *

    - *
  • The Component object on which to draw. + *
  • The {@code Component} object on which to draw. *
  • A translation origin for rendering and clipping coordinates. *
  • The current clip. *
  • The current color. @@ -72,21 +72,21 @@ import java.text.AttributedCharacterIterator; * the text, except for any descenders. *

* All coordinates that appear as arguments to the methods of this - * Graphics object are considered relative to the - * translation origin of this Graphics object prior to + * {@code Graphics} object are considered relative to the + * translation origin of this {@code Graphics} object prior to * the invocation of the method. *

* All rendering operations modify only pixels which lie within the * area bounded by the current clip, which is specified by a {@link Shape} * in user space and is controlled by the program using the - * Graphics object. This user clip + * {@code Graphics} object. This user clip * is transformed into device space and combined with the * device clip, which is defined by the visibility of windows and * device extents. The combination of the user clip and device clip * defines the composite clip, which determines the final clipping * region. The user clip cannot be modified by the rendering * system to reflect the resulting composite clip. The user clip can only - * be changed through the setClip or clipRect + * be changed through the {@code setClip} or {@code clipRect} * methods. * All drawing or writing is done in the current color, * using the current paint mode, and in the current font. @@ -104,14 +104,14 @@ import java.text.AttributedCharacterIterator; public abstract class Graphics { /** - * Constructs a new Graphics object. + * Constructs a new {@code Graphics} object. * This constructor is the default constructor for a graphics * context. *

- * Since Graphics is an abstract class, applications + * Since {@code Graphics} is an abstract class, applications * cannot call this constructor directly. Graphics contexts are * obtained from other graphics contexts or are created by calling - * getGraphics on a component. + * {@code getGraphics} on a component. * @see java.awt.Graphics#create() * @see java.awt.Component#getGraphics */ @@ -119,36 +119,36 @@ public abstract class Graphics { } /** - * Creates a new Graphics object that is - * a copy of this Graphics object. + * Creates a new {@code Graphics} object that is + * a copy of this {@code Graphics} object. * @return a new graphics context that is a copy of * this graphics context. */ public abstract Graphics create(); /** - * Creates a new Graphics object based on this - * Graphics object, but with a new translation and clip area. - * The new Graphics object has its origin + * Creates a new {@code Graphics} object based on this + * {@code Graphics} object, but with a new translation and clip area. + * The new {@code Graphics} object has its origin * translated to the specified point (xy). * Its clip area is determined by the intersection of the original * clip area with the specified rectangle. The arguments are all * interpreted in the coordinate system of the original - * Graphics object. The new graphics context is + * {@code Graphics} object. The new graphics context is * identical to the original, except in two respects: * *

    *
  • * The new graphics context is translated by (xy). - * That is to say, the point (00) in the + * That is to say, the point ({@code 0}, {@code 0}) in the * new graphics context is the same as (xy) in * the original graphics context. *
  • * The new graphics context has an additional clipping rectangle, in * addition to whatever (translated) clipping rectangle it inherited * from the original graphics context. The origin of the new clipping - * rectangle is at (00), and its size - * is specified by the width and height + * rectangle is at ({@code 0}, {@code 0}), and its size + * is specified by the {@code width} and {@code height} * arguments. *
* @@ -273,12 +273,12 @@ public abstract class Graphics { * This method refers to the user clip, which is independent of the * clipping associated with device bounds and window visibility. * If no clip has previously been set, or if the clip has been - * cleared using setClip(null), this method returns - * null. + * cleared using {@code setClip(null)}, this method returns + * {@code null}. * The coordinates in the rectangle are relative to the coordinate * system origin of this graphics context. * @return the bounding rectangle of the current clipping area, - * or null if no clip is set. + * or {@code null} if no clip is set. * @see java.awt.Graphics#getClip * @see java.awt.Graphics#clipRect * @see java.awt.Graphics#setClip(int, int, int, int) @@ -292,7 +292,7 @@ public abstract class Graphics { * The resulting clipping area is the intersection of the current * clipping area and the specified rectangle. If there is no * current clipping area, either because the clip has never been - * set, or the clip has been cleared using setClip(null), + * set, or the clip has been cleared using {@code setClip(null)}, * the specified rectangle becomes the new clip. * This method sets the user clip, which is independent of the * clipping associated with device bounds and window visibility. @@ -330,10 +330,10 @@ public abstract class Graphics { * This method returns the user clip, which is independent of the * clipping associated with device bounds and window visibility. * If no clip has previously been set, or if the clip has been - * cleared using setClip(null), this method returns - * null. - * @return a Shape object representing the - * current clipping area, or null if + * cleared using {@code setClip(null)}, this method returns + * {@code null}. + * @return a {@code Shape} object representing the + * current clipping area, or {@code null} if * no clip is set. * @see java.awt.Graphics#getClipBounds * @see java.awt.Graphics#clipRect @@ -345,15 +345,15 @@ public abstract class Graphics { /** * Sets the current clipping area to an arbitrary clip shape. - * Not all objects that implement the Shape + * Not all objects that implement the {@code Shape} * interface can be used to set the clip. The only - * Shape objects that are guaranteed to be - * supported are Shape objects that are - * obtained via the getClip method and via - * Rectangle objects. This method sets the + * {@code Shape} objects that are guaranteed to be + * supported are {@code Shape} objects that are + * obtained via the {@code getClip} method and via + * {@code Rectangle} objects. This method sets the * user clip, which is independent of the clipping associated * with device bounds and window visibility. - * @param clip the Shape to use to set the clip + * @param clip the {@code Shape} to use to set the clip * @see java.awt.Graphics#getClip() * @see java.awt.Graphics#clipRect * @see java.awt.Graphics#setClip(int, int, int, int) @@ -363,16 +363,16 @@ public abstract class Graphics { /** * Copies an area of the component by a distance specified by - * dx and dy. From the point specified - * by x and y, this method + * {@code dx} and {@code dy}. From the point specified + * by {@code x} and {@code y}, this method * copies downwards and to the right. To copy an area of the * component to the left or upwards, specify a negative value for - * dx or dy. + * {@code dx} or {@code dy}. * If a portion of the source rectangle lies outside the bounds * of the component, or is obscured by another window or component, - * copyArea will be unable to copy the associated + * {@code copyArea} will be unable to copy the associated * pixels. The area that is omitted can be refreshed by calling - * the component's paint method. + * the component's {@code paint} method. * @param x the x coordinate of the source rectangle. * @param y the y coordinate of the source rectangle. * @param width the width of the source rectangle. @@ -397,12 +397,12 @@ public abstract class Graphics { /** * Fills the specified rectangle. * The left and right edges of the rectangle are at - * x and x + width - 1. + * {@code x} and x + width - 1. * The top and bottom edges are at - * y and y + height - 1. + * {@code y} and y + height - 1. * The resulting rectangle covers an area - * width pixels wide by - * height pixels tall. + * {@code width} pixels wide by + * {@code height} pixels tall. * The rectangle is filled using the graphics context's current color. * @param x the x coordinate * of the rectangle to be filled. @@ -418,9 +418,9 @@ public abstract class Graphics { /** * Draws the outline of the specified rectangle. * The left and right edges of the rectangle are at - * x and x + width. + * {@code x} and x + width. * The top and bottom edges are at - * y and y + height. + * {@code y} and y + height. * The rectangle is drawn using the graphics context's current color. * @param x the x coordinate * of the rectangle to be drawn. @@ -453,7 +453,7 @@ public abstract class Graphics { *

* Beginning with Java 1.1, the background color * of offscreen images may be system dependent. Applications should - * use setColor followed by fillRect to + * use {@code setColor} followed by {@code fillRect} to * ensure that an offscreen image is cleared to a specific color. * @param x the x coordinate of the rectangle to clear. * @param y the y coordinate of the rectangle to clear. @@ -470,9 +470,9 @@ public abstract class Graphics { /** * Draws an outlined round-cornered rectangle using this graphics * context's current color. The left and right edges of the rectangle - * are at x and x + width, + * are at {@code x} and x + width, * respectively. The top and bottom edges of the rectangle are at - * y and y + height. + * {@code y} and y + height. * @param x the x coordinate of the rectangle to be drawn. * @param y the y coordinate of the rectangle to be drawn. * @param width the width of the rectangle to be drawn. @@ -489,9 +489,9 @@ public abstract class Graphics { /** * Fills the specified rounded corner rectangle with the current color. * The left and right edges of the rectangle - * are at x and x + width - 1, + * are at {@code x} and x + width - 1, * respectively. The top and bottom edges of the rectangle are at - * y and y + height - 1. + * {@code y} and y + height - 1. * @param x the x coordinate of the rectangle to be filled. * @param y the y coordinate of the rectangle to be filled. * @param width the width of the rectangle to be filled. @@ -576,8 +576,8 @@ public abstract class Graphics { /** * Draws the outline of an oval. * The result is a circle or ellipse that fits within the - * rectangle specified by the x, y, - * width, and height arguments. + * rectangle specified by the {@code x}, {@code y}, + * {@code width}, and {@code height} arguments. *

* The oval covers an area that is * width + 1 pixels wide @@ -609,8 +609,8 @@ public abstract class Graphics { * Draws the outline of a circular or elliptical arc * covering the specified rectangle. *

- * The resulting arc begins at startAngle and extends - * for arcAngle degrees, using the current color. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees, using the current color. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -618,7 +618,7 @@ public abstract class Graphics { *

* The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

* The resulting arc covers an area * width + 1 pixels wide @@ -648,8 +648,8 @@ public abstract class Graphics { /** * Fills a circular or elliptical arc covering the specified rectangle. *

- * The resulting arc begins at startAngle and extends - * for arcAngle degrees. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -657,7 +657,7 @@ public abstract class Graphics { *

* The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

* The resulting arc covers an area * width + 1 pixels wide @@ -704,16 +704,16 @@ public abstract class Graphics { * arrays of x and y coordinates. * Each pair of (xy) coordinates defines a point. *

- * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#fillPolygon * @see java.awt.Graphics#drawPolyline @@ -723,7 +723,7 @@ public abstract class Graphics { /** * Draws the outline of a polygon defined by the specified - * Polygon object. + * {@code Polygon} object. * @param p the polygon to draw. * @see java.awt.Graphics#fillPolygon * @see java.awt.Graphics#drawPolyline @@ -736,19 +736,19 @@ public abstract class Graphics { * Fills a closed polygon defined by * arrays of x and y coordinates. *

- * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. *

* The area inside the polygon is defined using an * even-odd fill rule, also known as the alternating rule. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#drawPolygon(int[], int[], int) */ @@ -776,7 +776,7 @@ public abstract class Graphics { * @param str the string to be drawn. * @param x the x coordinate. * @param y the y coordinate. - * @throws NullPointerException if str is null. + * @throws NullPointerException if {@code str} is {@code null}. * @see java.awt.Graphics#drawBytes * @see java.awt.Graphics#drawChars */ @@ -792,8 +792,8 @@ public abstract class Graphics { * @param iterator the iterator whose text is to be drawn * @param x the x coordinate. * @param y the y coordinate. - * @throws NullPointerException if iterator is - * null. + * @throws NullPointerException if {@code iterator} is + * {@code null}. * @see java.awt.Graphics#drawBytes * @see java.awt.Graphics#drawChars */ @@ -810,11 +810,11 @@ public abstract class Graphics { * @param length the number of characters to be drawn * @param x the x coordinate of the baseline of the text * @param y the y coordinate of the baseline of the text - * @throws NullPointerException if data is null. - * @throws IndexOutOfBoundsException if offset or - * lengthis less than zero, or - * offset+length is greater than the length of the - * data array. + * @throws NullPointerException if {@code data} is {@code null}. + * @throws IndexOutOfBoundsException if {@code offset} or + * {@code length} is less than zero, or + * {@code offset+length} is greater than the length of the + * {@code data} array. * @see java.awt.Graphics#drawBytes * @see java.awt.Graphics#drawString */ @@ -836,10 +836,10 @@ public abstract class Graphics { * @param length the number of bytes that are drawn * @param x the x coordinate of the baseline of the text * @param y the y coordinate of the baseline of the text - * @throws NullPointerException if data is null. - * @throws IndexOutOfBoundsException if offset or - * lengthis less than zero, or offset+length - * is greater than the length of the data array. + * @throws NullPointerException if {@code data} is {@code null}. + * @throws IndexOutOfBoundsException if {@code offset} or + * {@code length} is less than zero, or {@code offset+length} + * is greater than the length of the {@code data} array. * @see java.awt.Graphics#drawChars * @see java.awt.Graphics#drawString */ @@ -861,21 +861,21 @@ public abstract class Graphics { *

* If the image has completely loaded and its pixels are * no longer being changed, then - * drawImage returns true. - * Otherwise, drawImage returns false + * {@code drawImage} returns {@code true}. + * Otherwise, {@code drawImage} returns {@code false} * and as more of * the image becomes available * or it is time to draw another frame of animation, * the process that loads the image notifies * the specified image observer. * @param img the specified image to be drawn. This method does - * nothing if img is null. + * nothing if {@code img} is null. * @param x the x coordinate. * @param y the y coordinate. * @param observer object to be notified as more of * the image is converted. - * @return false if the image pixels are still changing; - * true otherwise. + * @return {@code false} if the image pixels are still changing; + * {@code true} otherwise. * @see java.awt.Image * @see java.awt.image.ImageObserver * @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int) @@ -896,9 +896,9 @@ public abstract class Graphics { * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that loads the image notifies - * the image observer by calling its imageUpdate method. + * the image observer by calling its {@code imageUpdate} method. *

* A scaled version of an image will not necessarily be * available immediately just because an unscaled version of the @@ -906,15 +906,15 @@ public abstract class Graphics { * the image may be cached separately and generated from the original * data in a separate image production sequence. * @param img the specified image to be drawn. This method does - * nothing if img is null. + * nothing if {@code img} is null. * @param x the x coordinate. * @param y the y coordinate. * @param width the width of the rectangle. * @param height the height of the rectangle. * @param observer object to be notified as more of * the image is converted. - * @return false if the image pixels are still changing; - * true otherwise. + * @return {@code false} if the image pixels are still changing; + * {@code true} otherwise. * @see java.awt.Image * @see java.awt.image.ImageObserver * @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int) @@ -940,23 +940,23 @@ public abstract class Graphics { *

* If the image has completely loaded and its pixels are * no longer being changed, then - * drawImage returns true. - * Otherwise, drawImage returns false + * {@code drawImage} returns {@code true}. + * Otherwise, {@code drawImage} returns {@code false} * and as more of * the image becomes available * or it is time to draw another frame of animation, * the process that loads the image notifies * the specified image observer. * @param img the specified image to be drawn. This method does - * nothing if img is null. + * nothing if {@code img} is null. * @param x the x coordinate. * @param y the y coordinate. * @param bgcolor the background color to paint under the * non-opaque portions of the image. * @param observer object to be notified as more of * the image is converted. - * @return false if the image pixels are still changing; - * true otherwise. + * @return {@code false} if the image pixels are still changing; + * {@code true} otherwise. * @see java.awt.Image * @see java.awt.image.ImageObserver * @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int) @@ -981,7 +981,7 @@ public abstract class Graphics { * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that loads the image notifies * the specified image observer. *

@@ -991,7 +991,7 @@ public abstract class Graphics { * the image may be cached separately and generated from the original * data in a separate image production sequence. * @param img the specified image to be drawn. This method does - * nothing if img is null. + * nothing if {@code img} is null. * @param x the x coordinate. * @param y the y coordinate. * @param width the width of the rectangle. @@ -1000,8 +1000,8 @@ public abstract class Graphics { * non-opaque portions of the image. * @param observer object to be notified as more of * the image is converted. - * @return false if the image pixels are still changing; - * true otherwise. + * @return {@code false} if the image pixels are still changing; + * {@code true} otherwise. * @see java.awt.Image * @see java.awt.image.ImageObserver * @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int) @@ -1021,7 +1021,7 @@ public abstract class Graphics { * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that loads the image notifies * the specified image observer. *

@@ -1035,7 +1035,7 @@ public abstract class Graphics { * mapped to the second destination coordinate. The subimage is * scaled and flipped as needed to preserve those mappings. * @param img the specified image to be drawn. This method does - * nothing if img is null. + * nothing if {@code img} is null. * @param dx1 the x coordinate of the first corner of the * destination rectangle. * @param dy1 the y coordinate of the first corner of the @@ -1054,8 +1054,8 @@ public abstract class Graphics { * source rectangle. * @param observer object to be notified as more of the image is * scaled and converted. - * @return false if the image pixels are still changing; - * true otherwise. + * @return {@code false} if the image pixels are still changing; + * {@code true} otherwise. * @see java.awt.Image * @see java.awt.image.ImageObserver * @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int) @@ -1080,7 +1080,7 @@ public abstract class Graphics { * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that loads the image notifies * the specified image observer. *

@@ -1094,7 +1094,7 @@ public abstract class Graphics { * mapped to the second destination coordinate. The subimage is * scaled and flipped as needed to preserve those mappings. * @param img the specified image to be drawn. This method does - * nothing if img is null. + * nothing if {@code img} is null. * @param dx1 the x coordinate of the first corner of the * destination rectangle. * @param dy1 the y coordinate of the first corner of the @@ -1115,8 +1115,8 @@ public abstract class Graphics { * non-opaque portions of the image. * @param observer object to be notified as more of the image is * scaled and converted. - * @return false if the image pixels are still changing; - * true otherwise. + * @return {@code false} if the image pixels are still changing; + * {@code true} otherwise. * @see java.awt.Image * @see java.awt.image.ImageObserver * @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int) @@ -1131,10 +1131,10 @@ public abstract class Graphics { /** * Disposes of this graphics context and releases * any system resources that it is using. - * A Graphics object cannot be used after - * disposehas been called. + * A {@code Graphics} object cannot be used after + * {@code dispose} has been called. *

- * When a Java program runs, a large number of Graphics + * When a Java program runs, a large number of {@code Graphics} * objects can be created within a short time frame. * Although the finalization process of the garbage collector * also disposes of the same system resources, it is preferable @@ -1143,12 +1143,12 @@ public abstract class Graphics { * may not run to completion for a long period of time. *

* Graphics objects which are provided as arguments to the - * paint and update methods + * {@code paint} and {@code update} methods * of components are automatically released by the system when * those methods return. For efficiency, programmers should - * call dispose when finished using - * a Graphics object only if it was created - * directly from a component or another Graphics object. + * call {@code dispose} when finished using + * a {@code Graphics} object only if it was created + * directly from a component or another {@code Graphics} object. * @see java.awt.Graphics#finalize * @see java.awt.Component#paint * @see java.awt.Component#update @@ -1166,8 +1166,8 @@ public abstract class Graphics { } /** - * Returns a String object representing this - * Graphics object's value. + * Returns a {@code String} object representing this + * {@code Graphics} object's value. * @return a string representation of this graphics context. */ public String toString() { @@ -1177,9 +1177,9 @@ public abstract class Graphics { /** * Returns the bounding rectangle of the current clipping area. * @return the bounding rectangle of the current clipping area - * or null if no clip is set. + * or {@code null} if no clip is set. * @deprecated As of JDK version 1.1, - * replaced by getClipBounds(). + * replaced by {@code getClipBounds()}. */ @Deprecated public Rectangle getClipRect() { @@ -1208,8 +1208,8 @@ public abstract class Graphics { * @param y the y coordinate of the rectangle to test against the clip * @param width the width of the rectangle to test against the clip * @param height the height of the rectangle to test against the clip - * @return true if the specified rectangle intersects - * the bounds of the current clip; false + * @return {@code true} if the specified rectangle intersects + * the bounds of the current clip; {@code false} * otherwise. */ public boolean hitClip(int x, int y, int width, int height) { @@ -1232,8 +1232,8 @@ public abstract class Graphics { * This method refers to the user clip, which is independent of the * clipping associated with device bounds and window visibility. * If no clip has previously been set, or if the clip has been - * cleared using setClip(null), this method returns the - * specified Rectangle. + * cleared using {@code setClip(null)}, this method returns the + * specified {@code Rectangle}. * @param r the rectangle where the current clipping area is * copied to. Any current values in this rectangle are * overwritten. diff --git a/jdk/src/java.desktop/share/classes/java/awt/Graphics2D.java b/jdk/src/java.desktop/share/classes/java/awt/Graphics2D.java index 080ac3f7f92..ec5f9bd73bb 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Graphics2D.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Graphics2D.java @@ -39,47 +39,47 @@ import java.text.AttributedCharacterIterator; import java.util.Map; /** - * This Graphics2D class extends the + * This {@code Graphics2D} class extends the * {@link Graphics} class to provide more sophisticated * control over geometry, coordinate transformations, color management, * and text layout. This is the fundamental class for rendering * 2-dimensional shapes, text and images on the Java(tm) platform. * *

Coordinate Spaces

- * All coordinates passed to a Graphics2D object are specified + * All coordinates passed to a {@code Graphics2D} object are specified * in a device-independent coordinate system called User Space, which is - * used by applications. The Graphics2D object contains + * used by applications. The {@code Graphics2D} object contains * an {@link AffineTransform} object as part of its rendering state * that defines how to convert coordinates from user space to * device-dependent coordinates in Device Space. *

* Coordinates in device space usually refer to individual device pixels * and are aligned on the infinitely thin gaps between these pixels. - * Some Graphics2D objects can be used to capture rendering + * Some {@code Graphics2D} objects can be used to capture rendering * operations for storage into a graphics metafile for playback on a * concrete device of unknown physical resolution at a later time. Since * the resolution might not be known when the rendering operations are - * captured, the Graphics2D Transform is set up + * captured, the {@code Graphics2D Transform} is set up * to transform user coordinates to a virtual device space that * approximates the expected resolution of the target device. Further * transformations might need to be applied at playback time if the * estimate is incorrect. *

* Some of the operations performed by the rendering attribute objects - * occur in the device space, but all Graphics2D methods take + * occur in the device space, but all {@code Graphics2D} methods take * user space coordinates. *

- * Every Graphics2D object is associated with a target that + * Every {@code Graphics2D} object is associated with a target that * defines where rendering takes place. A * {@link GraphicsConfiguration} object defines the characteristics * of the rendering target, such as pixel format and resolution. * The same rendering target is used throughout the life of a - * Graphics2D object. + * {@code Graphics2D} object. *

- * When creating a Graphics2D object, the - * GraphicsConfiguration + * When creating a {@code Graphics2D} object, the + * {@code GraphicsConfiguration} * specifies the default transform for - * the target of the Graphics2D (a + * the target of the {@code Graphics2D} (a * {@link Component} or {@link Image}). This default transform maps the * user space coordinate system to screen and printer device coordinates * such that the origin maps to the upper left hand corner of the @@ -90,11 +90,11 @@ import java.util.Map; * The scaling of the default transform is set to approximately 72 user * space coordinates per square inch for high resolution devices, such as * printers. For image buffers, the default transform is the - * Identity transform. + * {@code Identity} transform. * *

Rendering Process

* The Rendering Process can be broken down into four phases that are - * controlled by the Graphics2D rendering attributes. + * controlled by the {@code Graphics2D} rendering attributes. * The renderer can optimize many of these steps, either by caching the * results for future calls, by collapsing multiple virtual steps into * a single operation, or by recognizing various attributes as common @@ -106,13 +106,13 @@ import java.util.Map; *
  • * Determine what to render. *
  • - * Constrain the rendering operation to the current Clip. - * The Clip is specified by a {@link Shape} in user + * Constrain the rendering operation to the current {@code Clip}. + * The {@code Clip} is specified by a {@link Shape} in user * space and is controlled by the program using the various clip - * manipulation methods of Graphics and - * Graphics2D. This user clip + * manipulation methods of {@code Graphics} and + * {@code Graphics2D}. This user clip * is transformed into device space by the current - * Transform and combined with the + * {@code Transform} and combined with the * device clip, which is defined by the visibility of windows and * device extents. The combination of the user clip and device clip * defines the composite clip, which determines the final clipping @@ -122,40 +122,40 @@ import java.util.Map; * Determine what colors to render. *
  • * Apply the colors to the destination drawing surface using the current - * {@link Composite} attribute in the Graphics2D context. + * {@link Composite} attribute in the {@code Graphics2D} context. * *
    * The three types of rendering operations, along with details of each * of their particular rendering processes are: *
      *
    1. - * Shape operations + * {@code Shape} operations *
        *
      1. - * If the operation is a draw(Shape) operation, then + * If the operation is a {@code draw(Shape)} operation, then * the {@link Stroke#createStrokedShape(Shape) createStrokedShape} * method on the current {@link Stroke} attribute in the - * Graphics2D context is used to construct a new - * Shape object that contains the outline of the specified - * Shape. + * {@code Graphics2D} context is used to construct a new + * {@code Shape} object that contains the outline of the specified + * {@code Shape}. *
      2. - * The Shape is transformed from user space to device space - * using the current Transform - * in the Graphics2D context. + * The {@code Shape} is transformed from user space to device space + * using the current {@code Transform} + * in the {@code Graphics2D} context. *
      3. - * The outline of the Shape is extracted using the + * The outline of the {@code Shape} is extracted using the * {@link Shape#getPathIterator(AffineTransform) getPathIterator} method of - * Shape, which returns a + * {@code Shape}, which returns a * {@link java.awt.geom.PathIterator PathIterator} - * object that iterates along the boundary of the Shape. + * object that iterates along the boundary of the {@code Shape}. *
      4. - * If the Graphics2D object cannot handle the curved segments - * that the PathIterator object returns then it can call the + * If the {@code Graphics2D} object cannot handle the curved segments + * that the {@code PathIterator} object returns then it can call the * alternate * {@link Shape#getPathIterator(AffineTransform, double) getPathIterator} - * method of Shape, which flattens the Shape. + * method of {@code Shape}, which flattens the {@code Shape}. *
      5. - * The current {@link Paint} in the Graphics2D context + * The current {@link Paint} in the {@code Graphics2D} context * is queried for a {@link PaintContext}, which specifies the * colors to render in device space. *
      @@ -164,12 +164,12 @@ import java.util.Map; *
        *
      1. * The following steps are used to determine the set of glyphs required - * to render the indicated String: + * to render the indicated {@code String}: *
          *
        1. - * If the argument is a String, then the current - * Font in the Graphics2D context is asked to - * convert the Unicode characters in the String into a set of + * If the argument is a {@code String}, then the current + * {@code Font} in the {@code Graphics2D} context is asked to + * convert the Unicode characters in the {@code String} into a set of * glyphs for presentation with whatever basic layout and shaping * algorithms the font implements. *
        2. @@ -177,75 +177,75 @@ import java.util.Map; * {@link AttributedCharacterIterator}, * the iterator is asked to convert itself to a * {@link java.awt.font.TextLayout TextLayout} - * using its embedded font attributes. The TextLayout + * using its embedded font attributes. The {@code TextLayout} * implements more sophisticated glyph layout algorithms that * perform Unicode bi-directional layout adjustments automatically * for multiple fonts of differing writing directions. *
        3. * If the argument is a * {@link GlyphVector}, then the - * GlyphVector object already contains the appropriate + * {@code GlyphVector} object already contains the appropriate * font-specific glyph codes with explicit coordinates for the position of * each glyph. *
        *
      2. - * The current Font is queried to obtain outlines for the + * The current {@code Font} is queried to obtain outlines for the * indicated glyphs. These outlines are treated as shapes in user space * relative to the position of each glyph that was determined in step 1. *
      3. * The character outlines are filled as indicated above - * under Shape operations. + * under {@code Shape} operations. *
      4. - * The current Paint is queried for a - * PaintContext, which specifies + * The current {@code Paint} is queried for a + * {@code PaintContext}, which specifies * the colors to render in device space. *
      *
    2. - * Image Operations + * {@code Image} Operations *
        *
      1. * The region of interest is defined by the bounding box of the source - * Image. + * {@code Image}. * This bounding box is specified in Image Space, which is the - * Image object's local coordinate system. + * {@code Image} object's local coordinate system. *
      2. - * If an AffineTransform is passed to + * If an {@code AffineTransform} is passed to * {@link #drawImage(java.awt.Image, java.awt.geom.AffineTransform, java.awt.image.ImageObserver) drawImage(Image, AffineTransform, ImageObserver)}, - * the AffineTransform is used to transform the bounding - * box from image space to user space. If no AffineTransform + * the {@code AffineTransform} is used to transform the bounding + * box from image space to user space. If no {@code AffineTransform} * is supplied, the bounding box is treated as if it is already in user space. *
      3. - * The bounding box of the source Image is transformed from user - * space into device space using the current Transform. + * The bounding box of the source {@code Image} is transformed from user + * space into device space using the current {@code Transform}. * Note that the result of transforming the bounding box does not * necessarily result in a rectangular region in device space. *
      4. - * The Image object determines what colors to render, + * The {@code Image} object determines what colors to render, * sampled according to the source to destination - * coordinate mapping specified by the current Transform and the + * coordinate mapping specified by the current {@code Transform} and the * optional image transform. *
      *
    * *

    Default Rendering Attributes

    - * The default values for the Graphics2D rendering attributes are: + * The default values for the {@code Graphics2D} rendering attributes are: *
    - *
    Paint - *
    The color of the Component. - *
    Font - *
    The Font of the Component. - *
    Stroke + *
    {@code Paint} + *
    The color of the {@code Component}. + *
    {@code Font} + *
    The {@code Font} of the {@code Component}. + *
    {@code Stroke} *
    A square pen with a linewidth of 1, no dashing, miter segment joins * and square end caps. - *
    Transform + *
    {@code Transform} *
    The * {@link GraphicsConfiguration#getDefaultTransform() getDefaultTransform} - * for the GraphicsConfiguration of the Component. - *
    Composite + * for the {@code GraphicsConfiguration} of the {@code Component}. + *
    {@code Composite} *
    The {@link AlphaComposite#SRC_OVER} rule. - *
    Clip - *
    No rendering Clip, the output is clipped to the - * Component. + *
    {@code Clip} + *
    No rendering {@code Clip}, the output is clipped to the + * {@code Component}. *
    * *

    Rendering Compatibility Issues

    @@ -291,14 +291,14 @@ import java.util.Map; * Java 2D API maintains compatibility with JDK 1.1 rendering * behavior, such that legacy operations and existing renderer * behavior is unchanged under Java 2D API. Legacy - * methods that map onto general draw and - * fill methods are defined, which clearly indicates - * how Graphics2D extends Graphics based - * on settings of Stroke and Transform + * methods that map onto general {@code draw} and + * {@code fill} methods are defined, which clearly indicates + * how {@code Graphics2D} extends {@code Graphics} based + * on settings of {@code Stroke} and {@code Transform} * attributes and rendering hints. The definition * performs identically under default attribute settings. - * For example, the default Stroke is a - * BasicStroke with a width of 1 and no dashing and the + * For example, the default {@code Stroke} is a + * {@code BasicStroke} with a width of 1 and no dashing and the * default Transform for screen drawing is an Identity transform. *

    * The following two rules provide predictable rendering behavior whether @@ -315,7 +315,7 @@ import java.util.Map; * covered. On the other hand, since coordinates are defined to be * between pixels, a shape like a rectangle would have no half covered * pixels, whether or not it is rendered using antialiasing. - *

  • Lines and paths stroked using the BasicStroke + *
  • Lines and paths stroked using the {@code BasicStroke} * object may be "normalized" to provide consistent rendering of the * outlines when positioned at various points on the drawable and * whether drawn with aliased or antialiased rendering. This @@ -341,11 +341,11 @@ import java.util.Map; * attribute settings: *
      *
    • - * For fill operations, including fillRect, - * fillRoundRect, fillOval, - * fillArc, fillPolygon, and - * clearRect, {@link #fill(Shape) fill} can now be called - * with the desired Shape. For example, when filling a + * For {@code fill} operations, including {@code fillRect}, + * {@code fillRoundRect}, {@code fillOval}, + * {@code fillArc}, {@code fillPolygon}, and + * {@code clearRect}, {@link #fill(Shape) fill} can now be called + * with the desired {@code Shape}. For example, when filling a * rectangle: *
        * fill(new Rectangle(x, y, w, h));
      @@ -353,11 +353,11 @@ import java.util.Map;
        * is called.
        *
        * 
    • - * Similarly, for draw operations, including drawLine, - * drawRect, drawRoundRect, - * drawOval, drawArc, drawPolyline, - * and drawPolygon, {@link #draw(Shape) draw} can now be - * called with the desired Shape. For example, when drawing a + * Similarly, for draw operations, including {@code drawLine}, + * {@code drawRect}, {@code drawRoundRect}, + * {@code drawOval}, {@code drawArc}, {@code drawPolyline}, + * and {@code drawPolygon}, {@link #draw(Shape) draw} can now be + * called with the desired {@code Shape}. For example, when drawing a * rectangle: *
        * draw(new Rectangle(x, y, w, h));
      @@ -365,36 +365,36 @@ import java.util.Map;
        * is called.
        *
        * 
    • - * The draw3DRect and fill3DRect methods were - * implemented in terms of the drawLine and - * fillRect methods in the Graphics class which - * would predicate their behavior upon the current Stroke - * and Paint objects in a Graphics2D context. + * The {@code draw3DRect} and {@code fill3DRect} methods were + * implemented in terms of the {@code drawLine} and + * {@code fillRect} methods in the {@code Graphics} class which + * would predicate their behavior upon the current {@code Stroke} + * and {@code Paint} objects in a {@code Graphics2D} context. * This class overrides those implementations with versions that use - * the current Color exclusively, overriding the current - * Paint and which uses fillRect to describe + * the current {@code Color} exclusively, overriding the current + * {@code Paint} and which uses {@code fillRect} to describe * the exact same behavior as the preexisting methods regardless of the - * setting of the current Stroke. + * setting of the current {@code Stroke}. *
    - * The Graphics class defines only the setColor + * The {@code Graphics} class defines only the {@code setColor} * method to control the color to be painted. Since the Java 2D API extends - * the Color object to implement the new Paint + * the {@code Color} object to implement the new {@code Paint} * interface, the existing - * setColor method is now a convenience method for setting the - * current Paint attribute to a Color object. - * setColor(c) is equivalent to setPaint(c). + * {@code setColor} method is now a convenience method for setting the + * current {@code Paint} attribute to a {@code Color} object. + * {@code setColor(c)} is equivalent to {@code setPaint(c)}. *

    - * The Graphics class defines two methods for controlling + * The {@code Graphics} class defines two methods for controlling * how colors are applied to the destination. *

      *
    1. - * The setPaintMode method is implemented as a convenience - * method to set the default Composite, equivalent to - * setComposite(new AlphaComposite.SrcOver). + * The {@code setPaintMode} method is implemented as a convenience + * method to set the default {@code Composite}, equivalent to + * {@code setComposite(new AlphaComposite.SrcOver)}. *
    2. - * The setXORMode(Color xorcolor) method is implemented - * as a convenience method to set a special Composite object that - * ignores the Alpha components of source colors and sets the + * The {@code setXORMode(Color xorcolor)} method is implemented + * as a convenience method to set a special {@code Composite} object that + * ignores the {@code Alpha} components of source colors and sets the * destination color to the value: *
        * dstpixel = (PixelOf(srccolor) ^ PixelOf(xorcolor) ^ dstpixel);
      @@ -407,13 +407,13 @@ import java.util.Map;
       public abstract class Graphics2D extends Graphics {
       
           /**
      -     * Constructs a new Graphics2D object.  Since
      -     * Graphics2D is an abstract class, and since it must be
      +     * Constructs a new {@code Graphics2D} object.  Since
      +     * {@code Graphics2D} is an abstract class, and since it must be
            * customized by subclasses for different output devices,
      -     * Graphics2D objects cannot be created directly.
      -     * Instead, Graphics2D objects must be obtained from another
      -     * Graphics2D object, created by a
      -     * Component, or obtained from images such as
      +     * {@code Graphics2D} objects cannot be created directly.
      +     * Instead, {@code Graphics2D} objects must be obtained from another
      +     * {@code Graphics2D} object, created by a
      +     * {@code Component}, or obtained from images such as
            * {@link BufferedImage} objects.
            * @see java.awt.Component#getGraphics
            * @see java.awt.Graphics#create
      @@ -431,8 +431,8 @@ public abstract class Graphics2D extends Graphics {
            * The resulting rectangle covers an area that is
            * width + 1 pixels wide
            * by height + 1 pixels tall.  This method
      -     * uses the current Color exclusively and ignores
      -     * the current Paint.
      +     * uses the current {@code Color} exclusively and ignores
      +     * the current {@code Paint}.
            * @param x the x coordinate of the rectangle to be drawn.
            * @param y the y coordinate of the rectangle to be drawn.
            * @param width the width of the rectangle to be drawn.
      @@ -467,9 +467,9 @@ public abstract class Graphics2D extends Graphics {
            * The edges of the rectangle are highlighted so that it appears
            * as if the edges were beveled and lit from the upper left corner.
            * The colors used for the highlighting effect and for filling are
      -     * determined from the current Color.  This method uses
      -     * the current Color exclusively and ignores the current
      -     * Paint.
      +     * determined from the current {@code Color}.  This method uses
      +     * the current {@code Color} exclusively and ignores the current
      +     * {@code Paint}.
            * @param x the x coordinate of the rectangle to be filled.
            * @param y the y coordinate of the rectangle to be filled.
            * @param       width the width of the rectangle to be filled.
      @@ -506,12 +506,12 @@ public abstract class Graphics2D extends Graphics {
           }
       
           /**
      -     * Strokes the outline of a Shape using the settings of the
      -     * current Graphics2D context.  The rendering attributes
      -     * applied include the Clip, Transform,
      -     * Paint, Composite and
      -     * Stroke attributes.
      -     * @param s the Shape to be rendered
      +     * Strokes the outline of a {@code Shape} using the settings of the
      +     * current {@code Graphics2D} context.  The rendering attributes
      +     * applied include the {@code Clip}, {@code Transform},
      +     * {@code Paint}, {@code Composite} and
      +     * {@code Stroke} attributes.
      +     * @param s the {@code Shape} to be rendered
            * @see #setStroke
            * @see #setPaint
            * @see java.awt.Graphics#setColor
      @@ -527,22 +527,22 @@ public abstract class Graphics2D extends Graphics {
            * Renders an image, applying a transform from image space into user space
            * before drawing.
            * The transformation from user space into device space is done with
      -     * the current Transform in the Graphics2D.
      +     * the current {@code Transform} in the {@code Graphics2D}.
            * The specified transformation is applied to the image before the
      -     * transform attribute in the Graphics2D context is applied.
      -     * The rendering attributes applied include the Clip,
      -     * Transform, and Composite attributes.
      +     * transform attribute in the {@code Graphics2D} context is applied.
      +     * The rendering attributes applied include the {@code Clip},
      +     * {@code Transform}, and {@code Composite} attributes.
            * Note that no rendering is done if the specified transform is
            * noninvertible.
            * @param img the specified image to be rendered.
      -     *            This method does nothing if img is null.
      +     *            This method does nothing if {@code img} is null.
            * @param xform the transformation from image space into user space
            * @param obs the {@link ImageObserver}
      -     * to be notified as more of the Image
      +     * to be notified as more of the {@code Image}
            * is converted
      -     * @return true if the Image is
      +     * @return {@code true} if the {@code Image} is
            * fully loaded and completely rendered, or if it's null;
      -     * false if the Image is still being loaded.
      +     * {@code false} if the {@code Image} is still being loaded.
            * @see #transform
            * @see #setTransform
            * @see #setComposite
      @@ -554,19 +554,19 @@ public abstract class Graphics2D extends Graphics {
                                             ImageObserver obs);
       
           /**
      -     * Renders a BufferedImage that is
      +     * Renders a {@code BufferedImage} that is
            * filtered with a
            * {@link BufferedImageOp}.
      -     * The rendering attributes applied include the Clip,
      -     * Transform
      -     * and Composite attributes.  This is equivalent to:
      +     * The rendering attributes applied include the {@code Clip},
      +     * {@code Transform}
      +     * and {@code Composite} attributes.  This is equivalent to:
            * 
            * img1 = op.filter(img, null);
            * drawImage(img1, new AffineTransform(1f,0f,0f,1f,x,y), null);
            * 
      * @param op the filter to be applied to the image before rendering - * @param img the specified BufferedImage to be rendered. - * This method does nothing if img is null. + * @param img the specified {@code BufferedImage} to be rendered. + * This method does nothing if {@code img} is null. * @param x the x coordinate of the location in user space where * the upper left corner of the image is rendered * @param y the y coordinate of the location in user space where @@ -588,15 +588,15 @@ public abstract class Graphics2D extends Graphics { * applying a transform from image * space into user space before drawing. * The transformation from user space into device space is done with - * the current Transform in the Graphics2D. + * the current {@code Transform} in the {@code Graphics2D}. * The specified transformation is applied to the image before the - * transform attribute in the Graphics2D context is applied. - * The rendering attributes applied include the Clip, - * Transform, and Composite attributes. Note + * transform attribute in the {@code Graphics2D} context is applied. + * The rendering attributes applied include the {@code Clip}, + * {@code Transform}, and {@code Composite} attributes. Note * that no rendering is done if the specified transform is * noninvertible. * @param img the image to be rendered. This method does - * nothing if img is null. + * nothing if {@code img} is null. * @param xform the transformation from image space into user space * @see #transform * @see #setTransform @@ -612,24 +612,24 @@ public abstract class Graphics2D extends Graphics { * {@link RenderableImage}, * applying a transform from image space into user space before drawing. * The transformation from user space into device space is done with - * the current Transform in the Graphics2D. + * the current {@code Transform} in the {@code Graphics2D}. * The specified transformation is applied to the image before the - * transform attribute in the Graphics2D context is applied. - * The rendering attributes applied include the Clip, - * Transform, and Composite attributes. Note + * transform attribute in the {@code Graphics2D} context is applied. + * The rendering attributes applied include the {@code Clip}, + * {@code Transform}, and {@code Composite} attributes. Note * that no rendering is done if the specified transform is * noninvertible. *

      - * Rendering hints set on the Graphics2D object might - * be used in rendering the RenderableImage. + * Rendering hints set on the {@code Graphics2D} object might + * be used in rendering the {@code RenderableImage}. * If explicit control is required over specific hints recognized by a - * specific RenderableImage, or if knowledge of which hints - * are used is required, then a RenderedImage should be - * obtained directly from the RenderableImage + * specific {@code RenderableImage}, or if knowledge of which hints + * are used is required, then a {@code RenderedImage} should be + * obtained directly from the {@code RenderableImage} * and rendered using *{@link #drawRenderedImage(RenderedImage, AffineTransform) drawRenderedImage}. * @param img the image to be rendered. This method does - * nothing if img is null. + * nothing if {@code img} is null. * @param xform the transformation from image space into user space * @see #transform * @see #setTransform @@ -642,24 +642,24 @@ public abstract class Graphics2D extends Graphics { AffineTransform xform); /** - * Renders the text of the specified String, using the - * current text attribute state in the Graphics2D context. + * Renders the text of the specified {@code String}, using the + * current text attribute state in the {@code Graphics2D} context. * The baseline of the * first character is at position (xy) in * the User Space. - * The rendering attributes applied include the Clip, - * Transform, Paint, Font and - * Composite attributes. For characters in script + * The rendering attributes applied include the {@code Clip}, + * {@code Transform}, {@code Paint}, {@code Font} and + * {@code Composite} attributes. For characters in script * systems such as Hebrew and Arabic, the glyphs can be rendered from * right to left, in which case the coordinate supplied is the * location of the leftmost character on the baseline. * @param str the string to be rendered * @param x the x coordinate of the location where the - * String should be rendered + * {@code String} should be rendered * @param y the y coordinate of the location where the - * String should be rendered - * @throws NullPointerException if str is - * null + * {@code String} should be rendered + * @throws NullPointerException if {@code str} is + * {@code null} * @see java.awt.Graphics#drawBytes * @see java.awt.Graphics#drawChars * @since 1.0 @@ -667,23 +667,23 @@ public abstract class Graphics2D extends Graphics { public abstract void drawString(String str, int x, int y); /** - * Renders the text specified by the specified String, - * using the current text attribute state in the Graphics2D context. + * Renders the text specified by the specified {@code String}, + * using the current text attribute state in the {@code Graphics2D} context. * The baseline of the first character is at position * (xy) in the User Space. - * The rendering attributes applied include the Clip, - * Transform, Paint, Font and - * Composite attributes. For characters in script systems + * The rendering attributes applied include the {@code Clip}, + * {@code Transform}, {@code Paint}, {@code Font} and + * {@code Composite} attributes. For characters in script systems * such as Hebrew and Arabic, the glyphs can be rendered from right to * left, in which case the coordinate supplied is the location of the * leftmost character on the baseline. - * @param str the String to be rendered + * @param str the {@code String} to be rendered * @param x the x coordinate of the location where the - * String should be rendered + * {@code String} should be rendered * @param y the y coordinate of the location where the - * String should be rendered - * @throws NullPointerException if str is - * null + * {@code String} should be rendered + * @throws NullPointerException if {@code str} is + * {@code null} * @see #setPaint * @see java.awt.Graphics#setColor * @see java.awt.Graphics#setFont @@ -708,8 +708,8 @@ public abstract class Graphics2D extends Graphics { * rendered * @param y the y coordinate where the iterator's text is to be * rendered - * @throws NullPointerException if iterator is - * null + * @throws NullPointerException if {@code iterator} is + * {@code null} * @see #setPaint * @see java.awt.Graphics#setColor * @see #setTransform @@ -734,8 +734,8 @@ public abstract class Graphics2D extends Graphics { * rendered * @param y the y coordinate where the iterator's text is to be * rendered - * @throws NullPointerException if iterator is - * null + * @throws NullPointerException if {@code iterator} is + * {@code null} * @see #setPaint * @see java.awt.Graphics#setColor * @see #setTransform @@ -748,20 +748,20 @@ public abstract class Graphics2D extends Graphics { /** * Renders the text of the specified * {@link GlyphVector} using - * the Graphics2D context's rendering attributes. - * The rendering attributes applied include the Clip, - * Transform, Paint, and - * Composite attributes. The GlyphVector + * the {@code Graphics2D} context's rendering attributes. + * The rendering attributes applied include the {@code Clip}, + * {@code Transform}, {@code Paint}, and + * {@code Composite} attributes. The {@code GlyphVector} * specifies individual glyphs from a {@link Font}. - * The GlyphVector can also contain the glyph positions. + * The {@code GlyphVector} can also contain the glyph positions. * This is the fastest way to render a set of characters to the * screen. - * @param g the GlyphVector to be rendered + * @param g the {@code GlyphVector} to be rendered * @param x the x position in User Space where the glyphs should * be rendered * @param y the y position in User Space where the glyphs should * be rendered - * @throws NullPointerException if g is null. + * @throws NullPointerException if {@code g} is {@code null}. * * @see java.awt.Font#createGlyphVector * @see java.awt.font.GlyphVector @@ -774,11 +774,11 @@ public abstract class Graphics2D extends Graphics { public abstract void drawGlyphVector(GlyphVector g, float x, float y); /** - * Fills the interior of a Shape using the settings of the - * Graphics2D context. The rendering attributes applied - * include the Clip, Transform, - * Paint, and Composite. - * @param s the Shape to be filled + * Fills the interior of a {@code Shape} using the settings of the + * {@code Graphics2D} context. The rendering attributes applied + * include the {@code Clip}, {@code Transform}, + * {@code Paint}, and {@code Composite}. + * @param s the {@code Shape} to be filled * @see #setPaint * @see java.awt.Graphics#setColor * @see #transform @@ -790,25 +790,25 @@ public abstract class Graphics2D extends Graphics { public abstract void fill(Shape s); /** - * Checks whether or not the specified Shape intersects + * Checks whether or not the specified {@code Shape} intersects * the specified {@link Rectangle}, which is in device - * space. If onStroke is false, this method checks - * whether or not the interior of the specified Shape - * intersects the specified Rectangle. If - * onStroke is true, this method checks - * whether or not the Stroke of the specified - * Shape outline intersects the specified - * Rectangle. + * space. If {@code onStroke} is false, this method checks + * whether or not the interior of the specified {@code Shape} + * intersects the specified {@code Rectangle}. If + * {@code onStroke} is {@code true}, this method checks + * whether or not the {@code Stroke} of the specified + * {@code Shape} outline intersects the specified + * {@code Rectangle}. * The rendering attributes taken into account include the - * Clip, Transform, and Stroke + * {@code Clip}, {@code Transform}, and {@code Stroke} * attributes. * @param rect the area in device space to check for a hit - * @param s the Shape to check for a hit + * @param s the {@code Shape} to check for a hit * @param onStroke flag used to choose between testing the - * stroked or the filled shape. If the flag is true, the - * Stroke outline is tested. If the flag is - * false, the filled Shape is tested. - * @return true if there is a hit; false + * stroked or the filled shape. If the flag is {@code true}, the + * {@code Stroke} outline is tested. If the flag is + * {@code false}, the filled {@code Shape} is tested. + * @return {@code true} if there is a hit; {@code false} * otherwise. * @see #setStroke * @see #fill @@ -824,31 +824,31 @@ public abstract class Graphics2D extends Graphics { /** * Returns the device configuration associated with this - * Graphics2D. - * @return the device configuration of this Graphics2D. + * {@code Graphics2D}. + * @return the device configuration of this {@code Graphics2D}. */ public abstract GraphicsConfiguration getDeviceConfiguration(); /** - * Sets the Composite for the Graphics2D context. - * The Composite is used in all drawing methods such as - * drawImage, drawString, draw, - * and fill. It specifies how new pixels are to be combined + * Sets the {@code Composite} for the {@code Graphics2D} context. + * The {@code Composite} is used in all drawing methods such as + * {@code drawImage}, {@code drawString}, {@code draw}, + * and {@code fill}. It specifies how new pixels are to be combined * with the existing pixels on the graphics device during the rendering * process. - *

      If this Graphics2D context is drawing to a - * Component on the display screen and the - * Composite is a custom object rather than an - * instance of the AlphaComposite class, and if - * there is a security manager, its checkPermission - * method is called with an AWTPermission("readDisplayPixels") + *

      If this {@code Graphics2D} context is drawing to a + * {@code Component} on the display screen and the + * {@code Composite} is a custom object rather than an + * instance of the {@code AlphaComposite} class, and if + * there is a security manager, its {@code checkPermission} + * method is called with an {@code AWTPermission("readDisplayPixels")} * permission. * @throws SecurityException - * if a custom Composite object is being + * if a custom {@code Composite} object is being * used to render to the screen and a security manager - * is set and its checkPermission method + * is set and its {@code checkPermission} method * does not allow the operation. - * @param comp the Composite object to be used for rendering + * @param comp the {@code Composite} object to be used for rendering * @see java.awt.Graphics#setXORMode * @see java.awt.Graphics#setPaintMode * @see #getComposite @@ -859,13 +859,13 @@ public abstract class Graphics2D extends Graphics { public abstract void setComposite(Composite comp); /** - * Sets the Paint attribute for the - * Graphics2D context. Calling this method - * with a null Paint object does - * not have any effect on the current Paint attribute - * of this Graphics2D. - * @param paint the Paint object to be used to generate - * color during the rendering process, or null + * Sets the {@code Paint} attribute for the + * {@code Graphics2D} context. Calling this method + * with a {@code null Paint} object does + * not have any effect on the current {@code Paint} attribute + * of this {@code Graphics2D}. + * @param paint the {@code Paint} object to be used to generate + * color during the rendering process, or {@code null} * @see java.awt.Graphics#setColor * @see #getPaint * @see GradientPaint @@ -874,9 +874,9 @@ public abstract class Graphics2D extends Graphics { public abstract void setPaint( Paint paint ); /** - * Sets the Stroke for the Graphics2D context. - * @param s the Stroke object to be used to stroke a - * Shape during the rendering process + * Sets the {@code Stroke} for the {@code Graphics2D} context. + * @param s the {@code Stroke} object to be used to stroke a + * {@code Shape} during the rendering process * @see BasicStroke * @see #getStroke */ @@ -886,7 +886,7 @@ public abstract class Graphics2D extends Graphics { * Sets the value of a single preference for the rendering algorithms. * Hint categories include controls for rendering quality and overall * time/quality trade-off in the rendering process. Refer to the - * RenderingHints class for definitions of some common + * {@code RenderingHints} class for definitions of some common * keys and values. * @param hintKey the key of the hint to be set. * @param hintValue the value indicating preferences for the specified @@ -900,12 +900,12 @@ public abstract class Graphics2D extends Graphics { * Returns the value of a single preference for the rendering algorithms. * Hint categories include controls for rendering quality and overall * time/quality trade-off in the rendering process. Refer to the - * RenderingHints class for definitions of some common + * {@code RenderingHints} class for definitions of some common * keys and values. * @param hintKey the key corresponding to the hint to get. * @return an object representing the value for the specified hint key. * Some of the keys and their associated values are defined in the - * RenderingHints class. + * {@code RenderingHints} class. * @see RenderingHints * @see #setRenderingHint(RenderingHints.Key, Object) */ @@ -913,13 +913,13 @@ public abstract class Graphics2D extends Graphics { /** * Replaces the values of all preferences for the rendering - * algorithms with the specified hints. + * algorithms with the specified {@code hints}. * The existing values for all rendering hints are discarded and * the new set of known hints and values are initialized from the * specified {@link Map} object. * Hint categories include controls for rendering quality and * overall time/quality trade-off in the rendering process. - * Refer to the RenderingHints class for definitions of + * Refer to the {@code RenderingHints} class for definitions of * some common keys and values. * @param hints the rendering hints to be set * @see #getRenderingHints @@ -931,12 +931,12 @@ public abstract class Graphics2D extends Graphics { * Sets the values of an arbitrary number of preferences for the * rendering algorithms. * Only values for the rendering hints that are present in the - * specified Map object are modified. + * specified {@code Map} object are modified. * All other preferences not present in the specified * object are left unmodified. * Hint categories include controls for rendering quality and * overall time/quality trade-off in the rendering process. - * Refer to the RenderingHints class for definitions of + * Refer to the {@code RenderingHints} class for definitions of * some common keys and values. * @param hints the rendering hints to be set * @see RenderingHints @@ -949,9 +949,9 @@ public abstract class Graphics2D extends Graphics { * trade-off in the rendering process. * Returns all of the hint key/value pairs that were ever specified in * one operation. Refer to the - * RenderingHints class for definitions of some common + * {@code RenderingHints} class for definitions of some common * keys and values. - * @return a reference to an instance of RenderingHints + * @return a reference to an instance of {@code RenderingHints} * that contains the current preferences. * @see RenderingHints * @see #setRenderingHints(Map) @@ -959,11 +959,11 @@ public abstract class Graphics2D extends Graphics { public abstract RenderingHints getRenderingHints(); /** - * Translates the origin of the Graphics2D context to the + * Translates the origin of the {@code Graphics2D} context to the * point (xy) in the current coordinate system. - * Modifies the Graphics2D context so that its new origin + * Modifies the {@code Graphics2D} context so that its new origin * corresponds to the point (xy) in the - * Graphics2D context's former coordinate system. All + * {@code Graphics2D} context's former coordinate system. All * coordinates used in subsequent rendering operations on this graphics * context are relative to this new origin. * @param x the specified x coordinate @@ -974,12 +974,12 @@ public abstract class Graphics2D extends Graphics { /** * Concatenates the current - * Graphics2D Transform + * {@code Graphics2D Transform} * with a translation transform. * Subsequent rendering is translated by the specified * distance relative to the previous position. * This is equivalent to calling transform(T), where T is an - * AffineTransform represented by the following matrix: + * {@code AffineTransform} represented by the following matrix: *

            *          [   1    0    tx  ]
            *          [   0    1    ty  ]
      @@ -991,12 +991,12 @@ public abstract class Graphics2D extends Graphics {
           public abstract void translate(double tx, double ty);
       
           /**
      -     * Concatenates the current Graphics2D
      -     * Transform with a rotation transform.
      +     * Concatenates the current {@code Graphics2D}
      +     * {@code Transform} with a rotation transform.
            * Subsequent rendering is rotated by the specified radians relative
            * to the previous origin.
      -     * This is equivalent to calling transform(R), where R is an
      -     * AffineTransform represented by the following matrix:
      +     * This is equivalent to calling {@code transform(R)}, where R is an
      +     * {@code AffineTransform} represented by the following matrix:
            * 
            *          [   cos(theta)    -sin(theta)    0   ]
            *          [   sin(theta)     cos(theta)    0   ]
      @@ -1009,8 +1009,8 @@ public abstract class Graphics2D extends Graphics {
           public abstract void rotate(double theta);
       
           /**
      -     * Concatenates the current Graphics2D
      -     * Transform with a translated rotation
      +     * Concatenates the current {@code Graphics2D}
      +     * {@code Transform} with a translated rotation
            * transform.  Subsequent rendering is transformed by a transform
            * which is constructed by translating to the specified location,
            * rotating by the specified radians, and translating back by the same
      @@ -1030,12 +1030,12 @@ public abstract class Graphics2D extends Graphics {
           public abstract void rotate(double theta, double x, double y);
       
           /**
      -     * Concatenates the current Graphics2D
      -     * Transform with a scaling transformation
      +     * Concatenates the current {@code Graphics2D}
      +     * {@code Transform} with a scaling transformation
            * Subsequent rendering is resized according to the specified scaling
            * factors relative to the previous scaling.
      -     * This is equivalent to calling transform(S), where S is an
      -     * AffineTransform represented by the following matrix:
      +     * This is equivalent to calling {@code transform(S)}, where S is an
      +     * {@code AffineTransform} represented by the following matrix:
            * 
            *          [   sx   0    0   ]
            *          [   0    sy   0   ]
      @@ -1051,12 +1051,12 @@ public abstract class Graphics2D extends Graphics {
           public abstract void scale(double sx, double sy);
       
           /**
      -     * Concatenates the current Graphics2D
      -     * Transform with a shearing transform.
      +     * Concatenates the current {@code Graphics2D}
      +     * {@code Transform} with a shearing transform.
            * Subsequent renderings are sheared by the specified
            * multiplier relative to the previous position.
      -     * This is equivalent to calling transform(SH), where SH
      -     * is an AffineTransform represented by the following
      +     * This is equivalent to calling {@code transform(SH)}, where SH
      +     * is an {@code AffineTransform} represented by the following
            * matrix:
            * 
            *          [   1   shx   0   ]
      @@ -1071,37 +1071,37 @@ public abstract class Graphics2D extends Graphics {
           public abstract void shear(double shx, double shy);
       
           /**
      -     * Composes an AffineTransform object with the
      -     * Transform in this Graphics2D according
      +     * Composes an {@code AffineTransform} object with the
      +     * {@code Transform} in this {@code Graphics2D} according
            * to the rule last-specified-first-applied.  If the current
      -     * Transform is Cx, the result of composition
      -     * with Tx is a new Transform Cx'.  Cx' becomes the
      -     * current Transform for this Graphics2D.
      -     * Transforming a point p by the updated Transform Cx' is
      +     * {@code Transform} is Cx, the result of composition
      +     * with Tx is a new {@code Transform} Cx'.  Cx' becomes the
      +     * current {@code Transform} for this {@code Graphics2D}.
      +     * Transforming a point p by the updated {@code Transform} Cx' is
            * equivalent to first transforming p by Tx and then transforming
      -     * the result by the original Transform Cx.  In other
      +     * the result by the original {@code Transform} Cx.  In other
            * words, Cx'(p) = Cx(Tx(p)).  A copy of the Tx is made, if necessary,
            * so further modifications to Tx do not affect rendering.
      -     * @param Tx the AffineTransform object to be composed with
      -     * the current Transform
      +     * @param Tx the {@code AffineTransform} object to be composed with
      +     * the current {@code Transform}
            * @see #setTransform
            * @see AffineTransform
            */
           public abstract void transform(AffineTransform Tx);
       
           /**
      -     * Overwrites the Transform in the Graphics2D context.
      +     * Overwrites the Transform in the {@code Graphics2D} context.
            * WARNING: This method should never be used to apply a new
            * coordinate transform on top of an existing transform because the
      -     * Graphics2D might already have a transform that is
      +     * {@code Graphics2D} might already have a transform that is
            * needed for other purposes, such as rendering Swing
            * components or applying a scaling transformation to adjust for the
            * resolution of a printer.
            * 

      To add a coordinate transform, use the - * transform, rotate, scale, - * or shear methods. The setTransform + * {@code transform}, {@code rotate}, {@code scale}, + * or {@code shear} methods. The {@code setTransform} * method is intended only for restoring the original - * Graphics2D transform after rendering, as shown in this + * {@code Graphics2D} transform after rendering, as shown in this * example: *

            * // Get the current transform
      @@ -1114,8 +1114,8 @@ public abstract class Graphics2D extends Graphics {
            * g2d.setTransform(saveAT);
            * 
      * - * @param Tx the AffineTransform that was retrieved - * from the getTransform method + * @param Tx the {@code AffineTransform} that was retrieved + * from the {@code getTransform} method * @see #transform * @see #getTransform * @see AffineTransform @@ -1123,19 +1123,19 @@ public abstract class Graphics2D extends Graphics { public abstract void setTransform(AffineTransform Tx); /** - * Returns a copy of the current Transform in the - * Graphics2D context. - * @return the current AffineTransform in the - * Graphics2D context. + * Returns a copy of the current {@code Transform} in the + * {@code Graphics2D} context. + * @return the current {@code AffineTransform} in the + * {@code Graphics2D} context. * @see #transform * @see #setTransform */ public abstract AffineTransform getTransform(); /** - * Returns the current Paint of the - * Graphics2D context. - * @return the current Graphics2D Paint, + * Returns the current {@code Paint} of the + * {@code Graphics2D} context. + * @return the current {@code Graphics2D Paint}, * which defines a color or pattern. * @see #setPaint * @see java.awt.Graphics#setColor @@ -1143,27 +1143,27 @@ public abstract class Graphics2D extends Graphics { public abstract Paint getPaint(); /** - * Returns the current Composite in the - * Graphics2D context. - * @return the current Graphics2D Composite, + * Returns the current {@code Composite} in the + * {@code Graphics2D} context. + * @return the current {@code Graphics2D Composite}, * which defines a compositing style. * @see #setComposite */ public abstract Composite getComposite(); /** - * Sets the background color for the Graphics2D context. + * Sets the background color for the {@code Graphics2D} context. * The background color is used for clearing a region. - * When a Graphics2D is constructed for a - * Component, the background color is - * inherited from the Component. Setting the background color - * in the Graphics2D context only affects the subsequent - * clearRect calls and not the background color of the - * Component. To change the background - * of the Component, use appropriate methods of - * the Component. + * When a {@code Graphics2D} is constructed for a + * {@code Component}, the background color is + * inherited from the {@code Component}. Setting the background color + * in the {@code Graphics2D} context only affects the subsequent + * {@code clearRect} calls and not the background color of the + * {@code Component}. To change the background + * of the {@code Component}, use appropriate methods of + * the {@code Component}. * @param color the background color that is used in - * subsequent calls to clearRect + * subsequent calls to {@code clearRect} * @see #getBackground * @see java.awt.Graphics#clearRect */ @@ -1171,52 +1171,52 @@ public abstract class Graphics2D extends Graphics { /** * Returns the background color used for clearing a region. - * @return the current Graphics2D Color, + * @return the current {@code Graphics2D Color}, * which defines the background color. * @see #setBackground */ public abstract Color getBackground(); /** - * Returns the current Stroke in the - * Graphics2D context. - * @return the current Graphics2D Stroke, + * Returns the current {@code Stroke} in the + * {@code Graphics2D} context. + * @return the current {@code Graphics2D Stroke}, * which defines the line style. * @see #setStroke */ public abstract Stroke getStroke(); /** - * Intersects the current Clip with the interior of the - * specified Shape and sets the Clip to the - * resulting intersection. The specified Shape is - * transformed with the current Graphics2D - * Transform before being intersected with the current - * Clip. This method is used to make the current - * Clip smaller. - * To make the Clip larger, use setClip. + * Intersects the current {@code Clip} with the interior of the + * specified {@code Shape} and sets the {@code Clip} to the + * resulting intersection. The specified {@code Shape} is + * transformed with the current {@code Graphics2D} + * {@code Transform} before being intersected with the current + * {@code Clip}. This method is used to make the current + * {@code Clip} smaller. + * To make the {@code Clip} larger, use {@code setClip}. * The user clip modified by this method is independent of the * clipping associated with device bounds and visibility. If no clip has * previously been set, or if the clip has been cleared using - * {@link Graphics#setClip(Shape) setClip} with a null - * argument, the specified Shape becomes the new + * {@link Graphics#setClip(Shape) setClip} with a {@code null} + * argument, the specified {@code Shape} becomes the new * user clip. - * @param s the Shape to be intersected with the current - * Clip. If s is null, - * this method clears the current Clip. + * @param s the {@code Shape} to be intersected with the current + * {@code Clip}. If {@code s} is {@code null}, + * this method clears the current {@code Clip}. */ public abstract void clip(Shape s); /** - * Get the rendering context of the Font within this - * Graphics2D context. + * Get the rendering context of the {@code Font} within this + * {@code Graphics2D} context. * The {@link FontRenderContext} * encapsulates application hints such as anti-aliasing and * fractional metrics, as well as target device specific information * such as dots-per-inch. This information should be provided by the * application when using objects that perform typographical - * formatting, such as Font and - * TextLayout. This information should also be provided + * formatting, such as {@code Font} and + * {@code TextLayout}. This information should also be provided * by applications that perform their own layout and need accurate * measurements of various characteristics of glyphs such as advance * and line height when various rendering hints have been applied to diff --git a/jdk/src/java.desktop/share/classes/java/awt/GraphicsConfigTemplate.java b/jdk/src/java.desktop/share/classes/java/awt/GraphicsConfigTemplate.java index 7baec878444..d3799b3ef24 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/GraphicsConfigTemplate.java +++ b/jdk/src/java.desktop/share/classes/java/awt/GraphicsConfigTemplate.java @@ -28,14 +28,14 @@ package java.awt; import java.io.*; /** - * The GraphicsConfigTemplate class is used to obtain a valid + * The {@code GraphicsConfigTemplate} class is used to obtain a valid * {@link GraphicsConfiguration}. A user instantiates one of these * objects and then sets all non-default attributes as desired. The * {@link GraphicsDevice#getBestConfiguration} method found in the * {@link GraphicsDevice} class is then called with this - * GraphicsConfigTemplate. A valid - * GraphicsConfiguration is returned that meets or exceeds - * what was requested in the GraphicsConfigTemplate. + * {@code GraphicsConfigTemplate}. A valid + * {@code GraphicsConfiguration} is returned that meets or exceeds + * what was requested in the {@code GraphicsConfigTemplate}. * @see GraphicsDevice * @see GraphicsConfiguration * @@ -56,15 +56,15 @@ public abstract class GraphicsConfigTemplate implements Serializable { /** * Value used for "Enum" (Integer) type. States that this - * feature is required for the GraphicsConfiguration + * feature is required for the {@code GraphicsConfiguration} * object. If this feature is not available, do not select the - * GraphicsConfiguration object. + * {@code GraphicsConfiguration} object. */ public static final int REQUIRED = 1; /** * Value used for "Enum" (Integer) type. States that this - * feature is desired for the GraphicsConfiguration + * feature is desired for the {@code GraphicsConfiguration} * object. A selection with this feature is preferred over a * selection that does not include this feature, although both * selections can be considered valid matches. @@ -74,7 +74,7 @@ public abstract class GraphicsConfigTemplate implements Serializable { /** * Value used for "Enum" (Integer) type. States that this * feature is not necessary for the selection of the - * GraphicsConfiguration object. A selection + * {@code GraphicsConfiguration} object. A selection * without this feature is preferred over a selection that * includes this feature since it is not used. */ @@ -82,10 +82,10 @@ public abstract class GraphicsConfigTemplate implements Serializable { /** * Returns the "best" configuration possible that passes the - * criteria defined in the GraphicsConfigTemplate. - * @param gc the array of GraphicsConfiguration + * criteria defined in the {@code GraphicsConfigTemplate}. + * @param gc the array of {@code GraphicsConfiguration} * objects to choose from. - * @return a GraphicsConfiguration object that is + * @return a {@code GraphicsConfiguration} object that is * the best configuration possible. * @see GraphicsConfiguration */ @@ -93,15 +93,15 @@ public abstract class GraphicsConfigTemplate implements Serializable { getBestConfiguration(GraphicsConfiguration[] gc); /** - * Returns a boolean indicating whether or - * not the specified GraphicsConfiguration can be + * Returns a {@code boolean} indicating whether or + * not the specified {@code GraphicsConfiguration} can be * used to create a drawing surface that supports the indicated * features. - * @param gc the GraphicsConfiguration object to test - * @return true if this - * GraphicsConfiguration object can be used to create + * @param gc the {@code GraphicsConfiguration} object to test + * @return {@code true} if this + * {@code GraphicsConfiguration} object can be used to create * surfaces that support the indicated features; - * false if the GraphicsConfiguration can + * {@code false} if the {@code GraphicsConfiguration} can * not be used to create a drawing surface usable by this Java(tm) * API. */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/GraphicsConfiguration.java b/jdk/src/java.desktop/share/classes/java/awt/GraphicsConfiguration.java index ef0e454a070..3a5640c8f84 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/GraphicsConfiguration.java +++ b/jdk/src/java.desktop/share/classes/java/awt/GraphicsConfiguration.java @@ -34,23 +34,23 @@ import java.awt.image.WritableRaster; import sun.awt.image.SunVolatileImage; /** - * The GraphicsConfiguration class describes the + * The {@code GraphicsConfiguration} class describes the * characteristics of a graphics destination such as a printer or monitor. - * There can be many GraphicsConfiguration objects associated + * There can be many {@code GraphicsConfiguration} objects associated * with a single graphics device, representing different drawing modes or * capabilities. The corresponding native structure will vary from platform * to platform. For example, on X11 windowing systems, - * each visual is a different GraphicsConfiguration. - * On Microsoft Windows, GraphicsConfigurations represent + * each visual is a different {@code GraphicsConfiguration}. + * On Microsoft Windows, {@code GraphicsConfiguration}s represent * PixelFormats available in the current resolution and color depth. *

      * In a virtual device multi-screen environment in which the desktop * area could span multiple physical screen devices, the bounds of the - * GraphicsConfiguration objects are relative to the + * {@code GraphicsConfiguration} objects are relative to the * virtual coordinate system. When setting the location of a * component, use {@link #getBounds() getBounds} to get the bounds of - * the desired GraphicsConfiguration and offset the location - * with the coordinates of the GraphicsConfiguration, + * the desired {@code GraphicsConfiguration} and offset the location + * with the coordinates of the {@code GraphicsConfiguration}, * as the following code sample illustrates: *

      * @@ -61,17 +61,17 @@ import sun.awt.image.SunVolatileImage; * *

      * To determine if your environment is a virtual device - * environment, call getBounds on all of the - * GraphicsConfiguration objects in your system. If + * environment, call {@code getBounds} on all of the + * {@code GraphicsConfiguration} objects in your system. If * any of the origins of the returned bounds is not (0, 0), * your environment is a virtual device environment. * *

      - * You can also use getBounds to determine the bounds - * of the virtual device. To do this, first call getBounds on all - * of the GraphicsConfiguration objects in your + * You can also use {@code getBounds} to determine the bounds + * of the virtual device. To do this, first call {@code getBounds} on all + * of the {@code GraphicsConfiguration} objects in your * system. Then calculate the union of all of the bounds returned - * from the calls to getBounds. The union is the + * from the calls to {@code getBounds}. The union is the * bounds of the virtual device. The following code sample * calculates the bounds of the virtual device. * @@ -125,24 +125,24 @@ public abstract class GraphicsConfiguration { /** * Returns the {@link GraphicsDevice} associated with this - * GraphicsConfiguration. - * @return a GraphicsDevice object that is - * associated with this GraphicsConfiguration. + * {@code GraphicsConfiguration}. + * @return a {@code GraphicsDevice} object that is + * associated with this {@code GraphicsConfiguration}. */ public abstract GraphicsDevice getDevice(); /** * Returns a {@link BufferedImage} with a data layout and color model - * compatible with this GraphicsConfiguration. This + * compatible with this {@code GraphicsConfiguration}. This * method has nothing to do with memory-mapping - * a device. The returned BufferedImage has + * a device. The returned {@code BufferedImage} has * a layout and color model that is closest to this native device * configuration and can therefore be optimally blitted to this * device. - * @param width the width of the returned BufferedImage - * @param height the height of the returned BufferedImage - * @return a BufferedImage whose data layout and color - * model is compatible with this GraphicsConfiguration. + * @param width the width of the returned {@code BufferedImage} + * @param height the height of the returned {@code BufferedImage} + * @return a {@code BufferedImage} whose data layout and color + * model is compatible with this {@code GraphicsConfiguration}. */ public BufferedImage createCompatibleImage(int width, int height) { ColorModel model = getColorModel(); @@ -153,18 +153,18 @@ public abstract class GraphicsConfiguration { } /** - * Returns a BufferedImage that supports the specified + * Returns a {@code BufferedImage} that supports the specified * transparency and has a data layout and color model - * compatible with this GraphicsConfiguration. This + * compatible with this {@code GraphicsConfiguration}. This * method has nothing to do with memory-mapping - * a device. The returned BufferedImage has a layout and + * a device. The returned {@code BufferedImage} has a layout and * color model that can be optimally blitted to a device - * with this GraphicsConfiguration. - * @param width the width of the returned BufferedImage - * @param height the height of the returned BufferedImage + * with this {@code GraphicsConfiguration}. + * @param width the width of the returned {@code BufferedImage} + * @param height the height of the returned {@code BufferedImage} * @param transparency the specified transparency mode - * @return a BufferedImage whose data layout and color - * model is compatible with this GraphicsConfiguration + * @return a {@code BufferedImage} whose data layout and color + * model is compatible with this {@code GraphicsConfiguration} * and also supports the specified transparency. * @throws IllegalArgumentException if the transparency is not a valid value * @see Transparency#OPAQUE @@ -190,15 +190,15 @@ public abstract class GraphicsConfiguration { /** * Returns a {@link VolatileImage} with a data layout and color model - * compatible with this GraphicsConfiguration. - * The returned VolatileImage + * compatible with this {@code GraphicsConfiguration}. + * The returned {@code VolatileImage} * may have data that is stored optimally for the underlying graphics * device and may therefore benefit from platform-specific rendering * acceleration. - * @param width the width of the returned VolatileImage - * @param height the height of the returned VolatileImage - * @return a VolatileImage whose data layout and color - * model is compatible with this GraphicsConfiguration. + * @param width the width of the returned {@code VolatileImage} + * @param height the height of the returned {@code VolatileImage} + * @return a {@code VolatileImage} whose data layout and color + * model is compatible with this {@code GraphicsConfiguration}. * @see Component#createVolatileImage(int, int) * @since 1.4 */ @@ -216,16 +216,16 @@ public abstract class GraphicsConfiguration { /** * Returns a {@link VolatileImage} with a data layout and color model - * compatible with this GraphicsConfiguration. - * The returned VolatileImage + * compatible with this {@code GraphicsConfiguration}. + * The returned {@code VolatileImage} * may have data that is stored optimally for the underlying graphics * device and may therefore benefit from platform-specific rendering * acceleration. - * @param width the width of the returned VolatileImage - * @param height the height of the returned VolatileImage + * @param width the width of the returned {@code VolatileImage} + * @param height the height of the returned {@code VolatileImage} * @param transparency the specified transparency mode - * @return a VolatileImage whose data layout and color - * model is compatible with this GraphicsConfiguration. + * @return a {@code VolatileImage} whose data layout and color + * model is compatible with this {@code GraphicsConfiguration}. * @throws IllegalArgumentException if the transparency is not a valid value * @see Transparency#OPAQUE * @see Transparency#BITMASK @@ -248,20 +248,20 @@ public abstract class GraphicsConfiguration { /** * Returns a {@link VolatileImage} with a data layout and color model - * compatible with this GraphicsConfiguration, using + * compatible with this {@code GraphicsConfiguration}, using * the specified image capabilities. - * If the caps parameter is null, it is effectively ignored + * If the {@code caps} parameter is null, it is effectively ignored * and this method will create a VolatileImage without regard to - * ImageCapabilities constraints. + * {@code ImageCapabilities} constraints. * - * The returned VolatileImage has + * The returned {@code VolatileImage} has * a layout and color model that is closest to this native device * configuration and can therefore be optimally blitted to this * device. - * @return a VolatileImage whose data layout and color - * model is compatible with this GraphicsConfiguration. - * @param width the width of the returned VolatileImage - * @param height the height of the returned VolatileImage + * @return a {@code VolatileImage} whose data layout and color + * model is compatible with this {@code GraphicsConfiguration}. + * @param width the width of the returned {@code VolatileImage} + * @param height the height of the returned {@code VolatileImage} * @param caps the image capabilities * @exception AWTException if the supplied image capabilities could not * be met by this graphics configuration @@ -276,22 +276,22 @@ public abstract class GraphicsConfiguration { /** * Returns a {@link VolatileImage} with a data layout and color model - * compatible with this GraphicsConfiguration, using + * compatible with this {@code GraphicsConfiguration}, using * the specified image capabilities and transparency value. - * If the caps parameter is null, it is effectively ignored + * If the {@code caps} parameter is null, it is effectively ignored * and this method will create a VolatileImage without regard to - * ImageCapabilities constraints. + * {@code ImageCapabilities} constraints. * - * The returned VolatileImage has + * The returned {@code VolatileImage} has * a layout and color model that is closest to this native device * configuration and can therefore be optimally blitted to this * device. - * @param width the width of the returned VolatileImage - * @param height the height of the returned VolatileImage + * @param width the width of the returned {@code VolatileImage} + * @param height the height of the returned {@code VolatileImage} * @param caps the image capabilities * @param transparency the specified transparency mode - * @return a VolatileImage whose data layout and color - * model is compatible with this GraphicsConfiguration. + * @return a {@code VolatileImage} whose data layout and color + * model is compatible with this {@code GraphicsConfiguration}. * @see Transparency#OPAQUE * @see Transparency#BITMASK * @see Transparency#TRANSLUCENT @@ -317,19 +317,19 @@ public abstract class GraphicsConfiguration { /** * Returns the {@link ColorModel} associated with this - * GraphicsConfiguration. - * @return a ColorModel object that is associated with - * this GraphicsConfiguration. + * {@code GraphicsConfiguration}. + * @return a {@code ColorModel} object that is associated with + * this {@code GraphicsConfiguration}. */ public abstract ColorModel getColorModel(); /** - * Returns the ColorModel associated with this - * GraphicsConfiguration that supports the specified + * Returns the {@code ColorModel} associated with this + * {@code GraphicsConfiguration} that supports the specified * transparency. * @param transparency the specified transparency mode - * @return a ColorModel object that is associated with - * this GraphicsConfiguration and supports the + * @return a {@code ColorModel} object that is associated with + * this {@code GraphicsConfiguration} and supports the * specified transparency or null if the transparency is not a valid * value. * @see Transparency#OPAQUE @@ -340,30 +340,30 @@ public abstract class GraphicsConfiguration { /** * Returns the default {@link AffineTransform} for this - * GraphicsConfiguration. This - * AffineTransform is typically the Identity transform - * for most normal screens. The default AffineTransform + * {@code GraphicsConfiguration}. This + * {@code AffineTransform} is typically the Identity transform + * for most normal screens. The default {@code AffineTransform} * maps coordinates onto the device such that 72 user space * coordinate units measure approximately 1 inch in device * space. The normalizing transform can be used to make * this mapping more exact. Coordinates in the coordinate space - * defined by the default AffineTransform for screen and + * defined by the default {@code AffineTransform} for screen and * printer devices have the origin in the upper left-hand corner of * the target region of the device, with X coordinates * increasing to the right and Y coordinates increasing downwards. * For image buffers not associated with a device, such as those not - * created by createCompatibleImage, - * this AffineTransform is the Identity transform. - * @return the default AffineTransform for this - * GraphicsConfiguration. + * created by {@code createCompatibleImage}, + * this {@code AffineTransform} is the Identity transform. + * @return the default {@code AffineTransform} for this + * {@code GraphicsConfiguration}. */ public abstract AffineTransform getDefaultTransform(); /** * - * Returns a AffineTransform that can be concatenated - * with the default AffineTransform - * of a GraphicsConfiguration so that 72 units in user + * Returns a {@code AffineTransform} that can be concatenated + * with the default {@code AffineTransform} + * of a {@code GraphicsConfiguration} so that 72 units in user * space equals 1 inch in device space. *

      * For a particular {@link Graphics2D}, g, one @@ -375,27 +375,27 @@ public abstract class GraphicsConfiguration { * g.setTransform(gc.getDefaultTransform()); * g.transform(gc.getNormalizingTransform()); *

      - * Note that sometimes this AffineTransform is identity, + * Note that sometimes this {@code AffineTransform} is identity, * such as for printers or metafile output, and that this - * AffineTransform is only as accurate as the information + * {@code AffineTransform} is only as accurate as the information * supplied by the underlying system. For image buffers not * associated with a device, such as those not created by - * createCompatibleImage, this - * AffineTransform is the Identity transform + * {@code createCompatibleImage}, this + * {@code AffineTransform} is the Identity transform * since there is no valid distance measurement. - * @return an AffineTransform to concatenate to the - * default AffineTransform so that 72 units in user + * @return an {@code AffineTransform} to concatenate to the + * default {@code AffineTransform} so that 72 units in user * space is mapped to 1 inch in device space. */ public abstract AffineTransform getNormalizingTransform(); /** - * Returns the bounds of the GraphicsConfiguration + * Returns the bounds of the {@code GraphicsConfiguration} * in the device coordinates. In a multi-screen environment * with a virtual device, the bounds can have negative X * or Y origins. * @return the bounds of the area covered by this - * GraphicsConfiguration. + * {@code GraphicsConfiguration}. * @since 1.3 */ public abstract Rectangle getBounds(); @@ -408,7 +408,7 @@ public abstract class GraphicsConfiguration { /** * Returns the buffering capabilities of this - * GraphicsConfiguration. + * {@code GraphicsConfiguration}. * @return the buffering capabilities of this graphics * configuration object * @since 1.4 @@ -423,7 +423,7 @@ public abstract class GraphicsConfiguration { /** * Returns the image capabilities of this - * GraphicsConfiguration. + * {@code GraphicsConfiguration}. * @return the image capabilities of this graphics * configuration object * @since 1.4 diff --git a/jdk/src/java.desktop/share/classes/java/awt/GraphicsDevice.java b/jdk/src/java.desktop/share/classes/java/awt/GraphicsDevice.java index fdc44ca6ab7..b8947148a7e 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/GraphicsDevice.java +++ b/jdk/src/java.desktop/share/classes/java/awt/GraphicsDevice.java @@ -33,19 +33,19 @@ import sun.awt.AppContext; import sun.awt.SunToolkit; /** - * The GraphicsDevice class describes the graphics devices + * The {@code GraphicsDevice} class describes the graphics devices * that might be available in a particular graphics environment. These * include screen and printer devices. Note that there can be many screens * and many printers in an instance of {@link GraphicsEnvironment}. Each * graphics device has one or more {@link GraphicsConfiguration} objects * associated with it. These objects specify the different configurations - * in which the GraphicsDevice can be used. + * in which the {@code GraphicsDevice} can be used. *

      - * In a multi-screen environment, the GraphicsConfiguration + * In a multi-screen environment, the {@code GraphicsConfiguration} * objects can be used to render components on multiple screens. The - * following code sample demonstrates how to create a JFrame - * object for each GraphicsConfiguration on each screen - * device in the GraphicsEnvironment: + * following code sample demonstrates how to create a {@code JFrame} + * object for each {@code GraphicsConfiguration} on each screen + * device in the {@code GraphicsEnvironment}: *

      {@code
        *   GraphicsEnvironment ge = GraphicsEnvironment.
        *   getLocalGraphicsEnvironment();
      @@ -142,8 +142,8 @@ public abstract class GraphicsDevice {
           }
       
           /**
      -     * Returns the type of this GraphicsDevice.
      -     * @return the type of this GraphicsDevice, which can
      +     * Returns the type of this {@code GraphicsDevice}.
      +     * @return the type of this {@code GraphicsDevice}, which can
            * either be TYPE_RASTER_SCREEN, TYPE_PRINTER or TYPE_IMAGE_BUFFER.
            * @see #TYPE_RASTER_SCREEN
            * @see #TYPE_PRINTER
      @@ -153,52 +153,52 @@ public abstract class GraphicsDevice {
       
           /**
            * Returns the identification string associated with this
      -     * GraphicsDevice.
      +     * {@code GraphicsDevice}.
            * 

      * A particular program might use more than one - * GraphicsDevice in a GraphicsEnvironment. - * This method returns a String identifying a - * particular GraphicsDevice in the local - * GraphicsEnvironment. Although there is - * no public method to set this String, a programmer can - * use the String for debugging purposes. Vendors of + * {@code GraphicsDevice} in a {@code GraphicsEnvironment}. + * This method returns a {@code String} identifying a + * particular {@code GraphicsDevice} in the local + * {@code GraphicsEnvironment}. Although there is + * no public method to set this {@code String}, a programmer can + * use the {@code String} for debugging purposes. Vendors of * the Java™ Runtime Environment can - * format the return value of the String. To determine - * how to interpret the value of the String, contact the + * format the return value of the {@code String}. To determine + * how to interpret the value of the {@code String}, contact the * vendor of your Java Runtime. To find out who the vendor is, from * your program, call the * {@link System#getProperty(String) getProperty} method of the * System class with "java.vendor". - * @return a String that is the identification - * of this GraphicsDevice. + * @return a {@code String} that is the identification + * of this {@code GraphicsDevice}. */ public abstract String getIDstring(); /** - * Returns all of the GraphicsConfiguration - * objects associated with this GraphicsDevice. - * @return an array of GraphicsConfiguration + * Returns all of the {@code GraphicsConfiguration} + * objects associated with this {@code GraphicsDevice}. + * @return an array of {@code GraphicsConfiguration} * objects that are associated with this - * GraphicsDevice. + * {@code GraphicsDevice}. */ public abstract GraphicsConfiguration[] getConfigurations(); /** - * Returns the default GraphicsConfiguration - * associated with this GraphicsDevice. - * @return the default GraphicsConfiguration - * of this GraphicsDevice. + * Returns the default {@code GraphicsConfiguration} + * associated with this {@code GraphicsDevice}. + * @return the default {@code GraphicsConfiguration} + * of this {@code GraphicsDevice}. */ public abstract GraphicsConfiguration getDefaultConfiguration(); /** * Returns the "best" configuration possible that passes the * criteria defined in the {@link GraphicsConfigTemplate}. - * @param gct the GraphicsConfigTemplate object - * used to obtain a valid GraphicsConfiguration - * @return a GraphicsConfiguration that passes + * @param gct the {@code GraphicsConfigTemplate} object + * used to obtain a valid {@code GraphicsConfiguration} + * @return a {@code GraphicsConfiguration} that passes * the criteria defined in the specified - * GraphicsConfigTemplate. + * {@code GraphicsConfigTemplate}. * @see GraphicsConfigTemplate */ public GraphicsConfiguration @@ -208,12 +208,12 @@ public abstract class GraphicsDevice { } /** - * Returns true if this GraphicsDevice + * Returns {@code true} if this {@code GraphicsDevice} * supports full-screen exclusive mode. * If a SecurityManager is installed, its - * checkPermission method will be called - * with AWTPermission("fullScreenExclusive"). - * isFullScreenSupported returns true only if + * {@code checkPermission} method will be called + * with {@code AWTPermission("fullScreenExclusive")}. + * {@code isFullScreenSupported} returns true only if * that permission is granted. * @return whether full-screen exclusive mode is available for * this graphics device @@ -227,8 +227,8 @@ public abstract class GraphicsDevice { /** * Enter full-screen mode, or return to windowed mode. The entered * full-screen mode may be either exclusive or simulated. Exclusive - * mode is only available if isFullScreenSupported - * returns true. + * mode is only available if {@code isFullScreenSupported} + * returns {@code true}. *

      * Exclusive mode implies: *

        @@ -239,7 +239,7 @@ public abstract class GraphicsDevice { * will cause the existing full-screen window to * return to windowed mode. *
      • Input method windows are disabled. It is advisable to call - * Component.enableInputMethods(false) to make a component + * {@code Component.enableInputMethods(false)} to make a component * a non-client of the input method framework. *
      *

      @@ -341,10 +341,10 @@ public abstract class GraphicsDevice { } /** - * Returns the Window object representing the + * Returns the {@code Window} object representing the * full-screen window if the device is in full-screen mode. * - * @return the full-screen window, or null if the device is + * @return the full-screen window, or {@code null} if the device is * not in full-screen mode. * @see #setFullScreenWindow(Window) * @since 1.4 @@ -362,7 +362,7 @@ public abstract class GraphicsDevice { } /** - * Returns true if this GraphicsDevice + * Returns {@code true} if this {@code GraphicsDevice} * supports low-level display changes. * On some platforms low-level display changes may only be allowed in * full-screen exclusive mode (i.e., if {@link #isFullScreenSupported()} @@ -420,11 +420,11 @@ public abstract class GraphicsDevice { *

      * * @param dm The new display mode of this graphics device. - * @exception IllegalArgumentException if the DisplayMode - * supplied is null, or is not available in the array returned - * by getDisplayModes + * @exception IllegalArgumentException if the {@code DisplayMode} + * supplied is {@code null}, or is not available in the array returned + * by {@code getDisplayModes} * @exception UnsupportedOperationException if - * isDisplayChangeSupported returns false + * {@code isDisplayChangeSupported} returns {@code false} * @see #getDisplayMode * @see #getDisplayModes * @see #isDisplayChangeSupported @@ -436,7 +436,7 @@ public abstract class GraphicsDevice { /** * Returns the current display mode of this - * GraphicsDevice. + * {@code GraphicsDevice}. * The returned display mode is allowed to have a refresh rate * {@link DisplayMode#REFRESH_RATE_UNKNOWN} if it is indeterminate. * Likewise, the returned display mode is allowed to have a bit depth @@ -455,7 +455,7 @@ public abstract class GraphicsDevice { /** * Returns all display modes available for this - * GraphicsDevice. + * {@code GraphicsDevice}. * The returned display modes are allowed to have a refresh rate * {@link DisplayMode#REFRESH_RATE_UNKNOWN} if it is indeterminate. * Likewise, the returned display modes are allowed to have a bit depth diff --git a/jdk/src/java.desktop/share/classes/java/awt/GraphicsEnvironment.java b/jdk/src/java.desktop/share/classes/java/awt/GraphicsEnvironment.java index af6a7383649..ab2a8467e9a 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/GraphicsEnvironment.java +++ b/jdk/src/java.desktop/share/classes/java/awt/GraphicsEnvironment.java @@ -39,16 +39,16 @@ import sun.security.action.GetPropertyAction; /** * - * The GraphicsEnvironment class describes the collection + * The {@code GraphicsEnvironment} class describes the collection * of {@link GraphicsDevice} objects and {@link java.awt.Font} objects * available to a Java(tm) application on a particular platform. - * The resources in this GraphicsEnvironment might be local - * or on a remote machine. GraphicsDevice objects can be + * The resources in this {@code GraphicsEnvironment} might be local + * or on a remote machine. {@code GraphicsDevice} objects can be * screens, printers or image buffers and are the destination of - * {@link Graphics2D} drawing methods. Each GraphicsDevice + * {@link Graphics2D} drawing methods. Each {@code GraphicsDevice} * has a number of {@link GraphicsConfiguration} objects associated with * it. These objects specify the different configurations in which the - * GraphicsDevice can be used. + * {@code GraphicsDevice} can be used. * @see GraphicsDevice * @see GraphicsConfiguration */ @@ -74,8 +74,8 @@ public abstract class GraphicsEnvironment { } /** - * Returns the local GraphicsEnvironment. - * @return the local GraphicsEnvironment + * Returns the local {@code GraphicsEnvironment}. + * @return the local {@code GraphicsEnvironment} */ public static synchronized GraphicsEnvironment getLocalGraphicsEnvironment() { if (localEnv == null) { @@ -132,8 +132,8 @@ public abstract class GraphicsEnvironment { * a HeadlessException is thrown from areas of the Toolkit * and GraphicsEnvironment that are dependent on a display, * keyboard, or mouse. - * @return true if this environment cannot support - * a display, keyboard, and mouse; false + * @return {@code true} if this environment cannot support + * a display, keyboard, and mouse; {@code false} * otherwise * @see java.awt.HeadlessException * @since 1.4 @@ -209,11 +209,11 @@ public abstract class GraphicsEnvironment { /** * Returns whether or not a display, keyboard, and mouse can be * supported in this graphics environment. If this returns true, - * HeadlessException will be thrown from areas of the + * {@code HeadlessException} will be thrown from areas of the * graphics environment that are dependent on a display, keyboard, or * mouse. - * @return true if a display, keyboard, and mouse - * can be supported in this environment; false + * @return {@code true} if a display, keyboard, and mouse + * can be supported in this environment; {@code false} * otherwise * @see java.awt.HeadlessException * @see #isHeadless @@ -226,9 +226,9 @@ public abstract class GraphicsEnvironment { } /** - * Returns an array of all of the screen GraphicsDevice + * Returns an array of all of the screen {@code GraphicsDevice} * objects. - * @return an array containing all the GraphicsDevice + * @return an array containing all the {@code GraphicsDevice} * objects that represent screen devices * @exception HeadlessException if isHeadless() returns true * @see #isHeadless() @@ -237,8 +237,8 @@ public abstract class GraphicsEnvironment { throws HeadlessException; /** - * Returns the default screen GraphicsDevice. - * @return the GraphicsDevice that represents the + * Returns the default screen {@code GraphicsDevice}. + * @return the {@code GraphicsDevice} that represents the * default screen device * @exception HeadlessException if isHeadless() returns true * @see #isHeadless() @@ -247,35 +247,35 @@ public abstract class GraphicsEnvironment { throws HeadlessException; /** - * Returns a Graphics2D object for rendering into the + * Returns a {@code Graphics2D} object for rendering into the * specified {@link BufferedImage}. - * @param img the specified BufferedImage - * @return a Graphics2D to be used for rendering into - * the specified BufferedImage - * @throws NullPointerException if img is null + * @param img the specified {@code BufferedImage} + * @return a {@code Graphics2D} to be used for rendering into + * the specified {@code BufferedImage} + * @throws NullPointerException if {@code img} is null */ public abstract Graphics2D createGraphics(BufferedImage img); /** * Returns an array containing a one-point size instance of all fonts - * available in this GraphicsEnvironment. Typical usage + * available in this {@code GraphicsEnvironment}. Typical usage * would be to allow a user to select a particular font. Then, the * application can size the font and set various font attributes by - * calling the deriveFont method on the chosen instance. + * calling the {@code deriveFont} method on the chosen instance. *

      * This method provides for the application the most precise control - * over which Font instance is used to render text. - * If a font in this GraphicsEnvironment has multiple + * over which {@code Font} instance is used to render text. + * If a font in this {@code GraphicsEnvironment} has multiple * programmable variations, only one - * instance of that Font is returned in the array, and + * instance of that {@code Font} is returned in the array, and * other variations must be derived by the application. *

      * If a font in this environment has multiple programmable variations, * such as Multiple-Master fonts, only one instance of that font is - * returned in the Font array. The other variations + * returned in the {@code Font} array. The other variations * must be derived by the application. * - * @return an array of Font objects + * @return an array of {@code Font} objects * @see #getAvailableFontFamilyNames * @see java.awt.Font * @see java.awt.Font#deriveFont @@ -286,8 +286,8 @@ public abstract class GraphicsEnvironment { /** * Returns an array containing the names of all font families in this - * GraphicsEnvironment localized for the default locale, - * as returned by Locale.getDefault(). + * {@code GraphicsEnvironment} localized for the default locale, + * as returned by {@code Locale.getDefault()}. *

      * Typical usage would be for presentation to a user for selection of * a particular family name. An application can then specify this name @@ -295,7 +295,7 @@ public abstract class GraphicsEnvironment { * italic, giving the font system flexibility in choosing its own best * match among multiple fonts in the same font family. * - * @return an array of String containing font family names + * @return an array of {@code String} containing font family names * localized for the default locale, or a suitable alternative * name if no name exists for this locale. * @see #getAllFonts @@ -307,7 +307,7 @@ public abstract class GraphicsEnvironment { /** * Returns an array containing the names of all font families in this - * GraphicsEnvironment localized for the specified locale. + * {@code GraphicsEnvironment} localized for the specified locale. *

      * Typical usage would be for presentation to a user for selection of * a particular family name. An application can then specify this name @@ -317,10 +317,10 @@ public abstract class GraphicsEnvironment { * * @param l a {@link Locale} object that represents a * particular geographical, political, or cultural region. - * Specifying null is equivalent to - * specifying Locale.getDefault(). - * @return an array of String containing font family names - * localized for the specified Locale, or a + * Specifying {@code null} is equivalent to + * specifying {@code Locale.getDefault()}. + * @return an array of {@code String} containing font family names + * localized for the specified {@code Locale}, or a * suitable alternative name if no name exists for the specified locale. * @see #getAllFonts * @see java.awt.Font @@ -330,24 +330,24 @@ public abstract class GraphicsEnvironment { public abstract String[] getAvailableFontFamilyNames(Locale l); /** - * Registers a created Fontin this - * GraphicsEnvironment. + * Registers a created {@code Font} in this + * {@code GraphicsEnvironment}. * A created font is one that was returned from calling * {@link Font#createFont}, or derived from a created font by * calling {@link Font#deriveFont}. * After calling this method for such a font, it is available to - * be used in constructing new Fonts by name or family name, + * be used in constructing new {@code Font}s by name or family name, * and is enumerated by {@link #getAvailableFontFamilyNames} and * {@link #getAllFonts} within the execution context of this * application or applet. This means applets cannot register fonts in * a way that they are visible to other applets. *

      * Reasons that this method might not register the font and therefore - * return false are: + * return {@code false} are: *

        - *
      • The font is not a created Font. - *
      • The font conflicts with a non-created Font already - * in this GraphicsEnvironment. For example if the name + *
      • The font is not a created {@code Font}. + *
      • The font conflicts with a non-created {@code Font} already + * in this {@code GraphicsEnvironment}. For example if the name * is that of a system font, or a logical font as described in the * documentation of the {@link Font} class. It is implementation dependent * whether a font may also conflict if it has the same family name @@ -357,9 +357,9 @@ public abstract class GraphicsEnvironment { *
      * * @param font the font to be registered - * @return true if the font is successfully - * registered in this GraphicsEnvironment. - * @throws NullPointerException if font is null + * @return true if the {@code font} is successfully + * registered in this {@code GraphicsEnvironment}. + * @throws NullPointerException if {@code font} is null * @since 1.6 */ public boolean registerFont(Font font) { @@ -444,8 +444,8 @@ public abstract class GraphicsEnvironment { * entire display area. *

      * To get the usable bounds of a single display, use - * GraphicsConfiguration.getBounds() and - * Toolkit.getScreenInsets(). + * {@code GraphicsConfiguration.getBounds()} and + * {@code Toolkit.getScreenInsets()}. * @return the maximum bounds for centered Windows * * @exception HeadlessException if isHeadless() returns true diff --git a/jdk/src/java.desktop/share/classes/java/awt/GridBagConstraints.java b/jdk/src/java.desktop/share/classes/java/awt/GridBagConstraints.java index e676e4c74ad..566c50b67dd 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/GridBagConstraints.java +++ b/jdk/src/java.desktop/share/classes/java/awt/GridBagConstraints.java @@ -25,9 +25,9 @@ package java.awt; /** - * The GridBagConstraints class specifies constraints + * The {@code GridBagConstraints} class specifies constraints * for components that are laid out using the - * GridBagLayout class. + * {@code GridBagLayout} class. * * @author Doug Stein * @author Bill Spitzak (orignial NeWS & OLIT implementation) @@ -38,9 +38,9 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { /** * Specifies that this component is the next-to-last component in its - * column or row (gridwidth, gridheight), + * column or row ({@code gridwidth}, {@code gridheight}), * or that this component be placed next to the previously added - * component (gridx, gridy). + * component ({@code gridx}, {@code gridy}). * @see java.awt.GridBagConstraints#gridwidth * @see java.awt.GridBagConstraints#gridheight * @see java.awt.GridBagConstraints#gridx @@ -194,7 +194,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { public static final int LAST_LINE_END = 26; /** - * Possible value for the anchor field. Specifies + * Possible value for the {@code anchor} field. Specifies * that the component should be horizontally centered and * vertically aligned along the baseline of the prevailing row. * If the component does not have a baseline it will be vertically @@ -205,7 +205,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { public static final int BASELINE = 0x100; /** - * Possible value for the anchor field. Specifies + * Possible value for the {@code anchor} field. Specifies * that the component should be horizontally placed along the * leading edge. For components with a left-to-right orientation, * the leading edge is the left edge. Vertically the component is @@ -218,7 +218,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { public static final int BASELINE_LEADING = 0x200; /** - * Possible value for the anchor field. Specifies + * Possible value for the {@code anchor} field. Specifies * that the component should be horizontally placed along the * trailing edge. For components with a left-to-right * orientation, the trailing edge is the right edge. Vertically @@ -231,7 +231,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { public static final int BASELINE_TRAILING = 0x300; /** - * Possible value for the anchor field. Specifies + * Possible value for the {@code anchor} field. Specifies * that the component should be horizontally centered. Vertically * the component is positioned so that its bottom edge touches * the baseline of the starting row. If the starting row does not @@ -242,7 +242,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { public static final int ABOVE_BASELINE = 0x400; /** - * Possible value for the anchor field. Specifies + * Possible value for the {@code anchor} field. Specifies * that the component should be horizontally placed along the * leading edge. For components with a left-to-right orientation, * the leading edge is the left edge. Vertically the component is @@ -255,7 +255,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { public static final int ABOVE_BASELINE_LEADING = 0x500; /** - * Possible value for the anchor field. Specifies + * Possible value for the {@code anchor} field. Specifies * that the component should be horizontally placed along the * trailing edge. For components with a left-to-right * orientation, the trailing edge is the right edge. Vertically @@ -268,7 +268,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { public static final int ABOVE_BASELINE_TRAILING = 0x600; /** - * Possible value for the anchor field. Specifies + * Possible value for the {@code anchor} field. Specifies * that the component should be horizontally centered. Vertically * the component is positioned so that its top edge touches the * baseline of the starting row. If the starting row does not @@ -279,7 +279,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { public static final int BELOW_BASELINE = 0x700; /** - * Possible value for the anchor field. Specifies + * Possible value for the {@code anchor} field. Specifies * that the component should be horizontally placed along the * leading edge. For components with a left-to-right orientation, * the leading edge is the left edge. Vertically the component is @@ -292,7 +292,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { public static final int BELOW_BASELINE_LEADING = 0x800; /** - * Possible value for the anchor field. Specifies + * Possible value for the {@code anchor} field. Specifies * that the component should be horizontally placed along the * trailing edge. For components with a left-to-right * orientation, the trailing edge is the right edge. Vertically @@ -306,17 +306,17 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { /** * Specifies the cell containing the leading edge of the component's - * display area, where the first cell in a row has gridx=0. + * display area, where the first cell in a row has {@code gridx=0}. * The leading edge of a component's display area is its left edge for * a horizontal, left-to-right container and its right edge for a * horizontal, right-to-left container. * The value - * RELATIVE specifies that the component be placed + * {@code RELATIVE} specifies that the component be placed * immediately following the component that was added to the container * just before this component was added. *

      - * The default value is RELATIVE. - * gridx should be a non-negative value. + * The default value is {@code RELATIVE}. + * {@code gridx} should be a non-negative value. * @serial * @see #clone() * @see java.awt.GridBagConstraints#gridy @@ -326,13 +326,13 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { /** * Specifies the cell at the top of the component's display area, - * where the topmost cell has gridy=0. The value - * RELATIVE specifies that the component be placed just + * where the topmost cell has {@code gridy=0}. The value + * {@code RELATIVE} specifies that the component be placed just * below the component that was added to the container just before * this component was added. *

      - * The default value is RELATIVE. - * gridy should be a non-negative value. + * The default value is {@code RELATIVE}. + * {@code gridy} should be a non-negative value. * @serial * @see #clone() * @see java.awt.GridBagConstraints#gridx @@ -343,14 +343,14 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * Specifies the number of cells in a row for the component's * display area. *

      - * Use REMAINDER to specify that the component's - * display area will be from gridx to the last + * Use {@code REMAINDER} to specify that the component's + * display area will be from {@code gridx} to the last * cell in the row. - * Use RELATIVE to specify that the component's - * display area will be from gridx to the next + * Use {@code RELATIVE} to specify that the component's + * display area will be from {@code gridx} to the next * to the last one in its row. *

      - * gridwidth should be non-negative and the default + * {@code gridwidth} should be non-negative and the default * value is 1. * @serial * @see #clone() @@ -362,14 +362,14 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * Specifies the number of cells in a column for the component's * display area. *

      - * Use REMAINDER to specify that the component's - * display area will be from gridy to the last + * Use {@code REMAINDER} to specify that the component's + * display area will be from {@code gridy} to the last * cell in the column. - * Use RELATIVE to specify that the component's - * display area will be from gridy to the next + * Use {@code RELATIVE} to specify that the component's + * display area will be from {@code gridy} to the next * to the last one in its column. *

      - * gridheight should be a non-negative value and the + * {@code gridheight} should be a non-negative value and the * default value is 1. * @serial * @see #clone() @@ -381,7 +381,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * Specifies how to distribute extra horizontal space. *

      * The grid bag layout manager calculates the weight of a column to - * be the maximum weightx of all the components in a + * be the maximum {@code weightx} of all the components in a * column. If the resulting layout is smaller horizontally than the area * it needs to fill, the extra space is distributed to each column in * proportion to its weight. A column that has a weight of zero receives @@ -390,8 +390,8 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * If all the weights are zero, all the extra space appears between * the grids of the cell and the left and right edges. *

      - * The default value of this field is 0. - * weightx should be a non-negative value. + * The default value of this field is {@code 0}. + * {@code weightx} should be a non-negative value. * @serial * @see #clone() * @see java.awt.GridBagConstraints#weighty @@ -402,7 +402,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * Specifies how to distribute extra vertical space. *

      * The grid bag layout manager calculates the weight of a row to be - * the maximum weighty of all the components in a row. + * the maximum {@code weighty} of all the components in a row. * If the resulting layout is smaller vertically than the area it * needs to fill, the extra space is distributed to each row in * proportion to its weight. A row that has a weight of zero receives no @@ -411,8 +411,8 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * If all the weights are zero, all the extra space appears between * the grids of the cell and the top and bottom edges. *

      - * The default value of this field is 0. - * weighty should be a non-negative value. + * The default value of this field is {@code 0}. + * {@code weighty} should be a non-negative value. * @serial * @see #clone() * @see java.awt.GridBagConstraints#weightx @@ -429,22 +429,22 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * orientation property, baseline relative values are interpreted * relative to the baseline and absolute values are not. The * absolute values are: - * CENTER, NORTH, NORTHEAST, - * EAST, SOUTHEAST, SOUTH, - * SOUTHWEST, WEST, and NORTHWEST. - * The orientation relative values are: PAGE_START, - * PAGE_END, - * LINE_START, LINE_END, - * FIRST_LINE_START, FIRST_LINE_END, - * LAST_LINE_START and LAST_LINE_END. The + * {@code CENTER}, {@code NORTH}, {@code NORTHEAST}, + * {@code EAST}, {@code SOUTHEAST}, {@code SOUTH}, + * {@code SOUTHWEST}, {@code WEST}, and {@code NORTHWEST}. + * The orientation relative values are: {@code PAGE_START}, + * {@code PAGE_END}, + * {@code LINE_START}, {@code LINE_END}, + * {@code FIRST_LINE_START}, {@code FIRST_LINE_END}, + * {@code LAST_LINE_START} and {@code LAST_LINE_END}. The * baseline relative values are: - * BASELINE, BASELINE_LEADING, - * BASELINE_TRAILING, - * ABOVE_BASELINE, ABOVE_BASELINE_LEADING, - * ABOVE_BASELINE_TRAILING, - * BELOW_BASELINE, BELOW_BASELINE_LEADING, - * and BELOW_BASELINE_TRAILING. - * The default value is CENTER. + * {@code BASELINE}, {@code BASELINE_LEADING}, + * {@code BASELINE_TRAILING}, + * {@code ABOVE_BASELINE}, {@code ABOVE_BASELINE_LEADING}, + * {@code ABOVE_BASELINE_TRAILING}, + * {@code BELOW_BASELINE}, {@code BELOW_BASELINE_LEADING}, + * and {@code BELOW_BASELINE_TRAILING}. + * The default value is {@code CENTER}. * @serial * @see #clone() * @see java.awt.ComponentOrientation @@ -456,23 +456,23 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * than the component's requested size. It determines whether to * resize the component, and if so, how. *

      - * The following values are valid for fill: + * The following values are valid for {@code fill}: * *

        *
      • - * NONE: Do not resize the component. + * {@code NONE}: Do not resize the component. *
      • - * HORIZONTAL: Make the component wide enough to fill + * {@code HORIZONTAL}: Make the component wide enough to fill * its display area horizontally, but do not change its height. *
      • - * VERTICAL: Make the component tall enough to fill its + * {@code VERTICAL}: Make the component tall enough to fill its * display area vertically, but do not change its width. *
      • - * BOTH: Make the component fill its display area + * {@code BOTH}: Make the component fill its display area * entirely. *
      *

      - * The default value is NONE. + * The default value is {@code NONE}. * @serial * @see #clone() */ @@ -483,7 +483,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * minimum amount of space between the component and the edges of its * display area. *

      - * The default value is new Insets(0, 0, 0, 0). + * The default value is {@code new Insets(0, 0, 0, 0)}. * @serial * @see #clone() */ @@ -493,9 +493,9 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * This field specifies the internal padding of the component, how much * space to add to the minimum width of the component. The width of * the component is at least its minimum width plus - * ipadx pixels. + * {@code ipadx} pixels. *

      - * The default value is 0. + * The default value is {@code 0}. * @serial * @see #clone() * @see java.awt.GridBagConstraints#ipady @@ -506,7 +506,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * This field specifies the internal padding, that is, how much * space to add to the minimum height of the component. The height of * the component is at least its minimum height plus - * ipady pixels. + * {@code ipady} pixels. *

      * The default value is 0. * @serial @@ -537,14 +537,14 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { int tempHeight; /** * The minimum width of the component. It is used to calculate - * ipady, where the default will be 0. + * {@code ipady}, where the default will be 0. * @serial * @see #ipady */ int minWidth; /** * The minimum height of the component. It is used to calculate - * ipadx, where the default will be 0. + * {@code ipadx}, where the default will be 0. * @serial * @see #ipadx */ @@ -571,7 +571,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { private static final long serialVersionUID = -1000070633030801713L; /** - * Creates a GridBagConstraint object with + * Creates a {@code GridBagConstraint} object with * all of its fields set to their default value. */ public GridBagConstraints () { @@ -591,7 +591,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { } /** - * Creates a GridBagConstraints object with + * Creates a {@code GridBagConstraints} object with * all of its fields set to the passed-in arguments. * * Note: Because the use of this constructor hinders readability diff --git a/jdk/src/java.desktop/share/classes/java/awt/GridBagLayout.java b/jdk/src/java.desktop/share/classes/java/awt/GridBagLayout.java index 7c86dcc1f67..1ecf40840ea 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/GridBagLayout.java +++ b/jdk/src/java.desktop/share/classes/java/awt/GridBagLayout.java @@ -28,18 +28,18 @@ import java.util.Hashtable; import java.util.Arrays; /** - * The GridBagLayout class is a flexible layout + * The {@code GridBagLayout} class is a flexible layout * manager that aligns components vertically, horizontally or along their * baseline without requiring that the components be of the same size. - * Each GridBagLayout object maintains a dynamic, + * Each {@code GridBagLayout} object maintains a dynamic, * rectangular grid of cells, with each component occupying * one or more cells, called its display area. *

      - * Each component managed by a GridBagLayout is associated with + * Each component managed by a {@code GridBagLayout} is associated with * an instance of {@link GridBagConstraints}. The constraints object * specifies where a component's display area should be located on the grid * and how the component should be positioned within its display area. In - * addition to its constraints object, the GridBagLayout also + * addition to its constraints object, the {@code GridBagLayout} also * considers each component's minimum and preferred sizes in order to * determine a component's size. *

      @@ -52,8 +52,8 @@ import java.util.Arrays; * increasing downward. *

      * To use a grid bag layout effectively, you must customize one or more - * of the GridBagConstraints objects that are associated - * with its components. You customize a GridBagConstraints + * of the {@code GridBagConstraints} objects that are associated + * with its components. You customize a {@code GridBagConstraints} * object by setting one or more of its instance variables: * *

      @@ -65,51 +65,51 @@ import java.util.Arrays; * gridy = 0. For horizontal left-to-right layout, * a component's leading corner is its upper left. For horizontal * right-to-left layout, a component's leading corner is its upper right. - * Use GridBagConstraints.RELATIVE (the default value) + * Use {@code GridBagConstraints.RELATIVE} (the default value) * to specify that the component be placed immediately following - * (along the x axis for gridx or the y axis for - * gridy) the component that was added to the container + * (along the x axis for {@code gridx} or the y axis for + * {@code gridy}) the component that was added to the container * just before this component was added. *
      {@link GridBagConstraints#gridwidth}, * {@link GridBagConstraints#gridheight} - *
      Specifies the number of cells in a row (for gridwidth) - * or column (for gridheight) + *
      Specifies the number of cells in a row (for {@code gridwidth}) + * or column (for {@code gridheight}) * in the component's display area. * The default value is 1. - * Use GridBagConstraints.REMAINDER to specify - * that the component's display area will be from gridx - * to the last cell in the row (for gridwidth) - * or from gridy to the last cell in the column - * (for gridheight). + * Use {@code GridBagConstraints.REMAINDER} to specify + * that the component's display area will be from {@code gridx} + * to the last cell in the row (for {@code gridwidth}) + * or from {@code gridy} to the last cell in the column + * (for {@code gridheight}). * - * Use GridBagConstraints.RELATIVE to specify - * that the component's display area will be from gridx - * to the next to the last cell in its row (for gridwidth - * or from gridy to the next to the last cell in its - * column (for gridheight). + * Use {@code GridBagConstraints.RELATIVE} to specify + * that the component's display area will be from {@code gridx} + * to the next to the last cell in its row (for {@code gridwidth} + * or from {@code gridy} to the next to the last cell in its + * column (for {@code gridheight}). * *
      {@link GridBagConstraints#fill} *
      Used when the component's display area * is larger than the component's requested size * to determine whether (and how) to resize the component. * Possible values are - * GridBagConstraints.NONE (the default), - * GridBagConstraints.HORIZONTAL + * {@code GridBagConstraints.NONE} (the default), + * {@code GridBagConstraints.HORIZONTAL} * (make the component wide enough to fill its display area * horizontally, but don't change its height), - * GridBagConstraints.VERTICAL + * {@code GridBagConstraints.VERTICAL} * (make the component tall enough to fill its display area * vertically, but don't change its width), and - * GridBagConstraints.BOTH + * {@code GridBagConstraints.BOTH} * (make the component fill its display area entirely). *
      {@link GridBagConstraints#ipadx}, * {@link GridBagConstraints#ipady} *
      Specifies the component's internal padding within the layout, * how much to add to the minimum size of the component. * The width of the component will be at least its minimum width - * plus ipadx pixels. Similarly, the height of + * plus {@code ipadx} pixels. Similarly, the height of * the component will be at least the minimum height plus - * ipady pixels. + * {@code ipady} pixels. *
      {@link GridBagConstraints#insets} *
      Specifies the component's external padding, the minimum * amount of space between the component and the edges of its display area. @@ -118,7 +118,7 @@ import java.util.Arrays; * There are three kinds of possible values: absolute, orientation-relative, * and baseline-relative * Orientation relative values are interpreted relative to the container's - * ComponentOrientation property while absolute values + * {@code ComponentOrientation} property while absolute values * are not. Baseline relative values are calculated relative to the * baseline. Valid values are: * @@ -132,40 +132,40 @@ import java.util.Arrays; * * *
        - *
      • GridBagConstraints.NORTH
      • - *
      • GridBagConstraints.SOUTH
      • - *
      • GridBagConstraints.WEST
      • - *
      • GridBagConstraints.EAST
      • - *
      • GridBagConstraints.NORTHWEST
      • - *
      • GridBagConstraints.NORTHEAST
      • - *
      • GridBagConstraints.SOUTHWEST
      • - *
      • GridBagConstraints.SOUTHEAST
      • - *
      • GridBagConstraints.CENTER (the default)
      • + *
      • {@code GridBagConstraints.NORTH}
      • + *
      • {@code GridBagConstraints.SOUTH}
      • + *
      • {@code GridBagConstraints.WEST}
      • + *
      • {@code GridBagConstraints.EAST}
      • + *
      • {@code GridBagConstraints.NORTHWEST}
      • + *
      • {@code GridBagConstraints.NORTHEAST}
      • + *
      • {@code GridBagConstraints.SOUTHWEST}
      • + *
      • {@code GridBagConstraints.SOUTHEAST}
      • + *
      • {@code GridBagConstraints.CENTER} (the default)
      • *
      * * *
        - *
      • GridBagConstraints.PAGE_START
      • - *
      • GridBagConstraints.PAGE_END
      • - *
      • GridBagConstraints.LINE_START
      • - *
      • GridBagConstraints.LINE_END
      • - *
      • GridBagConstraints.FIRST_LINE_START
      • - *
      • GridBagConstraints.FIRST_LINE_END
      • - *
      • GridBagConstraints.LAST_LINE_START
      • - *
      • GridBagConstraints.LAST_LINE_END
      • + *
      • {@code GridBagConstraints.PAGE_START}
      • + *
      • {@code GridBagConstraints.PAGE_END}
      • + *
      • {@code GridBagConstraints.LINE_START}
      • + *
      • {@code GridBagConstraints.LINE_END}
      • + *
      • {@code GridBagConstraints.FIRST_LINE_START}
      • + *
      • {@code GridBagConstraints.FIRST_LINE_END}
      • + *
      • {@code GridBagConstraints.LAST_LINE_START}
      • + *
      • {@code GridBagConstraints.LAST_LINE_END}
      • *
      * * *
        - *
      • GridBagConstraints.BASELINE
      • - *
      • GridBagConstraints.BASELINE_LEADING
      • - *
      • GridBagConstraints.BASELINE_TRAILING
      • - *
      • GridBagConstraints.ABOVE_BASELINE
      • - *
      • GridBagConstraints.ABOVE_BASELINE_LEADING
      • - *
      • GridBagConstraints.ABOVE_BASELINE_TRAILING
      • - *
      • GridBagConstraints.BELOW_BASELINE
      • - *
      • GridBagConstraints.BELOW_BASELINE_LEADING
      • - *
      • GridBagConstraints.BELOW_BASELINE_TRAILING
      • + *
      • {@code GridBagConstraints.BASELINE}
      • + *
      • {@code GridBagConstraints.BASELINE_LEADING}
      • + *
      • {@code GridBagConstraints.BASELINE_TRAILING}
      • + *
      • {@code GridBagConstraints.ABOVE_BASELINE}
      • + *
      • {@code GridBagConstraints.ABOVE_BASELINE_LEADING}
      • + *
      • {@code GridBagConstraints.ABOVE_BASELINE_TRAILING}
      • + *
      • {@code GridBagConstraints.BELOW_BASELINE}
      • + *
      • {@code GridBagConstraints.BELOW_BASELINE_LEADING}
      • + *
      • {@code GridBagConstraints.BELOW_BASELINE_TRAILING}
      • *
      * * @@ -175,10 +175,10 @@ import java.util.Arrays; *
      Used to determine how to distribute space, which is * important for specifying resizing behavior. * Unless you specify a weight for at least one component - * in a row (weightx) and column (weighty), + * in a row ({@code weightx}) and column ({@code weighty}), * all the components clump together in the center of their container. * This is because when the weight is zero (the default), - * the GridBagLayout object puts any extra space + * the {@code GridBagLayout} object puts any extra space * between its grid of cells and the edges of the container. *
      *

      @@ -206,12 +206,12 @@ import java.util.Arrays; * * This layout consists of three components: *

      • A panel that starts in row 0 and ends in row 1. The panel - * has a baseline-resize behavior of CONSTANT_DESCENT and has - * an anchor of BASELINE. As the baseline-resize behavior - * is CONSTANT_DESCENT the prevailing row for the panel is + * has a baseline-resize behavior of {@code CONSTANT_DESCENT} and has + * an anchor of {@code BASELINE}. As the baseline-resize behavior + * is {@code CONSTANT_DESCENT} the prevailing row for the panel is * row 1. *
      • Two buttons, each with a baseline-resize behavior of - * CENTER_OFFSET and an anchor of BASELINE. + * {@code CENTER_OFFSET} and an anchor of {@code BASELINE}. *
      * Because the second button and the panel share the same prevailing row, * they are both aligned along their baseline. @@ -221,7 +221,7 @@ import java.util.Arrays; * value. How components change is dictated by how the baseline of the * prevailing row changes. The baseline is anchored to the * bottom of the display area if any components with the same prevailing row - * have a baseline-resize behavior of CONSTANT_DESCENT, + * have a baseline-resize behavior of {@code CONSTANT_DESCENT}, * otherwise the baseline is anchored to the top of the display area. * The following rules dictate the resize behavior: *
        @@ -233,12 +233,12 @@ import java.util.Arrays; * only grow as high as the difference between the display height and the * baseline. *
      • Resizable components positioned on the baseline with a - * baseline-resize behavior of OTHER are only resized if + * baseline-resize behavior of {@code OTHER} are only resized if * the baseline at the resized size fits within the display area. If * the baseline is such that it does not fit within the display area * the component is not resized. *
      • Components positioned on the baseline that do not have a - * baseline-resize behavior of OTHER + * baseline-resize behavior of {@code OTHER} * can only grow as tall as {@code display height - baseline + baseline of component}. *
      * If you position a component along the baseline, but the @@ -266,9 +266,9 @@ import java.util.Arrays; * * *

      - * Each of the ten components has the fill field - * of its associated GridBagConstraints object - * set to GridBagConstraints.BOTH. + * Each of the ten components has the {@code fill} field + * of its associated {@code GridBagConstraints} object + * set to {@code GridBagConstraints.BOTH}. * In addition, the components have the following non-default constraints: * *

        @@ -387,8 +387,8 @@ java.io.Serializable { /** * This hashtable maintains the association between * a component and its gridbag constraints. - * The Keys in comptable are the components and the - * values are the instances of GridBagConstraints. + * The Keys in {@code comptable} are the components and the + * values are the instances of {@code GridBagConstraints}. * * @serial * @see java.awt.GridBagConstraints @@ -400,7 +400,7 @@ java.io.Serializable { * containing the default values, so if a component * does not have gridbag constraints associated with * it, then the component will be assigned a - * copy of the defaultConstraints. + * copy of the {@code defaultConstraints}. * * @serial * @see #getConstraints(Component) @@ -414,7 +414,7 @@ java.io.Serializable { * for the gridbag. The information in this field * is based on the most recent validation of the * gridbag. - * If layoutInfo is null + * If {@code layoutInfo} is {@code null} * this indicates that there are no components in * the gridbag or if there are components, they have * not yet been validated. @@ -426,7 +426,7 @@ java.io.Serializable { /** * This field holds the overrides to the column minimum - * width. If this field is non-null the values are + * width. If this field is non-{@code null} the values are * applied to the gridbag after all of the minimum columns * widths have been calculated. * If columnWidths has more elements than the number of @@ -440,12 +440,12 @@ java.io.Serializable { /** * This field holds the overrides to the row minimum - * heights. If this field is non-null the values are + * heights. If this field is non-{@code null} the values are * applied to the gridbag after all of the minimum row * heights have been calculated. - * If rowHeights has more elements than the number of + * If {@code rowHeights} has more elements than the number of * rows, rows are added to the gridbag to match - * the number of elements in rowHeights. + * the number of elements in {@code rowHeights}. * * @serial * @see #getLayoutDimensions() @@ -454,12 +454,12 @@ java.io.Serializable { /** * This field holds the overrides to the column weights. - * If this field is non-null the values are + * If this field is non-{@code null} the values are * applied to the gridbag after all of the columns * weights have been calculated. - * If columnWeights[i] > weight for column i, then - * column i is assigned the weight in columnWeights[i]. - * If columnWeights has more elements than the number + * If {@code columnWeights[i] >} weight for column i, then + * column i is assigned the weight in {@code columnWeights[i]}. + * If {@code columnWeights} has more elements than the number * of columns, the excess elements are ignored - they do * not cause more columns to be created. * @@ -469,12 +469,12 @@ java.io.Serializable { /** * This field holds the overrides to the row weights. - * If this field is non-null the values are + * If this field is non-{@code null} the values are * applied to the gridbag after all of the rows * weights have been calculated. - * If rowWeights[i] > weight for row i, then - * row i is assigned the weight in rowWeights[i]. - * If rowWeights has more elements than the number + * If {@code rowWeights[i] > } weight for row i, then + * row i is assigned the weight in {@code rowWeights[i]}. + * If {@code rowWeights} has more elements than the number * of rows, the excess elements are ignored - they do * not cause more rows to be created. * @@ -484,7 +484,7 @@ java.io.Serializable { /** * The component being positioned. This is set before calling into - * adjustForGravity. + * {@code adjustForGravity}. */ private Component componentAdjusting; @@ -507,7 +507,7 @@ java.io.Serializable { /** * Gets the constraints for the specified component. A copy of - * the actual GridBagConstraints object is returned. + * the actual {@code GridBagConstraints} object is returned. * @param comp the component to be queried * @return the constraint for the specified component in this * grid bag layout; a copy of the actual constraint @@ -525,12 +525,12 @@ java.io.Serializable { /** * Retrieves the constraints for the specified component. * The return value is not a copy, but is the actual - * GridBagConstraints object used by the layout mechanism. + * {@code GridBagConstraints} object used by the layout mechanism. *

        - * If comp is not in the GridBagLayout, - * a set of default GridBagConstraints are returned. - * A comp value of null is invalid - * and returns null. + * If {@code comp} is not in the {@code GridBagLayout}, + * a set of default {@code GridBagConstraints} are returned. + * A {@code comp} value of {@code null} is invalid + * and returns {@code null}. * * @param comp the component to be queried * @return the constraints for the specified component @@ -556,7 +556,7 @@ java.io.Serializable { * Determines the origin of the layout area, in the graphics coordinate * space of the target container. This value represents the pixel * coordinates of the top-left corner of the layout area regardless of - * the ComponentOrientation value of the container. This + * the {@code ComponentOrientation} value of the container. This * is distinct from the grid origin given by the cell coordinates (0,0). * Most applications do not call this method directly. * @return the graphics origin of the cell in the top-left @@ -631,16 +631,16 @@ java.io.Serializable { *

        * If the (x, y) point lies * outside the grid, the following rules are used. - * The column index is returned as zero if x lies to the + * The column index is returned as zero if {@code x} lies to the * left of the layout for a left-to-right container or to the right of * the layout for a right-to-left container. The column index is returned - * as the number of columns if x lies + * as the number of columns if {@code x} lies * to the right of the layout in a left-to-right container or to the left * in a right-to-left container. - * The row index is returned as zero if y lies above the - * layout, and as the number of rows if y lies + * The row index is returned as zero if {@code y} lies above the + * layout, and as the number of rows if {@code y} lies * below the layout. The orientation of a container is determined by its - * ComponentOrientation property. + * {@code ComponentOrientation} property. * @param x the x coordinate of a point * @param y the y coordinate of a point * @return an ordered pair of indexes that indicate which cell @@ -692,14 +692,14 @@ java.io.Serializable { /** * Adds the specified component to the layout, using the specified - * constraints object. Note that constraints + * {@code constraints} object. Note that constraints * are mutable and are, therefore, cloned when cached. * * @param comp the component to be added * @param constraints an object that determines how * the component is added to the layout - * @exception IllegalArgumentException if constraints - * is not a GridBagConstraint + * @exception IllegalArgumentException if {@code constraints} + * is not a {@code GridBagConstraint} */ public void addLayoutComponent(Component comp, Object constraints) { if (constraints instanceof GridBagConstraints) { @@ -722,14 +722,14 @@ java.io.Serializable { } /** - * Determines the preferred size of the parent + * Determines the preferred size of the {@code parent} * container using this grid bag layout. *

        * Most applications do not call this method directly. * * @param parent the container in which to do the layout * @see java.awt.Container#getPreferredSize - * @return the preferred size of the parent + * @return the preferred size of the {@code parent} * container */ public Dimension preferredLayoutSize(Container parent) { @@ -738,13 +738,13 @@ java.io.Serializable { } /** - * Determines the minimum size of the parent container + * Determines the minimum size of the {@code parent} container * using this grid bag layout. *

        * Most applications do not call this method directly. * @param parent the container in which to do the layout * @see java.awt.Container#doLayout - * @return the minimum size of the parent container + * @return the minimum size of the {@code parent} container */ public Dimension minimumLayoutSize(Container parent) { GridBagLayoutInfo info = getLayoutInfo(parent, MINSIZE); @@ -771,7 +771,7 @@ java.io.Serializable { * where 0 represents alignment along the origin, 1 is aligned * the furthest away from the origin, 0.5 is centered, etc. * - * @return the value 0.5f to indicate centered + * @return the value {@code 0.5f} to indicate centered */ public float getLayoutAlignmentX(Container parent) { return 0.5f; @@ -784,7 +784,7 @@ java.io.Serializable { * where 0 represents alignment along the origin, 1 is aligned * the furthest away from the origin, 0.5 is centered, etc. * - * @return the value 0.5f to indicate centered + * @return the value {@code 0.5f} to indicate centered */ public float getLayoutAlignmentY(Container parent) { return 0.5f; @@ -800,7 +800,7 @@ java.io.Serializable { /** * Lays out the specified container using this grid bag layout. * This method reshapes components in the specified container in - * order to satisfy the constraints of this GridBagLayout + * order to satisfy the constraints of this {@code GridBagLayout} * object. *

        * Most applications do not call this method directly. @@ -890,7 +890,7 @@ java.io.Serializable { */ /** - * Fills in an instance of GridBagLayoutInfo for the + * Fills in an instance of {@code GridBagLayoutInfo} for the * current set of managed children. This requires three passes through the * set of children: * @@ -904,12 +904,12 @@ java.io.Serializable { * first encountered (so subsequent loops don't need to ask again). *

        * This method should only be used internally by - * GridBagLayout. + * {@code GridBagLayout}. * * @param parent the layout container - * @param sizeflag either PREFERREDSIZE or - * MINSIZE - * @return the GridBagLayoutInfo for the set of children + * @param sizeflag either {@code PREFERREDSIZE} or + * {@code MINSIZE} + * @return the {@code GridBagLayoutInfo} for the set of children * @since 1.4 */ protected GridBagLayoutInfo getLayoutInfo(Container parent, int sizeflag) { @@ -1605,10 +1605,10 @@ java.io.Serializable { * Adjusts the x, y, width, and height fields to the correct * values depending on the constraint geometry and pads. * This method should only be used internally by - * GridBagLayout. + * {@code GridBagLayout}. * * @param constraints the constraints to be applied - * @param r the Rectangle to be adjusted + * @param r the {@code Rectangle} to be adjusted * @since 1.4 */ protected void adjustForGravity(GridBagConstraints constraints, @@ -1624,7 +1624,7 @@ java.io.Serializable { * compatibility only; new code should call {@link * #adjustForGravity(java.awt.GridBagConstraints, java.awt.Rectangle) * adjustForGravity} instead. - * This method is the same as adjustForGravity + * This method is the same as {@code adjustForGravity} * * @param constraints the constraints to be applied * @param r the {@code Rectangle} to be adjusted @@ -1987,13 +1987,13 @@ java.io.Serializable { /** * Figures out the minimum size of the - * master based on the information from getLayoutInfo. + * master based on the information from {@code getLayoutInfo}. * This method should only be used internally by - * GridBagLayout. + * {@code GridBagLayout}. * * @param parent the layout container * @param info the layout info for this parent - * @return a Dimension object containing the + * @return a {@code Dimension} object containing the * minimum size * @since 1.4 */ @@ -2005,11 +2005,11 @@ java.io.Serializable { * This method is obsolete and supplied for backwards * compatibility only; new code should call {@link * #getMinSize(java.awt.Container, GridBagLayoutInfo) getMinSize} instead. - * This method is the same as getMinSize + * This method is the same as {@code getMinSize} * * @param parent the layout container * @param info the layout info for this parent - * @return a Dimension object containing the + * @return a {@code Dimension} object containing the * minimum size */ protected Dimension GetMinSize(Container parent, GridBagLayoutInfo info) { @@ -2035,7 +2035,7 @@ java.io.Serializable { /** * Lays out the grid. * This method should only be used internally by - * GridBagLayout. + * {@code GridBagLayout}. * * @param parent the layout container * @since 1.4 @@ -2048,7 +2048,7 @@ java.io.Serializable { * This method is obsolete and supplied for backwards * compatibility only; new code should call {@link * #arrangeGrid(Container) arrangeGrid} instead. - * This method is the same as arrangeGrid + * This method is the same as {@code arrangeGrid} * * @param parent the layout container */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Image.java b/jdk/src/java.desktop/share/classes/java/awt/Image.java index d18e02d5147..b2ab082aa2c 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Image.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Image.java @@ -35,7 +35,7 @@ import sun.awt.image.SurfaceManager; /** - * The abstract class Image is the superclass of all + * The abstract class {@code Image} is the superclass of all * classes that represent graphical images. The image must be * obtained in a platform-specific manner. * @@ -57,17 +57,17 @@ public abstract class Image { * Priority for accelerating this image. Subclasses are free to * set different default priorities and applications are free to * set the priority for specific images via the - * setAccelerationPriority(float) method. + * {@code setAccelerationPriority(float)} method. * @since 1.5 */ protected float accelerationPriority = .5f; /** * Determines the width of the image. If the width is not yet known, - * this method returns -1 and the specified - * ImageObserver object is notified later. + * this method returns {@code -1} and the specified + * {@code ImageObserver} object is notified later. * @param observer an object waiting for the image to be loaded. - * @return the width of this image, or -1 + * @return the width of this image, or {@code -1} * if the width is not yet known. * @see java.awt.Image#getHeight * @see java.awt.image.ImageObserver @@ -76,10 +76,10 @@ public abstract class Image { /** * Determines the height of the image. If the height is not yet known, - * this method returns -1 and the specified - * ImageObserver object is notified later. + * this method returns {@code -1} and the specified + * {@code ImageObserver} object is notified later. * @param observer an object waiting for the image to be loaded. - * @return the height of this image, or -1 + * @return the height of this image, or {@code -1} * if the height is not yet known. * @see java.awt.Image#getWidth * @see java.awt.image.ImageObserver @@ -112,13 +112,13 @@ public abstract class Image { *

        * Individual property names are defined by the various image * formats. If a property is not defined for a particular image, this - * method returns the UndefinedProperty object. + * method returns the {@code UndefinedProperty} object. *

        * If the properties for this image are not yet known, this method - * returns null, and the ImageObserver + * returns {@code null}, and the {@code ImageObserver} * object is notified later. *

        - * The property name "comment" should be used to store + * The property name {@code "comment"} should be used to store * an optional comment which can be presented to the application as a * description of the image, its source, or its author. * @param name a property name. @@ -131,25 +131,25 @@ public abstract class Image { public abstract Object getProperty(String name, ImageObserver observer); /** - * The UndefinedProperty object should be returned whenever a + * The {@code UndefinedProperty} object should be returned whenever a * property which was not defined for a particular image is fetched. */ public static final Object UndefinedProperty = new Object(); /** * Creates a scaled version of this image. - * A new Image object is returned which will render - * the image at the specified width and - * height by default. The new Image object + * A new {@code Image} object is returned which will render + * the image at the specified {@code width} and + * {@code height} by default. The new {@code Image} object * may be loaded asynchronously even if the original source image * has already been loaded completely. * *

        * - * If either width - * or height is a negative number then a value is + * If either {@code width} + * or {@code height} is a negative number then a value is * substituted to maintain the aspect ratio of the original image - * dimensions. If both width and height + * dimensions. If both {@code width} and {@code height} * are negative, then the original image dimensions are used. * * @param width the width to which to scale the image. @@ -157,8 +157,8 @@ public abstract class Image { * @param hints flags to indicate the type of algorithm to use * for image resampling. * @return a scaled version of the image. - * @exception IllegalArgumentException if width - * or height is zero. + * @exception IllegalArgumentException if {@code width} + * or {@code height} is zero. * @see java.awt.Image#SCALE_DEFAULT * @see java.awt.Image#SCALE_FAST * @see java.awt.Image#SCALE_SMOOTH @@ -200,8 +200,8 @@ public abstract class Image { /** * Use the image scaling algorithm embodied in the - * ReplicateScaleFilter class. - * The Image object is free to substitute a different filter + * {@code ReplicateScaleFilter} class. + * The {@code Image} object is free to substitute a different filter * that performs the same algorithm yet integrates more efficiently * into the imaging infrastructure supplied by the toolkit. * @see java.awt.image.ReplicateScaleFilter @@ -274,11 +274,11 @@ public abstract class Image { * size on the given GraphicsConfiguration, so although the object * may be acceleratable in general, it * does not have that capability on this GraphicsConfiguration. - * @param gc a GraphicsConfiguration object. A value of null + * @param gc a {@code GraphicsConfiguration} object. A value of null * for this parameter will result in getting the image capabilities - * for the default GraphicsConfiguration. - * @return an ImageCapabilities object that contains - * the capabilities of this Image on the specified + * for the default {@code GraphicsConfiguration}. + * @return an {@code ImageCapabilities} object that contains + * the capabilities of this {@code Image} on the specified * GraphicsConfiguration. * @see java.awt.image.VolatileImage#getCapabilities() * VolatileImage.getCapabilities() @@ -313,7 +313,7 @@ public abstract class Image { * means that this Image should never be accelerated. Other values * are used simply to determine acceleration priority relative to other * Images. - * @throws IllegalArgumentException if priority is less + * @throws IllegalArgumentException if {@code priority} is less * than zero or greater than 1. * @since 1.5 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/ImageCapabilities.java b/jdk/src/java.desktop/share/classes/java/awt/ImageCapabilities.java index e02ccacfb77..9d21b924ff8 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/ImageCapabilities.java +++ b/jdk/src/java.desktop/share/classes/java/awt/ImageCapabilities.java @@ -43,8 +43,8 @@ public class ImageCapabilities implements Cloneable { } /** - * Returns true if the object whose capabilities are - * encapsulated in this ImageCapabilities can be or is + * Returns {@code true} if the object whose capabilities are + * encapsulated in this {@code ImageCapabilities} can be or is * accelerated. * @return whether or not an image can be, or is, accelerated. There are * various platform-specific ways to accelerate an image, including @@ -56,8 +56,8 @@ public class ImageCapabilities implements Cloneable { } /** - * Returns true if the VolatileImage - * described by this ImageCapabilities can lose + * Returns {@code true} if the {@code VolatileImage} + * described by this {@code ImageCapabilities} can lose * its surfaces. * @return whether or not a volatile image is subject to losing its surfaces * at the whim of the operating system. diff --git a/jdk/src/java.desktop/share/classes/java/awt/Insets.java b/jdk/src/java.desktop/share/classes/java/awt/Insets.java index 66542fcf2a5..edd1473ef39 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Insets.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Insets.java @@ -26,7 +26,7 @@ package java.awt; /** - * An Insets object is a representation of the borders + * An {@code Insets} object is a representation of the borders * of a container. It specifies the space that a container must leave * at each of its edges. The space can be a border, a blank space, or * a title. @@ -93,7 +93,7 @@ public class Insets implements Cloneable, java.io.Serializable { } /** - * Creates and initializes a new Insets object with the + * Creates and initializes a new {@code Insets} object with the * specified top, left, bottom, and right insets. * @param top the inset from the top. * @param left the inset from the left. @@ -125,11 +125,11 @@ public class Insets implements Cloneable, java.io.Serializable { /** * Checks whether two insets objects are equal. Two instances - * of Insets are equal if the four integer values - * of the fields top, left, - * bottom, and right are all equal. - * @return true if the two insets are equal; - * otherwise false. + * of {@code Insets} are equal if the four integer values + * of the fields {@code top}, {@code left}, + * {@code bottom}, and {@code right} are all equal. + * @return {@code true} if the two insets are equal; + * otherwise {@code false}. * @since 1.1 */ public boolean equals(Object obj) { @@ -156,13 +156,13 @@ public class Insets implements Cloneable, java.io.Serializable { } /** - * Returns a string representation of this Insets object. + * Returns a string representation of this {@code Insets} object. * This method is intended to be used only for debugging purposes, and * the content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * - * @return a string representation of this Insets object. + * @return a string representation of this {@code Insets} object. */ public String toString() { return getClass().getName() + "[top=" + top + ",left=" + left + ",bottom=" + bottom + ",right=" + right + "]"; @@ -170,7 +170,7 @@ public class Insets implements Cloneable, java.io.Serializable { /** * Create a copy of this object. - * @return a copy of this Insets object. + * @return a copy of this {@code Insets} object. */ public Object clone() { try { diff --git a/jdk/src/java.desktop/share/classes/java/awt/ItemSelectable.java b/jdk/src/java.desktop/share/classes/java/awt/ItemSelectable.java index e11b70ef48f..2d26112027c 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/ItemSelectable.java +++ b/jdk/src/java.desktop/share/classes/java/awt/ItemSelectable.java @@ -37,7 +37,7 @@ import java.awt.event.*; public interface ItemSelectable { /** - * Returns the selected items or null if no + * Returns the selected items or {@code null} if no * items are selected. * * @return the list of selected objects, or {@code null} @@ -47,8 +47,8 @@ public interface ItemSelectable { /** * Adds a listener to receive item events when the state of an item is * changed by the user. Item events are not sent when an item's - * state is set programmatically. If l is - * null, no exception is thrown and no action is performed. + * state is set programmatically. If {@code l} is + * {@code null}, no exception is thrown and no action is performed. * * @param l the listener to receive events * @see ItemEvent @@ -57,7 +57,7 @@ public interface ItemSelectable { /** * Removes an item listener. - * If l is null, + * If {@code l} is {@code null}, * no exception is thrown and no action is performed. * * @param l the listener being removed diff --git a/jdk/src/java.desktop/share/classes/java/awt/JobAttributes.java b/jdk/src/java.desktop/share/classes/java/awt/JobAttributes.java index bbb94e3bb5c..6281d6e1e5e 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/JobAttributes.java +++ b/jdk/src/java.desktop/share/classes/java/awt/JobAttributes.java @@ -72,19 +72,19 @@ public final class JobAttributes implements Cloneable { }; /** - * The DefaultSelectionType instance to use for + * The {@code DefaultSelectionType} instance to use for * specifying that all pages of the job should be printed. */ public static final DefaultSelectionType ALL = new DefaultSelectionType(I_ALL); /** - * The DefaultSelectionType instance to use for + * The {@code DefaultSelectionType} instance to use for * specifying that a range of pages of the job should be printed. */ public static final DefaultSelectionType RANGE = new DefaultSelectionType(I_RANGE); /** - * The DefaultSelectionType instance to use for + * The {@code DefaultSelectionType} instance to use for * specifying that the current selection should be printed. */ public static final DefaultSelectionType SELECTION = @@ -108,13 +108,13 @@ public final class JobAttributes implements Cloneable { }; /** - * The DestinationType instance to use for + * The {@code DestinationType} instance to use for * specifying print to file. */ public static final DestinationType FILE = new DestinationType(I_FILE); /** - * The DestinationType instance to use for + * The {@code DestinationType} instance to use for * specifying print to printer. */ public static final DestinationType PRINTER = @@ -139,17 +139,17 @@ public final class JobAttributes implements Cloneable { }; /** - * The DialogType instance to use for + * The {@code DialogType} instance to use for * specifying the cross-platform, pure Java print dialog. */ public static final DialogType COMMON = new DialogType(I_COMMON); /** - * The DialogType instance to use for + * The {@code DialogType} instance to use for * specifying the platform's native print dialog. */ public static final DialogType NATIVE = new DialogType(I_NATIVE); /** - * The DialogType instance to use for + * The {@code DialogType} instance to use for * specifying no print dialog. */ public static final DialogType NONE = new DialogType(I_NONE); @@ -176,7 +176,7 @@ public final class JobAttributes implements Cloneable { }; /** - * The MultipleDocumentHandlingType instance to use for specifying + * The {@code MultipleDocumentHandlingType} instance to use for specifying * that the job should be divided into separate, collated copies. */ public static final MultipleDocumentHandlingType @@ -184,7 +184,7 @@ public final class JobAttributes implements Cloneable { new MultipleDocumentHandlingType( I_SEPARATE_DOCUMENTS_COLLATED_COPIES); /** - * The MultipleDocumentHandlingType instance to use for specifying + * The {@code MultipleDocumentHandlingType} instance to use for specifying * that the job should be divided into separate, uncollated copies. */ public static final MultipleDocumentHandlingType @@ -212,13 +212,13 @@ public final class JobAttributes implements Cloneable { }; /** - * The SidesType instance to use for specifying that + * The {@code SidesType} instance to use for specifying that * consecutive job pages should be printed upon the same side of * consecutive media sheets. */ public static final SidesType ONE_SIDED = new SidesType(I_ONE_SIDED); /** - * The SidesType instance to use for specifying that + * The {@code SidesType} instance to use for specifying that * consecutive job pages should be printed upon front and back sides * of consecutive media sheets, such that the orientation of each pair * of pages on the medium would be correct for the reader as if for @@ -227,7 +227,7 @@ public final class JobAttributes implements Cloneable { public static final SidesType TWO_SIDED_LONG_EDGE = new SidesType(I_TWO_SIDED_LONG_EDGE); /** - * The SidesType instance to use for specifying that + * The {@code SidesType} instance to use for specifying that * consecutive job pages should be printed upon front and back sides * of consecutive media sheets, such that the orientation of each pair * of pages on the medium would be correct for the reader as if for @@ -258,16 +258,16 @@ public final class JobAttributes implements Cloneable { private int toPage; /** - * Constructs a JobAttributes instance with default + * Constructs a {@code JobAttributes} instance with default * values for every attribute. The dialog defaults to - * DialogType.NATIVE. Min page defaults to - * 1. Max page defaults to Integer.MAX_VALUE. - * Destination defaults to DestinationType.PRINTER. - * Selection defaults to DefaultSelectionType.ALL. - * Number of copies defaults to 1. Multiple document handling defaults - * to MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES. - * Sides defaults to SidesType.ONE_SIDED. File name defaults - * to null. + * {@code DialogType.NATIVE}. Min page defaults to + * {@code 1}. Max page defaults to {@code Integer.MAX_VALUE}. + * Destination defaults to {@code DestinationType.PRINTER}. + * Selection defaults to {@code DefaultSelectionType.ALL}. + * Number of copies defaults to {@code 1}. Multiple document handling defaults + * to {@code MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES}. + * Sides defaults to {@code SidesType.ONE_SIDED}. File name defaults + * to {@code null}. */ public JobAttributes() { setCopiesToDefault(); @@ -281,36 +281,36 @@ public final class JobAttributes implements Cloneable { } /** - * Constructs a JobAttributes instance which is a copy - * of the supplied JobAttributes. + * Constructs a {@code JobAttributes} instance which is a copy + * of the supplied {@code JobAttributes}. * - * @param obj the JobAttributes to copy + * @param obj the {@code JobAttributes} to copy */ public JobAttributes(JobAttributes obj) { set(obj); } /** - * Constructs a JobAttributes instance with the + * Constructs a {@code JobAttributes} instance with the * specified values for every attribute. * * @param copies an integer greater than 0 - * @param defaultSelection DefaultSelectionType.ALL, - * DefaultSelectionType.RANGE, or - * DefaultSelectionType.SELECTION - * @param destination DestinationType.FILE or - * DestinationType.PRINTER - * @param dialog DialogType.COMMON, - * DialogType.NATIVE, or - * DialogType.NONE - * @param fileName the possibly null file name + * @param defaultSelection {@code DefaultSelectionType.ALL}, + * {@code DefaultSelectionType.RANGE}, or + * {@code DefaultSelectionType.SELECTION} + * @param destination {@code DestinationType.FILE} or + * {@code DestinationType.PRINTER} + * @param dialog {@code DialogType.COMMON}, + * {@code DialogType.NATIVE}, or + * {@code DialogType.NONE} + * @param fileName the possibly {@code null} file name * @param maxPage an integer greater than zero and greater than or equal * to minPage * @param minPage an integer greater than zero and less than or equal * to maxPage * @param multipleDocumentHandling - * MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES or - * MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES + * {@code MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES} or + * {@code MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES} * @param pageRanges an array of integer arrays of two elements; an array * is interpreted as a range spanning all pages including and * between the specified pages; ranges must be in ascending @@ -322,13 +322,13 @@ public final class JobAttributes implements Cloneable { * new int[] { 15, 19 } }), *

      * specifies pages 1, 2, 3, 5, 15, 16, 17, 18, and 19. Note that - * (new int[][] { new int[] { 1, 1 }, new int[] { 1, 2 } }), + * ({@code new int[][] { new int[] { 1, 1 }, new int[] { 1, 2 } }}), * is an invalid set of page ranges because the two ranges * overlap - * @param printer the possibly null printer name - * @param sides SidesType.ONE_SIDED, - * SidesType.TWO_SIDED_LONG_EDGE, or - * SidesType.TWO_SIDED_SHORT_EDGE + * @param printer the possibly {@code null} printer name + * @param sides {@code SidesType.ONE_SIDED}, + * {@code SidesType.TWO_SIDED_LONG_EDGE}, or + * {@code SidesType.TWO_SIDED_SHORT_EDGE} * @throws IllegalArgumentException if one or more of the above * conditions is violated */ @@ -351,10 +351,10 @@ public final class JobAttributes implements Cloneable { } /** - * Creates and returns a copy of this JobAttributes. + * Creates and returns a copy of this {@code JobAttributes}. * * @return the newly created copy; it is safe to cast this Object into - * a JobAttributes + * a {@code JobAttributes} */ public Object clone() { try { @@ -366,10 +366,10 @@ public final class JobAttributes implements Cloneable { } /** - * Sets all of the attributes of this JobAttributes to + * Sets all of the attributes of this {@code JobAttributes} to * the same values as the attributes of obj. * - * @param obj the JobAttributes to copy + * @param obj the {@code JobAttributes} to copy */ public void set(JobAttributes obj) { copies = obj.copies; @@ -404,10 +404,10 @@ public final class JobAttributes implements Cloneable { /** * Specifies the number of copies the application should render for jobs * using these attributes. Not specifying this attribute is equivalent to - * specifying 1. + * specifying {@code 1}. * * @param copies an integer greater than 0 - * @throws IllegalArgumentException if copies is less than + * @throws IllegalArgumentException if {@code copies} is less than * or equal to 0 */ public void setCopies(int copies) { @@ -429,7 +429,7 @@ public final class JobAttributes implements Cloneable { /** * Specifies whether, for jobs using these attributes, the application * should print all pages, the range specified by the return value of - * getPageRanges, or the current selection. This attribute + * {@code getPageRanges}, or the current selection. This attribute * is updated to the value chosen by the user. * * @return DefaultSelectionType.ALL, DefaultSelectionType.RANGE, or @@ -442,12 +442,12 @@ public final class JobAttributes implements Cloneable { /** * Specifies whether, for jobs using these attributes, the application * should print all pages, the range specified by the return value of - * getPageRanges, or the current selection. Not specifying + * {@code getPageRanges}, or the current selection. Not specifying * this attribute is equivalent to specifying DefaultSelectionType.ALL. * * @param defaultSelection DefaultSelectionType.ALL, * DefaultSelectionType.RANGE, or DefaultSelectionType.SELECTION. - * @throws IllegalArgumentException if defaultSelection is null + * @throws IllegalArgumentException if defaultSelection is {@code null} */ public void setDefaultSelection(DefaultSelectionType defaultSelection) { if (defaultSelection == null) { @@ -495,8 +495,8 @@ public final class JobAttributes implements Cloneable { * This attribute cannot be modified by, and is not subject to any * limitations of, the implementation or the target printer. * - * @return DialogType.COMMON, DialogType.NATIVE, or - * DialogType.NONE + * @return {@code DialogType.COMMON}, {@code DialogType.NATIVE}, or + * {@code DialogType.NONE} */ public DialogType getDialog() { return dialog; @@ -529,7 +529,7 @@ public final class JobAttributes implements Cloneable { * Specifies the file name for the output file for jobs using these * attributes. This attribute is updated to the value chosen by the user. * - * @return the possibly null file name + * @return the possibly {@code null} file name */ public String getFileName() { return fileName; @@ -549,9 +549,9 @@ public final class JobAttributes implements Cloneable { * Returns, for jobs using these attributes, the first page to be * printed, if a range of pages is to be printed. This attribute is * updated to the value chosen by the user. An application should ignore - * this attribute on output, unless the return value of the - * getDefaultSelection method is DefaultSelectionType.RANGE. An - * application should honor the return value of getPageRanges + * this attribute on output, unless the return value of the + * {@code getDefaultSelection} method is DefaultSelectionType.RANGE. An + * application should honor the return value of {@code getPageRanges} * over the return value of this method, if possible. * * @return an integer greater than zero and less than or equal to @@ -612,7 +612,7 @@ public final class JobAttributes implements Cloneable { /** * Specifies the maximum value the user can specify as the last page to * be printed for jobs using these attributes. Not specifying this - * attribute is equivalent to specifying Integer.MAX_VALUE. + * attribute is equivalent to specifying {@code Integer.MAX_VALUE}. * * @param maxPage an integer greater than zero and greater than or equal * to minPage @@ -643,7 +643,7 @@ public final class JobAttributes implements Cloneable { /** * Specifies the minimum value the user can specify as the first page to * be printed for jobs using these attributes. Not specifying this - * attribute is equivalent to specifying 1. + * attribute is equivalent to specifying {@code 1}. * * @param minPage an integer greater than zero and less than or equal * to maxPage. @@ -706,7 +706,7 @@ public final class JobAttributes implements Cloneable { * printed, if a range of pages is to be printed. All range numbers are * inclusive. This attribute is updated to the value chosen by the user. * An application should ignore this attribute on output, unless the - * return value of the getDefaultSelection method is + * return value of the {@code getDefaultSelection} method is * DefaultSelectionType.RANGE. * * @return an array of integer arrays of 2 elements. An array @@ -888,9 +888,9 @@ public final class JobAttributes implements Cloneable { * Returns, for jobs using these attributes, the last page (inclusive) * to be printed, if a range of pages is to be printed. This attribute is * updated to the value chosen by the user. An application should ignore - * this attribute on output, unless the return value of the - * getDefaultSelection method is DefaultSelectionType.RANGE. An - * application should honor the return value of getPageRanges + * this attribute on output, unless the return value of the + * {@code getDefaultSelection} method is DefaultSelectionType.RANGE. An + * application should honor the return value of {@code getPageRanges} * over the return value of this method, if possible. * * @return an integer greater than zero and greater than or equal diff --git a/jdk/src/java.desktop/share/classes/java/awt/KeyEventDispatcher.java b/jdk/src/java.desktop/share/classes/java/awt/KeyEventDispatcher.java index 9970ac586e3..36ef562f3de 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/KeyEventDispatcher.java +++ b/jdk/src/java.desktop/share/classes/java/awt/KeyEventDispatcher.java @@ -62,28 +62,28 @@ public interface KeyEventDispatcher { * used to deliver KeyEvents to Components other than the focus owner. This * can be useful when navigating children of non-focusable Windows in an * accessible environment, for example. Note that if a KeyEventDispatcher - * dispatches the KeyEvent itself, it must use redispatchEvent + * dispatches the KeyEvent itself, it must use {@code redispatchEvent} * to prevent the current KeyboardFocusManager from recursively requesting * that this KeyEventDispatcher dispatch the event again. *

      - * If an implementation of this method returns false, then + * If an implementation of this method returns {@code false}, then * the KeyEvent is passed to the next KeyEventDispatcher in the chain, * ending with the current KeyboardFocusManager. If an implementation - * returns true, the KeyEvent is assumed to have been + * returns {@code true}, the KeyEvent is assumed to have been * dispatched (although this need not be the case), and the current * KeyboardFocusManager will take no further action with regard to the * KeyEvent. In such a case, - * KeyboardFocusManager.dispatchEvent should return - * true as well. If an implementation consumes the KeyEvent, - * but returns false, the consumed event will still be passed + * {@code KeyboardFocusManager.dispatchEvent} should return + * {@code true} as well. If an implementation consumes the KeyEvent, + * but returns {@code false}, the consumed event will still be passed * to the next KeyEventDispatcher in the chain. It is important for * developers to check whether the KeyEvent has been consumed before * dispatching it to a target. By default, the current KeyboardFocusManager * will not dispatch a consumed KeyEvent. * * @param e the KeyEvent to dispatch - * @return true if the KeyboardFocusManager should take no - * further action with regard to the KeyEvent; false + * @return {@code true} if the KeyboardFocusManager should take no + * further action with regard to the KeyEvent; {@code false} * otherwise * @see KeyboardFocusManager#redispatchEvent */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/KeyEventPostProcessor.java b/jdk/src/java.desktop/share/classes/java/awt/KeyEventPostProcessor.java index 5a36b9536b1..15f6cb9dddc 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/KeyEventPostProcessor.java +++ b/jdk/src/java.desktop/share/classes/java/awt/KeyEventPostProcessor.java @@ -68,17 +68,17 @@ public interface KeyEventPostProcessor { * will be used to implement features which require global KeyEvent * post-handling, such as menu shortcuts. Note that if a * KeyEventPostProcessor wishes to dispatch the KeyEvent, it must use - * redispatchEvent to prevent the AWT from recursively + * {@code redispatchEvent} to prevent the AWT from recursively * requesting that this KeyEventPostProcessor perform post-processing * of the event again. *

      - * If an implementation of this method returns false, then the + * If an implementation of this method returns {@code false}, then the * KeyEvent is passed to the next KeyEventPostProcessor in the chain, * ending with the current KeyboardFocusManager. If an implementation - * returns true, the KeyEvent is assumed to have been fully + * returns {@code true}, the KeyEvent is assumed to have been fully * handled (although this need not be the case), and the AWT will take no * further action with regard to the KeyEvent. If an implementation - * consumes the KeyEvent but returns false, the consumed + * consumes the KeyEvent but returns {@code false}, the consumed * event will still be passed to the next KeyEventPostProcessor in the * chain. It is important for developers to check whether the KeyEvent has * been consumed before performing any post-processing of the KeyEvent. By @@ -86,8 +86,8 @@ public interface KeyEventPostProcessor { * processing in response to a consumed KeyEvent. * * @param e the KeyEvent to post-process - * @return true if the AWT should take no further action with - * regard to the KeyEvent; false otherwise + * @return {@code true} if the AWT should take no further action with + * regard to the KeyEvent; {@code false} otherwise * @see KeyboardFocusManager#redispatchEvent */ boolean postProcessKeyEvent(KeyEvent e); diff --git a/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java b/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java index d4d4a92e88c..6b7d779a7db 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java +++ b/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java @@ -356,7 +356,7 @@ public abstract class KeyboardFocusManager /** * This KeyboardFocusManager's KeyEventDispatcher chain. The List does not * include this KeyboardFocusManager unless it was explicitly re-registered - * via a call to addKeyEventDispatcher. If no other + * via a call to {@code addKeyEventDispatcher}. If no other * KeyEventDispatchers are registered, this field may be null or refer to * a List of length 0. */ @@ -365,7 +365,7 @@ public abstract class KeyboardFocusManager /** * This KeyboardFocusManager's KeyEventPostProcessor chain. The List does * not include this KeyboardFocusManager unless it was explicitly - * re-registered via a call to addKeyEventPostProcessor. + * re-registered via a call to {@code addKeyEventPostProcessor}. * If no other KeyEventPostProcessors are registered, this field may be * null or refer to a List of length 0. */ @@ -518,8 +518,8 @@ public abstract class KeyboardFocusManager *

      * This method does not actually set the focus to the specified Component. * It merely stores the value to be subsequently returned by - * getFocusOwner(). Use Component.requestFocus() - * or Component.requestFocusInWindow() to change the focus + * {@code getFocusOwner()}. Use {@code Component.requestFocus()} + * or {@code Component.requestFocusInWindow()} to change the focus * owner, subject to platform limitations. * * @param focusOwner the focus owner @@ -607,7 +607,7 @@ public abstract class KeyboardFocusManager * FOCUS_LOST event. After this operation completes, the native windowing * system will discard all user-generated KeyEvents until the user selects * a new Component to receive focus, or a Component is given focus - * explicitly via a call to requestFocus(). This operation + * explicitly via a call to {@code requestFocus()}. This operation * does not change the focused or active Windows. *

      * If a SecurityManager is installed, the calling thread must be granted @@ -731,9 +731,9 @@ public abstract class KeyboardFocusManager *

      * This method does not actually set the focus to the specified Component. * It merely stores the value to be subsequently returned by - * getPermanentFocusOwner(). Use - * Component.requestFocus() or - * Component.requestFocusInWindow() to change the focus owner, + * {@code getPermanentFocusOwner()}. Use + * {@code Component.requestFocus()} or + * {@code Component.requestFocusInWindow()} to change the focus owner, * subject to platform limitations. * * @param permanentFocusOwner the permanent focus owner @@ -832,9 +832,9 @@ public abstract class KeyboardFocusManager *

      * This method does not actually change the focused Window as far as the * native windowing system is concerned. It merely stores the value to be - * subsequently returned by getFocusedWindow(). Use - * Component.requestFocus() or - * Component.requestFocusInWindow() to change the focused + * subsequently returned by {@code getFocusedWindow()}. Use + * {@code Component.requestFocus()} or + * {@code Component.requestFocusInWindow()} to change the focused * Window, subject to platform limitations. * * @param focusedWindow the focused Window @@ -936,9 +936,9 @@ public abstract class KeyboardFocusManager *

      * This method does not actually change the active Window as far as the * native windowing system is concerned. It merely stores the value to be - * subsequently returned by getActiveWindow(). Use - * Component.requestFocus() or - * Component.requestFocusInWindow()to change the active + * subsequently returned by {@code getActiveWindow()}. Use + * {@code Component.requestFocus()} or + * {@code Component.requestFocusInWindow()} to change the active * Window, subject to platform limitations. * * @param activeWindow the active Window @@ -1160,16 +1160,16 @@ public abstract class KeyboardFocusManager * have no such Set of their own explicitly defined. This Set will also be * inherited, recursively, by any child Component of those Windows that has * no such Set of its own explicitly defined. (See - * setDefaultFocusTraversalKeys for a full description of each + * {@code setDefaultFocusTraversalKeys} for a full description of each * operation.) * * @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or * KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS - * @return the Set of AWTKeyStrokes - * for the specified operation; the Set - * will be unmodifiable, and may be empty; null + * @return the {@code Set} of {@code AWTKeyStroke}s + * for the specified operation; the {@code Set} + * will be unmodifiable, and may be empty; {@code null} * will never be returned * @see #setDefaultFocusTraversalKeys * @see Component#setFocusTraversalKeys @@ -1359,7 +1359,7 @@ public abstract class KeyboardFocusManager * registered on this keyboard focus manager. * * @return all of this keyboard focus manager's - * PropertyChangeListeners + * {@code PropertyChangeListener}s * or an empty array if no property change * listeners are currently registered * @@ -1446,11 +1446,11 @@ public abstract class KeyboardFocusManager } /** - * Returns an array of all the PropertyChangeListeners + * Returns an array of all the {@code PropertyChangeListener}s * associated with the named property. * * @param propertyName the property name - * @return all of the PropertyChangeListeners associated with + * @return all of the {@code PropertyChangeListener}s associated with * the named property or an empty array if no such listeners have * been added. * @@ -1542,7 +1542,7 @@ public abstract class KeyboardFocusManager * registered on this keyboard focus manager. * * @return all of this keyboard focus manager's - * VetoableChangeListeners + * {@code VetoableChangeListener}s * or an empty array if no vetoable change * listeners are currently registered * @@ -1616,11 +1616,11 @@ public abstract class KeyboardFocusManager } /** - * Returns an array of all the VetoableChangeListeners + * Returns an array of all the {@code VetoableChangeListener}s * associated with the named property. * * @param propertyName the property name - * @return all of the VetoableChangeListeners associated with + * @return all of the {@code VetoableChangeListener}s associated with * the named property or an empty array if no such listeners have * been added. * @@ -1649,8 +1649,8 @@ public abstract class KeyboardFocusManager * @param oldValue the property's previous value * @param newValue the property's new value * @throws java.beans.PropertyVetoException if a - * VetoableChangeListener threw - * PropertyVetoException + * {@code VetoableChangeListener} threw + * {@code PropertyVetoException} */ protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue) @@ -1673,8 +1673,8 @@ public abstract class KeyboardFocusManager * KeyEventDispatcher dispatch KeyEvents generated by the user before * finally dispatching the KeyEvent itself. KeyEventDispatchers will be * notified in the order in which they were added. Notifications will halt - * as soon as one KeyEventDispatcher returns true from its - * dispatchKeyEvent method. There is no limit to the total + * as soon as one KeyEventDispatcher returns {@code true} from its + * {@code dispatchKeyEvent} method. There is no limit to the total * number of KeyEventDispatchers which can be added, nor to the number of * times which a particular KeyEventDispatcher instance can be added. *

      @@ -1704,7 +1704,7 @@ public abstract class KeyboardFocusManager * Removes a KeyEventDispatcher which was previously added to this * KeyboardFocusManager's dispatcher chain. This KeyboardFocusManager * cannot itself be removed, unless it was explicitly re-registered via a - * call to addKeyEventDispatcher. + * call to {@code addKeyEventDispatcher}. *

      * If a null dispatcher is specified, if the specified dispatcher is not * in the dispatcher chain, or if this KeyboardFocusManager is specified @@ -1734,7 +1734,7 @@ public abstract class KeyboardFocusManager * Returns this KeyboardFocusManager's KeyEventDispatcher chain as a List. * The List will not include this KeyboardFocusManager unless it was * explicitly re-registered via a call to - * addKeyEventDispatcher. If no other KeyEventDispatchers are + * {@code addKeyEventDispatcher}. If no other KeyEventDispatchers are * registered, implementations are free to return null or a List of length * 0. Client code should not assume one behavior over another, nor should * it assume that the behavior, once established, will not change. @@ -1760,8 +1760,8 @@ public abstract class KeyboardFocusManager * of the KeyEvent's final resolution. KeyEventPostProcessors * will be notified in the order in which they were added; the current * KeyboardFocusManager will be notified last. Notifications will halt - * as soon as one KeyEventPostProcessor returns true from its - * postProcessKeyEvent method. There is no limit to the + * as soon as one KeyEventPostProcessor returns {@code true} from its + * {@code postProcessKeyEvent} method. There is no limit to the * total number of KeyEventPostProcessors that can be added, nor to the * number of times that a particular KeyEventPostProcessor instance can be * added. @@ -1794,7 +1794,7 @@ public abstract class KeyboardFocusManager * Removes a previously added KeyEventPostProcessor from this * KeyboardFocusManager's post-processor chain. This KeyboardFocusManager * cannot itself be entirely removed from the chain. Only additional - * references added via addKeyEventPostProcessor can be + * references added via {@code addKeyEventPostProcessor} can be * removed. *

      * If a null post-processor is specified, if the specified post-processor @@ -1825,7 +1825,7 @@ public abstract class KeyboardFocusManager /** * Returns this KeyboardFocusManager's KeyEventPostProcessor chain as a * List. The List will not include this KeyboardFocusManager unless it was - * explicitly added via a call to addKeyEventPostProcessor. If + * explicitly added via a call to {@code addKeyEventPostProcessor}. If * no KeyEventPostProcessors are registered, implementations are free to * return null or a List of length 0. Client code should not assume one * behavior over another, nor should it assume that the behavior, once @@ -1914,14 +1914,14 @@ public abstract class KeyboardFocusManager * These events should be dispatched based on the KeyboardFocusManager's * notion of the focus owner and the focused and active Windows, sometimes * overriding the source of the specified AWTEvent. Dispatching must be - * done using redispatchEvent to prevent the AWT event + * done using {@code redispatchEvent} to prevent the AWT event * dispatcher from recursively requesting that the KeyboardFocusManager - * dispatch the event again. If this method returns false, + * dispatch the event again. If this method returns {@code false}, * then the AWT event dispatcher will attempt to dispatch the event itself. * * @param e the AWTEvent to be dispatched - * @return true if this method dispatched the event; - * false otherwise + * @return {@code true} if this method dispatched the event; + * {@code false} otherwise * @see #redispatchEvent * @see #dispatchKeyEvent */ @@ -1931,9 +1931,9 @@ public abstract class KeyboardFocusManager * Redispatches an AWTEvent in such a way that the AWT event dispatcher * will not recursively request that the KeyboardFocusManager, or any * installed KeyEventDispatchers, dispatch the event again. Client - * implementations of dispatchEvent and client-defined - * KeyEventDispatchers must call redispatchEvent(target, e) - * instead of target.dispatchEvent(e) to dispatch an event. + * implementations of {@code dispatchEvent} and client-defined + * KeyEventDispatchers must call {@code redispatchEvent(target, e)} + * instead of {@code target.dispatchEvent(e)} to dispatch an event. *

      * This method is intended to be used only by KeyboardFocusManagers and * KeyEventDispatchers. It is not for general client use. @@ -1950,30 +1950,30 @@ public abstract class KeyboardFocusManager } /** - * Typically this method will be called by dispatchEvent if no + * Typically this method will be called by {@code dispatchEvent} if no * other KeyEventDispatcher in the dispatcher chain dispatched the * KeyEvent, or if no other KeyEventDispatchers are registered. If an - * implementation of this method returns false, - * dispatchEvent may try to dispatch the KeyEvent itself, or - * may simply return false. If true is returned, - * dispatchEvent should return true as well. + * implementation of this method returns {@code false}, + * {@code dispatchEvent} may try to dispatch the KeyEvent itself, or + * may simply return {@code false}. If {@code true} is returned, + * {@code dispatchEvent} should return {@code true} as well. * * @param e the KeyEvent which the current KeyboardFocusManager has * requested that this KeyEventDispatcher dispatch - * @return true if the KeyEvent was dispatched; - * false otherwise + * @return {@code true} if the KeyEvent was dispatched; + * {@code false} otherwise * @see #dispatchEvent */ public abstract boolean dispatchKeyEvent(KeyEvent e); /** - * This method will be called by dispatchKeyEvent. + * This method will be called by {@code dispatchKeyEvent}. * By default, this method will handle any unconsumed KeyEvents that - * map to an AWT MenuShortcut by consuming the event + * map to an AWT {@code MenuShortcut} by consuming the event * and activating the shortcut. * * @param e the KeyEvent to post-process - * @return true to indicate that no other + * @return {@code true} to indicate that no other * KeyEventPostProcessor will be notified of the KeyEvent. * @see #dispatchKeyEvent * @see MenuShortcut @@ -2005,8 +2005,8 @@ public abstract class KeyboardFocusManager * the KeyboardFocusManager to delay dispatching of KeyEvents with * timestamps later than the specified time stamp until the specified * Component receives a FOCUS_GAINED event, or the AWT cancels the delay - * request by invoking dequeueKeyEvents or - * discardKeyEvents. + * request by invoking {@code dequeueKeyEvents} or + * {@code discardKeyEvents}. * * @param after timestamp of current event, or the current, system time if * the current event has no timestamp, or the AWT cannot determine @@ -2022,16 +2022,16 @@ public abstract class KeyboardFocusManager /** * Called by the AWT to notify the KeyboardFocusManager that it should * cancel delayed dispatching of KeyEvents. All KeyEvents which were - * enqueued because of a call to enqueueKeyEvents with the + * enqueued because of a call to {@code enqueueKeyEvents} with the * same timestamp and Component should be released for normal dispatching * to the current focus owner. If the given timestamp is less than zero, * the outstanding enqueue request for the given Component with the * oldest timestamp (if any) should be cancelled. * * @param after the timestamp specified in the call to - * enqueueKeyEvents, or any value < 0 + * {@code enqueueKeyEvents}, or any value < 0 * @param untilFocused the Component specified in the call to - * enqueueKeyEvents + * {@code enqueueKeyEvents} * @see #enqueueKeyEvents * @see #discardKeyEvents */ @@ -2041,11 +2041,11 @@ public abstract class KeyboardFocusManager /** * Called by the AWT to notify the KeyboardFocusManager that it should * cancel delayed dispatching of KeyEvents. All KeyEvents which were - * enqueued because of one or more calls to enqueueKeyEvents + * enqueued because of one or more calls to {@code enqueueKeyEvents} * with the same Component should be discarded. * * @param comp the Component specified in one or more calls to - * enqueueKeyEvents + * {@code enqueueKeyEvents} * @see #enqueueKeyEvents * @see #dequeueKeyEvents */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Label.java b/jdk/src/java.desktop/share/classes/java/awt/Label.java index d0999399e84..32744ee2a60 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Label.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Label.java @@ -30,7 +30,7 @@ import java.io.ObjectInputStream; import javax.accessibility.*; /** - * A Label object is a component for placing text in a + * A {@code Label} object is a component for placing text in a * container. A label displays a single line of read-only text. * The text can be changed by the application, but a user cannot edit it * directly. @@ -107,7 +107,7 @@ public class Label extends Component implements Accessible { /** * Constructs an empty label. - * The text of the label is the empty string "". + * The text of the label is the empty string {@code ""}. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. * @see java.awt.GraphicsEnvironment#isHeadless @@ -120,7 +120,7 @@ public class Label extends Component implements Accessible { * Constructs a new label with the specified string of text, * left justified. * @param text the string that the label presents. - * A null value + * A {@code null} value * will be accepted without causing a NullPointerException * to be thrown. * @exception HeadlessException if GraphicsEnvironment.isHeadless() @@ -134,10 +134,10 @@ public class Label extends Component implements Accessible { /** * Constructs a new label that presents the specified string of * text with the specified alignment. - * Possible values for alignment are Label.LEFT, - * Label.RIGHT, and Label.CENTER. + * Possible values for {@code alignment} are {@code Label.LEFT}, + * {@code Label.RIGHT}, and {@code Label.CENTER}. * @param text the string that the label presents. - * A null value + * A {@code null} value * will be accepted without causing a NullPointerException * to be thrown. * @param alignment the alignment value. @@ -154,8 +154,8 @@ public class Label extends Component implements Accessible { /** * Read a label from an object input stream. * @exception HeadlessException if - * GraphicsEnvironment.isHeadless() returns - * true + * {@code GraphicsEnvironment.isHeadless()} returns + * {@code true} * @serial * @since 1.4 * @see java.awt.GraphicsEnvironment#isHeadless @@ -168,7 +168,7 @@ public class Label extends Component implements Accessible { /** * Construct a name for this component. Called by getName() when the - * name is null. + * name is {@code null}. */ String constructComponentName() { synchronized (Label.class) { @@ -191,8 +191,8 @@ public class Label extends Component implements Accessible { /** * Gets the current alignment of this label. Possible values are - * Label.LEFT, Label.RIGHT, and - * Label.CENTER. + * {@code Label.LEFT}, {@code Label.RIGHT}, and + * {@code Label.CENTER}. * @return the alignment of this label * @see java.awt.Label#setAlignment */ @@ -202,11 +202,11 @@ public class Label extends Component implements Accessible { /** * Sets the alignment for this label to the specified alignment. - * Possible values are Label.LEFT, - * Label.RIGHT, and Label.CENTER. + * Possible values are {@code Label.LEFT}, + * {@code Label.RIGHT}, and {@code Label.CENTER}. * @param alignment the alignment to be set. * @exception IllegalArgumentException if an improper value for - * alignment is given. + * {@code alignment} is given. * @see java.awt.Label#getAlignment */ public synchronized void setAlignment(int alignment) { @@ -226,8 +226,8 @@ public class Label extends Component implements Accessible { /** * Gets the text of this label. - * @return the text of this label, or null if - * the text has been set to null. + * @return the text of this label, or {@code null} if + * the text has been set to {@code null}. * @see java.awt.Label#setText */ public String getText() { @@ -237,9 +237,9 @@ public class Label extends Component implements Accessible { /** * Sets the text for this label to the specified text. * @param text the text that this label displays. If - * text is null, it is + * {@code text} is {@code null}, it is * treated for display purposes like an empty - * string "". + * string {@code ""}. * @see java.awt.Label#getText */ public void setText(String text) { @@ -263,11 +263,11 @@ public class Label extends Component implements Accessible { } /** - * Returns a string representing the state of this Label. + * Returns a string representing the state of this {@code Label}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this label */ @@ -311,7 +311,7 @@ public class Label extends Component implements Accessible { /** * This class implements accessibility support for the - * Label class. It provides an implementation of the + * {@code Label} class. It provides an implementation of the * Java Accessibility API appropriate to label user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/LayoutManager.java b/jdk/src/java.desktop/share/classes/java/awt/LayoutManager.java index d7abfbb1c29..b573ed0b83a 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/LayoutManager.java +++ b/jdk/src/java.desktop/share/classes/java/awt/LayoutManager.java @@ -26,13 +26,13 @@ package java.awt; /** * Defines the interface for classes that know how to lay out - * Containers. + * {@code Container}s. *

      * Swing's painting architecture assumes the children of a - * JComponent do not overlap. If a - * JComponent's LayoutManager allows - * children to overlap, the JComponent must override - * isOptimizedDrawingEnabled to return false. + * {@code JComponent} do not overlap. If a + * {@code JComponent}'s {@code LayoutManager} allows + * children to overlap, the {@code JComponent} must override + * {@code isOptimizedDrawingEnabled} to return false. * * @see Container * @see javax.swing.JComponent#isOptimizedDrawingEnabled @@ -43,9 +43,9 @@ package java.awt; public interface LayoutManager { /** * If the layout manager uses a per-component string, - * adds the component comp to the layout, + * adds the component {@code comp} to the layout, * associating it - * with the string specified by name. + * with the string specified by {@code name}. * * @param name the string to be associated with the component * @param comp the component to be added diff --git a/jdk/src/java.desktop/share/classes/java/awt/LinearGradientPaintContext.java b/jdk/src/java.desktop/share/classes/java/awt/LinearGradientPaintContext.java index 635a3cbe45d..16d58af3e55 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/LinearGradientPaintContext.java +++ b/jdk/src/java.desktop/share/classes/java/awt/LinearGradientPaintContext.java @@ -56,7 +56,7 @@ final class LinearGradientPaintContext extends MultipleGradientPaintContext { * @param paint the {@code LinearGradientPaint} from which this context * is created * @param cm {@code ColorModel} that receives - * the Paint data. This is used only as a hint. + * the {@code Paint} data. This is used only as a hint. * @param deviceBounds the device space bounding box of the * graphics primitive being rendered * @param userBounds the user space bounding box of the diff --git a/jdk/src/java.desktop/share/classes/java/awt/List.java b/jdk/src/java.desktop/share/classes/java/awt/List.java index 4112f87fbe2..c0c22d206e8 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/List.java +++ b/jdk/src/java.desktop/share/classes/java/awt/List.java @@ -36,7 +36,7 @@ import javax.accessibility.*; /** - * The List component presents the user with a + * The {@code List} component presents the user with a * scrolling list of text items. The list can be set up so that * the user can choose either one item or multiple items. *

      @@ -57,7 +57,7 @@ import javax.accessibility.*; * cnt.add(lst); *


      *

      - * where cnt is a container, produces the following + * where {@code cnt} is a container, produces the following * scrolling list: *

      * false. If the List does not allow multiple + * list is {@code false}. If the List does not allow multiple * selections, selecting an item causes any other selected item * to be deselected. *

      * Note that the list in the example shown was created with four visible * rows. Once the list has been created, the number of visible rows - * cannot be changed. A default List is created with - * four rows, so that lst = new List() is equivalent to - * list = new List(4, false). + * cannot be changed. A default {@code List} is created with + * four rows, so that {@code lst = new List()} is equivalent to + * {@code list = new List(4, false)}. *

      * Beginning with Java 1.1, the Abstract Window Toolkit - * sends the List object all mouse, keyboard, and focus events + * sends the {@code List} object all mouse, keyboard, and focus events * that occur over it. (The old AWT event model is being maintained * only for backwards compatibility, and its use is discouraged.) *

      * When an item is selected or deselected by the user, AWT sends an instance - * of ItemEvent to the list. + * of {@code ItemEvent} to the list. * When the user double-clicks on an item in a scrolling list, - * AWT sends an instance of ActionEvent to the + * AWT sends an instance of {@code ActionEvent} to the * list following the item event. AWT also generates an action event * when the user presses the return key while an item in the * list is selected. *

      * If an application wants to perform some action based on an item * in this list being selected or activated by the user, it should implement - * ItemListener or ActionListener + * {@code ItemListener} or {@code ActionListener} * as appropriate and register the new listener to receive * events from this list. *

      @@ -119,7 +119,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * This field will represent the number of visible rows in the - * List Component. It is specified only once, and + * {@code List} Component. It is specified only once, and * that is when the list component is actually * created. It will never change. * @@ -129,11 +129,11 @@ public class List extends Component implements ItemSelectable, Accessible { int rows = 0; /** - * multipleMode is a variable that will - * be set to true if a list component is to be set to + * {@code multipleMode} is a variable that will + * be set to {@code true} if a list component is to be set to * multiple selection mode, that is where the user can * select more than one item in a list at one time. - * multipleMode will be set to false if the + * {@code multipleMode} will be set to false if the * list component is set to single selection, that is where * the user can only select one item on the list at any * one time. @@ -145,7 +145,7 @@ public class List extends Component implements ItemSelectable, Accessible { boolean multipleMode = false; /** - * selected is an array that will contain + * {@code selected} is an array that will contain * the indices of items that have been selected. * * @serial @@ -178,7 +178,7 @@ public class List extends Component implements ItemSelectable, Accessible { * Creates a new scrolling list. * By default, there are four visible lines and multiple selections are * not allowed. Note that this is a convenience method for - * List(0, false). Also note that the number of visible + * {@code List(0, false)}. Also note that the number of visible * lines in the list cannot be changed after it has been created. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. @@ -192,7 +192,7 @@ public class List extends Component implements ItemSelectable, Accessible { * Creates a new scrolling list initialized with the specified * number of visible lines. By default, multiple selections are * not allowed. Note that this is a convenience method for - * List(rows, false). Also note that the number + * {@code List(rows, false)}. Also note that the number * of visible rows in the list cannot be changed after it has * been created. * @param rows the number of items to show. @@ -217,12 +217,12 @@ public class List extends Component implements ItemSelectable, Accessible { * the list will be created with a default of four rows. * Also note that the number of visible rows in the list cannot * be changed after it has been created. - * If the value of multipleMode is - * true, then the user can select multiple items from - * the list. If it is false, only one item at a time + * If the value of {@code multipleMode} is + * {@code true}, then the user can select multiple items from + * the list. If it is {@code false}, only one item at a time * can be selected. * @param rows the number of items to show. - * @param multipleMode if true, + * @param multipleMode if {@code true}, * then multiple selections are allowed; * otherwise, only one item can be selected at a time. * @exception HeadlessException if GraphicsEnvironment.isHeadless() @@ -237,7 +237,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Construct a name for this component. Called by - * getName when the name is null. + * {@code getName} when the name is {@code null}. */ String constructComponentName() { synchronized (List.class) { @@ -286,7 +286,7 @@ public class List extends Component implements ItemSelectable, Accessible { * * @return the number of items in the list * @deprecated As of JDK version 1.1, - * replaced by getItemCount(). + * replaced by {@code getItemCount()}. */ @Deprecated public int countItems() { @@ -339,7 +339,7 @@ public class List extends Component implements ItemSelectable, Accessible { * Adds the specified item to the end of the list. * * @param item the item to be added - * @deprecated replaced by add(String). + * @deprecated replaced by {@code add(String)}. */ @Deprecated public void addItem(String item) { @@ -354,8 +354,8 @@ public class List extends Component implements ItemSelectable, Accessible { * the number of items in the list, then the item is added * to the end of the list. * @param item the item to be added; - * if this parameter is null then the item is - * treated as an empty string, "" + * if this parameter is {@code null} then the item is + * treated as an empty string, {@code ""} * @param index the position at which to add the item * @since 1.1 */ @@ -369,7 +369,7 @@ public class List extends Component implements ItemSelectable, Accessible { * * @param item the item to be added * @param index the position at which to add the item - * @deprecated replaced by add(String, int). + * @deprecated replaced by {@code add(String, int)}. */ @Deprecated public synchronized void addItem(String item, int index) { @@ -398,7 +398,7 @@ public class List extends Component implements ItemSelectable, Accessible { * with the new string. * @param newValue a new string to replace an existing item * @param index the position of the item to replace - * @exception ArrayIndexOutOfBoundsException if index + * @exception ArrayIndexOutOfBoundsException if {@code index} * is out of range */ public synchronized void replaceItem(String newValue, int index) { @@ -418,7 +418,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * @deprecated As of JDK version 1.1, - * replaced by removeAll(). + * replaced by {@code removeAll()}. */ @Deprecated public synchronized void clear() { @@ -458,8 +458,8 @@ public class List extends Component implements ItemSelectable, Accessible { * @see #add(String, int) * @since 1.1 * @exception ArrayIndexOutOfBoundsException - * if the position is less than 0 or - * greater than getItemCount()-1 + * if the {@code position} is less than 0 or + * greater than {@code getItemCount()-1} */ public void remove(int position) { delItem(position); @@ -469,8 +469,8 @@ public class List extends Component implements ItemSelectable, Accessible { * Removes the item at the specified position. * * @param position the index of the item to delete - * @deprecated replaced by remove(String) - * and remove(int). + * @deprecated replaced by {@code remove(String)} + * and {@code remove(int)}. */ @Deprecated public void delItem(int position) { @@ -482,7 +482,7 @@ public class List extends Component implements ItemSelectable, Accessible { * * @return the index of the selected item; * if no item is selected, or if multiple items are - * selected, -1 is returned. + * selected, {@code -1} is returned. * @see #select * @see #deselect * @see #isIndexSelected @@ -514,7 +514,7 @@ public class List extends Component implements ItemSelectable, Accessible { * * @return the selected item on the list; * if no item is selected, or if multiple items are - * selected, null is returned. + * selected, {@code null} is returned. * @see #select * @see #deselect * @see #isIndexSelected @@ -544,7 +544,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Gets the selected items on this scrolling list in an array of Objects. - * @return an array of Objects representing the + * @return an array of {@code Object}s representing the * selected items on this scrolling list; * if no item is selected, a zero-length array is returned. * @see #getSelectedItems @@ -563,8 +563,8 @@ public class List extends Component implements ItemSelectable, Accessible { *

      Note that this method should be primarily used to * initially select an item in this component. * Programmatically calling this method will not trigger - * an ItemEvent. The only way to trigger an - * ItemEvent is by user interaction. + * an {@code ItemEvent}. The only way to trigger an + * {@code ItemEvent} is by user interaction. * * @param index the position of the item to select * @see #getSelectedItem @@ -649,8 +649,8 @@ public class List extends Component implements ItemSelectable, Accessible { * Determines if the specified item in this scrolling list is * selected. * @param index the item to be checked - * @return true if the specified item has been - * selected; false otherwise + * @return {@code true} if the specified item has been + * selected; {@code false} otherwise * @see #select * @see #deselect * @since 1.1 @@ -665,7 +665,7 @@ public class List extends Component implements ItemSelectable, Accessible { * @param index specifies the item to be checked * @return {@code true} if the item is selected; otherwise {@code false} * @deprecated As of JDK version 1.1, - * replaced by isIndexSelected(int). + * replaced by {@code isIndexSelected(int)}. */ @Deprecated public boolean isSelected(int index) { @@ -680,7 +680,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Gets the number of visible lines in this list. Note that - * once the List has been created, this number + * once the {@code List} has been created, this number * will never change. * @return the number of visible lines in this scrolling list */ @@ -691,8 +691,8 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Determines whether this list allows multiple selections. * - * @return true if this list allows multiple - * selections; otherwise, false + * @return {@code true} if this list allows multiple + * selections; otherwise, {@code false} * @see #setMultipleMode * @since 1.1 */ @@ -706,7 +706,7 @@ public class List extends Component implements ItemSelectable, Accessible { * @return {@code true} if this list allows multiple * selections; otherwise {@code false} * @deprecated As of JDK version 1.1, - * replaced by isMultipleMode(). + * replaced by {@code isMultipleMode()}. */ @Deprecated public boolean allowsMultipleSelections() { @@ -721,7 +721,7 @@ public class List extends Component implements ItemSelectable, Accessible { * If a selected item has the location cursor, only that * item will remain selected. If no selected item has the * location cursor, all items will be deselected. - * @param b if true then multiple selections + * @param b if {@code true} then multiple selections * are allowed; otherwise, only one item from * the list can be selected at once * @see #isMultipleMode @@ -736,7 +736,7 @@ public class List extends Component implements ItemSelectable, Accessible { * * @param b {@code true} to enable multiple mode, {@code false} otherwise * @deprecated As of JDK version 1.1, - * replaced by setMultipleMode(boolean). + * replaced by {@code setMultipleMode(boolean)}. */ @Deprecated public synchronized void setMultipleSelections(boolean b) { @@ -751,7 +751,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Gets the index of the item that was last made visible by - * the method makeVisible. + * the method {@code makeVisible}. * @return the index of the item that was last made visible * @see #makeVisible */ @@ -792,7 +792,7 @@ public class List extends Component implements ItemSelectable, Accessible { * @param rows the number of rows * @return the preferred dimensions for displaying this list * @deprecated As of JDK version 1.1, - * replaced by getPreferredSize(int). + * replaced by {@code getPreferredSize(int)}. */ @Deprecated public Dimension preferredSize(int rows) { @@ -816,7 +816,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * @deprecated As of JDK version 1.1, - * replaced by getPreferredSize(). + * replaced by {@code getPreferredSize()}. */ @Deprecated public Dimension preferredSize() { @@ -847,7 +847,7 @@ public class List extends Component implements ItemSelectable, Accessible { * @param rows the number of rows in the list * @return the minimum dimensions for displaying this list * @deprecated As of JDK version 1.1, - * replaced by getMinimumSize(int). + * replaced by {@code getMinimumSize(int)}. */ @Deprecated public Dimension minimumSize(int rows) { @@ -872,7 +872,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * @deprecated As of JDK version 1.1, - * replaced by getMinimumSize(). + * replaced by {@code getMinimumSize()}. */ @Deprecated public Dimension minimumSize() { @@ -884,8 +884,8 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Adds the specified item listener to receive item events from * this list. Item events are sent in response to user input, but not - * in response to calls to select or deselect. - * If listener l is null, + * in response to calls to {@code select} or {@code deselect}. + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

      Refer to AWT Threading Issues for details on AWT's threading model. @@ -910,7 +910,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Removes the specified item listener so that it no longer * receives item events from this list. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

      Refer to AWT Threading Issues for details on AWT's threading model. @@ -933,7 +933,7 @@ public class List extends Component implements ItemSelectable, Accessible { * Returns an array of all the item listeners * registered on this list. * - * @return all of this list's ItemListeners + * @return all of this list's {@code ItemListener}s * or an empty array if no item * listeners are currently registered * @@ -953,7 +953,7 @@ public class List extends Component implements ItemSelectable, Accessible { * on a list item or types Enter when the list has the keyboard * focus. *

      - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

      Refer to AWT Threading Issues for details on AWT's threading model. @@ -977,7 +977,7 @@ public class List extends Component implements ItemSelectable, Accessible { * Removes the specified action listener so that it no longer * receives action events from this list. Action events * occur when a user double-clicks on a list item. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

      Refer to AWT Threading Issues for details on AWT's threading model. @@ -1000,7 +1000,7 @@ public class List extends Component implements ItemSelectable, Accessible { * Returns an array of all the action listeners * registered on this list. * - * @return all of this list's ActionListeners + * @return all of this list's {@code ActionListener}s * or an empty array if no action * listeners are currently registered * @@ -1017,16 +1017,16 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Returns an array of all the objects currently registered * as FooListeners - * upon this List. + * upon this {@code List}. * FooListeners are registered using the * addFooListener method. * *

      - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * List l + * {@code List l} * for its item listeners with the following code: * *

      ItemListener[] ils = (ItemListener[])(l.getListeners(ItemListener.class));
      @@ -1035,14 +1035,14 @@ public class List extends Component implements ItemSelectable, Accessible { * * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this list, * or an empty array if no such * listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @see #getItemListeners * @since 1.3 @@ -1082,13 +1082,13 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Processes events on this scrolling list. If an event is - * an instance of ItemEvent, it invokes the - * processItemEvent method. Else, if the - * event is an instance of ActionEvent, - * it invokes processActionEvent. + * an instance of {@code ItemEvent}, it invokes the + * {@code processItemEvent} method. Else, if the + * event is an instance of {@code ActionEvent}, + * it invokes {@code processActionEvent}. * If the event is not an item event or an action event, - * it invokes processEvent on the superclass. - *

      Note that if the event parameter is null + * it invokes {@code processEvent} on the superclass. + *

      Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -1113,17 +1113,17 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Processes item events occurring on this list by * dispatching them to any registered - * ItemListener objects. + * {@code ItemListener} objects. *

      * This method is not called unless item events are * enabled for this component. Item events are enabled * when one of the following occurs: *

        - *
      • An ItemListener object is registered - * via addItemListener. - *
      • Item events are enabled via enableEvents. + *
      • An {@code ItemListener} object is registered + * via {@code addItemListener}. + *
      • Item events are enabled via {@code enableEvents}. *
      - *

      Note that if the event parameter is null + *

      Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -1144,17 +1144,17 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Processes action events occurring on this component * by dispatching them to any registered - * ActionListener objects. + * {@code ActionListener} objects. *

      * This method is not called unless action events are * enabled for this component. Action events are enabled * when one of the following occurs: *

        - *
      • An ActionListener object is registered - * via addActionListener. - *
      • Action events are enabled via enableEvents. + *
      • An {@code ActionListener} object is registered + * via {@code addActionListener}. + *
      • Action events are enabled via {@code enableEvents}. *
      - *

      Note that if the event parameter is null + *

      Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -1209,7 +1209,7 @@ public class List extends Component implements ItemSelectable, Accessible { */ /** - * The List component's + * The {@code List} component's * Serialized Data Version. * * @serial @@ -1218,22 +1218,22 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Writes default serializable fields to stream. Writes - * a list of serializable ItemListeners - * and ActionListeners as optional data. + * a list of serializable {@code ItemListeners} + * and {@code ActionListeners} as optional data. * The non-serializable listeners are detected and * no attempt is made to serialize them. * - * @serialData null terminated sequence of 0 - * or more pairs; the pair consists of a String - * and an Object; the String + * @serialData {@code null} terminated sequence of 0 + * or more pairs; the pair consists of a {@code String} + * and an {@code Object}; the {@code String} * indicates the type of object and is one of the * following: - * itemListenerK indicating an - * ItemListener object; - * actionListenerK indicating an - * ActionListener object + * {@code itemListenerK} indicating an + * {@code ItemListener} object; + * {@code actionListenerK} indicating an + * {@code ActionListener} object * - * @param s the ObjectOutputStream to write + * @param s the {@code ObjectOutputStream} to write * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see java.awt.Component#itemListenerK * @see java.awt.Component#actionListenerK @@ -1256,17 +1256,17 @@ public class List extends Component implements ItemSelectable, Accessible { } /** - * Reads the ObjectInputStream and if it - * isn't null adds a listener to receive + * Reads the {@code ObjectInputStream} and if it + * isn't {@code null} adds a listener to receive * both item events and action events (as specified * by the key stored in the stream) fired by the - * List. + * {@code List}. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to write + * @param s the {@code ObjectInputStream} to write * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns - * true + * {@code GraphicsEnvironment.isHeadless} returns + * {@code true} * @see #removeItemListener(ItemListener) * @see #addItemListener(ItemListener) * @see java.awt.GraphicsEnvironment#isHeadless @@ -1300,13 +1300,13 @@ public class List extends Component implements ItemSelectable, Accessible { /** - * Gets the AccessibleContext associated with this - * List. For lists, the AccessibleContext - * takes the form of an AccessibleAWTList. - * A new AccessibleAWTList instance is created, if necessary. + * Gets the {@code AccessibleContext} associated with this + * {@code List}. For lists, the {@code AccessibleContext} + * takes the form of an {@code AccessibleAWTList}. + * A new {@code AccessibleAWTList} instance is created, if necessary. * - * @return an AccessibleAWTList that serves as the - * AccessibleContext of this List + * @return an {@code AccessibleAWTList} that serves as the + * {@code AccessibleContext} of this {@code List} * @since 1.3 */ public AccessibleContext getAccessibleContext() { @@ -1318,7 +1318,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * This class implements accessibility support for the - * List class. It provides an implementation of the + * {@code List} class. It provides an implementation of the * Java Accessibility API appropriate to list user-interface elements. * @since 1.3 */ @@ -1930,13 +1930,13 @@ public class List extends Component implements ItemSelectable, Accessible { } /** - * Returns the Accessible child, if one exists, - * contained at the local coordinate Point. + * Returns the {@code Accessible} child, if one exists, + * contained at the local coordinate {@code Point}. * * @param p the point relative to the coordinate system of this * object - * @return the Accessible, if it exists, - * at the specified location; otherwise null + * @return the {@code Accessible}, if it exists, + * at the specified location; otherwise {@code null} */ public Accessible getAccessibleAt(Point p) { return null; // object cannot have children! @@ -1945,8 +1945,8 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Returns whether this object can accept focus or not. Objects * that can accept focus will also have the - * AccessibleState.FOCUSABLE state set in their - * AccessibleStateSet. + * {@code AccessibleState.FOCUSABLE} state set in their + * {@code AccessibleStateSet}. * * @return true if object can accept focus; otherwise false * @see AccessibleContext#getAccessibleStateSet diff --git a/jdk/src/java.desktop/share/classes/java/awt/MediaTracker.java b/jdk/src/java.desktop/share/classes/java/awt/MediaTracker.java index dd8f9e0825f..8af10871768 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/MediaTracker.java +++ b/jdk/src/java.desktop/share/classes/java/awt/MediaTracker.java @@ -31,13 +31,13 @@ import java.awt.image.ImageObserver; import sun.awt.image.MultiResolutionToolkitImage; /** - * The MediaTracker class is a utility class to track + * The {@code MediaTracker} class is a utility class to track * the status of a number of media objects. Media objects could * include audio clips as well as images, though currently only * images are supported. *

      * To use a media tracker, create an instance of - * MediaTracker and call its addImage + * {@code MediaTracker} and call its {@code addImage} * method for each image to be tracked. In addition, each image can * be assigned a unique identifier. This identifier controls the * priority order in which the images are fetched. It can also be used @@ -52,20 +52,20 @@ import sun.awt.image.MultiResolutionToolkitImage; * due to the multi-part nature of animated image * loading and painting, * but it is supported. - * MediaTracker treats an animated image + * {@code MediaTracker} treats an animated image * as completely loaded * when the first frame is completely loaded. - * At that point, the MediaTracker + * At that point, the {@code MediaTracker} * signals any waiters * that the image is completely loaded. - * If no ImageObservers are observing the image + * If no {@code ImageObserver}s are observing the image * when the first frame has finished loading, * the image might flush itself * to conserve resources * (see {@link Image#flush()}). * *

      - * Here is an example of using MediaTracker: + * Here is an example of using {@code MediaTracker}: * *


      {@code
        * import java.applet.Applet;
      @@ -169,7 +169,7 @@ import sun.awt.image.MultiResolutionToolkitImage;
       public class MediaTracker implements java.io.Serializable {
       
           /**
      -     * A given Component that will be
      +     * A given {@code Component} that will be
            * tracked by a media tracker where the image will
            * eventually be drawn.
            *
      @@ -178,8 +178,8 @@ public class MediaTracker implements java.io.Serializable {
            */
           Component target;
           /**
      -     * The head of the list of Images that is being
      -     * tracked by the MediaTracker.
      +     * The head of the list of {@code Images} that is being
      +     * tracked by the {@code MediaTracker}.
            *
            * @serial
            * @see #addImage(Image, int)
      @@ -277,11 +277,11 @@ public class MediaTracker implements java.io.Serializable {
            * 

      * If there is an error while loading or scaling an image, then that * image is considered to have finished loading. Use the - * isErrorAny or isErrorID methods to + * {@code isErrorAny} or {@code isErrorID} methods to * check for errors. - * @return true if all images have finished loading, + * @return {@code true} if all images have finished loading, * have been aborted, or have encountered - * an error; false otherwise + * an error; {@code false} otherwise * @see java.awt.MediaTracker#checkAll(boolean) * @see java.awt.MediaTracker#checkID * @see java.awt.MediaTracker#isErrorAny @@ -295,19 +295,19 @@ public class MediaTracker implements java.io.Serializable { * Checks to see if all images being tracked by this media tracker * have finished loading. *

      - * If the value of the load flag is true, + * If the value of the {@code load} flag is {@code true}, * then this method starts loading any images that are not yet * being loaded. *

      * If there is an error while loading or scaling an image, that * image is considered to have finished loading. Use the - * isErrorAny and isErrorID methods to + * {@code isErrorAny} and {@code isErrorID} methods to * check for errors. - * @param load if true, start loading any + * @param load if {@code true}, start loading any * images that are not yet being loaded - * @return true if all images have finished loading, + * @return {@code true} if all images have finished loading, * have been aborted, or have encountered - * an error; false otherwise + * an error; {@code false} otherwise * @see java.awt.MediaTracker#checkID * @see java.awt.MediaTracker#checkAll() * @see java.awt.MediaTracker#isErrorAny() @@ -331,9 +331,9 @@ public class MediaTracker implements java.io.Serializable { /** * Checks the error status of all of the images. - * @return true if any of the images tracked + * @return {@code true} if any of the images tracked * by this media tracker had an error during - * loading; false otherwise + * loading; {@code false} otherwise * @see java.awt.MediaTracker#isErrorID * @see java.awt.MediaTracker#getErrorsAny */ @@ -352,7 +352,7 @@ public class MediaTracker implements java.io.Serializable { * Returns a list of all media that have encountered an error. * @return an array of media objects tracked by this * media tracker that have encountered - * an error, or null if + * an error, or {@code null} if * there are none with errors * @see java.awt.MediaTracker#isErrorAny * @see java.awt.MediaTracker#getErrorsID @@ -388,7 +388,7 @@ public class MediaTracker implements java.io.Serializable { *

      * If there is an error while loading or scaling an image, then that * image is considered to have finished loading. Use the - * isErrorAny or isErrorID methods to + * {@code isErrorAny} or {@code isErrorID} methods to * check for errors. * @see java.awt.MediaTracker#waitForID(int) * @see java.awt.MediaTracker#waitForAll(long) @@ -405,16 +405,16 @@ public class MediaTracker implements java.io.Serializable { * Starts loading all images tracked by this media tracker. This * method waits until all the images being tracked have finished * loading, or until the length of time specified in milliseconds - * by the ms argument has passed. + * by the {@code ms} argument has passed. *

      * If there is an error while loading or scaling an image, then * that image is considered to have finished loading. Use the - * isErrorAny or isErrorID methods to + * {@code isErrorAny} or {@code isErrorID} methods to * check for errors. * @param ms the number of milliseconds to wait * for the loading to complete - * @return true if all images were successfully - * loaded; false otherwise + * @return {@code true} if all images were successfully + * loaded; {@code false} otherwise * @see java.awt.MediaTracker#waitForID(int) * @see java.awt.MediaTracker#waitForAll(long) * @see java.awt.MediaTracker#isErrorAny @@ -451,15 +451,15 @@ public class MediaTracker implements java.io.Serializable { * status of all media that are tracked by this media tracker. *

      * Possible flags defined by the - * MediaTracker class are LOADING, - * ABORTED, ERRORED, and - * COMPLETE. An image that hasn't started + * {@code MediaTracker} class are {@code LOADING}, + * {@code ABORTED}, {@code ERRORED}, and + * {@code COMPLETE}. An image that hasn't started * loading has zero as its status. *

      - * If the value of load is true, then + * If the value of {@code load} is {@code true}, then * this method starts loading any images that are not yet being loaded. * - * @param load if true, start loading + * @param load if {@code true}, start loading * any images that are not yet being loaded * @return the bitwise inclusive OR of the status of * all of the media being tracked @@ -492,12 +492,12 @@ public class MediaTracker implements java.io.Serializable { *

      * If there is an error while loading or scaling an image, then that * image is considered to have finished loading. Use the - * isErrorAny or isErrorID methods to + * {@code isErrorAny} or {@code isErrorID} methods to * check for errors. * @param id the identifier of the images to check - * @return true if all images have finished loading, + * @return {@code true} if all images have finished loading, * have been aborted, or have encountered - * an error; false otherwise + * an error; {@code false} otherwise * @see java.awt.MediaTracker#checkID(int, boolean) * @see java.awt.MediaTracker#checkAll() * @see java.awt.MediaTracker#isErrorAny() @@ -511,20 +511,20 @@ public class MediaTracker implements java.io.Serializable { * Checks to see if all images tracked by this media tracker that * are tagged with the specified identifier have finished loading. *

      - * If the value of the load flag is true, + * If the value of the {@code load} flag is {@code true}, * then this method starts loading any images that are not yet * being loaded. *

      * If there is an error while loading or scaling an image, then that * image is considered to have finished loading. Use the - * isErrorAny or isErrorID methods to + * {@code isErrorAny} or {@code isErrorID} methods to * check for errors. * @param id the identifier of the images to check - * @param load if true, start loading any + * @param load if {@code true}, start loading any * images that are not yet being loaded - * @return true if all images have finished loading, + * @return {@code true} if all images have finished loading, * have been aborted, or have encountered - * an error; false otherwise + * an error; {@code false} otherwise * @see java.awt.MediaTracker#checkID(int, boolean) * @see java.awt.MediaTracker#checkAll() * @see java.awt.MediaTracker#isErrorAny() @@ -553,9 +553,9 @@ public class MediaTracker implements java.io.Serializable { * Checks the error status of all of the images tracked by this * media tracker with the specified identifier. * @param id the identifier of the images to check - * @return true if any of the images with the + * @return {@code true} if any of the images with the * specified identifier had an error during - * loading; false otherwise + * loading; {@code false} otherwise * @see java.awt.MediaTracker#isErrorAny * @see java.awt.MediaTracker#getErrorsID */ @@ -579,7 +579,7 @@ public class MediaTracker implements java.io.Serializable { * @return an array of media objects tracked by this media * tracker with the specified identifier * that have encountered an error, or - * null if there are none with errors + * {@code null} if there are none with errors * @see java.awt.MediaTracker#isErrorID * @see java.awt.MediaTracker#isErrorAny * @see java.awt.MediaTracker#getErrorsAny @@ -619,7 +619,7 @@ public class MediaTracker implements java.io.Serializable { *

      * If there is an error while loading or scaling an image, then that * image is considered to have finished loading. Use the - * isErrorAny and isErrorID methods to + * {@code isErrorAny} and {@code isErrorID} methods to * check for errors. * @param id the identifier of the images to check * @see java.awt.MediaTracker#waitForAll @@ -636,13 +636,13 @@ public class MediaTracker implements java.io.Serializable { * Starts loading all images tracked by this media tracker with the * specified identifier. This method waits until all the images with * the specified identifier have finished loading, or until the - * length of time specified in milliseconds by the ms + * length of time specified in milliseconds by the {@code ms} * argument has passed. *

      * If there is an error while loading or scaling an image, then that * image is considered to have finished loading. Use the - * statusID, isErrorID, and - * isErrorAny methods to check for errors. + * {@code statusID}, {@code isErrorID}, and + * {@code isErrorAny} methods to check for errors. * @param id the identifier of the images to check * @param ms the length of time, in milliseconds, to wait * for the loading to complete @@ -686,15 +686,15 @@ public class MediaTracker implements java.io.Serializable { * tracked by this media tracker. *

      * Possible flags defined by the - * MediaTracker class are LOADING, - * ABORTED, ERRORED, and - * COMPLETE. An image that hasn't started + * {@code MediaTracker} class are {@code LOADING}, + * {@code ABORTED}, {@code ERRORED}, and + * {@code COMPLETE}. An image that hasn't started * loading has zero as its status. *

      - * If the value of load is true, then + * If the value of {@code load} is {@code true}, then * this method starts loading any images that are not yet being loaded. * @param id the identifier of the images to check - * @param load if true, start loading + * @param load if {@code true}, start loading * any images that are not yet being loaded * @return the bitwise inclusive OR of the status of * all of the media with the specified @@ -761,7 +761,7 @@ public class MediaTracker implements java.io.Serializable { /** * Removes the specified image from the specified tracking * ID of this media tracker. - * All instances of Image being tracked + * All instances of {@code Image} being tracked * under the specified ID are removed regardless of scale. * @param image the image to be removed * @param id the tracking ID from which to remove the image diff --git a/jdk/src/java.desktop/share/classes/java/awt/Menu.java b/jdk/src/java.desktop/share/classes/java/awt/Menu.java index af7d4c6b734..70b5ee1f25f 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Menu.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Menu.java @@ -34,7 +34,7 @@ import javax.accessibility.*; import sun.awt.AWTAccessor; /** - * A Menu object is a pull-down menu component + * A {@code Menu} object is a pull-down menu component * that is deployed from a menu bar. *

      * A menu can optionally be a tear-off menu. A tear-off menu @@ -45,10 +45,10 @@ import sun.awt.AWTAccessor; * On platforms that do not support tear-off menus, the tear-off * property is ignored. *

      - * Each item in a menu must belong to the MenuItem - * class. It can be an instance of MenuItem, a submenu - * (an instance of Menu), or a check box (an instance of - * CheckboxMenuItem). + * Each item in a menu must belong to the {@code MenuItem} + * class. It can be an instance of {@code MenuItem}, a submenu + * (an instance of {@code Menu}), or a check box (an instance of + * {@code CheckboxMenuItem}). * * @author Sami Shaio * @see java.awt.MenuItem @@ -83,8 +83,8 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { /** * This field indicates whether the menu has the * tear of property or not. It will be set to - * true if the menu has the tear off - * property and it will be set to false + * {@code true} if the menu has the tear off + * property and it will be set to {@code false} * if it does not. * A torn off menu can be deleted by a user when * it is no longer needed. @@ -95,10 +95,10 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { boolean tearOff; /** - * This field will be set to true + * This field will be set to {@code true} * if the Menu in question is actually a help - * menu. Otherwise it will be set to - * false. + * menu. Otherwise it will be set to + * {@code false}. * * @serial */ @@ -146,7 +146,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { * support tear-off menus, this value is silently ignored. * @param label the menu's label in the menu bar, or in * another menu of which this menu is a submenu. - * @param tearOff if true, the menu + * @param tearOff if {@code true}, the menu * is a tear-off menu. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. @@ -204,8 +204,8 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { * Tear-off functionality may not be supported by all * implementations of AWT. If a particular implementation doesn't * support tear-off menus, this value is silently ignored. - * @return true if this is a tear-off menu; - * false otherwise. + * @return {@code true} if this is a tear-off menu; + * {@code false} otherwise. */ public boolean isTearOff() { return tearOff; @@ -225,7 +225,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { * * @return the number of items in this menu * @deprecated As of JDK version 1.1, - * replaced by getItemCount(). + * replaced by {@code getItemCount()}. */ @Deprecated public int countItems() { @@ -304,7 +304,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { * @see java.awt.Menu#add(java.lang.String) * @see java.awt.Menu#add(java.awt.MenuItem) * @exception IllegalArgumentException if the value of - * index is less than zero + * {@code index} is less than zero * @since 1.1 */ @@ -340,7 +340,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { /** * Inserts a menu item with the specified label into this menu * at the specified position. This is a convenience method for - * insert(menuItem, index). + * {@code insert(menuItem, index)}. * * @param label the text on the item * @param index the position at which the menu item @@ -348,7 +348,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { * @see java.awt.Menu#add(java.lang.String) * @see java.awt.Menu#add(java.awt.MenuItem) * @exception IllegalArgumentException if the value of - * index is less than zero + * {@code index} is less than zero * @since 1.1 */ @@ -369,7 +369,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { * @param index the position at which the * menu separator should be inserted. * @exception IllegalArgumentException if the value of - * index is less than 0. + * {@code index} is less than 0. * @see java.awt.Menu#addSeparator * @since 1.1 */ @@ -423,7 +423,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { /** * Removes the specified menu item from this menu. * @param item the item to be removed from the menu. - * If item is null + * If {@code item} is {@code null} * or is not in this menu, this method does * nothing. */ @@ -519,7 +519,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { /** * Writes default serializable fields to stream. * - * @param s the ObjectOutputStream to write + * @param s the {@code ObjectOutputStream} to write * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see #readObject(ObjectInputStream) */ @@ -530,13 +530,13 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { } /** - * Reads the ObjectInputStream. + * Reads the {@code ObjectInputStream}. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns - * true + * {@code GraphicsEnvironment.isHeadless} returns + * {@code true} * @see java.awt.GraphicsEnvironment#isHeadless * @see #writeObject(ObjectOutputStream) */ @@ -552,11 +552,11 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { } /** - * Returns a string representing the state of this Menu. + * Returns a string representing the state of this {@code Menu}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this menu */ @@ -606,7 +606,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { * subclassed by menu component developers. *

      * This class implements accessibility support for the - * Menu class. It provides an implementation of the + * {@code Menu} class. It provides an implementation of the * Java Accessibility API appropriate to menu user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java b/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java index b8bb64d8efb..4a57b0dbf2c 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java +++ b/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java @@ -34,10 +34,10 @@ import java.awt.event.KeyEvent; import javax.accessibility.*; /** - * The MenuBar class encapsulates the platform's + * The {@code MenuBar} class encapsulates the platform's * concept of a menu bar bound to a frame. In order to associate - * the menu bar with a Frame object, call the - * frame's setMenuBar method. + * the menu bar with a {@code Frame} object, call the + * frame's {@code setMenuBar} method. *

      * * This is what a menu bar might look like: @@ -52,8 +52,8 @@ import javax.accessibility.*; * (Keyboard shortcuts, which are optional, provide the user with * an alternative to the mouse for invoking a menu item and the * action that is associated with it.) - * Each menu item can maintain an instance of MenuShortcut. - * The MenuBar class defines several methods, + * Each menu item can maintain an instance of {@code MenuShortcut}. + * The {@code MenuBar} class defines several methods, * {@link MenuBar#shortcuts} and * {@link MenuBar#getShortcutMenuItem} * that retrieve information about the shortcuts a given @@ -289,7 +289,7 @@ public class MenuBar extends MenuComponent implements MenuContainer, Accessible * * @return the number of menus on the menu bar. * @deprecated As of JDK version 1.1, - * replaced by getMenuCount(). + * replaced by {@code getMenuCount()}. */ @Deprecated public int countMenus() { @@ -342,9 +342,9 @@ public class MenuBar extends MenuComponent implements MenuContainer, Accessible } /** - * Gets the instance of MenuItem associated - * with the specified MenuShortcut object, - * or null if none of the menu items being managed + * Gets the instance of {@code MenuItem} associated + * with the specified {@code MenuShortcut} object, + * or {@code null} if none of the menu items being managed * by this menu bar is associated with the specified menu * shortcut. * @param s the specified menu shortcut. @@ -420,7 +420,7 @@ public class MenuBar extends MenuComponent implements MenuContainer, Accessible /** * Writes default serializable fields to stream. * - * @param s the ObjectOutputStream to write + * @param s the {@code ObjectOutputStream} to write * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see #readObject(java.io.ObjectInputStream) */ @@ -432,13 +432,13 @@ public class MenuBar extends MenuComponent implements MenuContainer, Accessible } /** - * Reads the ObjectInputStream. + * Reads the {@code ObjectInputStream}. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns - * true + * {@code GraphicsEnvironment.isHeadless} returns + * {@code true} * @see java.awt.GraphicsEnvironment#isHeadless * @see #writeObject(java.io.ObjectOutputStream) */ @@ -494,7 +494,7 @@ public class MenuBar extends MenuComponent implements MenuContainer, Accessible * subclassed by menu component developers. *

      * This class implements accessibility support for the - * MenuBar class. It provides an implementation of the + * {@code MenuBar} class. It provides an implementation of the * Java Accessibility API appropriate to menu bar user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/MenuComponent.java b/jdk/src/java.desktop/share/classes/java/awt/MenuComponent.java index fca144ac0f8..c6097397c98 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/MenuComponent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/MenuComponent.java @@ -38,13 +38,13 @@ import java.security.AccessControlContext; import java.security.AccessController; /** - * The abstract class MenuComponent is the superclass + * The abstract class {@code MenuComponent} is the superclass * of all menu-related components. In this respect, the class - * MenuComponent is analogous to the abstract superclass - * Component for AWT components. + * {@code MenuComponent} is analogous to the abstract superclass + * {@code Component} for AWT components. *

      * Menu components receive and process AWT events, just as components do, - * through the method processEvent. + * through the method {@code processEvent}. * * @author Arthur van Hoff * @since 1.0 @@ -63,15 +63,15 @@ public abstract class MenuComponent implements java.io.Serializable { transient MenuContainer parent; /** - * The AppContext of the MenuComponent. + * The {@code AppContext} of the {@code MenuComponent}. * This is set in the constructor and never changes. */ transient AppContext appContext; /** * The menu component's font. This value can be - * null at which point a default will be used. - * This defaults to null. + * {@code null} at which point a default will be used. + * This defaults to {@code null}. * * @serial * @see #setFont(Font) @@ -80,7 +80,7 @@ public abstract class MenuComponent implements java.io.Serializable { volatile Font font; /** - * The menu component's name, which defaults to null. + * The menu component's name, which defaults to {@code null}. * @serial * @see #getName() * @see #setName(String) @@ -89,15 +89,15 @@ public abstract class MenuComponent implements java.io.Serializable { /** * A variable to indicate whether a name is explicitly set. - * If true the name will be set explicitly. - * This defaults to false. + * If {@code true} the name will be set explicitly. + * This defaults to {@code false}. * @serial * @see #setName(String) */ private boolean nameExplicitlySet = false; /** - * Defaults to false. + * Defaults to {@code false}. * @serial * @see #dispatchEvent(AWTEvent) */ @@ -164,10 +164,10 @@ public abstract class MenuComponent implements java.io.Serializable { } /** - * Creates a MenuComponent. + * Creates a {@code MenuComponent}. * @exception HeadlessException if - * GraphicsEnvironment.isHeadless - * returns true + * {@code GraphicsEnvironment.isHeadless} + * returns {@code true} * @see java.awt.GraphicsEnvironment#isHeadless */ public MenuComponent() throws HeadlessException { @@ -176,9 +176,9 @@ public abstract class MenuComponent implements java.io.Serializable { } /** - * Constructs a name for this MenuComponent. - * Called by getName when the name is null. - * @return a name for this MenuComponent + * Constructs a name for this {@code MenuComponent}. + * Called by {@code getName} when the name is {@code null}. + * @return a name for this {@code MenuComponent} */ String constructComponentName() { return null; // For strict compliance with prior platform versions, a MenuComponent @@ -226,7 +226,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Returns the parent container for this menu component. * @return the menu component containing this menu component, - * or null if this menu component + * or {@code null} if this menu component * is the outermost component, the menu bar itself */ public MenuContainer getParent() { @@ -243,7 +243,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Gets the font used for this menu component. * @return the font used in this menu component, if there is one; - * null otherwise + * {@code null} otherwise * @see java.awt.MenuComponent#setFont */ public Font getFont() { @@ -290,7 +290,7 @@ public abstract class MenuComponent implements java.io.Serializable { * component, unless those subcomponents specify a different font. *

      * Some platforms may not support setting of all font attributes - * of a menu component; in such cases, calling setFont + * of a menu component; in such cases, calling {@code setFont} * will have no effect on the unsupported font attributes of this * menu component. Unless subcomponents of this menu component * specify a different font, this font will be used by those @@ -385,7 +385,7 @@ public abstract class MenuComponent implements java.io.Serializable { } /** * Processes events occurring on this menu component. - *

      Note that if the event parameter is null + *

      Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -397,10 +397,10 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Returns a string representing the state of this - * MenuComponent. This method is intended to be used + * {@code MenuComponent}. This method is intended to be used * only for debugging purposes, and the content and format of the * returned string may vary between implementations. The returned - * string may be empty but may not be null. + * string may be empty but may not be {@code null}. * * @return the parameter string of this menu component */ @@ -430,10 +430,10 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Reads the menu component from an object input stream. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns - * true + * {@code GraphicsEnvironment.isHeadless} returns + * {@code true} * @serial * @see java.awt.GraphicsEnvironment#isHeadless */ @@ -466,16 +466,16 @@ public abstract class MenuComponent implements java.io.Serializable { AccessibleContext accessibleContext = null; /** - * Gets the AccessibleContext associated with - * this MenuComponent. + * Gets the {@code AccessibleContext} associated with + * this {@code MenuComponent}. * - * The method implemented by this base class returns null. - * Classes that extend MenuComponent + * The method implemented by this base class returns {@code null}. + * Classes that extend {@code MenuComponent} * should implement this method to return the - * AccessibleContext associated with the subclass. + * {@code AccessibleContext} associated with the subclass. * - * @return the AccessibleContext of this - * MenuComponent + * @return the {@code AccessibleContext} of this + * {@code MenuComponent} * @since 1.3 */ public AccessibleContext getAccessibleContext() { @@ -483,7 +483,7 @@ public abstract class MenuComponent implements java.io.Serializable { } /** - * Inner class of MenuComponent used to provide + * Inner class of {@code MenuComponent} used to provide * default support for accessibility. This class is not meant * to be used directly by application developers, but is instead * meant only to be subclassed by menu component developers. @@ -512,11 +512,11 @@ public abstract class MenuComponent implements java.io.Serializable { // /** - * Gets the AccessibleSelection associated with this - * object which allows its Accessible children to be selected. + * Gets the {@code AccessibleSelection} associated with this + * object which allows its {@code Accessible} children to be selected. * - * @return AccessibleSelection if supported by object; - * else return null + * @return {@code AccessibleSelection} if supported by object; + * else return {@code null} * @see AccessibleSelection */ public AccessibleSelection getAccessibleSelection() { @@ -525,14 +525,14 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Gets the accessible name of this object. This should almost never - * return java.awt.MenuComponent.getName, as that + * return {@code java.awt.MenuComponent.getName}, as that * generally isn't a localized name, and doesn't have meaning for the * user. If the object is fundamentally a text object (e.g. a menu item), the * accessible name should be the text of the object (e.g. "save"). * If the object has a tooltip, the tooltip text may also be an * appropriate String to return. * - * @return the localized name of the object -- can be null + * @return the localized name of the object -- can be {@code null} * if this object does not have a name * @see AccessibleContext#setAccessibleName */ @@ -552,7 +552,7 @@ public abstract class MenuComponent implements java.io.Serializable { * text document" instead). * * @return the localized description of the object -- can be - * null if this object does not have a description + * {@code null} if this object does not have a description * @see AccessibleContext#setAccessibleDescription */ public String getAccessibleDescription() { @@ -562,7 +562,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Gets the role of this object. * - * @return an instance of AccessibleRole + * @return an instance of {@code AccessibleRole} * describing the role of the object * @see AccessibleRole */ @@ -573,7 +573,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Gets the state of this object. * - * @return an instance of AccessibleStateSet + * @return an instance of {@code AccessibleStateSet} * containing the current state set of the object * @see AccessibleState */ @@ -582,13 +582,13 @@ public abstract class MenuComponent implements java.io.Serializable { } /** - * Gets the Accessible parent of this object. - * If the parent of this object implements Accessible, - * this method should simply return getParent. + * Gets the {@code Accessible} parent of this object. + * If the parent of this object implements {@code Accessible}, + * this method should simply return {@code getParent}. * - * @return the Accessible parent of this object -- can - * be null if this object does not have an - * Accessible parent + * @return the {@code Accessible} parent of this object -- can + * be {@code null} if this object does not have an + * {@code Accessible} parent */ public Accessible getAccessibleParent() { if (accessibleParent != null) { @@ -615,7 +615,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Returns the number of accessible children in the object. If all - * of the children of this object implement Accessible, + * of the children of this object implement {@code Accessible}, * then this method should return the number of children of this object. * * @return the number of accessible children in the object @@ -625,7 +625,7 @@ public abstract class MenuComponent implements java.io.Serializable { } /** - * Returns the nth Accessible child of the object. + * Returns the nth {@code Accessible} child of the object. * * @param i zero-based index of child * @return the nth Accessible child of the object @@ -648,8 +648,8 @@ public abstract class MenuComponent implements java.io.Serializable { } /** - * Gets the AccessibleComponent associated with - * this object if one exists. Otherwise return null. + * Gets the {@code AccessibleComponent} associated with + * this object if one exists. Otherwise return {@code null}. * * @return the component */ @@ -664,7 +664,7 @@ public abstract class MenuComponent implements java.io.Serializable { * Gets the background color of this object. * * @return the background color, if supported, of the object; - * otherwise, null + * otherwise, {@code null} */ public Color getBackground() { return null; // Not supported for MenuComponents @@ -672,9 +672,9 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Sets the background color of this object. - * (For transparency, see isOpaque.) + * (For transparency, see {@code isOpaque}.) * - * @param c the new Color for the background + * @param c the new {@code Color} for the background * @see Component#isOpaque */ public void setBackground(Color c) { @@ -685,7 +685,7 @@ public abstract class MenuComponent implements java.io.Serializable { * Gets the foreground color of this object. * * @return the foreground color, if supported, of the object; - * otherwise, null + * otherwise, {@code null} */ public Color getForeground() { return null; // Not supported for MenuComponents @@ -694,59 +694,59 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Sets the foreground color of this object. * - * @param c the new Color for the foreground + * @param c the new {@code Color} for the foreground */ public void setForeground(Color c) { // Not supported for MenuComponents } /** - * Gets the Cursor of this object. + * Gets the {@code Cursor} of this object. * - * @return the Cursor, if supported, of the object; - * otherwise, null + * @return the {@code Cursor}, if supported, of the object; + * otherwise, {@code null} */ public Cursor getCursor() { return null; // Not supported for MenuComponents } /** - * Sets the Cursor of this object. + * Sets the {@code Cursor} of this object. *

      * The method may have no visual effect if the Java platform * implementation and/or the native system do not support * changing the mouse cursor shape. - * @param cursor the new Cursor for the object + * @param cursor the new {@code Cursor} for the object */ public void setCursor(Cursor cursor) { // Not supported for MenuComponents } /** - * Gets the Font of this object. + * Gets the {@code Font} of this object. * - * @return the Font,if supported, for the object; - * otherwise, null + * @return the {@code Font},if supported, for the object; + * otherwise, {@code null} */ public Font getFont() { return MenuComponent.this.getFont(); } /** - * Sets the Font of this object. + * Sets the {@code Font} of this object. * - * @param f the new Font for the object + * @param f the new {@code Font} for the object */ public void setFont(Font f) { MenuComponent.this.setFont(f); } /** - * Gets the FontMetrics of this object. + * Gets the {@code FontMetrics} of this object. * - * @param f the Font + * @param f the {@code Font} * @return the FontMetrics, if supported, the object; - * otherwise, null + * otherwise, {@code null} * @see #getFont */ public FontMetrics getFontMetrics(Font f) { @@ -776,7 +776,7 @@ public abstract class MenuComponent implements java.io.Serializable { * object intends to be visible; however, it may not in fact be * showing on the screen because one of the objects that this object * is contained by is not visible. To determine if an object is - * showing on the screen, use isShowing. + * showing on the screen, use {@code isShowing}. * * @return true if object is visible; otherwise, false */ @@ -811,9 +811,9 @@ public abstract class MenuComponent implements java.io.Serializable { * where the point's x and y coordinates are defined to be relative to * the coordinate system of the object. * - * @param p the Point relative to the coordinate + * @param p the {@code Point} relative to the coordinate * system of the object - * @return true if object contains Point; otherwise false + * @return true if object contains {@code Point}; otherwise false */ public boolean contains(Point p) { return false; // Not supported for MenuComponents @@ -822,7 +822,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Returns the location of the object on the screen. * - * @return location of object on screen -- can be null + * @return location of object on screen -- can be {@code null} * if this object is not on the screen */ public Point getLocationOnScreen() { @@ -834,9 +834,9 @@ public abstract class MenuComponent implements java.io.Serializable { * of a point specifying the object's top-left corner in the screen's * coordinate space. * - * @return an instance of Point representing the + * @return an instance of {@code Point} representing the * top-left corner of the object's bounds in the coordinate - * space of the screen; null if + * space of the screen; {@code null} if * this object or its parent are not on the screen */ public Point getLocation() { @@ -852,12 +852,12 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Gets the bounds of this object in the form of a - * Rectangle object. + * {@code Rectangle} object. * The bounds specify this object's width, height, and location * relative to its parent. * * @return a rectangle indicating this component's bounds; - * null if this object is not on the screen + * {@code null} if this object is not on the screen */ public Rectangle getBounds() { return null; // Not supported for MenuComponents @@ -865,7 +865,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Sets the bounds of this object in the form of a - * Rectangle object. + * {@code Rectangle} object. * The bounds specify this object's width, height, and location * relative to its parent. * @@ -877,13 +877,13 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Returns the size of this object in the form of a - * Dimension object. The height field of - * the Dimension object contains this object's - * height, and the width field of the Dimension + * {@code Dimension} object. The height field of + * the {@code Dimension} object contains this object's + * height, and the width field of the {@code Dimension} * object contains this object's width. * - * @return a Dimension object that indicates the - * size of this component; null + * @return a {@code Dimension} object that indicates the + * size of this component; {@code null} * if this object is not on the screen */ public Dimension getSize() { @@ -893,7 +893,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Resizes this object. * - * @param d - the Dimension specifying the + * @param d the {@code Dimension} specifying the * new size of the object */ public void setSize(Dimension d) { @@ -901,16 +901,16 @@ public abstract class MenuComponent implements java.io.Serializable { } /** - * Returns the Accessible child, if one exists, - * contained at the local coordinate Point. - * If there is no Accessible child, null + * Returns the {@code Accessible} child, if one exists, + * contained at the local coordinate {@code Point}. + * If there is no {@code Accessible} child, {@code null} * is returned. * * @param p the point defining the top-left corner of the - * Accessible, given in the coordinate space + * {@code Accessible}, given in the coordinate space * of the object's parent - * @return the Accessible, if it exists, - * at the specified location; else null + * @return the {@code Accessible}, if it exists, + * at the specified location; else {@code null} */ public Accessible getAccessibleAt(Point p) { return null; // MenuComponents don't have children @@ -956,7 +956,7 @@ public abstract class MenuComponent implements java.io.Serializable { // /** - * Returns the number of Accessible children currently selected. + * Returns the number of {@code Accessible} children currently selected. * If no children are selected, the return value will be 0. * * @return the number of items currently selected @@ -966,10 +966,10 @@ public abstract class MenuComponent implements java.io.Serializable { } /** - * Returns an Accessible representing the specified + * Returns an {@code Accessible} representing the specified * selected child in the object. If there isn't a selection, or there are * fewer children selected than the integer passed in, the return - * value will be null. + * value will be {@code null}. *

      Note that the index represents the i-th selected child, which * is different from the i-th child. * @@ -987,7 +987,7 @@ public abstract class MenuComponent implements java.io.Serializable { * @return true if the current child of this object is selected; * else false * @param i the zero-based index of the child in this - * Accessible object + * {@code Accessible} object * @see AccessibleContext#getAccessibleChild */ public boolean isAccessibleChildSelected(int i) { @@ -995,7 +995,7 @@ public abstract class MenuComponent implements java.io.Serializable { } /** - * Adds the specified Accessible child of the object + * Adds the specified {@code Accessible} child of the object * to the object's selection. If the object supports multiple selections, * the specified child is added to any existing selection, otherwise * it replaces any existing selection in the object. If the @@ -1068,7 +1068,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Gets the state of this object. * - * @return an instance of AccessibleStateSet + * @return an instance of {@code AccessibleStateSet} * containing the current state set of the object * @see AccessibleState */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/MenuItem.java b/jdk/src/java.desktop/share/classes/java/awt/MenuItem.java index 6c289f1ccf5..3a70fe2bee0 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/MenuItem.java +++ b/jdk/src/java.desktop/share/classes/java/awt/MenuItem.java @@ -35,9 +35,9 @@ import sun.awt.AWTAccessor; /** * All items in a menu must belong to the class - * MenuItem, or one of its subclasses. + * {@code MenuItem}, or one of its subclasses. *

      - * The default MenuItem object embodies + * The default {@code MenuItem} object embodies * a simple labeled menu item. *

      * This picture of a menu bar shows five menu items: @@ -45,24 +45,24 @@ import sun.awt.AWTAccessor; * style="float:center; margin: 7px 10px;"> *
      * The first two items are simple menu items, labeled - * "Basic" and "Simple". + * {@code "Basic"} and {@code "Simple"}. * Following these two items is a separator, which is itself - * a menu item, created with the label "-". - * Next is an instance of CheckboxMenuItem - * labeled "Check". The final menu item is a + * a menu item, created with the label {@code "-"}. + * Next is an instance of {@code CheckboxMenuItem} + * labeled {@code "Check"}. The final menu item is a * submenu labeled "More Examples", - * and this submenu is an instance of Menu. + * and this submenu is an instance of {@code Menu}. *

      * When a menu item is selected, AWT sends an action event to * the menu item. Since the event is an - * instance of ActionEvent, the processEvent + * instance of {@code ActionEvent}, the {@code processEvent} * method examines the event and passes it along to - * processActionEvent. The latter method redirects the - * event to any ActionListener objects that have + * {@code processActionEvent}. The latter method redirects the + * event to any {@code ActionListener} objects that have * registered an interest in action events generated by this * menu item. *

      - * Note that the subclass Menu overrides this behavior and + * Note that the subclass {@code Menu} overrides this behavior and * does not send any event to the frame until one of its subitems is * selected. * @@ -103,8 +103,8 @@ public class MenuItem extends MenuComponent implements Accessible { /** * A value to indicate whether a menu item is enabled - * or not. If it is enabled, enabled will - * be set to true. Else enabled will + * or not. If it is enabled, {@code enabled} will + * be set to true. Else {@code enabled} will * be set to false. * * @serial @@ -114,7 +114,7 @@ public class MenuItem extends MenuComponent implements Accessible { boolean enabled = true; /** - * label is the label of a menu item. + * {@code label} is the label of a menu item. * It can be any string. * * @serial @@ -124,9 +124,9 @@ public class MenuItem extends MenuComponent implements Accessible { String label; /** - * This field indicates the command tha has been issued + * This field indicates the command that has been issued * by a particular menu item. - * By default the actionCommand + * By default the {@code actionCommand} * is the label of the menu item, unless it has been * set using setActionCommand. * @@ -204,7 +204,7 @@ public class MenuItem extends MenuComponent implements Accessible { * a separator between menu items. By default, all menu * items except for separators are enabled. * @param label the label for this menu item. - * @param s the instance of MenuShortcut + * @param s the instance of {@code MenuShortcut} * associated with this menu item. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. @@ -239,7 +239,7 @@ public class MenuItem extends MenuComponent implements Accessible { /** * Gets the label for this menu item. - * @return the label of this menu item, or null + * @return the label of this menu item, or {@code null} if this menu item has no label. * @see java.awt.MenuItem#setLabel * @since 1.0 @@ -250,7 +250,7 @@ public class MenuItem extends MenuComponent implements Accessible { /** * Sets the label for this menu item to the specified label. - * @param label the new label, or null for no label. + * @param label the new label, or {@code null} for no label. * @see java.awt.MenuItem#getLabel * @since 1.0 */ @@ -276,8 +276,8 @@ public class MenuItem extends MenuComponent implements Accessible { /** * Sets whether or not this menu item can be chosen. - * @param b if true, enables this menu item; - * if false, disables it. + * @param b if {@code true}, enables this menu item; + * if {@code false}, disables it. * @see java.awt.MenuItem#isEnabled * @since 1.1 */ @@ -287,7 +287,7 @@ public class MenuItem extends MenuComponent implements Accessible { /** * @deprecated As of JDK version 1.1, - * replaced by setEnabled(boolean). + * replaced by {@code setEnabled(boolean)}. */ @Deprecated public synchronized void enable() { @@ -304,7 +304,7 @@ public class MenuItem extends MenuComponent implements Accessible { * @param b if {@code true}, enables this menu item; * otherwise disables * @deprecated As of JDK version 1.1, - * replaced by setEnabled(boolean). + * replaced by {@code setEnabled(boolean)}. */ @Deprecated public void enable(boolean b) { @@ -317,7 +317,7 @@ public class MenuItem extends MenuComponent implements Accessible { /** * @deprecated As of JDK version 1.1, - * replaced by setEnabled(boolean). + * replaced by {@code setEnabled(boolean)}. */ @Deprecated public synchronized void disable() { @@ -329,10 +329,10 @@ public class MenuItem extends MenuComponent implements Accessible { } /** - * Get the MenuShortcut object associated with this + * Get the {@code MenuShortcut} object associated with this * menu item, * @return the menu shortcut associated with this menu item, - * or null if none has been specified. + * or {@code null} if none has been specified. * @see java.awt.MenuItem#setShortcut * @since 1.1 */ @@ -341,7 +341,7 @@ public class MenuItem extends MenuComponent implements Accessible { } /** - * Set the MenuShortcut object associated with this + * Set the {@code MenuShortcut} object associated with this * menu item. If a menu shortcut is already associated with * this menu item, it is replaced. * @param s the menu shortcut to associate @@ -358,7 +358,7 @@ public class MenuItem extends MenuComponent implements Accessible { } /** - * Delete any MenuShortcut object associated + * Delete any {@code MenuShortcut} object associated * with this menu item. * @since 1.1 */ @@ -454,8 +454,8 @@ public class MenuItem extends MenuComponent implements Accessible { *

      * Since event types are automatically enabled when a listener for * that type is added to the menu item, this method only needs - * to be invoked by subclasses of MenuItem which desire to - * have the specified event types delivered to processEvent + * to be invoked by subclasses of {@code MenuItem} which desire to + * have the specified event types delivered to {@code processEvent} * regardless of whether a listener is registered. * * @param eventsToEnable the event mask defining the event types @@ -562,7 +562,7 @@ public class MenuItem extends MenuComponent implements Accessible { * Returns an array of all the action listeners * registered on this menu item. * - * @return all of this menu item's ActionListeners + * @return all of this menu item's {@code ActionListener}s * or an empty array if no action * listeners are currently registered * @@ -579,16 +579,16 @@ public class MenuItem extends MenuComponent implements Accessible { /** * Returns an array of all the objects currently registered * as FooListeners - * upon this MenuItem. + * upon this {@code MenuItem}. * FooListeners are registered using the * addFooListener method. * *

      - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * MenuItem m + * {@code MenuItem m} * for its action listeners with the following code: * *

      ActionListener[] als = (ActionListener[])(m.getListeners(ActionListener.class));
      @@ -598,14 +598,14 @@ public class MenuItem extends MenuComponent implements Accessible { * @param the type of the listeners * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this menu item, * or an empty array if no such * listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @see #getActionListeners * @since 1.3 @@ -620,12 +620,12 @@ public class MenuItem extends MenuComponent implements Accessible { /** * Processes events on this menu item. If the event is an - * instance of ActionEvent, it invokes - * processActionEvent, another method - * defined by MenuItem. + * instance of {@code ActionEvent}, it invokes + * {@code processActionEvent}, another method + * defined by {@code MenuItem}. *

      * Currently, menu items only support action events. - *

      Note that if the event parameter is null + *

      Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -654,16 +654,16 @@ public class MenuItem extends MenuComponent implements Accessible { /** * Processes action events occurring on this menu item, * by dispatching them to any registered - * ActionListener objects. + * {@code ActionListener} objects. * This method is not called unless action events are * enabled for this component. Action events are enabled * when one of the following occurs: *

        - *
      • An ActionListener object is registered - * via addActionListener. - *
      • Action events are enabled via enableEvents. + *
      • An {@code ActionListener} object is registered + * via {@code addActionListener}. + *
      • Action events are enabled via {@code enableEvents}. *
      - *

      Note that if the event parameter is null + *

      Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -681,11 +681,11 @@ public class MenuItem extends MenuComponent implements Accessible { } /** - * Returns a string representing the state of this MenuItem. + * Returns a string representing the state of this {@code MenuItem}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this menu item */ @@ -710,17 +710,17 @@ public class MenuItem extends MenuComponent implements Accessible { /** * Writes default serializable fields to stream. Writes - * a list of serializable ActionListeners + * a list of serializable {@code ActionListeners} * as optional data. The non-serializable listeners are * detected and no attempt is made to serialize them. * - * @param s the ObjectOutputStream to write - * @serialData null terminated sequence of 0 - * or more pairs; the pair consists of a String - * and an Object; the String + * @param s the {@code ObjectOutputStream} to write + * @serialData {@code null} terminated sequence of 0 + * or more pairs; the pair consists of a {@code String} + * and an {@code Object}; the {@code String} * indicates the type of object and is one of the following: - * actionListenerK indicating an - * ActionListener object + * {@code actionListenerK} indicating an + * {@code ActionListener} object * * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see #readObject(ObjectInputStream) @@ -735,15 +735,15 @@ public class MenuItem extends MenuComponent implements Accessible { } /** - * Reads the ObjectInputStream and if it - * isn't null adds a listener to receive - * action events fired by the Menu Item. + * Reads the {@code ObjectInputStream} and if it + * isn't {@code null} adds a listener to receive + * action events fired by the {@code Menu} Item. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns - * true + * {@code GraphicsEnvironment.isHeadless} returns + * {@code true} * @see #removeActionListener(ActionListener) * @see #addActionListener(ActionListener) * @see #writeObject(ObjectOutputStream) @@ -800,7 +800,7 @@ public class MenuItem extends MenuComponent implements Accessible { * subclassed by menu component developers. *

      * This class implements accessibility support for the - * MenuItem class. It provides an implementation of the + * {@code MenuItem} class. It provides an implementation of the * Java Accessibility API appropriate to menu item user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/MenuShortcut.java b/jdk/src/java.desktop/share/classes/java/awt/MenuShortcut.java index cba251bbf4b..57526ff4e6d 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/MenuShortcut.java +++ b/jdk/src/java.desktop/share/classes/java/awt/MenuShortcut.java @@ -27,27 +27,27 @@ package java.awt; import java.awt.event.KeyEvent; /** - * The MenuShortcutclass represents a keyboard accelerator + * The {@code MenuShortcut} class represents a keyboard accelerator * for a MenuItem. *

      * Menu shortcuts are created using virtual keycodes, not characters. * For example, a menu shortcut for Ctrl-a (assuming that Control is * the accelerator key) would be created with code like the following: *

      - * MenuShortcut ms = new MenuShortcut(KeyEvent.VK_A, false); + * {@code MenuShortcut ms = new MenuShortcut(KeyEvent.VK_A, false);} *

      or alternatively *

      - * MenuShortcut ms = new MenuShortcut(KeyEvent.getExtendedKeyCodeForChar('A'), false); + * {@code MenuShortcut ms = new MenuShortcut(KeyEvent.getExtendedKeyCodeForChar('A'), false);} *

      * Menu shortcuts may also be constructed for a wider set of keycodes - * using the java.awt.event.KeyEvent.getExtendedKeyCodeForChar call. + * using the {@code java.awt.event.KeyEvent.getExtendedKeyCodeForChar} call. * For example, a menu shortcut for "Ctrl+cyrillic ef" is created by *

      * MenuShortcut ms = new MenuShortcut(KeyEvent.getExtendedKeyCodeForChar('\u0444'), false); *

      - * Note that shortcuts created with a keycode or an extended keycode defined as a constant in KeyEvent + * Note that shortcuts created with a keycode or an extended keycode defined as a constant in {@code KeyEvent} * work regardless of the current keyboard layout. However, a shortcut made of - * an extended keycode not listed in KeyEvent + * an extended keycode not listed in {@code KeyEvent} * only work if the current keyboard layout produces a corresponding letter. *

      * The accelerator key is platform-dependent and may be obtained @@ -128,8 +128,8 @@ public class MenuShortcut implements java.io.Serializable /** * Returns whether this MenuShortcut must be invoked using the SHIFT key. - * @return true if this MenuShortcut must be invoked using the - * SHIFT key, false otherwise. + * @return {@code true} if this MenuShortcut must be invoked using the + * SHIFT key, {@code false} otherwise. * @since 1.1 */ public boolean usesShiftModifier() { @@ -141,8 +141,8 @@ public class MenuShortcut implements java.io.Serializable * equality is defined to mean that both MenuShortcuts use the same key * and both either use or don't use the SHIFT key. * @param s the MenuShortcut to compare with this. - * @return true if this MenuShortcut is the same as another, - * false otherwise. + * @return {@code true} if this MenuShortcut is the same as another, + * {@code false} otherwise. * @since 1.1 */ public boolean equals(MenuShortcut s) { @@ -155,8 +155,8 @@ public class MenuShortcut implements java.io.Serializable * equality is defined to mean that both MenuShortcuts use the same key * and both either use or don't use the SHIFT key. * @param obj the Object to compare with this. - * @return true if this MenuShortcut is the same as another, - * false otherwise. + * @return {@code true} if this MenuShortcut is the same as another, + * {@code false} otherwise. * @since 1.2 */ public boolean equals(Object obj) { diff --git a/jdk/src/java.desktop/share/classes/java/awt/MouseInfo.java b/jdk/src/java.desktop/share/classes/java/awt/MouseInfo.java index c06e5f12767..60849fc1f5d 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/MouseInfo.java +++ b/jdk/src/java.desktop/share/classes/java/awt/MouseInfo.java @@ -29,7 +29,7 @@ import sun.awt.AWTPermissions; import sun.awt.ComponentFactory; /** - * MouseInfo provides methods for getting information about the mouse, + * {@code MouseInfo} provides methods for getting information about the mouse, * such as mouse pointer location and the number of mouse buttons. * * @author Roman Poborchiy @@ -45,26 +45,26 @@ public class MouseInfo { } /** - * Returns a PointerInfo instance that represents the current + * Returns a {@code PointerInfo} instance that represents the current * location of the mouse pointer. - * The GraphicsDevice stored in this PointerInfo + * The {@code GraphicsDevice} stored in this {@code PointerInfo} * contains the mouse pointer. The coordinate system used for the mouse position - * depends on whether or not the GraphicsDevice is part of a virtual + * depends on whether or not the {@code GraphicsDevice} is part of a virtual * screen device. * For virtual screen devices, the coordinates are given in the virtual * coordinate system, otherwise they are returned in the coordinate system - * of the GraphicsDevice. See {@link GraphicsConfiguration} + * of the {@code GraphicsDevice}. See {@link GraphicsConfiguration} * for more information about the virtual screen devices. - * On systems without a mouse, returns null. + * On systems without a mouse, returns {@code null}. *

      - * If there is a security manager, its checkPermission method - * is called with an AWTPermission("watchMousePointer") - * permission before creating and returning a PointerInfo - * object. This may result in a SecurityException. + * If there is a security manager, its {@code checkPermission} method + * is called with an {@code AWTPermission("watchMousePointer")} + * permission before creating and returning a {@code PointerInfo} + * object. This may result in a {@code SecurityException}. * * @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true * @exception SecurityException if a security manager exists and its - * checkPermission method doesn't allow the operation + * {@code checkPermission} method doesn't allow the operation * @see GraphicsConfiguration * @see SecurityManager#checkPermission * @see java.awt.AWTPermission @@ -118,7 +118,7 @@ public class MouseInfo { /** * Returns the number of buttons on the mouse. - * On systems without a mouse, returns -1. + * On systems without a mouse, returns {@code -1}. * The number of buttons is obtained from the AWT Toolkit * by requesting the {@code "awt.mouse.numButtons"} desktop property * which is set by the underlying native platform. diff --git a/jdk/src/java.desktop/share/classes/java/awt/PageAttributes.java b/jdk/src/java.desktop/share/classes/java/awt/PageAttributes.java index d06ea4c562a..6b718f79536 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/PageAttributes.java +++ b/jdk/src/java.desktop/share/classes/java/awt/PageAttributes.java @@ -942,7 +942,7 @@ public final class PageAttributes implements Cloneable { * @param printerResolution an integer array of 3 elements. The first * element must be greater than 0. The second element must be * must be greater than 0. The third element must be either - * 3 or 4. + * {@code 3} or {@code 4}. * @throws IllegalArgumentException if one or more of the above * conditions is violated. */ @@ -1095,14 +1095,14 @@ public final class PageAttributes implements Cloneable { /** * Specifies the print orientation for pages using these attributes. - * Specifying 3 denotes portrait. Specifying 4 + * Specifying {@code 3} denotes portrait. Specifying {@code 4} * denotes landscape. Specifying any other value will generate an * IllegalArgumentException. Not specifying the property is equivalent * to calling setOrientationRequested(OrientationRequestedType.PORTRAIT). * - * @param orientationRequested 3 or 4 + * @param orientationRequested {@code 3} or {@code 4} * @throws IllegalArgumentException if orientationRequested is not - * 3 or 4 + * {@code 3} or {@code 4} */ public void setOrientationRequested(int orientationRequested) { switch (orientationRequested) { @@ -1189,15 +1189,15 @@ public final class PageAttributes implements Cloneable { /** * Specifies the print quality for pages using these attributes. - * Specifying 3 denotes draft. Specifying 4 - * denotes normal. Specifying 5 denotes high. Specifying + * Specifying {@code 3} denotes draft. Specifying {@code 4} + * denotes normal. Specifying {@code 5} denotes high. Specifying * any other value will generate an IllegalArgumentException. Not * specifying the property is equivalent to calling * setPrintQuality(PrintQualityType.NORMAL). * - * @param printQuality 3, 4, or 5 - * @throws IllegalArgumentException if printQuality is not 3 - * , 4, or 5 + * @param printQuality {@code 3}, {@code 4}, or {@code 5} + * @throws IllegalArgumentException if printQuality is not + * {@code 3}, {@code 4}, or {@code 5} */ public void setPrintQuality(int printQuality) { switch (printQuality) { @@ -1231,13 +1231,13 @@ public final class PageAttributes implements Cloneable { * (typically the horizontal resolution). Index 1 of the array specifies * the feed direction resolution (typically the vertical resolution). * Index 2 of the array specifies whether the resolutions are in dots per - * inch or dots per centimeter. 3 denotes dots per inch. - * 4 denotes dots per centimeter. + * inch or dots per centimeter. {@code 3} denotes dots per inch. + * {@code 4} denotes dots per centimeter. * * @return an integer array of 3 elements. The first * element must be greater than 0. The second element must be * must be greater than 0. The third element must be either - * 3 or 4. + * {@code 3} or {@code 4}. */ public int[] getPrinterResolution() { // Return a copy because otherwise client code could circumvent the @@ -1258,7 +1258,7 @@ public final class PageAttributes implements Cloneable { * resolution). Index 1 of the array specifies the feed direction * resolution (typically the vertical resolution). Index 2 of the array * specifies whether the resolutions are in dots per inch or dots per - * centimeter. 3 denotes dots per inch. 4 + * centimeter. {@code 3} denotes dots per inch. {@code 4} * denotes dots per centimeter. Note that the 1.1 printing implementation * (Toolkit.getPrintJob) requires that the feed and cross feed resolutions * be the same. Not specifying the property is equivalent to calling @@ -1267,7 +1267,7 @@ public final class PageAttributes implements Cloneable { * @param printerResolution an integer array of 3 elements. The first * element must be greater than 0. The second element must be * must be greater than 0. The third element must be either - * 3 or 4. + * {@code 3} or {@code 4}. * @throws IllegalArgumentException if one or more of the above * conditions is violated. */ @@ -1295,7 +1295,7 @@ public final class PageAttributes implements Cloneable { * inch for pages using these attributes. The same value is used for both * resolutions. The actual resolutions will be determined by the * limitations of the implementation and the target printer. Not - * specifying the property is equivalent to specifying 72. + * specifying the property is equivalent to specifying {@code 72}. * * @param printerResolution an integer greater than 0. * @throws IllegalArgumentException if printerResolution is less than or diff --git a/jdk/src/java.desktop/share/classes/java/awt/Paint.java b/jdk/src/java.desktop/share/classes/java/awt/Paint.java index b2e0dabb13e..ba4d601769b 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Paint.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Paint.java @@ -30,16 +30,16 @@ import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; /** - * This Paint interface defines how color patterns + * This {@code Paint} interface defines how color patterns * can be generated for {@link Graphics2D} operations. A class - * implementing the Paint interface is added to the - * Graphics2D context in order to define the color - * pattern used by the draw and fill methods. + * implementing the {@code Paint} interface is added to the + * {@code Graphics2D} context in order to define the color + * pattern used by the {@code draw} and {@code fill} methods. *

      - * Instances of classes implementing Paint must be - * read-only because the Graphics2D does not clone + * Instances of classes implementing {@code Paint} must be + * read-only because the {@code Graphics2D} does not clone * these objects when they are set as an attribute with the - * setPaint method or when the Graphics2D + * {@code setPaint} method or when the {@code Graphics2D} * object is itself cloned. * @see PaintContext * @see Color @@ -74,22 +74,22 @@ public interface Paint extends Transparency { * of the graphics primitive being rendered. * Implementations of the {@code Paint} interface * are allowed to throw {@code NullPointerException} - * for a {@code null} {@code deviceBounds}. + * for a {@code null deviceBounds}. * @param userBounds the user space bounding box * of the graphics primitive being rendered. * Implementations of the {@code Paint} interface * are allowed to throw {@code NullPointerException} - * for a {@code null} {@code userBounds}. + * for a {@code null userBounds}. * @param xform the {@link AffineTransform} from user * space into device space. * Implementations of the {@code Paint} interface * are allowed to throw {@code NullPointerException} - * for a {@code null} {@code xform}. + * for a {@code null xform}. * @param hints the set of hints that the context object can use to * choose between rendering alternatives. * Implementations of the {@code Paint} interface * are allowed to throw {@code NullPointerException} - * for a {@code null} {@code hints}. + * for a {@code null hints}. * @return the {@code PaintContext} for * generating color patterns. * @see PaintContext diff --git a/jdk/src/java.desktop/share/classes/java/awt/PaintContext.java b/jdk/src/java.desktop/share/classes/java/awt/PaintContext.java index 4efafff27d4..faca59d2c8b 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/PaintContext.java +++ b/jdk/src/java.desktop/share/classes/java/awt/PaintContext.java @@ -29,13 +29,13 @@ import java.awt.image.Raster; import java.awt.image.ColorModel; /** - * The PaintContext interface defines the encapsulated + * The {@code PaintContext} interface defines the encapsulated * and optimized environment to generate color patterns in device * space for fill or stroke operations on a - * {@link Graphics2D}. The PaintContext provides - * the necessary colors for Graphics2D operations in the + * {@link Graphics2D}. The {@code PaintContext} provides + * the necessary colors for {@code Graphics2D} operations in the * form of a {@link Raster} associated with a {@link ColorModel}. - * The PaintContext maintains state for a particular paint + * The {@code PaintContext} maintains state for a particular paint * operation. In a multi-threaded environment, several * contexts can exist simultaneously for a single {@link Paint} object. * @see Paint @@ -48,20 +48,20 @@ public interface PaintContext { public void dispose(); /** - * Returns the ColorModel of the output. Note that - * this ColorModel might be different from the hint + * Returns the {@code ColorModel} of the output. Note that + * this {@code ColorModel} might be different from the hint * specified in the * {@link Paint#createContext(ColorModel, Rectangle, Rectangle2D, AffineTransform, RenderingHints) createContext} method of - * Paint. Not all PaintContext objects are + * {@code Paint}. Not all {@code PaintContext} objects are * capable of generating color patterns in an arbitrary - * ColorModel. - * @return the ColorModel of the output. + * {@code ColorModel}. + * @return the {@code ColorModel} of the output. */ ColorModel getColorModel(); /** - * Returns a Raster containing the colors generated for + * Returns a {@code Raster} containing the colors generated for * the graphics operation. * @param x the x coordinate of the area in device space * for which colors are generated. @@ -69,7 +69,7 @@ AffineTransform, RenderingHints) createContext} method of * for which colors are generated. * @param w the width of the area in device space * @param h the height of the area in device space - * @return a Raster representing the specified + * @return a {@code Raster} representing the specified * rectangular area and containing the colors generated for * the graphics operation. */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Panel.java b/jdk/src/java.desktop/share/classes/java/awt/Panel.java index db8d2c412ad..345db85f793 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Panel.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Panel.java @@ -27,12 +27,12 @@ package java.awt; import javax.accessibility.*; /** - * Panel is the simplest container class. A panel + * {@code Panel} is the simplest container class. A panel * provides space in which an application can attach any other * component, including other panels. *

      * The default layout manager for a panel is the - * FlowLayout layout manager. + * {@code FlowLayout} layout manager. * * @author Sami Shaio * @see java.awt.FlowLayout @@ -50,7 +50,7 @@ public class Panel extends Container implements Accessible { /** * Creates a new panel using the default layout manager. * The default layout manager for all panels is the - * FlowLayout class. + * {@code FlowLayout} class. */ public Panel() { this(new FlowLayout()); @@ -111,7 +111,7 @@ public class Panel extends Container implements Accessible { /** * This class implements accessibility support for the - * Panel class. It provides an implementation of the + * {@code Panel} class. It provides an implementation of the * Java Accessibility API appropriate to panel user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Point.java b/jdk/src/java.desktop/share/classes/java/awt/Point.java index 03337998cb5..e967d33a035 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Point.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Point.java @@ -37,7 +37,7 @@ import java.beans.Transient; */ public class Point extends Point2D implements java.io.Serializable { /** - * The X coordinate of this Point. + * The X coordinate of this {@code Point}. * If no X coordinate is set it will default to 0. * * @serial @@ -48,7 +48,7 @@ public class Point extends Point2D implements java.io.Serializable { public int x; /** - * The Y coordinate of this Point. + * The Y coordinate of this {@code Point}. * If no Y coordinate is set it will default to 0. * * @serial @@ -74,7 +74,7 @@ public class Point extends Point2D implements java.io.Serializable { /** * Constructs and initializes a point with the same location as - * the specified Point object. + * the specified {@code Point} object. * @param p a point * @since 1.1 */ @@ -85,8 +85,8 @@ public class Point extends Point2D implements java.io.Serializable { /** * Constructs and initializes a point at the specified * {@code (x,y)} location in the coordinate space. - * @param x the X coordinate of the newly constructed Point - * @param y the Y coordinate of the newly constructed Point + * @param x the X coordinate of the newly constructed {@code Point} + * @param y the Y coordinate of the newly constructed {@code Point} * @since 1.0 */ public Point(int x, int y) { @@ -113,7 +113,7 @@ public class Point extends Point2D implements java.io.Serializable { /** * Returns the location of this point. * This method is included for completeness, to parallel the - * getLocation method of Component. + * {@code getLocation} method of {@code Component}. * @return a copy of this point, at the same location * @see java.awt.Component#getLocation * @see java.awt.Point#setLocation(java.awt.Point) @@ -128,7 +128,7 @@ public class Point extends Point2D implements java.io.Serializable { /** * Sets the location of the point to the specified location. * This method is included for completeness, to parallel the - * setLocation method of Component. + * {@code setLocation} method of {@code Component}. * @param p a point, the new location for this point * @see java.awt.Component#setLocation(java.awt.Point) * @see java.awt.Point#getLocation @@ -142,7 +142,7 @@ public class Point extends Point2D implements java.io.Serializable { * Changes the point to have the specified location. *

      * This method is included for completeness, to parallel the - * setLocation method of Component. + * {@code setLocation} method of {@code Component}. * Its behavior is identical with move(int, int). * @param x the X coordinate of the new location * @param y the Y coordinate of the new location @@ -158,10 +158,10 @@ public class Point extends Point2D implements java.io.Serializable { /** * Sets the location of this point to the specified double coordinates. * The double values will be rounded to integer values. - * Any number smaller than Integer.MIN_VALUE - * will be reset to MIN_VALUE, and any number - * larger than Integer.MAX_VALUE will be - * reset to MAX_VALUE. + * Any number smaller than {@code Integer.MIN_VALUE} + * will be reset to {@code MIN_VALUE}, and any number + * larger than {@code Integer.MAX_VALUE} will be + * reset to {@code MAX_VALUE}. * * @param x the X coordinate of the new location * @param y the Y coordinate of the new location @@ -203,13 +203,13 @@ public class Point extends Point2D implements java.io.Serializable { /** * Determines whether or not two points are equal. Two instances of - * Point2D are equal if the values of their - * x and y member fields, representing + * {@code Point2D} are equal if the values of their + * {@code x} and {@code y} member fields, representing * their position in the coordinate space, are the same. - * @param obj an object to be compared with this Point2D - * @return true if the object to be compared is - * an instance of Point2D and has - * the same values; false otherwise. + * @param obj an object to be compared with this {@code Point2D} + * @return {@code true} if the object to be compared is + * an instance of {@code Point2D} and has + * the same values; {@code false} otherwise. */ public boolean equals(Object obj) { if (obj instanceof Point) { @@ -224,7 +224,7 @@ public class Point extends Point2D implements java.io.Serializable { * in the {@code (x,y)} coordinate space. This method is * intended to be used only for debugging purposes, and the content * and format of the returned string may vary between implementations. - * The returned string may be empty but may not be null. + * The returned string may be empty but may not be {@code null}. * * @return a string representation of this point */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Polygon.java b/jdk/src/java.desktop/share/classes/java/awt/Polygon.java index 7a30a958f45..90ae45ad352 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Polygon.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Polygon.java @@ -32,7 +32,7 @@ import sun.awt.geom.Crossings; import java.util.Arrays; /** - * The Polygon class encapsulates a description of a + * The {@code Polygon} class encapsulates a description of a * closed, two-dimensional region within a coordinate space. This * region is bounded by an arbitrary number of line segments, each of * which is one side of the polygon. Internally, a polygon @@ -41,12 +41,12 @@ import java.util.Arrays; * polygon, and two successive pairs are the endpoints of a * line that is a side of the polygon. The first and final * pairs of {@code (x,y)} points are joined by a line segment - * that closes the polygon. This Polygon is defined with + * that closes the polygon. This {@code Polygon} is defined with * an even-odd winding rule. See * {@link java.awt.geom.PathIterator#WIND_EVEN_ODD WIND_EVEN_ODD} * for a definition of the even-odd winding rule. * This class's hit-testing methods, which include the - * contains, intersects and inside + * {@code contains}, {@code intersects} and {@code inside} * methods, use the insideness definition described in the * {@link Shape} class comments. * @@ -58,8 +58,8 @@ import java.util.Arrays; public class Polygon implements Shape, java.io.Serializable { /** - * The total number of points. The value of npoints - * represents the number of valid points in this Polygon + * The total number of points. The value of {@code npoints} + * represents the number of valid points in this {@code Polygon} * and might be less than the number of elements in * {@link #xpoints xpoints} or {@link #ypoints ypoints}. * This value can be NULL. @@ -73,10 +73,10 @@ public class Polygon implements Shape, java.io.Serializable { /** * The array of X coordinates. The number of elements in * this array might be more than the number of X coordinates - * in this Polygon. The extra elements allow new points - * to be added to this Polygon without re-creating this + * in this {@code Polygon}. The extra elements allow new points + * to be added to this {@code Polygon} without re-creating this * array. The value of {@link #npoints npoints} is equal to the - * number of valid points in this Polygon. + * number of valid points in this {@code Polygon}. * * @serial * @see #addPoint(int, int) @@ -87,10 +87,10 @@ public class Polygon implements Shape, java.io.Serializable { /** * The array of Y coordinates. The number of elements in * this array might be more than the number of Y coordinates - * in this Polygon. The extra elements allow new points - * to be added to this Polygon without re-creating this - * array. The value of npoints is equal to the - * number of valid points in this Polygon. + * in this {@code Polygon}. The extra elements allow new points + * to be added to this {@code Polygon} without re-creating this + * array. The value of {@code npoints} is equal to the + * number of valid points in this {@code Polygon}. * * @serial * @see #addPoint(int, int) @@ -129,19 +129,19 @@ public class Polygon implements Shape, java.io.Serializable { } /** - * Constructs and initializes a Polygon from the specified + * Constructs and initializes a {@code Polygon} from the specified * parameters. * @param xpoints an array of X coordinates * @param ypoints an array of Y coordinates * @param npoints the total number of points in the - * Polygon + * {@code Polygon} * @exception NegativeArraySizeException if the value of - * npoints is negative. - * @exception IndexOutOfBoundsException if npoints is - * greater than the length of xpoints - * or the length of ypoints. - * @exception NullPointerException if xpoints or - * ypoints is null. + * {@code npoints} is negative. + * @exception IndexOutOfBoundsException if {@code npoints} is + * greater than the length of {@code xpoints} + * or the length of {@code ypoints}. + * @exception NullPointerException if {@code xpoints} or + * {@code ypoints} is {@code null}. * @since 1.0 */ public Polygon(int xpoints[], int ypoints[], int npoints) { @@ -164,7 +164,7 @@ public class Polygon implements Shape, java.io.Serializable { } /** - * Resets this Polygon object to an empty polygon. + * Resets this {@code Polygon} object to an empty polygon. * The coordinate arrays and the data in them are left untouched * but the number of points is reset to zero to mark the old * vertex data as invalid and to start accumulating new vertex @@ -172,7 +172,7 @@ public class Polygon implements Shape, java.io.Serializable { * All internally-cached data relating to the old vertices * are discarded. * Note that since the coordinate arrays from before the reset - * are reused, creating a new empty Polygon might + * are reused, creating a new empty {@code Polygon} might * be more memory efficient than resetting the current one if * the number of vertices in the new polygon data is significantly * smaller than the number of vertices in the data from before the @@ -187,11 +187,11 @@ public class Polygon implements Shape, java.io.Serializable { /** * Invalidates or flushes any internally-cached data that depends - * on the vertex coordinates of this Polygon. + * on the vertex coordinates of this {@code Polygon}. * This method should be called after any direct manipulation - * of the coordinates in the xpoints or - * ypoints arrays to avoid inconsistent results - * from methods such as getBounds or contains + * of the coordinates in the {@code xpoints} or + * {@code ypoints} arrays to avoid inconsistent results + * from methods such as {@code getBounds} or {@code contains} * that might cache data from earlier computations relating to * the vertex coordinates. * @see java.awt.Polygon#getBounds @@ -202,9 +202,9 @@ public class Polygon implements Shape, java.io.Serializable { } /** - * Translates the vertices of the Polygon by - * deltaX along the x axis and by - * deltaY along the y axis. + * Translates the vertices of the {@code Polygon} by + * {@code deltaX} along the x axis and by + * {@code deltaY} along the y axis. * @param deltaX the amount to translate along the X axis * @param deltaY the amount to translate along the Y axis * @since 1.1 @@ -221,7 +221,7 @@ public class Polygon implements Shape, java.io.Serializable { /* * Calculates the bounding box of the points passed to the constructor. - * Sets bounds to the result. + * Sets {@code bounds} to the result. * @param xpoints[] array of x coordinates * @param ypoints[] array of y coordinates * @param npoints the total number of points @@ -270,11 +270,11 @@ public class Polygon implements Shape, java.io.Serializable { } /** - * Appends the specified coordinates to this Polygon. + * Appends the specified coordinates to this {@code Polygon}. *

      * If an operation that calculates the bounding box of this - * Polygon has already been performed, such as - * getBounds or contains, then this + * {@code Polygon} has already been performed, such as + * {@code getBounds} or {@code contains}, then this * method updates the bounding box. * @param x the specified X coordinate * @param y the specified Y coordinate @@ -305,12 +305,12 @@ public class Polygon implements Shape, java.io.Serializable { } /** - * Gets the bounding box of this Polygon. + * Gets the bounding box of this {@code Polygon}. * The bounding box is the smallest {@link Rectangle} whose * sides are parallel to the x and y axes of the - * coordinate space, and can completely contain the Polygon. - * @return a Rectangle that defines the bounds of this - * Polygon. + * coordinate space, and can completely contain the {@code Polygon}. + * @return a {@code Rectangle} that defines the bounds of this + * {@code Polygon}. * @since 1.1 */ public Rectangle getBounds() { @@ -318,10 +318,10 @@ public class Polygon implements Shape, java.io.Serializable { } /** - * Returns the bounds of this Polygon. - * @return the bounds of this Polygon. + * Returns the bounds of this {@code Polygon}. + * @return the bounds of this {@code Polygon}. * @deprecated As of JDK version 1.1, - * replaced by getBounds(). + * replaced by {@code getBounds()}. * @since 1.0 */ @Deprecated @@ -337,10 +337,10 @@ public class Polygon implements Shape, java.io.Serializable { /** * Determines whether the specified {@link Point} is inside this - * Polygon. - * @param p the specified Point to be tested - * @return true if the Polygon contains the - * Point; false otherwise. + * {@code Polygon}. + * @param p the specified {@code Point} to be tested + * @return {@code true} if the {@code Polygon} contains the + * {@code Point}; {@code false} otherwise. * @see #contains(double, double) * @since 1.0 */ @@ -350,7 +350,7 @@ public class Polygon implements Shape, java.io.Serializable { /** * Determines whether the specified coordinates are inside this - * Polygon. + * {@code Polygon}. * * @param x the specified X coordinate to be tested * @param y the specified Y coordinate to be tested @@ -366,7 +366,7 @@ public class Polygon implements Shape, java.io.Serializable { /** * Determines whether the specified coordinates are contained in this - * Polygon. + * {@code Polygon}. * @param x the specified X coordinate to be tested * @param y the specified Y coordinate to be tested * @return {@code true} if this {@code Polygon} contains @@ -374,7 +374,7 @@ public class Polygon implements Shape, java.io.Serializable { * {@code false} otherwise. * @see #contains(double, double) * @deprecated As of JDK version 1.1, - * replaced by contains(int, int). + * replaced by {@code contains(int, int)}. * @since 1.0 */ @Deprecated @@ -531,15 +531,15 @@ public class Polygon implements Shape, java.io.Serializable { /** * Returns an iterator object that iterates along the boundary of this - * Polygon and provides access to the geometry - * of the outline of this Polygon. An optional + * {@code Polygon} and provides access to the geometry + * of the outline of this {@code Polygon}. An optional * {@link AffineTransform} can be specified so that the coordinates * returned in the iteration are transformed accordingly. - * @param at an optional AffineTransform to be applied to the + * @param at an optional {@code AffineTransform} to be applied to the * coordinates as they are returned in the iteration, or - * null if untransformed coordinates are desired + * {@code null} if untransformed coordinates are desired * @return a {@link PathIterator} object that provides access to the - * geometry of this Polygon. + * geometry of this {@code Polygon}. * @since 1.2 */ public PathIterator getPathIterator(AffineTransform at) { @@ -548,23 +548,23 @@ public class Polygon implements Shape, java.io.Serializable { /** * Returns an iterator object that iterates along the boundary of - * the Shape and provides access to the geometry of the - * outline of the Shape. Only SEG_MOVETO, SEG_LINETO, and + * the {@code Shape} and provides access to the geometry of the + * outline of the {@code Shape}. Only SEG_MOVETO, SEG_LINETO, and * SEG_CLOSE point types are returned by the iterator. - * Since polygons are already flat, the flatness parameter - * is ignored. An optional AffineTransform can be specified + * Since polygons are already flat, the {@code flatness} parameter + * is ignored. An optional {@code AffineTransform} can be specified * in which case the coordinates returned in the iteration are transformed * accordingly. - * @param at an optional AffineTransform to be applied to the + * @param at an optional {@code AffineTransform} to be applied to the * coordinates as they are returned in the iteration, or - * null if untransformed coordinates are desired + * {@code null} if untransformed coordinates are desired * @param flatness the maximum amount that the control points * for a given curve can vary from collinear before a subdivided * curve is replaced by a straight line connecting the * endpoints. Since polygons are already flat the - * flatness parameter is ignored. - * @return a PathIterator object that provides access to the - * Shape object's geometry. + * {@code flatness} parameter is ignored. + * @return a {@code PathIterator} object that provides access to the + * {@code Shape} object's geometry. * @since 1.2 */ public PathIterator getPathIterator(AffineTransform at, double flatness) { @@ -597,8 +597,8 @@ public class Polygon implements Shape, java.io.Serializable { /** * Tests if there are more points to read. - * @return true if there are more points to read; - * false otherwise. + * @return {@code true} if there are more points to read; + * {@code false} otherwise. */ public boolean isDone() { return index > poly.npoints; @@ -618,12 +618,12 @@ public class Polygon implements Shape, java.io.Serializable { * the iteration. * The return value is the path segment type: * SEG_MOVETO, SEG_LINETO, or SEG_CLOSE. - * A float array of length 2 must be passed in and + * A {@code float} array of length 2 must be passed in and * can be used to store the coordinates of the point(s). - * Each point is stored as a pair of float x, y + * Each point is stored as a pair of {@code float} x, y * coordinates. SEG_MOVETO and SEG_LINETO types return one * point, and SEG_CLOSE does not return any points. - * @param coords a float array that specifies the + * @param coords a {@code float} array that specifies the * coordinates of the point(s) * @return an integer representing the type and coordinates of the * current path segment. @@ -648,13 +648,13 @@ public class Polygon implements Shape, java.io.Serializable { * the iteration. * The return value is the path segment type: * SEG_MOVETO, SEG_LINETO, or SEG_CLOSE. - * A double array of length 2 must be passed in and + * A {@code double} array of length 2 must be passed in and * can be used to store the coordinates of the point(s). - * Each point is stored as a pair of double x, y + * Each point is stored as a pair of {@code double} x, y * coordinates. * SEG_MOVETO and SEG_LINETO types return one point, * and SEG_CLOSE does not return any points. - * @param coords a double array that specifies the + * @param coords a {@code double} array that specifies the * coordinates of the point(s) * @return an integer representing the type and coordinates of the * current path segment. diff --git a/jdk/src/java.desktop/share/classes/java/awt/PopupMenu.java b/jdk/src/java.desktop/share/classes/java/awt/PopupMenu.java index 7e4ffc8cb91..253351f164a 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/PopupMenu.java +++ b/jdk/src/java.desktop/share/classes/java/awt/PopupMenu.java @@ -35,11 +35,11 @@ import sun.awt.AWTAccessor; * A class that implements a menu which can be dynamically popped up * at a specified position within a component. *

      - * As the inheritance hierarchy implies, a PopupMenu - * can be used anywhere a Menu can be used. - * However, if you use a PopupMenu like a Menu - * (e.g., you add it to a MenuBar), then you cannot - * call show on that PopupMenu. + * As the inheritance hierarchy implies, a {@code PopupMenu} + * can be used anywhere a {@code Menu} can be used. + * However, if you use a {@code PopupMenu} like a {@code Menu} + * (e.g., you add it to a {@code MenuBar}), then you cannot + * call {@code show} on that {@code PopupMenu}. * * @author Amy Fowler */ @@ -77,7 +77,7 @@ public class PopupMenu extends Menu { /** * Creates a new popup menu with the specified name. * - * @param label a non-null string specifying + * @param label a non-{@code null} string specifying * the popup menu's label * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. @@ -98,8 +98,8 @@ public class PopupMenu extends Menu { } /** - * Constructs a name for this MenuComponent. - * Called by getName when the name is null. + * Constructs a name for this {@code MenuComponent}. + * Called by {@code getName} when the name is {@code null}. */ String constructComponentName() { synchronized (PopupMenu.class) { @@ -139,16 +139,16 @@ public class PopupMenu extends Menu { * hierarchy of the popup menu's parent. Both the origin and the parent * must be showing on the screen for this method to be valid. *

      - * If this PopupMenu is being used as a Menu - * (i.e., it has a non-Component parent), - * then you cannot call this method on the PopupMenu. + * If this {@code PopupMenu} is being used as a {@code Menu} + * (i.e., it has a non-{@code Component} parent), + * then you cannot call this method on the {@code PopupMenu}. * * @param origin the component which defines the coordinate space * @param x the x coordinate position to popup the menu * @param y the y coordinate position to popup the menu - * @exception NullPointerException if the parent is null - * @exception IllegalArgumentException if this PopupMenu - * has a non-Component parent + * @exception NullPointerException if the parent is {@code null} + * @exception IllegalArgumentException if this {@code PopupMenu} + * has a non-{@code Component} parent * @exception IllegalArgumentException if the origin is not in the * parent's hierarchy * @exception RuntimeException if the parent is not showing on screen @@ -196,11 +196,11 @@ public class PopupMenu extends Menu { //////////////// /** - * Gets the AccessibleContext associated with this - * PopupMenu. + * Gets the {@code AccessibleContext} associated with this + * {@code PopupMenu}. * - * @return the AccessibleContext of this - * PopupMenu + * @return the {@code AccessibleContext} of this + * {@code PopupMenu} * @since 1.3 */ public AccessibleContext getAccessibleContext() { diff --git a/jdk/src/java.desktop/share/classes/java/awt/Rectangle.java b/jdk/src/java.desktop/share/classes/java/awt/Rectangle.java index 04bfc026499..fcc5cf3c729 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Rectangle.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Rectangle.java @@ -29,14 +29,14 @@ import java.awt.geom.Rectangle2D; import java.beans.Transient; /** - * A Rectangle specifies an area in a coordinate space that is - * enclosed by the Rectangle object's upper-left point + * A {@code Rectangle} specifies an area in a coordinate space that is + * enclosed by the {@code Rectangle} object's upper-left point * {@code (x,y)} * in the coordinate space, its width, and its height. *

      - * A Rectangle object's width and - * height are public fields. The constructors - * that create a Rectangle, and the methods that can modify + * A {@code Rectangle} object's {@code width} and + * {@code height} are {@code public} fields. The constructors + * that create a {@code Rectangle}, and the methods that can modify * one, do not prevent setting a negative value for width or height. *

      * @@ -120,7 +120,7 @@ public class Rectangle extends Rectangle2D { /** - * The X coordinate of the upper-left corner of the Rectangle. + * The X coordinate of the upper-left corner of the {@code Rectangle}. * * @serial * @see #setLocation(int, int) @@ -130,7 +130,7 @@ public class Rectangle extends Rectangle2D public int x; /** - * The Y coordinate of the upper-left corner of the Rectangle. + * The Y coordinate of the upper-left corner of the {@code Rectangle}. * * @serial * @see #setLocation(int, int) @@ -140,7 +140,7 @@ public class Rectangle extends Rectangle2D public int y; /** - * The width of the Rectangle. + * The width of the {@code Rectangle}. * @serial * @see #setSize(int, int) * @see #getSize() @@ -149,7 +149,7 @@ public class Rectangle extends Rectangle2D public int width; /** - * The height of the Rectangle. + * The height of the {@code Rectangle}. * * @serial * @see #setSize(int, int) @@ -177,7 +177,7 @@ public class Rectangle extends Rectangle2D } /** - * Constructs a new Rectangle whose upper-left corner + * Constructs a new {@code Rectangle} whose upper-left corner * is at (0, 0) in the coordinate space, and whose width and * height are both zero. */ @@ -186,10 +186,10 @@ public class Rectangle extends Rectangle2D } /** - * Constructs a new Rectangle, initialized to match - * the values of the specified Rectangle. - * @param r the Rectangle from which to copy initial values - * to a newly constructed Rectangle + * Constructs a new {@code Rectangle}, initialized to match + * the values of the specified {@code Rectangle}. + * @param r the {@code Rectangle} from which to copy initial values + * to a newly constructed {@code Rectangle} * @since 1.1 */ public Rectangle(Rectangle r) { @@ -197,14 +197,14 @@ public class Rectangle extends Rectangle2D } /** - * Constructs a new Rectangle whose upper-left corner is + * Constructs a new {@code Rectangle} whose upper-left corner is * specified as * {@code (x,y)} and whose width and height * are specified by the arguments of the same name. * @param x the specified X coordinate * @param y the specified Y coordinate - * @param width the width of the Rectangle - * @param height the height of the Rectangle + * @param width the width of the {@code Rectangle} + * @param height the height of the {@code Rectangle} * @since 1.0 */ public Rectangle(int x, int y, int width, int height) { @@ -215,94 +215,94 @@ public class Rectangle extends Rectangle2D } /** - * Constructs a new Rectangle whose upper-left corner + * Constructs a new {@code Rectangle} whose upper-left corner * is at (0, 0) in the coordinate space, and whose width and * height are specified by the arguments of the same name. - * @param width the width of the Rectangle - * @param height the height of the Rectangle + * @param width the width of the {@code Rectangle} + * @param height the height of the {@code Rectangle} */ public Rectangle(int width, int height) { this(0, 0, width, height); } /** - * Constructs a new Rectangle whose upper-left corner is + * Constructs a new {@code Rectangle} whose upper-left corner is * specified by the {@link Point} argument, and * whose width and height are specified by the * {@link Dimension} argument. - * @param p a Point that is the upper-left corner of - * the Rectangle - * @param d a Dimension, representing the - * width and height of the Rectangle + * @param p a {@code Point} that is the upper-left corner of + * the {@code Rectangle} + * @param d a {@code Dimension}, representing the + * width and height of the {@code Rectangle} */ public Rectangle(Point p, Dimension d) { this(p.x, p.y, d.width, d.height); } /** - * Constructs a new Rectangle whose upper-left corner is the - * specified Point, and whose width and height are both zero. - * @param p a Point that is the top left corner - * of the Rectangle + * Constructs a new {@code Rectangle} whose upper-left corner is the + * specified {@code Point}, and whose width and height are both zero. + * @param p a {@code Point} that is the top left corner + * of the {@code Rectangle} */ public Rectangle(Point p) { this(p.x, p.y, 0, 0); } /** - * Constructs a new Rectangle whose top left corner is + * Constructs a new {@code Rectangle} whose top left corner is * (0, 0) and whose width and height are specified - * by the Dimension argument. - * @param d a Dimension, specifying width and height + * by the {@code Dimension} argument. + * @param d a {@code Dimension}, specifying width and height */ public Rectangle(Dimension d) { this(0, 0, d.width, d.height); } /** - * Returns the X coordinate of the bounding Rectangle in - * double precision. - * @return the X coordinate of the bounding Rectangle. + * Returns the X coordinate of the bounding {@code Rectangle} in + * {@code double} precision. + * @return the X coordinate of the bounding {@code Rectangle}. */ public double getX() { return x; } /** - * Returns the Y coordinate of the bounding Rectangle in - * double precision. - * @return the Y coordinate of the bounding Rectangle. + * Returns the Y coordinate of the bounding {@code Rectangle} in + * {@code double} precision. + * @return the Y coordinate of the bounding {@code Rectangle}. */ public double getY() { return y; } /** - * Returns the width of the bounding Rectangle in - * double precision. - * @return the width of the bounding Rectangle. + * Returns the width of the bounding {@code Rectangle} in + * {@code double} precision. + * @return the width of the bounding {@code Rectangle}. */ public double getWidth() { return width; } /** - * Returns the height of the bounding Rectangle in - * double precision. - * @return the height of the bounding Rectangle. + * Returns the height of the bounding {@code Rectangle} in + * {@code double} precision. + * @return the height of the bounding {@code Rectangle}. */ public double getHeight() { return height; } /** - * Gets the bounding Rectangle of this Rectangle. + * Gets the bounding {@code Rectangle} of this {@code Rectangle}. *

      * This method is included for completeness, to parallel the - * getBounds method of + * {@code getBounds} method of * {@link Component}. - * @return a new Rectangle, equal to the - * bounding Rectangle for this Rectangle. + * @return a new {@code Rectangle}, equal to the + * bounding {@code Rectangle} for this {@code Rectangle}. * @see java.awt.Component#getBounds * @see #setBounds(Rectangle) * @see #setBounds(int, int, int, int) @@ -322,12 +322,12 @@ public class Rectangle extends Rectangle2D } /** - * Sets the bounding Rectangle of this Rectangle - * to match the specified Rectangle. + * Sets the bounding {@code Rectangle} of this {@code Rectangle} + * to match the specified {@code Rectangle}. *

      * This method is included for completeness, to parallel the - * setBounds method of Component. - * @param r the specified Rectangle + * {@code setBounds} method of {@code Component}. + * @param r the specified {@code Rectangle} * @see #getBounds * @see java.awt.Component#setBounds(java.awt.Rectangle) * @since 1.1 @@ -337,19 +337,19 @@ public class Rectangle extends Rectangle2D } /** - * Sets the bounding Rectangle of this - * Rectangle to the specified - * x, y, width, - * and height. + * Sets the bounding {@code Rectangle} of this + * {@code Rectangle} to the specified + * {@code x}, {@code y}, {@code width}, + * and {@code height}. *

      * This method is included for completeness, to parallel the - * setBounds method of Component. + * {@code setBounds} method of {@code Component}. * @param x the new X coordinate for the upper-left - * corner of this Rectangle + * corner of this {@code Rectangle} * @param y the new Y coordinate for the upper-left - * corner of this Rectangle - * @param width the new width for this Rectangle - * @param height the new height for this Rectangle + * corner of this {@code Rectangle} + * @param width the new width for this {@code Rectangle} + * @param height the new height for this {@code Rectangle} * @see #getBounds * @see java.awt.Component#setBounds(int, int, int, int) * @since 1.1 @@ -417,19 +417,19 @@ public class Rectangle extends Rectangle2D } /** - * Sets the bounding Rectangle of this - * Rectangle to the specified - * x, y, width, - * and height. + * Sets the bounding {@code Rectangle} of this + * {@code Rectangle} to the specified + * {@code x}, {@code y}, {@code width}, + * and {@code height}. * * @param x the new X coordinate for the upper-left - * corner of this Rectangle + * corner of this {@code Rectangle} * @param y the new Y coordinate for the upper-left - * corner of this Rectangle - * @param width the new width for this Rectangle - * @param height the new height for this Rectangle + * corner of this {@code Rectangle} + * @param width the new width for this {@code Rectangle} + * @param height the new height for this {@code Rectangle} * @deprecated As of JDK version 1.1, - * replaced by setBounds(int, int, int, int). + * replaced by {@code setBounds(int, int, int, int)}. */ @Deprecated public void reshape(int x, int y, int width, int height) { @@ -440,12 +440,12 @@ public class Rectangle extends Rectangle2D } /** - * Returns the location of this Rectangle. + * Returns the location of this {@code Rectangle}. *

      * This method is included for completeness, to parallel the - * getLocation method of Component. - * @return the Point that is the upper-left corner of - * this Rectangle. + * {@code getLocation} method of {@code Component}. + * @return the {@code Point} that is the upper-left corner of + * this {@code Rectangle}. * @see java.awt.Component#getLocation * @see #setLocation(Point) * @see #setLocation(int, int) @@ -456,12 +456,12 @@ public class Rectangle extends Rectangle2D } /** - * Moves this Rectangle to the specified location. + * Moves this {@code Rectangle} to the specified location. *

      * This method is included for completeness, to parallel the - * setLocation method of Component. - * @param p the Point specifying the new location - * for this Rectangle + * {@code setLocation} method of {@code Component}. + * @param p the {@code Point} specifying the new location + * for this {@code Rectangle} * @see java.awt.Component#setLocation(java.awt.Point) * @see #getLocation * @since 1.1 @@ -471,10 +471,10 @@ public class Rectangle extends Rectangle2D } /** - * Moves this Rectangle to the specified location. + * Moves this {@code Rectangle} to the specified location. *

      * This method is included for completeness, to parallel the - * setLocation method of Component. + * {@code setLocation} method of {@code Component}. * @param x the X coordinate of the new location * @param y the Y coordinate of the new location * @see #getLocation @@ -486,12 +486,12 @@ public class Rectangle extends Rectangle2D } /** - * Moves this Rectangle to the specified location. + * Moves this {@code Rectangle} to the specified location. * * @param x the X coordinate of the new location * @param y the Y coordinate of the new location * @deprecated As of JDK version 1.1, - * replaced by setLocation(int, int). + * replaced by {@code setLocation(int, int)}. */ @Deprecated public void move(int x, int y) { @@ -500,12 +500,12 @@ public class Rectangle extends Rectangle2D } /** - * Translates this Rectangle the indicated distance, + * Translates this {@code Rectangle} the indicated distance, * to the right along the X coordinate axis, and * downward along the Y coordinate axis. - * @param dx the distance to move this Rectangle + * @param dx the distance to move this {@code Rectangle} * along the X axis - * @param dy the distance to move this Rectangle + * @param dy the distance to move this {@code Rectangle} * along the Y axis * @see java.awt.Rectangle#setLocation(int, int) * @see java.awt.Rectangle#setLocation(java.awt.Point) @@ -578,13 +578,13 @@ public class Rectangle extends Rectangle2D } /** - * Gets the size of this Rectangle, represented by - * the returned Dimension. + * Gets the size of this {@code Rectangle}, represented by + * the returned {@code Dimension}. *

      * This method is included for completeness, to parallel the - * getSize method of Component. - * @return a Dimension, representing the size of - * this Rectangle. + * {@code getSize} method of {@code Component}. + * @return a {@code Dimension}, representing the size of + * this {@code Rectangle}. * @see java.awt.Component#getSize * @see #setSize(Dimension) * @see #setSize(int, int) @@ -595,12 +595,12 @@ public class Rectangle extends Rectangle2D } /** - * Sets the size of this Rectangle to match the - * specified Dimension. + * Sets the size of this {@code Rectangle} to match the + * specified {@code Dimension}. *

      * This method is included for completeness, to parallel the - * setSize method of Component. - * @param d the new size for the Dimension object + * {@code setSize} method of {@code Component}. + * @param d the new size for the {@code Dimension} object * @see java.awt.Component#setSize(java.awt.Dimension) * @see #getSize * @since 1.1 @@ -610,13 +610,13 @@ public class Rectangle extends Rectangle2D } /** - * Sets the size of this Rectangle to the specified + * Sets the size of this {@code Rectangle} to the specified * width and height. *

      * This method is included for completeness, to parallel the - * setSize method of Component. - * @param width the new width for this Rectangle - * @param height the new height for this Rectangle + * {@code setSize} method of {@code Component}. + * @param width the new width for this {@code Rectangle} + * @param height the new height for this {@code Rectangle} * @see java.awt.Component#setSize(int, int) * @see #getSize * @since 1.1 @@ -626,13 +626,13 @@ public class Rectangle extends Rectangle2D } /** - * Sets the size of this Rectangle to the specified + * Sets the size of this {@code Rectangle} to the specified * width and height. * - * @param width the new width for this Rectangle - * @param height the new height for this Rectangle + * @param width the new width for this {@code Rectangle} + * @param height the new height for this {@code Rectangle} * @deprecated As of JDK version 1.1, - * replaced by setSize(int, int). + * replaced by {@code setSize(int, int)}. */ @Deprecated public void resize(int width, int height) { @@ -641,12 +641,12 @@ public class Rectangle extends Rectangle2D } /** - * Checks whether or not this Rectangle contains the - * specified Point. - * @param p the Point to test - * @return true if the specified Point - * is inside this Rectangle; - * false otherwise. + * Checks whether or not this {@code Rectangle} contains the + * specified {@code Point}. + * @param p the {@code Point} to test + * @return {@code true} if the specified {@code Point} + * is inside this {@code Rectangle}; + * {@code false} otherwise. * @since 1.1 */ public boolean contains(Point p) { @@ -654,15 +654,15 @@ public class Rectangle extends Rectangle2D } /** - * Checks whether or not this Rectangle contains the + * Checks whether or not this {@code Rectangle} contains the * point at the specified location {@code (x,y)}. * * @param x the specified X coordinate * @param y the specified Y coordinate - * @return true if the point + * @return {@code true} if the point * {@code (x,y)} is inside this - * Rectangle; - * false otherwise. + * {@code Rectangle}; + * {@code false} otherwise. * @since 1.1 */ public boolean contains(int x, int y) { @@ -670,13 +670,13 @@ public class Rectangle extends Rectangle2D } /** - * Checks whether or not this Rectangle entirely contains - * the specified Rectangle. + * Checks whether or not this {@code Rectangle} entirely contains + * the specified {@code Rectangle}. * - * @param r the specified Rectangle - * @return true if the Rectangle - * is contained entirely inside this Rectangle; - * false otherwise + * @param r the specified {@code Rectangle} + * @return {@code true} if the {@code Rectangle} + * is contained entirely inside this {@code Rectangle}; + * {@code false} otherwise * @since 1.2 */ public boolean contains(Rectangle r) { @@ -684,18 +684,18 @@ public class Rectangle extends Rectangle2D } /** - * Checks whether this Rectangle entirely contains - * the Rectangle + * Checks whether this {@code Rectangle} entirely contains + * the {@code Rectangle} * at the specified location {@code (X,Y)} with the * specified dimensions {@code (W,H)}. * @param X the specified X coordinate * @param Y the specified Y coordinate - * @param W the width of the Rectangle - * @param H the height of the Rectangle - * @return true if the Rectangle specified by + * @param W the width of the {@code Rectangle} + * @param H the height of the {@code Rectangle} + * @return {@code true} if the {@code Rectangle} specified by * {@code (X, Y, W, H)} - * is entirely enclosed inside this Rectangle; - * false otherwise. + * is entirely enclosed inside this {@code Rectangle}; + * {@code false} otherwise. * @since 1.1 */ public boolean contains(int X, int Y, int W, int H) { @@ -736,17 +736,17 @@ public class Rectangle extends Rectangle2D } /** - * Checks whether or not this Rectangle contains the + * Checks whether or not this {@code Rectangle} contains the * point at the specified location {@code (X,Y)}. * * @param X the specified X coordinate * @param Y the specified Y coordinate - * @return true if the point + * @return {@code true} if the point * {@code (X,Y)} is inside this - * Rectangle; - * false otherwise. + * {@code Rectangle}; + * {@code false} otherwise. * @deprecated As of JDK version 1.1, - * replaced by contains(int, int). + * replaced by {@code contains(int, int)}. */ @Deprecated public boolean inside(int X, int Y) { @@ -770,14 +770,14 @@ public class Rectangle extends Rectangle2D } /** - * Determines whether or not this Rectangle and the specified - * Rectangle intersect. Two rectangles intersect if + * Determines whether or not this {@code Rectangle} and the specified + * {@code Rectangle} intersect. Two rectangles intersect if * their intersection is nonempty. * - * @param r the specified Rectangle - * @return true if the specified Rectangle - * and this Rectangle intersect; - * false otherwise. + * @param r the specified {@code Rectangle} + * @return {@code true} if the specified {@code Rectangle} + * and this {@code Rectangle} intersect; + * {@code false} otherwise. */ public boolean intersects(Rectangle r) { int tw = this.width; @@ -803,16 +803,16 @@ public class Rectangle extends Rectangle2D } /** - * Computes the intersection of this Rectangle with the - * specified Rectangle. Returns a new Rectangle + * Computes the intersection of this {@code Rectangle} with the + * specified {@code Rectangle}. Returns a new {@code Rectangle} * that represents the intersection of the two rectangles. * If the two rectangles do not intersect, the result will be * an empty rectangle. * - * @param r the specified Rectangle - * @return the largest Rectangle contained in both the - * specified Rectangle and in - * this Rectangle; or if the rectangles + * @param r the specified {@code Rectangle} + * @return the largest {@code Rectangle} contained in both the + * specified {@code Rectangle} and in + * this {@code Rectangle}; or if the rectangles * do not intersect, an empty rectangle. */ public Rectangle intersection(Rectangle r) { @@ -839,9 +839,9 @@ public class Rectangle extends Rectangle2D } /** - * Computes the union of this Rectangle with the - * specified Rectangle. Returns a new - * Rectangle that + * Computes the union of this {@code Rectangle} with the + * specified {@code Rectangle}. Returns a new + * {@code Rectangle} that * represents the union of the two rectangles. *

      * If either {@code Rectangle} has any dimension less than zero @@ -856,10 +856,10 @@ public class Rectangle extends Rectangle2D * too large to be expressed as an {@code int}, the result * will have a dimension of {@code Integer.MAX_VALUE} along * that dimension. - * @param r the specified Rectangle - * @return the smallest Rectangle containing both - * the specified Rectangle and this - * Rectangle. + * @param r the specified {@code Rectangle} + * @return the smallest {@code Rectangle} containing both + * the specified {@code Rectangle} and this + * {@code Rectangle}. */ public Rectangle union(Rectangle r) { long tx2 = this.width; @@ -911,14 +911,14 @@ public class Rectangle extends Rectangle2D * have a location equal to the specified coordinates and * width and height equal to zero. *

      - * After adding a point, a call to contains with the + * After adding a point, a call to {@code contains} with the * added point as an argument does not necessarily return - * true. The contains method does not - * return true for points on the right or bottom - * edges of a Rectangle. Therefore, if the added point + * {@code true}. The {@code contains} method does not + * return {@code true} for points on the right or bottom + * edges of a {@code Rectangle}. Therefore, if the added point * falls on the right or bottom edge of the enlarged - * Rectangle, contains returns - * false for that point. + * {@code Rectangle}, {@code contains} returns + * {@code false} for that point. * If the specified point must be contained within the new * {@code Rectangle}, a 1x1 rectangle should be added instead: *

      @@ -962,29 +962,29 @@ public class Rectangle extends Rectangle2D
            * have a location equal to the coordinates of the specified
            * {@code Point} and width and height equal to zero.
            * 

      - * After adding a Point, a call to contains - * with the added Point as an argument does not - * necessarily return true. The contains - * method does not return true for points on the right - * or bottom edges of a Rectangle. Therefore if the added - * Point falls on the right or bottom edge of the - * enlarged Rectangle, contains returns - * false for that Point. + * After adding a {@code Point}, a call to {@code contains} + * with the added {@code Point} as an argument does not + * necessarily return {@code true}. The {@code contains} + * method does not return {@code true} for points on the right + * or bottom edges of a {@code Rectangle}. Therefore if the added + * {@code Point} falls on the right or bottom edge of the + * enlarged {@code Rectangle}, {@code contains} returns + * {@code false} for that {@code Point}. * If the specified point must be contained within the new * {@code Rectangle}, a 1x1 rectangle should be added instead: *

            *     r.add(pt.x, pt.y, 1, 1);
            * 
      - * @param pt the new Point to add to this - * Rectangle + * @param pt the new {@code Point} to add to this + * {@code Rectangle} */ public void add(Point pt) { add(pt.x, pt.y); } /** - * Adds a Rectangle to this Rectangle. - * The resulting Rectangle is the union of the two + * Adds a {@code Rectangle} to this {@code Rectangle}. + * The resulting {@code Rectangle} is the union of the two * rectangles. *

      * If either {@code Rectangle} has any dimension less than 0, the @@ -1003,7 +1003,7 @@ public class Rectangle extends Rectangle2D * too large to be expressed as an {@code int}, the result * will have a dimension of {@code Integer.MAX_VALUE} along * that dimension. - * @param r the specified Rectangle + * @param r the specified {@code Rectangle} */ public void add(Rectangle r) { long tx2 = this.width; @@ -1039,19 +1039,19 @@ public class Rectangle extends Rectangle2D } /** - * Resizes the Rectangle both horizontally and vertically. + * Resizes the {@code Rectangle} both horizontally and vertically. *

      - * This method modifies the Rectangle so that it is - * h units larger on both the left and right side, - * and v units larger at both the top and bottom. + * This method modifies the {@code Rectangle} so that it is + * {@code h} units larger on both the left and right side, + * and {@code v} units larger at both the top and bottom. *

      - * The new Rectangle has {@code (x - h, y - v)} + * The new {@code Rectangle} has {@code (x - h, y - v)} * as its upper-left corner, * width of {@code (width + 2h)}, * and a height of {@code (height + 2v)}. *

      - * If negative values are supplied for h and - * v, the size of the Rectangle + * If negative values are supplied for {@code h} and + * {@code v}, the size of the {@code Rectangle} * decreases accordingly. * The {@code grow} method will check for integer overflow * and underflow, but does not check whether the resulting @@ -1183,14 +1183,14 @@ public class Rectangle extends Rectangle2D /** * Checks whether two rectangles are equal. *

      - * The result is true if and only if the argument is not - * null and is a Rectangle object that has the + * The result is {@code true} if and only if the argument is not + * {@code null} and is a {@code Rectangle} object that has the * same upper-left corner, width, and height as - * this Rectangle. - * @param obj the Object to compare with - * this Rectangle - * @return true if the objects are equal; - * false otherwise. + * this {@code Rectangle}. + * @param obj the {@code Object} to compare with + * this {@code Rectangle} + * @return {@code true} if the objects are equal; + * {@code false} otherwise. */ public boolean equals(Object obj) { if (obj instanceof Rectangle) { @@ -1204,10 +1204,10 @@ public class Rectangle extends Rectangle2D } /** - * Returns a String representing this - * Rectangle and its values. - * @return a String representing this - * Rectangle object's coordinate and size values. + * Returns a {@code String} representing this + * {@code Rectangle} and its values. + * @return a {@code String} representing this + * {@code Rectangle} object's coordinate and size values. */ public String toString() { return getClass().getName() + "[x=" + x + ",y=" + y + ",width=" + width + ",height=" + height + "]"; diff --git a/jdk/src/java.desktop/share/classes/java/awt/RenderingHints.java b/jdk/src/java.desktop/share/classes/java/awt/RenderingHints.java index 524fc999ad1..6403821b66a 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/RenderingHints.java +++ b/jdk/src/java.desktop/share/classes/java/awt/RenderingHints.java @@ -161,9 +161,9 @@ public class RenderingHints /** * Returns true if the specified object is a valid value * for this Key. - * @param val the Object to test for validity - * @return true if val is valid; - * false otherwise. + * @param val the {@code Object} to test for validity + * @return {@code true} if {@code val} is valid; + * {@code false} otherwise. */ public abstract boolean isCompatibleValue(Object val); @@ -519,7 +519,7 @@ public class RenderingHints /** * LCD text contrast rendering hint key. - * The value is an Integer object which is used as a text + * The value is an {@code Integer} object which is used as a text * contrast adjustment when used in conjunction with an LCD text * anti-aliasing hint such as * {@link #VALUE_TEXT_ANTIALIAS_LCD_HRGB}. @@ -1028,7 +1028,7 @@ public class RenderingHints * Constructs a new object with the specified key/value pair. * @param key the key of the particular hint property * @param value the value of the hint property specified with - * key + * {@code key} */ public RenderingHints(Key key, Object value) { hintmap.put(key, value); @@ -1036,21 +1036,21 @@ public class RenderingHints /** * Returns the number of key-value mappings in this - * RenderingHints. + * {@code RenderingHints}. * * @return the number of key-value mappings in this - * RenderingHints. + * {@code RenderingHints}. */ public int size() { return hintmap.size(); } /** - * Returns true if this - * RenderingHints contains no key-value mappings. + * Returns {@code true} if this + * {@code RenderingHints} contains no key-value mappings. * - * @return true if this - * RenderingHints contains no key-value mappings. + * @return {@code true} if this + * {@code RenderingHints} contains no key-value mappings. */ public boolean isEmpty() { return hintmap.isEmpty(); @@ -1074,19 +1074,19 @@ public class RenderingHints /** * Returns true if this RenderingHints maps one or more keys to the * specified value. - * More formally, returns true if and only - * if this RenderingHints - * contains at least one mapping to a value v such that + * More formally, returns {@code true} if and only + * if this {@code RenderingHints} + * contains at least one mapping to a value {@code v} such that *

            * (value==null ? v==null : value.equals(v))
            * 
      . * This operation will probably require time linear in the - * RenderingHints size for most implementations - * of RenderingHints. + * {@code RenderingHints} size for most implementations + * of {@code RenderingHints}. * * @param value value whose presence in this - * RenderingHints is to be tested. - * @return true if this RenderingHints + * {@code RenderingHints} is to be tested. + * @return {@code true} if this {@code RenderingHints} * maps one or more keys to the specified value. */ public boolean containsValue(Object value) { @@ -1139,19 +1139,19 @@ public class RenderingHints /** * Adds all of the keys and corresponding values from the specified - * RenderingHints object to this - * RenderingHints object. Keys that are present in - * this RenderingHints object, but not in the specified - * RenderingHints object are not affected. + * {@code RenderingHints} object to this + * {@code RenderingHints} object. Keys that are present in + * this {@code RenderingHints} object, but not in the specified + * {@code RenderingHints} object are not affected. * @param hints the set of key/value pairs to be added to this - * RenderingHints object + * {@code RenderingHints} object */ public void add(RenderingHints hints) { hintmap.putAll(hints.hintmap); } /** - * Clears this RenderingHints object of all key/value + * Clears this {@code RenderingHints} object of all key/value * pairs. */ public void clear() { @@ -1202,93 +1202,93 @@ public class RenderingHints } /** - * Returns a Set view of the Keys contained in this - * RenderingHints. The Set is backed by the - * RenderingHints, so changes to the - * RenderingHints are reflected in the Set, - * and vice-versa. If the RenderingHints is modified - * while an iteration over the Set is in progress, - * the results of the iteration are undefined. The Set + * Returns a {@code Set} view of the Keys contained in this + * {@code RenderingHints}. The Set is backed by the + * {@code RenderingHints}, so changes to the + * {@code RenderingHints} are reflected in the {@code Set}, + * and vice-versa. If the {@code RenderingHints} is modified + * while an iteration over the {@code Set} is in progress, + * the results of the iteration are undefined. The {@code Set} * supports element removal, which removes the corresponding - * mapping from the RenderingHints, via the - * Iterator.remove, Set.remove, - * removeAll retainAll, and - * clear operations. It does not support - * the add or addAll operations. + * mapping from the {@code RenderingHints}, via the + * {@code Iterator.remove}, {@code Set.remove}, + * {@code removeAll retainAll}, and + * {@code clear} operations. It does not support + * the {@code add} or {@code addAll} operations. * - * @return a Set view of the keys contained - * in this RenderingHints. + * @return a {@code Set} view of the keys contained + * in this {@code RenderingHints}. */ public Set keySet() { return hintmap.keySet(); } /** - * Returns a Collection view of the values - * contained in this RenderingHints. - * The Collection is backed by the - * RenderingHints, so changes to - * the RenderingHints are reflected in - * the Collection, and vice-versa. - * If the RenderingHints is modified while - * an iteration over the Collection is + * Returns a {@code Collection} view of the values + * contained in this {@code RenderingHints}. + * The {@code Collection} is backed by the + * {@code RenderingHints}, so changes to + * the {@code RenderingHints} are reflected in + * the {@code Collection}, and vice-versa. + * If the {@code RenderingHints} is modified while + * an iteration over the {@code Collection} is * in progress, the results of the iteration are undefined. - * The Collection supports element removal, + * The {@code Collection} supports element removal, * which removes the corresponding mapping from the - * RenderingHints, via the - * Iterator.remove, - * Collection.remove, removeAll, - * retainAll and clear operations. - * It does not support the add or - * addAll operations. + * {@code RenderingHints}, via the + * {@code Iterator.remove}, + * {@code Collection.remove}, {@code removeAll}, + * {@code retainAll} and {@code clear} operations. + * It does not support the {@code add} or + * {@code addAll} operations. * - * @return a Collection view of the values - * contained in this RenderingHints. + * @return a {@code Collection} view of the values + * contained in this {@code RenderingHints}. */ public Collection values() { return hintmap.values(); } /** - * Returns a Set view of the mappings contained - * in this RenderingHints. Each element in the - * returned Set is a Map.Entry. - * The Set is backed by the RenderingHints, - * so changes to the RenderingHints are reflected - * in the Set, and vice-versa. If the - * RenderingHints is modified while - * while an iteration over the Set is in progress, + * Returns a {@code Set} view of the mappings contained + * in this {@code RenderingHints}. Each element in the + * returned {@code Set} is a {@code Map.Entry}. + * The {@code Set} is backed by the {@code RenderingHints}, + * so changes to the {@code RenderingHints} are reflected + * in the {@code Set}, and vice-versa. If the + * {@code RenderingHints} is modified while + * while an iteration over the {@code Set} is in progress, * the results of the iteration are undefined. *

      - * The entrySet returned from a RenderingHints object + * The entrySet returned from a {@code RenderingHints} object * is not modifiable. * - * @return a Set view of the mappings contained in - * this RenderingHints. + * @return a {@code Set} view of the mappings contained in + * this {@code RenderingHints}. */ public Set> entrySet() { return Collections.unmodifiableMap(hintmap).entrySet(); } /** - * Compares the specified Object with this - * RenderingHints for equality. - * Returns true if the specified object is also a - * Map and the two Map objects represent - * the same mappings. More formally, two Map objects - * t1 and t2 represent the same mappings - * if t1.keySet().equals(t2.keySet()) and for every - * key k in t1.keySet(), + * Compares the specified {@code Object} with this + * {@code RenderingHints} for equality. + * Returns {@code true} if the specified object is also a + * {@code Map} and the two {@code Map} objects represent + * the same mappings. More formally, two {@code Map} objects + * {@code t1} and {@code t2} represent the same mappings + * if {@code t1.keySet().equals(t2.keySet())} and for every + * key {@code k} in {@code t1.keySet()}, *

            * (t1.get(k)==null ? t2.get(k)==null : t1.get(k).equals(t2.get(k)))
            * 
      . - * This ensures that the equals method works properly across - * different implementations of the Map interface. + * This ensures that the {@code equals} method works properly across + * different implementations of the {@code Map} interface. * - * @param o Object to be compared for equality with - * this RenderingHints. - * @return true if the specified Object - * is equal to this RenderingHints. + * @param o {@code Object} to be compared for equality with + * this {@code RenderingHints}. + * @return {@code true} if the specified {@code Object} + * is equal to this {@code RenderingHints}. */ public boolean equals(Object o) { if (o instanceof RenderingHints) { @@ -1300,16 +1300,16 @@ public class RenderingHints } /** - * Returns the hash code value for this RenderingHints. - * The hash code of a RenderingHints is defined to be - * the sum of the hashCodes of each Entry in the - * RenderingHints object's entrySet view. This ensures that - * t1.equals(t2) implies that - * t1.hashCode()==t2.hashCode() for any two Map - * objects t1 and t2, as required by the general - * contract of Object.hashCode. + * Returns the hash code value for this {@code RenderingHints}. + * The hash code of a {@code RenderingHints} is defined to be + * the sum of the hashCodes of each {@code Entry} in the + * {@code RenderingHints} object's entrySet view. This ensures that + * {@code t1.equals(t2)} implies that + * {@code t1.hashCode()==t2.hashCode()} for any two {@code Map} + * objects {@code t1} and {@code t2}, as required by the general + * contract of {@code Object.hashCode}. * - * @return the hash code value for this RenderingHints. + * @return the hash code value for this {@code RenderingHints}. * @see java.util.Map.Entry#hashCode() * @see Object#hashCode() * @see Object#equals(Object) @@ -1320,8 +1320,8 @@ public class RenderingHints } /** - * Creates a clone of this RenderingHints object - * that has the same contents as this RenderingHints + * Creates a clone of this {@code RenderingHints} object + * that has the same contents as this {@code RenderingHints} * object. * @return a clone of this instance. */ @@ -1344,7 +1344,7 @@ public class RenderingHints /** * Returns a rather long string representation of the hashmap * which contains the mappings of keys to values for this - * RenderingHints object. + * {@code RenderingHints} object. * @return a string representation of this object. */ public String toString() { diff --git a/jdk/src/java.desktop/share/classes/java/awt/Robot.java b/jdk/src/java.desktop/share/classes/java/awt/Robot.java index a915b2232b9..8483ed35297 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Robot.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Robot.java @@ -49,12 +49,12 @@ import sun.awt.image.SunWritableRaster; * Using the class to generate input events differs from posting * events to the AWT event queue or AWT components in that the * events are generated in the platform's native input - * queue. For example, Robot.mouseMove will actually move + * queue. For example, {@code Robot.mouseMove} will actually move * the mouse cursor instead of just generating mouse move events. *

      * Note that some platforms require special privileges or extensions * to access low-level input control. If the current platform configuration - * does not allow input control, an AWTException will be thrown + * does not allow input control, an {@code AWTException} will be thrown * when trying to construct Robot objects. For example, X-Window systems * will throw the exception if the XTEST 2.2 standard extension is not supported * (or not enabled) by the X server. @@ -80,7 +80,7 @@ public class Robot { * @throws AWTException if the platform configuration does not allow * low-level input control. This exception is always thrown when * GraphicsEnvironment.isHeadless() returns true - * @throws SecurityException if createRobot permission is not granted + * @throws SecurityException if {@code createRobot} permission is not granted * @see java.awt.GraphicsEnvironment#isHeadless * @see SecurityManager#checkPermission * @see AWTPermission @@ -113,9 +113,9 @@ public class Robot { * @throws AWTException if the platform configuration does not allow * low-level input control. This exception is always thrown when * GraphicsEnvironment.isHeadless() returns true. - * @throws IllegalArgumentException if screen is not a screen + * @throws IllegalArgumentException if {@code screen} is not a screen * GraphicsDevice. - * @throws SecurityException if createRobot permission is not granted + * @throws SecurityException if {@code createRobot} permission is not granted * @see java.awt.GraphicsEnvironment#isHeadless * @see GraphicsDevice * @see SecurityManager#checkPermission @@ -336,14 +336,14 @@ public class Robot { /** * Presses a given key. The key should be released using the - * keyRelease method. + * {@code keyRelease} method. *

      * Key codes that have more than one physical key associated with them - * (e.g. KeyEvent.VK_SHIFT could mean either the + * (e.g. {@code KeyEvent.VK_SHIFT} could mean either the * left or right shift key) will map to the left key. * - * @param keycode Key to press (e.g. KeyEvent.VK_A) - * @throws IllegalArgumentException if keycode is not + * @param keycode Key to press (e.g. {@code KeyEvent.VK_A}) + * @throws IllegalArgumentException if {@code keycode} is not * a valid key * @see #keyRelease(int) * @see java.awt.event.KeyEvent @@ -358,11 +358,11 @@ public class Robot { * Releases a given key. *

      * Key codes that have more than one physical key associated with them - * (e.g. KeyEvent.VK_SHIFT could mean either the + * (e.g. {@code KeyEvent.VK_SHIFT} could mean either the * left or right shift key) will map to the left key. * - * @param keycode Key to release (e.g. KeyEvent.VK_A) - * @throws IllegalArgumentException if keycode is not a + * @param keycode Key to release (e.g. {@code KeyEvent.VK_A}) + * @throws IllegalArgumentException if {@code keycode} is not a * valid key * @see #keyPress(int) * @see java.awt.event.KeyEvent @@ -399,8 +399,8 @@ public class Robot { * not include the mouse cursor. * @param screenRect Rect to capture in screen coordinates * @return The captured image - * @throws IllegalArgumentException if screenRect width and height are not greater than zero - * @throws SecurityException if readDisplayPixels permission is not granted + * @throws IllegalArgumentException if {@code screenRect} width and height are not greater than zero + * @throws SecurityException if {@code readDisplayPixels} permission is not granted * @see SecurityManager#checkPermission * @see AWTPermission */ @@ -470,18 +470,18 @@ public class Robot { } /** - * Returns whether this Robot automatically invokes waitForIdle + * Returns whether this Robot automatically invokes {@code waitForIdle} * after generating an event. - * @return Whether waitForIdle is automatically called + * @return Whether {@code waitForIdle} is automatically called */ public synchronized boolean isAutoWaitForIdle() { return isAutoWaitForIdle; } /** - * Sets whether this Robot automatically invokes waitForIdle + * Sets whether this Robot automatically invokes {@code waitForIdle} * after generating an event. - * @param isOn Whether waitForIdle is automatically invoked + * @param isOn Whether {@code waitForIdle} is automatically invoked */ public synchronized void setAutoWaitForIdle(boolean isOn) { isAutoWaitForIdle = isOn; @@ -526,8 +526,8 @@ public class Robot { /** * Sleeps for the specified time. - * To catch any InterruptedExceptions that occur, - * Thread.sleep() may be used instead. + * To catch any {@code InterruptedException}s that occur, + * {@code Thread.sleep()} may be used instead. * * @param ms time to sleep in milliseconds * @throws IllegalArgumentException if {@code ms} diff --git a/jdk/src/java.desktop/share/classes/java/awt/ScrollPane.java b/jdk/src/java.desktop/share/classes/java/awt/ScrollPane.java index 65eaed68924..8ae391daa89 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/ScrollPane.java +++ b/jdk/src/java.desktop/share/classes/java/awt/ScrollPane.java @@ -47,8 +47,8 @@ import java.io.IOException; * *

      * The state of the horizontal and vertical scrollbars is represented - * by two ScrollPaneAdjustable objects (one for each - * dimension) which implement the Adjustable interface. + * by two {@code ScrollPaneAdjustable} objects (one for each + * dimension) which implement the {@code Adjustable} interface. * The API provides methods to access those objects such that the * attributes on the Adjustable object (such as unitIncrement, value, * etc.) can be manipulated. @@ -71,7 +71,7 @@ import java.io.IOException; * be reset using setSize(). *

      * Scrolling with the wheel on a wheel-equipped mouse is enabled by default. - * This can be disabled using setWheelScrollingEnabled. + * This can be disabled using {@code setWheelScrollingEnabled}. * Wheel scrolling can be customized by setting the block and * unit increment of the horizontal and vertical Adjustables. * For information on how mouse wheel events are dispatched, see @@ -136,9 +136,9 @@ public class ScrollPane extends Container implements Accessible { /** * An adjustable vertical scrollbar. * It is important to note that you must NOT call 3 - * Adjustable methods, namely: - * setMinimum(), setMaximum(), - * setVisibleAmount(). + * {@code Adjustable} methods, namely: + * {@code setMinimum()}, {@code setMaximum()}, + * {@code setVisibleAmount()}. * * @serial * @see #getVAdjustable @@ -148,9 +148,9 @@ public class ScrollPane extends Container implements Accessible { /** * An adjustable horizontal scrollbar. * It is important to note that you must NOT call 3 - * Adjustable methods, namely: - * setMinimum(), setMaximum(), - * setVisibleAmount(). + * {@code Adjustable} methods, namely: + * {@code setMinimum()}, {@code setMaximum()}, + * {@code setVisibleAmount()}. * * @serial * @see #getHAdjustable @@ -318,10 +318,10 @@ public class ScrollPane extends Container implements Accessible { } /** - * Returns the ScrollPaneAdjustable object which + * Returns the {@code ScrollPaneAdjustable} object which * represents the state of the vertical scrollbar. * The declared return type of this method is - * Adjustable to maintain backward compatibility. + * {@code Adjustable} to maintain backward compatibility. * * @see java.awt.ScrollPaneAdjustable * @return the vertical scrollbar state @@ -331,10 +331,10 @@ public class ScrollPane extends Container implements Accessible { } /** - * Returns the ScrollPaneAdjustable object which + * Returns the {@code ScrollPaneAdjustable} object which * represents the state of the horizontal scrollbar. * The declared return type of this method is - * Adjustable to maintain backward compatibility. + * {@code Adjustable} to maintain backward compatibility. * * @see java.awt.ScrollPaneAdjustable * @return the horizontal scrollbar state @@ -488,7 +488,7 @@ public class ScrollPane extends Container implements Accessible { /** * @deprecated As of JDK version 1.1, - * replaced by doLayout(). + * replaced by {@code doLayout()}. */ @Deprecated public void layout() { @@ -573,11 +573,11 @@ public class ScrollPane extends Container implements Accessible { /** * Returns a string representing the state of this - * ScrollPane. This + * {@code ScrollPane}. This * method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this scroll pane */ @@ -610,8 +610,8 @@ public class ScrollPane extends Container implements Accessible { /** * Process mouse wheel events that are delivered to this - * ScrollPane by scrolling an appropriate amount. - *

      Note that if the event parameter is null + * {@code ScrollPane} by scrolling an appropriate amount. + *

      Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -643,9 +643,9 @@ public class ScrollPane extends Container implements Accessible { * Enables/disables scrolling in response to movement of the mouse wheel. * Wheel scrolling is enabled by default. * - * @param handleWheel true if scrolling should be done + * @param handleWheel {@code true} if scrolling should be done * automatically for a MouseWheelEvent, - * false otherwise. + * {@code false} otherwise. * @see #isWheelScrollingEnabled * @see java.awt.event.MouseWheelEvent * @see java.awt.event.MouseWheelListener @@ -683,8 +683,8 @@ public class ScrollPane extends Container implements Accessible { /** * Reads default serializable fields to stream. * @exception HeadlessException if - * GraphicsEnvironment.isHeadless() returns - * true + * {@code GraphicsEnvironment.isHeadless()} returns + * {@code true} * @see java.awt.GraphicsEnvironment#isHeadless */ private void readObject(ObjectInputStream s) @@ -779,7 +779,7 @@ public class ScrollPane extends Container implements Accessible { /** * This class implements accessibility support for the - * ScrollPane class. It provides an implementation of the + * {@code ScrollPane} class. It provides an implementation of the * Java Accessibility API appropriate to scroll pane user-interface * elements. * @since 1.3 diff --git a/jdk/src/java.desktop/share/classes/java/awt/ScrollPaneAdjustable.java b/jdk/src/java.desktop/share/classes/java/awt/ScrollPaneAdjustable.java index 6d3a6d01bf9..657c7d7e6d1 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/ScrollPaneAdjustable.java +++ b/jdk/src/java.desktop/share/classes/java/awt/ScrollPaneAdjustable.java @@ -34,15 +34,15 @@ import java.io.Serializable; /** * This class represents the state of a horizontal or vertical - * scrollbar of a ScrollPane. Objects of this class are - * returned by ScrollPane methods. + * scrollbar of a {@code ScrollPane}. Objects of this class are + * returned by {@code ScrollPane} methods. * * @since 1.4 */ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** - * The ScrollPane this object is a scrollbar of. + * The {@code ScrollPane} this object is a scrollbar of. * @serial */ private ScrollPane sp; @@ -59,8 +59,8 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * The value of this scrollbar. - * value should be greater than minimum - * and less than maximum + * {@code value} should be greater than {@code minimum} + * and less than {@code maximum} * * @serial * @see #getValue @@ -70,14 +70,14 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * The minimum value of this scrollbar. - * This value can only be set by the ScrollPane. + * This value can only be set by the {@code ScrollPane}. *

      * ATTN: In current implementation - * minimum is always 0. This field can - * only be altered via setSpan method and - * ScrollPane always calls that method with - * 0 for the minimum. getMinimum method - * always returns 0 without checking this field. + * {@code minimum} is always {@code 0}. This field can + * only be altered via {@code setSpan} method and + * {@code ScrollPane} always calls that method with + * {@code 0} for the minimum. {@code getMinimum} method + * always returns {@code 0} without checking this field. * * @serial * @see #getMinimum @@ -87,7 +87,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * The maximum value of this scrollbar. - * This value can only be set by the ScrollPane. + * This value can only be set by the {@code ScrollPane}. * * @serial * @see #getMaximum @@ -97,7 +97,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * The size of the visible portion of this scrollbar. - * This value can only be set by the ScrollPane. + * This value can only be set by the {@code ScrollPane}. * * @serial * @see #getVisibleAmount @@ -106,7 +106,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { private int visibleAmount; /** - * The adjusting status of the Scrollbar. + * The adjusting status of the {@code Scrollbar}. * True if the value is in the process of changing as a result of * actions being taken by the user. * @@ -141,7 +141,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { private AdjustmentListener adjustmentListener; /** - * Error message for AWTError reported when one of + * Error message for {@code AWTError} reported when one of * the public but unsupported methods is called. */ private static final String SCROLLPANE_ONLY = @@ -174,13 +174,13 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * Constructs a new object to represent specified scrollabar - * of the specified ScrollPane. + * of the specified {@code ScrollPane}. * Only ScrollPane creates instances of this class. - * @param sp ScrollPane - * @param l AdjustmentListener to add upon creation. + * @param sp {@code ScrollPane} + * @param l {@code AdjustmentListener} to add upon creation. * @param orientation specifies which scrollbar this object represents, - * can be either Adjustable.HORIZONTAL - * or Adjustable.VERTICAL. + * can be either {@code Adjustable.HORIZONTAL} + * or {@code Adjustable.VERTICAL}. */ ScrollPaneAdjustable(ScrollPane sp, AdjustmentListener l, int orientation) { this.sp = sp; @@ -190,8 +190,8 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * This is called by the scrollpane itself to update the - * minimum, maximum and - * visible values. The scrollpane is the only one + * {@code minimum}, {@code maximum} and + * {@code visible} values. The scrollpane is the only one * that should be changing these since it is the source of these * values. */ @@ -208,8 +208,8 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * Returns the orientation of this scrollbar. * @return the orientation of this scrollbar, either - * Adjustable.HORIZONTAL or - * Adjustable.VERTICAL + * {@code Adjustable.HORIZONTAL} or + * {@code Adjustable.VERTICAL} */ public int getOrientation() { return orientation; @@ -218,7 +218,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * This method should NOT be called by user code. * This method is public for this class to properly implement - * Adjustable interface. + * {@code Adjustable} interface. * * @throws AWTError Always throws an error when called. */ @@ -235,7 +235,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * This method should NOT be called by user code. * This method is public for this class to properly implement - * Adjustable interface. + * {@code Adjustable} interface. * * @throws AWTError Always throws an error when called. */ @@ -272,7 +272,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * This method should NOT be called by user code. * This method is public for this class to properly implement - * Adjustable interface. + * {@code Adjustable} interface. * * @throws AWTError Always throws an error when called. */ @@ -286,7 +286,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** - * Sets the valueIsAdjusting property. + * Sets the {@code valueIsAdjusting} property. * * @param b new adjustment-in-progress status * @see #getValueIsAdjusting @@ -307,7 +307,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { * Returns true if the value is in the process of changing as a * result of actions being taken by the user. * - * @return the value of the valueIsAdjusting property + * @return the value of the {@code valueIsAdjusting} property * @see #setValueIsAdjusting */ public boolean getValueIsAdjusting() { @@ -361,8 +361,8 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * Adds the specified adjustment listener to receive adjustment - * events from this ScrollPaneAdjustable. - * If l is null, no exception is thrown + * events from this {@code ScrollPaneAdjustable}. + * If {@code l} is {@code null}, no exception is thrown * and no action is performed. *

      Refer to AWT Threading Issues for details on AWT's threading model. @@ -382,8 +382,8 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * Removes the specified adjustment listener so that it no longer - * receives adjustment events from this ScrollPaneAdjustable. - * If l is null, no exception is thrown + * receives adjustment events from this {@code ScrollPaneAdjustable}. + * If {@code l} is {@code null}, no exception is thrown * and no action is performed. *

      Refer to AWT Threading Issues for details on AWT's threading model. @@ -404,10 +404,10 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * Returns an array of all the adjustment listeners - * registered on this ScrollPaneAdjustable. + * registered on this {@code ScrollPaneAdjustable}. * - * @return all of this ScrollPaneAdjustable's - * AdjustmentListeners + * @return all of this {@code ScrollPaneAdjustable}'s + * {@code AdjustmentListener}s * or an empty array if no adjustment * listeners are currently registered * @@ -435,7 +435,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { * This method is intended to be used only for debugging purposes, * and the content and format of the returned string may vary * between implementations. The returned string may be empty but - * may not be null. + * may not be {@code null}. * * @return the parameter string of this scrollbar. */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Scrollbar.java b/jdk/src/java.desktop/share/classes/java/awt/Scrollbar.java index ae2cb0e7d41..7bec1ef7956 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Scrollbar.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Scrollbar.java @@ -34,7 +34,7 @@ import javax.accessibility.*; /** - * The Scrollbar class embodies a scroll bar, a + * The {@code Scrollbar} class embodies a scroll bar, a * familiar user-interface object. A scroll bar provides a * convenient means for allowing a user to select from a * range of values. The following three vertical @@ -72,9 +72,9 @@ import javax.accessibility.*; *


      *

      * Note that the actual maximum value of the scroll bar is the - * maximum minus the visible amount. - * In the previous example, because the maximum is - * 300 and the visible amount is 60, the actual maximum + * {@code maximum} minus the {@code visible amount}. + * In the previous example, because the {@code maximum} is + * 300 and the {@code visible amount} is 60, the actual maximum * value is 240. The range of the scrollbar track is 0 - 300. * The left side of the bubble indicates the value of the * scroll bar. @@ -89,39 +89,39 @@ import javax.accessibility.*; * increment and block decrement areas. *

      * When the user changes the value of the scroll bar, the scroll bar - * receives an instance of AdjustmentEvent. + * receives an instance of {@code AdjustmentEvent}. * The scroll bar processes this event, passing it along to * any registered listeners. *

      * Any object that wishes to be notified of changes to the * scroll bar's value should implement - * AdjustmentListener, an interface defined in - * the package java.awt.event. + * {@code AdjustmentListener}, an interface defined in + * the package {@code java.awt.event}. * Listeners can be added and removed dynamically by calling - * the methods addAdjustmentListener and - * removeAdjustmentListener. + * the methods {@code addAdjustmentListener} and + * {@code removeAdjustmentListener}. *

      - * The AdjustmentEvent class defines five types + * The {@code AdjustmentEvent} class defines five types * of adjustment event, listed here: * *

        - *
      • AdjustmentEvent.TRACK is sent out when the + *
      • {@code AdjustmentEvent.TRACK} is sent out when the * user drags the scroll bar's bubble. - *
      • AdjustmentEvent.UNIT_INCREMENT is sent out + *
      • {@code AdjustmentEvent.UNIT_INCREMENT} is sent out * when the user clicks in the left arrow of a horizontal scroll * bar, or the top arrow of a vertical scroll bar, or makes the * equivalent gesture from the keyboard. - *
      • AdjustmentEvent.UNIT_DECREMENT is sent out + *
      • {@code AdjustmentEvent.UNIT_DECREMENT} is sent out * when the user clicks in the right arrow of a horizontal scroll * bar, or the bottom arrow of a vertical scroll bar, or makes the * equivalent gesture from the keyboard. - *
      • AdjustmentEvent.BLOCK_INCREMENT is sent out + *
      • {@code AdjustmentEvent.BLOCK_INCREMENT} is sent out * when the user clicks in the track, to the left of the bubble * on a horizontal scroll bar, or above the bubble on a vertical * scroll bar. By convention, the Page Up * key is equivalent, if the user is using a keyboard that * defines a Page Up key. - *
      • AdjustmentEvent.BLOCK_DECREMENT is sent out + *
      • {@code AdjustmentEvent.BLOCK_DECREMENT} is sent out * when the user clicks in the track, to the right of the bubble * on a horizontal scroll bar, or below the bubble on a vertical * scroll bar. By convention, the Page Down @@ -138,23 +138,23 @@ import javax.accessibility.*; * and the corresponding JDK 1.0 event type it replaces. * *
          - *
        • AdjustmentEvent.TRACK replaces - * Event.SCROLL_ABSOLUTE - *
        • AdjustmentEvent.UNIT_INCREMENT replaces - * Event.SCROLL_LINE_UP - *
        • AdjustmentEvent.UNIT_DECREMENT replaces - * Event.SCROLL_LINE_DOWN - *
        • AdjustmentEvent.BLOCK_INCREMENT replaces - * Event.SCROLL_PAGE_UP - *
        • AdjustmentEvent.BLOCK_DECREMENT replaces - * Event.SCROLL_PAGE_DOWN + *
        • {@code AdjustmentEvent.TRACK} replaces + * {@code Event.SCROLL_ABSOLUTE} + *
        • {@code AdjustmentEvent.UNIT_INCREMENT} replaces + * {@code Event.SCROLL_LINE_UP} + *
        • {@code AdjustmentEvent.UNIT_DECREMENT} replaces + * {@code Event.SCROLL_LINE_DOWN} + *
        • {@code AdjustmentEvent.BLOCK_INCREMENT} replaces + * {@code Event.SCROLL_PAGE_UP} + *
        • {@code AdjustmentEvent.BLOCK_DECREMENT} replaces + * {@code Event.SCROLL_PAGE_DOWN} *
        *

        - * Note: We recommend using a Scrollbar + * Note: We recommend using a {@code Scrollbar} * for value selection only. If you want to implement * a scrollable component inside a container, we recommend you use * a {@link ScrollPane ScrollPane}. If you use a - * Scrollbar for this purpose, you are likely to + * {@code Scrollbar} for this purpose, you are likely to * encounter issues with painting, key handling, sizing and * positioning. * @@ -176,10 +176,10 @@ public class Scrollbar extends Component implements Adjustable, Accessible { public static final int VERTICAL = 1; /** - * The value of the Scrollbar. - * This property must be greater than or equal to minimum + * The value of the {@code Scrollbar}. + * This property must be greater than or equal to {@code minimum} * and less than or equal to - * maximum - visibleAmount + * {@code maximum - visibleAmount} * * @serial * @see #getValue @@ -188,8 +188,8 @@ public class Scrollbar extends Component implements Adjustable, Accessible { int value; /** - * The maximum value of the Scrollbar. - * This value must be greater than the minimum + * The maximum value of the {@code Scrollbar}. + * This value must be greater than the {@code minimum} * value.
        * * @serial @@ -199,8 +199,8 @@ public class Scrollbar extends Component implements Adjustable, Accessible { int maximum; /** - * The minimum value of the Scrollbar. - * This value must be less than the maximum + * The minimum value of the {@code Scrollbar}. + * This value must be less than the {@code maximum} * value.
        * * @serial @@ -210,7 +210,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { int minimum; /** - * The size of the Scrollbar's bubble. + * The size of the {@code Scrollbar}'s bubble. * When a scroll bar is used to select a range of values, * the visibleAmount represents the size of this range. * Depending on platform, this may be visually indicated @@ -223,11 +223,11 @@ public class Scrollbar extends Component implements Adjustable, Accessible { int visibleAmount; /** - * The Scrollbar's orientation--being either horizontal + * The {@code Scrollbar}'s orientation--being either horizontal * or vertical. * This value should be specified when the scrollbar is created.
        - * orientation can be either : VERTICAL or - * HORIZONTAL only. + * orientation can be either : {@code VERTICAL} or + * {@code HORIZONTAL} only. * * @serial * @see #getOrientation @@ -258,7 +258,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { int pageIncrement = 10; /** - * The adjusting status of the Scrollbar. + * The adjusting status of the {@code Scrollbar}. * True if the value is in the process of changing as a result of * actions being taken by the user. * @@ -306,7 +306,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * orientation * indicates whether the scroll bar is vertical *
        or horizontal - * Scrollbar.VERTICAL + * {@code Scrollbar.VERTICAL} * * * value @@ -360,14 +360,14 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Constructs a new scroll bar with the specified orientation. *

        - * The orientation argument must take one of the two - * values Scrollbar.HORIZONTAL, - * or Scrollbar.VERTICAL, + * The {@code orientation} argument must take one of the two + * values {@code Scrollbar.HORIZONTAL}, + * or {@code Scrollbar.VERTICAL}, * indicating a horizontal or vertical scroll bar, respectively. * * @param orientation indicates the orientation of the scroll bar * @exception IllegalArgumentException when an illegal value for - * the orientation argument is supplied + * the {@code orientation} argument is supplied * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. * @see java.awt.GraphicsEnvironment#isHeadless @@ -380,9 +380,9 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * Constructs a new scroll bar with the specified orientation, * initial value, visible amount, and minimum and maximum values. *

        - * The orientation argument must take one of the two - * values Scrollbar.HORIZONTAL, - * or Scrollbar.VERTICAL, + * The {@code orientation} argument must take one of the two + * values {@code Scrollbar.HORIZONTAL}, + * or {@code Scrollbar.VERTICAL}, * indicating a horizontal or vertical scroll bar, respectively. *

        * The parameters supplied to this constructor are subject to the @@ -395,7 +395,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * @param minimum the minimum value of the scroll bar * @param maximum the maximum value of the scroll bar * @exception IllegalArgumentException when an illegal value for - * the orientation argument is supplied + * the {@code orientation} argument is supplied * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. * @see #setValues @@ -416,8 +416,8 @@ public class Scrollbar extends Component implements Adjustable, Accessible { } /** - * Constructs a name for this component. Called by getName - * when the name is null. + * Constructs a name for this component. Called by {@code getName} + * when the name is {@code null}. */ String constructComponentName() { synchronized (Scrollbar.class) { @@ -426,8 +426,8 @@ public class Scrollbar extends Component implements Adjustable, Accessible { } /** - * Creates the Scrollbar's peer. The peer allows you to modify - * the appearance of the Scrollbar without changing any of its + * Creates the {@code Scrollbar}'s peer. The peer allows you to modify + * the appearance of the {@code Scrollbar} without changing any of its * functionality. */ public void addNotify() { @@ -442,8 +442,8 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * Returns the orientation of this scroll bar. * * @return the orientation of this scroll bar, either - * Scrollbar.HORIZONTAL or - * Scrollbar.VERTICAL + * {@code Scrollbar.HORIZONTAL} or + * {@code Scrollbar.VERTICAL} * @see java.awt.Scrollbar#setOrientation */ public int getOrientation() { @@ -454,11 +454,11 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * Sets the orientation for this scroll bar. * * @param orientation the orientation of this scroll bar, either - * Scrollbar.HORIZONTAL or - * Scrollbar.VERTICAL + * {@code Scrollbar.HORIZONTAL} or + * {@code Scrollbar.VERTICAL} * @see java.awt.Scrollbar#getOrientation * @exception IllegalArgumentException if the value supplied - * for orientation is not a + * for {@code orientation} is not a * legal value * @since 1.1 */ @@ -506,20 +506,20 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Sets the value of this scroll bar to the specified value. *

        - * If the value supplied is less than the current minimum - * or greater than the current maximum - visibleAmount, - * then either minimum or maximum - visibleAmount + * If the value supplied is less than the current {@code minimum} + * or greater than the current {@code maximum - visibleAmount}, + * then either {@code minimum} or {@code maximum - visibleAmount} * is substituted, as appropriate. *

        * Normally, a program should change a scroll bar's - * value only by calling setValues. - * The setValues method simultaneously + * value only by calling {@code setValues}. + * The {@code setValues} method simultaneously * and synchronously sets the minimum, maximum, visible amount, * and value properties of a scroll bar, so that they are * mutually consistent. *

        * Calling this method does not fire an - * AdjustmentEvent. + * {@code AdjustmentEvent}. * * @param newValue the new value of the scroll bar * @see java.awt.Scrollbar#setValues @@ -547,21 +547,21 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Sets the minimum value of this scroll bar. *

        - * When setMinimum is called, the minimum value + * When {@code setMinimum} is called, the minimum value * is changed, and other values (including the maximum, the * visible amount, and the current scroll bar value) * are changed to be consistent with the new minimum. *

        * Normally, a program should change a scroll bar's minimum - * value only by calling setValues. - * The setValues method simultaneously + * value only by calling {@code setValues}. + * The {@code setValues} method simultaneously * and synchronously sets the minimum, maximum, visible amount, * and value properties of a scroll bar, so that they are * mutually consistent. *

        - * Note that setting the minimum value to Integer.MAX_VALUE + * Note that setting the minimum value to {@code Integer.MAX_VALUE} * will result in the new minimum value being set to - * Integer.MAX_VALUE - 1. + * {@code Integer.MAX_VALUE - 1}. * * @param newMinimum the new minimum value for this scroll bar * @see java.awt.Scrollbar#setValues @@ -591,21 +591,21 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Sets the maximum value of this scroll bar. *

        - * When setMaximum is called, the maximum value + * When {@code setMaximum} is called, the maximum value * is changed, and other values (including the minimum, the * visible amount, and the current scroll bar value) * are changed to be consistent with the new maximum. *

        * Normally, a program should change a scroll bar's maximum - * value only by calling setValues. - * The setValues method simultaneously + * value only by calling {@code setValues}. + * The {@code setValues} method simultaneously * and synchronously sets the minimum, maximum, visible amount, * and value properties of a scroll bar, so that they are * mutually consistent. *

        - * Note that setting the maximum value to Integer.MIN_VALUE + * Note that setting the maximum value to {@code Integer.MIN_VALUE} * will result in the new maximum value being set to - * Integer.MIN_VALUE + 1. + * {@code Integer.MIN_VALUE + 1}. * * @param newMaximum the new maximum value * for this scroll bar @@ -645,7 +645,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * moveable (e.g. when it takes up the entire length of the * scroll bar's track, or when the scroll bar is disabled). * Whether the bubble is displayed or not will not affect - * the value returned by getVisibleAmount. + * the value returned by {@code getVisibleAmount}. * * @return the visible amount of this scroll bar * @see java.awt.Scrollbar#setVisibleAmount @@ -660,7 +660,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * * @return the visible amount of this scroll bar * @deprecated As of JDK version 1.1, - * replaced by getVisibleAmount(). + * replaced by {@code getVisibleAmount()}. */ @Deprecated public int getVisible() { @@ -683,16 +683,16 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * moveable (e.g. when it takes up the entire length of the * scroll bar's track, or when the scroll bar is disabled). * Whether the bubble is displayed or not will not affect - * the value returned by getVisibleAmount. + * the value returned by {@code getVisibleAmount}. *

        - * If the visible amount supplied is less than one - * or greater than the current maximum - minimum, - * then either one or maximum - minimum + * If the visible amount supplied is less than {@code one} + * or greater than the current {@code maximum - minimum}, + * then either {@code one} or {@code maximum - minimum} * is substituted, as appropriate. *

        * Normally, a program should change a scroll bar's - * value only by calling setValues. - * The setValues method simultaneously + * value only by calling {@code setValues}. + * The {@code setValues} method simultaneously * and synchronously sets the minimum, maximum, visible amount, * and value properties of a scroll bar, so that they are * mutually consistent. @@ -737,7 +737,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * @param v the increment value * * @deprecated As of JDK version 1.1, - * replaced by setUnitIncrement(int). + * replaced by {@code setUnitIncrement(int)}. */ @Deprecated public synchronized void setLineIncrement(int v) { @@ -779,7 +779,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * * @return the unit increment for this scrollbar * @deprecated As of JDK version 1.1, - * replaced by getUnitIncrement(). + * replaced by {@code getUnitIncrement()}. */ @Deprecated public int getLineIncrement() { @@ -811,7 +811,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * * @param v the block increment * @deprecated As of JDK version 1.1, - * replaced by setBlockIncrement(). + * replaced by {@code setBlockIncrement()}. */ @Deprecated public synchronized void setPageIncrement(int v) { @@ -851,7 +851,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * @return the block increment of this scroll bar * * @deprecated As of JDK version 1.1, - * replaced by getBlockIncrement(). + * replaced by {@code getBlockIncrement()}. */ @Deprecated public int getPageIncrement() { @@ -860,8 +860,8 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Sets the values of four properties for this scroll bar: - * value, visibleAmount, - * minimum, and maximum. + * {@code value}, {@code visibleAmount}, + * {@code minimum}, and {@code maximum}. * If the values supplied for these properties are inconsistent * or incorrect, they will be changed to ensure consistency. *

        @@ -869,18 +869,18 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * of four scroll bar properties, assuring that the values of * these properties are mutually consistent. It enforces the * following constraints: - * maximum must be greater than minimum, - * maximum - minimum must not be greater - * than Integer.MAX_VALUE, - * visibleAmount must be greater than zero. - * visibleAmount must not be greater than - * maximum - minimum, - * value must not be less than minimum, - * and value must not be greater than - * maximum - visibleAmount + * {@code maximum} must be greater than {@code minimum}, + * {@code maximum - minimum} must not be greater + * than {@code Integer.MAX_VALUE}, + * {@code visibleAmount} must be greater than zero. + * {@code visibleAmount} must not be greater than + * {@code maximum - minimum}, + * {@code value} must not be less than {@code minimum}, + * and {@code value} must not be greater than + * {@code maximum - visibleAmount} *

        * Calling this method does not fire an - * AdjustmentEvent. + * {@code AdjustmentEvent}. * * @param value is the position in the current window * @param visible is the visible amount of the scroll bar @@ -943,7 +943,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * Returns true if the value is in the process of changing as a * result of actions being taken by the user. * - * @return the value of the valueIsAdjusting property + * @return the value of the {@code valueIsAdjusting} property * @see #setValueIsAdjusting * @since 1.4 */ @@ -952,7 +952,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { } /** - * Sets the valueIsAdjusting property. + * Sets the {@code valueIsAdjusting} property. * * @param b new adjustment-in-progress status * @see #getValueIsAdjusting @@ -978,8 +978,8 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Adds the specified adjustment listener to receive instances of - * AdjustmentEvent from this scroll bar. - * If l is null, no exception is thrown and no + * {@code AdjustmentEvent} from this scroll bar. + * If l is {@code null}, no exception is thrown and no * action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -1001,8 +1001,8 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Removes the specified adjustment listener so that it no longer - * receives instances of AdjustmentEvent from this scroll bar. - * If l is null, no exception is thrown and no action + * receives instances of {@code AdjustmentEvent} from this scroll bar. + * If l is {@code null}, no exception is thrown and no action * is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -1025,7 +1025,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * Returns an array of all the adjustment listeners * registered on this scrollbar. * - * @return all of this scrollbar's AdjustmentListeners + * @return all of this scrollbar's {@code AdjustmentListener}s * or an empty array if no adjustment * listeners are currently registered * @see #addAdjustmentListener @@ -1041,15 +1041,15 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Returns an array of all the objects currently registered * as FooListeners - * upon this Scrollbar. + * upon this {@code Scrollbar}. * FooListeners are registered using the * addFooListener method. *

        - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * Scrollbar c + * {@code Scrollbar c} * for its mouse listeners with the following code: * *

        MouseListener[] mls = (MouseListener[])(c.getListeners(MouseListener.class));
        @@ -1058,13 +1058,13 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this component, * or an empty array if no such listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @since 1.3 */ @@ -1092,11 +1092,11 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Processes events on this scroll bar. If the event is an - * instance of AdjustmentEvent, it invokes the - * processAdjustmentEvent method. + * instance of {@code AdjustmentEvent}, it invokes the + * {@code processAdjustmentEvent} method. * Otherwise, it invokes its superclass's - * processEvent method. - *

        Note that if the event parameter is null + * {@code processEvent} method. + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -1116,17 +1116,17 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Processes adjustment events occurring on this * scrollbar by dispatching them to any registered - * AdjustmentListener objects. + * {@code AdjustmentListener} objects. *

        * This method is not called unless adjustment events are * enabled for this component. Adjustment events are enabled * when one of the following occurs: *

          - *
        • An AdjustmentListener object is registered - * via addAdjustmentListener. - *
        • Adjustment events are enabled via enableEvents. + *
        • An {@code AdjustmentListener} object is registered + * via {@code addAdjustmentListener}. + *
        • Adjustment events are enabled via {@code enableEvents}. *
        - *

        Note that if the event parameter is null + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -1145,11 +1145,11 @@ public class Scrollbar extends Component implements Adjustable, Accessible { } /** - * Returns a string representing the state of this Scrollbar. + * Returns a string representing the state of this {@code Scrollbar}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this scroll bar */ @@ -1176,17 +1176,17 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Writes default serializable fields to stream. Writes - * a list of serializable AdjustmentListeners + * a list of serializable {@code AdjustmentListeners} * as optional data. The non-serializable listeners are * detected and no attempt is made to serialize them. * - * @param s the ObjectOutputStream to write - * @serialData null terminated sequence of 0 - * or more pairs; the pair consists of a String - * and an Object; the String indicates + * @param s the {@code ObjectOutputStream} to write + * @serialData {@code null} terminated sequence of 0 + * or more pairs; the pair consists of a {@code String} + * and an {@code Object}; the {@code String} indicates * the type of object and is one of the following: - * adjustmentListenerK indicating an - * AdjustmentListener object + * {@code adjustmentListenerK} indicating an + * {@code AdjustmentListener} object * * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see java.awt.Component#adjustmentListenerK @@ -1202,16 +1202,16 @@ public class Scrollbar extends Component implements Adjustable, Accessible { } /** - * Reads the ObjectInputStream and if - * it isn't null adds a listener to + * Reads the {@code ObjectInputStream} and if + * it isn't {@code null} adds a listener to * receive adjustment events fired by the - * Scrollbar. + * {@code Scrollbar}. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns - * true + * {@code GraphicsEnvironment.isHeadless} returns + * {@code true} * @see java.awt.GraphicsEnvironment#isHeadless * @see #writeObject(ObjectOutputStream) */ @@ -1239,14 +1239,14 @@ public class Scrollbar extends Component implements Adjustable, Accessible { //////////////// /** - * Gets the AccessibleContext associated with this - * Scrollbar. For scrollbars, the - * AccessibleContext takes the form of an - * AccessibleAWTScrollBar. A new - * AccessibleAWTScrollBar instance is created if necessary. + * Gets the {@code AccessibleContext} associated with this + * {@code Scrollbar}. For scrollbars, the + * {@code AccessibleContext} takes the form of an + * {@code AccessibleAWTScrollBar}. A new + * {@code AccessibleAWTScrollBar} instance is created if necessary. * - * @return an AccessibleAWTScrollBar that serves as the - * AccessibleContext of this ScrollBar + * @return an {@code AccessibleAWTScrollBar} that serves as the + * {@code AccessibleContext} of this {@code ScrollBar} * @since 1.3 */ public AccessibleContext getAccessibleContext() { @@ -1258,7 +1258,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * This class implements accessibility support for the - * Scrollbar class. It provides an implementation of + * {@code Scrollbar} class. It provides an implementation of * the Java Accessibility API appropriate to scrollbar * user-interface elements. * @since 1.3 @@ -1274,7 +1274,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Get the state set of this object. * - * @return an instance of AccessibleState + * @return an instance of {@code AccessibleState} * containing the current state of the object * @see AccessibleState */ @@ -1294,7 +1294,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Get the role of this object. * - * @return an instance of AccessibleRole + * @return an instance of {@code AccessibleRole} * describing the role of the object */ public AccessibleRole getAccessibleRole() { @@ -1302,11 +1302,11 @@ public class Scrollbar extends Component implements Adjustable, Accessible { } /** - * Get the AccessibleValue associated with this + * Get the {@code AccessibleValue} associated with this * object. In the implementation of the Java Accessibility * API for this class, return this object, which is * responsible for implementing the - * AccessibleValue interface on behalf of itself. + * {@code AccessibleValue} interface on behalf of itself. * * @return this object */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Shape.java b/jdk/src/java.desktop/share/classes/java/awt/Shape.java index 0ff0fbbc09e..209063c46a2 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Shape.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Shape.java @@ -31,36 +31,36 @@ import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; /** - * The Shape interface provides definitions for objects - * that represent some form of geometric shape. The Shape + * The {@code Shape} interface provides definitions for objects + * that represent some form of geometric shape. The {@code Shape} * is described by a {@link PathIterator} object, which can express the - * outline of the Shape as well as a rule for determining + * outline of the {@code Shape} as well as a rule for determining * how the outline divides the 2D plane into interior and exterior - * points. Each Shape object provides callbacks to get the + * points. Each {@code Shape} object provides callbacks to get the * bounding box of the geometry, determine whether points or * rectangles lie partly or entirely within the interior - * of the Shape, and retrieve a PathIterator - * object that describes the trajectory path of the Shape + * of the {@code Shape}, and retrieve a {@code PathIterator} + * object that describes the trajectory path of the {@code Shape} * outline. *

        * Definition of insideness: * A point is considered to lie inside a - * Shape if and only if: + * {@code Shape} if and only if: *

          *
        • it lies completely - * inside theShape boundary or + * inside the {@code Shape} boundary or *
        • - * it lies exactly on the Shape boundary and the + * it lies exactly on the {@code Shape} boundary and the * space immediately adjacent to the - * point in the increasing X direction is + * point in the increasing {@code X} direction is * entirely inside the boundary or *
        • * it lies exactly on a horizontal boundary segment and the * space immediately adjacent to the point in the - * increasing Y direction is inside the boundary. + * increasing {@code Y} direction is inside the boundary. *
        - *

        The contains and intersects methods - * consider the interior of a Shape to be the area it + *

        The {@code contains} and {@code intersects} methods + * consider the interior of a {@code Shape} to be the area it * encloses as if it were filled. This means that these methods * consider * unclosed shapes to be implicitly closed for the purpose of @@ -78,14 +78,14 @@ import java.awt.geom.Rectangle2D; public interface Shape { /** * Returns an integer {@link Rectangle} that completely encloses the - * Shape. Note that there is no guarantee that the - * returned Rectangle is the smallest bounding box that - * encloses the Shape, only that the Shape - * lies entirely within the indicated Rectangle. The - * returned Rectangle might also fail to completely - * enclose the Shape if the Shape overflows + * {@code Shape}. Note that there is no guarantee that the + * returned {@code Rectangle} is the smallest bounding box that + * encloses the {@code Shape}, only that the {@code Shape} + * lies entirely within the indicated {@code Rectangle}. The + * returned {@code Rectangle} might also fail to completely + * enclose the {@code Shape} if the {@code Shape} overflows * the limited range of the integer data type. The - * getBounds2D method generally returns a + * {@code getBounds2D} method generally returns a * tighter bounding box due to its greater flexibility in * representation. * @@ -114,8 +114,8 @@ public interface Shape { *

        * {@code bounds.contains(x,y)} does not imply {@code shape.contains(x,y)} *

        - * @return an integer Rectangle that completely encloses - * the Shape. + * @return an integer {@code Rectangle} that completely encloses + * the {@code Shape}. * @see #getBounds2D * @since 1.2 */ @@ -123,15 +123,15 @@ public interface Shape { /** * Returns a high precision and more accurate bounding box of - * the Shape than the getBounds method. + * the {@code Shape} than the {@code getBounds} method. * Note that there is no guarantee that the returned * {@link Rectangle2D} is the smallest bounding box that encloses - * the Shape, only that the Shape lies - * entirely within the indicated Rectangle2D. The + * the {@code Shape}, only that the {@code Shape} lies + * entirely within the indicated {@code Rectangle2D}. The * bounding box returned by this method is usually tighter than that - * returned by the getBounds method and never fails due + * returned by the {@code getBounds} method and never fails due * to overflow problems since the return value can be an instance of - * the Rectangle2D that uses double precision values to + * the {@code Rectangle2D} that uses double precision values to * store the dimensions. * *

        @@ -159,8 +159,8 @@ public interface Shape { *

        * {@code bounds.contains(p)} does not imply {@code shape.contains(p)} *

        - * @return an instance of Rectangle2D that is a - * high-precision bounding box of the Shape. + * @return an instance of {@code Rectangle2D} that is a + * high-precision bounding box of the {@code Shape}. * @see #getBounds * @since 1.2 */ @@ -168,13 +168,13 @@ public interface Shape { /** * Tests if the specified coordinates are inside the boundary of the - * Shape, as described by the + * {@code Shape}, as described by the * * definition of insideness. * @param x the specified X coordinate to be tested * @param y the specified Y coordinate to be tested - * @return true if the specified coordinates are inside - * the Shape boundary; false + * @return {@code true} if the specified coordinates are inside + * the {@code Shape} boundary; {@code false} * otherwise. * @since 1.2 */ @@ -182,30 +182,30 @@ public interface Shape { /** * Tests if a specified {@link Point2D} is inside the boundary - * of the Shape, as described by the + * of the {@code Shape}, as described by the * * definition of insideness. - * @param p the specified Point2D to be tested - * @return true if the specified Point2D is - * inside the boundary of the Shape; - * false otherwise. + * @param p the specified {@code Point2D} to be tested + * @return {@code true} if the specified {@code Point2D} is + * inside the boundary of the {@code Shape}; + * {@code false} otherwise. * @since 1.2 */ public boolean contains(Point2D p); /** - * Tests if the interior of the Shape intersects the + * Tests if the interior of the {@code Shape} intersects the * interior of a specified rectangular area. - * The rectangular area is considered to intersect the Shape + * The rectangular area is considered to intersect the {@code Shape} * if any point is contained in both the interior of the - * Shape and the specified rectangular area. + * {@code Shape} and the specified rectangular area. *

        * The {@code Shape.intersects()} method allows a {@code Shape} * implementation to conservatively return {@code true} when: *

          *
        • * there is a high probability that the rectangular area and the - * Shape intersect, but + * {@code Shape} intersect, but *
        • * the calculations to accurately determine this intersection * are prohibitively expensive. @@ -224,24 +224,24 @@ public interface Shape { * of the specified rectangular area * @param w the width of the specified rectangular area * @param h the height of the specified rectangular area - * @return true if the interior of the Shape and + * @return {@code true} if the interior of the {@code Shape} and * the interior of the rectangular area intersect, or are * both highly likely to intersect and intersection calculations - * would be too expensive to perform; false otherwise. + * would be too expensive to perform; {@code false} otherwise. * @see java.awt.geom.Area * @since 1.2 */ public boolean intersects(double x, double y, double w, double h); /** - * Tests if the interior of the Shape intersects the - * interior of a specified Rectangle2D. + * Tests if the interior of the {@code Shape} intersects the + * interior of a specified {@code Rectangle2D}. * The {@code Shape.intersects()} method allows a {@code Shape} * implementation to conservatively return {@code true} when: *
            *
          • - * there is a high probability that the Rectangle2D and the - * Shape intersect, but + * there is a high probability that the {@code Rectangle2D} and the + * {@code Shape} intersect, but *
          • * the calculations to accurately determine this intersection * are prohibitively expensive. @@ -254,11 +254,11 @@ public interface Shape { * {@code Shape} objects and therefore can be used if a more precise * answer is required. * - * @param r the specified Rectangle2D - * @return true if the interior of the Shape and - * the interior of the specified Rectangle2D + * @param r the specified {@code Rectangle2D} + * @return {@code true} if the interior of the {@code Shape} and + * the interior of the specified {@code Rectangle2D} * intersect, or are both highly likely to intersect and intersection - * calculations would be too expensive to perform; false + * calculations would be too expensive to perform; {@code false} * otherwise. * @see #intersects(double, double, double, double) * @since 1.2 @@ -266,20 +266,20 @@ public interface Shape { public boolean intersects(Rectangle2D r); /** - * Tests if the interior of the Shape entirely contains + * Tests if the interior of the {@code Shape} entirely contains * the specified rectangular area. All coordinates that lie inside - * the rectangular area must lie within the Shape for the + * the rectangular area must lie within the {@code Shape} for the * entire rectangular area to be considered contained within the - * Shape. + * {@code Shape}. *

            * The {@code Shape.contains()} method allows a {@code Shape} * implementation to conservatively return {@code false} when: *

              *
            • - * the intersect method returns true and + * the {@code intersect} method returns {@code true} and *
            • * the calculations to determine whether or not the - * Shape entirely contains the rectangular area are + * {@code Shape} entirely contains the rectangular area are * prohibitively expensive. *
            * This means that for some {@code Shapes} this method might @@ -296,11 +296,11 @@ public interface Shape { * of the specified rectangular area * @param w the width of the specified rectangular area * @param h the height of the specified rectangular area - * @return true if the interior of the Shape + * @return {@code true} if the interior of the {@code Shape} * entirely contains the specified rectangular area; - * false otherwise or, if the Shape + * {@code false} otherwise or, if the {@code Shape} * contains the rectangular area and the - * intersects method returns true + * {@code intersects} method returns {@code true} * and the containment calculations would be too expensive to * perform. * @see java.awt.geom.Area @@ -310,16 +310,16 @@ public interface Shape { public boolean contains(double x, double y, double w, double h); /** - * Tests if the interior of the Shape entirely contains the - * specified Rectangle2D. + * Tests if the interior of the {@code Shape} entirely contains the + * specified {@code Rectangle2D}. * The {@code Shape.contains()} method allows a {@code Shape} * implementation to conservatively return {@code false} when: *
              *
            • - * the intersect method returns true and + * the {@code intersect} method returns {@code true} and *
            • * the calculations to determine whether or not the - * Shape entirely contains the Rectangle2D + * {@code Shape} entirely contains the {@code Rectangle2D} * are prohibitively expensive. *
            * This means that for some {@code Shapes} this method might @@ -330,12 +330,12 @@ public interface Shape { * {@code Shape} objects and therefore can be used if a more precise * answer is required. * - * @param r The specified Rectangle2D - * @return true if the interior of the Shape - * entirely contains the Rectangle2D; - * false otherwise or, if the Shape - * contains the Rectangle2D and the - * intersects method returns true + * @param r The specified {@code Rectangle2D} + * @return {@code true} if the interior of the {@code Shape} + * entirely contains the {@code Rectangle2D}; + * {@code false} otherwise or, if the {@code Shape} + * contains the {@code Rectangle2D} and the + * {@code intersects} method returns {@code true} * and the containment calculations would be too expensive to * perform. * @see #contains(double, double, double, double) @@ -345,44 +345,44 @@ public interface Shape { /** * Returns an iterator object that iterates along the - * Shape boundary and provides access to the geometry of the - * Shape outline. If an optional {@link AffineTransform} + * {@code Shape} boundary and provides access to the geometry of the + * {@code Shape} outline. If an optional {@link AffineTransform} * is specified, the coordinates returned in the iteration are * transformed accordingly. *

            - * Each call to this method returns a fresh PathIterator - * object that traverses the geometry of the Shape object - * independently from any other PathIterator objects in use + * Each call to this method returns a fresh {@code PathIterator} + * object that traverses the geometry of the {@code Shape} object + * independently from any other {@code PathIterator} objects in use * at the same time. *

            * It is recommended, but not guaranteed, that objects - * implementing the Shape interface isolate iterations + * implementing the {@code Shape} interface isolate iterations * that are in process from any changes that might occur to the original * object's geometry during such iterations. * - * @param at an optional AffineTransform to be applied to the + * @param at an optional {@code AffineTransform} to be applied to the * coordinates as they are returned in the iteration, or - * null if untransformed coordinates are desired - * @return a new PathIterator object, which independently - * traverses the geometry of the Shape. + * {@code null} if untransformed coordinates are desired + * @return a new {@code PathIterator} object, which independently + * traverses the geometry of the {@code Shape}. * @since 1.2 */ public PathIterator getPathIterator(AffineTransform at); /** - * Returns an iterator object that iterates along the Shape + * Returns an iterator object that iterates along the {@code Shape} * boundary and provides access to a flattened view of the - * Shape outline geometry. + * {@code Shape} outline geometry. *

            * Only SEG_MOVETO, SEG_LINETO, and SEG_CLOSE point types are * returned by the iterator. *

            - * If an optional AffineTransform is specified, + * If an optional {@code AffineTransform} is specified, * the coordinates returned in the iteration are transformed * accordingly. *

            * The amount of subdivision of the curved segments is controlled - * by the flatness parameter, which specifies the + * by the {@code flatness} parameter, which specifies the * maximum distance that any point on the unflattened transformed * curve can deviate from the returned flattened path segments. * Note that a limit on the accuracy of the flattened path might be @@ -390,24 +390,24 @@ public interface Shape { * treated as larger values. This limit, if there is one, is * defined by the particular implementation that is used. *

            - * Each call to this method returns a fresh PathIterator - * object that traverses the Shape object geometry - * independently from any other PathIterator objects in use at + * Each call to this method returns a fresh {@code PathIterator} + * object that traverses the {@code Shape} object geometry + * independently from any other {@code PathIterator} objects in use at * the same time. *

            * It is recommended, but not guaranteed, that objects - * implementing the Shape interface isolate iterations + * implementing the {@code Shape} interface isolate iterations * that are in process from any changes that might occur to the original * object's geometry during such iterations. * - * @param at an optional AffineTransform to be applied to the + * @param at an optional {@code AffineTransform} to be applied to the * coordinates as they are returned in the iteration, or - * null if untransformed coordinates are desired + * {@code null} if untransformed coordinates are desired * @param flatness the maximum distance that the line segments used to * approximate the curved segments are allowed to deviate * from any point on the original curve - * @return a new PathIterator that independently traverses - * a flattened view of the geometry of the Shape. + * @return a new {@code PathIterator} that independently traverses + * a flattened view of the geometry of the {@code Shape}. * @since 1.2 */ public PathIterator getPathIterator(AffineTransform at, double flatness); diff --git a/jdk/src/java.desktop/share/classes/java/awt/SplashScreen.java b/jdk/src/java.desktop/share/classes/java/awt/SplashScreen.java index 3cf8ac0a6cd..4b6fab00428 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/SplashScreen.java +++ b/jdk/src/java.desktop/share/classes/java/awt/SplashScreen.java @@ -48,7 +48,7 @@ import sun.awt.image.SunWritableRaster; * Place the image in the jar archive and specify the path in the option. * The path should not have a leading slash. *
            - * For example, in the manifest.mf file: + * For example, in the {@code manifest.mf} file: *

              * Manifest-Version: 1.0
              * Main-Class: Test
            @@ -89,7 +89,7 @@ import sun.awt.image.SunWritableRaster;
              * can exist, and it may be obtained by using the {@link #getSplashScreen()}
              * static method. In case the splash screen has not been created at
              * application startup via the command line or manifest file option,
            - * the getSplashScreen method returns null.
            + * the {@code getSplashScreen} method returns {@code null}.
              *
              * @author Oleg Semenov
              * @since 1.6
            @@ -108,7 +108,7 @@ public final class SplashScreen {
                  *         supported by the current toolkit
                  * @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()}
                  *         returns true
            -     * @return the {@link SplashScreen} instance, or null if there is
            +     * @return the {@link SplashScreen} instance, or {@code null} if there is
                  *         none or it has already been closed
                  */
                 public static  SplashScreen getSplashScreen() {
            @@ -142,9 +142,9 @@ public final class SplashScreen {
                  * The splash screen window is resized according to the size of
                  * the image and is centered on the screen.
                  *
            -     * @param imageURL the non-null URL for the new
            +     * @param imageURL the non-{@code null} URL for the new
                  *        splash screen image
            -     * @throws NullPointerException if {@code imageURL} is null
            +     * @throws NullPointerException if {@code imageURL} is {@code null}
                  * @throws IOException if there was an error while loading the image
                  * @throws IllegalStateException if the splash screen has already been
                  *         closed
            @@ -282,7 +282,7 @@ public final class SplashScreen {
                  * displayed over the main image using alpha blending. Also note that drawing
                  * on the overlay image does not necessarily update the contents of splash
                  * screen window. You should call {@code update()} on the
            -     * SplashScreen when you want the splash screen to be
            +     * {@code SplashScreen} when you want the splash screen to be
                  * updated immediately.
                  * 

            * The pixel (0, 0) in the coordinate space of the graphics context @@ -402,7 +402,7 @@ public final class SplashScreen { /** * The instance reference for the singleton. - * (null if no instance exists yet.) + * ({@code null} if no instance exists yet.) * * @see #getSplashScreen * @see #close diff --git a/jdk/src/java.desktop/share/classes/java/awt/Stroke.java b/jdk/src/java.desktop/share/classes/java/awt/Stroke.java index 93ff2e8b32d..291c3857362 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Stroke.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Stroke.java @@ -26,43 +26,43 @@ package java.awt; /** - * The Stroke interface allows a + * The {@code Stroke} interface allows a * {@link Graphics2D} object to obtain a {@link Shape} that is the * decorated outline, or stylistic representation of the outline, - * of the specified Shape. - * Stroking a Shape is like tracing its outline with a + * of the specified {@code Shape}. + * Stroking a {@code Shape} is like tracing its outline with a * marking pen of the appropriate size and shape. * The area where the pen would place ink is the area enclosed by the - * outline Shape. + * outline {@code Shape}. *

            - * The methods of the Graphics2D interface that use the - * outline Shape returned by a Stroke object - * include draw and any other methods that are + * The methods of the {@code Graphics2D} interface that use the + * outline {@code Shape} returned by a {@code Stroke} object + * include {@code draw} and any other methods that are * implemented in terms of that method, such as - * drawLine, drawRect, - * drawRoundRect, drawOval, - * drawArc, drawPolyline, - * and drawPolygon. + * {@code drawLine}, {@code drawRect}, + * {@code drawRoundRect}, {@code drawOval}, + * {@code drawArc}, {@code drawPolyline}, + * and {@code drawPolygon}. *

            - * The objects of the classes implementing Stroke - * must be read-only because Graphics2D does not + * The objects of the classes implementing {@code Stroke} + * must be read-only because {@code Graphics2D} does not * clone these objects either when they are set as an attribute - * with the setStroke method or when the - * Graphics2D object is itself cloned. - * If a Stroke object is modified after it is set in - * the Graphics2D context then the behavior + * with the {@code setStroke} method or when the + * {@code Graphics2D} object is itself cloned. + * If a {@code Stroke} object is modified after it is set in + * the {@code Graphics2D} context then the behavior * of subsequent rendering would be undefined. * @see BasicStroke * @see Graphics2D#setStroke */ public interface Stroke { /** - * Returns an outline Shape which encloses the area that - * should be painted when the Shape is stroked according + * Returns an outline {@code Shape} which encloses the area that + * should be painted when the {@code Shape} is stroked according * to the rules defined by the - * object implementing the Stroke interface. - * @param p a Shape to be stroked - * @return the stroked outline Shape. + * object implementing the {@code Stroke} interface. + * @param p a {@code Shape} to be stroked + * @return the stroked outline {@code Shape}. */ Shape createStrokedShape (Shape p); } diff --git a/jdk/src/java.desktop/share/classes/java/awt/SystemColor.java b/jdk/src/java.desktop/share/classes/java/awt/SystemColor.java index 38a173f339a..75b3e58d6af 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/SystemColor.java +++ b/jdk/src/java.desktop/share/classes/java/awt/SystemColor.java @@ -36,15 +36,15 @@ import java.lang.annotation.Native; * update of the system colors (when the user changes the colors) * the actual RGB values of these symbolic colors will also change * dynamically. In order to compare the "current" RGB value of a - * SystemColor object with a non-symbolic Color object, - * getRGB should be used rather than equals. + * {@code SystemColor} object with a non-symbolic Color object, + * {@code getRGB} should be used rather than {@code equals}. *

            * Note that the way in which these system colors are applied to GUI objects * may vary slightly from platform to platform since GUI objects may be * rendered differently on each platform. *

            - * System color values may also be available through the getDesktopProperty - * method on java.awt.Toolkit. + * System color values may also be available through the {@code getDesktopProperty} + * method on {@code java.awt.Toolkit}. * * @see Toolkit#getDesktopProperty * @@ -380,28 +380,28 @@ public final class SystemColor extends Color implements java.io.Serializable { /** * The color rendered for light areas of 3D control objects, such as pushbuttons. - * This color is typically derived from the control background color + * This color is typically derived from the {@code control} background color * to provide a 3D effect. */ public static final SystemColor controlHighlight = new SystemColor((byte)CONTROL_HIGHLIGHT); /** * The color rendered for highlight areas of 3D control objects, such as pushbuttons. - * This color is typically derived from the control background color + * This color is typically derived from the {@code control} background color * to provide a 3D effect. */ public static final SystemColor controlLtHighlight = new SystemColor((byte)CONTROL_LT_HIGHLIGHT); /** * The color rendered for shadow areas of 3D control objects, such as pushbuttons. - * This color is typically derived from the control background color + * This color is typically derived from the {@code control} background color * to provide a 3D effect. */ public static final SystemColor controlShadow = new SystemColor((byte)CONTROL_SHADOW); /** * The color rendered for dark shadow areas on 3D control objects, such as pushbuttons. - * This color is typically derived from the control background color + * This color is typically derived from the {@code control} background color * to provide a 3D effect. */ public static final SystemColor controlDkShadow = new SystemColor((byte)CONTROL_DK_SHADOW); @@ -487,13 +487,13 @@ public final class SystemColor extends Color implements java.io.Serializable { } /** - * Returns a string representation of this Color's values. + * Returns a string representation of this {@code Color}'s values. * This method is intended to be used only for debugging purposes, * and the content and format of the returned string may vary between * implementations. - * The returned string may be empty but may not be null. + * The returned string may be empty but may not be {@code null}. * - * @return a string representation of this Color + * @return a string representation of this {@code Color} */ public String toString() { return getClass().getName() + "[i=" + (index) + "]"; diff --git a/jdk/src/java.desktop/share/classes/java/awt/SystemTray.java b/jdk/src/java.desktop/share/classes/java/awt/SystemTray.java index e61716ee537..46ed1ff807c 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/SystemTray.java +++ b/jdk/src/java.desktop/share/classes/java/awt/SystemTray.java @@ -36,7 +36,7 @@ import sun.awt.AWTAccessor; import sun.awt.AWTPermissions; /** - * The SystemTray class represents the system tray for a + * The {@code SystemTray} class represents the system tray for a * desktop. On Microsoft Windows it is referred to as the "Taskbar * Status Area", on Gnome it is referred to as the "Notification * Area", on KDE it is referred to as the "System Tray". The system @@ -47,19 +47,19 @@ import sun.awt.AWTPermissions; * throws {@link UnsupportedOperationException}. To detect whether the * system tray is supported, use {@link SystemTray#isSupported}. * - *

            The SystemTray may contain one or more {@link + *

            The {@code SystemTray} may contain one or more {@link * TrayIcon TrayIcons}, which are added to the tray using the {@link * #add} method, and removed when no longer needed, using the - * {@link #remove}. TrayIcon consists of an + * {@link #remove}. {@code TrayIcon} consists of an * image, a popup menu and a set of associated listeners. Please see * the {@link TrayIcon} class for details. * - *

            Every Java application has a single SystemTray + *

            Every Java application has a single {@code SystemTray} * instance that allows the app to interface with the system tray of - * the desktop while the app is running. The SystemTray + * the desktop while the app is running. The {@code SystemTray} * instance can be obtained from the {@link #getSystemTray} method. * An application may not create its own instance of - * SystemTray. + * {@code SystemTray}. * *

            The following code snippet demonstrates how to access * and customize the system tray: @@ -141,7 +141,7 @@ public class SystemTray { } /** - * Private SystemTray constructor. + * Private {@code SystemTray} constructor. * */ private SystemTray() { @@ -149,7 +149,7 @@ public class SystemTray { } /** - * Gets the SystemTray instance that represents the + * Gets the {@code SystemTray} instance that represents the * desktop's tray area. This always returns the same instance per * application. On some platforms the system tray may not be * supported. You may use the {@link #isSupported} method to @@ -160,12 +160,12 @@ public class SystemTray { * {@code SystemTray} instance. Otherwise this method will throw a * SecurityException. * - * @return the SystemTray instance that represents + * @return the {@code SystemTray} instance that represents * the desktop's tray area * @throws UnsupportedOperationException if the system tray isn't * supported by the current platform * @throws HeadlessException if - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * @throws SecurityException if {@code accessSystemTray} permission * is not granted * @see #add(TrayIcon) @@ -203,15 +203,15 @@ public class SystemTray { * both the action listener and the popup menu. See the {@link * SystemTray example} for an example of how to do this. * - *

            Note: When implementing SystemTray and - * TrayIcon it is strongly recommended that + *

            Note: When implementing {@code SystemTray} and + * {@code TrayIcon} it is strongly recommended that * you assign different gestures to the popup menu and an action * event. Overloading a gesture for both purposes is confusing * and may prevent the user from accessing one or the other. * * @see #getSystemTray - * @return false if no system tray access is supported; this - * method returns true if the minimal system tray access is + * @return {@code false} if no system tray access is supported; this + * method returns {@code true} if the minimal system tray access is * supported but does not guarantee that all system tray * functionality is supported for the current platform */ @@ -231,20 +231,20 @@ public class SystemTray { } /** - * Adds a TrayIcon to the SystemTray. + * Adds a {@code TrayIcon} to the {@code SystemTray}. * The tray icon becomes visible in the system tray once it is * added. The order in which icons are displayed in a tray is not * specified - it is platform and implementation-dependent. * *

            All icons added by the application are automatically - * removed from the SystemTray upon application exit + * removed from the {@code SystemTray} upon application exit * and also when the desktop system tray becomes unavailable. * - * @param trayIcon the TrayIcon to be added - * @throws NullPointerException if trayIcon is - * null + * @param trayIcon the {@code TrayIcon} to be added + * @throws NullPointerException if {@code trayIcon} is + * {@code null} * @throws IllegalArgumentException if the same instance of - * a TrayIcon is added more than once + * a {@code TrayIcon} is added more than once * @throws AWTException if the desktop system tray is missing * @see #remove(TrayIcon) * @see #getSystemTray @@ -284,18 +284,18 @@ public class SystemTray { } /** - * Removes the specified TrayIcon from the - * SystemTray. + * Removes the specified {@code TrayIcon} from the + * {@code SystemTray}. * *

            All icons added by the application are automatically - * removed from the SystemTray upon application exit + * removed from the {@code SystemTray} upon application exit * and also when the desktop system tray becomes unavailable. * - *

            If trayIcon is null or was not + *

            If {@code trayIcon} is {@code null} or was not * added to the system tray, no exception is thrown and no action * is performed. * - * @param trayIcon the TrayIcon to be removed + * @param trayIcon the {@code TrayIcon} to be removed * @see #add(TrayIcon) * @see TrayIcon */ @@ -328,8 +328,8 @@ public class SystemTray { * *

            The returned array is a copy of the actual array and may be * modified in any way without affecting the system tray. To - * remove a TrayIcon from the - * SystemTray, use the {@link + * remove a {@code TrayIcon} from the + * {@code SystemTray}, use the {@link * #remove(TrayIcon)} method. * * @return an array of all tray icons added to this tray, or an @@ -351,7 +351,7 @@ public class SystemTray { * occupy in the system tray. Developers may use this methods to * acquire the preferred size for the image property of a tray icon * before it is created. For convenience, there is a similar - * method {@link TrayIcon#getSize} in the TrayIcon class. + * method {@link TrayIcon#getSize} in the {@code TrayIcon} class. * * @return the default size of a tray icon, in pixels * @see TrayIcon#setImageAutoSize(boolean) @@ -383,7 +383,7 @@ public class SystemTray { * * {@code systemTray} * This property contains {@code SystemTray} instance when the system tray - * is available or null otherwise.
            This property is changed + * is available or {@code null} otherwise.
            This property is changed * when the system tray becomes available or unavailable on the desktop.
            * The property is accessed by the {@link #getSystemTray} method. * diff --git a/jdk/src/java.desktop/share/classes/java/awt/TextArea.java b/jdk/src/java.desktop/share/classes/java/awt/TextArea.java index eab879730de..a2f4246a33c 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/TextArea.java +++ b/jdk/src/java.desktop/share/classes/java/awt/TextArea.java @@ -35,7 +35,7 @@ import javax.accessibility.AccessibleState; import javax.accessibility.AccessibleStateSet; /** - * A TextArea object is a multi-line region + * A {@code TextArea} object is a multi-line region * that displays text. It can be set to allow editing or * to be read-only. *

            @@ -56,7 +56,7 @@ import javax.accessibility.AccessibleStateSet; public class TextArea extends TextComponent { /** - * The number of rows in the TextArea. + * The number of rows in the {@code TextArea}. * This parameter will determine the text area's height. * Guaranteed to be non-negative. * @@ -67,7 +67,7 @@ public class TextArea extends TextComponent { int rows; /** - * The number of columns in the TextArea. + * The number of columns in the {@code TextArea}. * A column is an approximate average character * width that is platform-dependent. * This parameter will determine the text area's width. @@ -109,10 +109,10 @@ public class TextArea extends TextComponent { /** * Determines which scrollbars are created for the * text area. It can be one of four values : - * SCROLLBARS_BOTH = both scrollbars.
            - * SCROLLBARS_HORIZONTAL_ONLY = Horizontal bar only.
            - * SCROLLBARS_VERTICAL_ONLY = Vertical bar only.
            - * SCROLLBARS_NONE = No scrollbars.
            + * {@code SCROLLBARS_BOTH} = both scrollbars.
            + * {@code SCROLLBARS_HORIZONTAL_ONLY} = Horizontal bar only.
            + * {@code SCROLLBARS_VERTICAL_ONLY} = Vertical bar only.
            + * {@code SCROLLBARS_NONE} = No scrollbars.
            * * @serial * @see #getScrollbarVisibility() @@ -155,7 +155,7 @@ public class TextArea extends TextComponent { * {@link #SCROLLBARS_BOTH}, so both vertical and horizontal * scrollbars will be visible for this text area. * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns true + * {@code GraphicsEnvironment.isHeadless} returns true * @see java.awt.GraphicsEnvironment#isHeadless() */ public TextArea() throws HeadlessException { @@ -168,10 +168,10 @@ public class TextArea extends TextComponent { * {@link #SCROLLBARS_BOTH}, so both vertical and horizontal * scrollbars will be visible for this text area. * @param text the text to be displayed; if - * text is null, the empty - * string "" will be displayed + * {@code text} is {@code null}, the empty + * string {@code ""} will be displayed * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns true + * {@code GraphicsEnvironment.isHeadless} returns true * @see java.awt.GraphicsEnvironment#isHeadless() */ public TextArea(String text) throws HeadlessException { @@ -189,7 +189,7 @@ public class TextArea extends TextComponent { * @param rows the number of rows * @param columns the number of columns * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns true + * {@code GraphicsEnvironment.isHeadless} returns true * @see java.awt.GraphicsEnvironment#isHeadless() */ public TextArea(int rows, int columns) throws HeadlessException { @@ -205,12 +205,12 @@ public class TextArea extends TextComponent { * vertical and horizontal scrollbars will be visible for this * text area. * @param text the text to be displayed; if - * text is null, the empty - * string "" will be displayed + * {@code text} is {@code null}, the empty + * string {@code ""} will be displayed * @param rows the number of rows * @param columns the number of columns * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns true + * {@code GraphicsEnvironment.isHeadless} returns true * @see java.awt.GraphicsEnvironment#isHeadless() */ public TextArea(String text, int rows, int columns) @@ -221,36 +221,36 @@ public class TextArea extends TextComponent { /** * Constructs a new text area with the specified text, * and with the rows, columns, and scroll bar visibility - * as specified. All TextArea constructors defer to + * as specified. All {@code TextArea} constructors defer to * this one. *

            - * The TextArea class defines several constants + * The {@code TextArea} class defines several constants * that can be supplied as values for the - * scrollbars argument: + * {@code scrollbars} argument: *

              - *
            • SCROLLBARS_BOTH, - *
            • SCROLLBARS_VERTICAL_ONLY, - *
            • SCROLLBARS_HORIZONTAL_ONLY, - *
            • SCROLLBARS_NONE. + *
            • {@code SCROLLBARS_BOTH}, + *
            • {@code SCROLLBARS_VERTICAL_ONLY}, + *
            • {@code SCROLLBARS_HORIZONTAL_ONLY}, + *
            • {@code SCROLLBARS_NONE}. *
            * Any other value for the - * scrollbars argument is invalid and will result in + * {@code scrollbars} argument is invalid and will result in * this text area being created with scrollbar visibility equal to * the default value of {@link #SCROLLBARS_BOTH}. * @param text the text to be displayed; if - * text is null, the empty - * string "" will be displayed + * {@code text} is {@code null}, the empty + * string {@code ""} will be displayed * @param rows the number of rows; if - * rows is less than 0, - * rows is set to 0 + * {@code rows} is less than {@code 0}, + * {@code rows} is set to {@code 0} * @param columns the number of columns; if - * columns is less than 0, - * columns is set to 0 + * {@code columns} is less than {@code 0}, + * {@code columns} is set to {@code 0} * @param scrollbars a constant that determines what * scrollbars are created to view the text area * @since 1.1 * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns true + * {@code GraphicsEnvironment.isHeadless} returns true * @see java.awt.GraphicsEnvironment#isHeadless() */ public TextArea(String text, int rows, int columns, int scrollbars) @@ -273,8 +273,8 @@ public class TextArea extends TextComponent { } /** - * Construct a name for this component. Called by getName - * when the name is null. + * Construct a name for this component. Called by {@code getName} + * when the name is {@code null}. */ String constructComponentName() { synchronized (TextArea.class) { @@ -283,8 +283,8 @@ public class TextArea extends TextComponent { } /** - * Creates the TextArea's peer. The peer allows us to modify - * the appearance of the TextArea without changing any of its + * Creates the {@code TextArea}'s peer. The peer allows us to modify + * the appearance of the {@code TextArea} without changing any of its * functionality. */ public void addNotify() { @@ -298,11 +298,11 @@ public class TextArea extends TextComponent { /** * Inserts the specified text at the specified position * in this text area. - *

            Note that passing null or inconsistent + *

            Note that passing {@code null} or inconsistent * parameters is invalid and will result in unspecified * behavior. * - * @param str the non-null text to insert + * @param str the non-{@code null} text to insert * @param pos the position at which to insert * @see java.awt.TextComponent#setText * @see java.awt.TextArea#replaceRange @@ -320,7 +320,7 @@ public class TextArea extends TextComponent { * @param str the non-{@code null} text to insert * @param pos the position at which to insert * @deprecated As of JDK version 1.1, - * replaced by insert(String, int). + * replaced by {@code insert(String, int)}. */ @Deprecated public synchronized void insertText(String str, int pos) { @@ -333,11 +333,11 @@ public class TextArea extends TextComponent { /** * Appends the given text to the text area's current text. - *

            Note that passing null or inconsistent + *

            Note that passing {@code null} or inconsistent * parameters is invalid and will result in unspecified * behavior. * - * @param str the non-null text to append + * @param str the non-{@code null} text to append * @see java.awt.TextArea#insert * @since 1.1 */ @@ -350,7 +350,7 @@ public class TextArea extends TextComponent { * * @param str the text to append * @deprecated As of JDK version 1.1, - * replaced by append(String). + * replaced by {@code append(String)}. */ @Deprecated public synchronized void appendText(String str) { @@ -365,11 +365,11 @@ public class TextArea extends TextComponent { * same as the end position). * The text position is zero-based. The inserted substring may be * of a different length than the text it replaces. - *

            Note that passing null or inconsistent + *

            Note that passing {@code null} or inconsistent * parameters is invalid and will result in unspecified * behavior. * - * @param str the non-null text to use as + * @param str the non-{@code null} text to use as * the replacement * @param start the start position * @param end the end position @@ -391,7 +391,7 @@ public class TextArea extends TextComponent { * @param start the start position * @param end the end position * @deprecated As of JDK version 1.1, - * replaced by replaceRange(String, int, int). + * replaced by {@code replaceRange(String, int, int)}. */ @Deprecated public synchronized void replaceText(String str, int start, int end) { @@ -419,8 +419,8 @@ public class TextArea extends TextComponent { * @see #getRows() * @see #setColumns(int) * @exception IllegalArgumentException if the value - * supplied for rows - * is less than 0 + * supplied for {@code rows} + * is less than {@code 0} * @since 1.1 */ public void setRows(int rows) { @@ -450,8 +450,8 @@ public class TextArea extends TextComponent { * @see #getColumns() * @see #setRows(int) * @exception IllegalArgumentException if the value - * supplied for columns - * is less than 0 + * supplied for {@code columns} + * is less than {@code 0} * @since 1.1 */ public void setColumns(int columns) { @@ -469,9 +469,9 @@ public class TextArea extends TextComponent { * Returns an enumerated value that indicates which scroll bars * the text area uses. *

            - * The TextArea class defines four integer constants + * The {@code TextArea} class defines four integer constants * that are used to specify which scroll bars are available. - * TextArea has one constructor that gives the + * {@code TextArea} has one constructor that gives the * application discretion over scroll bars. * * @return an integer that indicates which scroll bars are used @@ -510,7 +510,7 @@ public class TextArea extends TextComponent { * @param columns the number of columns * @return the preferred dimensions needed for the text area * @deprecated As of JDK version 1.1, - * replaced by getPreferredSize(int, int). + * replaced by {@code getPreferredSize(int, int)}. */ @Deprecated public Dimension preferredSize(int rows, int columns) { @@ -534,7 +534,7 @@ public class TextArea extends TextComponent { /** * @deprecated As of JDK version 1.1, - * replaced by getPreferredSize(). + * replaced by {@code getPreferredSize()}. */ @Deprecated public Dimension preferredSize() { @@ -568,7 +568,7 @@ public class TextArea extends TextComponent { * @param columns the number of columns * @return the minimum size for the text area * @deprecated As of JDK version 1.1, - * replaced by getMinimumSize(int, int). + * replaced by {@code getMinimumSize(int, int)}. */ @Deprecated public Dimension minimumSize(int rows, int columns) { @@ -592,7 +592,7 @@ public class TextArea extends TextComponent { /** * @deprecated As of JDK version 1.1, - * replaced by getMinimumSize(). + * replaced by {@code getMinimumSize()}. */ @Deprecated public Dimension minimumSize() { @@ -604,11 +604,11 @@ public class TextArea extends TextComponent { } /** - * Returns a string representing the state of this TextArea. + * Returns a string representing the state of this {@code TextArea}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this text area */ @@ -650,8 +650,8 @@ public class TextArea extends TextComponent { /** * Read the ObjectInputStream. * @exception HeadlessException if - * GraphicsEnvironment.isHeadless() returns - * true + * {@code GraphicsEnvironment.isHeadless()} returns + * {@code true} * @see java.awt.GraphicsEnvironment#isHeadless */ private void readObject(ObjectInputStream s) @@ -689,14 +689,14 @@ public class TextArea extends TextComponent { /** - * Returns the AccessibleContext associated with - * this TextArea. For text areas, the - * AccessibleContext takes the form of an - * AccessibleAWTTextArea. - * A new AccessibleAWTTextArea instance is created if necessary. + * Returns the {@code AccessibleContext} associated with + * this {@code TextArea}. For text areas, the + * {@code AccessibleContext} takes the form of an + * {@code AccessibleAWTTextArea}. + * A new {@code AccessibleAWTTextArea} instance is created if necessary. * - * @return an AccessibleAWTTextArea that serves as the - * AccessibleContext of this TextArea + * @return an {@code AccessibleAWTTextArea} that serves as the + * {@code AccessibleContext} of this {@code TextArea} * @since 1.3 */ public AccessibleContext getAccessibleContext() { @@ -708,7 +708,7 @@ public class TextArea extends TextComponent { /** * This class implements accessibility support for the - * TextArea class. It provides an implementation of the + * {@code TextArea} class. It provides an implementation of the * Java Accessibility API appropriate to text area user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/TextComponent.java b/jdk/src/java.desktop/share/classes/java/awt/TextComponent.java index 191412a30b7..29e0bb1ecba 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/TextComponent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/TextComponent.java @@ -38,11 +38,11 @@ import sun.awt.AWTPermissions; import sun.awt.InputMethodSupport; /** - * The TextComponent class is the superclass of + * The {@code TextComponent} class is the superclass of * any component that allows the editing of some text. *

            * A text component embodies a string of text. The - * TextComponent class defines a set of methods + * {@code TextComponent} class defines a set of methods * that determine whether or not this text is editable. If the * component is editable, it defines another set of methods * that supports a text insertion caret. @@ -61,7 +61,7 @@ public class TextComponent extends Component implements Accessible { /** * The value of the text. - * A null value is the same as "". + * A {@code null} value is the same as "". * * @serial * @see #setText(String) @@ -71,9 +71,9 @@ public class TextComponent extends Component implements Accessible { /** * A boolean indicating whether or not this - * TextComponent is editable. - * It will be true if the text component - * is editable and false if not. + * {@code TextComponent} is editable. + * It will be {@code true} if the text component + * is editable and {@code false} if not. * * @serial * @see #isEditable() @@ -82,7 +82,7 @@ public class TextComponent extends Component implements Accessible { /** * The selection refers to the selected text, and the - * selectionStart is the start position + * {@code selectionStart} is the start position * of the selected text. * * @serial @@ -93,7 +93,7 @@ public class TextComponent extends Component implements Accessible { /** * The selection refers to the selected text, and the - * selectionEnd + * {@code selectionEnd} * is the end position of the selected text. * * @serial @@ -120,12 +120,12 @@ public class TextComponent extends Component implements Accessible { /** * Constructs a new text component initialized with the * specified text. Sets the value of the cursor to - * Cursor.TEXT_CURSOR. + * {@code Cursor.TEXT_CURSOR}. * @param text the text to be displayed; if - * text is null, the empty - * string "" will be displayed + * {@code text} is {@code null}, the empty + * string {@code ""} will be displayed * @exception HeadlessException if - * GraphicsEnvironment.isHeadless + * {@code GraphicsEnvironment.isHeadless} * returns true * @see java.awt.GraphicsEnvironment#isHeadless * @see java.awt.Cursor @@ -203,9 +203,9 @@ public class TextComponent extends Component implements Accessible { } /** - * Removes the TextComponent's peer. + * Removes the {@code TextComponent}'s peer. * The peer allows us to modify the appearance of the - * TextComponent without changing its + * {@code TextComponent} without changing its * functionality. */ public void removeNotify() { @@ -224,7 +224,7 @@ public class TextComponent extends Component implements Accessible { * Sets the text that is presented by this * text component to be the specified text. * @param t the new text; - * if this parameter is null then + * if this parameter is {@code null} then * the text is set to the empty string "" * @see java.awt.TextComponent#getText */ @@ -251,7 +251,7 @@ public class TextComponent extends Component implements Accessible { * Returns the text that is presented by this text component. * By default, this is an empty string. * - * @return the value of this TextComponent + * @return the value of this {@code TextComponent} * @see java.awt.TextComponent#setText */ public synchronized String getText() { @@ -274,8 +274,8 @@ public class TextComponent extends Component implements Accessible { /** * Indicates whether or not this text component is editable. - * @return true if this text component is - * editable; false otherwise. + * @return {@code true} if this text component is + * editable; {@code false} otherwise. * @see java.awt.TextComponent#setEditable * @since 1.0 */ @@ -287,8 +287,8 @@ public class TextComponent extends Component implements Accessible { * Sets the flag that determines whether or not this * text component is editable. *

            - * If the flag is set to true, this text component - * becomes user editable. If the flag is set to false, + * If the flag is set to {@code true}, this text component + * becomes user editable. If the flag is set to {@code false}, * the user cannot change the text of this text component. * By default, non-editable text components have a background color * of SystemColor.control. This default can be overridden by @@ -367,7 +367,7 @@ public class TextComponent extends Component implements Accessible { * to be at or before the current selection end. It also * cannot be set to less than zero, the beginning of the * component's text. - * If the caller supplies a value for selectionStart + * If the caller supplies a value for {@code selectionStart} * that is out of bounds, the method enforces these constraints * silently, and without failure. * @param selectionStart the start position of the @@ -403,7 +403,7 @@ public class TextComponent extends Component implements Accessible { * the specified position. The new end point is constrained * to be at or after the current selection start. It also * cannot be set beyond the end of the component's text. - * If the caller supplies a value for selectionEnd + * If the caller supplies a value for {@code selectionEnd} * that is out of bounds, the method enforces these constraints * silently, and without failure. * @param selectionEnd the end position of the @@ -429,8 +429,8 @@ public class TextComponent extends Component implements Accessible { * equal to the length of the text component's text. The * character positions are indexed starting with zero. * The length of the selection is - * endPosition - startPosition, so the - * character at endPosition is not selected. + * {@code endPosition} - {@code startPosition}, so the + * character at {@code endPosition} is not selected. * If the start and end positions of the selected text are equal, * all text is deselected. *

            @@ -443,10 +443,10 @@ public class TextComponent extends Component implements Accessible { * start position, it is reset to the start position. * * @param selectionStart the zero-based index of the first - character (char value) to be selected + * character ({@code char} value) to be selected * @param selectionEnd the zero-based end position of the - text to be selected; the character (char value) at - selectionEnd is not selected + * text to be selected; the character ({@code char} value) at + * {@code selectionEnd} is not selected * @see java.awt.TextComponent#setSelectionStart * @see java.awt.TextComponent#setSelectionEnd * @see java.awt.TextComponent#selectAll @@ -495,13 +495,13 @@ public class TextComponent extends Component implements Accessible { * and the last character of the text, inclusive. * If the passed-in value is greater than this range, * the value is set to the last character (or 0 if - * the TextComponent contains no text) + * the {@code TextComponent} contains no text) * and no error is returned. If the passed-in value is - * less than 0, an IllegalArgumentException + * less than 0, an {@code IllegalArgumentException} * is thrown. * * @param position the position of the text insertion caret - * @exception IllegalArgumentException if position + * @exception IllegalArgumentException if {@code position} * is less than zero * @since 1.1 */ @@ -553,7 +553,7 @@ public class TextComponent extends Component implements Accessible { /** * Adds the specified text event listener to receive text events * from this text component. - * If l is null, no exception is + * If {@code l} is {@code null}, no exception is * thrown and no action is performed. *

            Refer to AWT Threading Issues for details on AWT's threading model. @@ -574,7 +574,7 @@ public class TextComponent extends Component implements Accessible { /** * Removes the specified text event listener so that it no longer * receives text events from this text component - * If l is null, no exception is + * If {@code l} is {@code null}, no exception is * thrown and no action is performed. *

            Refer to AWT Threading Issues for details on AWT's threading model. @@ -596,7 +596,7 @@ public class TextComponent extends Component implements Accessible { * Returns an array of all the text listeners * registered on this text component. * - * @return all of this text component's TextListeners + * @return all of this text component's {@code TextListener}s * or an empty array if no text * listeners are currently registered * @@ -612,16 +612,16 @@ public class TextComponent extends Component implements Accessible { /** * Returns an array of all the objects currently registered * as FooListeners - * upon this TextComponent. + * upon this {@code TextComponent}. * FooListeners are registered using the * addFooListener method. * *

            - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * TextComponent t + * {@code TextComponent t} * for its text listeners with the following code: * *

            TextListener[] tls = (TextListener[])(t.getListeners(TextListener.class));
            @@ -630,14 +630,14 @@ public class TextComponent extends Component implements Accessible { * * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this text component, * or an empty array if no such * listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @see #getTextListeners * @since 1.3 @@ -666,9 +666,9 @@ public class TextComponent extends Component implements Accessible { /** * Processes events on this text component. If the event is a - * TextEvent, it invokes the processTextEvent - * method else it invokes its superclass's processEvent. - *

            Note that if the event parameter is null + * {@code TextEvent}, it invokes the {@code processTextEvent} + * method else it invokes its superclass's {@code processEvent}. + *

            Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -684,17 +684,17 @@ public class TextComponent extends Component implements Accessible { /** * Processes text events occurring on this text component by - * dispatching them to any registered TextListener objects. + * dispatching them to any registered {@code TextListener} objects. *

            * NOTE: This method will not be called unless text events * are enabled for this component. This happens when one of the * following occurs: *

              - *
            • A TextListener object is registered - * via addTextListener - *
            • Text events are enabled via enableEvents + *
            • A {@code TextListener} object is registered + * via {@code addTextListener} + *
            • Text events are enabled via {@code enableEvents} *
            - *

            Note that if the event parameter is null + *

            Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -715,11 +715,11 @@ public class TextComponent extends Component implements Accessible { /** * Returns a string representing the state of this - * TextComponent. This + * {@code TextComponent}. This * method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this text component */ @@ -795,8 +795,8 @@ public class TextComponent extends Component implements Accessible { * ignored. * * @exception HeadlessException if - * GraphicsEnvironment.isHeadless() returns - * true + * {@code GraphicsEnvironment.isHeadless()} returns + * {@code true} * @see #removeTextListener * @see #addTextListener * @see java.awt.GraphicsEnvironment#isHeadless @@ -850,7 +850,7 @@ public class TextComponent extends Component implements Accessible { /** * This class implements accessibility support for the - * TextComponent class. It provides an implementation of the + * {@code TextComponent} class. It provides an implementation of the * Java Accessibility API appropriate to text component user-interface * elements. * @since 1.3 diff --git a/jdk/src/java.desktop/share/classes/java/awt/TextField.java b/jdk/src/java.desktop/share/classes/java/awt/TextField.java index 7c5563088c3..effdfd43d24 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/TextField.java +++ b/jdk/src/java.desktop/share/classes/java/awt/TextField.java @@ -34,12 +34,12 @@ import javax.accessibility.*; /** - * A TextField object is a text component + * A {@code TextField} object is a text component * that allows for the editing of a single line of text. *

            * For example, the following image depicts a frame with four * text fields of varying widths. Two of these text fields - * display the predefined text "Hello". + * display the predefined text {@code "Hello"}. *

            * The preceding text describes this image. @@ -59,27 +59,27 @@ import javax.accessibility.*; *


            *

            * Every time the user types a key in the text field, one or - * more key events are sent to the text field. A KeyEvent + * more key events are sent to the text field. A {@code KeyEvent} * may be one of three types: keyPressed, keyReleased, or keyTyped. * The properties of a key event indicate which of these types * it is, as well as additional information about the event, * such as what modifiers are applied to the key event and the * time at which the event occurred. *

            - * The key event is passed to every KeyListener - * or KeyAdapter object which registered to receive such - * events using the component's addKeyListener method. - * (KeyAdapter objects implement the - * KeyListener interface.) + * The key event is passed to every {@code KeyListener} + * or {@code KeyAdapter} object which registered to receive such + * events using the component's {@code addKeyListener} method. + * ({@code KeyAdapter} objects implement the + * {@code KeyListener} interface.) *

            - * It is also possible to fire an ActionEvent. + * It is also possible to fire an {@code ActionEvent}. * If action events are enabled for the text field, they may - * be fired by pressing the Return key. + * be fired by pressing the {@code Return} key. *

            - * The TextField class's processEvent + * The {@code TextField} class's {@code processEvent} * method examines the action event and passes it along to - * processActionEvent. The latter method redirects the - * event to any ActionListener objects that have + * {@code processActionEvent}. The latter method redirects the + * event to any {@code ActionListener} objects that have * registered to receive action events generated by this * text field. * @@ -112,7 +112,7 @@ public class TextField extends TextComponent { * The echo character, which is used when * the user wishes to disguise the characters * typed into the text field. - * The disguises are removed if echoChar = 0. + * The disguises are removed if echoChar = {@code 0}. * * @serial * @see #getEchoChar() @@ -157,8 +157,8 @@ public class TextField extends TextComponent { /** * Constructs a new text field initialized with the specified text. * @param text the text to be displayed. If - * text is null, the empty - * string "" will be displayed. + * {@code text} is {@code null}, the empty + * string {@code ""} will be displayed. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. * @see java.awt.GraphicsEnvironment#isHeadless @@ -172,8 +172,8 @@ public class TextField extends TextComponent { * of columns. A column is an approximate average character * width that is platform-dependent. * @param columns the number of columns. If - * columns is less than 0, - * columns is set to 0. + * {@code columns} is less than {@code 0}, + * {@code columns} is set to {@code 0}. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. * @see java.awt.GraphicsEnvironment#isHeadless @@ -188,11 +188,11 @@ public class TextField extends TextComponent { * number of columns. A column is an approximate average character * width that is platform-dependent. * @param text the text to be displayed. If - * text is null, the empty - * string "" will be displayed. + * {@code text} is {@code null}, the empty + * string {@code ""} will be displayed. * @param columns the number of columns. If - * columns is less than 0, - * columns is set to 0. + * {@code columns} is less than {@code 0}, + * {@code columns} is set to {@code 0}. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. * @see java.awt.GraphicsEnvironment#isHeadless @@ -230,7 +230,7 @@ public class TextField extends TextComponent { * An echo character is useful for text fields where * user input should not be echoed to the screen, as in * the case of a text field for entering a password. - * If echoChar = 0, user + * If {@code echoChar} = {@code 0}, user * input is echoed to the screen unchanged. *

            * A Java platform implementation may support only a limited, @@ -252,7 +252,7 @@ public class TextField extends TextComponent { * An echo character is useful for text fields where * user input should not be echoed to the screen, as in * the case of a text field for entering a password. - * Setting echoChar = 0 allows + * Setting {@code echoChar} = {@code 0} allows * user input to be echoed to the screen again. *

            * A Java platform implementation may support only a limited, @@ -277,7 +277,7 @@ public class TextField extends TextComponent { * @param c the echo character for this text field * * @deprecated As of JDK version 1.1, - * replaced by setEchoChar(char). + * replaced by {@code setEchoChar(char)}. */ @Deprecated public synchronized void setEchoCharacter(char c) { @@ -329,9 +329,9 @@ public class TextField extends TextComponent { * An echo character is useful for text fields where * user input should not be echoed to the screen, as in * the case of a text field for entering a password. - * @return true if this text field has + * @return {@code true} if this text field has * a character set for echoing; - * false otherwise. + * {@code false} otherwise. * @see java.awt.TextField#setEchoChar * @see java.awt.TextField#getEchoChar */ @@ -356,8 +356,8 @@ public class TextField extends TextComponent { * @param columns the number of columns. * @see java.awt.TextField#getColumns * @exception IllegalArgumentException if the value - * supplied for columns - * is less than 0. + * supplied for {@code columns} + * is less than {@code 0}. * @since 1.1 */ public void setColumns(int columns) { @@ -398,7 +398,7 @@ public class TextField extends TextComponent { * @return the preferred size for the text field * * @deprecated As of JDK version 1.1, - * replaced by getPreferredSize(int). + * replaced by {@code getPreferredSize(int)}. */ @Deprecated public Dimension preferredSize(int columns) { @@ -422,7 +422,7 @@ public class TextField extends TextComponent { /** * @deprecated As of JDK version 1.1, - * replaced by getPreferredSize(). + * replaced by {@code getPreferredSize()}. */ @Deprecated public Dimension preferredSize() { @@ -452,7 +452,7 @@ public class TextField extends TextComponent { * @param columns the number of columns * @return the minimum size for this text field * @deprecated As of JDK version 1.1, - * replaced by getMinimumSize(int). + * replaced by {@code getMinimumSize(int)}. */ @Deprecated public Dimension minimumSize(int columns) { @@ -476,7 +476,7 @@ public class TextField extends TextComponent { /** * @deprecated As of JDK version 1.1, - * replaced by getMinimumSize(). + * replaced by {@code getMinimumSize()}. */ @Deprecated public Dimension minimumSize() { @@ -532,7 +532,7 @@ public class TextField extends TextComponent { * Returns an array of all the action listeners * registered on this textfield. * - * @return all of this textfield's ActionListeners + * @return all of this textfield's {@code ActionListener}s * or an empty array if no action * listeners are currently registered * @@ -548,16 +548,16 @@ public class TextField extends TextComponent { /** * Returns an array of all the objects currently registered * as FooListeners - * upon this TextField. + * upon this {@code TextField}. * FooListeners are registered using the * addFooListener method. * *

            - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * TextField t + * {@code TextField t} * for its action listeners with the following code: * *

            ActionListener[] als = (ActionListener[])(t.getListeners(ActionListener.class));
            @@ -566,14 +566,14 @@ public class TextField extends TextComponent { * * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this textfield, * or an empty array if no such * listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @see #getActionListeners * @since 1.3 @@ -602,11 +602,11 @@ public class TextField extends TextComponent { /** * Processes events on this text field. If the event - * is an instance of ActionEvent, - * it invokes the processActionEvent - * method. Otherwise, it invokes processEvent + * is an instance of {@code ActionEvent}, + * it invokes the {@code processActionEvent} + * method. Otherwise, it invokes {@code processEvent} * on the superclass. - *

            Note that if the event parameter is null + *

            Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -626,17 +626,17 @@ public class TextField extends TextComponent { /** * Processes action events occurring on this text field by * dispatching them to any registered - * ActionListener objects. + * {@code ActionListener} objects. *

            * This method is not called unless action events are * enabled for this component. Action events are enabled * when one of the following occurs: *

              - *
            • An ActionListener object is registered - * via addActionListener. - *
            • Action events are enabled via enableEvents. + *
            • An {@code ActionListener} object is registered + * via {@code addActionListener}. + *
            • Action events are enabled via {@code enableEvents}. *
            - *

            Note that if the event parameter is null + *

            Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -654,11 +654,11 @@ public class TextField extends TextComponent { } /** - * Returns a string representing the state of this TextField. + * Returns a string representing the state of this {@code TextField}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this text field */ @@ -712,8 +712,8 @@ public class TextField extends TextComponent { * ignored. * * @exception HeadlessException if - * GraphicsEnvironment.isHeadless() returns - * true + * {@code GraphicsEnvironment.isHeadless()} returns + * {@code true} * @see #removeActionListener(ActionListener) * @see #addActionListener(ActionListener) * @see java.awt.GraphicsEnvironment#isHeadless @@ -769,7 +769,7 @@ public class TextField extends TextComponent { /** * This class implements accessibility support for the - * TextField class. It provides an implementation of the + * {@code TextField} class. It provides an implementation of the * Java Accessibility API appropriate to text field user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/TexturePaint.java b/jdk/src/java.desktop/share/classes/java/awt/TexturePaint.java index 8333965b114..387e5612984 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/TexturePaint.java +++ b/jdk/src/java.desktop/share/classes/java/awt/TexturePaint.java @@ -31,18 +31,18 @@ import java.awt.image.BufferedImage; import java.awt.image.ColorModel; /** - * The TexturePaint class provides a way to fill a + * The {@code TexturePaint} class provides a way to fill a * {@link Shape} with a texture that is specified as - * a {@link BufferedImage}. The size of the BufferedImage - * object should be small because the BufferedImage data - * is copied by the TexturePaint object. + * a {@link BufferedImage}. The size of the {@code BufferedImage} + * object should be small because the {@code BufferedImage} data + * is copied by the {@code TexturePaint} object. * At construction time, the texture is anchored to the upper * left corner of a {@link Rectangle2D} that is * specified in user space. Texture is computed for * locations in the device space by conceptually replicating the - * specified Rectangle2D infinitely in all directions - * in user space and mapping the BufferedImage to each - * replicated Rectangle2D. + * specified {@code Rectangle2D} infinitely in all directions + * in user space and mapping the {@code BufferedImage} to each + * replicated {@code Rectangle2D}. * @see Paint * @see Graphics2D#setPaint * @version 1.48, 06/05/07 @@ -57,10 +57,10 @@ public class TexturePaint implements Paint { double sy; /** - * Constructs a TexturePaint object. - * @param txtr the BufferedImage object with the texture + * Constructs a {@code TexturePaint} object. + * @param txtr the {@code BufferedImage} object with the texture * used for painting - * @param anchor the Rectangle2D in user space used to + * @param anchor the {@code Rectangle2D} in user space used to * anchor and replicate the texture */ public TexturePaint(BufferedImage txtr, @@ -73,9 +73,9 @@ public class TexturePaint implements Paint { } /** - * Returns the BufferedImage texture used to + * Returns the {@code BufferedImage} texture used to * fill the shapes. - * @return a BufferedImage. + * @return a {@code BufferedImage}. */ public BufferedImage getImage() { return bufImg; @@ -84,8 +84,8 @@ public class TexturePaint implements Paint { /** * Returns a copy of the anchor rectangle which positions and * sizes the textured image. - * @return the Rectangle2D used to anchor and - * size this TexturePaint. + * @return the {@code Rectangle2D} used to anchor and + * size this {@code TexturePaint}. */ public Rectangle2D getAnchorRect() { return new Rectangle2D.Double(tx, ty, @@ -139,8 +139,8 @@ public class TexturePaint implements Paint { } /** - * Returns the transparency mode for this TexturePaint. - * @return the transparency mode for this TexturePaint + * Returns the transparency mode for this {@code TexturePaint}. + * @return the transparency mode for this {@code TexturePaint} * as an integer value. * @see Transparency */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java b/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java index ee020270f19..663a6c72a1b 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java @@ -69,7 +69,7 @@ import javax.accessibility.AccessibilityProvider; /** * This class is the abstract superclass of all actual * implementations of the Abstract Window Toolkit. Subclasses of - * the Toolkit class are used to bind the various components + * the {@code Toolkit} class are used to bind the various components * to particular native toolkit implementations. *

            * Many GUI events may be delivered to user @@ -82,8 +82,8 @@ import javax.accessibility.AccessibilityProvider; * limited to: *

              *
            • Scrolling to a specified position. - *
              For example, calling ScrollPane.setScrollPosition - * and then getScrollPosition may return an incorrect + *
              For example, calling {@code ScrollPane.setScrollPosition} + * and then {@code getScrollPosition} may return an incorrect * value if the original request has not yet been processed. * *
            • Moving the focus from one component to another. @@ -94,25 +94,25 @@ import javax.accessibility.AccessibilityProvider; * Tutorial. * *
            • Making a top-level container visible. - *
              Calling setVisible(true) on a Window, - * Frame or Dialog may occur + *
              Calling {@code setVisible(true)} on a {@code Window}, + * {@code Frame} or {@code Dialog} may occur * asynchronously. * *
            • Setting the size or location of a top-level container. - *
              Calls to setSize, setBounds or - * setLocation on a Window, - * Frame or Dialog are forwarded + *
              Calls to {@code setSize}, {@code setBounds} or + * {@code setLocation} on a {@code Window}, + * {@code Frame} or {@code Dialog} are forwarded * to the underlying window management system and may be * ignored or modified. See {@link java.awt.Window} for * more information. *
            *

            * Most applications should not call any of the methods in this - * class directly. The methods defined by Toolkit are + * class directly. The methods defined by {@code Toolkit} are * the "glue" that joins the platform-independent classes in the - * java.awt package with their counterparts in - * java.awt.peer. Some methods defined by - * Toolkit query the native operating system directly. + * {@code java.awt} package with their counterparts in + * {@code java.awt.peer}. Some methods defined by + * {@code Toolkit} query the native operating system directly. * * @author Sami Shaio * @author Arthur van Hoff @@ -247,8 +247,8 @@ public abstract class Toolkit { /** * Gets the size of the screen. On systems with multiple displays, the * primary display is used. Multi-screen aware display dimensions are - * available from GraphicsConfiguration and - * GraphicsDevice. + * available from {@code GraphicsConfiguration} and + * {@code GraphicsDevice}. * @return the size of this toolkit's screen, in pixels. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true @@ -271,7 +271,7 @@ public abstract class Toolkit { /** * Gets the insets of the screen. - * @param gc a GraphicsConfiguration + * @param gc a {@code GraphicsConfiguration} * @return the insets of this toolkit's screen, in pixels. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true @@ -291,14 +291,14 @@ public abstract class Toolkit { /** * Determines the color model of this toolkit's screen. *

            - * ColorModel is an abstract class that + * {@code ColorModel} is an abstract class that * encapsulates the ability to translate between the * pixel values of an image and its red, green, blue, * and alpha components. *

            * This toolkit method is called by the - * getColorModel method - * of the Component class. + * {@code getColorModel} method + * of the {@code Component} class. * @return the color model of this toolkit's screen. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true @@ -332,8 +332,8 @@ public abstract class Toolkit { * Gets the screen device metrics for rendering of the font. * @param font a font * @return the screen metrics of the specified font in this toolkit - * @deprecated As of JDK version 1.2, replaced by the Font - * method getLineMetrics. + * @deprecated As of JDK version 1.2, replaced by the {@code Font} + * method {@code getLineMetrics}. * @see java.awt.font.LineMetrics * @see java.awt.Font#getLineMetrics * @see java.awt.GraphicsEnvironment#getScreenDevices @@ -606,22 +606,22 @@ public abstract class Toolkit { * with the same filename to the same returned Image. *

            * Since the mechanism required to facilitate this sharing of - * Image objects may continue to hold onto images + * {@code Image} objects may continue to hold onto images * that are no longer in use for an indefinite period of time, * developers are encouraged to implement their own caching of * images by using the {@link #createImage(java.lang.String) createImage} * variant wherever available. * If the image data contained in the specified file changes, - * the Image object returned from this method may + * the {@code Image} object returned from this method may * still contain stale information which was loaded from the * file after a prior call. * Previously loaded image data can be manually discarded by * calling the {@link Image#flush flush} method on the - * returned Image. + * returned {@code Image}. *

            * This method first checks if there is a security manager installed. * If so, the method calls the security manager's - * checkRead method with the file specified to ensure + * {@code checkRead} method with the file specified to ensure * that the access to the image is allowed. * @param filename the name of a file containing pixel data * in a recognized file format. @@ -641,27 +641,27 @@ public abstract class Toolkit { * with the same URL to the same returned Image. *

            * Since the mechanism required to facilitate this sharing of - * Image objects may continue to hold onto images + * {@code Image} objects may continue to hold onto images * that are no longer in use for an indefinite period of time, * developers are encouraged to implement their own caching of * images by using the {@link #createImage(java.net.URL) createImage} * variant wherever available. * If the image data stored at the specified URL changes, - * the Image object returned from this method may + * the {@code Image} object returned from this method may * still contain stale information which was fetched from the * URL after a prior call. * Previously loaded image data can be manually discarded by * calling the {@link Image#flush flush} method on the - * returned Image. + * returned {@code Image}. *

            * This method first checks if there is a security manager installed. * If so, the method calls the security manager's - * checkPermission method with the + * {@code checkPermission} method with the * url.openConnection().getPermission() permission to ensure * that the access to the image is allowed. For compatibility * with pre-1.2 security managers, if the access is denied with - * FilePermission or SocketPermission, - * the method throws the SecurityException + * {@code FilePermission} or {@code SocketPermission}, + * the method throws the {@code SecurityException} * if the corresponding 1.1-style SecurityManager.checkXXX method * also denies permission. * @param url the URL to use in fetching the pixel data. @@ -681,7 +681,7 @@ public abstract class Toolkit { *

            * This method first checks if there is a security manager installed. * If so, the method calls the security manager's - * checkRead method with the specified file to ensure + * {@code checkRead} method with the specified file to ensure * that the image creation is allowed. * @param filename the name of a file containing pixel data * in a recognized file format. @@ -700,12 +700,12 @@ public abstract class Toolkit { *

            * This method first checks if there is a security manager installed. * If so, the method calls the security manager's - * checkPermission method with the + * {@code checkPermission} method with the * url.openConnection().getPermission() permission to ensure * that the image creation is allowed. For compatibility * with pre-1.2 security managers, if the access is denied with - * FilePermission or SocketPermission, - * the method throws SecurityException + * {@code FilePermission} or {@code SocketPermission}, + * the method throws {@code SecurityException} * if the corresponding 1.1-style SecurityManager.checkXXX method * also denies permission. * @param url the URL to use in fetching the pixel data. @@ -722,7 +722,7 @@ public abstract class Toolkit { * Prepares an image for rendering. *

            * If the values of the width and height arguments are both - * -1, this method prepares the image for rendering + * {@code -1}, this method prepares the image for rendering * on the default screen; otherwise, this method prepares an image * for rendering on the default screen at the specified width and height. *

            @@ -730,23 +730,23 @@ public abstract class Toolkit { * and an appropriately scaled screen representation of the image is * generated. *

            - * This method is called by components prepareImage + * This method is called by components {@code prepareImage} * methods. *

            * Information on the flags returned by this method can be found - * with the definition of the ImageObserver interface. + * with the definition of the {@code ImageObserver} interface. * @param image the image for which to prepare a * screen representation. * @param width the width of the desired screen - * representation, or -1. + * representation, or {@code -1}. * @param height the height of the desired screen - * representation, or -1. - * @param observer the ImageObserver + * representation, or {@code -1}. + * @param observer the {@code ImageObserver} * object to be notified as the * image is being prepared. - * @return true if the image has already been - * fully prepared; false otherwise. + * @return {@code true} if the image has already been + * fully prepared; {@code false} otherwise. * @see java.awt.Component#prepareImage(java.awt.Image, * java.awt.image.ImageObserver) * @see java.awt.Component#prepareImage(java.awt.Image, @@ -761,30 +761,30 @@ public abstract class Toolkit { * being prepared for display. *

            * If the values of the width and height arguments are both - * -1, this method returns the construction status of + * {@code -1}, this method returns the construction status of * a screen representation of the specified image in this toolkit. * Otherwise, this method returns the construction status of a * scaled representation of the image at the specified width * and height. *

            * This method does not cause the image to begin loading. - * An application must call prepareImage to force + * An application must call {@code prepareImage} to force * the loading of an image. *

            - * This method is called by the component's checkImage + * This method is called by the component's {@code checkImage} * methods. *

            * Information on the flags returned by this method can be found - * with the definition of the ImageObserver interface. + * with the definition of the {@code ImageObserver} interface. * @param image the image whose status is being checked. * @param width the width of the scaled version whose status is - * being checked, or -1. + * being checked, or {@code -1}. * @param height the height of the scaled version whose status - * is being checked, or -1. - * @param observer the ImageObserver object to be + * is being checked, or {@code -1}. + * @param observer the {@code ImageObserver} object to be * notified as the image is being prepared. * @return the bitwise inclusive OR of the - * ImageObserver flags for the + * {@code ImageObserver} flags for the * image data that is currently available. * @see java.awt.Toolkit#prepareImage(java.awt.Image, * int, int, java.awt.image.ImageObserver) @@ -840,17 +840,17 @@ public abstract class Toolkit { int imagelength); /** - * Gets a PrintJob object which is the result of initiating + * Gets a {@code PrintJob} object which is the result of initiating * a print operation on the toolkit's platform. *

            * Each actual implementation of this method should first check if there * is a security manager installed. If there is, the method should call - * the security manager's checkPrintJobAccess method to + * the security manager's {@code checkPrintJobAccess} method to * ensure initiation of a print operation is allowed. If the default - * implementation of checkPrintJobAccess is used (that is, + * implementation of {@code checkPrintJobAccess} is used (that is, * that method is not overriden), then this results in a call to the - * security manager's checkPermission method with a - * RuntimePermission("queuePrintJob") permission. + * security manager's {@code checkPermission} method with a + * {@code RuntimePermission("queuePrintJob")} permission. * * @param frame the parent of the print dialog. May not be null. * @param jobtitle the title of the PrintJob. A null title is equivalent @@ -862,7 +862,7 @@ public abstract class Toolkit { * takes JobAttributes and PageAttributes objects. This object * may be updated to reflect the user's job choices on exit. May * be null. - * @return a PrintJob object, or null if the + * @return a {@code PrintJob} object, or {@code null} if the * user cancelled the print job. * @throws NullPointerException if frame is null * @throws SecurityException if this thread is not allowed to initiate a @@ -876,17 +876,17 @@ public abstract class Toolkit { Properties props); /** - * Gets a PrintJob object which is the result of initiating + * Gets a {@code PrintJob} object which is the result of initiating * a print operation on the toolkit's platform. *

            * Each actual implementation of this method should first check if there * is a security manager installed. If there is, the method should call - * the security manager's checkPrintJobAccess method to + * the security manager's {@code checkPrintJobAccess} method to * ensure initiation of a print operation is allowed. If the default - * implementation of checkPrintJobAccess is used (that is, + * implementation of {@code checkPrintJobAccess} is used (that is, * that method is not overriden), then this results in a call to the - * security manager's checkPermission method with a - * RuntimePermission("queuePrintJob") permission. + * security manager's {@code checkPermission} method with a + * {@code RuntimePermission("queuePrintJob")} permission. * * @param frame the parent of the print dialog. May not be null. * @param jobtitle the title of the PrintJob. A null title is equivalent @@ -900,7 +900,7 @@ public abstract class Toolkit { * job. The attributes will be updated to reflect the user's * choices as outlined in the PageAttributes documentation. May be * null. - * @return a PrintJob object, or null if the + * @return a {@code PrintJob} object, or {@code null} if the * user cancelled the print job. * @throws NullPointerException if frame is null * @throws IllegalArgumentException if pageAttributes specifies differing @@ -952,20 +952,20 @@ public abstract class Toolkit { * applications which use native clipboard facilities. *

            * In addition to any and all default formats text returned by the system - * Clipboard's getTransferData() method is available in the + * Clipboard's {@code getTransferData()} method is available in the * following flavors: *

              *
            • DataFlavor.stringFlavor
            • *
            • DataFlavor.plainTextFlavor (deprecated)
            • *
            - * As with java.awt.datatransfer.StringSelection, if the - * requested flavor is DataFlavor.plainTextFlavor, or an + * As with {@code java.awt.datatransfer.StringSelection}, if the + * requested flavor is {@code DataFlavor.plainTextFlavor}, or an * equivalent flavor, a Reader is returned. Note: The behavior of - * the system Clipboard's getTransferData() method for - * DataFlavor.plainTextFlavor, and equivalent DataFlavors, is - * inconsistent with the definition of DataFlavor.plainTextFlavor - * . Because of this, support for - * DataFlavor.plainTextFlavor, and equivalent flavors, is + * the system Clipboard's {@code getTransferData()} method for + * {@code DataFlavor.plainTextFlavor}, and equivalent DataFlavors, is + * inconsistent with the definition of {@code DataFlavor.plainTextFlavor}. + * Because of this, support for + * {@code DataFlavor.plainTextFlavor}, and equivalent flavors, is * deprecated. *

            * Each actual implementation of this method should first check if there @@ -990,37 +990,37 @@ public abstract class Toolkit { /** * Gets the singleton instance of the system selection as a - * Clipboard object. This allows an application to read and + * {@code Clipboard} object. This allows an application to read and * modify the current, system-wide selection. *

            * An application is responsible for updating the system selection whenever * the user selects text, using either the mouse or the keyboard. * Typically, this is implemented by installing a - * FocusListener on all Components which support - * text selection, and, between FOCUS_GAINED and - * FOCUS_LOST events delivered to that Component, - * updating the system selection Clipboard when the selection - * changes inside the Component. Properly updating the system + * {@code FocusListener} on all {@code Component}s which support + * text selection, and, between {@code FOCUS_GAINED} and + * {@code FOCUS_LOST} events delivered to that {@code Component}, + * updating the system selection {@code Clipboard} when the selection + * changes inside the {@code Component}. Properly updating the system * selection ensures that a Java application will interact correctly with * native applications and other Java applications running simultaneously - * on the system. Note that java.awt.TextComponent and - * javax.swing.text.JTextComponent already adhere to this + * on the system. Note that {@code java.awt.TextComponent} and + * {@code javax.swing.text.JTextComponent} already adhere to this * policy. When using these classes, and their subclasses, developers need * not write any additional code. *

            - * Some platforms do not support a system selection Clipboard. - * On those platforms, this method will return null. In such a + * Some platforms do not support a system selection {@code Clipboard}. + * On those platforms, this method will return {@code null}. In such a * case, an application is absolved from its responsibility to update the - * system selection Clipboard as described above. + * system selection {@code Clipboard} as described above. *

            * Each actual implementation of this method should first check if there * is a security manager installed. If there is, the method should call * the security manager's {@link SecurityManager#checkPermission * checkPermission} method to check {@code AWTPermission("accessClipboard")}. * - * @return the system selection as a Clipboard, or - * null if the native platform does not support a - * system selection Clipboard + * @return the system selection as a {@code Clipboard}, or + * {@code null} if the native platform does not support a + * system selection {@code Clipboard} * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @@ -1050,13 +1050,13 @@ public abstract class Toolkit { * key for menu shortcuts. *

            * Menu shortcuts, which are embodied in the - * MenuShortcut class, are handled by the - * MenuBar class. + * {@code MenuShortcut} class, are handled by the + * {@code MenuBar} class. *

            - * By default, this method returns Event.CTRL_MASK. + * By default, this method returns {@code Event.CTRL_MASK}. * Toolkit implementations should override this method if the * Control key isn't the correct key for accelerators. - * @return the modifier mask on the Event class + * @return the modifier mask on the {@code Event} class * that is used for menu shortcuts on this toolkit. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true @@ -1083,7 +1083,7 @@ public abstract class Toolkit { * @param keyCode the key code * @return {@code true} if the given key is currently in its "on" state; * otherwise {@code false} - * @exception java.lang.IllegalArgumentException if keyCode + * @exception java.lang.IllegalArgumentException if {@code keyCode} * is not one of the valid key codes * @exception java.lang.UnsupportedOperationException if the host system doesn't * allow getting the state of this key programmatically, or if the keyboard @@ -1119,7 +1119,7 @@ public abstract class Toolkit { * * @param keyCode the key code * @param on the state of the key - * @exception java.lang.IllegalArgumentException if keyCode + * @exception java.lang.IllegalArgumentException if {@code keyCode} * is not one of the valid key codes * @exception java.lang.UnsupportedOperationException if the host system doesn't * allow setting the state of this key programmatically, or if the keyboard @@ -1163,7 +1163,7 @@ public abstract class Toolkit { * @param cursor the image to display when the cursor is activated * @param hotSpot the X and Y of the large cursor's hot spot; the * hotSpot values must be less than the Dimension returned by - * getBestCursorSize + * {@code getBestCursorSize} * @param name a localized description of the cursor, for Java Accessibility use * @exception IndexOutOfBoundsException if the hotSpot values are outside * the bounds of the cursor @@ -1252,10 +1252,10 @@ public abstract class Toolkit { /** * Returns whether Toolkit supports this state for - * Frames. This method tells whether the UI + * {@code Frame}s. This method tells whether the UI * concept of, say, maximization or iconification is * supported. It will always return false for "compound" states - * like Frame.ICONIFIED|Frame.MAXIMIZED_VERT. + * like {@code Frame.ICONIFIED|Frame.MAXIMIZED_VERT}. * In other words, the rule of thumb is that only queries with a * single frame state constant as an argument are meaningful. *

            Note that supporting a given concept is a platform- @@ -1280,11 +1280,11 @@ public abstract class Toolkit { *

          * * @param state one of named frame state constants. - * @return true is this frame state is supported by - * this Toolkit implementation, false otherwise. + * @return {@code true} is this frame state is supported by + * this Toolkit implementation, {@code false} otherwise. * @exception HeadlessException - * if GraphicsEnvironment.isHeadless() - * returns true. + * if {@code GraphicsEnvironment.isHeadless()} + * returns {@code true}. * @see java.awt.Window#addWindowStateListener * @since 1.4 */ @@ -1431,7 +1431,7 @@ public abstract class Toolkit { * {@link SecurityManager#checkPermission checkPermission} method * is called to check {@code AWTPermission("accessEventQueue")}. * - * @return the EventQueue object + * @return the {@code EventQueue} object * @throws SecurityException * if a security manager is set and it denies access to * the {@code EventQueue} @@ -1446,10 +1446,10 @@ public abstract class Toolkit { } /** - * Gets the application's or applet's EventQueue + * Gets the application's or applet's {@code EventQueue} * instance, without checking access. For security reasons, - * this can only be called from a Toolkit subclass. - * @return the EventQueue object + * this can only be called from a {@code Toolkit} subclass. + * @return the {@code EventQueue} object */ protected abstract EventQueue getSystemEventQueueImpl(); @@ -1664,8 +1664,8 @@ public abstract class Toolkit { * Returns whether the always-on-top mode is supported by this toolkit. * To detect whether the always-on-top mode is supported for a * particular Window, use {@link Window#isAlwaysOnTopSupported}. - * @return true, if current toolkit supports the always-on-top mode, - * otherwise returns false + * @return {@code true}, if current toolkit supports the always-on-top mode, + * otherwise returns {@code false} * @see Window#isAlwaysOnTopSupported * @see Window#setAlwaysOnTop(boolean) * @since 1.6 @@ -1677,12 +1677,12 @@ public abstract class Toolkit { /** * Returns whether the given modality type is supported by this toolkit. If * a dialog with unsupported modality type is created, then - * Dialog.ModalityType.MODELESS is used instead. + * {@code Dialog.ModalityType.MODELESS} is used instead. * * @param modalityType modality type to be checked for support by this toolkit * - * @return true, if current toolkit supports given modality - * type, false otherwise + * @return {@code true}, if current toolkit supports given modality + * type, {@code false} otherwise * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#getModalityType @@ -1695,12 +1695,12 @@ public abstract class Toolkit { /** * Returns whether the given modal exclusion type is supported by this * toolkit. If an unsupported modal exclusion type property is set on a window, - * then Dialog.ModalExclusionType.NO_EXCLUDE is used instead. + * then {@code Dialog.ModalExclusionType.NO_EXCLUDE} is used instead. * * @param modalExclusionType modal exclusion type to be checked for support by this toolkit * - * @return true, if current toolkit supports given modal exclusion - * type, false otherwise + * @return {@code true}, if current toolkit supports given modal exclusion + * type, {@code false} otherwise * * @see java.awt.Dialog.ModalExclusionType * @see java.awt.Window#getModalExclusionType @@ -1739,16 +1739,16 @@ public abstract class Toolkit { /** * Adds an AWTEventListener to receive all AWTEvents dispatched - * system-wide that conform to the given eventMask. + * system-wide that conform to the given {@code eventMask}. *

          - * First, if there is a security manager, its checkPermission + * First, if there is a security manager, its {@code checkPermission} * method is called with an - * AWTPermission("listenToAllAWTEvents") permission. + * {@code AWTPermission("listenToAllAWTEvents")} permission. * This may result in a SecurityException. *

          - * eventMask is a bitmask of event types to receive. + * {@code eventMask} is a bitmask of event types to receive. * It is constructed by bitwise OR-ing together the event masks - * defined in AWTEvent. + * defined in {@code AWTEvent}. *

          * Note: event listener use is not recommended for normal * application use, but are intended solely to support special @@ -1761,7 +1761,7 @@ public abstract class Toolkit { * @param eventMask the bitmask of event types to receive * @throws SecurityException * if a security manager exists and its - * checkPermission method doesn't allow the operation. + * {@code checkPermission} method doesn't allow the operation. * @see #removeAWTEventListener * @see #getAWTEventListeners * @see SecurityManager#checkPermission @@ -1815,9 +1815,9 @@ public abstract class Toolkit { /** * Removes an AWTEventListener from receiving dispatched AWTEvents. *

          - * First, if there is a security manager, its checkPermission + * First, if there is a security manager, its {@code checkPermission} * method is called with an - * AWTPermission("listenToAllAWTEvents") permission. + * {@code AWTPermission("listenToAllAWTEvents")} permission. * This may result in a SecurityException. *

          * Note: event listener use is not recommended for normal @@ -1830,7 +1830,7 @@ public abstract class Toolkit { * @param listener the event listener. * @throws SecurityException * if a security manager exists and its - * checkPermission method doesn't allow the operation. + * {@code checkPermission} method doesn't allow the operation. * @see #addAWTEventListener * @see #getAWTEventListeners * @see SecurityManager#checkPermission @@ -1884,23 +1884,23 @@ public abstract class Toolkit { return calls[ci]; } /** - * Returns an array of all the AWTEventListeners + * Returns an array of all the {@code AWTEventListener}s * registered on this toolkit. * If there is a security manager, its {@code checkPermission} * method is called with an * {@code AWTPermission("listenToAllAWTEvents")} permission. * This may result in a SecurityException. * Listeners can be returned - * within AWTEventListenerProxy objects, which also contain + * within {@code AWTEventListenerProxy} objects, which also contain * the event mask for the given listener. * Note that listener objects * added multiple times appear only once in the returned array. * - * @return all of the AWTEventListeners or an empty + * @return all of the {@code AWTEventListener}s or an empty * array if no listeners are currently registered * @throws SecurityException * if a security manager exists and its - * checkPermission method doesn't allow the operation. + * {@code checkPermission} method doesn't allow the operation. * @see #addAWTEventListener * @see #removeAWTEventListener * @see SecurityManager#checkPermission @@ -1932,7 +1932,7 @@ public abstract class Toolkit { } /** - * Returns an array of all the AWTEventListeners + * Returns an array of all the {@code AWTEventListener}s * registered on this toolkit which listen to all of the event * types specified in the {@code eventMask} argument. * If there is a security manager, its {@code checkPermission} @@ -1940,19 +1940,19 @@ public abstract class Toolkit { * {@code AWTPermission("listenToAllAWTEvents")} permission. * This may result in a SecurityException. * Listeners can be returned - * within AWTEventListenerProxy objects, which also contain + * within {@code AWTEventListenerProxy} objects, which also contain * the event mask for the given listener. * Note that listener objects * added multiple times appear only once in the returned array. * * @param eventMask the bitmask of event types to listen for - * @return all of the AWTEventListeners registered + * @return all of the {@code AWTEventListener}s registered * on this toolkit for the specified * event types, or an empty array if no such listeners * are currently registered * @throws SecurityException * if a security manager exists and its - * checkPermission method doesn't allow the operation. + * {@code checkPermission} method doesn't allow the operation. * @see #addAWTEventListener * @see #removeAWTEventListener * @see SecurityManager#checkPermission @@ -2167,9 +2167,9 @@ public abstract class Toolkit { * The style field of the input method highlight is ignored. The map * returned is unmodifiable. * @param highlight input method highlight - * @return style attribute map, or null + * @return style attribute map, or {@code null} * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns true + * {@code GraphicsEnvironment.isHeadless} returns true * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Transparency.java b/jdk/src/java.desktop/share/classes/java/awt/Transparency.java index 42b87caa4c5..6cdeb111ecc 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Transparency.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Transparency.java @@ -28,7 +28,7 @@ package java.awt; import java.lang.annotation.Native; /** - * The Transparency interface defines the common transparency + * The {@code Transparency} interface defines the common transparency * modes for implementing classes. */ public interface Transparency { @@ -53,8 +53,8 @@ public interface Transparency { @Native public static final int TRANSLUCENT = 3; /** - * Returns the type of this Transparency. - * @return the field type of this Transparency, which is + * Returns the type of this {@code Transparency}. + * @return the field type of this {@code Transparency}, which is * either OPAQUE, BITMASK or TRANSLUCENT. */ public int getTransparency(); diff --git a/jdk/src/java.desktop/share/classes/java/awt/TrayIcon.java b/jdk/src/java.desktop/share/classes/java/awt/TrayIcon.java index 3c7182afcfa..08ad08d8820 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/TrayIcon.java +++ b/jdk/src/java.desktop/share/classes/java/awt/TrayIcon.java @@ -36,32 +36,32 @@ import java.security.AccessControlContext; import java.security.AccessController; /** - * A TrayIcon object represents a tray icon that can be + * A {@code TrayIcon} object represents a tray icon that can be * added to the {@link SystemTray system tray}. A - * TrayIcon can have a tooltip (text), an image, a popup + * {@code TrayIcon} can have a tooltip (text), an image, a popup * menu, and a set of listeners associated with it. * - *

          A TrayIcon can generate various {@link MouseEvent + *

          A {@code TrayIcon} can generate various {@link MouseEvent * MouseEvents} and supports adding corresponding listeners to receive - * notification of these events. TrayIcon processes some + * notification of these events. {@code TrayIcon} processes some * of the events by itself. For example, by default, when the - * right-mouse click is performed on the TrayIcon it + * right-mouse click is performed on the {@code TrayIcon} it * displays the specified popup menu. When the mouse hovers - * over the TrayIcon the tooltip is displayed. + * over the {@code TrayIcon} the tooltip is displayed. * - *

          Note: When the MouseEvent is - * dispatched to its registered listeners its component - * property will be set to null. (See {@link + *

          Note: When the {@code MouseEvent} is + * dispatched to its registered listeners its {@code component} + * property will be set to {@code null}. (See {@link * java.awt.event.ComponentEvent#getComponent}) The - * source property will be set to this - * TrayIcon. (See {@link + * {@code source} property will be set to this + * {@code TrayIcon}. (See {@link * java.util.EventObject#getSource}) * *

          Note: A well-behaved {@link TrayIcon} implementation * will assign different gestures to showing a popup menu and * selecting a tray icon. * - *

          A TrayIcon can generate an {@link ActionEvent + *

          A {@code TrayIcon} can generate an {@link ActionEvent * ActionEvent}. On some platforms, this occurs when the user selects * the tray icon using either the mouse or keyboard. * @@ -71,7 +71,7 @@ import java.security.AccessController; * SecurityException. * *

          See the {@link SystemTray} class overview for an example on how - * to use the TrayIcon API. + * to use the {@code TrayIcon} API. * * @since 1.6 * @see SystemTray#add @@ -147,11 +147,11 @@ public class TrayIcon { } /** - * Creates a TrayIcon with the specified image. + * Creates a {@code TrayIcon} with the specified image. * - * @param image the Image to be used - * @throws IllegalArgumentException if image is - * null + * @param image the {@code Image} to be used + * @throws IllegalArgumentException if {@code image} is + * {@code null} * @throws UnsupportedOperationException if the system tray isn't * supported by the current platform * @throws HeadlessException if @@ -173,14 +173,14 @@ public class TrayIcon { } /** - * Creates a TrayIcon with the specified image and + * Creates a {@code TrayIcon} with the specified image and * tooltip text. * - * @param image the Image to be used + * @param image the {@code Image} to be used * @param tooltip the string to be used as tooltip text; if the - * value is null no tooltip is shown - * @throws IllegalArgumentException if image is - * null + * value is {@code null} no tooltip is shown + * @throws IllegalArgumentException if {@code image} is + * {@code null} * @throws UnsupportedOperationException if the system tray isn't * supported by the current platform * @throws HeadlessException if @@ -199,15 +199,15 @@ public class TrayIcon { } /** - * Creates a TrayIcon with the specified image, + * Creates a {@code TrayIcon} with the specified image, * tooltip and popup menu. * - * @param image the Image to be used + * @param image the {@code Image} to be used * @param tooltip the string to be used as tooltip text; if the - * value is null no tooltip is shown + * value is {@code null} no tooltip is shown * @param popup the menu to be used for the tray icon's popup - * menu; if the value is null no popup menu is shown - * @throws IllegalArgumentException if image is null + * menu; if the value is {@code null} no popup menu is shown + * @throws IllegalArgumentException if {@code image} is {@code null} * @throws UnsupportedOperationException if the system tray isn't * supported by the current platform * @throws HeadlessException if @@ -229,7 +229,7 @@ public class TrayIcon { } /** - * Sets the image for this TrayIcon. The previous + * Sets the image for this {@code TrayIcon}. The previous * tray icon image is discarded without calling the {@link * java.awt.Image#flush} method — you will need to call it * manually. @@ -243,8 +243,8 @@ public class TrayIcon { *

          Calling this method with the same image that is currently * being used has no effect. * - * @throws NullPointerException if image is null - * @param image the non-null Image to be used + * @throws NullPointerException if {@code image} is {@code null} + * @param image the non-null {@code Image} to be used * @see #getImage * @see Image * @see SystemTray#add(TrayIcon) @@ -263,7 +263,7 @@ public class TrayIcon { } /** - * Returns the current image used for this TrayIcon. + * Returns the current image used for this {@code TrayIcon}. * * @return the image * @see #setImage(Image) @@ -274,13 +274,13 @@ public class TrayIcon { } /** - * Sets the popup menu for this TrayIcon. If - * popup is null, no popup menu will be - * associated with this TrayIcon. + * Sets the popup menu for this {@code TrayIcon}. If + * {@code popup} is {@code null}, no popup menu will be + * associated with this {@code TrayIcon}. * - *

          Note that this popup must not be added to any + *

          Note that this {@code popup} must not be added to any * parent before or after it is set on the tray icon. If you add - * it to some parent, the popup may be removed from + * it to some parent, the {@code popup} may be removed from * that parent. * *

          The {@code popup} can be set on one {@code TrayIcon} only. @@ -295,7 +295,7 @@ public class TrayIcon { * * @throws IllegalArgumentException if the {@code popup} is already * set for another {@code TrayIcon} - * @param popup a PopupMenu or null to + * @param popup a {@code PopupMenu} or {@code null} to * remove any popup menu * @see #getPopupMenu */ @@ -318,9 +318,9 @@ public class TrayIcon { } /** - * Returns the popup menu associated with this TrayIcon. + * Returns the popup menu associated with this {@code TrayIcon}. * - * @return the popup menu or null if none exists + * @return the popup menu or {@code null} if none exists * @see #setPopupMenu(PopupMenu) */ public PopupMenu getPopupMenu() { @@ -328,16 +328,16 @@ public class TrayIcon { } /** - * Sets the tooltip string for this TrayIcon. The + * Sets the tooltip string for this {@code TrayIcon}. The * tooltip is displayed automatically when the mouse hovers over - * the icon. Setting the tooltip to null removes any + * the icon. Setting the tooltip to {@code null} removes any * tooltip text. * * When displayed, the tooltip string may be truncated on some platforms; * the number of characters that may be displayed is platform-dependent. * * @param tooltip the string for the tooltip; if the value is - * null no tooltip is shown + * {@code null} no tooltip is shown * @see #getToolTip */ public void setToolTip(String tooltip) { @@ -351,9 +351,9 @@ public class TrayIcon { /** * Returns the tooltip string associated with this - * TrayIcon. + * {@code TrayIcon}. * - * @return the tooltip string or null if none exists + * @return the tooltip string or {@code null} if none exists * @see #setToolTip(String) */ public String getToolTip() { @@ -364,18 +364,18 @@ public class TrayIcon { * Sets the auto-size property. Auto-size determines whether the * tray image is automatically sized to fit the space allocated * for the image on the tray. By default, the auto-size property - * is set to false. + * is set to {@code false}. * - *

          If auto-size is false, and the image size + *

          If auto-size is {@code false}, and the image size * doesn't match the tray icon space, the image is painted as-is * inside that space — if larger than the allocated space, it will * be cropped. * - *

          If auto-size is true, the image is stretched or shrunk to + *

          If auto-size is {@code true}, the image is stretched or shrunk to * fit the tray icon space. * - * @param autosize true to auto-size the image, - * false otherwise + * @param autosize {@code true} to auto-size the image, + * {@code false} otherwise * @see #isImageAutoSize */ public void setImageAutoSize(boolean autosize) { @@ -390,8 +390,8 @@ public class TrayIcon { /** * Returns the value of the auto-size property. * - * @return true if the image will be auto-sized, - * false otherwise + * @return {@code true} if the image will be auto-sized, + * {@code false} otherwise * @see #setImageAutoSize(boolean) */ public boolean isImageAutoSize() { @@ -400,15 +400,15 @@ public class TrayIcon { /** * Adds the specified mouse listener to receive mouse events from - * this TrayIcon. Calling this method with a - * null value has no effect. + * this {@code TrayIcon}. Calling this method with a + * {@code null} value has no effect. * *

          Note: The {@code MouseEvent}'s coordinates (received * from the {@code TrayIcon}) are relative to the screen, not the * {@code TrayIcon}. * - *

          Note: The MOUSE_ENTERED and - * MOUSE_EXITED mouse events are not supported. + *

          Note: The {@code MOUSE_ENTERED} and + * {@code MOUSE_EXITED} mouse events are not supported. *

          Refer to AWT Threading Issues for details on AWT's threading model. * @@ -427,7 +427,7 @@ public class TrayIcon { /** * Removes the specified mouse listener. Calling this method with - * null or an invalid value has no effect. + * {@code null} or an invalid value has no effect. *

          Refer to AWT Threading Issues for details on AWT's threading model. * @@ -446,10 +446,10 @@ public class TrayIcon { /** * Returns an array of all the mouse listeners - * registered on this TrayIcon. + * registered on this {@code TrayIcon}. * - * @return all of the MouseListeners registered on - * this TrayIcon or an empty array if no mouse + * @return all of the {@code MouseListeners} registered on + * this {@code TrayIcon} or an empty array if no mouse * listeners are currently registered * * @see #addMouseListener(MouseListener) @@ -462,14 +462,14 @@ public class TrayIcon { /** * Adds the specified mouse listener to receive mouse-motion - * events from this TrayIcon. Calling this method - * with a null value has no effect. + * events from this {@code TrayIcon}. Calling this method + * with a {@code null} value has no effect. * *

          Note: The {@code MouseEvent}'s coordinates (received * from the {@code TrayIcon}) are relative to the screen, not the * {@code TrayIcon}. * - *

          Note: The MOUSE_DRAGGED mouse event is not supported. + *

          Note: The {@code MOUSE_DRAGGED} mouse event is not supported. *

          Refer to AWT Threading Issues for details on AWT's threading model. * @@ -488,7 +488,7 @@ public class TrayIcon { /** * Removes the specified mouse-motion listener. Calling this method with - * null or an invalid value has no effect. + * {@code null} or an invalid value has no effect. *

          Refer to AWT Threading Issues for details on AWT's threading model. * @@ -507,10 +507,10 @@ public class TrayIcon { /** * Returns an array of all the mouse-motion listeners - * registered on this TrayIcon. + * registered on this {@code TrayIcon}. * - * @return all of the MouseInputListeners registered on - * this TrayIcon or an empty array if no mouse + * @return all of the {@code MouseInputListeners} registered on + * this {@code TrayIcon} or an empty array if no mouse * listeners are currently registered * * @see #addMouseMotionListener(MouseMotionListener) @@ -524,7 +524,7 @@ public class TrayIcon { /** * Returns the command name of the action event fired by this tray icon. * - * @return the action command name, or null if none exists + * @return the action command name, or {@code null} if none exists * @see #addActionListener(ActionListener) * @see #setActionCommand(String) */ @@ -535,7 +535,7 @@ public class TrayIcon { /** * Sets the command name for the action event fired by this tray * icon. By default, this action command is set to - * null. + * {@code null}. * * @param command a string used to set the tray icon's * action command. @@ -549,12 +549,12 @@ public class TrayIcon { /** * Adds the specified action listener to receive - * ActionEvents from this TrayIcon. + * {@code ActionEvent}s from this {@code TrayIcon}. * Action events usually occur when a user selects the tray icon, * using either the mouse or keyboard. The conditions in which * action events are generated are platform-dependent. * - *

          Calling this method with a null value has no + *

          Calling this method with a {@code null} value has no * effect. *

          Refer to AWT Threading Issues for details on AWT's threading model. @@ -574,7 +574,7 @@ public class TrayIcon { /** * Removes the specified action listener. Calling this method with - * null or an invalid value has no effect. + * {@code null} or an invalid value has no effect. *

          Refer to AWT Threading Issues for details on AWT's threading model. * @@ -594,10 +594,10 @@ public class TrayIcon { /** * Returns an array of all the action listeners - * registered on this TrayIcon. + * registered on this {@code TrayIcon}. * - * @return all of the ActionListeners registered on - * this TrayIcon or an empty array if no action + * @return all of the {@code ActionListeners} registered on + * this {@code TrayIcon} or an empty array if no action * listeners are currently registered * * @see #addActionListener(ActionListener) @@ -633,9 +633,9 @@ public class TrayIcon { * disappear after a time or if the user clicks on it. Clicking * on the message may trigger an {@code ActionEvent}. * - *

          Either the caption or the text may be null, but an - * NullPointerException is thrown if both are - * null. + *

          Either the caption or the text may be {@code null}, but an + * {@code NullPointerException} is thrown if both are + * {@code null}. * * When displayed, the caption or text strings may be truncated on * some platforms; the number of characters that may be displayed is @@ -645,12 +645,12 @@ public class TrayIcon { * showing a message. * * @param caption the caption displayed above the text, usually in - * bold; may be null + * bold; may be {@code null} * @param text the text displayed for the particular message; may be - * null + * {@code null} * @param messageType an enum indicating the message type - * @throws NullPointerException if both caption - * and text are null + * @throws NullPointerException if both {@code caption} + * and {@code text} are {@code null} */ public void displayMessage(String caption, String text, MessageType messageType) { if (caption == null && text == null) { diff --git a/jdk/src/java.desktop/share/classes/java/awt/Window.java b/jdk/src/java.desktop/share/classes/java/awt/Window.java index 72fee8d1c9c..7ac8023acdd 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Window.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Window.java @@ -1926,7 +1926,7 @@ public class Window extends Container implements Accessible { * with a class literal, such as * FooListener.class. * For example, you can query a - * {@code Window} {@code w} + * {@code Window w} * for its window listeners with the following code: * *

          WindowListener[] wls = (WindowListener[])(w.getListeners(WindowListener.class));
          diff --git a/jdk/src/java.desktop/share/classes/java/awt/color/ColorSpace.java b/jdk/src/java.desktop/share/classes/java/awt/color/ColorSpace.java index 08feedd844e..ca28f64be1a 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/color/ColorSpace.java +++ b/jdk/src/java.desktop/share/classes/java/awt/color/ColorSpace.java @@ -268,7 +268,7 @@ public abstract class ColorSpace implements java.io.Serializable { /** * Constructs a ColorSpace object given a color space type * and the number of components. - * @param type one of the ColorSpace type constants + * @param type one of the {@code ColorSpace} type constants * @param numcomponents the number of components in the color space */ protected ColorSpace (int type, int numcomponents) { @@ -283,7 +283,7 @@ public abstract class ColorSpace implements java.io.Serializable { * @param colorspace a specific color space identified by one of * the predefined class constants (e.g. CS_sRGB, CS_LINEAR_RGB, * CS_CIEXYZ, CS_GRAY, or CS_PYCC) - * @return the requested ColorSpace object + * @return the requested {@code ColorSpace} object */ // NOTE: This method may be called by privileged threads. // DO NOT INVOKE CLIENT CODE ON THIS THREAD! @@ -366,8 +366,8 @@ public abstract class ColorSpace implements java.io.Serializable { /** * Returns true if the ColorSpace is CS_sRGB. - * @return true if this is a CS_sRGB color - * space, false if it is not + * @return {@code true} if this is a {@code CS_sRGB} color + * space, {@code false} if it is not */ public boolean isCS_sRGB () { /* REMIND - make sure we know sRGBspace exists already */ @@ -381,10 +381,10 @@ public abstract class ColorSpace implements java.io.Serializable { * This method transforms color values using algorithms designed * to produce the best perceptual match between input and output * colors. In order to do colorimetric conversion of color values, - * you should use the toCIEXYZ + * you should use the {@code toCIEXYZ} * method of this color space to first convert from the input * color space to the CS_CIEXYZ color space, and then use the - * fromCIEXYZ method of the CS_sRGB color space to + * {@code fromCIEXYZ} method of the CS_sRGB color space to * convert from CS_CIEXYZ to the output color space. * See {@link #toCIEXYZ(float[]) toCIEXYZ} and * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information. @@ -405,10 +405,10 @@ public abstract class ColorSpace implements java.io.Serializable { * This method transforms color values using algorithms designed * to produce the best perceptual match between input and output * colors. In order to do colorimetric conversion of color values, - * you should use the toCIEXYZ + * you should use the {@code toCIEXYZ} * method of the CS_sRGB color space to first convert from the input * color space to the CS_CIEXYZ color space, and then use the - * fromCIEXYZ method of this color space to + * {@code fromCIEXYZ} method of this color space to * convert from CS_CIEXYZ to the output color space. * See {@link #toCIEXYZ(float[]) toCIEXYZ} and * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information. @@ -438,7 +438,7 @@ public abstract class ColorSpace implements java.io.Serializable { * A further transformation is necessary to compute the XYZ values * that would be measured using current CIE recommended practices. * See the {@link ICC_ColorSpace#toCIEXYZ(float[]) toCIEXYZ} method of - * ICC_ColorSpace for further information. + * {@code ICC_ColorSpace} for further information. * * @param colorvalue a float array with length of at least the number * of components in this ColorSpace @@ -466,7 +466,7 @@ public abstract class ColorSpace implements java.io.Serializable { * current CIE recommended practices, they must be converted to D50 * relative values before being passed to this method. * See the {@link ICC_ColorSpace#fromCIEXYZ(float[]) fromCIEXYZ} method of - * ICC_ColorSpace for further information. + * {@code ICC_ColorSpace} for further information. * * @param colorvalue a float array with length of at least 3 * @return a float array with length equal to the number of @@ -486,7 +486,7 @@ public abstract class ColorSpace implements java.io.Serializable { * primaries. * * @return the type constant that represents the type of this - * ColorSpace + * {@code ColorSpace} */ public int getType() { return type; @@ -494,7 +494,7 @@ public abstract class ColorSpace implements java.io.Serializable { /** * Returns the number of components of this ColorSpace. - * @return The number of components in this ColorSpace. + * @return The number of components in this {@code ColorSpace}. */ public int getNumComponents() { return numComponents; @@ -505,7 +505,7 @@ public abstract class ColorSpace implements java.io.Serializable { * * @param idx the component index * @return the name of the component at the specified index - * @throws IllegalArgumentException if idx is + * @throws IllegalArgumentException if {@code idx} is * less than 0 or greater than numComponents - 1 */ public String getName (int idx) { diff --git a/jdk/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java b/jdk/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java index e80054c767f..cf6f640f1eb 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java +++ b/jdk/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java @@ -142,10 +142,10 @@ public class ICC_ColorSpace extends ColorSpace { * This method transforms color values using algorithms designed * to produce the best perceptual match between input and output * colors. In order to do colorimetric conversion of color values, - * you should use the toCIEXYZ + * you should use the {@code toCIEXYZ} * method of this color space to first convert from the input * color space to the CS_CIEXYZ color space, and then use the - * fromCIEXYZ method of the CS_sRGB color space to + * {@code fromCIEXYZ} method of the CS_sRGB color space to * convert from CS_CIEXYZ to the output color space. * See {@link #toCIEXYZ(float[]) toCIEXYZ} and * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information. @@ -194,10 +194,10 @@ public class ICC_ColorSpace extends ColorSpace { * This method transforms color values using algorithms designed * to produce the best perceptual match between input and output * colors. In order to do colorimetric conversion of color values, - * you should use the toCIEXYZ + * you should use the {@code toCIEXYZ} * method of the CS_sRGB color space to first convert from the input * color space to the CS_CIEXYZ color space, and then use the - * fromCIEXYZ method of this color space to + * {@code fromCIEXYZ} method of this color space to * convert from CS_CIEXYZ to the output color space. * See {@link #toCIEXYZ(float[]) toCIEXYZ} and * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information. diff --git a/jdk/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java b/jdk/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java index 90f87280a7f..3adc80fa59f 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java +++ b/jdk/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java @@ -766,8 +766,8 @@ public class ICC_Profile implements Serializable { * a byte array. Throws an IllegalArgumentException if the data * does not correspond to a valid ICC Profile. * @param data the specified ICC Profile data - * @return an ICC_Profile object corresponding to - * the data in the specified data array. + * @return an {@code ICC_Profile} object corresponding to + * the data in the specified {@code data} array. */ public static ICC_Profile getInstance(byte[] data) { ICC_Profile thisProfile; @@ -821,11 +821,11 @@ public class ICC_Profile implements Serializable { * * @param cspace the type of color space to create a profile for. * The specified type is one of the color - * space constants defined in the ColorSpace class. + * space constants defined in the {@code ColorSpace} class. * - * @return an ICC_Profile object corresponding to - * the specified ColorSpace type. - * @exception IllegalArgumentException If cspace is not + * @return an {@code ICC_Profile} object corresponding to + * the specified {@code ColorSpace} type. + * @exception IllegalArgumentException If {@code cspace} is not * one of the predefined color space types. */ public static ICC_Profile getInstance (int cspace) { @@ -956,7 +956,7 @@ public class ICC_Profile implements Serializable { * Profile data. * @param fileName The file that contains the data for the profile. * - * @return an ICC_Profile object corresponding to + * @return an {@code ICC_Profile} object corresponding to * the data in the specified file. * @exception IOException If the specified file cannot be opened or * an I/O error occurs while reading the file. @@ -997,8 +997,8 @@ public class ICC_Profile implements Serializable { * error occurs while reading the stream. * @param s The input stream from which to read the profile data. * - * @return an ICC_Profile object corresponding to the - * data in the specified InputStream. + * @return an {@code ICC_Profile} object corresponding to the + * data in the specified {@code InputStream}. * * @exception IOException If an I/O error occurs while reading the stream. * @@ -1213,7 +1213,7 @@ public class ICC_Profile implements Serializable { * characteristics of the space, e.g. the chromaticities of the * primaries. * @return One of the color space type constants defined in the - * ColorSpace class. + * {@code ColorSpace} class. */ public int getColorSpaceType() { if (deferralInfo != null) { @@ -1245,7 +1245,7 @@ public class ICC_Profile implements Serializable { * color space defined in the ICC specification. For a device * link profile, this could be any of the color space type constants. * @return One of the color space type constants defined in the - * ColorSpace class. + * {@code ColorSpace} class. */ public int getPCSType() { if (ProfileDeferralMgr.deferring) { @@ -1342,7 +1342,7 @@ public class ICC_Profile implements Serializable { * want to get. * * @return A byte array that contains the tagged data element. Returns - * null if the specified tag doesn't exist. + * {@code null} if the specified tag doesn't exist. * @see #setData(int, byte[]) */ public byte[] getData(int tagSignature) { @@ -1929,7 +1929,7 @@ public class ICC_Profile implements Serializable { /** * Version of the format of additional serialized data in the - * stream. Version 1 corresponds to Java 2 + * stream. Version {@code 1} corresponds to Java 2 * Platform, v1.3. * @since 1.3 * @serial @@ -1943,17 +1943,17 @@ public class ICC_Profile implements Serializable { * * @param s stream used for serialization. * @throws IOException - * thrown by ObjectInputStream. + * thrown by {@code ObjectInputStream}. * @serialData - * The String is the name of one of + * The {@code String} is the name of one of * CS_* constants defined in the * {@link ColorSpace} class if the profile object is a profile * for a predefined color space (for example - * "CS_sRGB"). The string is null + * {@code "CS_sRGB"}). The string is {@code null} * otherwise. *

          - * The byte[] array is the profile data for the - * profile. For predefined color spaces null is + * The {@code byte[]} array is the profile data for the + * profile. For predefined color spaces {@code null} is * written instead of the profile data. If in the future * versions of Java API new predefined color spaces will be * added, future versions of this class may choose to write @@ -2003,19 +2003,19 @@ public class ICC_Profile implements Serializable { * * @param s stream used for deserialization. * @throws IOException - * thrown by ObjectInputStream. + * thrown by {@code ObjectInputStream}. * @throws ClassNotFoundException - * thrown by ObjectInputStream. + * thrown by {@code ObjectInputStream}. * @serialData - * The String is the name of one of + * The {@code String} is the name of one of * CS_* constants defined in the * {@link ColorSpace} class if the profile object is a profile * for a predefined color space (for example - * "CS_sRGB"). The string is null + * {@code "CS_sRGB"}). The string is {@code null} * otherwise. *

          - * The byte[] array is the profile data for the - * profile. It will usually be null for the + * The {@code byte[]} array is the profile data for the + * profile. It will usually be {@code null} for the * predefined profiles. *

          * If the string is recognized as a constant name for diff --git a/jdk/src/java.desktop/share/classes/java/awt/color/ICC_ProfileRGB.java b/jdk/src/java.desktop/share/classes/java/awt/color/ICC_ProfileRGB.java index 4929e8a7190..39a243adb43 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/color/ICC_ProfileRGB.java +++ b/jdk/src/java.desktop/share/classes/java/awt/color/ICC_ProfileRGB.java @@ -45,13 +45,13 @@ import sun.java2d.cmm.ProfileDeferralInfo; * that represents profiles which meet the following criteria: *

            *
          • The profile's color space type is RGB.
          • - *
          • The profile includes the redColorantTag, - * greenColorantTag, blueColorantTag, - * redTRCTag, greenTRCTag, - * blueTRCTag, and mediaWhitePointTag tags.
          • + *
          • The profile includes the {@code redColorantTag}, + * {@code greenColorantTag}, {@code blueColorantTag}, + * {@code redTRCTag}, {@code greenTRCTag}, + * {@code blueTRCTag}, and {@code mediaWhitePointTag} tags.
          • *
          - * The ICC_Profile getInstance method will - * return an ICC_ProfileRGB object when these conditions are met. + * The {@code ICC_Profile getInstance} method will + * return an {@code ICC_ProfileRGB} object when these conditions are met. * Three-component, matrix-based input profiles and RGB display profiles are * examples of this type of profile. *

          @@ -109,7 +109,7 @@ extends ICC_Profile { /** - * Constructs an new ICC_ProfileRGB from a CMM ID. + * Constructs an new {@code ICC_ProfileRGB} from a CMM ID. * * @param p The CMM ID for the profile. * @@ -119,7 +119,7 @@ extends ICC_Profile { } /** - * Constructs a new ICC_ProfileRGB from a + * Constructs a new {@code ICC_ProfileRGB} from a * ProfileDeferralInfo object. * * @param pdi @@ -131,10 +131,10 @@ extends ICC_Profile { /** * Returns an array that contains the components of the profile's - * mediaWhitePointTag. + * {@code mediaWhitePointTag}. * - * @return A 3-element float array containing the x, y, - * and z components of the profile's mediaWhitePointTag. + * @return A 3-element {@code float} array containing the x, y, + * and z components of the profile's {@code mediaWhitePointTag}. */ public float[] getMediaWhitePoint() { return super.getMediaWhitePoint(); @@ -142,17 +142,17 @@ extends ICC_Profile { /** - * Returns a 3x3 float matrix constructed from the - * X, Y, and Z components of the profile's redColorantTag, - * greenColorantTag, and blueColorantTag. + * Returns a 3x3 {@code float} matrix constructed from the + * X, Y, and Z components of the profile's {@code redColorantTag}, + * {@code greenColorantTag}, and {@code blueColorantTag}. *

          * This matrix can be used for color transforms in the forward * direction of the profile--from the profile color space * to the CIEXYZ PCS. * - * @return A 3x3 float array that contains the x, y, and z - * components of the profile's redColorantTag, - * greenColorantTag, and blueColorantTag. + * @return A 3x3 {@code float} array that contains the x, y, and z + * components of the profile's {@code redColorantTag}, + * {@code greenColorantTag}, and {@code blueColorantTag}. */ public float[][] getMatrix() { float[][] theMatrix = new float[3][3]; @@ -191,7 +191,7 @@ extends ICC_Profile { *   linearComponent = deviceComponent * * - * @param component The ICC_ProfileRGB constant that + * @param component The {@code ICC_ProfileRGB} constant that * represents the component whose TRC you want to retrieve * @return the gamma value as a float. * @exception ProfileDataException if the profile does not specify @@ -225,8 +225,8 @@ extends ICC_Profile { /** * Returns the TRC for a particular component as an array. - * Component must be REDCOMPONENT, - * GREENCOMPONENT, or BLUECOMPONENT. + * Component must be {@code REDCOMPONENT}, + * {@code GREENCOMPONENT}, or {@code BLUECOMPONENT}. * Otherwise the returned array * represents a lookup table where the input component value * is conceptually in the range [0.0, 1.0]. Value 0.0 maps @@ -236,18 +236,18 @@ extends ICC_Profile { * array. Output values also map linearly to the range [0.0, 1.0]. * Value 0.0 is represented by an array value of 0x0000 and * value 1.0 by 0xFFFF. In other words, the values are really unsigned - * short values even though they are returned in a - * short array. + * {@code short} values even though they are returned in a + * {@code short} array. * * If the profile has specified the corresponding TRC * as linear (gamma = 1.0) or as a simple gamma value, this method * throws an exception. In this case, the {@link #getGamma(int)} * method should be used to get the gamma value. * - * @param component The ICC_ProfileRGB constant that + * @param component The {@code ICC_ProfileRGB} constant that * represents the component whose TRC you want to retrieve: - * REDCOMPONENT, GREENCOMPONENT, or - * BLUECOMPONENT. + * {@code REDCOMPONENT}, {@code GREENCOMPONENT}, or + * {@code BLUECOMPONENT}. * * @return a short array representing the TRC. * @exception ProfileDataException if the profile does not specify diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/Autoscroll.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/Autoscroll.java index 0e3f0fb459a..b144a6b8d47 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/Autoscroll.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/Autoscroll.java @@ -37,17 +37,17 @@ import java.awt.Point; * and institute a scroll operation in order to make obscured region(s) * visible to the user. This feature is known as autoscrolling. *

          - * If a GUI control is both an active DropTarget + * If a GUI control is both an active {@code DropTarget} * and is also scrollable, it * can receive notifications of autoscrolling gestures by the user from * the DnD system by implementing this interface. *

          * An autoscrolling gesture is initiated by the user by keeping the drag - * cursor motionless with a border region of the Component, + * cursor motionless with a border region of the {@code Component}, * referred to as * the "autoscrolling region", for a predefined period of time, this will - * result in repeated scroll requests to the Component - * until the drag Cursor resumes its motion. + * result in repeated scroll requests to the {@code Component} + * until the drag {@code Cursor} resumes its motion. * * @since 1.2 */ @@ -55,13 +55,13 @@ import java.awt.Point; public interface Autoscroll { /** - * This method returns the Insets describing + * This method returns the {@code Insets} describing * the autoscrolling region or border relative * to the geometry of the implementing Component. *

          - * This value is read once by the DropTarget - * upon entry of the drag Cursor - * into the associated Component. + * This value is read once by the {@code DropTarget} + * upon entry of the drag {@code Cursor} + * into the associated {@code Component}. * * @return the Insets */ @@ -69,9 +69,9 @@ public interface Autoscroll { public Insets getAutoscrollInsets(); /** - * notify the Component to autoscroll + * notify the {@code Component} to autoscroll * - * @param cursorLocn A Point indicating the + * @param cursorLocn A {@code Point} indicating the * location of the cursor that triggered this operation. */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DnDConstants.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DnDConstants.java index e4c5fb42206..88b70fc9900 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DnDConstants.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DnDConstants.java @@ -37,28 +37,28 @@ public final class DnDConstants { private DnDConstants() {} // define null private constructor. /** - * An int representing no action. + * An {@code int} representing no action. */ @Native public static final int ACTION_NONE = 0x0; /** - * An int representing a "copy" action. + * An {@code int} representing a "copy" action. */ @Native public static final int ACTION_COPY = 0x1; /** - * An int representing a "move" action. + * An {@code int} representing a "move" action. */ @Native public static final int ACTION_MOVE = 0x2; /** - * An int representing a "copy" or - * "move" action. + * An {@code int} representing a "copy" or + * "move" action. */ @Native public static final int ACTION_COPY_OR_MOVE = ACTION_COPY | ACTION_MOVE; /** - * An int representing a "link" action. + * An {@code int} representing a "link" action. * * The link verb is found in many, if not all native DnD platforms, and the * actual interpretation of LINK semantics is both platform @@ -76,7 +76,7 @@ public final class DnDConstants { @Native public static final int ACTION_LINK = 0x40000000; /** - * An int representing a "reference" + * An {@code int} representing a "reference" * action (synonym for ACTION_LINK). */ @Native public static final int ACTION_REFERENCE = ACTION_LINK; diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DnDEventMulticaster.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DnDEventMulticaster.java index f4e059f9e00..dc7fc7f2138 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DnDEventMulticaster.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DnDEventMulticaster.java @@ -31,7 +31,7 @@ import java.util.EventListener; /** - * A class extends AWTEventMulticaster to implement efficient and + * A class extends {@code AWTEventMulticaster} to implement efficient and * thread-safe multi-cast event dispatching for the drag-and-drop events defined * in the java.awt.dnd package. * @@ -44,9 +44,9 @@ class DnDEventMulticaster extends AWTEventMulticaster /** * Creates an event multicaster instance which chains listener-a - * with listener-b. Input parameters a and b - * should not be null, though implementations may vary in - * choosing whether or not to throw NullPointerException + * with listener-b. Input parameters {@code a} and {@code b} + * should not be {@code null}, though implementations may vary in + * choosing whether or not to throw {@code NullPointerException} * in that case. * * @param a listener-a @@ -57,10 +57,10 @@ class DnDEventMulticaster extends AWTEventMulticaster } /** - * Handles the DragSourceDragEvent by invoking - * dragEnter on listener-a and listener-b. + * Handles the {@code DragSourceDragEvent} by invoking + * {@code dragEnter} on listener-a and listener-b. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dragEnter(DragSourceDragEvent dsde) { ((DragSourceListener)a).dragEnter(dsde); @@ -68,10 +68,10 @@ class DnDEventMulticaster extends AWTEventMulticaster } /** - * Handles the DragSourceDragEvent by invoking - * dragOver on listener-a and listener-b. + * Handles the {@code DragSourceDragEvent} by invoking + * {@code dragOver} on listener-a and listener-b. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dragOver(DragSourceDragEvent dsde) { ((DragSourceListener)a).dragOver(dsde); @@ -79,10 +79,10 @@ class DnDEventMulticaster extends AWTEventMulticaster } /** - * Handles the DragSourceDragEvent by invoking - * dropActionChanged on listener-a and listener-b. + * Handles the {@code DragSourceDragEvent} by invoking + * {@code dropActionChanged} on listener-a and listener-b. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dropActionChanged(DragSourceDragEvent dsde) { ((DragSourceListener)a).dropActionChanged(dsde); @@ -90,10 +90,10 @@ class DnDEventMulticaster extends AWTEventMulticaster } /** - * Handles the DragSourceEvent by invoking - * dragExit on listener-a and listener-b. + * Handles the {@code DragSourceEvent} by invoking + * {@code dragExit} on listener-a and listener-b. * - * @param dse the DragSourceEvent + * @param dse the {@code DragSourceEvent} */ public void dragExit(DragSourceEvent dse) { ((DragSourceListener)a).dragExit(dse); @@ -101,10 +101,10 @@ class DnDEventMulticaster extends AWTEventMulticaster } /** - * Handles the DragSourceDropEvent by invoking - * dragDropEnd on listener-a and listener-b. + * Handles the {@code DragSourceDropEvent} by invoking + * {@code dragDropEnd} on listener-a and listener-b. * - * @param dsde the DragSourceDropEvent + * @param dsde the {@code DragSourceDropEvent} */ public void dragDropEnd(DragSourceDropEvent dsde) { ((DragSourceListener)a).dragDropEnd(dsde); @@ -112,10 +112,10 @@ class DnDEventMulticaster extends AWTEventMulticaster } /** - * Handles the DragSourceDragEvent by invoking - * dragMouseMoved on listener-a and listener-b. + * Handles the {@code DragSourceDragEvent} by invoking + * {@code dragMouseMoved} on listener-a and listener-b. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dragMouseMoved(DragSourceDragEvent dsde) { ((DragSourceMotionListener)a).dragMouseMoved(dsde); diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureEvent.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureEvent.java index 3dff336a794..b87b709feb2 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureEvent.java @@ -49,12 +49,12 @@ import java.io.ObjectOutputStream; /** - * A DragGestureEvent is passed - * to DragGestureListener's + * A {@code DragGestureEvent} is passed + * to {@code DragGestureListener}'s * dragGestureRecognized() method - * when a particular DragGestureRecognizer detects that a + * when a particular {@code DragGestureRecognizer} detects that a * platform dependent drag initiating gesture has occurred - * on the Component that it is tracking. + * on the {@code Component} that it is tracking. * * The {@code action} field of any {@code DragGestureEvent} instance should take one of the following * values: @@ -76,19 +76,19 @@ public class DragGestureEvent extends EventObject { private static final long serialVersionUID = 9080172649166731306L; /** - * Constructs a DragGestureEvent object given by the - * DragGestureRecognizer instance firing this event, + * Constructs a {@code DragGestureEvent} object given by the + * {@code DragGestureRecognizer} instance firing this event, * an {@code act} parameter representing * the user's preferred action, an {@code ori} parameter * indicating the origin of the drag, and a {@code List} of * events that comprise the gesture({@code evs} parameter). * - * @param dgr The DragGestureRecognizer firing this event + * @param dgr The {@code DragGestureRecognizer} firing this event * @param act The user's preferred action. * For information on allowable values, see * the class description for {@link DragGestureEvent} * @param ori The origin of the drag - * @param evs The List of events that comprise the gesture + * @param evs The {@code List} of events that comprise the gesture * * @throws IllegalArgumentException if any parameter equals {@code null} * @throws IllegalArgumentException if the act parameter does not comply with @@ -123,9 +123,9 @@ public class DragGestureEvent extends EventObject { } /** - * Returns the source as a DragGestureRecognizer. + * Returns the source as a {@code DragGestureRecognizer}. * - * @return the source as a DragGestureRecognizer + * @return the source as a {@code DragGestureRecognizer} */ public DragGestureRecognizer getSourceAsDragGestureRecognizer() { @@ -133,8 +133,8 @@ public class DragGestureEvent extends EventObject { } /** - * Returns the Component associated - * with this DragGestureEvent. + * Returns the {@code Component} associated + * with this {@code DragGestureEvent}. * * @return the Component */ @@ -142,16 +142,16 @@ public class DragGestureEvent extends EventObject { public Component getComponent() { return component; } /** - * Returns the DragSource. + * Returns the {@code DragSource}. * - * @return the DragSource + * @return the {@code DragSource} */ public DragSource getDragSource() { return dragSource; } /** - * Returns a Point in the coordinates - * of the Component over which the drag originated. + * Returns a {@code Point} in the coordinates + * of the {@code Component} over which the drag originated. * * @return the Point where the drag originated in Component coords. */ @@ -161,7 +161,7 @@ public class DragGestureEvent extends EventObject { } /** - * Returns an Iterator for the events + * Returns an {@code Iterator} for the events * comprising the gesture. * * @return an Iterator for the events comprising the gesture @@ -170,7 +170,7 @@ public class DragGestureEvent extends EventObject { public Iterator iterator() { return events.iterator(); } /** - * Returns an Object array of the + * Returns an {@code Object} array of the * events comprising the drag gesture. * * @return an array of the events comprising the gesture @@ -181,7 +181,7 @@ public class DragGestureEvent extends EventObject { /** * Returns an array of the events comprising the drag gesture. * - * @param array the array of EventObject sub(types) + * @param array the array of {@code EventObject} sub(types) * * @return an array of the events comprising the gesture */ @@ -189,7 +189,7 @@ public class DragGestureEvent extends EventObject { public Object[] toArray(Object[] array) { return events.toArray(array); } /** - * Returns an int representing the + * Returns an {@code int} representing the * action selected by the user. * * @return the action selected by the user @@ -208,22 +208,22 @@ public class DragGestureEvent extends EventObject { } /** - * Starts the drag operation given the Cursor for this drag - * operation and the Transferable representing the source data + * Starts the drag operation given the {@code Cursor} for this drag + * operation and the {@code Transferable} representing the source data * for this drag operation. *
          - * If a null Cursor is specified no exception will + * If a {@code null Cursor} is specified no exception will * be thrown and default drag cursors will be used instead. *
          - * If a null Transferable is specified - * NullPointerException will be thrown. + * If a {@code null Transferable} is specified + * {@code NullPointerException} will be thrown. * @param dragCursor The initial {@code Cursor} for this drag operation * or {@code null} for the default cursor handling; * see * DragSourceContext * for more details on the cursor handling mechanism * during drag and drop - * @param transferable The Transferable representing the source + * @param transferable The {@code Transferable} representing the source * data for this drag operation. * * @throws InvalidDnDOperationException if the Drag and Drop @@ -239,9 +239,9 @@ public class DragGestureEvent extends EventObject { } /** - * Starts the drag given the initial Cursor to display, - * the Transferable object, - * and the DragSourceListener to use. + * Starts the drag given the initial {@code Cursor} to display, + * the {@code Transferable} object, + * and the {@code DragSourceListener} to use. * * @param dragCursor The initial {@code Cursor} for this drag operation * or {@code null} for the default cursor handling; @@ -264,11 +264,11 @@ public class DragGestureEvent extends EventObject { } /** - * Start the drag given the initial Cursor to display, - * a drag Image, the offset of - * the Image, - * the Transferable object, and - * the DragSourceListener to use. + * Start the drag given the initial {@code Cursor} to display, + * a drag {@code Image}, the offset of + * the {@code Image}, + * the {@code Transferable} object, and + * the {@code DragSourceListener} to use. * * @param dragCursor The initial {@code Cursor} for this drag operation * or {@code null} for the default cursor handling; @@ -293,16 +293,16 @@ public class DragGestureEvent extends EventObject { } /** - * Serializes this DragGestureEvent. Performs default - * serialization and then writes out this object's List of - * gesture events if and only if the List can be serialized. - * If not, null is written instead. In this case, a - * DragGestureEvent created from the resulting deserialized - * stream will contain an empty List of gesture events. + * Serializes this {@code DragGestureEvent}. Performs default + * serialization and then writes out this object's {@code List} of + * gesture events if and only if the {@code List} can be serialized. + * If not, {@code null} is written instead. In this case, a + * {@code DragGestureEvent} created from the resulting deserialized + * stream will contain an empty {@code List} of gesture events. * * @serialData The default serializable fields, in alphabetical order, - * followed by either a List instance, or - * null. + * followed by either a {@code List} instance, or + * {@code null}. * @since 1.4 */ private void writeObject(ObjectOutputStream s) throws IOException { @@ -312,16 +312,16 @@ public class DragGestureEvent extends EventObject { } /** - * Deserializes this DragGestureEvent. This method first - * performs default deserialization for all non-transient + * Deserializes this {@code DragGestureEvent}. This method first + * performs default deserialization for all non-{@code transient} * fields. An attempt is then made to deserialize this object's - * List of gesture events as well. This is first attempted - * by deserializing the field events, because, in releases - * prior to 1.4, a non-transient field of this name stored the - * List of gesture events. If this fails, the next object in - * the stream is used instead. If the resulting List is - * null, this object's List of gesture events - * is set to an empty List. + * {@code List} of gesture events as well. This is first attempted + * by deserializing the field {@code events}, because, in releases + * prior to 1.4, a non-{@code transient} field of this name stored the + * {@code List} of gesture events. If this fails, the next object in + * the stream is used instead. If the resulting {@code List} is + * {@code null}, this object's {@code List} of gesture events + * is set to an empty {@code List}. * * @since 1.4 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureListener.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureListener.java index f3e600e6cd4..e04fbfa4bb5 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureListener.java @@ -56,7 +56,7 @@ import java.util.EventListener; * * @see java.awt.dnd.DragGestureRecognizer * @see java.awt.dnd.DragGestureEvent - * @param dge the DragGestureEvent describing + * @param dge the {@code DragGestureEvent} describing * the gesture that has just occurred */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureRecognizer.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureRecognizer.java index b3dbeb5f477..0a64aa5c62f 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureRecognizer.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureRecognizer.java @@ -40,41 +40,41 @@ import java.io.ObjectOutputStream; import java.io.Serializable; /** - * The DragGestureRecognizer is an + * The {@code DragGestureRecognizer} is an * abstract base class for the specification * of a platform-dependent listener that can be associated with a particular - * Component in order to + * {@code Component} in order to * identify platform-dependent drag initiating gestures. *

          - * The appropriate DragGestureRecognizer + * The appropriate {@code DragGestureRecognizer} * subclass instance is obtained from the * {@link DragSource} associated with - * a particular Component, or from the Toolkit object via its + * a particular {@code Component}, or from the {@code Toolkit} object via its * {@link java.awt.Toolkit#createDragGestureRecognizer createDragGestureRecognizer()} * method. *

          - * Once the DragGestureRecognizer - * is associated with a particular Component + * Once the {@code DragGestureRecognizer} + * is associated with a particular {@code Component} * it will register the appropriate listener interfaces on that - * Component - * in order to track the input events delivered to the Component. + * {@code Component} + * in order to track the input events delivered to the {@code Component}. *

          - * Once the DragGestureRecognizer identifies a sequence of events - * on the Component as a drag initiating gesture, it will notify - * its unicast DragGestureListener by + * Once the {@code DragGestureRecognizer} identifies a sequence of events + * on the {@code Component} as a drag initiating gesture, it will notify + * its unicast {@code DragGestureListener} by * invoking its * {@link java.awt.dnd.DragGestureListener#dragGestureRecognized gestureRecognized()} * method. *

          - * When a concrete DragGestureRecognizer + * When a concrete {@code DragGestureRecognizer} * instance detects a drag initiating - * gesture on the Component it is associated with, + * gesture on the {@code Component} it is associated with, * it fires a {@link DragGestureEvent} to - * the DragGestureListener registered on - * its unicast event source for DragGestureListener - * events. This DragGestureListener is responsible + * the {@code DragGestureListener} registered on + * its unicast event source for {@code DragGestureListener} + * events. This {@code DragGestureListener} is responsible * for causing the associated - * DragSource to start the Drag and Drop operation (if + * {@code DragSource} to start the Drag and Drop operation (if * appropriate). * * @author Laurence P. G. Cable @@ -88,36 +88,36 @@ public abstract class DragGestureRecognizer implements Serializable { private static final long serialVersionUID = 8996673345831063337L; /** - * Construct a new DragGestureRecognizer - * given the DragSource to be used - * in this Drag and Drop operation, the Component - * this DragGestureRecognizer should "observe" + * Construct a new {@code DragGestureRecognizer} + * given the {@code DragSource} to be used + * in this Drag and Drop operation, the {@code Component} + * this {@code DragGestureRecognizer} should "observe" * for drag initiating gestures, the action(s) supported * for this Drag and Drop operation, and the - * DragGestureListener to notify + * {@code DragGestureListener} to notify * once a drag initiating gesture has been detected. * - * @param ds the DragSource this - * DragGestureRecognizer + * @param ds the {@code DragSource} this + * {@code DragGestureRecognizer} * will use to process the Drag and Drop operation * - * @param c the Component - * this DragGestureRecognizer + * @param c the {@code Component} + * this {@code DragGestureRecognizer} * should "observe" the event stream to, * in order to detect a drag initiating gesture. - * If this value is null, the - * DragGestureRecognizer - * is not associated with any Component. + * If this value is {@code null}, the + * {@code DragGestureRecognizer} + * is not associated with any {@code Component}. * * @param sa the set (logical OR) of the - * DnDConstants + * {@code DnDConstants} * that this Drag and Drop operation will support * - * @param dgl the DragGestureRecognizer + * @param dgl the {@code DragGestureRecognizer} * to notify when a drag gesture is detected * * @throws IllegalArgumentException - * if ds is null. + * if ds is {@code null}. */ protected DragGestureRecognizer(DragSource ds, Component c, int sa, DragGestureListener dgl) { @@ -137,30 +137,30 @@ public abstract class DragGestureRecognizer implements Serializable { } /** - * Construct a new DragGestureRecognizer - * given the DragSource to be used in this + * Construct a new {@code DragGestureRecognizer} + * given the {@code DragSource} to be used in this * Drag and Drop - * operation, the Component this - * DragGestureRecognizer should "observe" + * operation, the {@code Component} this + * {@code DragGestureRecognizer} should "observe" * for drag initiating gestures, and the action(s) * supported for this Drag and Drop operation. * - * @param ds the DragSource this - * DragGestureRecognizer will use to + * @param ds the {@code DragSource} this + * {@code DragGestureRecognizer} will use to * process the Drag and Drop operation * - * @param c the Component this - * DragGestureRecognizer should "observe" the event + * @param c the {@code Component} this + * {@code DragGestureRecognizer} should "observe" the event * stream to, in order to detect a drag initiating gesture. - * If this value is null, the - * DragGestureRecognizer - * is not associated with any Component. + * If this value is {@code null}, the + * {@code DragGestureRecognizer} + * is not associated with any {@code Component}. * - * @param sa the set (logical OR) of the DnDConstants + * @param sa the set (logical OR) of the {@code DnDConstants} * that this Drag and Drop operation will support * * @throws IllegalArgumentException - * if ds is null. + * if ds is {@code null}. */ protected DragGestureRecognizer(DragSource ds, Component c, int sa) { @@ -168,27 +168,27 @@ public abstract class DragGestureRecognizer implements Serializable { } /** - * Construct a new DragGestureRecognizer - * given the DragSource to be used + * Construct a new {@code DragGestureRecognizer} + * given the {@code DragSource} to be used * in this Drag and Drop operation, and - * the Component this - * DragGestureRecognizer + * the {@code Component} this + * {@code DragGestureRecognizer} * should "observe" for drag initiating gestures. * - * @param ds the DragSource this - * DragGestureRecognizer + * @param ds the {@code DragSource} this + * {@code DragGestureRecognizer} * will use to process the Drag and Drop operation * - * @param c the Component - * this DragGestureRecognizer + * @param c the {@code Component} + * this {@code DragGestureRecognizer} * should "observe" the event stream to, * in order to detect a drag initiating gesture. - * If this value is null, - * the DragGestureRecognizer - * is not associated with any Component. + * If this value is {@code null}, + * the {@code DragGestureRecognizer} + * is not associated with any {@code Component}. * * @throws IllegalArgumentException - * if ds is null. + * if ds is {@code null}. */ protected DragGestureRecognizer(DragSource ds, Component c) { @@ -196,16 +196,16 @@ public abstract class DragGestureRecognizer implements Serializable { } /** - * Construct a new DragGestureRecognizer - * given the DragSource to be used in this + * Construct a new {@code DragGestureRecognizer} + * given the {@code DragSource} to be used in this * Drag and Drop operation. * - * @param ds the DragSource this - * DragGestureRecognizer will + * @param ds the {@code DragSource} this + * {@code DragGestureRecognizer} will * use to process the Drag and Drop operation * * @throws IllegalArgumentException - * if ds is null. + * if ds is {@code null}. */ protected DragGestureRecognizer(DragSource ds) { @@ -229,8 +229,8 @@ public abstract class DragGestureRecognizer implements Serializable { protected abstract void unregisterListeners(); /** - * This method returns the DragSource - * this DragGestureRecognizer + * This method returns the {@code DragSource} + * this {@code DragGestureRecognizer} * will use in order to process the Drag and Drop * operation. * @@ -240,9 +240,9 @@ public abstract class DragGestureRecognizer implements Serializable { public DragSource getDragSource() { return dragSource; } /** - * This method returns the Component + * This method returns the {@code Component} * that is to be "observed" by the - * DragGestureRecognizer + * {@code DragGestureRecognizer} * for drag initiating gestures. * * @return The Component this DragGestureRecognizer @@ -257,7 +257,7 @@ public abstract class DragGestureRecognizer implements Serializable { * registerListeners() and unregisterListeners() are called as a side * effect as appropriate. * - * @param c The Component or null + * @param c The {@code Component} or {@code null} */ public synchronized void setComponent(Component c) { @@ -309,13 +309,13 @@ public abstract class DragGestureRecognizer implements Serializable { public void resetRecognizer() { events.clear(); } /** - * Register a new DragGestureListener. + * Register a new {@code DragGestureListener}. * - * @param dgl the DragGestureListener to register - * with this DragGestureRecognizer. + * @param dgl the {@code DragGestureListener} to register + * with this {@code DragGestureRecognizer}. * * @throws java.util.TooManyListenersException if a - * DragGestureListener has already been added. + * {@code DragGestureListener} has already been added. */ public synchronized void addDragGestureListener(DragGestureListener dgl) throws TooManyListenersException { @@ -331,11 +331,11 @@ public abstract class DragGestureRecognizer implements Serializable { /** * unregister the current DragGestureListener * - * @param dgl the DragGestureListener to unregister - * from this DragGestureRecognizer + * @param dgl the {@code DragGestureListener} to unregister + * from this {@code DragGestureRecognizer} * * @throws IllegalArgumentException if - * dgl is not (equal to) the currently registered DragGestureListener. + * dgl is not (equal to) the currently registered {@code DragGestureListener}. */ public synchronized void removeDragGestureListener(DragGestureListener dgl) { @@ -370,16 +370,16 @@ public abstract class DragGestureRecognizer implements Serializable { * all Events that are recognized as part of the series of Events that go * to comprise a Drag and Drop initiating gesture via this API. *

          - * This method is used by a DragGestureRecognizer - * implementation to add an InputEvent + * This method is used by a {@code DragGestureRecognizer} + * implementation to add an {@code InputEvent} * subclass (that it believes is one in a series * of events that comprise a Drag and Drop operation) * to the array of events that this - * DragGestureRecognizer maintains internally. + * {@code DragGestureRecognizer} maintains internally. * - * @param awtie the InputEvent - * to add to this DragGestureRecognizer's - * internal array of events. Note that null + * @param awtie the {@code InputEvent} + * to add to this {@code DragGestureRecognizer}'s + * internal array of events. Note that {@code null} * is not a valid value, and will be ignored. */ @@ -388,14 +388,14 @@ public abstract class DragGestureRecognizer implements Serializable { } /** - * Serializes this DragGestureRecognizer. This method first + * Serializes this {@code DragGestureRecognizer}. This method first * performs default serialization. Then, this object's - * DragGestureListener is written out if and only if it can be - * serialized. If not, null is written instead. + * {@code DragGestureListener} is written out if and only if it can be + * serialized. If not, {@code null} is written instead. * * @serialData The default serializable fields, in alphabetical order, - * followed by either a DragGestureListener, or - * null. + * followed by either a {@code DragGestureListener}, or + * {@code null}. * @since 1.4 */ private void writeObject(ObjectOutputStream s) throws IOException { @@ -406,9 +406,9 @@ public abstract class DragGestureRecognizer implements Serializable { } /** - * Deserializes this DragGestureRecognizer. This method first - * performs default deserialization for all non-transient - * fields. This object's DragGestureListener is then + * Deserializes this {@code DragGestureRecognizer}. This method first + * performs default deserialization for all non-{@code transient} + * fields. This object's {@code DragGestureListener} is then * deserialized as well by using the next object in the stream. * * @since 1.4 @@ -437,30 +437,30 @@ public abstract class DragGestureRecognizer implements Serializable { */ /** - * The DragSource + * The {@code DragSource} * associated with this - * DragGestureRecognizer. + * {@code DragGestureRecognizer}. * * @serial */ protected DragSource dragSource; /** - * The Component - * associated with this DragGestureRecognizer. + * The {@code Component} + * associated with this {@code DragGestureRecognizer}. * * @serial */ protected Component component; /** - * The DragGestureListener - * associated with this DragGestureRecognizer. + * The {@code DragGestureListener} + * associated with this {@code DragGestureRecognizer}. */ protected transient DragGestureListener dragGestureListener; /** - * An int representing + * An {@code int} representing * the type(s) of action(s) used * in this Drag and Drop operation. * @@ -470,7 +470,7 @@ public abstract class DragGestureRecognizer implements Serializable { /** * The list of events (in order) that - * the DragGestureRecognizer + * the {@code DragGestureRecognizer} * "recognized" as a "gesture" that triggers a drag. * * @serial diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSource.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSource.java index 073686e857e..cb028a399a8 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSource.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSource.java @@ -49,7 +49,7 @@ import sun.security.action.GetIntegerAction; /** - * The DragSource is the entity responsible + * The {@code DragSource} is the entity responsible * for the initiation of the Drag * and Drop operation, and may be used in a number of scenarios: *

            @@ -57,49 +57,49 @@ import sun.security.action.GetIntegerAction; *
          • 1 instance per class of potential Drag Initiator object (e.g * TextField). [implementation dependent] *
          • 1 per instance of a particular - * Component, or application specific - * object associated with a Component + * {@code Component}, or application specific + * object associated with a {@code Component} * instance in the GUI. [implementation dependent] *
          • Some other arbitrary association. [implementation dependent] *
          * - * Once the DragSource is - * obtained, a DragGestureRecognizer should - * also be obtained to associate the DragSource + * Once the {@code DragSource} is + * obtained, a {@code DragGestureRecognizer} should + * also be obtained to associate the {@code DragSource} * with a particular - * Component. + * {@code Component}. *

          * The initial interpretation of the user's gesture, * and the subsequent starting of the drag operation * are the responsibility of the implementing - * Component, which is usually - * implemented by a DragGestureRecognizer. + * {@code Component}, which is usually + * implemented by a {@code DragGestureRecognizer}. *

          * When a drag gesture occurs, the - * DragSource's + * {@code DragSource}'s * startDrag() method shall be * invoked in order to cause processing * of the user's navigational * gestures and delivery of Drag and Drop * protocol notifications. A - * DragSource shall only + * {@code DragSource} shall only * permit a single Drag and Drop operation to be * current at any one time, and shall * reject any further startDrag() requests - * by throwing an IllegalDnDOperationException + * by throwing an {@code IllegalDnDOperationException} * until such time as the extant operation is complete. *

          * The startDrag() method invokes the * createDragSourceContext() method to * instantiate an appropriate - * DragSourceContext - * and associate the DragSourceContextPeer + * {@code DragSourceContext} + * and associate the {@code DragSourceContextPeer} * with that. *

          * If the Drag and Drop System is * unable to initiate a drag operation for * some reason, the startDrag() method throws - * a java.awt.dnd.InvalidDnDOperationException + * a {@code java.awt.dnd.InvalidDnDOperationException} * to signal such a condition. Typically this * exception is thrown when the underlying platform * system is either not in a state to @@ -111,7 +111,7 @@ import sun.security.action.GetIntegerAction; * until the operation is complete. * The operation(s) are constant for the * duration of the operation with respect to the - * DragSource. + * {@code DragSource}. * * @since 1.2 */ @@ -140,9 +140,9 @@ public class DragSource implements Serializable { /** - * The default Cursor to use with a copy operation indicating - * that a drop is currently allowed. null if - * GraphicsEnvironment.isHeadless() returns true. + * The default {@code Cursor} to use with a copy operation indicating + * that a drop is currently allowed. {@code null} if + * {@code GraphicsEnvironment.isHeadless()} returns {@code true}. * * @see java.awt.GraphicsEnvironment#isHeadless */ @@ -150,9 +150,9 @@ public class DragSource implements Serializable { load("DnD.Cursor.CopyDrop"); /** - * The default Cursor to use with a move operation indicating - * that a drop is currently allowed. null if - * GraphicsEnvironment.isHeadless() returns true. + * The default {@code Cursor} to use with a move operation indicating + * that a drop is currently allowed. {@code null} if + * {@code GraphicsEnvironment.isHeadless()} returns {@code true}. * * @see java.awt.GraphicsEnvironment#isHeadless */ @@ -160,9 +160,9 @@ public class DragSource implements Serializable { load("DnD.Cursor.MoveDrop"); /** - * The default Cursor to use with a link operation indicating - * that a drop is currently allowed. null if - * GraphicsEnvironment.isHeadless() returns true. + * The default {@code Cursor} to use with a link operation indicating + * that a drop is currently allowed. {@code null} if + * {@code GraphicsEnvironment.isHeadless()} returns {@code true}. * * @see java.awt.GraphicsEnvironment#isHeadless */ @@ -170,9 +170,9 @@ public class DragSource implements Serializable { load("DnD.Cursor.LinkDrop"); /** - * The default Cursor to use with a copy operation indicating - * that a drop is currently not allowed. null if - * GraphicsEnvironment.isHeadless() returns true. + * The default {@code Cursor} to use with a copy operation indicating + * that a drop is currently not allowed. {@code null} if + * {@code GraphicsEnvironment.isHeadless()} returns {@code true}. * * @see java.awt.GraphicsEnvironment#isHeadless */ @@ -180,9 +180,9 @@ public class DragSource implements Serializable { load("DnD.Cursor.CopyNoDrop"); /** - * The default Cursor to use with a move operation indicating - * that a drop is currently not allowed. null if - * GraphicsEnvironment.isHeadless() returns true. + * The default {@code Cursor} to use with a move operation indicating + * that a drop is currently not allowed. {@code null} if + * {@code GraphicsEnvironment.isHeadless()} returns {@code true}. * * @see java.awt.GraphicsEnvironment#isHeadless */ @@ -190,9 +190,9 @@ public class DragSource implements Serializable { load("DnD.Cursor.MoveNoDrop"); /** - * The default Cursor to use with a link operation indicating - * that a drop is currently not allowed. null if - * GraphicsEnvironment.isHeadless() returns true. + * The default {@code Cursor} to use with a link operation indicating + * that a drop is currently not allowed. {@code null} if + * {@code GraphicsEnvironment.isHeadless()} returns {@code true}. * * @see java.awt.GraphicsEnvironment#isHeadless */ @@ -209,7 +209,7 @@ public class DragSource implements Serializable { static final String dragSourceMotionListenerK = "dragSourceMotionL"; /** - * Gets the DragSource object associated with + * Gets the {@code DragSource} object associated with * the underlying platform. * * @return the platform DragSource @@ -228,7 +228,7 @@ public class DragSource implements Serializable { /** * Reports * whether or not drag - * Image support + * {@code Image} support * is available on the underlying platform. * * @return if the Drag Image support is available on this platform @@ -249,7 +249,7 @@ public class DragSource implements Serializable { } /** - * Creates a new DragSource. + * Creates a new {@code DragSource}. * * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true @@ -262,28 +262,28 @@ public class DragSource implements Serializable { } /** - * Start a drag, given the DragGestureEvent + * Start a drag, given the {@code DragGestureEvent} * that initiated the drag, the initial - * Cursor to use, - * the Image to drag, - * the offset of the Image origin - * from the hotspot of the Cursor at + * {@code Cursor} to use, + * the {@code Image} to drag, + * the offset of the {@code Image} origin + * from the hotspot of the {@code Cursor} at * the instant of the trigger, - * the Transferable subject data - * of the drag, the DragSourceListener, - * and the FlavorMap. + * the {@code Transferable} subject data + * of the drag, the {@code DragSourceListener}, + * and the {@code FlavorMap}. * - * @param trigger the DragGestureEvent that initiated the drag + * @param trigger the {@code DragGestureEvent} that initiated the drag * @param dragCursor the initial {@code Cursor} for this drag operation * or {@code null} for the default cursor handling; * see DragSourceContext * for more details on the cursor handling mechanism during drag and drop * @param dragImage the image to drag or {@code null} - * @param imageOffset the offset of the Image origin from the hotspot - * of the Cursor at the instant of the trigger + * @param imageOffset the offset of the {@code Image} origin from the hotspot + * of the {@code Cursor} at the instant of the trigger * @param transferable the subject data of the drag - * @param dsl the DragSourceListener - * @param flavorMap the FlavorMap to use, or null + * @param dsl the {@code DragSourceListener} + * @param flavorMap the {@code FlavorMap} to use, or {@code null} * * @throws java.awt.dnd.InvalidDnDOperationException * if the Drag and Drop @@ -322,22 +322,22 @@ public class DragSource implements Serializable { } /** - * Start a drag, given the DragGestureEvent + * Start a drag, given the {@code DragGestureEvent} * that initiated the drag, the initial - * Cursor to use, - * the Transferable subject data - * of the drag, the DragSourceListener, - * and the FlavorMap. + * {@code Cursor} to use, + * the {@code Transferable} subject data + * of the drag, the {@code DragSourceListener}, + * and the {@code FlavorMap}. * - * @param trigger the DragGestureEvent that + * @param trigger the {@code DragGestureEvent} that * initiated the drag * @param dragCursor the initial {@code Cursor} for this drag operation * or {@code null} for the default cursor handling; * see DragSourceContext * for more details on the cursor handling mechanism during drag and drop * @param transferable the subject data of the drag - * @param dsl the DragSourceListener - * @param flavorMap the FlavorMap to use or null + * @param dsl the {@code DragSourceListener} + * @param flavorMap the {@code FlavorMap} to use or {@code null} * * @throws java.awt.dnd.InvalidDnDOperationException * if the Drag and Drop @@ -355,26 +355,26 @@ public class DragSource implements Serializable { } /** - * Start a drag, given the DragGestureEvent - * that initiated the drag, the initial Cursor + * Start a drag, given the {@code DragGestureEvent} + * that initiated the drag, the initial {@code Cursor} * to use, - * the Image to drag, - * the offset of the Image origin - * from the hotspot of the Cursor + * the {@code Image} to drag, + * the offset of the {@code Image} origin + * from the hotspot of the {@code Cursor} * at the instant of the trigger, * the subject data of the drag, and - * the DragSourceListener. + * the {@code DragSourceListener}. * - * @param trigger the DragGestureEvent that initiated the drag + * @param trigger the {@code DragGestureEvent} that initiated the drag * @param dragCursor the initial {@code Cursor} for this drag operation * or {@code null} for the default cursor handling; * see DragSourceContext * for more details on the cursor handling mechanism during drag and drop - * @param dragImage the Image to drag or null - * @param dragOffset the offset of the Image origin from the hotspot - * of the Cursor at the instant of the trigger + * @param dragImage the {@code Image} to drag or {@code null} + * @param dragOffset the offset of the {@code Image} origin from the hotspot + * of the {@code Cursor} at the instant of the trigger * @param transferable the subject data of the drag - * @param dsl the DragSourceListener + * @param dsl the {@code DragSourceListener} * * @throws java.awt.dnd.InvalidDnDOperationException * if the Drag and Drop @@ -393,20 +393,20 @@ public class DragSource implements Serializable { } /** - * Start a drag, given the DragGestureEvent + * Start a drag, given the {@code DragGestureEvent} * that initiated the drag, the initial - * Cursor to + * {@code Cursor} to * use, - * the Transferable subject data - * of the drag, and the DragSourceListener. + * the {@code Transferable} subject data + * of the drag, and the {@code DragSourceListener}. * - * @param trigger the DragGestureEvent that initiated the drag + * @param trigger the {@code DragGestureEvent} that initiated the drag * @param dragCursor the initial {@code Cursor} for this drag operation * or {@code null} for the default cursor handling; * see DragSourceContext class * for more details on the cursor handling mechanism during drag and drop * @param transferable the subject data of the drag - * @param dsl the DragSourceListener + * @param dsl the {@code DragSourceListener} * * @throws java.awt.dnd.InvalidDnDOperationException * if the Drag and Drop @@ -426,46 +426,46 @@ public class DragSource implements Serializable { * Creates the {@code DragSourceContext} to handle the current drag * operation. *

          - * To incorporate a new DragSourceContext - * subclass, subclass DragSource and + * To incorporate a new {@code DragSourceContext} + * subclass, subclass {@code DragSource} and * override this method. *

          - * If dragImage is null, no image is used + * If {@code dragImage} is {@code null}, no image is used * to represent the drag over feedback for this drag operation, but - * NullPointerException is not thrown. + * {@code NullPointerException} is not thrown. *

          - * If dsl is null, no drag source listener - * is registered with the created DragSourceContext, - * but NullPointerException is not thrown. + * If {@code dsl} is {@code null}, no drag source listener + * is registered with the created {@code DragSourceContext}, + * but {@code NullPointerException} is not thrown. * - * @param dgl The DragGestureEvent that triggered the + * @param dgl The {@code DragGestureEvent} that triggered the * drag * @param dragCursor The initial {@code Cursor} for this drag operation * or {@code null} for the default cursor handling; * see DragSourceContext class * for more details on the cursor handling mechanism during drag and drop - * @param dragImage The Image to drag or null - * @param imageOffset The offset of the Image origin from the + * @param dragImage The {@code Image} to drag or {@code null} + * @param imageOffset The offset of the {@code Image} origin from the * hotspot of the cursor at the instant of the trigger * @param t The subject data of the drag - * @param dsl The DragSourceListener + * @param dsl The {@code DragSourceListener} * - * @return the DragSourceContext + * @return the {@code DragSourceContext} * - * @throws NullPointerException if dscp is null - * @throws NullPointerException if dgl is null - * @throws NullPointerException if dragImage is not - * null and imageOffset is null - * @throws NullPointerException if t is null - * @throws IllegalArgumentException if the Component - * associated with the trigger event is null. - * @throws IllegalArgumentException if the DragSource for the - * trigger event is null. + * @throws NullPointerException if {@code dscp} is {@code null} + * @throws NullPointerException if {@code dgl} is {@code null} + * @throws NullPointerException if {@code dragImage} is not + * {@code null} and {@code imageOffset} is {@code null} + * @throws NullPointerException if {@code t} is {@code null} + * @throws IllegalArgumentException if the {@code Component} + * associated with the trigger event is {@code null}. + * @throws IllegalArgumentException if the {@code DragSource} for the + * trigger event is {@code null}. * @throws IllegalArgumentException if the drag action for the - * trigger event is DnDConstants.ACTION_NONE. + * trigger event is {@code DnDConstants.ACTION_NONE}. * @throws IllegalArgumentException if the source actions for the - * DragGestureRecognizer associated with the trigger - * event are equal to DnDConstants.ACTION_NONE. + * {@code DragGestureRecognizer} associated with the trigger + * event are equal to {@code DnDConstants.ACTION_NONE}. */ protected DragSourceContext createDragSourceContext(DragGestureEvent dgl, @@ -479,33 +479,33 @@ public class DragSource implements Serializable { /** * This method returns the - * FlavorMap for this DragSource. + * {@code FlavorMap} for this {@code DragSource}. * - * @return the FlavorMap for this DragSource + * @return the {@code FlavorMap} for this {@code DragSource} */ public FlavorMap getFlavorMap() { return flavorMap; } /** - * Creates a new DragGestureRecognizer + * Creates a new {@code DragGestureRecognizer} * that implements the specified * abstract subclass of - * DragGestureRecognizer, and - * sets the specified Component - * and DragGestureListener on + * {@code DragGestureRecognizer}, and + * sets the specified {@code Component} + * and {@code DragGestureListener} on * the newly created object. * * @param the type of {@code DragGestureRecognizer} to create * @param recognizerAbstractClass the requested abstract type * @param actions the permitted source drag actions - * @param c the Component target - * @param dgl the DragGestureListener to notify + * @param c the {@code Component} target + * @param dgl the {@code DragGestureListener} to notify * - * @return the new DragGestureRecognizer or null - * if the Toolkit.createDragGestureRecognizer method + * @return the new {@code DragGestureRecognizer} or {@code null} + * if the {@code Toolkit.createDragGestureRecognizer} method * has no implementation available for - * the requested DragGestureRecognizer - * subclass and returns null + * the requested {@code DragGestureRecognizer} + * subclass and returns {@code null} */ public T @@ -518,26 +518,26 @@ public class DragSource implements Serializable { /** - * Creates a new DragGestureRecognizer + * Creates a new {@code DragGestureRecognizer} * that implements the default - * abstract subclass of DragGestureRecognizer - * for this DragSource, - * and sets the specified Component - * and DragGestureListener on the + * abstract subclass of {@code DragGestureRecognizer} + * for this {@code DragSource}, + * and sets the specified {@code Component} + * and {@code DragGestureListener} on the * newly created object. * - * For this DragSource - * the default is MouseDragGestureRecognizer. + * For this {@code DragSource} + * the default is {@code MouseDragGestureRecognizer}. * - * @param c the Component target for the recognizer + * @param c the {@code Component} target for the recognizer * @param actions the permitted source actions - * @param dgl the DragGestureListener to notify + * @param dgl the {@code DragGestureListener} to notify * - * @return the new DragGestureRecognizer or null - * if the Toolkit.createDragGestureRecognizer method + * @return the new {@code DragGestureRecognizer} or {@code null} + * if the {@code Toolkit.createDragGestureRecognizer} method * has no implementation available for - * the requested DragGestureRecognizer - * subclass and returns null + * the requested {@code DragGestureRecognizer} + * subclass and returns {@code null} */ public DragGestureRecognizer createDefaultDragGestureRecognizer(Component c, int actions, DragGestureListener dgl) { @@ -545,13 +545,13 @@ public class DragSource implements Serializable { } /** - * Adds the specified DragSourceListener to this - * DragSource to receive drag source events during drag - * operations initiated with this DragSource. - * If a null listener is specified, no action is taken and no + * Adds the specified {@code DragSourceListener} to this + * {@code DragSource} to receive drag source events during drag + * operations initiated with this {@code DragSource}. + * If a {@code null} listener is specified, no action is taken and no * exception is thrown. * - * @param dsl the DragSourceListener to add + * @param dsl the {@code DragSourceListener} to add * * @see #removeDragSourceListener * @see #getDragSourceListeners @@ -566,15 +566,15 @@ public class DragSource implements Serializable { } /** - * Removes the specified DragSourceListener from this - * DragSource. - * If a null listener is specified, no action is taken and no + * Removes the specified {@code DragSourceListener} from this + * {@code DragSource}. + * If a {@code null} listener is specified, no action is taken and no * exception is thrown. * If the listener specified by the argument was not previously added to - * this DragSource, no action is taken and no exception + * this {@code DragSource}, no action is taken and no exception * is thrown. * - * @param dsl the DragSourceListener to remove + * @param dsl the {@code DragSourceListener} to remove * * @see #addDragSourceListener * @see #getDragSourceListeners @@ -589,11 +589,11 @@ public class DragSource implements Serializable { } /** - * Gets all the DragSourceListeners - * registered with this DragSource. + * Gets all the {@code DragSourceListener}s + * registered with this {@code DragSource}. * - * @return all of this DragSource's - * DragSourceListeners or an empty array if no + * @return all of this {@code DragSource}'s + * {@code DragSourceListener}s or an empty array if no * such listeners are currently registered * * @see #addDragSourceListener @@ -605,13 +605,13 @@ public class DragSource implements Serializable { } /** - * Adds the specified DragSourceMotionListener to this - * DragSource to receive drag motion events during drag - * operations initiated with this DragSource. - * If a null listener is specified, no action is taken and no + * Adds the specified {@code DragSourceMotionListener} to this + * {@code DragSource} to receive drag motion events during drag + * operations initiated with this {@code DragSource}. + * If a {@code null} listener is specified, no action is taken and no * exception is thrown. * - * @param dsml the DragSourceMotionListener to add + * @param dsml the {@code DragSourceMotionListener} to add * * @see #removeDragSourceMotionListener * @see #getDragSourceMotionListeners @@ -626,15 +626,15 @@ public class DragSource implements Serializable { } /** - * Removes the specified DragSourceMotionListener from this - * DragSource. - * If a null listener is specified, no action is taken and no + * Removes the specified {@code DragSourceMotionListener} from this + * {@code DragSource}. + * If a {@code null} listener is specified, no action is taken and no * exception is thrown. * If the listener specified by the argument was not previously added to - * this DragSource, no action is taken and no exception + * this {@code DragSource}, no action is taken and no exception * is thrown. * - * @param dsml the DragSourceMotionListener to remove + * @param dsml the {@code DragSourceMotionListener} to remove * * @see #addDragSourceMotionListener * @see #getDragSourceMotionListeners @@ -649,11 +649,11 @@ public class DragSource implements Serializable { } /** - * Gets all of the DragSourceMotionListeners - * registered with this DragSource. + * Gets all of the {@code DragSourceMotionListener}s + * registered with this {@code DragSource}. * - * @return all of this DragSource's - * DragSourceMotionListeners or an empty array if no + * @return all of this {@code DragSource}'s + * {@code DragSourceMotionListener}s or an empty array if no * such listeners are currently registered * * @see #addDragSourceMotionListener @@ -666,21 +666,21 @@ public class DragSource implements Serializable { /** * Gets all the objects currently registered as - * FooListeners upon this DragSource. + * FooListeners upon this {@code DragSource}. * FooListeners are registered using the * addFooListener method. * * @param the type of listener objects * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this - * DragSource, or an empty array if no such listeners + * {@code DragSource}, or an empty array if no such listeners * have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @see #getDragSourceListeners * @see #getDragSourceMotionListeners @@ -697,12 +697,12 @@ public class DragSource implements Serializable { } /** - * This method calls dragEnter on the - * DragSourceListeners registered with this - * DragSource, and passes them the specified - * DragSourceDragEvent. + * This method calls {@code dragEnter} on the + * {@code DragSourceListener}s registered with this + * {@code DragSource}, and passes them the specified + * {@code DragSourceDragEvent}. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ void processDragEnter(DragSourceDragEvent dsde) { DragSourceListener dsl = listener; @@ -712,12 +712,12 @@ public class DragSource implements Serializable { } /** - * This method calls dragOver on the - * DragSourceListeners registered with this - * DragSource, and passes them the specified - * DragSourceDragEvent. + * This method calls {@code dragOver} on the + * {@code DragSourceListener}s registered with this + * {@code DragSource}, and passes them the specified + * {@code DragSourceDragEvent}. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ void processDragOver(DragSourceDragEvent dsde) { DragSourceListener dsl = listener; @@ -727,12 +727,12 @@ public class DragSource implements Serializable { } /** - * This method calls dropActionChanged on the - * DragSourceListeners registered with this - * DragSource, and passes them the specified - * DragSourceDragEvent. + * This method calls {@code dropActionChanged} on the + * {@code DragSourceListener}s registered with this + * {@code DragSource}, and passes them the specified + * {@code DragSourceDragEvent}. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ void processDropActionChanged(DragSourceDragEvent dsde) { DragSourceListener dsl = listener; @@ -742,12 +742,12 @@ public class DragSource implements Serializable { } /** - * This method calls dragExit on the - * DragSourceListeners registered with this - * DragSource, and passes them the specified - * DragSourceEvent. + * This method calls {@code dragExit} on the + * {@code DragSourceListener}s registered with this + * {@code DragSource}, and passes them the specified + * {@code DragSourceEvent}. * - * @param dse the DragSourceEvent + * @param dse the {@code DragSourceEvent} */ void processDragExit(DragSourceEvent dse) { DragSourceListener dsl = listener; @@ -757,12 +757,12 @@ public class DragSource implements Serializable { } /** - * This method calls dragDropEnd on the - * DragSourceListeners registered with this - * DragSource, and passes them the specified - * DragSourceDropEvent. + * This method calls {@code dragDropEnd} on the + * {@code DragSourceListener}s registered with this + * {@code DragSource}, and passes them the specified + * {@code DragSourceDropEvent}. * - * @param dsde the DragSourceEvent + * @param dsde the {@code DragSourceEvent} */ void processDragDropEnd(DragSourceDropEvent dsde) { DragSourceListener dsl = listener; @@ -772,12 +772,12 @@ public class DragSource implements Serializable { } /** - * This method calls dragMouseMoved on the - * DragSourceMotionListeners registered with this - * DragSource, and passes them the specified - * DragSourceDragEvent. + * This method calls {@code dragMouseMoved} on the + * {@code DragSourceMotionListener}s registered with this + * {@code DragSource}, and passes them the specified + * {@code DragSourceDragEvent}. * - * @param dsde the DragSourceEvent + * @param dsde the {@code DragSourceEvent} */ void processDragMouseMoved(DragSourceDragEvent dsde) { DragSourceMotionListener dsml = motionListener; @@ -787,33 +787,33 @@ public class DragSource implements Serializable { } /** - * Serializes this DragSource. This method first performs + * Serializes this {@code DragSource}. This method first performs * default serialization. Next, it writes out this object's - * FlavorMap if and only if it can be serialized. If not, - * null is written instead. Next, it writes out - * Serializable listeners registered with this - * object. Listeners are written in a null-terminated sequence - * of 0 or more pairs. The pair consists of a String and an - * Object; the String indicates the type of the - * Object and is one of the following: + * {@code FlavorMap} if and only if it can be serialized. If not, + * {@code null} is written instead. Next, it writes out + * {@code Serializable} listeners registered with this + * object. Listeners are written in a {@code null}-terminated sequence + * of 0 or more pairs. The pair consists of a {@code String} and an + * {@code Object}; the {@code String} indicates the type of the + * {@code Object} and is one of the following: *

            - *
          • dragSourceListenerK indicating a - * DragSourceListener object; - *
          • dragSourceMotionListenerK indicating a - * DragSourceMotionListener object. + *
          • {@code dragSourceListenerK} indicating a + * {@code DragSourceListener} object; + *
          • {@code dragSourceMotionListenerK} indicating a + * {@code DragSourceMotionListener} object. *
          * - * @serialData Either a FlavorMap instance, or - * null, followed by a null-terminated + * @serialData Either a {@code FlavorMap} instance, or + * {@code null}, followed by a {@code null}-terminated * sequence of 0 or more pairs; the pair consists of a - * String and an Object; the - * String indicates the type of the Object + * {@code String} and an {@code Object}; the + * {@code String} indicates the type of the {@code Object} * and is one of the following: *
            - *
          • dragSourceListenerK indicating a - * DragSourceListener object; - *
          • dragSourceMotionListenerK indicating a - * DragSourceMotionListener object. + *
          • {@code dragSourceListenerK} indicating a + * {@code DragSourceListener} object; + *
          • {@code dragSourceMotionListenerK} indicating a + * {@code DragSourceMotionListener} object. *
          . * @since 1.4 */ @@ -828,24 +828,24 @@ public class DragSource implements Serializable { } /** - * Deserializes this DragSource. This method first performs - * default deserialization. Next, this object's FlavorMap is + * Deserializes this {@code DragSource}. This method first performs + * default deserialization. Next, this object's {@code FlavorMap} is * deserialized by using the next object in the stream. - * If the resulting FlavorMap is null, this - * object's FlavorMap is set to the default FlavorMap for - * this thread's ClassLoader. + * If the resulting {@code FlavorMap} is {@code null}, this + * object's {@code FlavorMap} is set to the default FlavorMap for + * this thread's {@code ClassLoader}. * Next, this object's listeners are deserialized by reading a - * null-terminated sequence of 0 or more key/value pairs + * {@code null}-terminated sequence of 0 or more key/value pairs * from the stream: *
            - *
          • If a key object is a String equal to - * dragSourceListenerK, a DragSourceListener is + *
          • If a key object is a {@code String} equal to + * {@code dragSourceListenerK}, a {@code DragSourceListener} is * deserialized using the corresponding value object and added to this - * DragSource. - *
          • If a key object is a String equal to - * dragSourceMotionListenerK, a - * DragSourceMotionListener is deserialized using the - * corresponding value object and added to this DragSource. + * {@code DragSource}. + *
          • If a key object is a {@code String} equal to + * {@code dragSourceMotionListenerK}, a + * {@code DragSourceMotionListener} is deserialized using the + * corresponding value object and added to this {@code DragSource}. *
          • Otherwise, the key/value pair is skipped. *
          * @@ -884,13 +884,13 @@ public class DragSource implements Serializable { * Returns the drag gesture motion threshold. The drag gesture motion threshold * defines the recommended behavior for {@link MouseDragGestureRecognizer}s. *

          - * If the system property awt.dnd.drag.threshold is set to + * If the system property {@code awt.dnd.drag.threshold} is set to * a positive integer, this method returns the value of the system property; * otherwise if a pertinent desktop property is available and supported by * the implementation of the Java platform, this method returns the value of * that property; otherwise this method returns some default value. * The pertinent desktop property can be queried using - * java.awt.Toolkit.getDesktopProperty("DnD.gestureMotionThreshold"). + * {@code java.awt.Toolkit.getDesktopProperty("DnD.gestureMotionThreshold")}. * * @return the drag gesture motion threshold * @see MouseDragGestureRecognizer diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceAdapter.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceAdapter.java index 1d406819074..9470c5990bc 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceAdapter.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceAdapter.java @@ -30,22 +30,22 @@ package java.awt.dnd; * this class are empty. This class exists only as a convenience for creating * listener objects. *

          - * Extend this class to create a DragSourceEvent listener + * Extend this class to create a {@code DragSourceEvent} listener * and override the methods for the events of interest. (If you implement the - * DragSourceListener interface, you have to define all of + * {@code DragSourceListener} interface, you have to define all of * the methods in it. This abstract class defines null methods for them * all, so you only have to define methods for events you care about.) *

          * Create a listener object using the extended class and then register it with - * a DragSource. When the drag enters, moves over, or exits + * a {@code DragSource}. When the drag enters, moves over, or exits * a drop site, when the drop action changes, and when the drag ends, the * relevant method in the listener object is invoked, and the - * DragSourceEvent is passed to it. + * {@code DragSourceEvent} is passed to it. *

          - * The drop site is associated with the previous dragEnter() - * invocation if the latest invocation of dragEnter() on this + * The drop site is associated with the previous {@code dragEnter()} + * invocation if the latest invocation of {@code dragEnter()} on this * adapter corresponds to that drop site and is not followed by a - * dragExit() invocation on this adapter. + * {@code dragExit()} invocation on this adapter. * * @see DragSourceEvent * @see DragSourceListener @@ -67,7 +67,7 @@ public abstract class DragSourceAdapter *

        • The drop site accepts the drag. *
        * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dragEnter(DragSourceDragEvent dsde) {} @@ -82,14 +82,14 @@ public abstract class DragSourceAdapter *
      • The drop site accepts the drag. *
      * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dragOver(DragSourceDragEvent dsde) {} /** * Called whenever the mouse is moved during a drag operation. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dragMouseMoved(DragSourceDragEvent dsde) {} @@ -100,7 +100,7 @@ public abstract class DragSourceAdapter * Such devices are typically the mouse buttons or keyboard * modifiers that the user is interacting with. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dropActionChanged(DragSourceDragEvent dsde) {} @@ -122,21 +122,21 @@ public abstract class DragSourceAdapter * has rejected the drag. * * - * @param dse the DragSourceEvent + * @param dse the {@code DragSourceEvent} */ public void dragExit(DragSourceEvent dse) {} /** * This method is invoked to signify that the Drag and Drop * operation is complete. The getDropSuccess() method of - * the DragSourceDropEvent can be used to + * the {@code DragSourceDropEvent} can be used to * determine the termination state. The getDropAction() method * returns the operation that the drop site selected * to apply to the Drop operation. Once this method is complete, the - * current DragSourceContext and + * current {@code DragSourceContext} and * associated resources become invalid. * - * @param dsde the DragSourceDropEvent + * @param dsde the {@code DragSourceDropEvent} */ public void dragDropEnd(DragSourceDropEvent dsde) {} } diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceContext.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceContext.java index 7e0d0030175..7d858548ddb 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceContext.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceContext.java @@ -46,22 +46,22 @@ import sun.awt.AWTAccessor; import sun.awt.ComponentFactory; /** - * The DragSourceContext class is responsible for managing the + * The {@code DragSourceContext} class is responsible for managing the * initiator side of the Drag and Drop protocol. In particular, it is responsible * for managing drag event notifications to the * {@linkplain DragSourceListener DragSourceListeners} * and {@linkplain DragSourceMotionListener DragSourceMotionListeners}, and providing the * {@link Transferable} representing the source data for the drag operation. *

      - * Note that the DragSourceContext itself - * implements the DragSourceListener and - * DragSourceMotionListener interfaces. + * Note that the {@code DragSourceContext} itself + * implements the {@code DragSourceListener} and + * {@code DragSourceMotionListener} interfaces. * This is to allow the platform peer * (the {@link DragSourceContextPeer} instance) * created by the {@link DragSource} to notify - * the DragSourceContext of + * the {@code DragSourceContext} of * state changes in the ongoing operation. This allows the - * DragSourceContext object to interpose + * {@code DragSourceContext} object to interpose * itself between the platform and the * listeners provided by the initiator of the drag operation. *

      @@ -97,28 +97,28 @@ public class DragSourceContext // used by updateCurrentCursor /** - * An int used by updateCurrentCursor() - * indicating that the Cursor should change - * to the default (no drop) Cursor. + * An {@code int} used by updateCurrentCursor() + * indicating that the {@code Cursor} should change + * to the default (no drop) {@code Cursor}. */ protected static final int DEFAULT = 0; /** - * An int used by updateCurrentCursor() - * indicating that the Cursor - * has entered a DropTarget. + * An {@code int} used by updateCurrentCursor() + * indicating that the {@code Cursor} + * has entered a {@code DropTarget}. */ protected static final int ENTER = 1; /** - * An int used by updateCurrentCursor() - * indicating that the Cursor is - * over a DropTarget. + * An {@code int} used by updateCurrentCursor() + * indicating that the {@code Cursor} is + * over a {@code DropTarget}. */ protected static final int OVER = 2; /** - * An int used by updateCurrentCursor() + * An {@code int} used by updateCurrentCursor() * indicating that the user operation has changed. */ @@ -129,35 +129,35 @@ public class DragSourceContext } /** - * Called from DragSource, this constructor creates a new - * DragSourceContext given the - * DragSourceContextPeer for this Drag, the - * DragGestureEvent that triggered the Drag, the initial - * Cursor to use for the Drag, an (optional) - * Image to display while the Drag is taking place, the offset - * of the Image origin from the hotspot at the instant of the - * triggering event, the Transferable subject data, and the - * DragSourceListener to use during the Drag and Drop + * Called from {@code DragSource}, this constructor creates a new + * {@code DragSourceContext} given the + * {@code DragSourceContextPeer} for this Drag, the + * {@code DragGestureEvent} that triggered the Drag, the initial + * {@code Cursor} to use for the Drag, an (optional) + * {@code Image} to display while the Drag is taking place, the offset + * of the {@code Image} origin from the hotspot at the instant of the + * triggering event, the {@code Transferable} subject data, and the + * {@code DragSourceListener} to use during the Drag and Drop * operation. *
      - * If DragSourceContextPeer is null - * NullPointerException is thrown. + * If {@code DragSourceContextPeer} is {@code null} + * {@code NullPointerException} is thrown. *
      - * If DragGestureEvent is null - * NullPointerException is thrown. + * If {@code DragGestureEvent} is {@code null} + * {@code NullPointerException} is thrown. *
      - * If Cursor is null no exception is thrown and + * If {@code Cursor} is {@code null} no exception is thrown and * the default drag cursor behavior is activated for this drag operation. *
      - * If Image is null no exception is thrown. + * If {@code Image} is {@code null} no exception is thrown. *
      - * If Image is not null and the offset is - * null NullPointerException is thrown. + * If {@code Image} is not {@code null} and the offset is + * {@code null NullPointerException} is thrown. *
      - * If Transferable is null - * NullPointerException is thrown. + * If {@code Transferable} is {@code null} + * {@code NullPointerException} is thrown. *
      - * If DragSourceListener is null no exception + * If {@code DragSourceListener} is {@code null} no exception * is thrown. * * @param trigger the triggering event @@ -165,21 +165,21 @@ public class DragSourceContext * or {@code null} for the default cursor handling; * see class level documentation * for more details on the cursor handling mechanism during drag and drop - * @param dragImage the Image to drag (or null) + * @param dragImage the {@code Image} to drag (or {@code null}) * @param offset the offset of the image origin from the hotspot at the * instant of the triggering event - * @param t the Transferable - * @param dsl the DragSourceListener + * @param t the {@code Transferable} + * @param dsl the {@code DragSourceListener} * - * @throws IllegalArgumentException if the Component associated - * with the trigger event is null. - * @throws IllegalArgumentException if the DragSource for the - * trigger event is null. + * @throws IllegalArgumentException if the {@code Component} associated + * with the trigger event is {@code null}. + * @throws IllegalArgumentException if the {@code DragSource} for the + * trigger event is {@code null}. * @throws IllegalArgumentException if the drag action for the - * trigger event is DnDConstants.ACTION_NONE. + * trigger event is {@code DnDConstants.ACTION_NONE}. * @throws IllegalArgumentException if the source actions for the - * DragGestureRecognizer associated with the trigger - * event are equal to DnDConstants.ACTION_NONE. + * {@code DragGestureRecognizer} associated with the trigger + * event are equal to {@code DnDConstants.ACTION_NONE}. * @throws NullPointerException if dscp, trigger, or t are null, or * if dragImage is non-null and offset is null */ @@ -240,26 +240,26 @@ public class DragSourceContext } /** - * Returns the DragSource - * that instantiated this DragSourceContext. + * Returns the {@code DragSource} + * that instantiated this {@code DragSourceContext}. * - * @return the DragSource that - * instantiated this DragSourceContext + * @return the {@code DragSource} that + * instantiated this {@code DragSourceContext} */ public DragSource getDragSource() { return trigger.getDragSource(); } /** - * Returns the Component associated with this - * DragSourceContext. + * Returns the {@code Component} associated with this + * {@code DragSourceContext}. * - * @return the Component that started the drag + * @return the {@code Component} that started the drag */ public Component getComponent() { return trigger.getComponent(); } /** - * Returns the DragGestureEvent + * Returns the {@code DragGestureEvent} * that initially triggered the drag. * * @return the Event that triggered the drag @@ -268,9 +268,9 @@ public class DragSourceContext public DragGestureEvent getTrigger() { return trigger; } /** - * Returns a bitwise mask of DnDConstants that + * Returns a bitwise mask of {@code DnDConstants} that * represent the set of drop actions supported by the drag source for the - * drag operation associated with this DragSourceContext. + * drag operation associated with this {@code DragSourceContext}. * * @return the drop actions supported by the drag source */ @@ -280,8 +280,8 @@ public class DragSourceContext /** * Sets the cursor for this drag operation to the specified - * Cursor. If the specified Cursor - * is null, the default drag cursor behavior is + * {@code Cursor}. If the specified {@code Cursor} + * is {@code null}, the default drag cursor behavior is * activated for this drag operation, otherwise it is deactivated. * * @param c the initial {@code Cursor} for this drag operation, @@ -298,25 +298,25 @@ public class DragSourceContext } /** - * Returns the current drag Cursor. + * Returns the current drag {@code Cursor}. * - * @return the current drag Cursor + * @return the current drag {@code Cursor} */ public Cursor getCursor() { return cursor; } /** - * Add a DragSourceListener to this - * DragSourceContext if one has not already been added. - * If a DragSourceListener already exists, - * this method throws a TooManyListenersException. + * Add a {@code DragSourceListener} to this + * {@code DragSourceContext} if one has not already been added. + * If a {@code DragSourceListener} already exists, + * this method throws a {@code TooManyListenersException}. * - * @param dsl the DragSourceListener to add. - * Note that while null is not prohibited, + * @param dsl the {@code DragSourceListener} to add. + * Note that while {@code null} is not prohibited, * it is not acceptable as a parameter. * * @throws TooManyListenersException if - * a DragSourceListener has already been added + * a {@code DragSourceListener} has already been added */ public synchronized void addDragSourceListener(DragSourceListener dsl) throws TooManyListenersException { @@ -331,11 +331,11 @@ public class DragSourceContext } /** - * Removes the specified DragSourceListener - * from this DragSourceContext. + * Removes the specified {@code DragSourceListener} + * from this {@code DragSourceContext}. * - * @param dsl the DragSourceListener to remove; - * note that while null is not prohibited, + * @param dsl the {@code DragSourceListener} to remove; + * note that while {@code null} is not prohibited, * it is not acceptable as a parameter */ @@ -347,8 +347,8 @@ public class DragSourceContext } /** - * Notifies the peer that the Transferable's - * DataFlavors have changed. + * Notifies the peer that the {@code Transferable}'s + * {@code DataFlavor}s have changed. */ public void transferablesFlavorsChanged() { @@ -356,13 +356,13 @@ public class DragSourceContext } /** - * Calls dragEnter on the - * DragSourceListeners registered with this - * DragSourceContext and with the associated - * DragSource, and passes them the specified - * DragSourceDragEvent. + * Calls {@code dragEnter} on the + * {@code DragSourceListener}s registered with this + * {@code DragSourceContext} and with the associated + * {@code DragSource}, and passes them the specified + * {@code DragSourceDragEvent}. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dragEnter(DragSourceDragEvent dsde) { DragSourceListener dsl = listener; @@ -375,13 +375,13 @@ public class DragSourceContext } /** - * Calls dragOver on the - * DragSourceListeners registered with this - * DragSourceContext and with the associated - * DragSource, and passes them the specified - * DragSourceDragEvent. + * Calls {@code dragOver} on the + * {@code DragSourceListener}s registered with this + * {@code DragSourceContext} and with the associated + * {@code DragSource}, and passes them the specified + * {@code DragSourceDragEvent}. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dragOver(DragSourceDragEvent dsde) { DragSourceListener dsl = listener; @@ -394,13 +394,13 @@ public class DragSourceContext } /** - * Calls dragExit on the - * DragSourceListeners registered with this - * DragSourceContext and with the associated - * DragSource, and passes them the specified - * DragSourceEvent. + * Calls {@code dragExit} on the + * {@code DragSourceListener}s registered with this + * {@code DragSourceContext} and with the associated + * {@code DragSource}, and passes them the specified + * {@code DragSourceEvent}. * - * @param dse the DragSourceEvent + * @param dse the {@code DragSourceEvent} */ public void dragExit(DragSourceEvent dse) { DragSourceListener dsl = listener; @@ -413,13 +413,13 @@ public class DragSourceContext } /** - * Calls dropActionChanged on the - * DragSourceListeners registered with this - * DragSourceContext and with the associated - * DragSource, and passes them the specified - * DragSourceDragEvent. + * Calls {@code dropActionChanged} on the + * {@code DragSourceListener}s registered with this + * {@code DragSourceContext} and with the associated + * {@code DragSource}, and passes them the specified + * {@code DragSourceDragEvent}. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dropActionChanged(DragSourceDragEvent dsde) { DragSourceListener dsl = listener; @@ -432,13 +432,13 @@ public class DragSourceContext } /** - * Calls dragDropEnd on the - * DragSourceListeners registered with this - * DragSourceContext and with the associated - * DragSource, and passes them the specified - * DragSourceDropEvent. + * Calls {@code dragDropEnd} on the + * {@code DragSourceListener}s registered with this + * {@code DragSourceContext} and with the associated + * {@code DragSource}, and passes them the specified + * {@code DragSourceDropEvent}. * - * @param dsde the DragSourceDropEvent + * @param dsde the {@code DragSourceDropEvent} */ public void dragDropEnd(DragSourceDropEvent dsde) { DragSourceListener dsl = listener; @@ -449,13 +449,13 @@ public class DragSourceContext } /** - * Calls dragMouseMoved on the - * DragSourceMotionListeners registered with the - * DragSource associated with this - * DragSourceContext, and them passes the specified - * DragSourceDragEvent. + * Calls {@code dragMouseMoved} on the + * {@code DragSourceMotionListener}s registered with the + * {@code DragSource} associated with this + * {@code DragSourceContext}, and them passes the specified + * {@code DragSourceDragEvent}. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} * @since 1.4 */ public void dragMouseMoved(DragSourceDragEvent dsde) { @@ -463,10 +463,10 @@ public class DragSourceContext } /** - * Returns the Transferable associated with - * this DragSourceContext. + * Returns the {@code Transferable} associated with + * this {@code DragSourceContext}. * - * @return the Transferable + * @return the {@code Transferable} */ public Transferable getTransferable() { return transferable; } @@ -478,9 +478,9 @@ public class DragSourceContext * * @param sourceAct the actions supported by the drag source * @param targetAct the drop target action - * @param status one of the fields DEFAULT, - * ENTER, OVER, - * CHANGED + * @param status one of the fields {@code DEFAULT}, + * {@code ENTER}, {@code OVER}, + * {@code CHANGED} */ @SuppressWarnings("fallthrough") protected synchronized void updateCurrentCursor(int sourceAct, int targetAct, int status) { @@ -532,21 +532,21 @@ public class DragSourceContext } /** - * Serializes this DragSourceContext. This method first + * Serializes this {@code DragSourceContext}. This method first * performs default serialization. Next, this object's - * Transferable is written out if and only if it can be - * serialized. If not, null is written instead. In this case, - * a DragSourceContext created from the resulting deserialized - * stream will contain a dummy Transferable which supports no - * DataFlavors. Finally, this object's - * DragSourceListener is written out if and only if it can be - * serialized. If not, null is written instead. + * {@code Transferable} is written out if and only if it can be + * serialized. If not, {@code null} is written instead. In this case, + * a {@code DragSourceContext} created from the resulting deserialized + * stream will contain a dummy {@code Transferable} which supports no + * {@code DataFlavor}s. Finally, this object's + * {@code DragSourceListener} is written out if and only if it can be + * serialized. If not, {@code null} is written instead. * * @serialData The default serializable fields, in alphabetical order, - * followed by either a Transferable instance, or - * null, followed by either a - * DragSourceListener instance, or - * null. + * followed by either a {@code Transferable} instance, or + * {@code null}, followed by either a + * {@code DragSourceListener} instance, or + * {@code null}. * @since 1.4 */ private void writeObject(ObjectOutputStream s) throws IOException { @@ -559,14 +559,14 @@ public class DragSourceContext } /** - * Deserializes this DragSourceContext. This method first - * performs default deserialization for all non-transient - * fields. This object's Transferable and - * DragSourceListener are then deserialized as well by using + * Deserializes this {@code DragSourceContext}. This method first + * performs default deserialization for all non-{@code transient} + * fields. This object's {@code Transferable} and + * {@code DragSourceListener} are then deserialized as well by using * the next two objects in the stream. If the resulting - * Transferable is null, this object's - * Transferable is set to a dummy Transferable - * which supports no DataFlavors. + * {@code Transferable} is {@code null}, this object's + * {@code Transferable} is set to a dummy {@code Transferable} + * which supports no {@code DataFlavor}s. * * @since 1.4 */ @@ -654,7 +654,7 @@ public class DragSourceContext private transient DragSourceListener listener; /** - * true if the custom drag cursor is used instead of the + * {@code true} if the custom drag cursor is used instead of the * default one. * * @serial @@ -662,9 +662,9 @@ public class DragSourceContext private boolean useCustomCursor; /** - * A bitwise mask of DnDConstants that represents the set of + * A bitwise mask of {@code DnDConstants} that represents the set of * drop actions supported by the drag source for the drag operation associated - * with this DragSourceContext. + * with this {@code DragSourceContext.} * * @serial */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDragEvent.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDragEvent.java index 63e60d92a20..b8d89d2b575 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDragEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDragEvent.java @@ -28,19 +28,19 @@ package java.awt.dnd; import java.awt.event.InputEvent; /** - * The DragSourceDragEvent is - * delivered from the DragSourceContextPeer, - * via the DragSourceContext, to the DragSourceListener - * registered with that DragSourceContext and with its associated - * DragSource. + * The {@code DragSourceDragEvent} is + * delivered from the {@code DragSourceContextPeer}, + * via the {@code DragSourceContext}, to the {@code DragSourceListener} + * registered with that {@code DragSourceContext} and with its associated + * {@code DragSource}. *

      - * The DragSourceDragEvent reports the target drop action + * The {@code DragSourceDragEvent} reports the target drop action * and the user drop action that reflect the current state of * the drag operation. *

      - * Target drop action is one of DnDConstants that represents + * Target drop action is one of {@code DnDConstants} that represents * the drop action selected by the current drop target if this drop action is - * supported by the drag source or DnDConstants.ACTION_NONE if this + * supported by the drag source or {@code DnDConstants.ACTION_NONE} if this * drop action is not supported by the drag source. *

      * User drop action depends on the drop actions supported by the drag @@ -52,18 +52,18 @@ import java.awt.event.InputEvent; * Shift -> ACTION_MOVE * * If the user selects a drop action, the user drop action is one of - * DnDConstants that represents the selected drop action if this + * {@code DnDConstants} that represents the selected drop action if this * drop action is supported by the drag source or - * DnDConstants.ACTION_NONE if this drop action is not supported + * {@code DnDConstants.ACTION_NONE} if this drop action is not supported * by the drag source. *

      * If the user doesn't select a drop action, the set of - * DnDConstants that represents the set of drop actions supported - * by the drag source is searched for DnDConstants.ACTION_MOVE, - * then for DnDConstants.ACTION_COPY, then for - * DnDConstants.ACTION_LINK and the user drop action is the + * {@code DnDConstants} that represents the set of drop actions supported + * by the drag source is searched for {@code DnDConstants.ACTION_MOVE}, + * then for {@code DnDConstants.ACTION_COPY}, then for + * {@code DnDConstants.ACTION_LINK} and the user drop action is the * first constant found. If no constant is found the user drop action - * is DnDConstants.ACTION_NONE. + * is {@code DnDConstants.ACTION_NONE}. * * @since 1.2 * @@ -74,25 +74,25 @@ public class DragSourceDragEvent extends DragSourceEvent { private static final long serialVersionUID = 481346297933902471L; /** - * Constructs a DragSourceDragEvent. + * Constructs a {@code DragSourceDragEvent}. * This class is typically - * instantiated by the DragSourceContextPeer + * instantiated by the {@code DragSourceContextPeer} * rather than directly * by client code. - * The coordinates for this DragSourceDragEvent - * are not specified, so getLocation will return - * null for this event. + * The coordinates for this {@code DragSourceDragEvent} + * are not specified, so {@code getLocation} will return + * {@code null} for this event. *

      - * The arguments dropAction and action should - * be one of DnDConstants that represents a single action. - * The argument modifiers should be either a bitwise mask - * of old java.awt.event.InputEvent.*_MASK constants or a - * bitwise mask of extended java.awt.event.InputEvent.*_DOWN_MASK + * The arguments {@code dropAction} and {@code action} should + * be one of {@code DnDConstants} that represents a single action. + * The argument {@code modifiers} should be either a bitwise mask + * of old {@code java.awt.event.InputEvent.*_MASK} constants or a + * bitwise mask of extended {@code java.awt.event.InputEvent.*_DOWN_MASK} * constants. - * This constructor does not throw any exception for invalid dropAction, - * action and modifiers. + * This constructor does not throw any exception for invalid {@code dropAction}, + * {@code action} and {@code modifiers}. * - * @param dsc the DragSourceContext that is to manage + * @param dsc the {@code DragSourceContext} that is to manage * notifications for this event. * @param dropAction the user drop action. * @param action the target drop action. @@ -103,7 +103,7 @@ public class DragSourceDragEvent extends DragSourceEvent { * in one event. Use of the extended modifiers is * preferred. * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if {@code dsc} is {@code null}. * * @see java.awt.event.InputEvent * @see DragSourceEvent#getLocation @@ -128,20 +128,20 @@ public class DragSourceDragEvent extends DragSourceEvent { } /** - * Constructs a DragSourceDragEvent given the specified - * DragSourceContext, user drop action, target drop action, + * Constructs a {@code DragSourceDragEvent} given the specified + * {@code DragSourceContext}, user drop action, target drop action, * modifiers and coordinates. *

      - * The arguments dropAction and action should - * be one of DnDConstants that represents a single action. - * The argument modifiers should be either a bitwise mask - * of old java.awt.event.InputEvent.*_MASK constants or a - * bitwise mask of extended java.awt.event.InputEvent.*_DOWN_MASK + * The arguments {@code dropAction} and {@code action} should + * be one of {@code DnDConstants} that represents a single action. + * The argument {@code modifiers} should be either a bitwise mask + * of old {@code java.awt.event.InputEvent.*_MASK} constants or a + * bitwise mask of extended {@code java.awt.event.InputEvent.*_DOWN_MASK} * constants. - * This constructor does not throw any exception for invalid dropAction, - * action and modifiers. + * This constructor does not throw any exception for invalid {@code dropAction}, + * {@code action} and {@code modifiers}. * - * @param dsc the DragSourceContext associated with this + * @param dsc the {@code DragSourceContext} associated with this * event. * @param dropAction the user drop action. * @param action the target drop action. @@ -154,7 +154,7 @@ public class DragSourceDragEvent extends DragSourceEvent { * @param x the horizontal coordinate for the cursor location * @param y the vertical coordinate for the cursor location * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if {@code dsc} is {@code null}. * * @see java.awt.event.InputEvent * @since 1.4 @@ -192,12 +192,12 @@ public class DragSourceDragEvent extends DragSourceEvent { ((InputEvent.ALT_GRAPH_DOWN_MASK << 1) - 1) & ~JDK_1_3_MODIFIERS; /** - * This method returns an int representing + * This method returns an {@code int} representing * the current state of the input device modifiers * associated with the user's gesture. Typically these * would be mouse buttons or keyboard modifiers. *

      - * If the modifiers passed to the constructor + * If the {@code modifiers} passed to the constructor * are invalid, this method returns them unchanged. * * @return the current state of the input device modifiers @@ -208,12 +208,12 @@ public class DragSourceDragEvent extends DragSourceEvent { } /** - * This method returns an int representing + * This method returns an {@code int} representing * the current state of the input device extended modifiers * associated with the user's gesture. * See {@link InputEvent#getModifiersEx} *

      - * If the modifiers passed to the constructor + * If the {@code modifiers} passed to the constructor * are invalid, this method returns them unchanged. * * @return the current state of the input device extended modifiers @@ -270,7 +270,7 @@ public class DragSourceDragEvent extends DragSourceEvent { private int gestureModifiers = 0; /** - * Indicates whether the gestureModifiers are invalid. + * Indicates whether the {@code gestureModifiers} are invalid. * * @serial */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDropEvent.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDropEvent.java index f31e3d233dc..84317613ddc 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDropEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDropEvent.java @@ -26,12 +26,12 @@ package java.awt.dnd; /** - * The DragSourceDropEvent is delivered - * from the DragSourceContextPeer, - * via the DragSourceContext, to the dragDropEnd - * method of DragSourceListeners registered with that - * DragSourceContext and with its associated - * DragSource. + * The {@code DragSourceDropEvent} is delivered + * from the {@code DragSourceContextPeer}, + * via the {@code DragSourceContext}, to the {@code dragDropEnd} + * method of {@code DragSourceListener}s registered with that + * {@code DragSourceContext} and with its associated + * {@code DragSource}. * It contains sufficient information for the * originator of the operation * to provide appropriate feedback to the end user @@ -45,24 +45,24 @@ public class DragSourceDropEvent extends DragSourceEvent { private static final long serialVersionUID = -5571321229470821891L; /** - * Construct a DragSourceDropEvent for a drop, + * Construct a {@code DragSourceDropEvent} for a drop, * given the - * DragSourceContext, the drop action, - * and a boolean indicating if the drop was successful. - * The coordinates for this DragSourceDropEvent - * are not specified, so getLocation will return - * null for this event. + * {@code DragSourceContext}, the drop action, + * and a {@code boolean} indicating if the drop was successful. + * The coordinates for this {@code DragSourceDropEvent} + * are not specified, so {@code getLocation} will return + * {@code null} for this event. *

      - * The argument action should be one of DnDConstants + * The argument {@code action} should be one of {@code DnDConstants} * that represents a single action. - * This constructor does not throw any exception for invalid action. + * This constructor does not throw any exception for invalid {@code action}. * - * @param dsc the DragSourceContext - * associated with this DragSourceDropEvent + * @param dsc the {@code DragSourceContext} + * associated with this {@code DragSourceDropEvent} * @param action the drop action * @param success a boolean indicating if the drop was successful * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if {@code dsc} is {@code null}. * * @see DragSourceEvent#getLocation */ @@ -75,22 +75,22 @@ public class DragSourceDropEvent extends DragSourceEvent { } /** - * Construct a DragSourceDropEvent for a drop, given the - * DragSourceContext, the drop action, a boolean + * Construct a {@code DragSourceDropEvent} for a drop, given the + * {@code DragSourceContext}, the drop action, a {@code boolean} * indicating if the drop was successful, and coordinates. *

      - * The argument action should be one of DnDConstants + * The argument {@code action} should be one of {@code DnDConstants} * that represents a single action. - * This constructor does not throw any exception for invalid action. + * This constructor does not throw any exception for invalid {@code action}. * - * @param dsc the DragSourceContext - * associated with this DragSourceDropEvent + * @param dsc the {@code DragSourceContext} + * associated with this {@code DragSourceDropEvent} * @param action the drop action * @param success a boolean indicating if the drop was successful * @param x the horizontal coordinate for the cursor location * @param y the vertical coordinate for the cursor location * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if {@code dsc} is {@code null}. * * @since 1.4 */ @@ -103,15 +103,15 @@ public class DragSourceDropEvent extends DragSourceEvent { } /** - * Construct a DragSourceDropEvent + * Construct a {@code DragSourceDropEvent} * for a drag that does not result in a drop. - * The coordinates for this DragSourceDropEvent - * are not specified, so getLocation will return - * null for this event. + * The coordinates for this {@code DragSourceDropEvent} + * are not specified, so {@code getLocation} will return + * {@code null} for this event. * - * @param dsc the DragSourceContext + * @param dsc the {@code DragSourceContext} * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if {@code dsc} is {@code null}. * * @see DragSourceEvent#getLocation */ @@ -123,12 +123,12 @@ public class DragSourceDropEvent extends DragSourceEvent { } /** - * This method returns a boolean indicating + * This method returns a {@code boolean} indicating * if the drop was successful. * - * @return true if the drop target accepted the drop and + * @return {@code true} if the drop target accepted the drop and * successfully performed a drop action; - * false if the drop target rejected the drop or + * {@code false} if the drop target rejected the drop or * if the drop target accepted the drop, but failed to perform * a drop action. */ @@ -136,13 +136,13 @@ public class DragSourceDropEvent extends DragSourceEvent { public boolean getDropSuccess() { return dropSuccess; } /** - * This method returns an int representing + * This method returns an {@code int} representing * the action performed by the target on the subject of the drop. * * @return the action performed by the target on the subject of the drop * if the drop target accepted the drop and the target drop action * is supported by the drag source; otherwise, - * DnDConstants.ACTION_NONE. + * {@code DnDConstants.ACTION_NONE}. */ public int getDropAction() { return dropAction; } @@ -152,7 +152,7 @@ public class DragSourceDropEvent extends DragSourceEvent { */ /** - * true if the drop was successful. + * {@code true} if the drop was successful. * * @serial */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceEvent.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceEvent.java index b9f55e15170..5a389b0dd08 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceEvent.java @@ -31,23 +31,23 @@ import java.util.EventObject; /** * This class is the base class for - * DragSourceDragEvent and - * DragSourceDropEvent. + * {@code DragSourceDragEvent} and + * {@code DragSourceDropEvent}. *

      - * DragSourceEvents are generated whenever the drag enters, moves + * {@code DragSourceEvent}s are generated whenever the drag enters, moves * over, or exits a drop site, when the drop action changes, and when the drag - * ends. The location for the generated DragSourceEvent specifies + * ends. The location for the generated {@code DragSourceEvent} specifies * the mouse cursor location in screen coordinates at the moment this event * occurred. *

      * In a multi-screen environment without a virtual device, the cursor location is * specified in the coordinate system of the initiator - * GraphicsConfiguration. The initiator - * GraphicsConfiguration is the GraphicsConfiguration - * of the Component on which the drag gesture for the current drag + * {@code GraphicsConfiguration}. The initiator + * {@code GraphicsConfiguration} is the {@code GraphicsConfiguration} + * of the {@code Component} on which the drag gesture for the current drag * operation was recognized. If the cursor location is outside the bounds of - * the initiator GraphicsConfiguration, the reported coordinates are - * clipped to fit within the bounds of that GraphicsConfiguration. + * the initiator {@code GraphicsConfiguration}, the reported coordinates are + * clipped to fit within the bounds of that {@code GraphicsConfiguration}. *

      * In a multi-screen environment with a virtual device, the location is specified * in the corresponding virtual coordinate system. If the cursor location is @@ -62,7 +62,7 @@ public class DragSourceEvent extends EventObject { private static final long serialVersionUID = -763287114604032641L; /** - * The boolean indicating whether the cursor location + * The {@code boolean} indicating whether the cursor location * is specified for this event. * * @serial @@ -88,15 +88,15 @@ public class DragSourceEvent extends EventObject { private final int y; /** - * Construct a DragSourceEvent - * given a specified DragSourceContext. - * The coordinates for this DragSourceEvent - * are not specified, so getLocation will return - * null for this event. + * Construct a {@code DragSourceEvent} + * given a specified {@code DragSourceContext}. + * The coordinates for this {@code DragSourceEvent} + * are not specified, so {@code getLocation} will return + * {@code null} for this event. * - * @param dsc the DragSourceContext + * @param dsc the {@code DragSourceContext} * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if {@code dsc} is {@code null}. * * @see #getLocation */ @@ -109,15 +109,15 @@ public class DragSourceEvent extends EventObject { } /** - * Construct a DragSourceEvent given a specified - * DragSourceContext, and coordinates of the cursor + * Construct a {@code DragSourceEvent} given a specified + * {@code DragSourceContext}, and coordinates of the cursor * location. * - * @param dsc the DragSourceContext + * @param dsc the {@code DragSourceContext} * @param x the horizontal coordinate for the cursor location * @param y the vertical coordinate for the cursor location * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if {@code dsc} is {@code null}. * * @since 1.4 */ @@ -129,10 +129,10 @@ public class DragSourceEvent extends EventObject { } /** - * This method returns the DragSourceContext that + * This method returns the {@code DragSourceContext} that * originated the event. * - * @return the DragSourceContext that originated the event + * @return the {@code DragSourceContext} that originated the event */ public DragSourceContext getDragSourceContext() { @@ -140,13 +140,13 @@ public class DragSourceEvent extends EventObject { } /** - * This method returns a Point indicating the cursor + * This method returns a {@code Point} indicating the cursor * location in screen coordinates at the moment this event occurred, or - * null if the cursor location is not specified for this + * {@code null} if the cursor location is not specified for this * event. * - * @return the Point indicating the cursor location - * or null if the cursor location is not specified + * @return the {@code Point} indicating the cursor location + * or {@code null} if the cursor location is not specified * @since 1.4 */ public Point getLocation() { diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceListener.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceListener.java index e568b6a5ad7..dc3122f1607 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceListener.java @@ -28,19 +28,19 @@ package java.awt.dnd; import java.util.EventListener; /** - * The DragSourceListener defines the + * The {@code DragSourceListener} defines the * event interface for originators of * Drag and Drop operations to track the state of the user's gesture, and to * provide appropriate "drag over" * feedback to the user throughout the * Drag and Drop operation. *

      - * The drop site is associated with the previous dragEnter() - * invocation if the latest invocation of dragEnter() on this + * The drop site is associated with the previous {@code dragEnter()} + * invocation if the latest invocation of {@code dragEnter()} on this * listener: *

        *
      • corresponds to that drop site and - *
      • is not followed by a dragExit() invocation on this listener. + *
      • is not followed by a {@code dragExit()} invocation on this listener. *
      * * @since 1.2 @@ -58,7 +58,7 @@ public interface DragSourceListener extends EventListener { *
    3. The drop site accepts the drag. * * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ void dragEnter(DragSourceDragEvent dsde); @@ -73,7 +73,7 @@ public interface DragSourceListener extends EventListener { *
    4. The drop site accepts the drag. * * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ void dragOver(DragSourceDragEvent dsde); @@ -84,7 +84,7 @@ public interface DragSourceListener extends EventListener { * Such devices are typically the mouse buttons or keyboard * modifiers that the user is interacting with. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ void dropActionChanged(DragSourceDragEvent dsde); @@ -106,21 +106,21 @@ public interface DragSourceListener extends EventListener { * has rejected the drag. * * - * @param dse the DragSourceEvent + * @param dse the {@code DragSourceEvent} */ void dragExit(DragSourceEvent dse); /** * This method is invoked to signify that the Drag and Drop * operation is complete. The getDropSuccess() method of - * the DragSourceDropEvent can be used to + * the {@code DragSourceDropEvent} can be used to * determine the termination state. The getDropAction() method * returns the operation that the drop site selected * to apply to the Drop operation. Once this method is complete, the - * current DragSourceContext and + * current {@code DragSourceContext} and * associated resources become invalid. * - * @param dsde the DragSourceDropEvent + * @param dsde the {@code DragSourceDropEvent} */ void dragDropEnd(DragSourceDropEvent dsde); } diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceMotionListener.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceMotionListener.java index 92bf6e12807..95bde275d2a 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceMotionListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceMotionListener.java @@ -33,14 +33,14 @@ import java.util.EventListener; *

      * The class that is interested in processing mouse motion events during * a drag operation either implements this interface or extends the abstract - * DragSourceAdapter class (overriding only the methods of + * {@code DragSourceAdapter} class (overriding only the methods of * interest). *

      * Create a listener object using that class and then register it with - * a DragSource. Whenever the mouse moves during a drag - * operation initiated with this DragSource, that object's - * dragMouseMoved method is invoked, and the - * DragSourceDragEvent is passed to it. + * a {@code DragSource}. Whenever the mouse moves during a drag + * operation initiated with this {@code DragSource}, that object's + * {@code dragMouseMoved} method is invoked, and the + * {@code DragSourceDragEvent} is passed to it. * * @see DragSourceDragEvent * @see DragSource @@ -55,7 +55,7 @@ public interface DragSourceMotionListener extends EventListener { /** * Called whenever the mouse is moved during a drag operation. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ void dragMouseMoved(DragSourceDragEvent dsde); } diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTarget.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTarget.java index 6fbb8cad8b4..bd8e54e1f34 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTarget.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTarget.java @@ -54,15 +54,15 @@ import sun.awt.AWTAccessor.ComponentAccessor; /** - * The DropTarget is associated - * with a Component when that Component + * The {@code DropTarget} is associated + * with a {@code Component} when that {@code Component} * wishes * to accept drops during Drag and Drop operations. *

      * Each - * DropTarget is associated with a FlavorMap. - * The default FlavorMap hereafter designates the - * FlavorMap returned by SystemFlavorMap.getDefaultFlavorMap(). + * {@code DropTarget} is associated with a {@code FlavorMap}. + * The default {@code FlavorMap} hereafter designates the + * {@code FlavorMap} returned by {@code SystemFlavorMap.getDefaultFlavorMap()}. * * @since 1.2 */ @@ -72,20 +72,20 @@ public class DropTarget implements DropTargetListener, Serializable { private static final long serialVersionUID = -6283860791671019047L; /** - * Creates a new DropTarget given the Component - * to associate itself with, an int representing + * Creates a new DropTarget given the {@code Component} + * to associate itself with, an {@code int} representing * the default acceptable action(s) to - * support, a DropTargetListener - * to handle event processing, a boolean indicating - * if the DropTarget is currently accepting drops, and - * a FlavorMap to use (or null for the default FlavorMap). + * support, a {@code DropTargetListener} + * to handle event processing, a {@code boolean} indicating + * if the {@code DropTarget} is currently accepting drops, and + * a {@code FlavorMap} to use (or null for the default {@code FlavorMap}). *

      * The Component will receive drops only if it is enabled. - * @param c The Component with which this DropTarget is associated - * @param ops The default acceptable actions for this DropTarget - * @param dtl The DropTargetListener for this DropTarget - * @param act Is the DropTarget accepting drops. - * @param fm The FlavorMap to use, or null for the default FlavorMap + * @param c The {@code Component} with which this {@code DropTarget} is associated + * @param ops The default acceptable actions for this {@code DropTarget} + * @param dtl The {@code DropTargetListener} for this {@code DropTarget} + * @param act Is the {@code DropTarget} accepting drops. + * @param fm The {@code FlavorMap} to use, or null for the default {@code FlavorMap} * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless @@ -121,18 +121,18 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Creates a DropTarget given the Component - * to associate itself with, an int representing + * Creates a {@code DropTarget} given the {@code Component} + * to associate itself with, an {@code int} representing * the default acceptable action(s) - * to support, a DropTargetListener - * to handle event processing, and a boolean indicating - * if the DropTarget is currently accepting drops. + * to support, a {@code DropTargetListener} + * to handle event processing, and a {@code boolean} indicating + * if the {@code DropTarget} is currently accepting drops. *

      * The Component will receive drops only if it is enabled. - * @param c The Component with which this DropTarget is associated - * @param ops The default acceptable actions for this DropTarget - * @param dtl The DropTargetListener for this DropTarget - * @param act Is the DropTarget accepting drops. + * @param c The {@code Component} with which this {@code DropTarget} is associated + * @param ops The default acceptable actions for this {@code DropTarget} + * @param dtl The {@code DropTargetListener} for this {@code DropTarget} + * @param act Is the {@code DropTarget} accepting drops. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless @@ -145,7 +145,7 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Creates a DropTarget. + * Creates a {@code DropTarget}. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless @@ -155,13 +155,13 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Creates a DropTarget given the Component - * to associate itself with, and the DropTargetListener + * Creates a {@code DropTarget} given the {@code Component} + * to associate itself with, and the {@code DropTargetListener} * to handle event processing. *

      * The Component will receive drops only if it is enabled. - * @param c The Component with which this DropTarget is associated - * @param dtl The DropTargetListener for this DropTarget + * @param c The {@code Component} with which this {@code DropTarget} is associated + * @param dtl The {@code DropTargetListener} for this {@code DropTarget} * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless @@ -173,15 +173,15 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Creates a DropTarget given the Component - * to associate itself with, an int representing + * Creates a {@code DropTarget} given the {@code Component} + * to associate itself with, an {@code int} representing * the default acceptable action(s) to support, and a - * DropTargetListener to handle event processing. + * {@code DropTargetListener} to handle event processing. *

      * The Component will receive drops only if it is enabled. - * @param c The Component with which this DropTarget is associated - * @param ops The default acceptable actions for this DropTarget - * @param dtl The DropTargetListener for this DropTarget + * @param c The {@code Component} with which this {@code DropTarget} is associated + * @param ops The default acceptable actions for this {@code DropTarget} + * @param dtl The {@code DropTargetListener} for this {@code DropTarget} * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless @@ -195,11 +195,11 @@ public class DropTarget implements DropTargetListener, Serializable { /** * Note: this interface is required to permit the safe association * of a DropTarget with a Component in one of two ways, either: - * component.setDropTarget(droptarget); - * or droptarget.setComponent(component); + * {@code component.setDropTarget(droptarget);} + * or {@code droptarget.setComponent(component);} *

      * The Component will receive drops only if it is enabled. - * @param c The new Component this DropTarget + * @param c The new {@code Component} this {@code DropTarget} * is to be associated with. */ @@ -229,10 +229,10 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Gets the Component associated - * with this DropTarget. + * Gets the {@code Component} associated + * with this {@code DropTarget}. * - * @return the current Component + * @return the current {@code Component} */ public synchronized Component getComponent() { @@ -240,7 +240,7 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Sets the default acceptable actions for this DropTarget + * Sets the default acceptable actions for this {@code DropTarget} * * @param ops the default actions * @see java.awt.dnd.DnDConstants @@ -259,8 +259,8 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Gets an int representing the - * current action(s) supported by this DropTarget. + * Gets an {@code int} representing the + * current action(s) supported by this {@code DropTarget}. * * @return the current default actions */ @@ -270,10 +270,10 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Sets the DropTarget active if true, - * inactive if false. + * Sets the DropTarget active if {@code true}, + * inactive if {@code false}. * - * @param isActive sets the DropTarget (in)active. + * @param isActive sets the {@code DropTarget} (in)active. */ public synchronized void setActive(boolean isActive) { @@ -286,10 +286,10 @@ public class DropTarget implements DropTargetListener, Serializable { /** * Reports whether or not - * this DropTarget + * this {@code DropTarget} * is currently active (ready to accept drops). * - * @return true if active, false if not + * @return {@code true} if active, {@code false} if not */ public boolean isActive() { @@ -297,13 +297,13 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Adds a new DropTargetListener (UNICAST SOURCE). + * Adds a new {@code DropTargetListener} (UNICAST SOURCE). * - * @param dtl The new DropTargetListener + * @param dtl The new {@code DropTargetListener} * * @throws TooManyListenersException if a - * DropTargetListener is already added to this - * DropTarget. + * {@code DropTargetListener} is already added to this + * {@code DropTarget}. */ public synchronized void addDropTargetListener(DropTargetListener dtl) throws TooManyListenersException { @@ -318,7 +318,7 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Removes the current DropTargetListener (UNICAST SOURCE). + * Removes the current {@code DropTargetListener} (UNICAST SOURCE). * * @param dtl the DropTargetListener to deregister. */ @@ -333,16 +333,16 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Calls dragEnter on the registered - * DropTargetListener and passes it - * the specified DropTargetDragEvent. - * Has no effect if this DropTarget + * Calls {@code dragEnter} on the registered + * {@code DropTargetListener} and passes it + * the specified {@code DropTargetDragEvent}. + * Has no effect if this {@code DropTarget} * is not active. * - * @param dtde the DropTargetDragEvent + * @param dtde the {@code DropTargetDragEvent} * - * @throws NullPointerException if this DropTarget - * is active and dtde is null + * @throws NullPointerException if this {@code DropTarget} + * is active and {@code dtde} is {@code null} * * @see #isActive */ @@ -360,16 +360,16 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Calls dragOver on the registered - * DropTargetListener and passes it - * the specified DropTargetDragEvent. - * Has no effect if this DropTarget + * Calls {@code dragOver} on the registered + * {@code DropTargetListener} and passes it + * the specified {@code DropTargetDragEvent}. + * Has no effect if this {@code DropTarget} * is not active. * - * @param dtde the DropTargetDragEvent + * @param dtde the {@code DropTargetDragEvent} * - * @throws NullPointerException if this DropTarget - * is active and dtde is null + * @throws NullPointerException if this {@code DropTarget} + * is active and {@code dtde} is {@code null} * * @see #isActive */ @@ -382,16 +382,16 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Calls dropActionChanged on the registered - * DropTargetListener and passes it - * the specified DropTargetDragEvent. - * Has no effect if this DropTarget + * Calls {@code dropActionChanged} on the registered + * {@code DropTargetListener} and passes it + * the specified {@code DropTargetDragEvent}. + * Has no effect if this {@code DropTarget} * is not active. * - * @param dtde the DropTargetDragEvent + * @param dtde the {@code DropTargetDragEvent} * - * @throws NullPointerException if this DropTarget - * is active and dtde is null + * @throws NullPointerException if this {@code DropTarget} + * is active and {@code dtde} is {@code null} * * @see #isActive */ @@ -404,17 +404,17 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Calls dragExit on the registered - * DropTargetListener and passes it - * the specified DropTargetEvent. - * Has no effect if this DropTarget + * Calls {@code dragExit} on the registered + * {@code DropTargetListener} and passes it + * the specified {@code DropTargetEvent}. + * Has no effect if this {@code DropTarget} * is not active. *

      * This method itself does not throw any exception * for null parameter but for exceptions thrown by * the respective method of the listener. * - * @param dte the DropTargetEvent + * @param dte the {@code DropTargetEvent} * * @see #isActive */ @@ -429,17 +429,17 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Calls drop on the registered - * DropTargetListener and passes it - * the specified DropTargetDropEvent - * if this DropTarget is active. + * Calls {@code drop} on the registered + * {@code DropTargetListener} and passes it + * the specified {@code DropTargetDropEvent} + * if this {@code DropTarget} is active. * - * @param dtde the DropTargetDropEvent + * @param dtde the {@code DropTargetDropEvent} * - * @throws NullPointerException if dtde is null + * @throws NullPointerException if {@code dtde} is null * and at least one of the following is true: this - * DropTarget is not active, or there is - * no a DropTargetListener registered. + * {@code DropTarget} is not active, or there is + * no a {@code DropTargetListener} registered. * * @see #isActive */ @@ -456,11 +456,11 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Gets the FlavorMap - * associated with this DropTarget. - * If no FlavorMap has been set for this - * DropTarget, it is associated with the default - * FlavorMap. + * Gets the {@code FlavorMap} + * associated with this {@code DropTarget}. + * If no {@code FlavorMap} has been set for this + * {@code DropTarget}, it is associated with the default + * {@code FlavorMap}. * * @return the FlavorMap for this DropTarget */ @@ -468,10 +468,10 @@ public class DropTarget implements DropTargetListener, Serializable { public FlavorMap getFlavorMap() { return flavorMap; } /** - * Sets the FlavorMap associated - * with this DropTarget. + * Sets the {@code FlavorMap} associated + * with this {@code DropTarget}. * - * @param fm the new FlavorMap, or null to + * @param fm the new {@code FlavorMap}, or null to * associate the default FlavorMap with this DropTarget. */ @@ -544,10 +544,10 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Gets the DropTargetContext associated - * with this DropTarget. + * Gets the {@code DropTargetContext} associated + * with this {@code DropTarget}. * - * @return the DropTargetContext associated with this DropTarget. + * @return the {@code DropTargetContext} associated with this {@code DropTarget}. */ public DropTargetContext getDropTargetContext() { @@ -571,14 +571,14 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Serializes this DropTarget. Performs default serialization, - * and then writes out this object's DropTargetListener if and - * only if it can be serialized. If not, null is written + * Serializes this {@code DropTarget}. Performs default serialization, + * and then writes out this object's {@code DropTargetListener} if and + * only if it can be serialized. If not, {@code null} is written * instead. * * @serialData The default serializable fields, in alphabetical order, - * followed by either a DropTargetListener - * instance, or null. + * followed by either a {@code DropTargetListener} + * instance, or {@code null}. * @since 1.4 */ private void writeObject(ObjectOutputStream s) throws IOException { @@ -589,13 +589,13 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Deserializes this DropTarget. This method first performs - * default deserialization for all non-transient fields. An + * Deserializes this {@code DropTarget}. This method first performs + * default deserialization for all non-{@code transient} fields. An * attempt is then made to deserialize this object's - * DropTargetListener as well. This is first attempted by - * deserializing the field dtListener, because, in releases - * prior to 1.4, a non-transient field of this name stored the - * DropTargetListener. If this fails, the next object in the + * {@code DropTargetListener} as well. This is first attempted by + * deserializing the field {@code dtListener}, because, in releases + * prior to 1.4, a non-{@code transient} field of this name stored the + * {@code DropTargetListener}. If this fails, the next object in the * stream is used instead. * * @since 1.4 @@ -639,8 +639,8 @@ public class DropTarget implements DropTargetListener, Serializable { /** * construct a DropTargetAutoScroller * - * @param c the Component - * @param p the Point + * @param c the {@code Component} + * @param p the {@code Point} */ protected DropTargetAutoScroller(Component c, Point p) { @@ -709,7 +709,7 @@ public class DropTarget implements DropTargetListener, Serializable { /** * cause autoscroll to occur * - * @param newLocn the Point + * @param newLocn the {@code Point} */ protected synchronized void updateLocation(Point newLocn) { @@ -733,7 +733,7 @@ public class DropTarget implements DropTargetListener, Serializable { /** * cause autoscroll to occur * - * @param e the ActionEvent + * @param e the {@code ActionEvent} */ public synchronized void actionPerformed(ActionEvent e) { @@ -766,8 +766,8 @@ public class DropTarget implements DropTargetListener, Serializable { /** * create an embedded autoscroller * - * @param c the Component - * @param p the Point + * @param c the {@code Component} + * @param p the {@code Point} * @return an embedded autoscroller */ @@ -778,7 +778,7 @@ public class DropTarget implements DropTargetListener, Serializable { /** * initialize autoscrolling * - * @param p the Point + * @param p the {@code Point} */ protected void initializeAutoscrolling(Point p) { @@ -790,7 +790,7 @@ public class DropTarget implements DropTargetListener, Serializable { /** * update autoscrolling with current cursor location * - * @param dragCursorLocn the Point + * @param dragCursorLocn the {@code Point} */ protected void updateAutoscroll(Point dragCursorLocn) { @@ -843,7 +843,7 @@ public class DropTarget implements DropTargetListener, Serializable { int actions = DnDConstants.ACTION_COPY_OR_MOVE; /** - * true if the DropTarget is accepting Drag & Drop operations. + * {@code true} if the DropTarget is accepting Drag & Drop operations. * * @serial */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetAdapter.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetAdapter.java index 2da3bf7eae2..f019ae108a5 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetAdapter.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetAdapter.java @@ -30,39 +30,39 @@ package java.awt.dnd; * this class are empty. This class exists only as a convenience for creating * listener objects. *

      - * Extend this class to create a DropTargetEvent listener + * Extend this class to create a {@code DropTargetEvent} listener * and override the methods for the events of interest. (If you implement the - * DropTargetListener interface, you have to define all of + * {@code DropTargetListener} interface, you have to define all of * the methods in it. This abstract class defines a null implementation for - * every method except drop(DropTargetDropEvent), so you only have + * every method except {@code drop(DropTargetDropEvent)}, so you only have * to define methods for events you care about.) You must provide an - * implementation for at least drop(DropTargetDropEvent). This + * implementation for at least {@code drop(DropTargetDropEvent)}. This * method cannot have a null implementation because its specification requires * that you either accept or reject the drop, and, if accepted, indicate * whether the drop was successful. *

      * Create a listener object using the extended class and then register it with - * a DropTarget. When the drag enters, moves over, or exits - * the operable part of the drop site for that DropTarget, when + * a {@code DropTarget}. When the drag enters, moves over, or exits + * the operable part of the drop site for that {@code DropTarget}, when * the drop action changes, and when the drop occurs, the relevant method in - * the listener object is invoked, and the DropTargetEvent is + * the listener object is invoked, and the {@code DropTargetEvent} is * passed to it. *

      - * The operable part of the drop site for the DropTarget is - * the part of the associated Component's geometry that is not + * The operable part of the drop site for the {@code DropTarget} is + * the part of the associated {@code Component}'s geometry that is not * obscured by an overlapping top-level window or by another - * Component higher in the Z-order that has an associated active - * DropTarget. + * {@code Component} higher in the Z-order that has an associated active + * {@code DropTarget}. *

      * During the drag, the data associated with the current drag operation can be - * retrieved by calling getTransferable() on - * DropTargetDragEvent instances passed to the listener's + * retrieved by calling {@code getTransferable()} on + * {@code DropTargetDragEvent} instances passed to the listener's * methods. *

      - * Note that getTransferable() on the - * DropTargetDragEvent instance should only be called within the + * Note that {@code getTransferable()} on the + * {@code DropTargetDragEvent} instance should only be called within the * respective listener's method and all the necessary data should be retrieved - * from the returned Transferable before that method returns. + * from the returned {@code Transferable} before that method returns. * * @see DropTargetEvent * @see DropTargetListener @@ -74,19 +74,19 @@ public abstract class DropTargetAdapter implements DropTargetListener { /** * Called while a drag operation is ongoing, when the mouse pointer enters - * the operable part of the drop site for the DropTarget + * the operable part of the drop site for the {@code DropTarget} * registered with this listener. * - * @param dtde the DropTargetDragEvent + * @param dtde the {@code DropTargetDragEvent} */ public void dragEnter(DropTargetDragEvent dtde) {} /** * Called when a drag operation is ongoing, while the mouse pointer is still - * over the operable part of the drop site for the DropTarget + * over the operable part of the drop site for the {@code DropTarget} * registered with this listener. * - * @param dtde the DropTargetDragEvent + * @param dtde the {@code DropTargetDragEvent} */ public void dragOver(DropTargetDragEvent dtde) {} @@ -94,16 +94,16 @@ public abstract class DropTargetAdapter implements DropTargetListener { * Called if the user has modified * the current drop gesture. * - * @param dtde the DropTargetDragEvent + * @param dtde the {@code DropTargetDragEvent} */ public void dropActionChanged(DropTargetDragEvent dtde) {} /** * Called while a drag operation is ongoing, when the mouse pointer has * exited the operable part of the drop site for the - * DropTarget registered with this listener. + * {@code DropTarget} registered with this listener. * - * @param dte the DropTargetEvent + * @param dte the {@code DropTargetEvent} */ public void dragExit(DropTargetEvent dte) {} } diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDragEvent.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDragEvent.java index 00639cf9043..9a6b57d450b 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDragEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDragEvent.java @@ -33,15 +33,15 @@ import java.awt.datatransfer.Transferable; import java.util.List; /** - * The DropTargetDragEvent is delivered to a - * DropTargetListener via its + * The {@code DropTargetDragEvent} is delivered to a + * {@code DropTargetListener} via its * dragEnter() and dragOver() methods. *

      - * The DropTargetDragEvent reports the source drop actions + * The {@code DropTargetDragEvent} reports the source drop actions * and the user drop action that reflect the current state of * the drag operation. *

      - * Source drop actions is a bitwise mask of DnDConstants + * Source drop actions is a bitwise mask of {@code DnDConstants} * that represents the set of drop actions supported by the drag source for * this drag operation. *

      @@ -54,18 +54,18 @@ import java.util.List; * Shift -> ACTION_MOVE * * If the user selects a drop action, the user drop action is one of - * DnDConstants that represents the selected drop action if this + * {@code DnDConstants} that represents the selected drop action if this * drop action is supported by the drag source or - * DnDConstants.ACTION_NONE if this drop action is not supported + * {@code DnDConstants.ACTION_NONE} if this drop action is not supported * by the drag source. *

      * If the user doesn't select a drop action, the set of - * DnDConstants that represents the set of drop actions supported - * by the drag source is searched for DnDConstants.ACTION_MOVE, - * then for DnDConstants.ACTION_COPY, then for - * DnDConstants.ACTION_LINK and the user drop action is the + * {@code DnDConstants} that represents the set of drop actions supported + * by the drag source is searched for {@code DnDConstants.ACTION_MOVE}, + * then for {@code DnDConstants.ACTION_COPY}, then for + * {@code DnDConstants.ACTION_LINK} and the user drop action is the * first constant found. If no constant is found the user drop action - * is DnDConstants.ACTION_NONE. + * is {@code DnDConstants.ACTION_NONE}. * * @since 1.2 */ @@ -75,10 +75,10 @@ public class DropTargetDragEvent extends DropTargetEvent { private static final long serialVersionUID = -8422265619058953682L; /** - * Construct a DropTargetDragEvent given the - * DropTargetContext for this operation, - * the location of the "Drag" Cursor's hotspot - * in the Component's coordinates, the + * Construct a {@code DropTargetDragEvent} given the + * {@code DropTargetContext} for this operation, + * the location of the "Drag" {@code Cursor}'s hotspot + * in the {@code Component}'s coordinates, the * user drop action, and the source drop actions. * * @param dtc The DropTargetContext for this operation @@ -89,10 +89,10 @@ public class DropTargetDragEvent extends DropTargetEvent { * * @throws NullPointerException if cursorLocn is null * @throws IllegalArgumentException if dropAction is not one of - * DnDConstants. + * {@code DnDConstants}. * @throws IllegalArgumentException if srcActions is not - * a bitwise mask of DnDConstants. - * @throws IllegalArgumentException if dtc is null. + * a bitwise mask of {@code DnDConstants}. + * @throws IllegalArgumentException if dtc is {@code null}. */ public DropTargetDragEvent(DropTargetContext dtc, Point cursorLocn, int dropAction, int srcActions) { @@ -114,13 +114,13 @@ public class DropTargetDragEvent extends DropTargetEvent { } /** - * This method returns a Point - * indicating the Cursor's current - * location within the Component's + * This method returns a {@code Point} + * indicating the {@code Cursor}'s current + * location within the {@code Component'}s * coordinates. * * @return the current cursor location in - * Component's coords. + * {@code Component}'s coords. */ public Point getLocation() { @@ -129,8 +129,8 @@ public class DropTargetDragEvent extends DropTargetEvent { /** - * This method returns the current DataFlavors from the - * DropTargetContext. + * This method returns the current {@code DataFlavor}s from the + * {@code DropTargetContext}. * * @return current DataFlavors from the DropTargetContext */ @@ -140,10 +140,10 @@ public class DropTargetDragEvent extends DropTargetEvent { } /** - * This method returns the current DataFlavors - * as a java.util.List + * This method returns the current {@code DataFlavor}s + * as a {@code java.util.List} * - * @return a java.util.List of the Current DataFlavors + * @return a {@code java.util.List} of the Current {@code DataFlavor}s */ public List getCurrentDataFlavorsAsList() { @@ -151,10 +151,10 @@ public class DropTargetDragEvent extends DropTargetEvent { } /** - * This method returns a boolean indicating - * if the specified DataFlavor is supported. + * This method returns a {@code boolean} indicating + * if the specified {@code DataFlavor} is supported. * - * @param df the DataFlavor to test + * @param df the {@code DataFlavor} to test * * @return if a particular DataFlavor is supported */ @@ -195,11 +195,11 @@ public class DropTargetDragEvent extends DropTargetEvent { * Accepts the drag. * * This method should be called from a - * DropTargetListeners dragEnter, - * dragOver, and dropActionChanged + * {@code DropTargetListeners dragEnter}, + * {@code dragOver}, and {@code dropActionChanged} * methods if the implementation wishes to accept an operation * from the srcActions other than the one selected by - * the user as represented by the dropAction. + * the user as represented by the {@code dropAction}. * * @param dragOperation the operation accepted by the target */ @@ -209,7 +209,7 @@ public class DropTargetDragEvent extends DropTargetEvent { /** * Rejects the drag as a result of examining either the - * dropAction or the available DataFlavor + * {@code dropAction} or the available {@code DataFlavor} * types. */ public void rejectDrag() { diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDropEvent.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDropEvent.java index 6b197ae6b1f..7fdee103b3d 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDropEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDropEvent.java @@ -33,14 +33,14 @@ import java.awt.datatransfer.Transferable; import java.util.List; /** - * The DropTargetDropEvent is delivered - * via the DropTargetListener drop() method. + * The {@code DropTargetDropEvent} is delivered + * via the {@code DropTargetListener} drop() method. *

      - * The DropTargetDropEvent reports the source drop actions + * The {@code DropTargetDropEvent} reports the source drop actions * and the user drop action that reflect the current state of the * drag-and-drop operation. *

      - * Source drop actions is a bitwise mask of DnDConstants + * Source drop actions is a bitwise mask of {@code DnDConstants} * that represents the set of drop actions supported by the drag source for * this drag-and-drop operation. *

      @@ -53,18 +53,18 @@ import java.util.List; * Shift -> ACTION_MOVE * * If the user selects a drop action, the user drop action is one of - * DnDConstants that represents the selected drop action if this + * {@code DnDConstants} that represents the selected drop action if this * drop action is supported by the drag source or - * DnDConstants.ACTION_NONE if this drop action is not supported + * {@code DnDConstants.ACTION_NONE} if this drop action is not supported * by the drag source. *

      * If the user doesn't select a drop action, the set of - * DnDConstants that represents the set of drop actions supported - * by the drag source is searched for DnDConstants.ACTION_MOVE, - * then for DnDConstants.ACTION_COPY, then for - * DnDConstants.ACTION_LINK and the user drop action is the + * {@code DnDConstants} that represents the set of drop actions supported + * by the drag source is searched for {@code DnDConstants.ACTION_MOVE}, + * then for {@code DnDConstants.ACTION_COPY}, then for + * {@code DnDConstants.ACTION_LINK} and the user drop action is the * first constant found. If no constant is found the user drop action - * is DnDConstants.ACTION_NONE. + * is {@code DnDConstants.ACTION_NONE}. * * @since 1.2 */ @@ -74,31 +74,31 @@ public class DropTargetDropEvent extends DropTargetEvent { private static final long serialVersionUID = -1721911170440459322L; /** - * Construct a DropTargetDropEvent given - * the DropTargetContext for this operation, - * the location of the drag Cursor's - * hotspot in the Component's coordinates, + * Construct a {@code DropTargetDropEvent} given + * the {@code DropTargetContext} for this operation, + * the location of the drag {@code Cursor}'s + * hotspot in the {@code Component}'s coordinates, * the currently * selected user drop action, and the current set of * actions supported by the source. * By default, this constructor * assumes that the target is not in the same virtual machine as * the source; that is, {@link #isLocalTransfer()} will - * return false. + * return {@code false}. * - * @param dtc The DropTargetContext for this operation + * @param dtc The {@code DropTargetContext} for this operation * @param cursorLocn The location of the "Drag" Cursor's - * hotspot in Component coordinates + * hotspot in {@code Component} coordinates * @param dropAction the user drop action. * @param srcActions the source drop actions. * * @throws NullPointerException - * if cursorLocn is null + * if cursorLocn is {@code null} * @throws IllegalArgumentException - * if dropAction is not one of DnDConstants. + * if dropAction is not one of {@code DnDConstants}. * @throws IllegalArgumentException - * if srcActions is not a bitwise mask of DnDConstants. - * @throws IllegalArgumentException if dtc is null. + * if srcActions is not a bitwise mask of {@code DnDConstants}. + * @throws IllegalArgumentException if dtc is {@code null}. */ public DropTargetDropEvent(DropTargetContext dtc, Point cursorLocn, int dropAction, int srcActions) { @@ -120,13 +120,13 @@ public class DropTargetDropEvent extends DropTargetEvent { } /** - * Construct a DropTargetEvent given the - * DropTargetContext for this operation, - * the location of the drag Cursor's hotspot - * in the Component's + * Construct a {@code DropTargetEvent} given the + * {@code DropTargetContext} for this operation, + * the location of the drag {@code Cursor}'s hotspot + * in the {@code Component}'s * coordinates, the currently selected user drop action, * the current set of actions supported by the source, - * and a boolean indicating if the source is in the same JVM + * and a {@code boolean} indicating if the source is in the same JVM * as the target. * * @param dtc The DropTargetContext for this operation @@ -137,11 +137,11 @@ public class DropTargetDropEvent extends DropTargetEvent { * @param isLocal True if the source is in the same JVM as the target * * @throws NullPointerException - * if cursorLocn is null + * if cursorLocn is {@code null} * @throws IllegalArgumentException - * if dropAction is not one of DnDConstants. - * @throws IllegalArgumentException if srcActions is not a bitwise mask of DnDConstants. - * @throws IllegalArgumentException if dtc is null. + * if dropAction is not one of {@code DnDConstants}. + * @throws IllegalArgumentException if srcActions is not a bitwise mask of {@code DnDConstants}. + * @throws IllegalArgumentException if dtc is {@code null}. */ public DropTargetDropEvent(DropTargetContext dtc, Point cursorLocn, int dropAction, int srcActions, boolean isLocal) { @@ -151,11 +151,11 @@ public class DropTargetDropEvent extends DropTargetEvent { } /** - * This method returns a Point - * indicating the Cursor's current - * location in the Component's coordinates. + * This method returns a {@code Point} + * indicating the {@code Cursor}'s current + * location in the {@code Component}'s coordinates. * - * @return the current Cursor location in Component's coords. + * @return the current {@code Cursor} location in Component's coords. */ public Point getLocation() { @@ -175,7 +175,7 @@ public class DropTargetDropEvent extends DropTargetEvent { /** * This method returns the currently available - * DataFlavors as a java.util.List. + * {@code DataFlavor}s as a {@code java.util.List}. * * @return the currently available DataFlavors as a java.util.List */ @@ -185,11 +185,11 @@ public class DropTargetDropEvent extends DropTargetEvent { } /** - * This method returns a boolean indicating if the - * specified DataFlavor is available + * This method returns a {@code boolean} indicating if the + * specified {@code DataFlavor} is available * from the source. * - * @param df the DataFlavor to test + * @param df the {@code DataFlavor} to test * * @return if the DataFlavor specified is available from the source */ @@ -213,10 +213,10 @@ public class DropTargetDropEvent extends DropTargetEvent { public int getDropAction() { return dropAction; } /** - * This method returns the Transferable object + * This method returns the {@code Transferable} object * associated with the drop. * - * @return the Transferable associated with the drop + * @return the {@code Transferable} associated with the drop */ public Transferable getTransferable() { @@ -242,10 +242,10 @@ public class DropTargetDropEvent extends DropTargetEvent { } /** - * This method notifies the DragSource + * This method notifies the {@code DragSource} * that the drop transfer(s) are completed. * - * @param success a boolean indicating that the drop transfer(s) are completed. + * @param success a {@code boolean} indicating that the drop transfer(s) are completed. */ public void dropComplete(boolean success) { @@ -253,7 +253,7 @@ public class DropTargetDropEvent extends DropTargetEvent { } /** - * This method returns an int indicating if + * This method returns an {@code int} indicating if * the source is in the same JVM as the target. * * @return if the Source is in the same JVM @@ -291,7 +291,7 @@ public class DropTargetDropEvent extends DropTargetEvent { private int dropAction = DnDConstants.ACTION_NONE; /** - * true if the source is in the same JVM as the target. + * {@code true} if the source is in the same JVM as the target. * * @serial */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetEvent.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetEvent.java index e7911ab8cbb..3dfe215b0a2 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetEvent.java @@ -29,12 +29,12 @@ import java.util.EventObject; import java.awt.dnd.DropTargetContext; /** - * The DropTargetEvent is the base - * class for both the DropTargetDragEvent - * and the DropTargetDropEvent. + * The {@code DropTargetEvent} is the base + * class for both the {@code DropTargetDragEvent} + * and the {@code DropTargetDropEvent}. * It encapsulates the current state of the Drag and * Drop operations, in particular the current - * DropTargetContext. + * {@code DropTargetContext}. * * @since 1.2 * @@ -45,10 +45,10 @@ public class DropTargetEvent extends java.util.EventObject { private static final long serialVersionUID = 2821229066521922993L; /** - * Construct a DropTargetEvent object with - * the specified DropTargetContext. + * Construct a {@code DropTargetEvent} object with + * the specified {@code DropTargetContext}. * - * @param dtc The DropTargetContext + * @param dtc The {@code DropTargetContext} * @throws NullPointerException if {@code dtc} equals {@code null}. * @see #getSource() * @see #getDropTargetContext() @@ -61,10 +61,10 @@ public class DropTargetEvent extends java.util.EventObject { } /** - * This method returns the DropTargetContext - * associated with this DropTargetEvent. + * This method returns the {@code DropTargetContext} + * associated with this {@code DropTargetEvent}. * - * @return the DropTargetContext + * @return the {@code DropTargetContext} */ public DropTargetContext getDropTargetContext() { @@ -72,8 +72,8 @@ public class DropTargetEvent extends java.util.EventObject { } /** - * The DropTargetContext associated with this - * DropTargetEvent. + * The {@code DropTargetContext} associated with this + * {@code DropTargetEvent}. * * @serial */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetListener.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetListener.java index ec04be74e32..be540d424a4 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetListener.java @@ -31,37 +31,37 @@ import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; /** - * The DropTargetListener interface + * The {@code DropTargetListener} interface * is the callback interface used by the - * DropTarget class to provide + * {@code DropTarget} class to provide * notification of DnD operations that involve - * the subject DropTarget. Methods of + * the subject {@code DropTarget}. Methods of * this interface may be implemented to provide * "drag under" visual feedback to the user throughout * the Drag and Drop operation. *

      * Create a listener object by implementing the interface and then register it - * with a DropTarget. When the drag enters, moves over, or exits - * the operable part of the drop site for that DropTarget, when + * with a {@code DropTarget}. When the drag enters, moves over, or exits + * the operable part of the drop site for that {@code DropTarget}, when * the drop action changes, and when the drop occurs, the relevant method in - * the listener object is invoked, and the DropTargetEvent is + * the listener object is invoked, and the {@code DropTargetEvent} is * passed to it. *

      - * The operable part of the drop site for the DropTarget is - * the part of the associated Component's geometry that is not + * The operable part of the drop site for the {@code DropTarget} is + * the part of the associated {@code Component}'s geometry that is not * obscured by an overlapping top-level window or by another - * Component higher in the Z-order that has an associated active - * DropTarget. + * {@code Component} higher in the Z-order that has an associated active + * {@code DropTarget}. *

      * During the drag, the data associated with the current drag operation can be - * retrieved by calling getTransferable() on - * DropTargetDragEvent instances passed to the listener's + * retrieved by calling {@code getTransferable()} on + * {@code DropTargetDragEvent} instances passed to the listener's * methods. *

      - * Note that getTransferable() on the - * DropTargetDragEvent instance should only be called within the + * Note that {@code getTransferable()} on the + * {@code DropTargetDragEvent} instance should only be called within the * respective listener's method and all the necessary data should be retrieved - * from the returned Transferable before that method returns. + * from the returned {@code Transferable} before that method returns. * * @since 1.2 */ @@ -70,20 +70,20 @@ public interface DropTargetListener extends EventListener { /** * Called while a drag operation is ongoing, when the mouse pointer enters - * the operable part of the drop site for the DropTarget + * the operable part of the drop site for the {@code DropTarget} * registered with this listener. * - * @param dtde the DropTargetDragEvent + * @param dtde the {@code DropTargetDragEvent} */ void dragEnter(DropTargetDragEvent dtde); /** * Called when a drag operation is ongoing, while the mouse pointer is still - * over the operable part of the drop site for the DropTarget + * over the operable part of the drop site for the {@code DropTarget} * registered with this listener. * - * @param dtde the DropTargetDragEvent + * @param dtde the {@code DropTargetDragEvent} */ void dragOver(DropTargetDragEvent dtde); @@ -92,7 +92,7 @@ public interface DropTargetListener extends EventListener { * Called if the user has modified * the current drop gesture. * - * @param dtde the DropTargetDragEvent + * @param dtde the {@code DropTargetDragEvent} */ void dropActionChanged(DropTargetDragEvent dtde); @@ -100,52 +100,52 @@ public interface DropTargetListener extends EventListener { /** * Called while a drag operation is ongoing, when the mouse pointer has * exited the operable part of the drop site for the - * DropTarget registered with this listener. + * {@code DropTarget} registered with this listener. * - * @param dte the DropTargetEvent + * @param dte the {@code DropTargetEvent} */ void dragExit(DropTargetEvent dte); /** * Called when the drag operation has terminated with a drop on - * the operable part of the drop site for the DropTarget + * the operable part of the drop site for the {@code DropTarget} * registered with this listener. *

      * This method is responsible for undertaking * the transfer of the data associated with the - * gesture. The DropTargetDropEvent - * provides a means to obtain a Transferable + * gesture. The {@code DropTargetDropEvent} + * provides a means to obtain a {@code Transferable} * object that represents the data object(s) to * be transferred.

      - * From this method, the DropTargetListener + * From this method, the {@code DropTargetListener} * shall accept or reject the drop via the * acceptDrop(int dropAction) or rejectDrop() methods of the - * DropTargetDropEvent parameter. + * {@code DropTargetDropEvent} parameter. *

      * Subsequent to acceptDrop(), but not before, - * DropTargetDropEvent's getTransferable() + * {@code DropTargetDropEvent}'s getTransferable() * method may be invoked, and data transfer may be - * performed via the returned Transferable's + * performed via the returned {@code Transferable}'s * getTransferData() method. *

      * At the completion of a drop, an implementation * of this method is required to signal the success/failure * of the drop by passing an appropriate - * boolean to the DropTargetDropEvent's + * {@code boolean} to the {@code DropTargetDropEvent}'s * dropComplete(boolean success) method. *

      * Note: The data transfer should be completed before the call to the - * DropTargetDropEvent's dropComplete(boolean success) method. + * {@code DropTargetDropEvent}'s dropComplete(boolean success) method. * After that, a call to the getTransferData() method of the - * Transferable returned by - * DropTargetDropEvent.getTransferable() is guaranteed to + * {@code Transferable} returned by + * {@code DropTargetDropEvent.getTransferable()} is guaranteed to * succeed only if the data transfer is local; that is, only if - * DropTargetDropEvent.isLocalTransfer() returns - * true. Otherwise, the behavior of the call is + * {@code DropTargetDropEvent.isLocalTransfer()} returns + * {@code true}. Otherwise, the behavior of the call is * implementation-dependent. * - * @param dtde the DropTargetDropEvent + * @param dtde the {@code DropTargetDropEvent} */ void drop(DropTargetDropEvent dtde); diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/MouseDragGestureRecognizer.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/MouseDragGestureRecognizer.java index cf975835f22..0c5a623f754 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/MouseDragGestureRecognizer.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/MouseDragGestureRecognizer.java @@ -32,8 +32,8 @@ import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; /** - * This abstract subclass of DragGestureRecognizer - * defines a DragGestureRecognizer + * This abstract subclass of {@code DragGestureRecognizer} + * defines a {@code DragGestureRecognizer} * for mouse-based gestures. * * Each platform implements its own concrete subclass of this class, @@ -67,12 +67,12 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i private static final long serialVersionUID = 6220099344182281120L; /** - * Construct a new MouseDragGestureRecognizer - * given the DragSource for the - * Component c, the Component + * Construct a new {@code MouseDragGestureRecognizer} + * given the {@code DragSource} for the + * {@code Component} c, the {@code Component} * to observe, the action(s) * permitted for this drag operation, and - * the DragGestureListener to + * the {@code DragGestureListener} to * notify when a drag gesture is detected. * * @param ds The DragSource for the Component c @@ -87,10 +87,10 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i } /** - * Construct a new MouseDragGestureRecognizer - * given the DragSource for - * the Component c, - * the Component to observe, and the action(s) + * Construct a new {@code MouseDragGestureRecognizer} + * given the {@code DragSource} for + * the {@code Component} c, + * the {@code Component} to observe, and the action(s) * permitted for this drag operation. * * @param ds The DragSource for the Component c @@ -103,10 +103,10 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i } /** - * Construct a new MouseDragGestureRecognizer - * given the DragSource for the - * Component c, and the - * Component to observe. + * Construct a new {@code MouseDragGestureRecognizer} + * given the {@code DragSource} for the + * {@code Component} c, and the + * {@code Component} to observe. * * @param ds The DragSource for the Component c * @param c The Component to observe @@ -117,8 +117,8 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i } /** - * Construct a new MouseDragGestureRecognizer - * given the DragSource for the Component. + * Construct a new {@code MouseDragGestureRecognizer} + * given the {@code DragSource} for the {@code Component}. * * @param ds The DragSource for the Component */ @@ -151,16 +151,16 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i /** * Invoked when the mouse has been clicked on a component. * - * @param e the MouseEvent + * @param e the {@code MouseEvent} */ public void mouseClicked(MouseEvent e) { } /** * Invoked when a mouse button has been - * pressed on a Component. + * pressed on a {@code Component}. * - * @param e the MouseEvent + * @param e the {@code MouseEvent} */ public void mousePressed(MouseEvent e) { } @@ -168,7 +168,7 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i /** * Invoked when a mouse button has been released on a component. * - * @param e the MouseEvent + * @param e the {@code MouseEvent} */ public void mouseReleased(MouseEvent e) { } @@ -176,7 +176,7 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i /** * Invoked when the mouse enters a component. * - * @param e the MouseEvent + * @param e the {@code MouseEvent} */ public void mouseEntered(MouseEvent e) { } @@ -184,7 +184,7 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i /** * Invoked when the mouse exits a component. * - * @param e the MouseEvent + * @param e the {@code MouseEvent} */ public void mouseExited(MouseEvent e) { } @@ -192,7 +192,7 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i /** * Invoked when a mouse button is pressed on a component. * - * @param e the MouseEvent + * @param e the {@code MouseEvent} */ public void mouseDragged(MouseEvent e) { } @@ -201,7 +201,7 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i * Invoked when the mouse button has been moved on a component * (with no buttons no down). * - * @param e the MouseEvent + * @param e the {@code MouseEvent} */ public void mouseMoved(MouseEvent e) { } diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/AWTEventListener.java b/jdk/src/java.desktop/share/classes/java/awt/event/AWTEventListener.java index e56191fd988..f0050c740c4 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/AWTEventListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/AWTEventListener.java @@ -41,9 +41,9 @@ import java.awt.AWTEvent; * The class that is interested in monitoring AWT events * implements this interface, and the object created with that * class is registered with the Toolkit, using the Toolkit's - * addAWTEventListener method. When an event is + * {@code addAWTEventListener} method. When an event is * dispatched anywhere in the AWT, that object's - * eventDispatched method is invoked. + * {@code eventDispatched} method is invoked. * * @see java.awt.AWTEvent * @see java.awt.Toolkit#addAWTEventListener diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ActionEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/ActionEvent.java index 24a91ac0cd2..6ce79554eeb 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ActionEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ActionEvent.java @@ -32,17 +32,17 @@ import java.lang.annotation.Native; /** * A semantic event which indicates that a component-defined action occurred. * This high-level event is generated by a component (such as a - * Button) when + * {@code Button}) when * the component-specific action occurs (such as being pressed). - * The event is passed to every ActionListener object + * The event is passed to every {@code ActionListener} object * that registered to receive such events using the component's - * addActionListener method. + * {@code addActionListener} method. *

      - * Note: To invoke an ActionEvent on a - * Button using the keyboard, use the Space bar. + * Note: To invoke an {@code ActionEvent} on a + * {@code Button} using the keyboard, use the Space bar. *

      - * The object that implements the ActionListener interface - * gets this ActionEvent when the event occurs. The listener + * The object that implements the {@code ActionListener} interface + * gets this {@code ActionEvent} when the event occurs. The listener * is therefore spared the details of processing individual mouse movements * and mouse clicks, and can instead process a "meaningful" (semantic) * event like "button pressed". @@ -137,12 +137,12 @@ public class ActionEvent extends AWTEvent { private static final long serialVersionUID = -7671078796273832149L; /** - * Constructs an ActionEvent object. + * Constructs an {@code ActionEvent} object. *

      * This method throws an - * IllegalArgumentException if source - * is null. - * A null command string is legal, + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. + * A {@code null command} string is legal, * but not recommended. * * @param source The object that originated the event @@ -151,7 +151,7 @@ public class ActionEvent extends AWTEvent { * the class description for {@link ActionEvent} * @param command A string that may specify a command (possibly one * of several) associated with the event - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getSource() * @see #getID() * @see #getActionCommand() @@ -161,12 +161,12 @@ public class ActionEvent extends AWTEvent { } /** - * Constructs an ActionEvent object with modifier keys. + * Constructs an {@code ActionEvent} object with modifier keys. *

      * This method throws an - * IllegalArgumentException if source - * is null. - * A null command string is legal, + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. + * A {@code null command} string is legal, * but not recommended. * * @param source The object that originated the event @@ -179,7 +179,7 @@ public class ActionEvent extends AWTEvent { * (shift, ctrl, alt, meta). * Passing negative parameter is not recommended. * Zero value means that no modifiers were passed - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getSource() * @see #getID() * @see #getActionCommand() @@ -190,13 +190,13 @@ public class ActionEvent extends AWTEvent { } /** - * Constructs an ActionEvent object with the specified + * Constructs an {@code ActionEvent} object with the specified * modifier keys and timestamp. *

      * This method throws an - * IllegalArgumentException if source - * is null. - * A null command string is legal, + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. + * A {@code null command} string is legal, * but not recommended. * * @param source The object that originated the event @@ -212,7 +212,7 @@ public class ActionEvent extends AWTEvent { * @param when A long that gives the time the event occurred. * Passing negative or zero value * is not recommended - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getSource() * @see #getID() * @see #getActionCommand() @@ -237,9 +237,9 @@ public class ActionEvent extends AWTEvent { * and the event would be the same in each case, but the command string * would identify the intended action. *

      - * Note that if a null command string was passed - * to the constructor for this ActionEvent, this - * this method returns null. + * Note that if a {@code null} command string was passed + * to the constructor for this {@code ActionEvent}, this + * this method returns {@code null}. * * @return the string identifying the command for this event */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ActionListener.java b/jdk/src/java.desktop/share/classes/java/awt/event/ActionListener.java index bbb87dbddfb..50b94c46a18 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ActionListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ActionListener.java @@ -32,8 +32,8 @@ import java.util.EventListener; * The class that is interested in processing an action event * implements this interface, and the object created with that * class is registered with a component, using the component's - * addActionListener method. When the action event - * occurs, that object's actionPerformed method is + * {@code addActionListener} method. When the action event + * occurs, that object's {@code actionPerformed} method is * invoked. * * @see ActionEvent diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/AdjustmentEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/AdjustmentEvent.java index 66d54c3c247..f113319c57b 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/AdjustmentEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/AdjustmentEvent.java @@ -107,7 +107,7 @@ public class AdjustmentEvent extends AWTEvent { Adjustable adjustable; /** - * value will contain the new value of the + * {@code value} will contain the new value of the * adjustable object. This value will always be in a * range associated adjustable object. * @@ -117,7 +117,7 @@ public class AdjustmentEvent extends AWTEvent { int value; /** - * The adjustmentType describes how the adjustable + * The {@code adjustmentType} describes how the adjustable * object value has changed. * This value can be increased/decreased by a block or unit amount * where the block is associated with page increments/decrements, @@ -130,7 +130,7 @@ public class AdjustmentEvent extends AWTEvent { /** - * The isAdjusting is true if the event is one + * The {@code isAdjusting} is true if the event is one * of the series of multiple adjustment events. * * @since 1.4 @@ -147,14 +147,14 @@ public class AdjustmentEvent extends AWTEvent { /** - * Constructs an AdjustmentEvent object with the - * specified Adjustable source, event type, + * Constructs an {@code AdjustmentEvent} object with the + * specified {@code Adjustable} source, event type, * adjustment type, and value. *

      This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Adjustable object where the + * @param source The {@code Adjustable} object where the * event originated * @param id An integer indicating the type of event. * For information on allowable values, see @@ -163,7 +163,7 @@ public class AdjustmentEvent extends AWTEvent { * For information on allowable values, see * the class description for {@link AdjustmentEvent} * @param value The current value of the adjustment - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getSource() * @see #getID() * @see #getAdjustmentType() @@ -174,13 +174,13 @@ public class AdjustmentEvent extends AWTEvent { } /** - * Constructs an AdjustmentEvent object with the + * Constructs an {@code AdjustmentEvent} object with the * specified Adjustable source, event type, adjustment type, and value. *

      This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Adjustable object where the + * @param source The {@code Adjustable} object where the * event originated * @param id An integer indicating the type of event. * For information on allowable values, see @@ -189,10 +189,10 @@ public class AdjustmentEvent extends AWTEvent { * For information on allowable values, see * the class description for {@link AdjustmentEvent} * @param value The current value of the adjustment - * @param isAdjusting A boolean that equals true if the event is one + * @param isAdjusting A boolean that equals {@code true} if the event is one * of a series of multiple adjusting events, - * otherwise false - * @throws IllegalArgumentException if source is null + * otherwise {@code false} + * @throws IllegalArgumentException if {@code source} is null * @since 1.4 * @see #getSource() * @see #getID() @@ -209,9 +209,9 @@ public class AdjustmentEvent extends AWTEvent { } /** - * Returns the Adjustable object where this event originated. + * Returns the {@code Adjustable} object where this event originated. * - * @return the Adjustable object where this event originated + * @return the {@code Adjustable} object where this event originated */ public Adjustable getAdjustable() { return adjustable; @@ -243,11 +243,11 @@ public class AdjustmentEvent extends AWTEvent { } /** - * Returns true if this is one of multiple + * Returns {@code true} if this is one of multiple * adjustment events. * - * @return true if this is one of multiple - * adjustment events, otherwise returns false + * @return {@code true} if this is one of multiple + * adjustment events, otherwise returns {@code false} * @since 1.4 */ public boolean getValueIsAdjusting() { diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ComponentAdapter.java b/jdk/src/java.desktop/share/classes/java/awt/event/ComponentAdapter.java index 2e3ab4c2ca2..47cd188d2c3 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ComponentAdapter.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ComponentAdapter.java @@ -30,17 +30,17 @@ package java.awt.event; * The methods in this class are empty. This class exists as * convenience for creating listener objects. *

      - * Extend this class to create a ComponentEvent listener + * Extend this class to create a {@code ComponentEvent} listener * and override the methods for the events of interest. (If you implement the - * ComponentListener interface, you have to define all of + * {@code ComponentListener} interface, you have to define all of * the methods in it. This abstract class defines null methods for them * all, so you can only have to define methods for events you care about.) *

      * Create a listener object using your class and then register it with a - * component using the component's addComponentListener + * component using the component's {@code addComponentListener} * method. When the component's size, location, or visibility * changes, the relevant method in the listener object is invoked, - * and the ComponentEvent is passed to it. + * and the {@code ComponentEvent} is passed to it. * * @see ComponentEvent * @see ComponentListener diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ComponentEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/ComponentEvent.java index d168f6c1763..705a9fb5848 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ComponentEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ComponentEvent.java @@ -47,12 +47,12 @@ import java.lang.annotation.Native; *

      * This low-level event is generated by a component object (such as a * List) when the component is moved, resized, rendered invisible, or made - * visible again. The event is passed to every ComponentListener - * or ComponentAdapter object which registered to receive such - * events using the component's addComponentListener method. - * (ComponentAdapter objects implement the - * ComponentListener interface.) Each such listener object - * gets this ComponentEvent when the event occurs. + * visible again. The event is passed to every {@code ComponentListener} + * or {@code ComponentAdapter} object which registered to receive such + * events using the component's {@code addComponentListener} method. + * ({@code ComponentAdapter} objects implement the + * {@code ComponentListener} interface.) Each such listener object + * gets this {@code ComponentEvent} when the event occurs. *

      * An unspecified behavior will be caused if the {@code id} parameter * of any particular {@code ComponentEvent} instance is not @@ -103,16 +103,16 @@ public class ComponentEvent extends AWTEvent { private static final long serialVersionUID = 8101406823902992965L; /** - * Constructs a ComponentEvent object. + * Constructs a {@code ComponentEvent} object. *

      This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Component that originated the event + * @param source The {@code Component} that originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link ComponentEvent} - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getComponent() * @see #getID() */ @@ -123,9 +123,9 @@ public class ComponentEvent extends AWTEvent { /** * Returns the originator of the event. * - * @return the Component object that originated - * the event, or null if the object is not a - * Component. + * @return the {@code Component} object that originated + * the event, or {@code null} if the object is not a + * {@code Component}. */ public Component getComponent() { return (source instanceof Component) ? (Component)source : null; diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ComponentListener.java b/jdk/src/java.desktop/share/classes/java/awt/event/ComponentListener.java index e3e83e638d1..e316597590a 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ComponentListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ComponentListener.java @@ -31,18 +31,18 @@ import java.util.EventListener; * The listener interface for receiving component events. * The class that is interested in processing a component event * either implements this interface (and all the methods it - * contains) or extends the abstract ComponentAdapter class + * contains) or extends the abstract {@code ComponentAdapter} class * (overriding only the methods of interest). * The listener object created from that class is then registered with a - * component using the component's addComponentListener + * component using the component's {@code addComponentListener} * method. When the component's size, location, or visibility * changes, the relevant method in the listener object is invoked, - * and the ComponentEvent is passed to it. + * and the {@code ComponentEvent} is passed to it. *

      * Component events are provided for notification purposes ONLY; * The AWT will automatically handle component moves and resizes * internally so that GUI layout works properly regardless of - * whether a program registers a ComponentListener or not. + * whether a program registers a {@code ComponentListener} or not. * * @see ComponentAdapter * @see ComponentEvent diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ContainerAdapter.java b/jdk/src/java.desktop/share/classes/java/awt/event/ContainerAdapter.java index e4af172bc39..9a333b3d666 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ContainerAdapter.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ContainerAdapter.java @@ -30,17 +30,17 @@ package java.awt.event; * The methods in this class are empty. This class exists as * convenience for creating listener objects. *

      - * Extend this class to create a ContainerEvent listener + * Extend this class to create a {@code ContainerEvent} listener * and override the methods for the events of interest. (If you implement the - * ContainerListener interface, you have to define all of + * {@code ContainerListener} interface, you have to define all of * the methods in it. This abstract class defines null methods for them * all, so you can only have to define methods for events you care about.) *

      * Create a listener object using the extended class and then register it with - * a component using the component's addContainerListener + * a component using the component's {@code addContainerListener} * method. When the container's contents change because a component has * been added or removed, the relevant method in the listener object is invoked, - * and the ContainerEvent is passed to it. + * and the {@code ContainerEvent} is passed to it. * * @see ContainerEvent * @see ContainerListener diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ContainerEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/ContainerEvent.java index 964b27cd22c..7aecc21b963 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ContainerEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ContainerEvent.java @@ -39,12 +39,12 @@ import java.awt.Component; *

      * This low-level event is generated by a container object (such as a * Panel) when a component is added to it or removed from it. - * The event is passed to every ContainerListener - * or ContainerAdapter object which registered to receive such - * events using the component's addContainerListener method. - * (ContainerAdapter objects implement the - * ContainerListener interface.) Each such listener object - * gets this ContainerEvent when the event occurs. + * The event is passed to every {@code ContainerListener} + * or {@code ContainerAdapter} object which registered to receive such + * events using the component's {@code addContainerListener} method. + * ({@code ContainerAdapter} objects implement the + * {@code ContainerListener} interface.) Each such listener object + * gets this {@code ContainerEvent} when the event occurs. *

      * An unspecified behavior will be caused if the {@code id} parameter * of any particular {@code ContainerEvent} instance is not @@ -95,18 +95,18 @@ public class ContainerEvent extends ComponentEvent { private static final long serialVersionUID = -4114942250539772041L; /** - * Constructs a ContainerEvent object. + * Constructs a {@code ContainerEvent} object. *

      This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Component object (container) + * @param source The {@code Component} object (container) * that originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link ContainerEvent} * @param child the component that was added or removed - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getContainer() * @see #getID() * @see #getChild() @@ -119,9 +119,9 @@ public class ContainerEvent extends ComponentEvent { /** * Returns the originator of the event. * - * @return the Container object that originated - * the event, or null if the object is not a - * Container. + * @return the {@code Container} object that originated + * the event, or {@code null} if the object is not a + * {@code Container}. */ public Container getContainer() { return (source instanceof Container) ? (Container)source : null; diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ContainerListener.java b/jdk/src/java.desktop/share/classes/java/awt/event/ContainerListener.java index c99c5b9c94b..a0557327c82 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ContainerListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ContainerListener.java @@ -31,13 +31,13 @@ import java.util.EventListener; * The listener interface for receiving container events. * The class that is interested in processing a container event * either implements this interface (and all the methods it - * contains) or extends the abstract ContainerAdapter class + * contains) or extends the abstract {@code ContainerAdapter} class * (overriding only the methods of interest). * The listener object created from that class is then registered with a - * component using the component's addContainerListener + * component using the component's {@code addContainerListener} * method. When the container's contents change because a component * has been added or removed, the relevant method in the listener object - * is invoked, and the ContainerEvent is passed to it. + * is invoked, and the {@code ContainerEvent} is passed to it. *

      * Container events are provided for notification purposes ONLY; * The AWT will automatically handle add and remove operations diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/FocusAdapter.java b/jdk/src/java.desktop/share/classes/java/awt/event/FocusAdapter.java index 5676d082e82..1525990d5aa 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/FocusAdapter.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/FocusAdapter.java @@ -30,17 +30,17 @@ package java.awt.event; * The methods in this class are empty. This class exists as * convenience for creating listener objects. *

      - * Extend this class to create a FocusEvent listener + * Extend this class to create a {@code FocusEvent} listener * and override the methods for the events of interest. (If you implement the - * FocusListener interface, you have to define all of + * {@code FocusListener} interface, you have to define all of * the methods in it. This abstract class defines null methods for them * all, so you can only have to define methods for events you care about.) *

      * Create a listener object using the extended class and then register it with - * a component using the component's addFocusListener + * a component using the component's {@code addFocusListener} * method. When the component gains or loses the keyboard focus, * the relevant method in the listener object is invoked, - * and the FocusEvent is passed to it. + * and the {@code FocusEvent} is passed to it. * * @see FocusEvent * @see FocusListener diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/FocusEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/FocusEvent.java index 2f9e1911c99..afef05edef0 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/FocusEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/FocusEvent.java @@ -32,11 +32,11 @@ import sun.awt.SunToolkit; /** * A low-level event which indicates that a Component has gained or lost the * input focus. This low-level event is generated by a Component (such as a - * TextField). The event is passed to every FocusListener or - * FocusAdapter object which registered to receive such events - * using the Component's addFocusListener method. ( - * FocusAdapter objects implement the FocusListener - * interface.) Each such listener object gets this FocusEvent when + * TextField). The event is passed to every {@code FocusListener} or + * {@code FocusAdapter} object which registered to receive such events + * using the Component's {@code addFocusListener} method. + * ({@code FocusAdapter} objects implement the {@code FocusListener} + * interface.) Each such listener object gets this {@code FocusEvent} when * the event occurs. *

      * There are two levels of focus events: permanent and temporary. Permanent @@ -114,30 +114,30 @@ public class FocusEvent extends ComponentEvent { private static final long serialVersionUID = 523753786457416396L; /** - * Constructs a FocusEvent object with the - * specified temporary state and opposite Component. - * The opposite Component is the other - * Component involved in this focus change. - * For a FOCUS_GAINED event, this is the - * Component that lost focus. For a - * FOCUS_LOST event, this is the Component + * Constructs a {@code FocusEvent} object with the + * specified temporary state and opposite {@code Component}. + * The opposite {@code Component} is the other + * {@code Component} involved in this focus change. + * For a {@code FOCUS_GAINED} event, this is the + * {@code Component} that lost focus. For a + * {@code FOCUS_LOST} event, this is the {@code Component} * that gained focus. If this focus change occurs with a native * application, with a Java application in a different VM, - * or with no other Component, then the opposite - * Component is null. + * or with no other {@code Component}, then the opposite + * {@code Component} is {@code null}. *

      This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Component that originated the event + * @param source The {@code Component} that originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link FocusEvent} - * @param temporary Equals true if the focus change is temporary; - * false otherwise + * @param temporary Equals {@code true} if the focus change is temporary; + * {@code false} otherwise * @param opposite The other Component involved in the focus change, - * or null - * @throws IllegalArgumentException if source equals {@code null} + * or {@code null} + * @throws IllegalArgumentException if {@code source} equals {@code null} * @see #getSource() * @see #getID() * @see #isTemporary() @@ -152,19 +152,19 @@ public class FocusEvent extends ComponentEvent { } /** - * Constructs a FocusEvent object and identifies + * Constructs a {@code FocusEvent} object and identifies * whether or not the change is temporary. *

      This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Component that originated the event + * @param source The {@code Component} that originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link FocusEvent} - * @param temporary Equals true if the focus change is temporary; - * false otherwise - * @throws IllegalArgumentException if source equals {@code null} + * @param temporary Equals {@code true} if the focus change is temporary; + * {@code false} otherwise + * @throws IllegalArgumentException if {@code source} equals {@code null} * @see #getSource() * @see #getID() * @see #isTemporary() @@ -174,17 +174,17 @@ public class FocusEvent extends ComponentEvent { } /** - * Constructs a FocusEvent object and identifies it + * Constructs a {@code FocusEvent} object and identifies it * as a permanent change in focus. *

      This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Component that originated the event + * @param source The {@code Component} that originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link FocusEvent} - * @throws IllegalArgumentException if source equals {@code null} + * @throws IllegalArgumentException if {@code source} equals {@code null} * @see #getSource() * @see #getID() */ @@ -195,8 +195,8 @@ public class FocusEvent extends ComponentEvent { /** * Identifies the focus change event as temporary or permanent. * - * @return true if the focus change is temporary; - * false otherwise + * @return {@code true} if the focus change is temporary; + * {@code false} otherwise */ public boolean isTemporary() { return temporary; diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/FocusListener.java b/jdk/src/java.desktop/share/classes/java/awt/event/FocusListener.java index 31edd5a0726..2acd1035305 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/FocusListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/FocusListener.java @@ -32,13 +32,13 @@ import java.util.EventListener; * a component. * The class that is interested in processing a focus event * either implements this interface (and all the methods it - * contains) or extends the abstract FocusAdapter class + * contains) or extends the abstract {@code FocusAdapter} class * (overriding only the methods of interest). * The listener object created from that class is then registered with a - * component using the component's addFocusListener + * component using the component's {@code addFocusListener} * method. When the component gains or loses the keyboard focus, * the relevant method in the listener object - * is invoked, and the FocusEvent is passed to it. + * is invoked, and the {@code FocusEvent} is passed to it. * * @see FocusAdapter * @see FocusEvent diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyBoundsAdapter.java b/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyBoundsAdapter.java index c17801468ad..5fa165a6839 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyBoundsAdapter.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyBoundsAdapter.java @@ -31,16 +31,16 @@ package java.awt.event; * convenience for creating listener objects. *

      * Extend this class and override the method for the event of interest. (If - * you implement the HierarchyBoundsListener interface, you have + * you implement the {@code HierarchyBoundsListener} interface, you have * to define both methods in it. This abstract class defines null methods for * them both, so you only have to define the method for the event you care * about.) *

      * Create a listener object using your class and then register it with a - * Component using the Component's addHierarchyBoundsListener + * Component using the Component's {@code addHierarchyBoundsListener} * method. When the hierarchy to which the Component belongs changes by * resize or movement of an ancestor, the relevant method in the listener - * object is invoked, and the HierarchyEvent is passed to it. + * object is invoked, and the {@code HierarchyEvent} is passed to it. * * @author David Mendenhall * @see HierarchyBoundsListener diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyBoundsListener.java b/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyBoundsListener.java index a8f21342e9e..bc997939b43 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyBoundsListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyBoundsListener.java @@ -31,18 +31,18 @@ import java.util.EventListener; * The listener interface for receiving ancestor moved and resized events. * The class that is interested in processing these events either implements * this interface (and all the methods it contains) or extends the abstract - * HierarchyBoundsAdapter class (overriding only the method of + * {@code HierarchyBoundsAdapter} class (overriding only the method of * interest). * The listener object created from that class is then registered with a - * Component using the Component's addHierarchyBoundsListener + * Component using the Component's {@code addHierarchyBoundsListener} * method. When the hierarchy to which the Component belongs changes by * the resizing or movement of an ancestor, the relevant method in the listener - * object is invoked, and the HierarchyEvent is passed to it. + * object is invoked, and the {@code HierarchyEvent} is passed to it. *

      * Hierarchy events are provided for notification purposes ONLY; * The AWT will automatically handle changes to the hierarchy internally so * that GUI layout works properly regardless of whether a - * program registers an HierarchyBoundsListener or not. + * program registers an {@code HierarchyBoundsListener} or not. * * @author David Mendenhall * @see HierarchyBoundsAdapter diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyEvent.java index 47107b35981..c6cde2b5f0c 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyEvent.java @@ -30,8 +30,8 @@ import java.awt.Component; import java.awt.Container; /** - * An event which indicates a change to the Component - * hierarchy to which Component belongs. + * An event which indicates a change to the {@code Component} + * hierarchy to which {@code Component} belongs. *

        *
      • Hierarchy Change Events (HierarchyListener) *
          @@ -57,18 +57,18 @@ import java.awt.Container; * This event is generated by a Container object (such as a Panel) when the * Container is added, removed, moved, or resized, and passed down the * hierarchy. It is also generated by a Component object when that object's - * addNotify, removeNotify, show, or - * hide method is called. The {@code ANCESTOR_MOVED} and + * {@code addNotify}, {@code removeNotify}, {@code show}, or + * {@code hide} method is called. The {@code ANCESTOR_MOVED} and * {@code ANCESTOR_RESIZED} - * events are dispatched to every HierarchyBoundsListener or - * HierarchyBoundsAdapter object which registered to receive - * such events using the Component's addHierarchyBoundsListener - * method. (HierarchyBoundsAdapter objects implement the - * HierarchyBoundsListener interface.) The {@code HIERARCHY_CHANGED} events are - * dispatched to every HierarchyListener object which registered - * to receive such events using the Component's addHierarchyListener - * method. Each such listener object gets this HierarchyEvent - * when the event occurs. + * events are dispatched to every {@code HierarchyBoundsListener} or + * {@code HierarchyBoundsAdapter} object which registered to receive + * such events using the Component's {@code addHierarchyBoundsListener} + * method. ({@code HierarchyBoundsAdapter} objects implement the + * {@code HierarchyBoundsListener} interface.) The {@code HIERARCHY_CHANGED} events are + * dispatched to every {@code HierarchyListener} object which registered + * to receive such events using the Component's {@code addHierarchyListener} + * method. Each such listener object gets this {@code HierarchyEvent} + * when the event occurs. *

          * An unspecified behavior will be caused if the {@code id} parameter * of any particular {@code HierarchyEvent} instance is not @@ -122,20 +122,20 @@ public class HierarchyEvent extends AWTEvent { public static final int HIERARCHY_LAST = ANCESTOR_RESIZED; /** - * A change flag indicates that the HIERARCHY_CHANGED event + * A change flag indicates that the {@code HIERARCHY_CHANGED} event * was generated by a reparenting operation. */ public static final int PARENT_CHANGED = 0x1; /** - * A change flag indicates that the HIERARCHY_CHANGED event + * A change flag indicates that the {@code HIERARCHY_CHANGED} event * was generated due to the changing of the hierarchy displayability. * To discern the * current displayability of the hierarchy, call the - * Component.isDisplayable method. Displayability changes occur + * {@code Component.isDisplayable} method. Displayability changes occur * in response to explicit or implicit calls of the - * Component.addNotify and - * Component.removeNotify methods. + * {@code Component.addNotify} and + * {@code Component.removeNotify} methods. * * @see java.awt.Component#isDisplayable() * @see java.awt.Component#addNotify() @@ -144,15 +144,15 @@ public class HierarchyEvent extends AWTEvent { public static final int DISPLAYABILITY_CHANGED = 0x2; /** - * A change flag indicates that the HIERARCHY_CHANGED event + * A change flag indicates that the {@code HIERARCHY_CHANGED} event * was generated due to the changing of the hierarchy showing state. * To discern the * current showing state of the hierarchy, call the - * Component.isShowing method. Showing state changes occur + * {@code Component.isShowing} method. Showing state changes occur * when either the displayability or visibility of the * hierarchy occurs. Visibility changes occur in response to explicit - * or implicit calls of the Component.show and - * Component.hide methods. + * or implicit calls of the {@code Component.show} and + * {@code Component.hide} methods. * * @see java.awt.Component#isShowing() * @see java.awt.Component#addNotify() @@ -167,24 +167,24 @@ public class HierarchyEvent extends AWTEvent { long changeFlags; /** - * Constructs an HierarchyEvent object to identify a - * change in the Component hierarchy. + * Constructs an {@code HierarchyEvent} object to identify a + * change in the {@code Component} hierarchy. *

          This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Component object that + * @param source The {@code Component} object that * originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link HierarchyEvent} - * @param changed The Component at the top of + * @param changed The {@code Component} at the top of * the hierarchy which was changed - * @param changedParent The parent of the changed component. + * @param changedParent The parent of the {@code changed} component. * This * may be the parent before or after the * change, depending on the type of change - * @throws IllegalArgumentException if source is {@code null} + * @throws IllegalArgumentException if {@code source} is {@code null} * @see #getSource() * @see #getID() * @see #getChanged() @@ -198,29 +198,29 @@ public class HierarchyEvent extends AWTEvent { } /** - * Constructs an HierarchyEvent object to identify - * a change in the Component hierarchy. + * Constructs an {@code HierarchyEvent} object to identify + * a change in the {@code Component} hierarchy. *

          This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Component object that + * @param source The {@code Component} object that * originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link HierarchyEvent} - * @param changed The Component at the top + * @param changed The {@code Component} at the top * of the hierarchy which was changed - * @param changedParent The parent of the changed component. + * @param changedParent The parent of the {@code changed} component. * This * may be the parent before or after the * change, depending on the type of change * @param changeFlags A bitmask which indicates the type(s) of - * the HIERARCHY_CHANGED events + * the {@code HIERARCHY_CHANGED} events * represented in this event object. * For information on allowable values, see * the class description for {@link HierarchyEvent} - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getSource() * @see #getID() * @see #getChanged() @@ -238,9 +238,9 @@ public class HierarchyEvent extends AWTEvent { /** * Returns the originator of the event. * - * @return the Component object that originated - * the event, or null if the object is not a - * Component. + * @return the {@code Component} object that originated + * the event, or {@code null} if the object is not a + * {@code Component}. */ public Component getComponent() { return (source instanceof Component) ? (Component)source : null; @@ -257,13 +257,13 @@ public class HierarchyEvent extends AWTEvent { } /** - * Returns the parent of the Component returned by - * getChanged(). For a HIERARCHY_CHANGED event where the - * change was of type PARENT_CHANGED via a call to - * Container.add, the parent returned is the parent + * Returns the parent of the Component returned by + * {@code getChanged()}. For a HIERARCHY_CHANGED event where the + * change was of type PARENT_CHANGED via a call to + * {@code Container.add}, the parent returned is the parent * after the add operation. For a HIERARCHY_CHANGED event where - * the change was of type PARENT_CHANGED via a call to - * Container.remove, the parent returned is the parent + * the change was of type PARENT_CHANGED via a call to + * {@code Container.remove}, the parent returned is the parent * before the remove operation. For all other events and types, * the parent returned is the parent during the operation. * diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyListener.java b/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyListener.java index b681b54212e..b3fb3640343 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyListener.java @@ -32,15 +32,15 @@ import java.util.EventListener; * The class that is interested in processing a hierarchy changed event * should implement this interface. * The listener object created from that class is then registered with a - * Component using the Component's addHierarchyListener + * Component using the Component's {@code addHierarchyListener} * method. When the hierarchy to which the Component belongs changes, the - * hierarchyChanged method in the listener object is invoked, - * and the HierarchyEvent is passed to it. + * {@code hierarchyChanged} method in the listener object is invoked, + * and the {@code HierarchyEvent} is passed to it. *

          * Hierarchy events are provided for notification purposes ONLY; * The AWT will automatically handle changes to the hierarchy internally so * that GUI layout, displayability, and visibility work properly regardless - * of whether a program registers a HierarchyListener or not. + * of whether a program registers a {@code HierarchyListener} or not. * * @author David Mendenhall * @see HierarchyEvent @@ -49,7 +49,7 @@ import java.util.EventListener; public interface HierarchyListener extends EventListener { /** * Called when the hierarchy has been changed. To discern the actual - * type of change, call HierarchyEvent.getChangeFlags(). + * type of change, call {@code HierarchyEvent.getChangeFlags()}. * * @param e the event to be processed * @see HierarchyEvent#getChangeFlags() diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/InputEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/InputEvent.java index ecf993530d3..d332d2d2735 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/InputEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/InputEvent.java @@ -315,8 +315,8 @@ public abstract class InputEvent extends ComponentEvent { * Constructs an InputEvent object with the specified source component, * modifiers, and type. *

          This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * * @param source the object where the event originated * @param id the integer that identifies the event type. @@ -336,7 +336,7 @@ public abstract class InputEvent extends ComponentEvent { * Passing negative parameter * is not recommended. * Zero value means that no modifiers were passed - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getSource() * @see #getID() * @see #getWhen() @@ -442,16 +442,16 @@ public abstract class InputEvent extends ComponentEvent { * button 2, and then releases them in the same order, * the following sequence of events is generated: *

          -     *    MOUSE_PRESSED:  BUTTON1_DOWN_MASK
          -     *    MOUSE_PRESSED:  BUTTON1_DOWN_MASK | BUTTON2_DOWN_MASK
          -     *    MOUSE_RELEASED: BUTTON2_DOWN_MASK
          -     *    MOUSE_CLICKED:  BUTTON2_DOWN_MASK
          -     *    MOUSE_RELEASED:
          -     *    MOUSE_CLICKED:
          +     *    {@code MOUSE_PRESSED}:  {@code BUTTON1_DOWN_MASK}
          +     *    {@code MOUSE_PRESSED}:  {@code BUTTON1_DOWN_MASK | BUTTON2_DOWN_MASK}
          +     *    {@code MOUSE_RELEASED}: {@code BUTTON2_DOWN_MASK}
          +     *    {@code MOUSE_CLICKED}:  {@code BUTTON2_DOWN_MASK}
          +     *    {@code MOUSE_RELEASED}:
          +     *    {@code MOUSE_CLICKED}:
                * 
          *

          * It is not recommended to compare the return value of this method - * using == because new modifiers can be added in the future. + * using {@code ==} because new modifiers can be added in the future. * For example, the appropriate way to check that SHIFT and BUTTON1 are * down, but CTRL is up is demonstrated by the following code: *

          @@ -494,7 +494,7 @@ public abstract class InputEvent extends ComponentEvent {
                * Returns a String describing the extended modifier keys and
                * mouse buttons, such as "Shift", "Button1", or "Ctrl+Shift".
                * These strings can be localized by changing the
          -     * awt.properties file.
          +     * {@code awt.properties} file.
                * 

          * Note that passing negative parameter is incorrect, * and will cause the returning an unspecified string. diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/InputMethodEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/InputMethodEvent.java index e1ec9abbcf5..00e6413fea1 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/InputMethodEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/InputMethodEvent.java @@ -106,45 +106,45 @@ public class InputMethodEvent extends AWTEvent { private transient TextHitInfo visiblePosition; /** - * Constructs an InputMethodEvent with the specified + * Constructs an {@code InputMethodEvent} with the specified * source component, type, time, text, caret, and visiblePosition. *

          * The offsets of caret and visiblePosition are relative to the current - * composed text; that is, the composed text within text - * if this is an INPUT_METHOD_TEXT_CHANGED event, - * the composed text within the text of the - * preceding INPUT_METHOD_TEXT_CHANGED event otherwise. - *

          Note that passing in an invalid id results in + * composed text; that is, the composed text within {@code text} + * if this is an {@code INPUT_METHOD_TEXT_CHANGED} event, + * the composed text within the {@code text} of the + * preceding {@code INPUT_METHOD_TEXT_CHANGED} event otherwise. + *

          Note that passing in an invalid {@code id} results in * unspecified behavior. This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * * @param source the object where the event originated * @param id the event type * @param when a long integer that specifies the time the event occurred * @param text the combined committed and composed text, - * committed text first; must be null - * when the event type is CARET_POSITION_CHANGED; - * may be null for - * INPUT_METHOD_TEXT_CHANGED if there's no + * committed text first; must be {@code null} + * when the event type is {@code CARET_POSITION_CHANGED}; + * may be {@code null} for + * {@code INPUT_METHOD_TEXT_CHANGED} if there's no * committed or composed text * @param committedCharacterCount the number of committed * characters in the text * @param caret the caret (a.k.a. insertion point); - * null if there's no caret within current + * {@code null} if there's no caret within current * composed text * @param visiblePosition the position that's most important - * to be visible; null if there's no + * to be visible; {@code null} if there's no * recommendation for a visible position within current * composed text - * @throws IllegalArgumentException if id is not + * @throws IllegalArgumentException if {@code id} is not * in the range - * INPUT_METHOD_FIRST..INPUT_METHOD_LAST; - * or if id is CARET_POSITION_CHANGED and - * text is not null; - * or if committedCharacterCount is not in the range - * 0..(text.getEndIndex() - text.getBeginIndex()) - * @throws IllegalArgumentException if source is null + * {@code INPUT_METHOD_FIRST}..{@code INPUT_METHOD_LAST}; + * or if id is {@code CARET_POSITION_CHANGED} and + * {@code text} is not {@code null}; + * or if {@code committedCharacterCount} is not in the range + * {@code 0}..{@code (text.getEndIndex() - text.getBeginIndex())} + * @throws IllegalArgumentException if {@code source} is null * * @since 1.4 */ @@ -177,46 +177,46 @@ public class InputMethodEvent extends AWTEvent { } /** - * Constructs an InputMethodEvent with the specified + * Constructs an {@code InputMethodEvent} with the specified * source component, type, text, caret, and visiblePosition. *

          * The offsets of caret and visiblePosition are relative to the current - * composed text; that is, the composed text within text - * if this is an INPUT_METHOD_TEXT_CHANGED event, - * the composed text within the text of the - * preceding INPUT_METHOD_TEXT_CHANGED event otherwise. + * composed text; that is, the composed text within {@code text} + * if this is an {@code INPUT_METHOD_TEXT_CHANGED} event, + * the composed text within the {@code text} of the + * preceding {@code INPUT_METHOD_TEXT_CHANGED} event otherwise. * The time stamp for this event is initialized by invoking * {@link java.awt.EventQueue#getMostRecentEventTime()}. - *

          Note that passing in an invalid id results in + *

          Note that passing in an invalid {@code id} results in * unspecified behavior. This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * * @param source the object where the event originated * @param id the event type * @param text the combined committed and composed text, - * committed text first; must be null - * when the event type is CARET_POSITION_CHANGED; - * may be null for - * INPUT_METHOD_TEXT_CHANGED if there's no + * committed text first; must be {@code null} + * when the event type is {@code CARET_POSITION_CHANGED}; + * may be {@code null} for + * {@code INPUT_METHOD_TEXT_CHANGED} if there's no * committed or composed text * @param committedCharacterCount the number of committed * characters in the text * @param caret the caret (a.k.a. insertion point); - * null if there's no caret within current + * {@code null} if there's no caret within current * composed text * @param visiblePosition the position that's most important - * to be visible; null if there's no + * to be visible; {@code null} if there's no * recommendation for a visible position within current * composed text - * @throws IllegalArgumentException if id is not + * @throws IllegalArgumentException if {@code id} is not * in the range - * INPUT_METHOD_FIRST..INPUT_METHOD_LAST; - * or if id is CARET_POSITION_CHANGED and - * text is not null; - * or if committedCharacterCount is not in the range - * 0..(text.getEndIndex() - text.getBeginIndex()) - * @throws IllegalArgumentException if source is null + * {@code INPUT_METHOD_FIRST}..{@code INPUT_METHOD_LAST}; + * or if id is {@code CARET_POSITION_CHANGED} and + * {@code text} is not {@code null}; + * or if {@code committedCharacterCount} is not in the range + * {@code 0}..{@code (text.getEndIndex() - text.getBeginIndex())} + * @throws IllegalArgumentException if {@code source} is null */ public InputMethodEvent(Component source, int id, AttributedCharacterIterator text, int committedCharacterCount, @@ -228,39 +228,39 @@ public class InputMethodEvent extends AWTEvent { } /** - * Constructs an InputMethodEvent with the + * Constructs an {@code InputMethodEvent} with the * specified source component, type, caret, and visiblePosition. - * The text is set to null, - * committedCharacterCount to 0. + * The text is set to {@code null}, + * {@code committedCharacterCount} to 0. *

          - * The offsets of caret and visiblePosition + * The offsets of {@code caret} and {@code visiblePosition} * are relative to the current composed text; that is, - * the composed text within the text of the - * preceding INPUT_METHOD_TEXT_CHANGED event if the - * event being constructed as a CARET_POSITION_CHANGED event. - * For an INPUT_METHOD_TEXT_CHANGED event without text, - * caret and visiblePosition must be - * null. + * the composed text within the {@code text} of the + * preceding {@code INPUT_METHOD_TEXT_CHANGED} event if the + * event being constructed as a {@code CARET_POSITION_CHANGED} event. + * For an {@code INPUT_METHOD_TEXT_CHANGED} event without text, + * {@code caret} and {@code visiblePosition} must be + * {@code null}. * The time stamp for this event is initialized by invoking * {@link java.awt.EventQueue#getMostRecentEventTime()}. - *

          Note that passing in an invalid id results in + *

          Note that passing in an invalid {@code id} results in * unspecified behavior. This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * * @param source the object where the event originated * @param id the event type * @param caret the caret (a.k.a. insertion point); - * null if there's no caret within current + * {@code null} if there's no caret within current * composed text * @param visiblePosition the position that's most important - * to be visible; null if there's no + * to be visible; {@code null} if there's no * recommendation for a visible position within current * composed text - * @throws IllegalArgumentException if id is not + * @throws IllegalArgumentException if {@code id} is not * in the range - * INPUT_METHOD_FIRST..INPUT_METHOD_LAST - * @throws IllegalArgumentException if source is null + * {@code INPUT_METHOD_FIRST}..{@code INPUT_METHOD_LAST} + * @throws IllegalArgumentException if {@code source} is null */ public InputMethodEvent(Component source, int id, TextHitInfo caret, TextHitInfo visiblePosition) { @@ -271,7 +271,7 @@ public class InputMethodEvent extends AWTEvent { /** * Gets the combined committed and composed text. - * Characters from index 0 to index getCommittedCharacterCount() - 1 are committed + * Characters from index 0 to index {@code getCommittedCharacterCount() - 1} are committed * text, the remaining characters are composed text. * * @return the text. @@ -295,9 +295,9 @@ public class InputMethodEvent extends AWTEvent { *

          * The offset of the caret is relative to the current * composed text; that is, the composed text within getText() - * if this is an INPUT_METHOD_TEXT_CHANGED event, + * if this is an {@code INPUT_METHOD_TEXT_CHANGED} event, * the composed text within getText() of the - * preceding INPUT_METHOD_TEXT_CHANGED event otherwise. + * preceding {@code INPUT_METHOD_TEXT_CHANGED} event otherwise. * * @return the caret (a.k.a. insertion point). * Null if there's no caret within current composed text. @@ -311,9 +311,9 @@ public class InputMethodEvent extends AWTEvent { *

          * The offset of the visible position is relative to the current * composed text; that is, the composed text within getText() - * if this is an INPUT_METHOD_TEXT_CHANGED event, + * if this is an {@code INPUT_METHOD_TEXT_CHANGED} event, * the composed text within getText() of the - * preceding INPUT_METHOD_TEXT_CHANGED event otherwise. + * preceding {@code INPUT_METHOD_TEXT_CHANGED} event otherwise. * * @return the position that's most important to be visible. * Null if there's no recommendation for a visible position within current composed text. @@ -411,7 +411,7 @@ public class InputMethodEvent extends AWTEvent { } /** - * Initializes the when field if it is not present in the + * Initializes the {@code when} field if it is not present in the * object input stream. In that case, the field will be initialized by * invoking {@link java.awt.EventQueue#getMostRecentEventTime()}. */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ItemEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/ItemEvent.java index 34e3b5b01db..37a0c5f0084 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ItemEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ItemEvent.java @@ -32,12 +32,12 @@ import java.awt.ItemSelectable; * A semantic event which indicates that an item was selected or deselected. * This high-level event is generated by an ItemSelectable object (such as a * List) when an item is selected or deselected by the user. - * The event is passed to every ItemListener object which + * The event is passed to every {@code ItemListener} object which * registered to receive such events using the component's - * addItemListener method. + * {@code addItemListener} method. *

          - * The object that implements the ItemListener interface gets - * this ItemEvent when the event occurs. The listener is + * The object that implements the {@code ItemListener} interface gets + * this {@code ItemEvent} when the event occurs. The listener is * spared the details of processing individual mouse movements and mouse * clicks, and can instead process a "meaningful" (semantic) event like * "item selected" or "item deselected". @@ -98,7 +98,7 @@ public class ItemEvent extends AWTEvent { Object item; /** - * stateChange indicates whether the item + * {@code stateChange} indicates whether the {@code item} * was selected or deselected. * * @serial @@ -112,12 +112,12 @@ public class ItemEvent extends AWTEvent { private static final long serialVersionUID = -608708132447206933L; /** - * Constructs an ItemEvent object. + * Constructs an {@code ItemEvent} object. *

          This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The ItemSelectable object + * @param source The {@code ItemSelectable} object * that originated the event * @param id The integer that identifies the event type. * For information on allowable values, see @@ -127,7 +127,7 @@ public class ItemEvent extends AWTEvent { * selected or deselected. * For information on allowable values, see * the class description for {@link ItemEvent} - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getItemSelectable() * @see #getID() * @see #getStateChange() diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ItemListener.java b/jdk/src/java.desktop/share/classes/java/awt/event/ItemListener.java index 8d2cde627cc..c1533a3c3f8 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ItemListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ItemListener.java @@ -32,9 +32,9 @@ import java.util.EventListener; * The class that is interested in processing an item event * implements this interface. The object created with that * class is then registered with a component using the - * component's addItemListener method. When an + * component's {@code addItemListener} method. When an * item-selection event occurs, the listener object's - * itemStateChanged method is invoked. + * {@code itemStateChanged} method is invoked. * * @author Amy Fowler * diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/KeyAdapter.java b/jdk/src/java.desktop/share/classes/java/awt/event/KeyAdapter.java index 846da09af14..12a8a6544a1 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/KeyAdapter.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/KeyAdapter.java @@ -30,17 +30,17 @@ package java.awt.event; * The methods in this class are empty. This class exists as * convenience for creating listener objects. *

          - * Extend this class to create a KeyEvent listener + * Extend this class to create a {@code KeyEvent} listener * and override the methods for the events of interest. (If you implement the - * KeyListener interface, you have to define all of + * {@code KeyListener} interface, you have to define all of * the methods in it. This abstract class defines null methods for them * all, so you can only have to define methods for events you care about.) *

          * Create a listener object using the extended class and then register it with - * a component using the component's addKeyListener + * a component using the component's {@code addKeyListener} * method. When a key is pressed, released, or typed, * the relevant method in the listener object is invoked, - * and the KeyEvent is passed to it. + * and the {@code KeyEvent} is passed to it. * * @author Carl Quinn * diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/KeyEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/KeyEvent.java index b8cbea6052e..f103d525271 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/KeyEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/KeyEvent.java @@ -37,12 +37,12 @@ import sun.awt.AWTAccessor; *

          * This low-level event is generated by a component object (such as a text * field) when a key is pressed, released, or typed. - * The event is passed to every KeyListener - * or KeyAdapter object which registered to receive such - * events using the component's addKeyListener method. - * (KeyAdapter objects implement the - * KeyListener interface.) Each such listener object - * gets this KeyEvent when the event occurs. + * The event is passed to every {@code KeyListener} + * or {@code KeyAdapter} object which registered to receive such + * events using the component's {@code addKeyListener} method. + * ({@code KeyAdapter} objects implement the + * {@code KeyListener} interface.) Each such listener object + * gets this {@code KeyEvent} when the event occurs. *

          * "Key typed" events are higher-level and generally do not depend on * the platform or keyboard layout. They are generated when a Unicode character @@ -974,7 +974,7 @@ public class KeyEvent extends InputEvent { /** * A constant indicating that the keyLocation is indeterminate * or not relevant. - * KEY_TYPED events do not have a keyLocation; this value + * {@code KEY_TYPED} events do not have a keyLocation; this value * is used instead. * @since 1.4 */ @@ -1028,7 +1028,7 @@ public class KeyEvent extends InputEvent { int keyCode; /** - * keyChar is a valid unicode character + * {@code keyChar} is a valid unicode character * that is fired by a key or a key combination on * a keyboard. * @@ -1045,9 +1045,9 @@ public class KeyEvent extends InputEvent { * right shift keys. Additionally, some keys occur on the numeric * keypad. This variable is used to distinguish such keys. * - * The only legal values are KEY_LOCATION_UNKNOWN, - * KEY_LOCATION_STANDARD, KEY_LOCATION_LEFT, - * KEY_LOCATION_RIGHT, and KEY_LOCATION_NUMPAD. + * The only legal values are {@code KEY_LOCATION_UNKNOWN}, + * {@code KEY_LOCATION_STANDARD}, {@code KEY_LOCATION_LEFT}, + * {@code KEY_LOCATION_RIGHT}, and {@code KEY_LOCATION_NUMPAD}. * * @serial * @see #getKeyLocation() @@ -1115,12 +1115,12 @@ public class KeyEvent extends InputEvent { } /** - * Constructs a KeyEvent object. + * Constructs a {@code KeyEvent} object. *

          This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Component that originated the event + * @param source The {@code Component} that originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link KeyEvent} @@ -1142,19 +1142,19 @@ public class KeyEvent extends InputEvent { * CHAR_UNDEFINED (for key-pressed and key-released * events which do not map to a valid Unicode character) * @param keyLocation Identifies the key location. The only legal - * values are KEY_LOCATION_UNKNOWN, - * KEY_LOCATION_STANDARD, KEY_LOCATION_LEFT, - * KEY_LOCATION_RIGHT, and KEY_LOCATION_NUMPAD. + * values are {@code KEY_LOCATION_UNKNOWN}, + * {@code KEY_LOCATION_STANDARD}, {@code KEY_LOCATION_LEFT}, + * {@code KEY_LOCATION_RIGHT}, and {@code KEY_LOCATION_NUMPAD}. * @throws IllegalArgumentException - * if id is KEY_TYPED and - * keyChar is CHAR_UNDEFINED; - * or if id is KEY_TYPED and - * keyCode is not VK_UNDEFINED; - * or if id is KEY_TYPED and - * keyLocation is not KEY_LOCATION_UNKNOWN; - * or if keyLocation is not one of the legal + * if {@code id} is {@code KEY_TYPED} and + * {@code keyChar} is {@code CHAR_UNDEFINED}; + * or if {@code id} is {@code KEY_TYPED} and + * {@code keyCode} is not {@code VK_UNDEFINED}; + * or if {@code id} is {@code KEY_TYPED} and + * {@code keyLocation} is not {@code KEY_LOCATION_UNKNOWN}; + * or if {@code keyLocation} is not one of the legal * values enumerated above. - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getSource() * @see #getID() * @see #getWhen() @@ -1196,12 +1196,12 @@ public class KeyEvent extends InputEvent { } /** - * Constructs a KeyEvent object. + * Constructs a {@code KeyEvent} object. *

          This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Component that originated the event + * @param source The {@code Component} that originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link KeyEvent} @@ -1222,12 +1222,12 @@ public class KeyEvent extends InputEvent { * @param keyChar The Unicode character generated by this event, or * CHAR_UNDEFINED (for key-pressed and key-released * events which do not map to a valid Unicode character) - * @throws IllegalArgumentException if id is - * KEY_TYPED and keyChar is - * CHAR_UNDEFINED; or if id is - * KEY_TYPED and keyCode is not - * VK_UNDEFINED - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code id} is + * {@code KEY_TYPED} and {@code keyChar} is + * {@code CHAR_UNDEFINED}; or if {@code id} is + * {@code KEY_TYPED} and {@code keyCode} is not + * {@code VK_UNDEFINED} + * @throws IllegalArgumentException if {@code source} is null * @see #getSource() * @see #getID() * @see #getWhen() @@ -1243,7 +1243,7 @@ public class KeyEvent extends InputEvent { /** * @deprecated as of JDK1.1; use {@link #KeyEvent(Component, int, long, int, int, char)} instead - * @param source The Component that originated the event + * @param source The {@code Component} that originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link KeyEvent} @@ -1272,8 +1272,8 @@ public class KeyEvent extends InputEvent { * Returns the integer keyCode associated with the key in this event. * * @return the integer code for an actual key on the keyboard. - * (For KEY_TYPED events, the keyCode is - * VK_UNDEFINED.) + * (For {@code KEY_TYPED} events, the keyCode is + * {@code VK_UNDEFINED}.) */ public int getKeyCode() { return keyCode; @@ -1290,17 +1290,17 @@ public class KeyEvent extends InputEvent { /** * Returns the character associated with the key in this event. - * For example, the KEY_TYPED event for shift + "a" + * For example, the {@code KEY_TYPED} event for shift + "a" * returns the value for "A". *

          - * KEY_PRESSED and KEY_RELEASED events + * {@code KEY_PRESSED} and {@code KEY_RELEASED} events * are not intended for reporting of character input. Therefore, * the values returned by this method are guaranteed to be - * meaningful only for KEY_TYPED events. + * meaningful only for {@code KEY_TYPED} events. * * @return the Unicode character defined for this key event. * If no valid Unicode character exists for this key event, - * CHAR_UNDEFINED is returned. + * {@code CHAR_UNDEFINED} is returned. */ public char getKeyChar() { return keyChar; @@ -1322,7 +1322,7 @@ public class KeyEvent extends InputEvent { *

          * NOTE: use of this method is not recommended, because many AWT * implementations do not recognize modifier changes. This is - * especially true for KEY_TYPED events where the shift + * especially true for {@code KEY_TYPED} events where the shift * modifier is changed. * * @param modifiers an integer combination of the modifier constants. @@ -1347,8 +1347,8 @@ public class KeyEvent extends InputEvent { * keypad. This provides a way of distinguishing such keys. * * @return the location of the key that was pressed or released. - * Always returns KEY_LOCATION_UNKNOWN for - * KEY_TYPED events. + * Always returns {@code KEY_LOCATION_UNKNOWN} for + * {@code KEY_TYPED} events. * @since 1.4 */ public int getKeyLocation() { @@ -1541,15 +1541,15 @@ public class KeyEvent extends InputEvent { } /** - * Returns a String describing the modifier key(s), + * Returns a {@code String} describing the modifier key(s), * such as "Shift", or "Ctrl+Shift". These strings can be - * localized by changing the awt.properties file. + * localized by changing the {@code awt.properties} file. *

          - * Note that InputEvent.ALT_MASK and - * InputEvent.BUTTON2_MASK have the same value, + * Note that {@code InputEvent.ALT_MASK} and + * {@code InputEvent.BUTTON2_MASK} have the same value, * so the string "Alt" is returned for both modifiers. Likewise, - * InputEvent.META_MASK and - * InputEvent.BUTTON3_MASK have the same value, + * {@code InputEvent.META_MASK} and + * {@code InputEvent.BUTTON3_MASK} have the same value, * so the string "Meta" is returned for both modifiers. * * @param modifiers the modifier mask to be processed @@ -1595,8 +1595,8 @@ public class KeyEvent extends InputEvent { * Typically an action key does not fire a unicode character and is * not a modifier key. * - * @return true if the key is an "action" key, - * false otherwise + * @return {@code true} if the key is an "action" key, + * {@code false} otherwise */ public boolean isActionKey() { switch (keyCode) { diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/KeyListener.java b/jdk/src/java.desktop/share/classes/java/awt/event/KeyListener.java index 1a8ba31bae0..622c6b43991 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/KeyListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/KeyListener.java @@ -31,14 +31,14 @@ import java.util.EventListener; * The listener interface for receiving keyboard events (keystrokes). * The class that is interested in processing a keyboard event * either implements this interface (and all the methods it - * contains) or extends the abstract KeyAdapter class + * contains) or extends the abstract {@code KeyAdapter} class * (overriding only the methods of interest). *

          * The listener object created from that class is then registered with a - * component using the component's addKeyListener + * component using the component's {@code addKeyListener} * method. A keyboard event is generated when a key is pressed, released, * or typed. The relevant method in the listener - * object is then invoked, and the KeyEvent is passed to it. + * object is then invoked, and the {@code KeyEvent} is passed to it. * * @author Carl Quinn * diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/MouseEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/MouseEvent.java index de522828a4d..2ae987b8144 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/MouseEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/MouseEvent.java @@ -526,13 +526,15 @@ public class MouseEvent extends InputEvent { * {@link java.awt.MouseInfo#getNumberOfButtons() MouseInfo.getNumberOfButtons()} * if the mouse has more than three buttons. *

        - * @throws IllegalArgumentException if {@code button} is less then zero + * @throws IllegalArgumentException if {@code button} is less than zero * @throws IllegalArgumentException if {@code source} is null - * @throws IllegalArgumentException if {@code button} is greater then BUTTON3 and the support for extended mouse buttons is + * @throws IllegalArgumentException if {@code button} is greater than BUTTON3 + * and the support for extended mouse buttons is * {@link Toolkit#areExtraMouseButtonsEnabled() disabled} by Java - * @throws IllegalArgumentException if {@code button} is greater then the - * {@link java.awt.MouseInfo#getNumberOfButtons() current number of buttons} and the support - * for extended mouse buttons is {@link Toolkit#areExtraMouseButtonsEnabled() enabled} + * @throws IllegalArgumentException if {@code button} is greater than the + * {@link java.awt.MouseInfo#getNumberOfButtons() current number of buttons} + * and the support for extended mouse buttons is + * {@link Toolkit#areExtraMouseButtonsEnabled() enabled} * by Java * @throws IllegalArgumentException if an invalid {@code button} * value is passed in @@ -701,12 +703,14 @@ public class MouseEvent extends InputEvent { * {@link java.awt.MouseInfo#getNumberOfButtons() MouseInfo.getNumberOfButtons()} * if the mouse has more than three buttons. *
      - * @throws IllegalArgumentException if {@code button} is less then zero + * @throws IllegalArgumentException if {@code button} is less than zero * @throws IllegalArgumentException if {@code source} is null - * @throws IllegalArgumentException if {@code button} is greater then BUTTON3 and the support for extended mouse buttons is + * @throws IllegalArgumentException if {@code button} is greater than BUTTON3 + * and the support for extended mouse buttons is * {@link Toolkit#areExtraMouseButtonsEnabled() disabled} by Java - * @throws IllegalArgumentException if {@code button} is greater then the - * {@link java.awt.MouseInfo#getNumberOfButtons() current number of buttons} and the support + * @throws IllegalArgumentException if {@code button} is greater than the + * {@link java.awt.MouseInfo#getNumberOfButtons() + * current number of buttons} and the support * for extended mouse buttons is {@link Toolkit#areExtraMouseButtonsEnabled() enabled} * by Java * @throws IllegalArgumentException if an invalid {@code button} @@ -865,7 +869,8 @@ public class MouseEvent extends InputEvent { *
    5. 2 ({@code BUTTON2}) *
    6. 3 ({@code BUTTON3}) * - * Button numbers greater then {@code BUTTON3} have no constant identifier. So if a mouse with five buttons is + * Button numbers greater than {@code BUTTON3} have no constant identifier. + * So if a mouse with five buttons is * installed, this method may return the following values: * *

      * A Java Print Service instance is allowed to support any other doc flavors @@ -390,7 +390,7 @@ import java.io.Serializable; *

      * Class DocFlavor in package javax.print.data is similar to class * {@link java.awt.datatransfer.DataFlavor DataFlavor}. Class - * DataFlavor + * {@code DataFlavor} * is not used in the Java Print Service (JPS) API * for three reasons which are all rooted in allowing the JPS API to be * shared by other print services APIs which may need to run on Java profiles @@ -401,13 +401,13 @@ import java.io.Serializable; * AWT. * *

    7. - * The implementation of class java.awt.datatransfer.DataFlavor + * The implementation of class {@code java.awt.datatransfer.DataFlavor} * does not guarantee that equivalent data flavors will have the same * serialized representation. DocFlavor does, and can be used in services * which need this. * *
    8. - * The implementation of class java.awt.datatransfer.DataFlavor + * The implementation of class {@code java.awt.datatransfer.DataFlavor} * includes a human presentable name as part of the serialized representation. * This is not appropriate as part of a service matching constraint. * @@ -488,10 +488,10 @@ public class DocFlavor implements Serializable, Cloneable { * @param className Fully-qualified representation class name. * * @exception NullPointerException - * (unchecked exception) Thrown if mimeType is null or - * className is null. + * (unchecked exception) Thrown if {@code mimeType} is null or + * {@code className} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if mimeType does not + * (unchecked exception) Thrown if {@code mimeType} does not * obey the syntax for a MIME media type string. */ public DocFlavor(String mimeType, String className) { @@ -528,7 +528,7 @@ public class DocFlavor implements Serializable, Cloneable { } /** - * Returns a String representing a MIME + * Returns a {@code String} representing a MIME * parameter. * Mime types may include parameters which are usually optional. * The charset for text types is a commonly useful example. @@ -555,7 +555,7 @@ public class DocFlavor implements Serializable, Cloneable { } /** - * Converts this DocFlavor to a string. + * Converts this {@code DocFlavor} to a string. * * @return MIME type string based on the canonical form. Each parameter * value is enclosed in quotes. @@ -576,7 +576,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Determines if this doc flavor object is equal to the given object. * The two are equal if the given object is not null, is an instance - * of DocFlavor, has a MIME type equivalent to this doc + * of {@code DocFlavor}, has a MIME type equivalent to this doc * flavor object's MIME type (that is, the MIME types have the same media * type, media subtype, and parameters), and has the same representation * class name as this doc flavor object. Thus, if two doc flavor objects' @@ -588,7 +588,7 @@ public class DocFlavor implements Serializable, Cloneable { * * @param obj Object to test. * - * @return True if this doc flavor object equals obj, false + * @return True if this doc flavor object equals {@code obj}, false * otherwise. */ public boolean equals(Object obj) { @@ -642,7 +642,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Class DocFlavor.BYTE_ARRAY provides predefined static constant * DocFlavor objects for example doc flavors using a byte array - * (byte[]) as the print data representation class. + * ({@code byte[]}) as the print data representation class. * * @author Alan Kaminsky */ @@ -652,14 +652,14 @@ public class DocFlavor implements Serializable, Cloneable { /** * Constructs a new doc flavor with the given MIME type and a print - * data representation class name of "[B" (byte array). + * data representation class name of {@code "[B"} (byte array). * * @param mimeType MIME media type string. * * @exception NullPointerException - * (unchecked exception) Thrown if mimeType is null. + * (unchecked exception) Thrown if {@code mimeType} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if mimeType does not + * (unchecked exception) Thrown if {@code mimeType} does not * obey the syntax for a MIME media type string. */ public BYTE_ARRAY (String mimeType) { @@ -667,19 +667,19 @@ public class DocFlavor implements Serializable, Cloneable { } /** - * Doc flavor with MIME type = "text/plain", + * Doc flavor with MIME type = {@code "text/plain"}, * encoded in the host platform encoding. * See {@link DocFlavor#hostEncoding hostEncoding} * Print data representation class name = - * "[B" (byte array). + * {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_PLAIN_HOST = new BYTE_ARRAY ("text/plain; charset="+hostEncoding); /** * Doc flavor with MIME type = - * "text/plain; charset=utf-8", - * print data representation class name = "[B" (byte + * {@code "text/plain; charset=utf-8"}, + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY TEXT_PLAIN_UTF_8 = @@ -687,8 +687,8 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = - * "text/plain; charset=utf-16", - * print data representation class name = "[B" (byte + * {@code "text/plain; charset=utf-16"}, + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY TEXT_PLAIN_UTF_16 = @@ -697,9 +697,9 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = - * "text/plain; charset=utf-16be" + * {@code "text/plain; charset=utf-16be"} * (big-endian byte ordering), - * print data representation class name = "[B" (byte + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY TEXT_PLAIN_UTF_16BE = @@ -707,9 +707,9 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = - * "text/plain; charset=utf-16le" + * {@code "text/plain; charset=utf-16le"} * (little-endian byte ordering), - * print data representation class name = "[B" (byte + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY TEXT_PLAIN_UTF_16LE = @@ -717,28 +717,28 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = - * "text/plain; charset=us-ascii", + * {@code "text/plain; charset=us-ascii"}, * print data representation class name = - * "[B" (byte array). + * {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_PLAIN_US_ASCII = new BYTE_ARRAY ("text/plain; charset=us-ascii"); /** - * Doc flavor with MIME type = "text/html", + * Doc flavor with MIME type = {@code "text/html"}, * encoded in the host platform encoding. * See {@link DocFlavor#hostEncoding hostEncoding} * Print data representation class name = - * "[B" (byte array). + * {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_HTML_HOST = new BYTE_ARRAY ("text/html; charset="+hostEncoding); /** * Doc flavor with MIME type = - * "text/html; charset=utf-8", - * print data representation class name = "[B" (byte + * {@code "text/html; charset=utf-8"}, + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY TEXT_HTML_UTF_8 = @@ -746,8 +746,8 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = - * "text/html; charset=utf-16", - * print data representation class name = "[B" (byte + * {@code "text/html; charset=utf-16"}, + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY TEXT_HTML_UTF_16 = @@ -755,9 +755,9 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = - * "text/html; charset=utf-16be" + * {@code "text/html; charset=utf-16be"} * (big-endian byte ordering), - * print data representation class name = "[B" (byte + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY TEXT_HTML_UTF_16BE = @@ -765,9 +765,9 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = - * "text/html; charset=utf-16le" + * {@code "text/html; charset=utf-16le"} * (little-endian byte ordering), - * print data representation class name = "[B" (byte + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY TEXT_HTML_UTF_16LE = @@ -775,58 +775,58 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = - * "text/html; charset=us-ascii", + * {@code "text/html; charset=us-ascii"}, * print data representation class name = - * "[B" (byte array). + * {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_HTML_US_ASCII = new BYTE_ARRAY ("text/html; charset=us-ascii"); /** - * Doc flavor with MIME type = "application/pdf", print - * data representation class name = "[B" (byte array). + * Doc flavor with MIME type = {@code "application/pdf"}, print + * data representation class name = {@code "[B"} (byte array). */ public static final BYTE_ARRAY PDF = new BYTE_ARRAY ("application/pdf"); /** - * Doc flavor with MIME type = "application/postscript", - * print data representation class name = "[B" (byte + * Doc flavor with MIME type = {@code "application/postscript"}, + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY POSTSCRIPT = new BYTE_ARRAY ("application/postscript"); /** - * Doc flavor with MIME type = "application/vnd.hp-PCL", - * print data representation class name = "[B" (byte + * Doc flavor with MIME type = {@code "application/vnd.hp-PCL"}, + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY PCL = new BYTE_ARRAY ("application/vnd.hp-PCL"); /** - * Doc flavor with MIME type = "image/gif", print data - * representation class name = "[B" (byte array). + * Doc flavor with MIME type = {@code "image/gif"}, print data + * representation class name = {@code "[B"} (byte array). */ public static final BYTE_ARRAY GIF = new BYTE_ARRAY ("image/gif"); /** - * Doc flavor with MIME type = "image/jpeg", print data - * representation class name = "[B" (byte array). + * Doc flavor with MIME type = {@code "image/jpeg"}, print data + * representation class name = {@code "[B"} (byte array). */ public static final BYTE_ARRAY JPEG = new BYTE_ARRAY ("image/jpeg"); /** - * Doc flavor with MIME type = "image/png", print data - * representation class name = "[B" (byte array). + * Doc flavor with MIME type = {@code "image/png"}, print data + * representation class name = {@code "[B"} (byte array). */ public static final BYTE_ARRAY PNG = new BYTE_ARRAY ("image/png"); /** * Doc flavor with MIME type = - * "application/octet-stream", - * print data representation class name = "[B" (byte + * {@code "application/octet-stream"}, + * print data representation class name = {@code "[B"} (byte * array). The client must determine that data described * using this DocFlavor is valid for the printer. */ @@ -850,14 +850,14 @@ public class DocFlavor implements Serializable, Cloneable { /** * Constructs a new doc flavor with the given MIME type and a print * data representation class name of - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). * * @param mimeType MIME media type string. * * @exception NullPointerException - * (unchecked exception) Thrown if mimeType is null. + * (unchecked exception) Thrown if {@code mimeType} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if mimeType does not + * (unchecked exception) Thrown if {@code mimeType} does not * obey the syntax for a MIME media type string. */ public INPUT_STREAM (String mimeType) { @@ -865,169 +865,169 @@ public class DocFlavor implements Serializable, Cloneable { } /** - * Doc flavor with MIME type = "text/plain", + * Doc flavor with MIME type = {@code "text/plain"}, * encoded in the host platform encoding. * See {@link DocFlavor#hostEncoding hostEncoding} * Print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_PLAIN_HOST = new INPUT_STREAM ("text/plain; charset="+hostEncoding); /** * Doc flavor with MIME type = - * "text/plain; charset=utf-8", + * {@code "text/plain; charset=utf-8"}, * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_PLAIN_UTF_8 = new INPUT_STREAM ("text/plain; charset=utf-8"); /** * Doc flavor with MIME type = - * "text/plain; charset=utf-16", + * {@code "text/plain; charset=utf-16"}, * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_PLAIN_UTF_16 = new INPUT_STREAM ("text/plain; charset=utf-16"); /** * Doc flavor with MIME type = - * "text/plain; charset=utf-16be" + * {@code "text/plain; charset=utf-16be"} * (big-endian byte ordering), * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_PLAIN_UTF_16BE = new INPUT_STREAM ("text/plain; charset=utf-16be"); /** * Doc flavor with MIME type = - * "text/plain; charset=utf-16le" + * {@code "text/plain; charset=utf-16le"} * (little-endian byte ordering), * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_PLAIN_UTF_16LE = new INPUT_STREAM ("text/plain; charset=utf-16le"); /** * Doc flavor with MIME type = - * "text/plain; charset=us-ascii", + * {@code "text/plain; charset=us-ascii"}, * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_PLAIN_US_ASCII = new INPUT_STREAM ("text/plain; charset=us-ascii"); /** - * Doc flavor with MIME type = "text/html", + * Doc flavor with MIME type = {@code "text/html"}, * encoded in the host platform encoding. * See {@link DocFlavor#hostEncoding hostEncoding} * Print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_HTML_HOST = new INPUT_STREAM ("text/html; charset="+hostEncoding); /** * Doc flavor with MIME type = - * "text/html; charset=utf-8", + * {@code "text/html; charset=utf-8"}, * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_HTML_UTF_8 = new INPUT_STREAM ("text/html; charset=utf-8"); /** * Doc flavor with MIME type = - * "text/html; charset=utf-16", + * {@code "text/html; charset=utf-16"}, * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_HTML_UTF_16 = new INPUT_STREAM ("text/html; charset=utf-16"); /** * Doc flavor with MIME type = - * "text/html; charset=utf-16be" + * {@code "text/html; charset=utf-16be"} * (big-endian byte ordering), * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_HTML_UTF_16BE = new INPUT_STREAM ("text/html; charset=utf-16be"); /** * Doc flavor with MIME type = - * "text/html; charset=utf-16le" + * {@code "text/html; charset=utf-16le"} * (little-endian byte ordering), * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_HTML_UTF_16LE = new INPUT_STREAM ("text/html; charset=utf-16le"); /** * Doc flavor with MIME type = - * "text/html; charset=us-ascii", + * {@code "text/html; charset=us-ascii"}, * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_HTML_US_ASCII = new INPUT_STREAM ("text/html; charset=us-ascii"); /** - * Doc flavor with MIME type = "application/pdf", print - * data representation class name = "java.io.InputStream" + * Doc flavor with MIME type = {@code "application/pdf"}, print + * data representation class name = {@code "java.io.InputStream"} * (byte stream). */ public static final INPUT_STREAM PDF = new INPUT_STREAM ("application/pdf"); /** - * Doc flavor with MIME type = "application/postscript", + * Doc flavor with MIME type = {@code "application/postscript"}, * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM POSTSCRIPT = new INPUT_STREAM ("application/postscript"); /** - * Doc flavor with MIME type = "application/vnd.hp-PCL", + * Doc flavor with MIME type = {@code "application/vnd.hp-PCL"}, * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM PCL = new INPUT_STREAM ("application/vnd.hp-PCL"); /** - * Doc flavor with MIME type = "image/gif", print data + * Doc flavor with MIME type = {@code "image/gif"}, print data * representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM GIF = new INPUT_STREAM ("image/gif"); /** - * Doc flavor with MIME type = "image/jpeg", print data + * Doc flavor with MIME type = {@code "image/jpeg"}, print data * representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM JPEG = new INPUT_STREAM ("image/jpeg"); /** - * Doc flavor with MIME type = "image/png", print data + * Doc flavor with MIME type = {@code "image/png"}, print data * representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM PNG = new INPUT_STREAM ("image/png"); /** * Doc flavor with MIME type = - * "application/octet-stream", + * {@code "application/octet-stream"}, * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). * The client must determine that data described * using this DocFlavor is valid for the printer. */ @@ -1050,14 +1050,14 @@ public class DocFlavor implements Serializable, Cloneable { /** * Constructs a new doc flavor with the given MIME type and a print - * data representation class name of "java.net.URL". + * data representation class name of {@code "java.net.URL"}. * * @param mimeType MIME media type string. * * @exception NullPointerException - * (unchecked exception) Thrown if mimeType is null. + * (unchecked exception) Thrown if {@code mimeType} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if mimeType does not + * (unchecked exception) Thrown if {@code mimeType} does not * obey the syntax for a MIME media type string. */ public URL (String mimeType) { @@ -1065,160 +1065,160 @@ public class DocFlavor implements Serializable, Cloneable { } /** - * Doc flavor with MIME type = "text/plain", + * Doc flavor with MIME type = {@code "text/plain"}, * encoded in the host platform encoding. * See {@link DocFlavor#hostEncoding hostEncoding} * Print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_PLAIN_HOST = new URL ("text/plain; charset="+hostEncoding); /** * Doc flavor with MIME type = - * "text/plain; charset=utf-8", + * {@code "text/plain; charset=utf-8"}, * print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_PLAIN_UTF_8 = new URL ("text/plain; charset=utf-8"); /** * Doc flavor with MIME type = - * "text/plain; charset=utf-16", + * {@code "text/plain; charset=utf-16"}, * print data representation class name = - * java.net.URL"" (byte stream). + * {@code java.net.URL""} (byte stream). */ public static final URL TEXT_PLAIN_UTF_16 = new URL ("text/plain; charset=utf-16"); /** * Doc flavor with MIME type = - * "text/plain; charset=utf-16be" + * {@code "text/plain; charset=utf-16be"} * (big-endian byte ordering), * print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_PLAIN_UTF_16BE = new URL ("text/plain; charset=utf-16be"); /** * Doc flavor with MIME type = - * "text/plain; charset=utf-16le" + * {@code "text/plain; charset=utf-16le"} * (little-endian byte ordering), * print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_PLAIN_UTF_16LE = new URL ("text/plain; charset=utf-16le"); /** * Doc flavor with MIME type = - * "text/plain; charset=us-ascii", + * {@code "text/plain; charset=us-ascii"}, * print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_PLAIN_US_ASCII = new URL ("text/plain; charset=us-ascii"); /** - * Doc flavor with MIME type = "text/html", + * Doc flavor with MIME type = {@code "text/html"}, * encoded in the host platform encoding. * See {@link DocFlavor#hostEncoding hostEncoding} * Print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_HTML_HOST = new URL ("text/html; charset="+hostEncoding); /** * Doc flavor with MIME type = - * "text/html; charset=utf-8", + * {@code "text/html; charset=utf-8"}, * print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_HTML_UTF_8 = new URL ("text/html; charset=utf-8"); /** * Doc flavor with MIME type = - * "text/html; charset=utf-16", + * {@code "text/html; charset=utf-16"}, * print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_HTML_UTF_16 = new URL ("text/html; charset=utf-16"); /** * Doc flavor with MIME type = - * "text/html; charset=utf-16be" + * {@code "text/html; charset=utf-16be"} * (big-endian byte ordering), * print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_HTML_UTF_16BE = new URL ("text/html; charset=utf-16be"); /** * Doc flavor with MIME type = - * "text/html; charset=utf-16le" + * {@code "text/html; charset=utf-16le"} * (little-endian byte ordering), * print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_HTML_UTF_16LE = new URL ("text/html; charset=utf-16le"); /** * Doc flavor with MIME type = - * "text/html; charset=us-ascii", + * {@code "text/html; charset=us-ascii"}, * print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_HTML_US_ASCII = new URL ("text/html; charset=us-ascii"); /** - * Doc flavor with MIME type = "application/pdf", print - * data representation class name = "java.net.URL". + * Doc flavor with MIME type = {@code "application/pdf"}, print + * data representation class name = {@code "java.net.URL"}. */ public static final URL PDF = new URL ("application/pdf"); /** - * Doc flavor with MIME type = "application/postscript", - * print data representation class name = "java.net.URL". + * Doc flavor with MIME type = {@code "application/postscript"}, + * print data representation class name = {@code "java.net.URL"}. */ public static final URL POSTSCRIPT = new URL ("application/postscript"); /** - * Doc flavor with MIME type = "application/vnd.hp-PCL", - * print data representation class name = "java.net.URL". + * Doc flavor with MIME type = {@code "application/vnd.hp-PCL"}, + * print data representation class name = {@code "java.net.URL"}. */ public static final URL PCL = new URL ("application/vnd.hp-PCL"); /** - * Doc flavor with MIME type = "image/gif", print data - * representation class name = "java.net.URL". + * Doc flavor with MIME type = {@code "image/gif"}, print data + * representation class name = {@code "java.net.URL"}. */ public static final URL GIF = new URL ("image/gif"); /** - * Doc flavor with MIME type = "image/jpeg", print data - * representation class name = "java.net.URL". + * Doc flavor with MIME type = {@code "image/jpeg"}, print data + * representation class name = {@code "java.net.URL"}. */ public static final URL JPEG = new URL ("image/jpeg"); /** - * Doc flavor with MIME type = "image/png", print data - * representation class name = "java.net.URL". + * Doc flavor with MIME type = {@code "image/png"}, print data + * representation class name = {@code "java.net.URL"}. */ public static final URL PNG = new URL ("image/png"); /** * Doc flavor with MIME type = - * "application/octet-stream", - * print data representation class name = "java.net.URL". + * {@code "application/octet-stream"}, + * print data representation class name = {@code "java.net.URL"}. * The client must determine that data described * using this DocFlavor is valid for the printer. */ @@ -1229,7 +1229,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Class DocFlavor.CHAR_ARRAY provides predefined static constant * DocFlavor objects for example doc flavors using a character array - * (char[]) as the print data representation class. As such, + * ({@code char[]}) as the print data representation class. As such, * the character set is Unicode. * * @author Alan Kaminsky @@ -1241,16 +1241,16 @@ public class DocFlavor implements Serializable, Cloneable { /** * Constructs a new doc flavor with the given MIME type and a print * data representation class name of - * "[C" (character array). + * {@code "[C"} (character array). * * @param mimeType MIME media type string. If it is a text media * type, it is assumed to contain a - * "charset=utf-16" parameter. + * {@code "charset=utf-16"} parameter. * * @exception NullPointerException - * (unchecked exception) Thrown if mimeType is null. + * (unchecked exception) Thrown if {@code mimeType} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if mimeType does not + * (unchecked exception) Thrown if {@code mimeType} does not * obey the syntax for a MIME media type string. */ public CHAR_ARRAY (String mimeType) { @@ -1258,17 +1258,17 @@ public class DocFlavor implements Serializable, Cloneable { } /** - * Doc flavor with MIME type = "text/plain; - * charset=utf-16", print data representation class name = - * "[C" (character array). + * Doc flavor with MIME type = {@code "text/plain; charset=utf-16"}, + * print data representation class name = + * {@code "[C"} (character array). */ public static final CHAR_ARRAY TEXT_PLAIN = new CHAR_ARRAY ("text/plain; charset=utf-16"); /** - * Doc flavor with MIME type = "text/html; - * charset=utf-16", print data representation class name = - * "[C" (character array). + * Doc flavor with MIME type = {@code "text/html; charset=utf-16"}, + * print data representation class name = + * {@code "[C"} (character array). */ public static final CHAR_ARRAY TEXT_HTML = new CHAR_ARRAY ("text/html; charset=utf-16"); @@ -1289,16 +1289,16 @@ public class DocFlavor implements Serializable, Cloneable { /** * Constructs a new doc flavor with the given MIME type and a print - * data representation class name of "java.lang.String". + * data representation class name of {@code "java.lang.String"}. * * @param mimeType MIME media type string. If it is a text media * type, it is assumed to contain a - * "charset=utf-16" parameter. + * {@code "charset=utf-16"} parameter. * * @exception NullPointerException - * (unchecked exception) Thrown if mimeType is null. + * (unchecked exception) Thrown if {@code mimeType} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if mimeType does not + * (unchecked exception) Thrown if {@code mimeType} does not * obey the syntax for a MIME media type string. */ public STRING (String mimeType) { @@ -1306,17 +1306,17 @@ public class DocFlavor implements Serializable, Cloneable { } /** - * Doc flavor with MIME type = "text/plain; - * charset=utf-16", print data representation class name = - * "java.lang.String". + * Doc flavor with MIME type = {@code "text/plain; charset=utf-16"}, + * print data representation class name = + * {@code "java.lang.String"}. */ public static final STRING TEXT_PLAIN = new STRING ("text/plain; charset=utf-16"); /** - * Doc flavor with MIME type = "text/html; - * charset=utf-16", print data representation class name = - * "java.lang.String". + * Doc flavor with MIME type = {@code "text/html; charset=utf-16"}, + * print data representation class name = + * {@code "java.lang.String"}. */ public static final STRING TEXT_HTML = new STRING ("text/html; charset=utf-16"); @@ -1337,16 +1337,16 @@ public class DocFlavor implements Serializable, Cloneable { /** * Constructs a new doc flavor with the given MIME type and a print * data representation class name of\ - * "java.io.Reader" (character stream). + * {@code "java.io.Reader"} (character stream). * * @param mimeType MIME media type string. If it is a text media * type, it is assumed to contain a - * "charset=utf-16" parameter. + * {@code "charset=utf-16"} parameter. * * @exception NullPointerException - * (unchecked exception) Thrown if mimeType is null. + * (unchecked exception) Thrown if {@code mimeType} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if mimeType does not + * (unchecked exception) Thrown if {@code mimeType} does not * obey the syntax for a MIME media type string. */ public READER (String mimeType) { @@ -1354,17 +1354,17 @@ public class DocFlavor implements Serializable, Cloneable { } /** - * Doc flavor with MIME type = "text/plain; - * charset=utf-16", print data representation class name = - * "java.io.Reader" (character stream). + * Doc flavor with MIME type = {@code "text/plain; charset=utf-16"}, + * print data representation class name = + * {@code "java.io.Reader"} (character stream). */ public static final READER TEXT_PLAIN = new READER ("text/plain; charset=utf-16"); /** - * Doc flavor with MIME type = "text/html; - * charset=utf-16", print data representation class name = - * "java.io.Reader" (character stream). + * Doc flavor with MIME type = {@code "text/html; charset=utf-16"}, + * print data representation class name = + * {@code "java.io.Reader"} (character stream). */ public static final READER TEXT_HTML = new READER ("text/html; charset=utf-16"); @@ -1384,14 +1384,14 @@ public class DocFlavor implements Serializable, Cloneable { /** * Constructs a new doc flavor with a MIME type of - * "application/x-java-jvm-local-objectref" indicating + * {@code "application/x-java-jvm-local-objectref"} indicating * service formatted print data and the given print data * representation class name. * * @param className Fully-qualified representation class name. * * @exception NullPointerException - * (unchecked exception) Thrown if className is + * (unchecked exception) Thrown if {@code className} is * null. */ public SERVICE_FORMATTED (String className) { @@ -1401,7 +1401,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Service formatted print data doc flavor with print data * representation class name = - * "java.awt.image.renderable.RenderableImage" + * {@code "java.awt.image.renderable.RenderableImage"} * (renderable image object). */ public static final SERVICE_FORMATTED RENDERABLE_IMAGE = @@ -1409,7 +1409,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Service formatted print data doc flavor with print data - * representation class name = "java.awt.print.Printable" + * representation class name = {@code "java.awt.print.Printable"} * (printable object). */ public static final SERVICE_FORMATTED PRINTABLE = @@ -1417,7 +1417,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Service formatted print data doc flavor with print data - * representation class name = "java.awt.print.Pageable" + * representation class name = {@code "java.awt.print.Pageable"} * (pageable object). */ public static final SERVICE_FORMATTED PAGEABLE = diff --git a/jdk/src/java.desktop/share/classes/javax/print/DocPrintJob.java b/jdk/src/java.desktop/share/classes/javax/print/DocPrintJob.java index 3d504dd6451..3ab15f96664 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/DocPrintJob.java +++ b/jdk/src/java.desktop/share/classes/javax/print/DocPrintJob.java @@ -45,7 +45,7 @@ public interface DocPrintJob { * Determines the {@link PrintService} object to which this print job * object is bound. * - * @return PrintService object. + * @return {@code PrintService} object. * */ public PrintService getPrintService(); @@ -58,7 +58,7 @@ public interface DocPrintJob { * call; that is, the returned attribute set's object's contents will * not be updated if this Print Job's attribute set's contents change * in the future. To detect changes in attribute values, call - * getAttributes() again and compare the new attribute + * {@code getAttributes()} again and compare the new attribute * set to the previous attribute set; alternatively, register a * listener for print job events. * The returned value may be an empty set but should not be null. @@ -96,7 +96,7 @@ public interface DocPrintJob { * If listener is null, no exception is thrown and no action is * performed. * To determine the attribute updates that may be reported by this job, - * a client can call getAttributes() and identify the + * a client can call {@code getAttributes()} and identify the * subset that are interesting and likely to be reported to the * listener. Clients expecting to be updated about changes in a * specific job attribute should verify it is in that set, but @@ -152,7 +152,7 @@ public interface DocPrintJob { * Print service implementors should close any print data streams (ie * Reader or InputStream implementations) that they obtain * from the client doc. Robust clients may still wish to verify this. - * An exception is always generated if a DocFlavor cannot + * An exception is always generated if a {@code DocFlavor} cannot * be printed. * * @param doc The document to be printed. If must be a flavor diff --git a/jdk/src/java.desktop/share/classes/javax/print/MimeType.java b/jdk/src/java.desktop/share/classes/javax/print/MimeType.java index 87891f655b7..c9d1f614af0 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/MimeType.java +++ b/jdk/src/java.desktop/share/classes/javax/print/MimeType.java @@ -195,9 +195,9 @@ class MimeType implements Serializable, Cloneable { * @param s MIME media type string. * * @exception NullPointerException - * (unchecked exception) Thrown if s is null. + * (unchecked exception) Thrown if {@code s} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if s does not obey the + * (unchecked exception) Thrown if {@code s} does not obey the * syntax for a MIME media type string. */ public MimeType(String s) { @@ -271,7 +271,7 @@ class MimeType implements Serializable, Cloneable { * * @param obj Object to test. * - * @return True if this MIME type object equals obj, false + * @return True if this MIME type object equals {@code obj}, false * otherwise. */ public boolean equals (Object obj) { @@ -525,7 +525,7 @@ class MimeType implements Serializable, Cloneable { /** * Parses the given string into canonical pieces and stores the pieces in - * {@link #myPieces myPieces}. + * {@link #myPieces myPieces}. *

      * Special rules applied: *

        @@ -536,9 +536,9 @@ class MimeType implements Serializable, Cloneable { * @param s MIME media type string. * * @exception NullPointerException - * (unchecked exception) Thrown if s is null. + * (unchecked exception) Thrown if {@code s} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if s does not obey the + * (unchecked exception) Thrown if {@code s} does not obey the * syntax for a MIME media type string. */ private void parse(String s) { diff --git a/jdk/src/java.desktop/share/classes/javax/print/PrintService.java b/jdk/src/java.desktop/share/classes/javax/print/PrintService.java index a003e730880..356e8498d01 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/PrintService.java +++ b/jdk/src/java.desktop/share/classes/javax/print/PrintService.java @@ -91,7 +91,7 @@ public interface PrintService { /** * Removes the print-service listener from this print service. * This means the listener is no longer interested in - * PrintService events. + * {@code PrintService} events. * @param listener a PrintServiceAttributeListener object * @see #addPrintServiceAttributeListener */ @@ -103,10 +103,10 @@ public interface PrintService { * giving this Print Service's status. The returned attribute set object * is unmodifiable. The returned attribute set object is a "snapshot" of * this Print Service's attribute set at the time of the - * getAttributes() method call: that is, the returned + * {@code getAttributes()} method call: that is, the returned * attribute set's contents will not be updated if this print * service's attribute set's contents change in the future. To detect - * changes in attribute values, call getAttributes() again + * changes in attribute values, call {@code getAttributes()} again * and compare the new attribute set to the previous attribute set; * alternatively, register a listener for print service events. * @@ -126,8 +126,8 @@ public interface PrintService { * attribute is not supported by this service. * @exception NullPointerException if the category is null. * @exception IllegalArgumentException - * (unchecked exception) if category is not a - * Class that implements interface + * (unchecked exception) if {@code category} is not a + * {@code Class} that implements interface *{@link javax.print.attribute.PrintServiceAttribute PrintServiceAttribute}. */ public @@ -135,13 +135,13 @@ public interface PrintService { /** * Determines the print data formats a client can specify when setting - * up a job for this PrintService. A print data format is + * up a job for this {@code PrintService}. A print data format is * designated by a "doc * flavor" (class {@link javax.print.DocFlavor DocFlavor}) * consisting of a MIME type plus a print data representation class. *

        * Note that some doc flavors may not be supported in combination - * with all attributes. Use getUnsupportedAttributes(..) + * with all attributes. Use {@code getUnsupportedAttributes(..)} * to validate specific combinations. * * @return Array of supported doc flavors, should have at least @@ -152,19 +152,19 @@ public interface PrintService { /** * Determines if this print service supports a specific - * DocFlavor. This is a convenience method to determine - * if the DocFlavor would be a member of the result of - * getSupportedDocFlavors(). + * {@code DocFlavor}. This is a convenience method to determine + * if the {@code DocFlavor} would be a member of the result of + * {@code getSupportedDocFlavors()}. *

        * Note that some doc flavors may not be supported in combination - * with all attributes. Use getUnsupportedAttributes(..) + * with all attributes. Use {@code getUnsupportedAttributes(..)} * to validate specific combinations. * - * @param flavor the DocFlavorto query for support. - * @return true if this print service supports the - * specified DocFlavor; false otherwise. + * @param flavor the {@code DocFlavor} to query for support. + * @return {@code true} if this print service supports the + * specified {@code DocFlavor}; {@code false} otherwise. * @exception NullPointerException - * (unchecked exception) Thrown if flavor is null. + * (unchecked exception) Thrown if {@code flavor} is null. */ public boolean isDocFlavorSupported(DocFlavor flavor); @@ -173,7 +173,7 @@ public interface PrintService { * Determines the printing attribute categories a client can specify * when setting up a job for this print service. * A printing attribute category is - * designated by a Class that implements interface + * designated by a {@code Class} that implements interface * {@link javax.print.attribute.Attribute Attribute}. This method returns * just the attribute categories that are supported; it does not * return the particular attribute values that are supported. @@ -181,10 +181,10 @@ public interface PrintService { * This method returns all the printing attribute * categories this print service supports for any possible job. * Some categories may not be supported in a particular context (ie - * for a particular DocFlavor). - * Use one of the methods that include a DocFlavor to + * for a particular {@code DocFlavor}). + * Use one of the methods that include a {@code DocFlavor} to * validate the request before submitting it, such as - * getSupportedAttributeValues(..). + * {@code getSupportedAttributeValues(..)}. * * @return Array of printing attribute categories that the client can * specify as a doc-level or job-level attribute in a Print @@ -198,37 +198,37 @@ public interface PrintService { /** * Determines whether a client can specify the given printing * attribute category when setting up a job for this print service. A - * printing attribute category is designated by a Class + * printing attribute category is designated by a {@code Class} * that implements interface {@link javax.print.attribute.Attribute * Attribute}. This method tells whether the attribute category is * supported; it does not tell whether a particular attribute value * is supported. *

        * Some categories may not be supported in a particular context (ie - * for a particular DocFlavor). - * Use one of the methods which include a DocFlavor to + * for a particular {@code DocFlavor}). + * Use one of the methods which include a {@code DocFlavor} to * validate the request before submitting it, such as - * getSupportedAttributeValues(..). + * {@code getSupportedAttributeValues(..)}. *

        * This is a convenience method to determine if the category * would be a member of the result of - * getSupportedAttributeCategories(). + * {@code getSupportedAttributeCategories()}. * * @param category Printing attribute category to test. It must be a - * Class that implements + * {@code Class} that implements * interface * {@link javax.print.attribute.Attribute Attribute}. * - * @return true if this print service supports + * @return {@code true} if this print service supports * specifying a doc-level or - * job-level attribute in category in a Print - * Request; false if it doesn't. + * job-level attribute in {@code category} in a Print + * Request; {@code false} if it doesn't. * * @exception NullPointerException - * (unchecked exception) Thrown if category is null. + * (unchecked exception) Thrown if {@code category} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if category is not a - * Class that implements interface + * (unchecked exception) Thrown if {@code category} is not a + * {@code Class} that implements interface * {@link javax.print.attribute.Attribute Attribute}. */ public boolean @@ -244,16 +244,16 @@ public interface PrintService { * default attribute value instead. *

        * Some attributes may not be supported in a particular context (ie - * for a particular DocFlavor). - * Use one of the methods that include a DocFlavor to + * for a particular {@code DocFlavor}). + * Use one of the methods that include a {@code DocFlavor} to * validate the request before submitting it, such as - * getSupportedAttributeValues(..). + * {@code getSupportedAttributeValues(..)}. *

        * Not all attributes have a default value. For example the - * service will not have a defaultvalue for RequestingUser + * service will not have a defaultvalue for {@code RequestingUser} * i.e. a null return for a supported category means there is no * service default value for that category. Use the - * isAttributeCategorySupported(Class) method to + * {@code isAttributeCategorySupported(Class)} method to * distinguish these cases. * * @param category Printing attribute category for which the default @@ -262,16 +262,16 @@ public interface PrintService { * {@link javax.print.attribute.Attribute * Attribute}. * - * @return Default attribute value for category, or null + * @return Default attribute value for {@code category}, or null * if this Print Service does not support specifying a doc-level or - * job-level attribute in category in a Print + * job-level attribute in {@code category} in a Print * Request, or the service does not have a default value * for this attribute. * * @exception NullPointerException - * (unchecked exception) Thrown if category is null. + * (unchecked exception) Thrown if {@code category} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if category is not a + * (unchecked exception) Thrown if {@code category} is not a * {@link java.lang.Class Class} that implements interface {@link * javax.print.attribute.Attribute Attribute}. */ @@ -285,10 +285,10 @@ public interface PrintService { * attribute value is an instance of a class that implements interface * {@link javax.print.attribute.Attribute Attribute}. *

        - * If flavor is null and attributes is null + * If {@code flavor} is null and {@code attributes} is null * or is an empty set, this method returns all the printing attribute * values this Print Service supports for any possible job. If - * flavor is not null or attributes is not + * {@code flavor} is not null or {@code attributes} is not * an empty set, this method returns just the printing attribute values * that are compatible with the given doc flavor and/or set of attributes. * That is, a null return value may indicate that specifying this attribute @@ -296,12 +296,12 @@ public interface PrintService { * Also if DocFlavor is not null it must be a flavor supported by this * PrintService, else IllegalArgumentException will be thrown. *

        - * If the attributes parameter contains an Attribute whose - * category is the same as the category parameter, the service + * If the {@code attributes} parameter contains an Attribute whose + * category is the same as the {@code category} parameter, the service * must ignore this attribute in the AttributeSet. *

        - * DocAttributes which are to be specified on the - * Doc must be included in this set to accurately + * {@code DocAttribute}s which are to be specified on the + * {@code Doc} must be included in this set to accurately * represent the context. *

        * This method returns an Object because different printing attribute @@ -321,7 +321,7 @@ public interface PrintService { * containing the legal values -- used, for example, by an attribute with * a list of enumerated values. The type of the array is an array of the * specified attribute category type as returned by its - * getCategory(Class). + * {@code getCategory(Class)}. *

      • * Return a single object (of some class other than the attribute category) * that indicates bounds on the legal values -- used, for example, by an @@ -337,18 +337,18 @@ public interface PrintService { * (both job-level attributes and document-level * attributes), or null. * - * @return Object indicating supported values for category, + * @return Object indicating supported values for {@code category}, * or null if this Print Service does not support specifying a - * doc-level or job-level attribute in category in + * doc-level or job-level attribute in {@code category} in * a Print Request. * * @exception NullPointerException - * (unchecked exception) Thrown if category is null. + * (unchecked exception) Thrown if {@code category} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if category is not a + * (unchecked exception) Thrown if {@code category} is not a * {@link java.lang.Class Class} that implements interface {@link * javax.print.attribute.Attribute Attribute}, or - * DocFlavor is not supported by this service. + * {@code DocFlavor} is not supported by this service. */ public Object getSupportedAttributeValues(Class category, @@ -362,24 +362,24 @@ public interface PrintService { * attribute value is an instance of a class that implements interface * {@link javax.print.attribute.Attribute Attribute}. *

        - * If flavor is null and attributes is null or + * If {@code flavor} is null and {@code attributes} is null or * is an empty set, this method tells whether this Print Service supports * the given printing attribute value for some possible combination of doc - * flavor and set of attributes. If flavor is not null or - * attributes is not an empty set, this method tells whether + * flavor and set of attributes. If {@code flavor} is not null or + * {@code attributes} is not an empty set, this method tells whether * this Print Service supports the given printing attribute value in * combination with the given doc flavor and/or set of attributes. *

        * Also if DocFlavor is not null it must be a flavor supported by this * PrintService, else IllegalArgumentException will be thrown. *

        - * DocAttributes which are to be specified on the - * Doc must be included in this set to accurately + * {@code DocAttribute}s which are to be specified on the + * {@code Doc} must be included in this set to accurately * represent the context. *

        * This is a convenience method to determine if the value * would be a member of the result of - * getSupportedAttributeValues(...). + * {@code getSupportedAttributeValues(...)}. * * @param attrval Printing attribute value to test. * @param flavor Doc flavor for a supposed job, or null. @@ -388,11 +388,11 @@ public interface PrintService { * attributes), or null. * * @return True if this Print Service supports specifying - * attrval as a doc-level or job-level attribute in a + * {@code attrval} as a doc-level or job-level attribute in a * Print Request, false if it doesn't. * * @exception NullPointerException - * (unchecked exception) if attrval is null. + * (unchecked exception) if {@code attrval} is null. * @exception IllegalArgumentException if flavor is not supported by * this PrintService. */ @@ -410,8 +410,8 @@ public interface PrintService { * IllegalArgumentException will be thrown. If the * return value from this method is null, all attributes are supported. *

        - * DocAttributes which are to be specified on the - * Doc must be included in this set to accurately + * {@code DocAttribute}s which are to be specified on the + * {@code Doc} must be included in this set to accurately * represent the context. *

        * If the return value is non-null, all attributes in the returned @@ -428,7 +428,7 @@ public interface PrintService { * to select the attribute(s) to be identified as the cause of the * conflict. *

        - * Use isDocFlavorSupported() to verify that a DocFlavor + * Use {@code isDocFlavorSupported()} to verify that a DocFlavor * is supported before calling this method. * * @param flavor Doc flavor to test, or null @@ -439,7 +439,7 @@ public interface PrintService { * @return null if this Print Service supports the print request * specification, else the unsupported attributes. * - * @exception IllegalArgumentException ifflavor is + * @exception IllegalArgumentException if {@code flavor} is * not supported by this PrintService. */ public AttributeSet getUnsupportedAttributes(DocFlavor flavor, @@ -453,7 +453,7 @@ public interface PrintService { * an environment with no UI support should ensure that the factory * is not initialised unless the application calls this method to * obtain the factory. - * See ServiceUIFactory for more information. + * See {@code ServiceUIFactory} for more information. * @return null or a factory for UI components. */ public ServiceUIFactory getServiceUIFactory(); @@ -480,7 +480,7 @@ public interface PrintService { /** * This method should be implemented consistently with - * equals(Object). + * {@code equals(Object)}. * @return hash code of this object. */ public int hashCode(); diff --git a/jdk/src/java.desktop/share/classes/javax/print/PrintServiceLookup.java b/jdk/src/java.desktop/share/classes/javax/print/PrintServiceLookup.java index d15a0146287..a6981a1f441 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/PrintServiceLookup.java +++ b/jdk/src/java.desktop/share/classes/javax/print/PrintServiceLookup.java @@ -113,7 +113,7 @@ public abstract class PrintServiceLookup { * @param attributes attributes that the print service must support. * If null this constraint is not used. * - * @return array of matching PrintService objects + * @return array of matching {@code PrintService} objects * representing print services that support the specified flavor * attributes. If no services match, the array is zero-length. */ @@ -129,9 +129,9 @@ public abstract class PrintServiceLookup { * Locates MultiDoc print Services capable of printing MultiDocs * containing all the specified doc flavors. *

        This method is useful to help locate a service that can print - * a MultiDoc in which the elements may be different + * a {@code MultiDoc} in which the elements may be different * flavors. An application could perform this itself by multiple lookups - * on each DocFlavor in turn and collating the results, + * on each {@code DocFlavor} in turn and collating the results, * but the lookup service may be able to do this more efficiently. * * @param flavors the flavors to print. If null or empty this @@ -201,8 +201,8 @@ public abstract class PrintServiceLookup { * the method returns false. * * @param sp an implementation of a lookup service. - * @return true if the new lookup service is newly - * registered; false otherwise. + * @return {@code true} if the new lookup service is newly + * registered; {@code false} otherwise. */ public static boolean registerServiceProvider(PrintServiceLookup sp) { synchronized (PrintServiceLookup.class) { @@ -232,15 +232,15 @@ public abstract class PrintServiceLookup { * values and classes reported by the service. * This may be less efficient than a lookup * service tuned for that service. - * Therefore registering a PrintServiceLookup instance + * Therefore registering a {@code PrintServiceLookup} instance * instead is recommended. * The method returns true if this service is not previously * registered and is now successfully registered. * This method should not be called with StreamPrintService instances. * They will always fail to register and the method will return false. * @param service an implementation of a print service. - * @return true if the service is newly - * registered; false otherwise. + * @return {@code true} if the service is newly + * registered; {@code false} otherwise. */ public static boolean registerService(PrintService service) { diff --git a/jdk/src/java.desktop/share/classes/javax/print/ServiceUI.java b/jdk/src/java.desktop/share/classes/javax/print/ServiceUI.java index a3960af1816..520d508c3b5 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/ServiceUI.java +++ b/jdk/src/java.desktop/share/classes/javax/print/ServiceUI.java @@ -136,8 +136,8 @@ public class ServiceUI { * @param x location of dialog including border in screen coordinates * @param y location of dialog including border in screen coordinates * @param services to be browsable, must be non-null. - * @param defaultService - initial PrintService to display. - * @param flavor - the flavor to be printed, or null. + * @param defaultService initial PrintService to display. + * @param flavor the flavor to be printed, or null. * @param attributes on input is the initial application supplied * preferences. This cannot be null but may be empty. * On output the attributes reflect changes made by the user. diff --git a/jdk/src/java.desktop/share/classes/javax/print/SimpleDoc.java b/jdk/src/java.desktop/share/classes/javax/print/SimpleDoc.java index f73d794f76b..dfe8dc4a470 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/SimpleDoc.java +++ b/jdk/src/java.desktop/share/classes/javax/print/SimpleDoc.java @@ -35,7 +35,7 @@ import javax.print.attribute.AttributeSetUtilities; import javax.print.attribute.DocAttributeSet; /** - * This class is an implementation of interface Doc that can + * This class is an implementation of interface {@code Doc} that can * be used in many common printing requests. * It can handle all of the presently defined "pre-defined" doc flavors * defined as static variables in the DocFlavor class. @@ -52,7 +52,7 @@ import javax.print.attribute.DocAttributeSet; * or need a MultiDoc will not want to use this class. *

        * If the print data is a stream, or a print job requests data as a - * stream, then SimpleDoc does not monitor if the service + * stream, then {@code SimpleDoc} does not monitor if the service * properly closes the stream after data transfer completion or job * termination. * Clients may prefer to use provide their own implementation of doc that @@ -69,18 +69,18 @@ public final class SimpleDoc implements Doc { private InputStream inStream; /** - * Constructs a SimpleDoc with the specified + * Constructs a {@code SimpleDoc} with the specified * print data, doc flavor and doc attribute set. * @param printData the print data object - * @param flavor the DocFlavor object - * @param attributes a DocAttributeSet, which can - * be null - * @throws IllegalArgumentException if flavor or - * printData is null, or the - * printData does not correspond + * @param flavor the {@code DocFlavor} object + * @param attributes a {@code DocAttributeSet}, which can + * be {@code null} + * @throws IllegalArgumentException if {@code flavor} or + * {@code printData} is {@code null}, or the + * {@code printData} does not correspond * to the specified doc flavor--for example, the data is * not of the type specified as the representation in the - * DocFlavor. + * {@code DocFlavor}. */ public SimpleDoc(Object printData, DocFlavor flavor, DocAttributeSet attributes) { @@ -144,7 +144,7 @@ public final class SimpleDoc implements Doc { * Obtains the print data representation object that contains this doc * object's piece of print data in the format corresponding to the * supported doc flavor. - * The getPrintData() method returns an instance of + * The {@code getPrintData()} method returns an instance of * the representation class whose name is given by * {@link DocFlavor#getRepresentationClassName() getRepresentationClassName}, * and the return value can be cast @@ -161,26 +161,26 @@ public final class SimpleDoc implements Doc { /** * Obtains a reader for extracting character print data from this doc. - * The Doc implementation is required to support this - * method if the DocFlavor has one of the following print - * data representation classes, and return null + * The {@code Doc} implementation is required to support this + * method if the {@code DocFlavor} has one of the following print + * data representation classes, and return {@code null} * otherwise: *

          - *
        • char[] - *
        • java.lang.String - *
        • java.io.Reader + *
        • {@code char[]} + *
        • {@code java.lang.String} + *
        • {@code java.io.Reader} *
        * The doc's print data representation object is used to construct and - * return a Reader for reading the print data as a stream + * return a {@code Reader} for reading the print data as a stream * of characters from the print data representation object. * However, if the print data representation object is itself a - * Reader then the print data representation object is + * {@code Reader} then the print data representation object is * simply returned. * - * @return a Reader for reading the print data + * @return a {@code Reader} for reading the print data * characters from this doc. * If a reader cannot be provided because this doc does not meet - * the criteria stated above, null is returned. + * the criteria stated above, {@code null} is returned. * * @exception IOException if there was an I/O error while creating * the reader. @@ -209,13 +209,13 @@ public final class SimpleDoc implements Doc { /** * Obtains an input stream for extracting byte print data from * this doc. - * The Doc implementation is required to support this - * method if the DocFlavor has one of the following print + * The {@code Doc} implementation is required to support this + * method if the {@code DocFlavor} has one of the following print * data representation classes; otherwise this method - * returns null: + * returns {@code null}: *
          - *
        • byte[] - *
        • java.io.InputStream + *
        • {@code byte[]} + *
        • {@code java.io.InputStream} *
        * The doc's print data representation object is obtained. Then, an * input stream for reading the print data @@ -225,10 +225,10 @@ public final class SimpleDoc implements Doc { * input stream then the print data representation object is simply * returned. * - * @return an InputStream for reading the print data + * @return an {@code InputStream} for reading the print data * bytes from this doc. If an input stream cannot be * provided because this doc does not meet - * the criteria stated above, null is returned. + * the criteria stated above, {@code null} is returned. * * @exception IOException * if there was an I/O error while creating the input stream. diff --git a/jdk/src/java.desktop/share/classes/javax/print/StreamPrintService.java b/jdk/src/java.desktop/share/classes/javax/print/StreamPrintService.java index c1a99229b2e..a735d542a58 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/StreamPrintService.java +++ b/jdk/src/java.desktop/share/classes/javax/print/StreamPrintService.java @@ -37,17 +37,17 @@ import java.io.OutputStream; * The output format must be declared as a mime type. * This is equivalent to an output document flavor where the * representation class is always "java.io.OutputStream" - * An instance of the StreamPrintService class is + * An instance of the {@code StreamPrintService} class is * obtained from a {@link StreamPrintServiceFactory} instance. *

        - * Note that a StreamPrintService is different from a - * PrintService, which supports a + * Note that a {@code StreamPrintService} is different from a + * {@code PrintService}, which supports a * {@link javax.print.attribute.standard.Destination Destination} - * attribute. A StreamPrintService always requires an output - * stream, whereas a PrintService optionally accepts a - * Destination. A StreamPrintService + * attribute. A {@code StreamPrintService} always requires an output + * stream, whereas a {@code PrintService} optionally accepts a + * {@code Destination}. A {@code StreamPrintService} * has no default destination for its formatted output. - * Additionally a StreamPrintService is expected to generate + * Additionally a {@code StreamPrintService} is expected to generate output in * a format useful in other contexts. * StreamPrintService's are not expected to support the Destination attribute. @@ -88,7 +88,7 @@ public abstract class StreamPrintService implements PrintService { public abstract String getOutputFormat(); /** - * Disposes this StreamPrintService. + * Disposes this {@code StreamPrintService}. * If a stream service cannot be re-used, it must be disposed * to indicate this. Typically the client will call this method. * Services which write data which cannot meaningfully be appended to @@ -100,12 +100,12 @@ public abstract class StreamPrintService implements PrintService { } /** - * Returns a boolean indicating whether or not - * this StreamPrintService has been disposed. + * Returns a {@code boolean} indicating whether or not + * this {@code StreamPrintService} has been disposed. * If this object has been disposed, will return true. * Used by services and client applications to recognize streams * to which no further data should be written. - * @return if this StreamPrintService has been disposed + * @return if this {@code StreamPrintService} has been disposed */ public boolean isDisposed() { return disposed; diff --git a/jdk/src/java.desktop/share/classes/javax/print/StreamPrintServiceFactory.java b/jdk/src/java.desktop/share/classes/javax/print/StreamPrintServiceFactory.java index f1f7f28c410..a7da64e61f3 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/StreamPrintServiceFactory.java +++ b/jdk/src/java.desktop/share/classes/javax/print/StreamPrintServiceFactory.java @@ -37,7 +37,7 @@ import java.util.ServiceLoader; import java.util.ServiceConfigurationError; /** - * A StreamPrintServiceFactory is the factory for + * A {@code StreamPrintServiceFactory} is the factory for * {@link StreamPrintService} instances, * which can print to an output stream in a particular * document format described as a mime type. @@ -51,8 +51,8 @@ import java.util.ServiceConfigurationError; * Applications locate instances of this class by calling the * {@link #lookupStreamPrintServiceFactories(DocFlavor, String)} method. *

        - * Applications can use a StreamPrintService obtained from a - * factory in place of a PrintService which represents a + * Applications can use a {@code StreamPrintService} obtained from a + * factory in place of a {@code PrintService} which represents a * physical printer device. */ @@ -101,7 +101,7 @@ public abstract class StreamPrintServiceFactory { * @param outputMimeType representing the required output format, used to * identify suitable stream printer factories. A value of null means * match all formats. - * @return - matching factories for stream print service instance, + * @return matching factories for stream print service instance, * empty if no suitable factories could be located. */ public static StreamPrintServiceFactory[] @@ -127,25 +127,25 @@ public abstract class StreamPrintServiceFactory { public abstract DocFlavor[] getSupportedDocFlavors(); /** - * Returns a StreamPrintService that can print to + * Returns a {@code StreamPrintService} that can print to * the specified output stream. * The output stream is created and managed by the application. * It is the application's responsibility to close the stream and * to ensure that this Printer is not reused. * The application should not close this stream until any print job * created from the printer is complete. Doing so earlier may generate - * a PrinterException and an event indicating that the + * a {@code PrinterException} and an event indicating that the * job failed. *

        - * Whereas a PrintService connected to a physical printer + * Whereas a {@code PrintService} connected to a physical printer * can be reused, - * a StreamPrintService connected to a stream cannot. - * The underlying StreamPrintService may be disposed by + * a {@code StreamPrintService} connected to a stream cannot. + * The underlying {@code StreamPrintService} may be disposed by * the print system with * the {@link StreamPrintService#dispose() dispose} method * before returning from the * {@link DocPrintJob#print(Doc, javax.print.attribute.PrintRequestAttributeSet) print} - * method of DocPrintJob so that the print system knows + * method of {@code DocPrintJob} so that the print system knows * this printer is no longer usable. * This is equivalent to a physical printer going offline - permanently. * Applications may supply a null print stream to create a queryable diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/Attribute.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/Attribute.java index a6c58e6f933..e493b4869de 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/Attribute.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/Attribute.java @@ -52,8 +52,8 @@ public interface Attribute extends Serializable { *

        * Note: This method is intended to provide a default, nonlocalized * string for the attribute's category. If two attribute objects return the - * same category from the getCategory() method, they should - * return the same name from the getName() method. + * same category from the {@code getCategory()} method, they should + * return the same name from the {@code getName()} method. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/AttributeSetUtilities.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/AttributeSetUtilities.java index 2c5896f633f..587a4833501 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/AttributeSetUtilities.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/AttributeSetUtilities.java @@ -206,10 +206,10 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying attribute set. * - * @return Unmodifiable view of attributeSet. + * @return Unmodifiable view of {@code attributeSet}. * * @exception NullPointerException - * Thrown if attributeSet is null. Null is never a + * Thrown if {@code attributeSet} is null. Null is never a */ public static AttributeSet unmodifiableView(AttributeSet attributeSet) { if (attributeSet == null) { @@ -224,10 +224,10 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying doc attribute set. * - * @return Unmodifiable view of attributeSet. + * @return Unmodifiable view of {@code attributeSet}. * * @exception NullPointerException - * Thrown if attributeSet is null. + * Thrown if {@code attributeSet} is null. */ public static DocAttributeSet unmodifiableView (DocAttributeSet attributeSet) { @@ -242,10 +242,10 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying print request attribute set. * - * @return Unmodifiable view of attributeSet. + * @return Unmodifiable view of {@code attributeSet}. * * @exception NullPointerException - * Thrown if attributeSet is null. + * Thrown if {@code attributeSet} is null. */ public static PrintRequestAttributeSet unmodifiableView(PrintRequestAttributeSet attributeSet) { @@ -260,10 +260,10 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying print job attribute set. * - * @return Unmodifiable view of attributeSet. + * @return Unmodifiable view of {@code attributeSet}. * * @exception NullPointerException - * Thrown if attributeSet is null. + * Thrown if {@code attributeSet} is null. */ public static PrintJobAttributeSet unmodifiableView(PrintJobAttributeSet attributeSet) { @@ -278,10 +278,10 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying print service attribute set. * - * @return Unmodifiable view of attributeSet. + * @return Unmodifiable view of {@code attributeSet}. * * @exception NullPointerException - * Thrown if attributeSet is null. + * Thrown if {@code attributeSet} is null. */ public static PrintServiceAttributeSet unmodifiableView(PrintServiceAttributeSet attributeSet) { @@ -417,10 +417,10 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying attribute set. * - * @return Synchronized view of attributeSet. + * @return Synchronized view of {@code attributeSet}. * * @exception NullPointerException - * Thrown if attributeSet is null. + * Thrown if {@code attributeSet} is null. */ public static AttributeSet synchronizedView (AttributeSet attributeSet) { @@ -435,10 +435,10 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying doc attribute set. * - * @return Synchronized view of attributeSet. + * @return Synchronized view of {@code attributeSet}. * * @exception NullPointerException - * Thrown if attributeSet is null. + * Thrown if {@code attributeSet} is null. */ public static DocAttributeSet synchronizedView(DocAttributeSet attributeSet) { @@ -453,10 +453,10 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying print request attribute set. * - * @return Synchronized view of attributeSet. + * @return Synchronized view of {@code attributeSet}. * * @exception NullPointerException - * Thrown if attributeSet is null. + * Thrown if {@code attributeSet} is null. */ public static PrintRequestAttributeSet synchronizedView(PrintRequestAttributeSet attributeSet) { @@ -471,10 +471,10 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying print job attribute set. * - * @return Synchronized view of attributeSet. + * @return Synchronized view of {@code attributeSet}. * * @exception NullPointerException - * Thrown if attributeSet is null. + * Thrown if {@code attributeSet} is null. */ public static PrintJobAttributeSet synchronizedView(PrintJobAttributeSet attributeSet) { @@ -489,7 +489,7 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying print service attribute set. * - * @return Synchronized view of attributeSet. + * @return Synchronized view of {@code attributeSet}. */ public static PrintServiceAttributeSet synchronizedView(PrintServiceAttributeSet attributeSet) { @@ -508,17 +508,17 @@ public final class AttributeSetUtilities { * @param object Object to test. * @param interfaceName Interface the object must implement. * - * @return If object is a {@link java.lang.Class Class} - * that implements interfaceName, - * object is returned downcast to type {@link + * @return If {@code object} is a {@link java.lang.Class Class} + * that implements {@code interfaceName}, + * {@code object} is returned downcast to type {@link * java.lang.Class Class}; otherwise an exception is thrown. * * @exception NullPointerException - * (unchecked exception) Thrown if object is null. + * (unchecked exception) Thrown if {@code object} is null. * @exception ClassCastException - * (unchecked exception) Thrown if object is not a + * (unchecked exception) Thrown if {@code object} is not a * {@link java.lang.Class Class} that implements - * interfaceName. + * {@code interfaceName}. */ public static Class verifyAttributeCategory(Object object, Class interfaceName) { @@ -540,16 +540,16 @@ public final class AttributeSetUtilities { * @param object Object to test. * @param interfaceName Interface of which the object must be an instance. * - * @return If object is an instance of - * interfaceName, object is returned + * @return If {@code object} is an instance of + * {@code interfaceName}, {@code object} is returned * downcast to type {@link Attribute Attribute}; otherwise an * exception is thrown. * * @exception NullPointerException - * (unchecked exception) Thrown if object is null. + * (unchecked exception) Thrown if {@code object} is null. * @exception ClassCastException - * (unchecked exception) Thrown if object is not an - * instance of interfaceName. + * (unchecked exception) Thrown if {@code object} is not an + * instance of {@code interfaceName}. */ public static Attribute verifyAttributeValue(Object object, Class interfaceName) { @@ -573,11 +573,11 @@ public final class AttributeSetUtilities { * @param attribute Attribute value to test. * * @exception NullPointerException - * (unchecked exception) Thrown if the category is - * null or if the attribute is null. + * (unchecked exception) Thrown if the {@code category} is + * null or if the {@code attribute} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if the category is not - * equal to the category of the attribute. + * (unchecked exception) Thrown if the {@code category} is not + * equal to the category of the {@code attribute}. */ public static void verifyCategoryForValue(Class category, Attribute attribute) { diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/DateTimeSyntax.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/DateTimeSyntax.java index 72e583a0347..0515be6e801 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/DateTimeSyntax.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/DateTimeSyntax.java @@ -34,26 +34,25 @@ import java.util.Date; * Class DateTimeSyntax is an abstract base class providing the common * implementation of all attributes whose value is a date and time. *

        - * Under the hood, a date-time attribute is stored as a value of class - * java.util.Date. You can get a date-time attribute's Date value by + * Under the hood, a date-time attribute is stored as a value of class + * {@code java.util.Date}. You can get a date-time attribute's Date value by * calling {@link #getValue() getValue()}. A date-time attribute's * Date value is established when it is constructed (see {@link * #DateTimeSyntax(Date) DateTimeSyntax(Date)}). Once * constructed, a date-time attribute's value is immutable. *

        * To construct a date-time attribute from separate values of the year, month, - * day, hour, minute, and so on, use a java.util.Calendar - * object to construct a java.util.Date object, then use the - * java.util.Date object to construct the date-time attribute. + * day, hour, minute, and so on, use a {@code java.util.Calendar} + * object to construct a {@code java.util.Date} object, then use the + * {@code java.util.Date} object to construct the date-time attribute. * To convert * a date-time attribute to separate values of the year, month, day, hour, - * minute, and so on, create a java.util.Calendar object and - * set it to the java.util.Date from the date-time attribute. Class - * DateTimeSyntax stores its value in the form of a java.util.Date - * - * rather than a java.util.Calendar because it typically takes - * less memory to store and less time to compare a java.util.Date - * than a java.util.Calendar. + * minute, and so on, create a {@code java.util.Calendar} object and + * set it to the {@code java.util.Date} from the date-time attribute. Class + * DateTimeSyntax stores its value in the form of a {@code java.util.Date} + * rather than a {@code java.util.Calendar} because it typically takes + * less memory to store and less time to compare a {@code java.util.Date} + * than a {@code java.util.Calendar}. * * @author Alan Kaminsky */ @@ -64,7 +63,7 @@ public abstract class DateTimeSyntax implements Serializable, Cloneable { // Hidden data members. /** - * This date-time attribute'sjava.util.Date value. + * This date-time attribute's {@code java.util.Date} value. * @serial */ private Date value; @@ -73,12 +72,12 @@ public abstract class DateTimeSyntax implements Serializable, Cloneable { /** * Construct a new date-time attribute with the given - * java.util.Date value. + * {@code java.util.Date} value. * - * @param value java.util.Date value. + * @param value {@code java.util.Date} value. * * @exception NullPointerException - * (unchecked exception) Thrown if theValue is null. + * (unchecked exception) Thrown if {@code theValue} is null. */ protected DateTimeSyntax(Date value) { if (value == null) { @@ -90,7 +89,7 @@ public abstract class DateTimeSyntax implements Serializable, Cloneable { // Exported operations. /** - * Returns this date-time attribute's java.util.Date + * Returns this date-time attribute's {@code java.util.Date} * value. * @return the Date. */ @@ -105,17 +104,17 @@ public abstract class DateTimeSyntax implements Serializable, Cloneable { * object. To be equivalent, all of the following conditions must be true: *

          *
        1. - * object is not null. + * {@code object} is not null. *
        2. - * object is an instance of class DateTimeSyntax. + * {@code object} is an instance of class DateTimeSyntax. *
        3. - * This date-time attribute's java.util.Date value and - * object's java.util.Date value are + * This date-time attribute's {@code java.util.Date} value and + * {@code object}'s {@code java.util.Date} value are * equal.
        * * @param object Object to compare to. * - * @return True if object is equivalent to this date-time + * @return True if {@code object} is equivalent to this date-time * attribute, false otherwise. */ public boolean equals(Object object) { @@ -126,7 +125,7 @@ public abstract class DateTimeSyntax implements Serializable, Cloneable { /** * Returns a hash code value for this date-time attribute. The hashcode is - * that of this attribute's java.util.Date value. + * that of this attribute's {@code java.util.Date} value. */ public int hashCode() { return value.hashCode(); @@ -135,7 +134,7 @@ public abstract class DateTimeSyntax implements Serializable, Cloneable { /** * Returns a string value corresponding to this date-time attribute. * The string value is just this attribute's - * java.util.Date value + * {@code java.util.Date} value * converted to a string. */ public String toString() { diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/DocAttribute.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/DocAttribute.java index 994208f0a9e..509eee309d4 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/DocAttribute.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/DocAttribute.java @@ -30,7 +30,7 @@ package javax.print.attribute; * Interface DocAttribute is a tagging interface which a printing attribute * class implements to indicate the attribute denotes a setting for a doc. * ("Doc" is a short, easy-to-pronounce term that means "a piece of print - * data.") The client may include a DocAttribute in a Doc's + * data.") The client may include a DocAttribute in a {@code Doc}'s * attribute set to specify a characteristic of * that doc. If an attribute implements {@link PrintRequestAttribute * PrintRequestAttribute} as well as DocAttribute, the client may include the diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/EnumSyntax.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/EnumSyntax.java index f774066e592..2b3470c5da4 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/EnumSyntax.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/EnumSyntax.java @@ -68,7 +68,7 @@ import java.io.Serializable; * } * } * - * You can then write code that uses the == and != + * You can then write code that uses the {@code ==} and {@code !=} * operators to test enumeration values; for example: *
          *     Bach theComposer;
        @@ -77,8 +77,8 @@ import java.io.Serializable;
          *         System.out.println ("The greatest composer of all time!");
          *     }
          * 
        - * The equals() method for an enumeration class just does a test - * for identical objects (==). + * The {@code equals()} method for an enumeration class just does a test + * for identical objects ({@code ==}). *

        * You can convert an enumeration value to a string by calling {@link * #toString() toString()}. The string is obtained from a table @@ -97,8 +97,8 @@ import java.io.Serializable; * You can define a subclass of an enumeration class that extends it with * additional enumeration values. The subclass's enumeration values' integer * values need not be distinct from the superclass's enumeration values' integer - * values; the ==, !=, equals(), and - * toString() methods will still work properly even if the subclass + * values; the {@code ==}, {@code !=}, {@code equals()}, and + * {@code toString()} methods will still work properly even if the subclass * uses some of the same integer values as the superclass. However, the * application in which the enumeration class and subclass are used may need to * have distinct integer values in the superclass and subclass. @@ -182,7 +182,7 @@ public abstract class EnumSyntax implements Serializable, Cloneable { * enumeration value table is null. (Note: {@link * java.io.InvalidObjectException InvalidObjectException} is a subclass * of {@link java.io.ObjectStreamException ObjectStreamException}, which - * readResolve() is declared to throw.) + * {@code readResolve()} is declared to throw.) */ protected Object readResolve() throws ObjectStreamException { diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashDocAttributeSet.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashDocAttributeSet.java index 0b915ba2ca9..5742a074420 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashDocAttributeSet.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashDocAttributeSet.java @@ -55,7 +55,7 @@ public class HashDocAttributeSet extends HashAttributeSet * @param attribute Attribute value to add to the set. * * @exception NullPointerException - * (unchecked exception) Thrown if attribute is null. + * (unchecked exception) Thrown if {@code attribute} is null. */ public HashDocAttributeSet(DocAttribute attribute) { super (attribute, DocAttribute.class); @@ -65,7 +65,7 @@ public class HashDocAttributeSet extends HashAttributeSet * Construct a new hash doc attribute set, * initially populated with the values from the given array. * The new attribute set is populated by - * adding the elements of attributes array to the set in + * adding the elements of {@code attributes} array to the set in * sequence, starting at index 0. Thus, later array elements may replace * earlier array elements if the array contains duplicate attribute * values or attribute categories. @@ -75,7 +75,7 @@ public class HashDocAttributeSet extends HashAttributeSet * * @exception NullPointerException * (unchecked exception) - * Thrown if any element of attributes is null. + * Thrown if any element of {@code attributes} is null. */ public HashDocAttributeSet(DocAttribute[] attributes) { super (attributes, DocAttribute.class); @@ -84,15 +84,15 @@ public class HashDocAttributeSet extends HashAttributeSet /** * Construct a new attribute set, initially populated with the * values from the given set where the members of the attribute set - * are restricted to the DocAttribute interface. + * are restricted to the {@code DocAttribute} interface. * * @param attributes set of attribute values to initialise the set. If * null, an empty attribute set is constructed. * * @exception ClassCastException * (unchecked exception) Thrown if any element of - * attributes is not an instance of - * DocAttribute. + * {@code attributes} is not an instance of + * {@code DocAttribute}. */ public HashDocAttributeSet(DocAttributeSet attributes) { super(attributes, DocAttribute.class); diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java index f39c85883d5..e9971e9a45c 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java @@ -55,7 +55,7 @@ public class HashPrintJobAttributeSet extends HashAttributeSet * @param attribute Attribute value to add to the set. * * @exception NullPointerException - * (unchecked exception) Thrown if attribute is null. + * (unchecked exception) Thrown if {@code attribute} is null. */ public HashPrintJobAttributeSet(PrintJobAttribute attribute) { super(attribute, PrintJobAttribute.class); @@ -65,7 +65,7 @@ public class HashPrintJobAttributeSet extends HashAttributeSet * Construct a new hash print job attribute set, * initially populated with the values from the given array. * The new attribute set is populated - * by adding the elements of attributes array to the set in + * by adding the elements of {@code attributes} array to the set in * sequence, starting at index 0. Thus, later array elements may replace * earlier array elements if the array contains duplicate attribute * values or attribute categories. @@ -74,7 +74,7 @@ public class HashPrintJobAttributeSet extends HashAttributeSet * If null, an empty attribute set is constructed. * * @exception NullPointerException (unchecked exception) - * Thrown if any element of attributes is null. + * Thrown if any element of {@code attributes} is null. */ public HashPrintJobAttributeSet(PrintJobAttribute[] attributes) { super (attributes, PrintJobAttribute.class); @@ -83,15 +83,15 @@ public class HashPrintJobAttributeSet extends HashAttributeSet /** * Construct a new attribute set, initially populated with the * values from the given set where the members of the attribute set - * are restricted to the PrintJobAttribute interface. + * are restricted to the {@code PrintJobAttribute} interface. * * @param attributes set of attribute values to initialise the set. If * null, an empty attribute set is constructed. * * @exception ClassCastException * (unchecked exception) Thrown if any element of - * attributes is not an instance of - * PrintJobAttribute. + * {@code attributes} is not an instance of + * {@code PrintJobAttribute}. */ public HashPrintJobAttributeSet(PrintJobAttributeSet attributes) { super(attributes, PrintJobAttribute.class); diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java index fde4ebb6945..9ef717500e7 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java @@ -55,7 +55,7 @@ public class HashPrintRequestAttributeSet extends HashAttributeSet * @param attribute Attribute value to add to the set. * * @exception NullPointerException - * (unchecked exception) Thrown if attribute is null. + * (unchecked exception) Thrown if {@code attribute} is null. */ public HashPrintRequestAttributeSet(PrintRequestAttribute attribute) { super (attribute, PrintRequestAttribute.class); @@ -64,7 +64,7 @@ public class HashPrintRequestAttributeSet extends HashAttributeSet /** * Construct a new print request attribute set, initially populated with * the values from the given array. The new attribute set is populated - * by adding the elements of attributes array to the set in + * by adding the elements of {@code attributes} array to the set in * sequence, starting at index 0. Thus, later array elements may replace * earlier array elements if the array contains duplicate attribute * values or attribute categories. @@ -74,7 +74,7 @@ public class HashPrintRequestAttributeSet extends HashAttributeSet * * @exception NullPointerException * (unchecked exception) - * Thrown if any element of attributes is null. + * Thrown if any element of {@code attributes} is null. */ public HashPrintRequestAttributeSet(PrintRequestAttribute[] attributes) { super (attributes, PrintRequestAttribute.class); @@ -84,15 +84,15 @@ public class HashPrintRequestAttributeSet extends HashAttributeSet /** * Construct a new attribute set, initially populated with the * values from the given set where the members of the attribute set - * are restricted to the (PrintRequestAttributeSe interface. + * are restricted to the {@code (PrintRequestAttributeSe} interface. * * @param attributes set of attribute values to initialise the set. If * null, an empty attribute set is constructed. * * @exception ClassCastException * (unchecked exception) Thrown if any element of - * attributes is not an instance of - * (PrintRequestAttributeSe. + * {@code attributes} is not an instance of + * {@code (PrintRequestAttributeSe}. */ public HashPrintRequestAttributeSet(PrintRequestAttributeSet attributes) { diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java index d98430d0d75..31bd2ec738c 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java @@ -55,7 +55,7 @@ public class HashPrintServiceAttributeSet extends HashAttributeSet * @param attribute Attribute value to add to the set. * * @exception NullPointerException - * (unchecked exception) Thrown if attribute is null. + * (unchecked exception) Thrown if {@code attribute} is null. */ public HashPrintServiceAttributeSet(PrintServiceAttribute attribute) { super (attribute, PrintServiceAttribute.class); @@ -64,7 +64,7 @@ public class HashPrintServiceAttributeSet extends HashAttributeSet /** * Construct a new print service attribute set, initially populated with * the values from the given array. The new attribute set is populated - * by adding the elements of attributes array to the set in + * by adding the elements of {@code attributes} array to the set in * sequence, starting at index 0. Thus, later array elements may replace * earlier array elements if the array contains duplicate attribute * values or attribute categories. @@ -74,7 +74,7 @@ public class HashPrintServiceAttributeSet extends HashAttributeSet * * @exception NullPointerException * (unchecked exception) - * Thrown if any element of attributes is null. + * Thrown if any element of {@code attributes} is null. */ public HashPrintServiceAttributeSet(PrintServiceAttribute[] attributes) { super (attributes, PrintServiceAttribute.class); @@ -84,15 +84,15 @@ public class HashPrintServiceAttributeSet extends HashAttributeSet /** * Construct a new attribute set, initially populated with the * values from the given set where the members of the attribute set - * are restricted to the PrintServiceAttribute interface. + * are restricted to the {@code PrintServiceAttribute} interface. * * @param attributes set of attribute values to initialise the set. If * null, an empty attribute set is constructed. * * @exception ClassCastException * (unchecked exception) Thrown if any element of - * attributes is not an instance of - * PrintServiceAttribute. + * {@code attributes} is not an instance of + * {@code PrintServiceAttribute}. */ public HashPrintServiceAttributeSet(PrintServiceAttributeSet attributes) { diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/IntegerSyntax.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/IntegerSyntax.java index 1fbd3b2556d..a68cb0eac97 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/IntegerSyntax.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/IntegerSyntax.java @@ -69,9 +69,9 @@ public abstract class IntegerSyntax implements Serializable, Cloneable { * @param upperBound Upper bound. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than - * lowerBound or greater than - * upperBound. + * (Unchecked exception) Thrown if {@code value} is less than + * {@code lowerBound} or greater than + * {@code upperBound}. */ protected IntegerSyntax(int value, int lowerBound, int upperBound) { if (lowerBound > value || value > upperBound) { @@ -95,17 +95,17 @@ public abstract class IntegerSyntax implements Serializable, Cloneable { * object. To be equivalent, all of the following conditions must be true: *

          *
        1. - * object is not null. + * {@code object} is not null. *
        2. - * object is an instance of class IntegerSyntax. + * {@code object} is an instance of class IntegerSyntax. *
        3. - * This integer attribute's value and object's value are + * This integer attribute's value and {@code object}'s value are * equal. *
        * * @param object Object to compare to. * - * @return True if object is equivalent to this integer + * @return True if {@code object} is equivalent to this integer * attribute, false otherwise. */ public boolean equals(Object object) { diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintRequestAttribute.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintRequestAttribute.java index 48249480e60..6acf9ca51ef 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintRequestAttribute.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintRequestAttribute.java @@ -37,7 +37,7 @@ package javax.print.attribute; *

        * If an attribute implements {@link DocAttribute DocAttribute} * as well as PrintRequestAttribute, the client may include the - * attribute in a Doc}'s attribute set to specify + * attribute in a {@code Doc}'s attribute set to specify * a job setting which pertains just to that doc. * * @see DocAttributeSet diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/ResolutionSyntax.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/ResolutionSyntax.java index 7e9c40835b5..c6674707ec0 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/ResolutionSyntax.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/ResolutionSyntax.java @@ -150,13 +150,13 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable { * @param dphi * Value (dphi) to convert. * @param units - * Unit conversion factor, e.g. {@link #DPI DPI} or - * {@link #DPCM DPCM}. + * Unit conversion factor, e.g. {@link #DPI DPI} or + * {@link #DPCM DPCM}. * - * @return The value of dphi converted to the desired units. + * @return The value of {@code dphi} converted to the desired units. * * @exception IllegalArgumentException - * (unchecked exception) Thrown if units < 1. + * (unchecked exception) Thrown if {@code units} < 1. */ private static int convertFromDphi(int dphi, int units) { if (units < 1) { @@ -222,7 +222,7 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable { /** * Returns a string version of this resolution attribute in the given units. - * The string takes the form "CxF U", + * The string takes the form "CxF U", * where C is the cross feed direction resolution, F is the * feed direction resolution, and U is the units name. The values are * rounded to the nearest integer. @@ -231,7 +231,7 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable { * Unit conversion factor, e.g. {@link #DPI CODE>DPI} or {@link * #DPCM DPCM}. * @param unitsName - * Units name string, e.g. "dpi" or "dpcm". If + * Units name string, e.g. {@code "dpi"} or {@code "dpcm"}. If * null, no units name is appended to the result. * * @return String version of this resolution attribute. @@ -259,19 +259,19 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable { *

          *
        • * This attribute's cross feed direction resolution is less than or equal to - * the other attribute's cross feed direction resolution. + * the {@code other} attribute's cross feed direction resolution. *
        • * This attribute's feed direction resolution is less than or equal to the - * other attribute's feed direction resolution. + * {@code other} attribute's feed direction resolution. *
        * * @param other Resolution attribute to compare with. * * @return True if this resolution attribute is less than or equal to the - * other resolution attribute, false otherwise. + * {@code other} resolution attribute, false otherwise. * * @exception NullPointerException - * (unchecked exception) Thrown if other is null. + * (unchecked exception) Thrown if {@code other} is null. */ public boolean lessThanOrEquals(ResolutionSyntax other) { return (this.crossFeedResolution <= other.crossFeedResolution && @@ -284,20 +284,20 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable { * object. To be equivalent, all of the following conditions must be true: *
          *
        1. - * object is not null. + * {@code object} is not null. *
        2. - * object is an instance of class ResolutionSyntax. + * {@code object} is an instance of class ResolutionSyntax. *
        3. * This attribute's cross feed direction resolution is equal to - * object's cross feed direction resolution. + * {@code object}'s cross feed direction resolution. *
        4. * This attribute's feed direction resolution is equal to - * object's feed direction resolution. + * {@code object}'s feed direction resolution. *
        * * @param object Object to compare to. * - * @return True if object is equivalent to this resolution + * @return True if {@code object} is equivalent to this resolution * attribute, false otherwise. */ public boolean equals(Object object) { @@ -320,7 +320,7 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable { /** * Returns a string version of this resolution attribute. The string takes - * the form "CxF dphi", where C is the + * the form "CxF dphi", where C is the * cross feed direction resolution and F is the feed direction * resolution. The values are reported in the internal units of dphi. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/SetOfIntegerSyntax.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/SetOfIntegerSyntax.java index 8ba9303135a..ca1c81a6f31 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/SetOfIntegerSyntax.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/SetOfIntegerSyntax.java @@ -38,19 +38,18 @@ import java.util.Vector; * You can construct an instance of SetOfIntegerSyntax by giving it in "string * form." The string consists of zero or more comma-separated integer groups. * Each integer group consists of either one integer, two integers separated by - * a hyphen (-), or two integers separated by a colon - * (:). Each integer consists of one or more decimal digits - * (0 through 9). Whitespace characters cannot + * a hyphen ({@code -}), or two integers separated by a colon + * ({@code :}). Each integer consists of one or more decimal digits + * ({@code 0} through {@code 9}). Whitespace characters cannot * appear within an integer but are otherwise ignored. For example: - * "", "1", "5-10", "1:2, - * 4". + * {@code ""}, {@code "1"}, {@code "5-10"}, {@code "1:2, 4"}. *

        * You can also construct an instance of SetOfIntegerSyntax by giving it in * "array form." Array form consists of an array of zero or more integer groups * where each integer group is a length-1 or length-2 array of - * ints; for example, int[0][], - * int[][]{{1}}, int[][]{{5,10}}, - * int[][]{{1,2},{4}}. + * {@code int}s; for example, {@code int[0][]}, + * {@code int[][]{{1}}}, {@code int[][]{{5,10}}}, + * {@code int[][]{{1,2},{4}}}. *

        * In both string form and array form, each successive integer group gives a * range of integers to be included in the set. The first integer in each group @@ -68,7 +67,7 @@ import java.util.Vector; * array form." This is the same as array form, except there are no null ranges; * the members of the set are represented in as few ranges as possible (i.e., * overlapping ranges are coalesced); the ranges appear in ascending order; and - * each range is always represented as a length-two array of ints + * each range is always represented as a length-two array of {@code int}s * in the form {lower bound, upper bound}. An empty set is represented as a * zero-length array. *

        @@ -98,7 +97,7 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable { * constructed. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if members does not + * (Unchecked exception) Thrown if {@code members} does not * obey the proper syntax. */ protected SetOfIntegerSyntax(String members) { @@ -305,11 +304,11 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable { * * @exception NullPointerException * (Unchecked exception) Thrown if any element of - * members is null. + * {@code members} is null. * @exception IllegalArgumentException * (Unchecked exception) Thrown if any element of - * members is not a length-one or length-two array or if - * any non-null range in members has a lower bound less + * {@code members} is not a length-one or length-two array or if + * any non-null range in {@code members} has a lower bound less * than zero. */ protected SetOfIntegerSyntax(int[][] members) { @@ -357,7 +356,7 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable { * @param member Set member. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if member is less than + * (Unchecked exception) Thrown if {@code member} is less than * zero. */ protected SetOfIntegerSyntax(int member) { @@ -377,7 +376,7 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable { * * @exception IllegalArgumentException * (Unchecked exception) Thrown if the range is non-null and - * lowerBound is less than zero. + * {@code lowerBound} is less than zero. */ protected SetOfIntegerSyntax(int lowerBound, int upperBound) { if (lowerBound <= upperBound && lowerBound < 0) { @@ -411,7 +410,7 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable { * @param x Integer value. * * @return True if this set-of-integer attribute contains the value - * x, false otherwise. + * {@code x}, false otherwise. */ public boolean contains(int x) { // Do a linear search to find the range that contains x, if any. @@ -433,7 +432,7 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable { * @param attribute Integer attribute. * * @return True if this set-of-integer attribute contains - * theAttribute's value, false otherwise. + * {@code theAttribute}'s value, false otherwise. */ public boolean contains(IntegerSyntax attribute) { return contains (attribute.getValue()); @@ -442,10 +441,10 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable { /** * Determine the smallest integer in this set-of-integer attribute that is * greater than the given value. If there are no integers in this - * set-of-integer attribute greater than the given value, -1 is + * set-of-integer attribute greater than the given value, {@code -1} is * returned. (Since a set-of-integer attribute can only contain nonnegative - * values, -1 will never appear in the set.) You can use the - * next() method to iterate through the integer values in a + * values, {@code -1} will never appear in the set.) You can use the + * {@code next()} method to iterate through the integer values in a * set-of-integer attribute in ascending order, like this: *

              *     SetOfIntegerSyntax attribute = . . .;
        @@ -459,8 +458,8 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable {
              * @param  x  Integer value.
              *
              * @return  The smallest integer in this set-of-integer attribute that is
        -     *          greater than x, or -1 if no integer in
        -     *          this set-of-integer attribute is greater than x.
        +     *          greater than {@code x}, or {@code -1} if no integer in
        +     *          this set-of-integer attribute is greater than {@code x}.
              */
             public int next(int x) {
                 // Do a linear search to find the range that contains x, if any.
        @@ -481,17 +480,17 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable {
              * true:
              * 
          *
        1. - * object is not null. + * {@code object} is not null. *
        2. - * object is an instance of class SetOfIntegerSyntax. + * {@code object} is an instance of class SetOfIntegerSyntax. *
        3. - * This set-of-integer attribute's members and object's + * This set-of-integer attribute's members and {@code object}'s * members are the same. *
        * * @param object Object to compare to. * - * @return True if object is equivalent to this + * @return True if {@code object} is equivalent to this * set-of-integer attribute, false otherwise. */ public boolean equals(Object object) { @@ -534,9 +533,9 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable { * Returns a string value corresponding to this set-of-integer attribute. * The string value is a zero-length string if this set is empty. Otherwise, * the string value is a comma-separated list of the ranges in the canonical - * array form, where each range is represented as "i" if + * array form, where each range is represented as "i" if * the lower bound equals the upper bound or - * "i-j" otherwise. + * "i-j" otherwise. */ public String toString() { StringBuilder result = new StringBuilder(); diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/Size2DSyntax.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/Size2DSyntax.java index 76832508c94..e57c0812d58 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/Size2DSyntax.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/Size2DSyntax.java @@ -172,13 +172,13 @@ public abstract class Size2DSyntax implements Serializable, Cloneable { * @param x * Value (micrometers) to convert. * @param units - * Unit conversion factor, e.g. {@link #INCH INCH} or - * {@link #MM MM}. + * Unit conversion factor, e.g. {@link #INCH INCH} or + * {@link #MM MM}. * - * @return The value of x converted to the desired units. + * @return The value of {@code x} converted to the desired units. * * @exception IllegalArgumentException - * (unchecked exception) Thrown if units < 1. + * (unchecked exception) Thrown if {@code units} < 1. */ private static float convertFromMicrometers(int x, int units) { if (units < 1) { @@ -238,8 +238,8 @@ public abstract class Size2DSyntax implements Serializable, Cloneable { /** * Returns a string version of this two-dimensional size attribute in the - * given units. The string takes the form "XxY - * U", where X is the X dimension, Y is the Y + * given units. The string takes the form "XxY + * U", where X is the X dimension, Y is the Y * dimension, and U is the units name. The values are displayed in * floating point. * @@ -273,20 +273,20 @@ public abstract class Size2DSyntax implements Serializable, Cloneable { * be true: *
          *
        1. - * object is not null. + * {@code object} is not null. *
        2. - * object is an instance of class Size2DSyntax. + * {@code object} is an instance of class Size2DSyntax. *
        3. - * This attribute's X dimension is equal to object's X + * This attribute's X dimension is equal to {@code object}'s X * dimension. *
        4. - * This attribute's Y dimension is equal to object's Y + * This attribute's Y dimension is equal to {@code object}'s Y * dimension. *
        * * @param object Object to compare to. * - * @return True if object is equivalent to this + * @return True if {@code object} is equivalent to this * two-dimensional size attribute, false otherwise. */ public boolean equals(Object object) { @@ -306,7 +306,7 @@ public abstract class Size2DSyntax implements Serializable, Cloneable { /** * Returns a string version of this two-dimensional size attribute. The - * string takes the form "XxY um", where + * string takes the form "XxY um", where * X is the X dimension and Y is the Y dimension. * The values are reported in the internal units of micrometers. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/TextSyntax.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/TextSyntax.java index 7b91de24d0f..fb7a5654364 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/TextSyntax.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/TextSyntax.java @@ -61,10 +61,10 @@ public abstract class TextSyntax implements Serializable, Cloneable { * @param value Text string. * @param locale Natural language of the text string. null * is interpreted to mean the default locale for as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if value is null. + * (unchecked exception) Thrown if {@code value} is null. */ protected TextSyntax(String value, Locale locale) { this.value = verify (value); @@ -115,20 +115,20 @@ public abstract class TextSyntax implements Serializable, Cloneable { * object. To be equivalent, all of the following conditions must be true: *
          *
        1. - * object is not null. + * {@code object} is not null. *
        2. - * object is an instance of class TextSyntax. + * {@code object} is an instance of class TextSyntax. *
        3. - * This text attribute's underlying string and object's + * This text attribute's underlying string and {@code object}'s * underlying string are equal. *
        4. - * This text attribute's locale and object's locale are + * This text attribute's locale and {@code object}'s locale are * equal. *
        * * @param object Object to compare to. * - * @return True if object is equivalent to this text + * @return True if {@code object} is equivalent to this text * attribute, false otherwise. */ public boolean equals(Object object) { diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/URISyntax.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/URISyntax.java index 770ba8a9592..baee148a778 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/URISyntax.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/URISyntax.java @@ -52,7 +52,7 @@ public abstract class URISyntax implements Serializable, Cloneable { * @param uri URI. * * @exception NullPointerException - * (unchecked exception) Thrown if uri is null. + * (unchecked exception) Thrown if {@code uri} is null. */ protected URISyntax(URI uri) { this.uri = verify (uri); @@ -88,17 +88,17 @@ public abstract class URISyntax implements Serializable, Cloneable { * To be equivalent, all of the following conditions must be true: *
          *
        1. - * object is not null. + * {@code object} is not null. *
        2. - * object is an instance of class URISyntax. + * {@code object} is an instance of class URISyntax. *
        3. - * This URI attribute's underlying URI and object's + * This URI attribute's underlying URI and {@code object}'s * underlying URI are equal. *
        * * @param object Object to compare to. * - * @return True if object is equivalent to this URI + * @return True if {@code object} is equivalent to this URI * attribute, false otherwise. */ public boolean equals(Object object) { diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java index 0cce5fde315..a9ac9a10c0b 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java @@ -145,7 +145,7 @@ public final class Chromaticity extends EnumSyntax * Get the name of the category of which this attribute value is an * instance. *

        - * For class Chromaticity, the category name is "chromaticity". + * For class Chromaticity, the category name is {@code "chromaticity"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ColorSupported.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ColorSupported.java index 53def76bff1..ab5bee83451 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ColorSupported.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ColorSupported.java @@ -49,8 +49,8 @@ import javax.print.attribute.PrintServiceAttribute; *

        * IPP Compatibility: The IPP boolean value is "true" for SUPPORTED and * "false" for NOT_SUPPORTED. The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -118,7 +118,7 @@ public final class ColorSupported extends EnumSyntax * Get the name of the category of which this attribute value is an * instance. *

        - * For class ColorSupported, the category name is "color-supported". + * For class ColorSupported, the category name is {@code "color-supported"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Compression.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Compression.java index 80b391ed3bd..c0ba6680aba 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Compression.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Compression.java @@ -37,8 +37,8 @@ import javax.print.attribute.DocAttribute; * NONE}). *

        * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -122,7 +122,7 @@ public class Compression extends EnumSyntax implements DocAttribute { * instance. *

        * For class Compression and any vendor-defined subclasses, the category - * name is "compression". + * name is {@code "compression"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Copies.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Copies.java index 55b8db8489b..67cd5258885 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Copies.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Copies.java @@ -62,7 +62,7 @@ import javax.print.attribute.PrintJobAttribute; *

      *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @author David Mendenhall @@ -79,7 +79,7 @@ public final class Copies extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 1. + * (Unchecked exception) Thrown if {@code value} is less than 1. */ public Copies(int value) { super (value, 1, Integer.MAX_VALUE); @@ -90,17 +90,17 @@ public final class Copies extends IntegerSyntax * object. To be equivalent, all of the following conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class Copies. + * {@code object} is an instance of class Copies. *
      3. - * This copies attribute's value and object's value are + * This copies attribute's value and {@code object}'s value are * equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this copies + * @return True if {@code object} is equivalent to this copies * attribute, false otherwise. */ public boolean equals(Object object) { @@ -124,7 +124,7 @@ public final class Copies extends IntegerSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class Copies, the category name is "copies". + * For class Copies, the category name is {@code "copies"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/CopiesSupported.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/CopiesSupported.java index 4d24577ca7d..96efbb60bac 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/CopiesSupported.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/CopiesSupported.java @@ -39,7 +39,7 @@ import javax.print.attribute.SupportedValuesAttribute; * in an IPP "copies-supported" attribute. See class {@link * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an * explanation of canonical array form. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -55,7 +55,7 @@ public final class CopiesSupported extends SetOfIntegerSyntax * @param member Set member. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if member is less than 1. + * (Unchecked exception) Thrown if {@code member} is less than 1. */ public CopiesSupported(int member) { super (member); @@ -74,7 +74,7 @@ public final class CopiesSupported extends SetOfIntegerSyntax * * @exception IllegalArgumentException * (Unchecked exception) Thrown if a null range is specified or if a - * non-null range is specified with lowerBound less than + * non-null range is specified with {@code lowerBound} less than * 1. */ public CopiesSupported(int lowerBound, int upperBound) { @@ -93,17 +93,17 @@ public final class CopiesSupported extends SetOfIntegerSyntax * be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class CopiesSupported. + * {@code object} is an instance of class CopiesSupported. *
      3. - * This copies supported attribute's members and object's + * This copies supported attribute's members and {@code object}'s * members are the same. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this copies + * @return True if {@code object} is equivalent to this copies * supported attribute, false otherwise. */ public boolean equals(Object object) { @@ -129,7 +129,7 @@ public final class CopiesSupported extends SetOfIntegerSyntax * instance. *

      * For class CopiesSupported, the category - * name is "copies-supported". + * name is {@code "copies-supported"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java index c51b2fd32ab..9005e940db1 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java @@ -45,7 +45,7 @@ import javax.print.attribute.PrintJobAttribute; *

      * IPP Compatibility: The information needed to construct an IPP * "date-time-at-completed" attribute can be obtained as described above. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @author Alan Kaminsky @@ -62,7 +62,7 @@ public final class DateTimeAtCompleted extends DateTimeSyntax * @param dateTime {@link java.util.Date Date} value. * * @exception NullPointerException - * (unchecked exception) Thrown if dateTime is null. + * (unchecked exception) Thrown if {@code dateTime} is null. */ public DateTimeAtCompleted(Date dateTime) { super (dateTime); @@ -74,17 +74,17 @@ public final class DateTimeAtCompleted extends DateTimeSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class DateTimeAtCompleted. + * {@code object} is an instance of class DateTimeAtCompleted. *
      3. * This date-time at completed attribute's {@link java.util.Date Date} value - * and object's {@link java.util.Date Date} value are equal. + * and {@code object}'s {@link java.util.Date Date} value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this date-time + * @return True if {@code object} is equivalent to this date-time * at completed attribute, false otherwise. */ public boolean equals(Object object) { @@ -113,7 +113,7 @@ public final class DateTimeAtCompleted extends DateTimeSyntax * instance. *

      * For class DateTimeAtCompleted, the category name is - * "date-time-at-completed". + * {@code "date-time-at-completed"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java index f4c98aaba7d..497398cc3d2 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java @@ -45,7 +45,7 @@ import javax.print.attribute.PrintJobAttribute; *

      * IPP Compatibility: The information needed to construct an IPP * "date-time-at-creation" attribute can be obtained as described above. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @author Alan Kaminsky @@ -62,7 +62,7 @@ public final class DateTimeAtCreation extends DateTimeSyntax * @param dateTime {@link java.util.Date Date} value. * * @exception NullPointerException - * (unchecked exception) Thrown if dateTime is null. + * (unchecked exception) Thrown if {@code dateTime} is null. */ public DateTimeAtCreation(Date dateTime) { super (dateTime); @@ -74,17 +74,17 @@ public final class DateTimeAtCreation extends DateTimeSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class DateTimeAtCreation. + * {@code object} is an instance of class DateTimeAtCreation. *
      3. * This date-time at creation attribute's {@link java.util.Date Date} value - * and object's {@link java.util.Date Date} value are equal. + * and {@code object}'s {@link java.util.Date Date} value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this date-time + * @return True if {@code object} is equivalent to this date-time * at creation attribute, false otherwise. */ public boolean equals(Object object) { @@ -111,7 +111,7 @@ public final class DateTimeAtCreation extends DateTimeSyntax * instance. *

      * For class DateTimeAtCreation, the category name is - * "date-time-at-creation". + * {@code "date-time-at-creation"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java index 821a8453a1a..98ad0d2216d 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java @@ -45,7 +45,7 @@ import javax.print.attribute.PrintJobAttribute; *

      * IPP Compatibility: The information needed to construct an IPP * "date-time-at-processing" attribute can be obtained as described above. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @author Alan Kaminsky @@ -62,7 +62,7 @@ public final class DateTimeAtProcessing extends DateTimeSyntax * @param dateTime {@link java.util.Date Date} value. * * @exception NullPointerException - * (unchecked exception) Thrown if dateTime is null. + * (unchecked exception) Thrown if {@code dateTime} is null. */ public DateTimeAtProcessing(Date dateTime) { super (dateTime); @@ -74,18 +74,18 @@ public final class DateTimeAtProcessing extends DateTimeSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class DateTimeAtProcessing. + * {@code object} is an instance of class DateTimeAtProcessing. *
      3. * This date-time at processing attribute's {@link java.util.Date Date} - * value and object's {@link java.util.Date Date} value + * value and {@code object}'s {@link java.util.Date Date} value * are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this date-time + * @return True if {@code object} is equivalent to this date-time * at processing attribute, false otherwise. */ public boolean equals(Object object) { @@ -112,7 +112,7 @@ public final class DateTimeAtProcessing extends DateTimeSyntax * instance. *

      * For class DateTimeAtProcessing, the category name is - * "date-time-at-processing". + * {@code "date-time-at-processing"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Destination.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Destination.java index 43e1ea9b150..4c855da4b73 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Destination.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Destination.java @@ -40,7 +40,7 @@ import javax.print.attribute.PrintJobAttribute; * A common use for this attribute will be applications which want * to redirect output to a local disk file : eg."file:out.prn". * Note that proper construction of "file:" scheme URI instances should - * be performed using the toURI() method of class + * be performed using the {@code toURI()} method of class * {@link java.io.File File}. * See the documentation on that class for more information. *

      @@ -64,7 +64,7 @@ public final class Destination extends URISyntax * @param uri URI. * * @exception NullPointerException - * (unchecked exception) Thrown if uri is null. + * (unchecked exception) Thrown if {@code uri} is null. */ public Destination(URI uri) { super (uri); @@ -76,17 +76,17 @@ public final class Destination extends URISyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class Destination. + * {@code object} is an instance of class Destination. *
      3. - * This destination attribute's URI and object's URI + * This destination attribute's URI and {@code object}'s URI * are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this destination + * @return True if {@code object} is equivalent to this destination * attribute, false otherwise. */ public boolean equals(Object object) { @@ -111,7 +111,7 @@ public final class Destination extends URISyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class Destination, the category name is "spool-data-destination". + * For class Destination, the category name is {@code "spool-data-destination"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DialogTypeSelection.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DialogTypeSelection.java index 3e567f50973..f4827744815 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DialogTypeSelection.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DialogTypeSelection.java @@ -120,7 +120,7 @@ public final class DialogTypeSelection extends EnumSyntax * instance. *

      * For class DialogTypeSelection the category name is - * "dialog-type-selection". + * {@code "dialog-type-selection"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DocumentName.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DocumentName.java index 68b93bed43c..a2716895cf1 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DocumentName.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DocumentName.java @@ -42,7 +42,7 @@ import javax.print.attribute.DocAttribute; *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -57,10 +57,10 @@ public final class DocumentName extends TextSyntax implements DocAttribute { * @param documentName Document name. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if documentName is null. + * (unchecked exception) Thrown if {@code documentName} is null. */ public DocumentName(String documentName, Locale locale) { super (documentName, locale); @@ -72,20 +72,20 @@ public final class DocumentName extends TextSyntax implements DocAttribute { * To be equivalent, all of the following conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class DocumentName. + * {@code object} is an instance of class DocumentName. *
      3. * This document name attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. - * This document name attribute's locale and object's locale + * This document name attribute's locale and {@code object}'s locale * are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this document + * @return True if {@code object} is equivalent to this document * name attribute, false otherwise. */ public boolean equals(Object object) { @@ -109,7 +109,7 @@ public final class DocumentName extends TextSyntax implements DocAttribute { * Get the name of the category of which this attribute value is an * instance. *

      - * For class DocumentName, the category name is "document-name". + * For class DocumentName, the category name is {@code "document-name"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Fidelity.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Fidelity.java index 8db0c98366b..b77b110d309 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Fidelity.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Fidelity.java @@ -41,8 +41,8 @@ import javax.print.attribute.PrintRequestAttribute; *

      * IPP Compatibility: The IPP boolean value is "true" for FIDELITY_TRUE * and "false" for FIDELITY_FALSE. The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * See RFC 2911 Section 15.1 for * a fuller description of the IPP fidelity attribute. @@ -117,7 +117,7 @@ public final class Fidelity extends EnumSyntax * instance. *

      * For class Fidelity the category name is - * "ipp-attribute-fidelity". + * {@code "ipp-attribute-fidelity"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java index cc21389cbaf..8369f7f4da8 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java @@ -212,8 +212,8 @@ import javax.print.attribute.PrintJobAttribute; * IPP Compatibility: Class Finishings encapsulates some of the * IPP enum values that can be included in an IPP "finishings" attribute, which * is a set of enums. The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * In IPP Finishings is a multi-value attribute, this API currently allows * only one binding to be specified. @@ -466,7 +466,7 @@ public class Finishings extends EnumSyntax * instance. *

      * For class Finishings and any vendor-defined subclasses, the - * category name is "finishings". + * category name is {@code "finishings"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobHoldUntil.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobHoldUntil.java index 4e3ee705bb7..6c6da671faf 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobHoldUntil.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobHoldUntil.java @@ -77,7 +77,7 @@ import javax.print.attribute.PrintJobAttribute; * converted to one of the standard IPP keywords with some loss of precision; * for example, a JobHoldUntil value with today's date and 9:00pm local time * might be converted to the standard IPP keyword "night". The category name - * returned by getName() gives the IPP attribute name. + * returned by {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -94,7 +94,7 @@ public final class JobHoldUntil extends DateTimeSyntax * @param dateTime {@link java.util.Date Date} value. * * @exception NullPointerException - * (unchecked exception) Thrown if dateTime is null. + * (unchecked exception) Thrown if {@code dateTime} is null. */ public JobHoldUntil(Date dateTime) { super (dateTime); @@ -106,17 +106,17 @@ public final class JobHoldUntil extends DateTimeSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobHoldUntil. + * {@code object} is an instance of class JobHoldUntil. *
      3. * This job hold until attribute's {@link java.util.Date Date} value and - * object's {@link java.util.Date Date} value are equal. + * {@code object}'s {@link java.util.Date Date} value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job hold + * @return True if {@code object} is equivalent to this job hold * until attribute, false otherwise. */ public boolean equals(Object object) { @@ -141,7 +141,7 @@ public final class JobHoldUntil extends DateTimeSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class JobHoldUntil, the category name is "job-hold-until". + * For class JobHoldUntil, the category name is {@code "job-hold-until"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressions.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressions.java index e0b267bae89..8d5a1244327 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressions.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressions.java @@ -63,7 +63,7 @@ import javax.print.attribute.PrintJobAttribute; * than a measure of the number of impressions to be produced by the job. *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @see JobImpressionsSupported @@ -85,7 +85,7 @@ public final class JobImpressions extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public JobImpressions(int value) { super(value, 0, Integer.MAX_VALUE); @@ -97,17 +97,17 @@ public final class JobImpressions extends IntegerSyntax * be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobImpressions. + * {@code object} is an instance of class JobImpressions. *
      3. - * This job impressions attribute's value and object's value + * This job impressions attribute's value and {@code object}'s value * are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job + * @return True if {@code object} is equivalent to this job * impressions attribute, false otherwise. */ public boolean equals(Object object) { @@ -132,7 +132,7 @@ public final class JobImpressions extends IntegerSyntax * instance. *

      * For class JobImpressions, the category name is - * "job-impressions". + * {@code "job-impressions"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java index 2ac4f6049d1..ea346435dd6 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java @@ -45,7 +45,7 @@ import javax.print.attribute.PrintJobAttribute; * states, the JobImpressionsCompleted value is the final value for the job. *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @see JobImpressions @@ -67,7 +67,7 @@ public final class JobImpressionsCompleted extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public JobImpressionsCompleted(int value) { super (value, 0, Integer.MAX_VALUE); @@ -79,17 +79,17 @@ public final class JobImpressionsCompleted extends IntegerSyntax * conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobImpressionsCompleted. + * {@code object} is an instance of class JobImpressionsCompleted. *
      3. * This job impressions completed attribute's value and - * object's value are equal. + * {@code object}'s value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job + * @return True if {@code object} is equivalent to this job * impressions completed attribute, false otherwise. */ public boolean equals(Object object) { @@ -116,7 +116,7 @@ public final class JobImpressionsCompleted extends IntegerSyntax * instance. *

      * For class JobImpressionsCompleted, the category name is - * "job-impressions-completed". + * {@code "job-impressions-completed"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java index b6804aae2c8..ee53d2a3614 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java @@ -41,7 +41,7 @@ import javax.print.attribute.SupportedValuesAttribute; * included in an IPP "job-impressions-supported" attribute. See class {@link * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an * explanation of canonical array form. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -61,7 +61,7 @@ public final class JobImpressionsSupported extends SetOfIntegerSyntax * * @exception IllegalArgumentException * (Unchecked exception) Thrown if a null range is specified or if a - * non-null range is specified with lowerBound less than + * non-null range is specified with {@code lowerBound} less than * 0. */ public JobImpressionsSupported(int lowerBound, int upperBound) { @@ -81,17 +81,17 @@ public final class JobImpressionsSupported extends SetOfIntegerSyntax * conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobImpressionsSupported. + * {@code object} is an instance of class JobImpressionsSupported. *
      3. * This job impressions supported attribute's members and - * object's members are the same. + * {@code object}'s members are the same. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job + * @return True if {@code object} is equivalent to this job * impressions supported attribute, false otherwise. */ public boolean equals(Object object) { @@ -118,7 +118,7 @@ public final class JobImpressionsSupported extends SetOfIntegerSyntax * instance. *

      * For class JobImpressionsSupported, the category name is - * "job-impressions-supported". + * {@code "job-impressions-supported"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java index 383f5fe1e2e..c50dc9f3b7d 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java @@ -115,7 +115,7 @@ import javax.print.attribute.PrintJobAttribute; * data, replacing any JobKOctets value the client specified. *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @see JobKOctetsSupported @@ -136,7 +136,7 @@ public final class JobKOctets extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public JobKOctets(int value) { super (value, 0, Integer.MAX_VALUE); @@ -148,17 +148,17 @@ public final class JobKOctets extends IntegerSyntax * true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobKOctets. + * {@code object} is an instance of class JobKOctets. *
      3. - * This job K octets attribute's value and object's value + * This job K octets attribute's value and {@code object}'s value * are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job K + * @return True if {@code object} is equivalent to this job K * octets attribute, false otherwise. */ public boolean equals(Object object) { @@ -182,7 +182,7 @@ public final class JobKOctets extends IntegerSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class JobKOctets, the category name is "job-k-octets". + * For class JobKOctets, the category name is {@code "job-k-octets"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java index cecd80ddd1b..d3fff73454f 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java @@ -57,7 +57,7 @@ import javax.print.attribute.PrintJobAttribute; * JobKOctets} attribute. *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @see JobKOctets @@ -79,7 +79,7 @@ public final class JobKOctetsProcessed extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public JobKOctetsProcessed(int value) { super (value, 0, Integer.MAX_VALUE); @@ -91,17 +91,17 @@ public final class JobKOctetsProcessed extends IntegerSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobKOctetsProcessed. + * {@code object} is an instance of class JobKOctetsProcessed. *
      3. * This job K octets processed attribute's value and - * object's value are equal. + * {@code object}'s value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job K + * @return True if {@code object} is equivalent to this job K * octets processed attribute, false otherwise. */ public boolean equals(Object object) { @@ -128,7 +128,7 @@ public final class JobKOctetsProcessed extends IntegerSyntax * instance. *

      * For class JobKOctetsProcessed, the category name is - * "job-k-octets-processed". + * {@code "job-k-octets-processed"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java index 9a7a8504e00..c4666bee8b1 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java @@ -41,7 +41,7 @@ import javax.print.attribute.SupportedValuesAttribute; * in an IPP "job-k-octets-supported" attribute. See class {@link * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an * explanation of canonical array form. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -60,7 +60,7 @@ public final class JobKOctetsSupported extends SetOfIntegerSyntax * * @exception IllegalArgumentException * (Unchecked exception) Thrown if a null range is specified or if a - * non-null range is specified with lowerBound less than + * non-null range is specified with {@code lowerBound} less than * 0. */ public JobKOctetsSupported(int lowerBound, int upperBound) { @@ -79,17 +79,17 @@ public final class JobKOctetsSupported extends SetOfIntegerSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobKOctetsSupported. + * {@code object} is an instance of class JobKOctetsSupported. *
      3. * This job K octets supported attribute's members and - * object's members are the same. + * {@code object}'s members are the same. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job K + * @return True if {@code object} is equivalent to this job K * octets supported attribute, false otherwise. */ public boolean equals(Object object) { @@ -116,7 +116,7 @@ public final class JobKOctetsSupported extends SetOfIntegerSyntax * instance. *

      * For class JobKOctetsSupported, the category name is - * "job-k-octets-supported". + * {@code "job-k-octets-supported"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheets.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheets.java index caeb31e996c..ad574753c4e 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheets.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheets.java @@ -55,7 +55,7 @@ import javax.print.attribute.PrintJobAttribute; * with {@link JobMediaSheetsSupported JobMediaSheetsSupported}. *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @see JobMediaSheetsSupported @@ -78,7 +78,7 @@ public class JobMediaSheets extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public JobMediaSheets(int value) { super (value, 0, Integer.MAX_VALUE); @@ -90,17 +90,17 @@ public class JobMediaSheets extends IntegerSyntax * be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobMediaSheets. + * {@code object} is an instance of class JobMediaSheets. *
      3. - * This job media sheets attribute's value and object's + * This job media sheets attribute's value and {@code object}'s * value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job media + * @return True if {@code object} is equivalent to this job media * sheets attribute, false otherwise. */ public boolean equals(Object object) { @@ -126,7 +126,7 @@ public class JobMediaSheets extends IntegerSyntax * instance. *

      * For class JobMediaSheets and any vendor-defined subclasses, the - * category name is "job-media-sheets". + * category name is {@code "job-media-sheets"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java index 5b75cdbb89b..ed39a52e122 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java @@ -45,7 +45,7 @@ import javax.print.attribute.PrintJobAttribute; * states, the JobMediaSheetsCompleted value is the final value for the job. *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @see JobMediaSheets @@ -68,7 +68,7 @@ public final class JobMediaSheetsCompleted extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public JobMediaSheetsCompleted(int value) { super (value, 0, Integer.MAX_VALUE); @@ -80,17 +80,17 @@ public final class JobMediaSheetsCompleted extends IntegerSyntax * conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobMediaSheetsCompleted. + * {@code object} is an instance of class JobMediaSheetsCompleted. *
      3. * This job media sheets completed attribute's value and - * object's value are equal. + * {@code object}'s value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job media + * @return True if {@code object} is equivalent to this job media * sheets completed attribute, false otherwise. */ public boolean equals(Object object) { @@ -117,7 +117,7 @@ public final class JobMediaSheetsCompleted extends IntegerSyntax * instance. *

      * For class JobMediaSheetsCompleted, the category name is - * "job-media-sheets-completed". + * {@code "job-media-sheets-completed"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java index 47c7b04459a..19d3a6a2084 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java @@ -41,7 +41,7 @@ import javax.print.attribute.SupportedValuesAttribute; * included in an IPP "job-media-sheets-supported" attribute. See class {@link * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an * explanation of canonical array form. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -60,7 +60,7 @@ public final class JobMediaSheetsSupported extends SetOfIntegerSyntax * * @exception IllegalArgumentException * (Unchecked exception) Thrown if a null range is specified or if a - * non-null range is specified with lowerBound less than + * non-null range is specified with {@code lowerBound} less than * 0. */ public JobMediaSheetsSupported(int lowerBound, int upperBound) { @@ -79,17 +79,17 @@ public final class JobMediaSheetsSupported extends SetOfIntegerSyntax * conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobMediaSheetsSupported. + * {@code object} is an instance of class JobMediaSheetsSupported. *
      3. * This job media sheets supported attribute's members and - * object's members are the same. + * {@code object}'s members are the same. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job media + * @return True if {@code object} is equivalent to this job media * sheets supported attribute, false otherwise. */ public boolean equals(Object object) { @@ -116,7 +116,7 @@ public final class JobMediaSheetsSupported extends SetOfIntegerSyntax * instance. *

      * For class JobMediaSheetsSupported, the - * category name is "job-media-sheets-supported". + * category name is {@code "job-media-sheets-supported"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java index c1f4231009c..f52de7d303a 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java @@ -46,7 +46,7 @@ import javax.print.attribute.PrintJobAttribute; *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -62,10 +62,10 @@ public final class JobMessageFromOperator extends TextSyntax * @param message Message. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if message is null. + * (unchecked exception) Thrown if {@code message} is null. */ public JobMessageFromOperator(String message, Locale locale) { super (message, locale); @@ -77,20 +77,20 @@ public final class JobMessageFromOperator extends TextSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobMessageFromOperator. + * {@code object} is an instance of class JobMessageFromOperator. *
      3. * This job message from operator attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. * This job message from operator attribute's locale and - * object's locale are equal. + * {@code object}'s locale are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job + * @return True if {@code object} is equivalent to this job * message from operator attribute, false otherwise. */ public boolean equals(Object object) { @@ -117,7 +117,7 @@ public final class JobMessageFromOperator extends TextSyntax * instance. *

      * For class JobMessageFromOperator, the - * category name is "job-message-from-operator". + * category name is {@code "job-message-from-operator"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobName.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobName.java index bb563ceaf75..7be25f02c91 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobName.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobName.java @@ -47,7 +47,7 @@ import javax.print.attribute.PrintJobAttribute; *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -62,10 +62,10 @@ public final class JobName extends TextSyntax * @param jobName Job name. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if jobName is null. + * (unchecked exception) Thrown if {@code jobName} is null. */ public JobName(String jobName, Locale locale) { super (jobName, locale); @@ -76,20 +76,20 @@ public final class JobName extends TextSyntax * object. To be equivalent, all of the following conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobName. + * {@code object} is an instance of class JobName. *
      3. - * This job name attribute's underlying string and object's + * This job name attribute's underlying string and {@code object}'s * underlying string are equal. *
      4. - * This job name attribute's locale and object's locale are + * This job name attribute's locale and {@code object}'s locale are * equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job name + * @return True if {@code object} is equivalent to this job name * attribute, false otherwise. */ public boolean equals(Object object) { @@ -113,7 +113,7 @@ public final class JobName extends TextSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class JobName, the category name is "job-name". + * For class JobName, the category name is {@code "job-name"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java index 61e589c7f64..62a3e20b235 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java @@ -46,7 +46,7 @@ import javax.print.attribute.PrintJobAttribute; *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -62,10 +62,10 @@ public final class JobOriginatingUserName extends TextSyntax * @param userName User name. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if userName is null. + * (unchecked exception) Thrown if {@code userName} is null. */ public JobOriginatingUserName(String userName, Locale locale) { super (userName, locale); @@ -77,20 +77,20 @@ public final class JobOriginatingUserName extends TextSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobOriginatingUserName. + * {@code object} is an instance of class JobOriginatingUserName. *
      3. * This job originating user name attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. * This job originating user name attribute's locale and - * object's locale are equal. + * {@code object}'s locale are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job + * @return True if {@code object} is equivalent to this job * originating user name attribute, false otherwise. */ public boolean equals(Object object) { @@ -117,7 +117,7 @@ public final class JobOriginatingUserName extends TextSyntax * instance. *

      * For class JobOriginatingUserName, the - * category name is "job-originating-user-name". + * category name is {@code "job-originating-user-name"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPriority.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPriority.java index b4a77ae5c51..7a03e304f1b 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPriority.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPriority.java @@ -52,7 +52,7 @@ import javax.print.attribute.PrintJobAttribute; * among the available job priority levels. *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @author Alan Kaminsky @@ -68,7 +68,7 @@ public final class JobPriority extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 1 + * (Unchecked exception) Thrown if {@code value} is less than 1 * or greater than 100. */ public JobPriority(int value) { @@ -81,17 +81,17 @@ public final class JobPriority extends IntegerSyntax * true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobPriority. + * {@code object} is an instance of class JobPriority. *
      3. - * This job priority attribute's value and object's value + * This job priority attribute's value and {@code object}'s value * are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job + * @return True if {@code object} is equivalent to this job * priority attribute, false otherwise. */ public boolean equals(Object object) { @@ -115,7 +115,7 @@ public final class JobPriority extends IntegerSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class JobPriority, the category name is "job-priority". + * For class JobPriority, the category name is {@code "job-priority"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPrioritySupported.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPrioritySupported.java index 80e7b6c54a5..3d7cf55095a 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPrioritySupported.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPrioritySupported.java @@ -42,7 +42,7 @@ import javax.print.attribute.SupportedValuesAttribute; * priority values equally among the available job priority levels. *

      * IPP Compatibility: The integer value gives the IPP integer value. - * The category name returned by getName() gives the IPP + * The category name returned by {@code getName()} gives the IPP * attribute name. * * @author Alan Kaminsky @@ -60,7 +60,7 @@ public final class JobPrioritySupported extends IntegerSyntax * @param value Number of different job priority levels supported. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 1 + * (Unchecked exception) Thrown if {@code value} is less than 1 * or greater than 100. */ public JobPrioritySupported(int value) { @@ -73,17 +73,17 @@ public final class JobPrioritySupported extends IntegerSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobPrioritySupported. + * {@code object} is an instance of class JobPrioritySupported. *
      3. * This job priority supported attribute's value and - * object's value are equal. + * {@code object}'s value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job + * @return True if {@code object} is equivalent to this job * priority supported attribute, false otherwise. */ public boolean equals (Object object) { @@ -112,7 +112,7 @@ public final class JobPrioritySupported extends IntegerSyntax * instance. *

      * For class JobPrioritySupported, the - * category name is "job-priority-supported". + * category name is {@code "job-priority-supported"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobSheets.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobSheets.java index cec0f27901a..69579ce6c60 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobSheets.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobSheets.java @@ -44,9 +44,9 @@ import javax.print.attribute.PrintJobAttribute; * particular JobSheets value. *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The + * {@code getName()} is the IPP attribute name. The * enumeration's integer value is the IPP enum value. The - * toString() method returns the IPP string representation of + * {@code toString()} method returns the IPP string representation of * the attribute value. For a subclass, the attribute value must be * localized to give the IPP name and natural language values. * @@ -122,7 +122,7 @@ public class JobSheets extends EnumSyntax * instance. *

      * For class JobSheets and any vendor-defined subclasses, the category - * name is "job-sheets". + * name is {@code "job-sheets"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobState.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobState.java index 0ad1e5997ba..e87de1aab70 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobState.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobState.java @@ -39,8 +39,8 @@ import javax.print.attribute.PrintJobAttribute; * detailed information about the job in the given job state. *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -225,7 +225,7 @@ public class JobState extends EnumSyntax implements PrintJobAttribute { * instance. *

      * For class JobState and any vendor-defined subclasses, the category - * name is "job-state". + * name is {@code "job-state"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReason.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReason.java index 3465eae6204..553236efaeb 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReason.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReason.java @@ -48,8 +48,8 @@ import javax.print.attribute.Attribute; * JobState} also changed. *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -259,7 +259,7 @@ public class JobStateReason extends EnumSyntax implements Attribute { * The job was aborted by the system because the document data's document * format (doc flavor) is not among those supported by the printer. If the * client specifies a doc flavor with a MIME type of - * "application/octet-stream", the printer may abort the job if + * {@code "application/octet-stream"}, the printer may abort the job if * the printer cannot determine the document data's actual format through * auto-sensing (even if the printer supports the document format if * specified explicitly). This value must be supported, since a doc flavor @@ -449,7 +449,7 @@ public class JobStateReason extends EnumSyntax implements Attribute { * instance. *

      * For class JobStateReason and any vendor-defined subclasses, the - * category name is "job-state-reason". + * category name is {@code "job-state-reason"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Media.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Media.java index 59dd57b320b..94eec385dfb 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Media.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Media.java @@ -49,8 +49,8 @@ import javax.print.attribute.PrintJobAttribute; * one of the ways in which the Media attribute can be specified. *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Phil Race @@ -74,16 +74,16 @@ public abstract class Media extends EnumSyntax * object. To be equivalent, all of the following conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is of the same subclass of Media as this object. + * {@code object} is of the same subclass of Media as this object. *
      3. * The values are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this media + * @return True if {@code object} is equivalent to this media * attribute, false otherwise. */ public boolean equals(Object object) { @@ -111,7 +111,7 @@ public abstract class Media extends EnumSyntax * instance. *

      * For class Media and any vendor-defined subclasses, the category name is - * "media". + * {@code "media"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaPrintableArea.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaPrintableArea.java index 232600e88ad..cfe9a34cbf8 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaPrintableArea.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaPrintableArea.java @@ -54,7 +54,7 @@ import javax.print.attribute.PrintRequestAttribute; * The hardware's minimum margins is not just a property of the printer, * but may be a function of the media size, orientation, media type, and * any specified finishings. - * PrintService provides the method to query the supported + * {@code PrintService} provides the method to query the supported * values of an attribute in a suitable context : * See {@link javax.print.PrintService#getSupportedAttributeValues(Class,DocFlavor, AttributeSet) PrintService.getSupportedAttributeValues()} *

      @@ -236,16 +236,16 @@ public final class MediaPrintableArea * To be equivalent, all of the following conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class MediaPrintableArea. + * {@code object} is an instance of class MediaPrintableArea. *
      3. * The origin and dimensions are the same. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this media margins + * @return True if {@code object} is equivalent to this media margins * attribute, false otherwise. */ public boolean equals(Object object) { @@ -278,7 +278,7 @@ public final class MediaPrintableArea * instance. *

      * For class MediaPrintableArea, - * the category name is "media-printable-area". + * the category name is {@code "media-printable-area"}. *

      This is not an IPP V1.1 attribute. * * @return Attribute category name. @@ -295,7 +295,7 @@ public final class MediaPrintableArea * Unit conversion factor, e.g. {@link #INCH INCH} or * {@link #MM MM}. * @param unitsName - * Units name string, e.g. "in" or "mm". If + * Units name string, e.g. {@code "in"} or {@code "mm"}. If * null, no units name is appended to the result. * * @return String version of this two-dimensional size attribute. diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSize.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSize.java index b6fdbdccb4f..55990097a71 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSize.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSize.java @@ -42,7 +42,7 @@ import javax.print.attribute.Attribute; * MediaSize is not yet used to specify media. Its current role is * as a mapping for named media (see {@link MediaSizeName MediaSizeName}). * Clients can use the mapping method - * MediaSize.getMediaSizeForName(MediaSizeName) + * {@code MediaSize.getMediaSizeForName(MediaSizeName)} * to find the physical dimensions of the MediaSizeName instances * enumerated in this API. This is useful for clients which need this * information to format {@literal &} paginate printing. @@ -66,8 +66,8 @@ public class MediaSize extends Size2DSyntax implements Attribute { * @param x X dimension. * @param y Y dimension. * @param units - * Unit conversion factor, e.g. Size2DSyntax.INCH or - * Size2DSyntax.MM. + * Unit conversion factor, e.g. {@code Size2DSyntax.INCH} or + * {@code Size2DSyntax.MM}. * * @exception IllegalArgumentException * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or @@ -87,8 +87,8 @@ public class MediaSize extends Size2DSyntax implements Attribute { * @param x X dimension. * @param y Y dimension. * @param units - * Unit conversion factor, e.g. Size2DSyntax.INCH or - * Size2DSyntax.MM. + * Unit conversion factor, e.g. {@code Size2DSyntax.INCH} or + * {@code Size2DSyntax.MM}. * * @exception IllegalArgumentException * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or @@ -109,8 +109,8 @@ public class MediaSize extends Size2DSyntax implements Attribute { * @param x X dimension. * @param y Y dimension. * @param units - * Unit conversion factor, e.g. Size2DSyntax.INCH or - * Size2DSyntax.MM. + * Unit conversion factor, e.g. {@code Size2DSyntax.INCH} or + * {@code Size2DSyntax.MM}. * @param media a media name to associate with this MediaSize * * @exception IllegalArgumentException @@ -135,8 +135,8 @@ public class MediaSize extends Size2DSyntax implements Attribute { * @param x X dimension. * @param y Y dimension. * @param units - * Unit conversion factor, e.g. Size2DSyntax.INCH or - * Size2DSyntax.MM. + * Unit conversion factor, e.g. {@code Size2DSyntax.INCH} or + * {@code Size2DSyntax.MM}. * @param media a media name to associate with this MediaSize * * @exception IllegalArgumentException @@ -168,7 +168,7 @@ public class MediaSize extends Size2DSyntax implements Attribute { /** * Get the MediaSize for the specified named media. * - * @param media - the name of the media for which the size is sought + * @param media the name of the media for which the size is sought * @return size of the media, or null if this media is not associated * with any size. */ @@ -187,11 +187,11 @@ public class MediaSize extends Size2DSyntax implements Attribute { *

      * This method is useful for clients which have only dimensions and * want to find a Media which corresponds to the dimensions. - * @param x - X dimension - * @param y - Y dimension. + * @param x X dimension + * @param y Y dimension. * @param units - * Unit conversion factor, e.g. Size2DSyntax.INCH or - * Size2DSyntax.MM + * Unit conversion factor, e.g. {@code Size2DSyntax.INCH} or + * {@code Size2DSyntax.MM} * @return MediaSizeName matching these dimensions, or null. * @exception IllegalArgumentException if {@code x <= 0}, * {@code y <= 0}, or {@code units < 1}. @@ -237,20 +237,20 @@ public class MediaSize extends Size2DSyntax implements Attribute { * To be equivalent, all of the following conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class MediaSize. + * {@code object} is an instance of class MediaSize. *
      3. * This media size attribute's X dimension is equal to - * object's X dimension. + * {@code object}'s X dimension. *
      4. * This media size attribute's Y dimension is equal to - * object's Y dimension. + * {@code object}'s Y dimension. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this media size + * @return True if {@code object} is equivalent to this media size * attribute, false otherwise. */ public boolean equals(Object object) { @@ -276,7 +276,7 @@ public class MediaSize extends Size2DSyntax implements Attribute { * instance. *

      * For class MediaSize and any vendor-defined subclasses, the category - * name is "media-size". + * name is {@code "media-size"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java index f3e02845159..7f06e953572 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java @@ -62,53 +62,53 @@ import javax.print.attribute.PrintJobAttribute; * specify two variations of this possibility. * *

      - * In the detailed explanations below, if "a" represents an + * In the detailed explanations below, if "{@code a}" represents an * instance of document data, then the result of processing the data in - * document "a" is a sequence of media sheets represented by - * "a(*)". + * document "{@code a}" is a sequence of media sheets represented by + * "{@code a(*)}". *

      * The standard MultipleDocumentHandling values are: *

        *
      • * {@link #SINGLE_DOCUMENT * SINGLE_DOCUMENT}. If a print job has multiple - * documents -- say, the document data is called a and - * b -- then the result of processing all the document data - * (a and then b) must be treated as a single sequence + * documents -- say, the document data is called {@code a} and + * {@code b} -- then the result of processing all the document data + * ({@code a} and then {@code b}) must be treated as a single sequence * of media sheets for finishing operations; that is, finishing would be - * performed on the concatenation of the sequences a(*),b(*). The + * performed on the concatenation of the sequences {@code a(*),b(*)}. The * printer must not force the data in each document instance to be formatted * onto a new print-stream page, nor to start a new impression on a new media * sheet. If more than one copy is made, the ordering of the sets of media * sheets resulting from processing the document data must be - * a(*),b(*),a(*),b(*),..., and the printer object must force - * each copy (a(*),b(*)) to start on a new media sheet. + * {@code a(*),b(*),a(*),b(*),...}, and the printer object must force + * each copy ({@code a(*),b(*)}) to start on a new media sheet. * *
      • * {@link #SEPARATE_DOCUMENTS_UNCOLLATED_COPIES * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES}. If a print job - * has multiple documents -- say, the document data is called a and - * b -- then the result of processing the data in each document + * has multiple documents -- say, the document data is called {@code a} and + * {@code b} -- then the result of processing the data in each document * instance must be treated as a single sequence of media sheets for finishing - * operations; that is, the sets a(*) and b(*) would + * operations; that is, the sets {@code a(*)} and {@code b(*)} would * each be finished separately. The printer must force each copy of the result * of processing the data in a single document to start on a new media sheet. * If more than one copy is made, the ordering of the sets of media sheets * resulting from processing the document data must be - * a(*),a(*),...,b(*),b(*).... + * {@code a(*),a(*),...,b(*),b(*)...}. * *
      • * {@link #SEPARATE_DOCUMENTS_COLLATED_COPIES * SEPARATE_DOCUMENTS_COLLATED_COPIES}. If a print job - * has multiple documents -- say, the document data is called a and - * b -- then the result of processing the data in each document + * has multiple documents -- say, the document data is called {@code a} and + * {@code b} -- then the result of processing the data in each document * instance must be treated as a single sequence of media sheets for finishing - * operations; that is, the sets a(*) and b(*) would + * operations; that is, the sets {@code a(*)} and {@code b(*)} would * each be finished separately. The printer must force each copy of the result * of processing the data in a single document to start on a new media sheet. * If more than one copy is made, the ordering of the sets of media sheets * resulting from processing the document data must be - * a(*),b(*),a(*),b(*),.... + * {@code a(*),b(*),a(*),b(*),...}. * *
      • * {@link #SINGLE_DOCUMENT_NEW_SHEET @@ -130,18 +130,18 @@ import javax.print.attribute.PrintJobAttribute; * {@link Finishings#STAPLE STAPLE} is specified, then: *
          *
        • - * With SINGLE_DOCUMENT, documents a and b are + * With SINGLE_DOCUMENT, documents {@code a} and {@code b} are * stapled together as a single document with no regard to new sheets. * *
        • - * With SINGLE_DOCUMENT_NEW_SHEET, documents a and b - * are stapled together as a single document, but document b + * With SINGLE_DOCUMENT_NEW_SHEET, documents {@code a} and {@code b} + * are stapled together as a single document, but document {@code b} * starts on a new sheet. * *
        • * With SEPARATE_DOCUMENTS_UNCOLLATED_COPIES and - * SEPARATE_DOCUMENTS_COLLATED_COPIES, documents a and - * b are stapled separately. + * SEPARATE_DOCUMENTS_COLLATED_COPIES, documents {@code a} and + * {@code b} are stapled separately. *
        *

        * Note: None of these values provide means to produce uncollated @@ -150,8 +150,8 @@ import javax.print.attribute.PrintJobAttribute; * To specify that, see the {@link SheetCollate SheetCollate} attribute. *

        * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @see Copies @@ -256,7 +256,7 @@ public class MultipleDocumentHandling extends EnumSyntax * instance. *

        * For class MultipleDocumentHandling and any vendor-defined subclasses, - * the category name is "multiple-document-handling". + * the category name is {@code "multiple-document-handling"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfDocuments.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfDocuments.java index 73e07e8d124..50e0b10b7c9 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfDocuments.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfDocuments.java @@ -35,7 +35,7 @@ import javax.print.attribute.PrintJobAttribute; * not. *

        * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @author Alan Kaminsky @@ -53,7 +53,7 @@ public final class NumberOfDocuments extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public NumberOfDocuments(int value) { super (value, 0, Integer.MAX_VALUE); @@ -65,17 +65,17 @@ public final class NumberOfDocuments extends IntegerSyntax * must be true: *

          *
        1. - * object is not null. + * {@code object} is not null. *
        2. - * object is an instance of class NumberOfDocuments. + * {@code object} is an instance of class NumberOfDocuments. *
        3. - * This number of documents attribute's value and object's + * This number of documents attribute's value and {@code object}'s * value are equal. *
        * * @param object Object to compare to. * - * @return True if object is equivalent to this number of + * @return True if {@code object} is equivalent to this number of * documents attribute, false otherwise. */ public boolean equals(Object object) { @@ -102,7 +102,7 @@ public final class NumberOfDocuments extends IntegerSyntax * instance. *

        * For class NumberOfDocuments, the - * category name is "number-of-documents". + * category name is {@code "number-of-documents"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java index e73ef00be84..0a01f090bf3 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java @@ -35,7 +35,7 @@ import javax.print.attribute.PrintJobAttribute; * scheduled order). *

        * IPP Compatibility: The integer value gives the IPP integer value. - * The category name returned by getName() gives the IPP + * The category name returned by {@code getName()} gives the IPP * attribute name. * * @author Alan Kaminsky @@ -52,7 +52,7 @@ public final class NumberOfInterveningJobs extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public NumberOfInterveningJobs(int value) { super(value, 0, Integer.MAX_VALUE); @@ -64,17 +64,17 @@ public final class NumberOfInterveningJobs extends IntegerSyntax * conditions must be true: *

          *
        1. - * object is not null. + * {@code object} is not null. *
        2. - * object is an instance of class NumberOfInterveningJobs. + * {@code object} is an instance of class NumberOfInterveningJobs. *
        3. * This number of intervening jobs attribute's value and - * object's value are equal. + * {@code object}'s value are equal. *
        * * @param object Object to compare to. * - * @return True if object is equivalent to this number of + * @return True if {@code object} is equivalent to this number of * intervening jobs attribute, false otherwise. */ public boolean equals(Object object) { @@ -101,7 +101,7 @@ public final class NumberOfInterveningJobs extends IntegerSyntax * instance. *

        * For class NumberOfInterveningJobs, the - * category name is "number-of-intervening-jobs". + * category name is {@code "number-of-intervening-jobs"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUp.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUp.java index d029d82faa8..b6a965a7c76 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUp.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUp.java @@ -118,7 +118,7 @@ import javax.print.attribute.PrintJobAttribute; *

      * * IPP Compatibility: The integer value gives the IPP integer value. - * The category name returned by getName() gives the IPP + * The category name returned by {@code getName()} gives the IPP * attribute name. * * @author Alan Kaminsky @@ -135,7 +135,7 @@ public final class NumberUp extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 1. + * (Unchecked exception) Thrown if {@code value} is less than 1. */ public NumberUp(int value) { super (value, 1, Integer.MAX_VALUE); @@ -146,17 +146,17 @@ public final class NumberUp extends IntegerSyntax * object. To be equivalent, all of the following conditions must be true: *
        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class NumberUp. + * {@code object} is an instance of class NumberUp. *
      3. - * This number up attribute's value and object's value are + * This number up attribute's value and {@code object}'s value are * equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this number up + * @return True if {@code object} is equivalent to this number up * attribute, false otherwise. */ public boolean equals(Object object) { @@ -180,7 +180,7 @@ public final class NumberUp extends IntegerSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class NumberUp, the category name is "number-up". + * For class NumberUp, the category name is {@code "number-up"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUpSupported.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUpSupported.java index a7f1b98bc1f..e5107b8ca04 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUpSupported.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUpSupported.java @@ -37,7 +37,7 @@ import javax.print.attribute.SupportedValuesAttribute; * included in an IPP "number-up-supported" attribute. See class {@link * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an * explanation of canonical array form. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -57,12 +57,12 @@ public final class NumberUpSupported extends SetOfIntegerSyntax * @param members Set members in array form. * * @exception NullPointerException - * (unchecked exception) Thrown if members is null or - * any element of members is null. + * (unchecked exception) Thrown if {@code members} is null or + * any element of {@code members} is null. * @exception IllegalArgumentException * (unchecked exception) Thrown if any element of - * members is not a length-one or length-two array. Also - * thrown if members is a zero-length array or if any + * {@code members} is not a length-one or length-two array. Also + * thrown if {@code members} is a zero-length array or if any * member of the set is less than 1. */ public NumberUpSupported(int[][] members) { @@ -91,7 +91,7 @@ public final class NumberUpSupported extends SetOfIntegerSyntax * @param member Set member. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if member is less than + * (Unchecked exception) Thrown if {@code member} is less than * 1. */ public NumberUpSupported(int member) { @@ -111,7 +111,7 @@ public final class NumberUpSupported extends SetOfIntegerSyntax * * @exception IllegalArgumentException * (Unchecked exception) Thrown if a null range is specified or if a - * non-null range is specified with lowerBound less than + * non-null range is specified with {@code lowerBound} less than * 1. */ public NumberUpSupported(int lowerBound, int upperBound) { @@ -130,17 +130,17 @@ public final class NumberUpSupported extends SetOfIntegerSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class NumberUpSupported. + * {@code object} is an instance of class NumberUpSupported. *
      3. - * This number up supported attribute's members and object's + * This number up supported attribute's members and {@code object}'s * members are the same. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this number up + * @return True if {@code object} is equivalent to this number up * supported attribute, false otherwise. */ public boolean equals(Object object) { @@ -167,7 +167,7 @@ public final class NumberUpSupported extends SetOfIntegerSyntax * instance. *

      * For class NumberUpSupported, the - * category name is "number-up-supported". + * category name is {@code "number-up-supported"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OrientationRequested.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OrientationRequested.java index a026baac5db..0ce78a5b390 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OrientationRequested.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OrientationRequested.java @@ -36,17 +36,17 @@ import javax.print.attribute.PrintJobAttribute; * does not describe the orientation of the client-supplied print-stream * pages. *

      - * For some document formats (such as "application/postscript"), + * For some document formats (such as {@code "application/postscript"}), * the desired orientation of the print-stream pages is specified within the * document data. This information is generated by a device driver prior to * the submission of the print job. Other document formats (such as - * "text/plain") do not include the notion of desired orientation + * {@code "text/plain"}) do not include the notion of desired orientation * within the document data. In the latter case it is possible for the printer * to bind the desired orientation to the document data after it has been * submitted. It is expected that a printer would only support the * OrientationRequested attribute for some document formats (e.g., - * "text/plain" or "text/html") but not others (e.g. - * "application/postscript"). This is no different from any other + * {@code "text/plain"} or {@code "text/html"}) but not others (e.g. + * {@code "application/postscript"}). This is no different from any other * job template attribute, since a print job can always impose constraints * among the values of different job template attributes. * However, a special mention @@ -55,8 +55,8 @@ import javax.print.attribute.PrintJobAttribute; * formats. *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -105,7 +105,7 @@ public final class OrientationRequested extends EnumSyntax * Finishings Finishings} attribute in cases where the * opposite edge is desired for finishing a portrait document on simple * finishing devices that have only one finishing position. Thus a - * "text/plain" portrait document can be stapled "on the + * {@code "text/plain"} portrait document can be stapled "on the * right" by a simple finishing device as is common use with some * Middle Eastern languages such as Hebrew. */ @@ -176,7 +176,7 @@ public final class OrientationRequested extends EnumSyntax * instance. *

      * For class OrientationRequested, the - * category name is "orientation-requested". + * category name is {@code "orientation-requested"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java index 5ebf19378fd..e9411371466 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java @@ -42,7 +42,7 @@ import javax.print.attribute.PrintJobAttribute; *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -58,10 +58,10 @@ public final class OutputDeviceAssigned extends TextSyntax * @param deviceName Device name. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if deviceName is null. + * (unchecked exception) Thrown if {@code deviceName} is null. */ public OutputDeviceAssigned(String deviceName, Locale locale) { @@ -76,20 +76,20 @@ public final class OutputDeviceAssigned extends TextSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class OutputDeviceAssigned. + * {@code object} is an instance of class OutputDeviceAssigned. *
      3. * This output device assigned attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. * This output device assigned attribute's locale and - * object's locale are equal. + * {@code object}'s locale are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this output + * @return True if {@code object} is equivalent to this output * device assigned attribute, false otherwise. */ public boolean equals(Object object) { @@ -116,7 +116,7 @@ public final class OutputDeviceAssigned extends TextSyntax * instance. *

      * For class OutputDeviceAssigned, the - * category name is "output-device-assigned". + * category name is {@code "output-device-assigned"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java index b7f75af6ead..e1d31db38c1 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java @@ -35,8 +35,8 @@ import javax.print.attribute.PrintServiceAttribute; * specified as attributes outside the print data. *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -116,7 +116,7 @@ public class PDLOverrideSupported extends EnumSyntax * instance. *

      * For class PDLOverrideSupported and any vendor-defined subclasses, the - * category name is "pdl-override-supported". + * category name is {@code "pdl-override-supported"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PageRanges.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PageRanges.java index 6038f0bb534..7e92d6db2c0 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PageRanges.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PageRanges.java @@ -44,13 +44,13 @@ import javax.print.attribute.PrintJobAttribute; * driver and this attribute would not be required. However, when printing an * archived document which has already been formatted, the end user may elect to * print just a subset of the pages contained in the document. In this case, if - * a page range of "n-m" is specified, the first page + * a page range of "n-m" is specified, the first page * to be printed will be page n. All subsequent pages of the document * will be printed through and including page m. *

      * If a PageRanges attribute is not specified for a print job, all pages of * the document will be printed. In other words, the default value for the - * PageRanges attribute is always {{1, Integer.MAX_VALUE}}. + * PageRanges attribute is always {@code {{1, Integer.MAX_VALUE}}}. *

      * The effect of a PageRanges attribute on a multidoc print job (a job with * multiple documents) depends on whether all the docs have the same page ranges @@ -99,7 +99,7 @@ import javax.print.attribute.PrintJobAttribute; * and IPP "page-ranges" attribute. See class {@link * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an * explanation of canonical array form. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author David Mendenhall * @author Alan Kaminsky @@ -119,12 +119,12 @@ public final class PageRanges extends SetOfIntegerSyntax * @param members Set members in array form. * * @exception NullPointerException - * (unchecked exception) Thrown if members is null or - * any element of members is null. + * (unchecked exception) Thrown if {@code members} is null or + * any element of {@code members} is null. * @exception IllegalArgumentException * (unchecked exception) Thrown if any element of - * members is not a length-one or length-two array. Also - * thrown if members is a zero-length array or if any + * {@code members} is not a length-one or length-two array. Also + * thrown if {@code members} is a zero-length array or if any * member of the set is less than 1. */ public PageRanges(int[][] members) { @@ -144,10 +144,10 @@ public final class PageRanges extends SetOfIntegerSyntax * @param members Set members in string form. * * @exception NullPointerException - * (unchecked exception) Thrown if members is null or - * any element of members is null. + * (unchecked exception) Thrown if {@code members} is null or + * any element of {@code members} is null. * @exception IllegalArgumentException - * (Unchecked exception) Thrown if members does not + * (Unchecked exception) Thrown if {@code members} does not * obey the proper syntax. Also * thrown if the constructed set-of-integer is a * zero-length array or if any @@ -182,7 +182,7 @@ public final class PageRanges extends SetOfIntegerSyntax * @param member Set member. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if member is less than + * (Unchecked exception) Thrown if {@code member} is less than * 1. */ public PageRanges(int member) { @@ -201,7 +201,7 @@ public final class PageRanges extends SetOfIntegerSyntax * * @exception IllegalArgumentException * (Unchecked exception) Thrown if a null range is specified or if a - * non-null range is specified with lowerBound less than + * non-null range is specified with {@code lowerBound} less than * 1. */ public PageRanges(int lowerBound, int upperBound) { @@ -219,17 +219,17 @@ public final class PageRanges extends SetOfIntegerSyntax * true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PageRanges. + * {@code object} is an instance of class PageRanges. *
      3. - * This page ranges attribute's members and object's members + * This page ranges attribute's members and {@code object}'s members * are the same. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this page ranges + * @return True if {@code object} is equivalent to this page ranges * attribute, false otherwise. */ public boolean equals(Object object) { @@ -253,7 +253,7 @@ public final class PageRanges extends SetOfIntegerSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class PageRanges, the category name is "page-ranges". + * For class PageRanges, the category name is {@code "page-ranges"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinute.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinute.java index 37d0ddbd5d7..397ad356837 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinute.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinute.java @@ -37,7 +37,7 @@ import javax.print.attribute.PrintServiceAttribute; * device that takes more than two minutes to process a page. *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @author Alan Kaminsky @@ -54,7 +54,7 @@ public final class PagesPerMinute extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public PagesPerMinute(int value) { super(value, 0, Integer.MAX_VALUE); @@ -66,17 +66,17 @@ public final class PagesPerMinute extends IntegerSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PagesPerMinute. + * {@code object} is an instance of class PagesPerMinute. *
      3. - * This pages per minute attribute's value and object's + * This pages per minute attribute's value and {@code object}'s * value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this pages per + * @return True if {@code object} is equivalent to this pages per * minute attribute, false otherwise. */ public boolean equals(Object object) { @@ -102,7 +102,7 @@ public final class PagesPerMinute extends IntegerSyntax * instance. *

      * For class PagesPerMinute, the - * category name is "pages-per-minute". + * category name is {@code "pages-per-minute"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java index f139c5964ce..9af138bf5dd 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java @@ -48,7 +48,7 @@ import javax.print.attribute.PrintServiceAttribute; * attribute must also be present and have a value of SUPPORTED. *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @author Alan Kaminsky @@ -65,7 +65,7 @@ public final class PagesPerMinuteColor extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public PagesPerMinuteColor(int value) { super(value, 0, Integer.MAX_VALUE); @@ -77,17 +77,17 @@ public final class PagesPerMinuteColor extends IntegerSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PagesPerMinuteColor. + * {@code object} is an instance of class PagesPerMinuteColor. *
      3. - * This pages per minute attribute's value and object's + * This pages per minute attribute's value and {@code object}'s * value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this pages per + * @return True if {@code object} is equivalent to this pages per * minute color attribute, false otherwise. */ public boolean equals(Object object) { @@ -114,7 +114,7 @@ public final class PagesPerMinuteColor extends IntegerSyntax * instance. *

      * For class PagesPerMinuteColor, the - * category name is "pages-per-minute-color". + * category name is {@code "pages-per-minute-color"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PresentationDirection.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PresentationDirection.java index 4b3ff06d073..70d8acff70b 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PresentationDirection.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PresentationDirection.java @@ -42,8 +42,8 @@ import javax.print.attribute.PrintRequestAttribute; * attribute; it is an attribute in the Production Printing Extension * (PDF) * of IPP 1.1. The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Phil Race. @@ -174,7 +174,7 @@ public final class PresentationDirection extends EnumSyntax * instance. *

      * For class PresentationDirection - * the category name is "presentation-direction". + * the category name is {@code "presentation-direction"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrintQuality.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrintQuality.java index 6240965c68a..6ed83ff5842 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrintQuality.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrintQuality.java @@ -35,8 +35,8 @@ import javax.print.attribute.PrintJobAttribute; * that specifies the print quality that the printer uses for the job. *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author David Mendenhall @@ -123,7 +123,7 @@ public class PrintQuality extends EnumSyntax * instance. *

      * For class PrintQuality and any vendor-defined subclasses, the category - * name is "print-quality". + * name is {@code "print-quality"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterInfo.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterInfo.java index 57813ec20b7..13b8ca7c33c 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterInfo.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterInfo.java @@ -33,15 +33,15 @@ import javax.print.attribute.PrintServiceAttribute; /** * Class PrinterInfo is a printing attribute class, a text attribute, that * provides descriptive information about a printer. This could include things - * like: "This printer can be used for printing color transparencies for - * HR presentations", or "Out of courtesy for others, please - * print only small (1-5 page) jobs at this printer", or even \ - * "This printer is going away on July 1, 1997, please find a new - * printer". + * like: {@code "This printer can be used for printing color transparencies for + * HR presentations"}, or {@code "Out of courtesy for others, please + * print only small (1-5 page) jobs at this printer"}, or even + * {@code "This printer is going away on July 1, 1997, please find a new + * printer"}. *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -57,10 +57,10 @@ public final class PrinterInfo extends TextSyntax * @param info Printer information string. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if info is null. + * (unchecked exception) Thrown if {@code info} is null. */ public PrinterInfo(String info, Locale locale) { super (info, locale); @@ -72,20 +72,20 @@ public final class PrinterInfo extends TextSyntax * true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PrinterInfo. + * {@code object} is an instance of class PrinterInfo. *
      3. * This printer info attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. - * This printer info attribute's locale and object's + * This printer info attribute's locale and {@code object}'s * locale are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this printer + * @return True if {@code object} is equivalent to this printer * info attribute, false otherwise. */ public boolean equals(Object object) { @@ -109,7 +109,7 @@ public final class PrinterInfo extends TextSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class PrinterInfo, the category name is "printer-info". + * For class PrinterInfo, the category name is {@code "printer-info"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java index b04c4bab5ec..39b4961399a 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java @@ -40,8 +40,8 @@ import javax.print.attribute.PrintServiceAttribute; *

      * IPP Compatibility: The IPP boolean value is "true" for ACCEPTING_JOBS * and "false" for NOT_ACCEPTING_JOBS. The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -116,7 +116,7 @@ public final class PrinterIsAcceptingJobs extends EnumSyntax * instance. *

      * For class PrinterIsAcceptingJobs, the - * category name is "printer-is-accepting-jobs". + * category name is {@code "printer-is-accepting-jobs"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterLocation.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterLocation.java index 7675cb956d4..73056a85820 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterLocation.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterLocation.java @@ -33,11 +33,11 @@ import javax.print.attribute.PrintServiceAttribute; /** * Class PrinterLocation is a printing attribute class, a text attribute, that * identifies the location of the device. This could include things like: - * "in Room 123A, second floor of building XYZ". + * {@code "in Room 123A, second floor of building XYZ"}. *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -53,10 +53,10 @@ public final class PrinterLocation extends TextSyntax * @param location Printer location. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if location is null. + * (unchecked exception) Thrown if {@code location} is null. */ public PrinterLocation(String location, Locale locale) { super (location, locale); @@ -68,20 +68,20 @@ public final class PrinterLocation extends TextSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PrinterLocation. + * {@code object} is an instance of class PrinterLocation. *
      3. * This printer location attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. - * This printer location attribute's locale and object's + * This printer location attribute's locale and {@code object}'s * locale are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this printer + * @return True if {@code object} is equivalent to this printer * location attribute, false otherwise. */ public boolean equals(Object object) { @@ -107,7 +107,7 @@ public final class PrinterLocation extends TextSyntax * instance. *

      * For class PrinterLocation, the - * category name is "printer-location". + * category name is {@code "printer-location"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java index c0538fae845..55a61ea44a3 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java @@ -35,7 +35,7 @@ import javax.print.attribute.PrintServiceAttribute; *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -51,10 +51,10 @@ public final class PrinterMakeAndModel extends TextSyntax * @param makeAndModel Printer make and model string. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if makeAndModel is null. + * (unchecked exception) Thrown if {@code makeAndModel} is null. */ public PrinterMakeAndModel(String makeAndModel, Locale locale) { super (makeAndModel, locale); @@ -66,20 +66,20 @@ public final class PrinterMakeAndModel extends TextSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PrinterMakeAndModel. + * {@code object} is an instance of class PrinterMakeAndModel. *
      3. * This printer make and model attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. * This printer make and model attribute's locale and - * object's locale are equal. + * {@code object}'s locale are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this printer + * @return True if {@code object} is equivalent to this printer * make and model attribute, false otherwise. */ public boolean equals(Object object) { @@ -106,7 +106,7 @@ public final class PrinterMakeAndModel extends TextSyntax * instance. *

      * For class PrinterMakeAndModel, the - * category name is "printer-make-and-model". + * category name is {@code "printer-make-and-model"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java index d46412d2f9c..94388ca9469 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java @@ -50,7 +50,7 @@ import javax.print.attribute.PrintServiceAttribute; *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -66,10 +66,10 @@ public final class PrinterMessageFromOperator extends TextSyntax * @param message Message. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if message is null. + * (unchecked exception) Thrown if {@code message} is null. */ public PrinterMessageFromOperator(String message, Locale locale) { super (message, locale); @@ -81,21 +81,21 @@ public final class PrinterMessageFromOperator extends TextSyntax * following conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class + * {@code object} is an instance of class * PrinterMessageFromOperator. *
      3. * This printer message from operator attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. * This printer message from operator attribute's locale and - * object's locale are equal. + * {@code object}'s locale are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this printer + * @return True if {@code object} is equivalent to this printer * message from operator attribute, false otherwise. */ public boolean equals(Object object) { @@ -122,7 +122,7 @@ public final class PrinterMessageFromOperator extends TextSyntax * instance. *

      * For class PrinterMessageFromOperator, - * the category name is "printer-message-from-operator". + * the category name is {@code "printer-message-from-operator"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java index c982907badf..285a42574b0 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java @@ -46,8 +46,8 @@ import javax.print.attribute.PrintServiceAttribute; * about this general kind of printer rather than this specific printer. *

      * IPP Compatibility: The string form returned by - * toString() gives the IPP uri value. - * The category name returned by getName() + * {@code toString()} gives the IPP uri value. + * The category name returned by {@code getName()} * gives the IPP attribute name. * * @author Alan Kaminsky @@ -63,7 +63,7 @@ public final class PrinterMoreInfo extends URISyntax * @param uri URI. * * @exception NullPointerException - * (unchecked exception) Thrown if uri is null. + * (unchecked exception) Thrown if {@code uri} is null. */ public PrinterMoreInfo(URI uri) { super (uri); @@ -75,17 +75,17 @@ public final class PrinterMoreInfo extends URISyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PrinterMoreInfo. + * {@code object} is an instance of class PrinterMoreInfo. *
      3. - * This printer more info attribute's URI and object's URI + * This printer more info attribute's URI and {@code object}'s URI * are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this printer + * @return True if {@code object} is equivalent to this printer * more info attribute, false otherwise. */ public boolean equals(Object object) { @@ -111,7 +111,7 @@ public final class PrinterMoreInfo extends URISyntax * instance. *

      * For class PrinterMoreInfo, the - * category name is "printer-more-info". + * category name is {@code "printer-more-info"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java index 10b4e9acace..881b5cb8a14 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java @@ -46,8 +46,8 @@ import javax.print.attribute.PrintServiceAttribute; * general kind of printer. *

      * IPP Compatibility: The string form returned by - * toString() gives the IPP uri value. - * The category name returned by getName() + * {@code toString()} gives the IPP uri value. + * The category name returned by {@code getName()} * gives the IPP attribute name. * * @author Alan Kaminsky @@ -64,7 +64,7 @@ public final class PrinterMoreInfoManufacturer extends URISyntax * @param uri URI. * * @exception NullPointerException - * (unchecked exception) Thrown if uri is null. + * (unchecked exception) Thrown if {@code uri} is null. */ public PrinterMoreInfoManufacturer(URI uri) { super (uri); @@ -76,18 +76,18 @@ public final class PrinterMoreInfoManufacturer extends URISyntax * following conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class + * {@code object} is an instance of class * PrinterMoreInfoManufacturer. *
      3. * This printer more info manufacturer attribute's URI and - * object's URI are equal. + * {@code object}'s URI are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this printer + * @return True if {@code object} is equivalent to this printer * more info manufacturer attribute, false otherwise. */ public boolean equals(Object object) { @@ -114,7 +114,7 @@ public final class PrinterMoreInfoManufacturer extends URISyntax * instance. *

      * For class PrinterMoreInfoManufacturer, the category name is - * "printer-more-info-manufacturer". + * {@code "printer-more-info-manufacturer"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterName.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterName.java index a8b2487ad17..3bc293df02b 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterName.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterName.java @@ -40,7 +40,7 @@ import javax.print.attribute.PrintServiceAttribute; *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -55,10 +55,10 @@ public final class PrinterName extends TextSyntax * @param printerName Printer name. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if printerName is null. + * (unchecked exception) Thrown if {@code printerName} is null. */ public PrinterName(String printerName, Locale locale) { super (printerName, locale); @@ -70,20 +70,20 @@ public final class PrinterName extends TextSyntax * true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PrinterName. + * {@code object} is an instance of class PrinterName. *
      3. * This printer name attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. - * This printer name attribute's locale and object's locale + * This printer name attribute's locale and {@code object}'s locale * are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this printer + * @return True if {@code object} is equivalent to this printer * name attribute, false otherwise. */ public boolean equals(Object object) { @@ -109,7 +109,7 @@ public final class PrinterName extends TextSyntax * instance. *

      * For class PrinterName, the category - * name is "printer-name". + * name is {@code "printer-name"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterResolution.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterResolution.java index 67d908103a2..408d2007324 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterResolution.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterResolution.java @@ -61,9 +61,9 @@ import javax.print.attribute.PrintJobAttribute; * PrintQuality attribute which often controls resolution. *

      * IPP Compatibility: The information needed to construct an IPP - * "printer-resolution" attribute can be obtained by calling + * {@code "printer-resolution"} attribute can be obtained by calling * methods on the PrinterResolution object. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author David Mendenhall * @author Alan Kaminsky @@ -81,8 +81,8 @@ public final class PrinterResolution extends ResolutionSyntax * @param feedResolution * Feed direction resolution. * @param units - * Unit conversion factor, e.g. ResolutionSyntax.DPI - * or ResolutionSyntax.DPCM. + * Unit conversion factor, e.g. {@code ResolutionSyntax.DPI} + * or {@code ResolutionSyntax.DPCM}. * * @exception IllegalArgumentException * (unchecked exception) Thrown if {@code crossFeedResolution < 1} or @@ -99,20 +99,20 @@ public final class PrinterResolution extends ResolutionSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PrinterResolution. + * {@code object} is an instance of class PrinterResolution. *
      3. * This attribute's cross feed direction resolution is equal to - * object's cross feed direction resolution. + * {@code object}'s cross feed direction resolution. *
      4. * This attribute's feed direction resolution is equal to - * object's feed direction resolution. + * {@code object}'s feed direction resolution. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this printer + * @return True if {@code object} is equivalent to this printer * resolution attribute, false otherwise. */ public boolean equals(Object object) { @@ -138,7 +138,7 @@ public final class PrinterResolution extends ResolutionSyntax * instance. *

      * For class PrinterResolution, the - * category name is "printer-resolution". + * category name is {@code "printer-resolution"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterState.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterState.java index 961d82ec53d..4af01a6cda6 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterState.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterState.java @@ -39,8 +39,8 @@ import javax.print.attribute.PrintServiceAttribute; * in given printer state. *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -130,7 +130,7 @@ implements PrintServiceAttribute { * Get the name of the category of which this attribute value is an * instance. *

      - * For class PrinterState, the category name is "printer-state". + * For class PrinterState, the category name is {@code "printer-state"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReason.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReason.java index ece9a538397..cdcb8e56d88 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReason.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReason.java @@ -56,10 +56,10 @@ import javax.print.attribute.Attribute; *

      * IPP Compatibility: * The string values returned by each individual {@link PrinterStateReason} and - * associated {@link Severity} object's toString() - * methods, concatenated together with a hyphen ("-") in + * associated {@link Severity} object's {@code toString()} + * methods, concatenated together with a hyphen ({@code "-"}) in * between, gives the IPP keyword value for a {@link PrinterStateReasons}. - * The category name returned by getName() gives the IPP + * The category name returned by {@code getName()} gives the IPP * attribute name. * * @author Alan Kaminsky @@ -432,7 +432,7 @@ public class PrinterStateReason extends EnumSyntax implements Attribute { * instance. *

      * For class PrinterStateReason and any vendor-defined subclasses, the - * category name is "printer-state-reason". + * category name is {@code "printer-state-reason"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterURI.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterURI.java index 9471b73481b..b2224d10bfe 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterURI.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterURI.java @@ -38,8 +38,8 @@ import javax.print.attribute.PrintServiceAttribute; *

      * IPP Compatibility: This implements the * IPP printer-uri attribute. The string form returned by - * toString() gives the IPP printer-uri value. - * The category name returned by getName() + * {@code toString()} gives the IPP printer-uri value. + * The category name returned by {@code getName()} * gives the IPP attribute name. * * @author Robert Herriot @@ -56,7 +56,7 @@ public final class PrinterURI extends URISyntax * @param uri URI of the printer * * @exception NullPointerException - * (unchecked exception) Thrown if uri is null. + * (unchecked exception) Thrown if {@code uri} is null. */ public PrinterURI(URI uri) { super (uri); @@ -68,17 +68,17 @@ public final class PrinterURI extends URISyntax * true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PrinterURI. + * {@code object} is an instance of class PrinterURI. *
      3. * This PrinterURI attribute's underlying URI and - * object's underlying URI are equal. + * {@code object}'s underlying URI are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this PrinterURI + * @return True if {@code object} is equivalent to this PrinterURI * attribute, false otherwise. */ public boolean equals(Object object) { @@ -104,7 +104,7 @@ public final class PrinterURI extends URISyntax * instance. *

      * For class PrinterURI and any vendor-defined subclasses, the category - * name is "printer-uri". + * name is {@code "printer-uri"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/QueuedJobCount.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/QueuedJobCount.java index f335288bd9c..41a710cb624 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/QueuedJobCount.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/QueuedJobCount.java @@ -34,7 +34,7 @@ import javax.print.attribute.PrintServiceAttribute; * PENDING, PENDING_HELD, PROCESSING, or PROCESSING_STOPPED. *

      * IPP Compatibility: The integer value gives the IPP integer value. - * The category name returned by getName() gives the IPP + * The category name returned by {@code getName()} gives the IPP * attribute name. * * @author Alan Kaminsky @@ -51,7 +51,7 @@ public final class QueuedJobCount extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public QueuedJobCount(int value) { super (value, 0, Integer.MAX_VALUE); @@ -63,17 +63,17 @@ public final class QueuedJobCount extends IntegerSyntax * mus be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class QueuedJobCount. + * {@code object} is an instance of class QueuedJobCount. *
      3. - * This queued job count attribute's value and object's + * This queued job count attribute's value and {@code object}'s * value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this queued job + * @return True if {@code object} is equivalent to this queued job * count attribute, false otherwise. */ public boolean equals(Object object) { @@ -99,7 +99,7 @@ public final class QueuedJobCount extends IntegerSyntax * instance. *

      * For class QueuedJobCount, the - * category name is "queued-job-count". + * category name is {@code "queued-job-count"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java index 8597c3143eb..ac8dcd326b0 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java @@ -32,13 +32,13 @@ import javax.print.attribute.Attribute; * an enumeration, that indicates a "URI scheme," such as "http:" or "ftp:", * that a printer can use to retrieve print data stored at a URI location. * If a printer supports doc flavors with a print data representation class of - * "java.net.URL", the printer uses instances of class + * {@code "java.net.URL"}, the printer uses instances of class * ReferenceUriSchemesSupported to advertise the URI schemes it can accept. * The acceptable URI schemes are included as service attributes in the * lookup service; this lets clients search the * for printers that can get print data using a certain URI scheme. The * acceptable URI schemes can also be queried using the capability methods in - * interface PrintService. However, + * interface {@code PrintService}. However, * ReferenceUriSchemesSupported attributes are used solely for determining * acceptable URI schemes, they are never included in a doc's, * print request's, print job's, or print service's attribute set. @@ -52,8 +52,8 @@ import javax.print.attribute.Attribute; * can define them in a subclass of class ReferenceUriSchemesSupported. *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -171,7 +171,7 @@ public class ReferenceUriSchemesSupported *

      * For class ReferenceUriSchemesSupported and any vendor-defined * subclasses, the category name is - * "reference-uri-schemes-supported". + * {@code "reference-uri-schemes-supported"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/RequestingUserName.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/RequestingUserName.java index 62bd3e03763..c0284c8a041 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/RequestingUserName.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/RequestingUserName.java @@ -47,7 +47,7 @@ import javax.print.attribute.PrintRequestAttribute; *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -63,10 +63,10 @@ public final class RequestingUserName extends TextSyntax * @param userName User name. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if userName is null. + * (unchecked exception) Thrown if {@code userName} is null. */ public RequestingUserName(String userName, Locale locale) { super (userName, locale); @@ -78,20 +78,20 @@ public final class RequestingUserName extends TextSyntax * conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class RequestingUserName. + * {@code object} is an instance of class RequestingUserName. *
      3. * This requesting user name attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. * This requesting user name attribute's locale and - * object's locale are equal. + * {@code object}'s locale are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this requesting + * @return True if {@code object} is equivalent to this requesting * user name attribute, false otherwise. */ public boolean equals(Object object) { @@ -118,7 +118,7 @@ public final class RequestingUserName extends TextSyntax * instance. *

      * For class RequestingUserName, the - * category name is "requesting-user-name". + * category name is {@code "requesting-user-name"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Severity.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Severity.java index 36df6b6f5d0..d9db96cf299 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Severity.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Severity.java @@ -50,13 +50,13 @@ import javax.print.attribute.Attribute; * {@link PrinterState PrinterState} also changed. *

      * IPP Compatibility: - * Severity.toString() returns either "error", "warning", or + * {@code Severity.toString()} returns either "error", "warning", or * "report". The string values returned by * each individual {@link PrinterStateReason} and - * associated {@link Severity} object's toString() - * methods, concatenated together with a hyphen ("-") in + * associated {@link Severity} object's {@code toString()} + * methods, concatenated together with a hyphen ({@code "-"}) in * between, gives the IPP keyword value for a {@link PrinterStateReasons}. - * The category name returned by getName() gives the IPP + * The category name returned by {@code getName()} gives the IPP * attribute name. * * @author Alan Kaminsky @@ -146,7 +146,7 @@ public final class Severity extends EnumSyntax implements Attribute { * Get the name of the category of which this attribute value is an * instance. *

      - * For class Severit, the category name is "severity". + * For class Severit, the category name is {@code "severity"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/SheetCollate.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/SheetCollate.java index 1d264a5964e..b497791f2a1 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/SheetCollate.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/SheetCollate.java @@ -222,7 +222,7 @@ public final class SheetCollate extends EnumSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class SheetCollate, the category name is "sheet-collate". + * For class SheetCollate, the category name is {@code "sheet-collate"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Sides.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Sides.java index 664f07d03dc..a9c13c11282 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Sides.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Sides.java @@ -110,8 +110,8 @@ import javax.print.attribute.PrintJobAttribute; * *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -210,7 +210,7 @@ public final class Sides extends EnumSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class Sides, the category name is "sides". + * For class Sides, the category name is {@code "sides"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/event/PrintEvent.java b/jdk/src/java.desktop/share/classes/javax/print/event/PrintEvent.java index 1f489026149..0732fb37231 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintEvent.java +++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintEvent.java @@ -37,8 +37,8 @@ public class PrintEvent extends java.util.EventObject { /** * Constructs a PrintEvent object. * @param source is the source of the event - * @throws IllegalArgumentException if source is - * null. + * @throws IllegalArgumentException if {@code source} is + * {@code null}. */ public PrintEvent (Object source) { super(source); diff --git a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeEvent.java b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeEvent.java index d23e4c6a226..efec2a761ca 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeEvent.java +++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeEvent.java @@ -45,8 +45,8 @@ public class PrintJobAttributeEvent extends PrintEvent { * Constructs a PrintJobAttributeEvent object. * @param source the print job generating this event * @param attributes the attribute changes being reported - * @throws IllegalArgumentException if source is - * null. + * @throws IllegalArgumentException if {@code source} is + * {@code null}. */ public PrintJobAttributeEvent (DocPrintJob source, PrintJobAttributeSet attributes) { diff --git a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeListener.java b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeListener.java index 64e6b6fa894..0f21e659a9b 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeListener.java +++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeListener.java @@ -38,7 +38,7 @@ public interface PrintJobAttributeListener { * One example of an occurrence triggering this event is if the * {@link javax.print.attribute.standard.JobState JobState} * attribute changed from - * PROCESSING to PROCESSING_STOPPED. + * {@code PROCESSING} to {@code PROCESSING_STOPPED}. * @param pjae the event. */ public void attributeUpdate(PrintJobAttributeEvent pjae) ; diff --git a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobEvent.java b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobEvent.java index dca9b66640e..77424a07a91 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobEvent.java +++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobEvent.java @@ -29,7 +29,7 @@ import javax.print.DocPrintJob; /** * - * Class PrintJobEvent encapsulates common events a print job + * Class {@code PrintJobEvent} encapsulates common events a print job * reports to let a listener know of progress in the processing of the * {@link DocPrintJob}. * @@ -86,12 +86,12 @@ public class PrintJobEvent extends PrintEvent { public static final int DATA_TRANSFER_COMPLETE = 106; /** - * Constructs a PrintJobEvent object. + * Constructs a {@code PrintJobEvent} object. * - * @param source a DocPrintJob object + * @param source a {@code DocPrintJob} object * @param reason an int specifying the reason. - * @throws IllegalArgumentException if source is - * null. + * @throws IllegalArgumentException if {@code source} is + * {@code null}. */ public PrintJobEvent( DocPrintJob source, int reason) { @@ -109,12 +109,12 @@ public class PrintJobEvent extends PrintEvent { } /** - * Determines the DocPrintJob to which this print job + * Determines the {@code DocPrintJob} to which this print job * event pertains. * - * @return the DocPrintJob object that represents the + * @return the {@code DocPrintJob} object that represents the * print job that reports the events encapsulated by this - * PrintJobEvent. + * {@code PrintJobEvent}. * */ public DocPrintJob getPrintJob() { diff --git a/jdk/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeEvent.java b/jdk/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeEvent.java index 9f1b6721854..06998afd354 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeEvent.java +++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeEvent.java @@ -47,8 +47,8 @@ public class PrintServiceAttributeEvent extends PrintEvent { * * @param source the print job generating this event * @param attributes the attribute changes being reported - * @throws IllegalArgumentException if source is - * null. + * @throws IllegalArgumentException if {@code source} is + * {@code null}. */ public PrintServiceAttributeEvent(PrintService source, PrintServiceAttributeSet attributes) { diff --git a/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioInputStream.java b/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioInputStream.java index e9e770c0e0d..716b9902331 100644 --- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioInputStream.java +++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, 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 @@ -321,31 +321,48 @@ public class AudioInputStream extends InputStream { */ @Override public long skip(long n) throws IOException { + if (n <= 0) { + return 0; + } // make sure not to skip fractional frames - if( (n%frameSize) != 0 ) { - n -= (n%frameSize); + final long reminder = n % frameSize; + if (reminder != 0) { + n -= reminder; } - if( frameLength != AudioSystem.NOT_SPECIFIED ) { + if (frameLength != AudioSystem.NOT_SPECIFIED) { // don't skip more than our set length in frames. - if( (n/frameSize) > (frameLength-framePos) ) { - n = (frameLength-framePos) * frameSize; + if ((n / frameSize) > (frameLength - framePos)) { + n = (frameLength - framePos) * frameSize; } } - long temp = stream.skip(n); + long remaining = n; + while (remaining > 0) { + // Some input streams like FileInputStream can return more bytes, + // when EOF is reached. + long ret = Math.min(stream.skip(remaining), remaining); + if (ret == 0) { + // EOF or not? we need to check. + if (stream.read() == -1) { + break; + } + ret = 1; + } else if (ret < 0) { + // the skip should not return negative value, but check it also + break; + } + remaining -= ret; + } + final long temp = n - remaining; // if no error, update our position. - if( temp%frameSize != 0 ) { - + if (temp % frameSize != 0) { // Throw an IOException if we've skipped a fractional number of frames throw new IOException("Could not skip an integer number of frames."); } - if( temp >= 0 ) { - framePos += temp/frameSize; - } + framePos += temp/frameSize; return temp; - } /** diff --git a/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioSystem.java b/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioSystem.java index 2a6d98dd158..e567b392102 100644 --- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioSystem.java +++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioSystem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, 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 @@ -25,12 +25,14 @@ package javax.sound.sampled; +import java.io.EOFException; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URL; import java.util.ArrayList; +import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Objects; @@ -688,8 +690,11 @@ public class AudioSystem { } } } - AudioFormat.Encoding encs2[] = encodings.toArray(new AudioFormat.Encoding[0]); - return encs2; + if (!encodings.contains(sourceEncoding)) { + encodings.addElement(sourceEncoding); + } + + return encodings.toArray(new AudioFormat.Encoding[encodings.size()]); } // $$fb 2002-04-12: fix for 4662082: behavior of AudioSystem.getTargetEncodings() methods doesn't match the spec @@ -710,30 +715,18 @@ public class AudioSystem { Objects.requireNonNull(sourceFormat); List codecs = getFormatConversionProviders(); - Vector encodings = new Vector<>(); - - int size = 0; - int index = 0; - AudioFormat.Encoding encs[] = null; + List encs = new ArrayList<>(); // gather from all the codecs - - for(int i=0; i codecs = getFormatConversionProviders(); @@ -781,6 +777,9 @@ public class AudioSystem { AudioInputStream sourceStream) { Objects.requireNonNull(targetEncoding); Objects.requireNonNull(sourceStream); + if (sourceStream.getFormat().getEncoding().equals(targetEncoding)) { + return sourceStream; + } List codecs = getFormatConversionProviders(); @@ -811,31 +810,27 @@ public class AudioSystem { Objects.requireNonNull(sourceFormat); List codecs = getFormatConversionProviders(); - Vector formats = new Vector<>(); - - int size = 0; - int index = 0; - AudioFormat fmts[] = null; + List formats = new ArrayList<>(); + boolean matchFound = false; // gather from all the codecs - - for(int i=0; i codecs = getFormatConversionProviders(); @@ -919,28 +917,17 @@ public class AudioSystem { * @see InputStream#markSupported * @see InputStream#mark */ - public static AudioFileFormat getAudioFileFormat(InputStream stream) + public static AudioFileFormat getAudioFileFormat(final InputStream stream) throws UnsupportedAudioFileException, IOException { Objects.requireNonNull(stream); - List providers = getAudioFileReaders(); - AudioFileFormat format = null; - - for(int i = 0; i < providers.size(); i++ ) { - AudioFileReader reader = providers.get(i); + for (final AudioFileReader reader : getAudioFileReaders()) { try { - format = reader.getAudioFileFormat( stream ); // throws IOException - break; - } catch (UnsupportedAudioFileException e) { - continue; + return reader.getAudioFileFormat(stream); + } catch (final UnsupportedAudioFileException ignored) { } } - - if( format==null ) { - throw new UnsupportedAudioFileException("file is not a supported file type"); - } else { - return format; - } + throw new UnsupportedAudioFileException("Stream of unsupported format"); } /** @@ -956,28 +943,17 @@ public class AudioSystem { * @throws IOException if an input/output exception occurs * @throws NullPointerException if {@code url} is {@code null} */ - public static AudioFileFormat getAudioFileFormat(URL url) + public static AudioFileFormat getAudioFileFormat(final URL url) throws UnsupportedAudioFileException, IOException { Objects.requireNonNull(url); - List providers = getAudioFileReaders(); - AudioFileFormat format = null; - - for(int i = 0; i < providers.size(); i++ ) { - AudioFileReader reader = providers.get(i); + for (final AudioFileReader reader : getAudioFileReaders()) { try { - format = reader.getAudioFileFormat( url ); // throws IOException - break; - } catch (UnsupportedAudioFileException e) { - continue; + return reader.getAudioFileFormat(url); + } catch (final UnsupportedAudioFileException ignored) { } } - - if( format==null ) { - throw new UnsupportedAudioFileException("file is not a supported file type"); - } else { - return format; - } + throw new UnsupportedAudioFileException("URL of unsupported format"); } /** @@ -993,28 +969,17 @@ public class AudioSystem { * @throws IOException if an I/O exception occurs * @throws NullPointerException if {@code file} is {@code null} */ - public static AudioFileFormat getAudioFileFormat(File file) + public static AudioFileFormat getAudioFileFormat(final File file) throws UnsupportedAudioFileException, IOException { Objects.requireNonNull(file); - List providers = getAudioFileReaders(); - AudioFileFormat format = null; - - for(int i = 0; i < providers.size(); i++ ) { - AudioFileReader reader = providers.get(i); + for (final AudioFileReader reader : getAudioFileReaders()) { try { - format = reader.getAudioFileFormat( file ); // throws IOException - break; - } catch (UnsupportedAudioFileException e) { - continue; + return reader.getAudioFileFormat(file); + } catch (final UnsupportedAudioFileException ignored) { } } - - if( format==null ) { - throw new UnsupportedAudioFileException("file is not a supported file type"); - } else { - return format; - } + throw new UnsupportedAudioFileException("File of unsupported format"); } /** @@ -1038,28 +1003,17 @@ public class AudioSystem { * @see InputStream#markSupported * @see InputStream#mark */ - public static AudioInputStream getAudioInputStream(InputStream stream) + public static AudioInputStream getAudioInputStream(final InputStream stream) throws UnsupportedAudioFileException, IOException { Objects.requireNonNull(stream); - List providers = getAudioFileReaders(); - AudioInputStream audioStream = null; - - for(int i = 0; i < providers.size(); i++ ) { - AudioFileReader reader = providers.get(i); + for (final AudioFileReader reader : getAudioFileReaders()) { try { - audioStream = reader.getAudioInputStream( stream ); // throws IOException - break; - } catch (UnsupportedAudioFileException e) { - continue; + return reader.getAudioInputStream(stream); + } catch (final UnsupportedAudioFileException ignored) { } } - - if( audioStream==null ) { - throw new UnsupportedAudioFileException("could not get audio input stream from input stream"); - } else { - return audioStream; - } + throw new UnsupportedAudioFileException("Stream of unsupported format"); } /** @@ -1075,28 +1029,17 @@ public class AudioSystem { * @throws IOException if an I/O exception occurs * @throws NullPointerException if {@code url} is {@code null} */ - public static AudioInputStream getAudioInputStream(URL url) + public static AudioInputStream getAudioInputStream(final URL url) throws UnsupportedAudioFileException, IOException { Objects.requireNonNull(url); - List providers = getAudioFileReaders(); - AudioInputStream audioStream = null; - - for(int i = 0; i < providers.size(); i++ ) { - AudioFileReader reader = providers.get(i); + for (final AudioFileReader reader : getAudioFileReaders()) { try { - audioStream = reader.getAudioInputStream( url ); // throws IOException - break; - } catch (UnsupportedAudioFileException e) { - continue; + return reader.getAudioInputStream(url); + } catch (final UnsupportedAudioFileException ignored) { } } - - if( audioStream==null ) { - throw new UnsupportedAudioFileException("could not get audio input stream from input URL"); - } else { - return audioStream; - } + throw new UnsupportedAudioFileException("URL of unsupported format"); } /** @@ -1112,28 +1055,17 @@ public class AudioSystem { * @throws IOException if an I/O exception occurs * @throws NullPointerException if {@code file} is {@code null} */ - public static AudioInputStream getAudioInputStream(File file) + public static AudioInputStream getAudioInputStream(final File file) throws UnsupportedAudioFileException, IOException { Objects.requireNonNull(file); - List providers = getAudioFileReaders(); - AudioInputStream audioStream = null; - - for(int i = 0; i < providers.size(); i++ ) { - AudioFileReader reader = providers.get(i); + for (final AudioFileReader reader : getAudioFileReaders()) { try { - audioStream = reader.getAudioInputStream( file ); // throws IOException - break; - } catch (UnsupportedAudioFileException e) { - continue; + return reader.getAudioInputStream(file); + } catch (final UnsupportedAudioFileException ignored) { } } - - if( audioStream==null ) { - throw new UnsupportedAudioFileException("could not get audio input stream from input file"); - } else { - return audioStream; - } + throw new UnsupportedAudioFileException("File of unsupported format"); } /** @@ -1255,32 +1187,24 @@ public class AudioSystem { * @see #isFileTypeSupported * @see #getAudioFileTypes */ - public static int write(AudioInputStream stream, AudioFileFormat.Type fileType, - OutputStream out) throws IOException { + public static int write(final AudioInputStream stream, + final AudioFileFormat.Type fileType, + final OutputStream out) throws IOException { Objects.requireNonNull(stream); Objects.requireNonNull(fileType); Objects.requireNonNull(out); - List providers = getAudioFileWriters(); - int bytesWritten = 0; - boolean flag = false; - - for(int i=0; i < providers.size(); i++) { - AudioFileWriter writer = providers.get(i); + for (final AudioFileWriter writer : getAudioFileWriters()) { try { - bytesWritten = writer.write( stream, fileType, out ); // throws IOException - flag = true; - break; - } catch (IllegalArgumentException e) { - // thrown if this provider cannot write the sequence, try the next - continue; + return writer.write(stream, fileType, out); + } catch (final IllegalArgumentException ignored) { + // thrown if this provider cannot write the stream, try next } } - if(!flag) { - throw new IllegalArgumentException("could not write audio file: file type not supported: " + fileType); - } else { - return bytesWritten; - } + // "File type " + type + " not supported." + throw new IllegalArgumentException( + "could not write audio file: file type not supported: " + + fileType); } /** @@ -1300,32 +1224,23 @@ public class AudioSystem { * @see #isFileTypeSupported * @see #getAudioFileTypes */ - public static int write(AudioInputStream stream, AudioFileFormat.Type fileType, - File out) throws IOException { + public static int write(final AudioInputStream stream, + final AudioFileFormat.Type fileType, + final File out) throws IOException { Objects.requireNonNull(stream); Objects.requireNonNull(fileType); Objects.requireNonNull(out); - List providers = getAudioFileWriters(); - int bytesWritten = 0; - boolean flag = false; - - for(int i=0; i < providers.size(); i++) { - AudioFileWriter writer = providers.get(i); + for (final AudioFileWriter writer : getAudioFileWriters()) { try { - bytesWritten = writer.write( stream, fileType, out ); // throws IOException - flag = true; - break; - } catch (IllegalArgumentException e) { - // thrown if this provider cannot write the sequence, try the next - continue; + return writer.write(stream, fileType, out); + } catch (final IllegalArgumentException ignored) { + // thrown if this provider cannot write the stream, try next } } - if (!flag) { - throw new IllegalArgumentException("could not write audio file: file type not supported: " + fileType); - } else { - return bytesWritten; - } + throw new IllegalArgumentException( + "could not write audio file: file type not supported: " + + fileType); } // METHODS FOR INTERNAL IMPLEMENTATION USE diff --git a/jdk/src/java.desktop/share/classes/javax/swing/Action.java b/jdk/src/java.desktop/share/classes/javax/swing/Action.java index b1ebbec40a8..8a7ae6ea1db 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/Action.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/Action.java @@ -356,24 +356,41 @@ public interface Action extends ActionListener { public void putValue(String key, Object value); /** - * Sets the enabled state of the Action. When enabled, + * Sets the enabled state of the {@code Action}. When enabled, * any component associated with this object is active and - * able to fire this object's actionPerformed method. - * If the value has changed, a PropertyChangeEvent is sent + * able to fire this object's {@code actionPerformed} method. + * If the value has changed, a {@code PropertyChangeEvent} is sent * to listeners. * - * @param b true to enable this Action, false to disable it + * @param b true to enable this {@code Action}, false to disable it + * @see #accept */ public void setEnabled(boolean b); /** - * Returns the enabled state of the Action. When enabled, + * Returns the enabled state of the {@code Action}. When enabled, * any component associated with this object is active and - * able to fire this object's actionPerformed method. + * able to fire this object's {@code actionPerformed} method. * - * @return true if this Action is enabled + * @return true if this {@code Action} is enabled + * @see #accept */ public boolean isEnabled(); + /** + * Determines whether the action should be performed with the specified + * sender object. The {@code sender} can be {@code null}. + * The method must return false if the action is disabled. + *

      + * @param sender the object to check, can be null + * @return {@code true} if the action should be performed with the sender + * object, must be false if the action is disabled. + * @see isEnabled + * @see setEnabled + */ + default boolean accept(Object sender) { + return isEnabled(); + } + /** * Adds a PropertyChange listener. Containers and attached * components use these methods to register interest in this diff --git a/jdk/src/java.desktop/share/classes/javax/swing/DefaultDesktopManager.java b/jdk/src/java.desktop/share/classes/javax/swing/DefaultDesktopManager.java index e28f446a5f2..18f30579f4e 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/DefaultDesktopManager.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/DefaultDesktopManager.java @@ -197,17 +197,17 @@ public class DefaultDesktopManager implements DesktopManager, java.io.Serializab if (!f.isMaximum()) { f.setNormalBounds(f.getBounds()); } - d.setComponentOrderCheckingEnabled(false); - c.remove(f); - c.add(desktopIcon); - d.setComponentOrderCheckingEnabled(true); - c.repaint(f.getX(), f.getY(), f.getWidth(), f.getHeight()); if (findNext) { if (d.selectFrame(true) == null) { // The icon is the last frame. f.restoreSubcomponentFocus(); } } + d.setComponentOrderCheckingEnabled(false); + c.remove(f); + c.add(desktopIcon); + d.setComponentOrderCheckingEnabled(true); + c.repaint(f.getX(), f.getY(), f.getWidth(), f.getHeight()); } /** diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JDesktopPane.java b/jdk/src/java.desktop/share/classes/javax/swing/JDesktopPane.java index 99a2fe8ab6a..e5d53e1cda3 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JDesktopPane.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JDesktopPane.java @@ -480,6 +480,7 @@ public class JDesktopPane extends JLayeredPane implements Accessible * @since 1.6 */ protected void addImpl(Component comp, Object constraints, int index) { + checkComponentAttributes(comp); super.addImpl(comp, constraints, index); if (componentOrderCheckingEnabled) { if (comp instanceof JInternalFrame || @@ -489,6 +490,12 @@ public class JDesktopPane extends JLayeredPane implements Accessible } } + private void checkComponentAttributes(Component comp) { + if (comp instanceof JInternalFrame && ((JInternalFrame) comp).isIcon()) { + ((JInternalFrame) comp).putClientProperty("wasIconOnce", Boolean.FALSE); + } + } + /** * {@inheritDoc} * @since 1.6 diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JTabbedPane.java b/jdk/src/java.desktop/share/classes/javax/swing/JTabbedPane.java index de917a34e00..184ca2c2d0b 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JTabbedPane.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JTabbedPane.java @@ -2156,15 +2156,14 @@ public class JTabbedPane extends JComponent AccessibleStateSet states; states = parent.getAccessibleContext().getAccessibleStateSet(); states.add(AccessibleState.SELECTABLE); - int i = parent.indexOfTabComponent(tabComponent); - if (i == parent.getSelectedIndex()) { + if (getPageIndex() == parent.getSelectedIndex()) { states.add(AccessibleState.SELECTED); } return states; } public int getAccessibleIndexInParent() { - return parent.indexOfTabComponent(tabComponent); + return getPageIndex(); } public int getAccessibleChildrenCount() { @@ -2272,8 +2271,7 @@ public class JTabbedPane extends JComponent } public Rectangle getBounds() { - return parent.getUI(). - getTabBounds(parent, parent.indexOfTabComponent(tabComponent)); + return parent.getUI().getTabBounds(parent, getPageIndex()); } public void setBounds(Rectangle r) { @@ -2343,7 +2341,33 @@ public class JTabbedPane extends JComponent } private String getTitle() { - return getTitleAt(parent.indexOfComponent(component)); + return getTitleAt(getPageIndex()); + } + + /* + * getPageIndex() has three valid scenarios: + * - null component and null tabComponent: use indexOfcomponent + * - non-null component: use indexOfComponent + * - null component and non-null tabComponent: use indexOfTabComponent + * + * Note: It's valid to have have a titled tab with a null component, e.g. + * myPane.add("my title", null); + * but it's only useful to have one of those because indexOfComponent(null) + * will find the first one. + * + * Note: indexofTab(title) is not useful because there are cases, due to + * subclassing, where Page.title is not set and title is managed in a subclass + * and fetched with an overridden JTabbedPane.getTitleAt(index). + */ + private int getPageIndex() { + int index; + if (component != null || (component == null && tabComponent == null)) { + index = parent.indexOfComponent(component); + } else { + // component is null, tabComponent is non-null + index = parent.indexOfTabComponent(tabComponent); + } + return index; } } diff --git a/jdk/src/java.desktop/share/classes/javax/swing/SwingUtilities.java b/jdk/src/java.desktop/share/classes/javax/swing/SwingUtilities.java index 5c34dffb012..6a48eb423a3 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/SwingUtilities.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/SwingUtilities.java @@ -1704,9 +1704,9 @@ public class SwingUtilities implements SwingConstants } /** - * Invokes actionPerformed on action if - * action is enabled (and non-{@code null}). The command for the - * ActionEvent is determined by: + * Invokes {@code actionPerformed} on {@code action} if {@code action} + * is non-{@code null} and accepts the sender object. + * The command for the ActionEvent is determined by: *

        *
      1. If the action was registered via * registerKeyboardAction, then the command string @@ -1725,23 +1725,18 @@ public class SwingUtilities implements SwingConstants * @param modifiers action modifiers * @return {@code true} if {@code action} is non-{@code null} and * actionPerformed is invoked on it. + * @see javax.swing.Action#accept * * @since 1.3 */ public static boolean notifyAction(Action action, KeyStroke ks, KeyEvent event, Object sender, int modifiers) { - if (action == null) { - return false; - } - if (action instanceof UIAction) { - if (!((UIAction)action).isEnabled(sender)) { - return false; - } - } - else if (!action.isEnabled()) { + + if (action == null || !action.accept(sender)) { return false; } + Object commandO; boolean stayNull; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/TransferHandler.java b/jdk/src/java.desktop/share/classes/javax/swing/TransferHandler.java index 5201a0c26a5..70fe30a37be 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/TransferHandler.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/TransferHandler.java @@ -1695,13 +1695,10 @@ public class TransferHandler implements Serializable { super(name); } - public boolean isEnabled(Object sender) { - if (sender instanceof JComponent - && ((JComponent)sender).getTransferHandler() == null) { - return false; - } - - return true; + @Override + public boolean accept(Object sender) { + return !(sender instanceof JComponent + && ((JComponent)sender).getTransferHandler() == null); } private static final JavaSecurityAccess javaSecurityAccess = diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonListener.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonListener.java index 3278d33e4a9..1fda40ee5df 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonListener.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonListener.java @@ -319,13 +319,10 @@ public class BasicButtonListener implements MouseListener, MouseMotionListener, } } - public boolean isEnabled(Object sender) { - if(sender != null && (sender instanceof AbstractButton) && - !((AbstractButton)sender).getModel().isEnabled()) { - return false; - } else { - return true; - } + @Override + public boolean accept(Object sender) { + return !((sender instanceof AbstractButton) && + !((AbstractButton)sender).getModel().isEnabled()); } } -} +} \ No newline at end of file diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java index 5a3f67da230..e08c8a3045f 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java @@ -1719,7 +1719,8 @@ public class BasicComboBoxUI extends ComboBoxUI { return comboBox.getSelectedIndex(); } - public boolean isEnabled(Object c) { + @Override + public boolean accept(Object c) { if (getName() == HIDE) { return (c != null && ((JComboBox)c).isPopupVisible()); } diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java index c8a4d9d0a7a..e784d2d4b2a 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java @@ -646,7 +646,8 @@ public class BasicDesktopPaneUI extends DesktopPaneUI { } } - public boolean isEnabled(Object sender) { + @Override + public boolean accept(Object sender) { if (sender instanceof JDesktopPane) { JDesktopPane dp = (JDesktopPane)sender; String action = getName(); diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java index 8f534ef786a..bcae2e3f8e8 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java @@ -200,7 +200,8 @@ public class BasicInternalFrameUI extends InternalFrameUI } } - public boolean isEnabled(Object sender){ + @Override + public boolean accept(Object sender){ if (sender instanceof JInternalFrame) { JInternalFrame iFrame = (JInternalFrame)sender; if (iFrame.getUI() instanceof BasicInternalFrameUI) { @@ -1709,6 +1710,12 @@ public class BasicInternalFrameUI extends InternalFrameUI } else { parentBounds = null; } + if ((frame.getParent() != null) && frame.isIcon()) { + Boolean value = (Boolean) frame.getClientProperty("wasIconOnce"); + if (Boolean.FALSE.equals(value)) { + iconifyFrame(frame); + } + } if ((frame.getParent() != null) && !componentListenerAdded) { f.getParent().addComponentListener(componentListener); componentListenerAdded = true; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java index ae8827a4f82..39585e86db8 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java @@ -2060,7 +2060,8 @@ public class BasicListUI extends ListUI } } - public boolean isEnabled(Object c) { + @Override + public boolean accept(Object c) { Object name = getName(); if (name == SELECT_PREVIOUS_COLUMN_CHANGE_LEAD || name == SELECT_NEXT_COLUMN_CHANGE_LEAD || diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java index 7231ae2a570..98afcc95679 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java @@ -312,7 +312,8 @@ public class BasicMenuUI extends BasicMenuItemUI } } - public boolean isEnabled(Object c) { + @Override + public boolean accept(Object c) { if (c instanceof JMenu) { return ((JMenu)c).isEnabled(); } diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicRootPaneUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicRootPaneUI.java index 300e46a2e7b..714a06396c6 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicRootPaneUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicRootPaneUI.java @@ -256,7 +256,8 @@ public class BasicRootPaneUI extends RootPaneUI implements } } - public boolean isEnabled(Object sender) { + @Override + public boolean accept(Object sender) { String key = getName(); if(key == POST_POPUP) { MenuElement[] elems = MenuSelectionManager @@ -278,7 +279,7 @@ public class BasicRootPaneUI extends RootPaneUI implements return false; } - if (sender != null && sender instanceof JRootPane) { + if (sender instanceof JRootPane) { JButton owner = ((JRootPane)sender).getDefaultButton(); return (owner != null && owner.getModel().isEnabled()); } diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java index 2ec7e11ef71..a02d25f293b 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java @@ -855,7 +855,8 @@ public class BasicTableHeaderUI extends TableHeaderUI { super(name); } - public boolean isEnabled(Object sender) { + @Override + public boolean accept(Object sender) { if (sender instanceof JTableHeader) { JTableHeader th = (JTableHeader)sender; TableColumnModel cm = th.getColumnModel(); diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java index 73fd9a51340..e6a3d0eb9b5 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java @@ -676,7 +676,8 @@ public class BasicTableUI extends TableUI } } - public boolean isEnabled(Object sender) { + @Override + public boolean accept(Object sender) { String key = getName(); if (sender instanceof JTable && diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java index 7216dfe4a4b..b43423dbc02 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java @@ -4416,7 +4416,8 @@ public class BasicTreeUI extends TreeUI super(key); } - public boolean isEnabled(Object o) { + @Override + public boolean accept(Object o) { if (o instanceof JTree) { if (getName() == CANCEL_EDITING) { return ((JTree)o).isEditing(); diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java index 6259171317b..b22941c8f6f 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java @@ -351,12 +351,16 @@ public class SynthDesktopPaneUI extends BasicDesktopPaneUI implements Container c = f.getParent(); JDesktopPane d = f.getDesktopPane(); boolean findNext = f.isSelected(); - - if (c == null) { + if (c == null || d == null) { return; } - desktopIcon = f.getDesktopIcon(); + if (!wasIcon(f)) { + Rectangle r = getBoundsForIconOf(f); + desktopIcon.setBounds(r.x, r.y, r.width, r.height); + desktopIcon.revalidate(); + setWasIcon(f, Boolean.TRUE); + } if (!f.isMaximum()) { f.setNormalBounds(f.getBounds()); diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java index bf2b9298973..a36117cda20 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java @@ -471,7 +471,7 @@ public class SynthToolBarUI extends BasicToolBarUI // be distributed among the "glue", if any int extraSpacePerGlue = 0; if (glueCount > 0) { - int minWidth = minimumLayoutSize(parent).width; + int minWidth = preferredLayoutSize(parent).width; extraSpacePerGlue = (tb.getWidth() - minWidth) / glueCount; if (extraSpacePerGlue < 0) extraSpacePerGlue = 0; } diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractWriter.java b/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractWriter.java index 0ca0fecb5a8..1625964b562 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractWriter.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractWriter.java @@ -441,7 +441,7 @@ public abstract class AbstractWriter { --offsetIndent; } else { - indentLevel--; + indentLevel = indentLevel > 0 ? indentLevel-- : 0; } } diff --git a/jdk/src/java.desktop/share/classes/sun/applet/AppletClassLoader.java b/jdk/src/java.desktop/share/classes/sun/applet/AppletClassLoader.java index efb0ea50077..a778ca6c769 100644 --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletClassLoader.java +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletClassLoader.java @@ -358,7 +358,7 @@ public class AppletClassLoader extends URLClassLoader { * #getResource(String)}.

        * * @param name the resource name - * @return an input stream for reading the resource, or null + * @return an input stream for reading the resource, or {@code null} * if the resource could not be found * @since 1.1 */ @@ -418,7 +418,7 @@ public class AppletClassLoader extends URLClassLoader { * #getResource(String)}.

        * * @param name the resource name - * @return an input stream for reading the resource, or null + * @return an input stream for reading the resource, or {@code null} * if the resource could not be found * @since 1.1 */ diff --git a/jdk/src/java.desktop/share/classes/sun/applet/AppletSecurity.java b/jdk/src/java.desktop/share/classes/sun/applet/AppletSecurity.java index 0eba476fe82..192c0c84f2e 100644 --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletSecurity.java +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletSecurity.java @@ -260,17 +260,17 @@ class AppletSecurity extends AWTSecurityManager { /** - * Throws a SecurityException if the + * Throws a {@code SecurityException} if the * calling thread is not allowed to access the package specified by * the argument. *

        - * This method is used by the loadClass method of class + * This method is used by the {@code loadClass} method of class * loaders. *

        - * The checkPackageAccess method for class - * SecurityManager calls - * checkPermission with the - * RuntimePermission("accessClassInPackage."+ pkgname) + * The {@code checkPackageAccess} method for class + * {@code SecurityManager} calls + * {@code checkPermission} with the + * {@code RuntimePermission("accessClassInPackage."+ pkgname)} * permission. * * @param pkgname the package name. @@ -302,8 +302,8 @@ class AppletSecurity extends AWTSecurityManager { /** * Tests if a client can get access to the AWT event queue. *

        - * This method calls checkPermission with the - * AWTPermission("accessEventQueue") permission. + * This method calls {@code checkPermission} with the + * {@code AWTPermission("accessEventQueue")} permission. * * @since 1.1 * @exception SecurityException if the caller does not have diff --git a/jdk/src/java.desktop/share/classes/sun/applet/AppletThreadGroup.java b/jdk/src/java.desktop/share/classes/sun/applet/AppletThreadGroup.java index fab6685c1d6..932b517cc0a 100644 --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletThreadGroup.java +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletThreadGroup.java @@ -51,7 +51,7 @@ public class AppletThreadGroup extends ThreadGroup { * @param parent the parent thread group. * @param name the name of the new thread group. * @exception NullPointerException if the thread group argument is - * null. + * {@code null}. * @exception SecurityException if the current thread cannot create a * thread in the specified thread group. * @see java.lang.SecurityException diff --git a/jdk/src/java.desktop/share/classes/sun/applet/Main.java b/jdk/src/java.desktop/share/classes/sun/applet/Main.java index d29ed5ffd23..681fb81c6db 100644 --- a/jdk/src/java.desktop/share/classes/sun/applet/Main.java +++ b/jdk/src/java.desktop/share/classes/sun/applet/Main.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, 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 @@ -107,6 +107,7 @@ public class Main { private int run(String [] args) { // DECODE ARGS try { + System.out.println(lookup("deprecated")); if (args.length == 0) { usage(); return 0; @@ -229,7 +230,7 @@ public class Main { * * @param url a string which represents either a relative or absolute URL. * @return a URL when the passed in string can be interpreted according - * to the RFC, null otherwise. + * to the RFC, {@code null} otherwise. * @exception ParseException * Thrown when we are unable to construct a proper URL from the * passed in string. @@ -270,8 +271,8 @@ public class Main { * Invoke the debugger with the arguments passed in to appletviewer. * * @param args The arguments passed into the debugger. - * @return 0 if the debugger is invoked successfully, - * 1 otherwise. + * @return {@code 0} if the debugger is invoked successfully, + * {@code 1} otherwise. */ private int invokeDebugger(String [] args) { // CONSTRUCT THE COMMAND LINE diff --git a/jdk/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer.java b/jdk/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer.java index af1f3d5a609..f05729b972e 100644 --- a/jdk/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer.java +++ b/jdk/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, 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 @@ -73,6 +73,7 @@ public class MsgAppletViewer extends ListResourceBundle { {"appletviewer.parse.warning.embed.requiresheight", "Warning: tag requires height attribute."}, {"appletviewer.parse.warning.embed.requireswidth", "Warning: tag requires width attribute."}, {"appletviewer.parse.warning.appnotLongersupported", "Warning: tag no longer supported, use instead:"}, + {"appletviewer.deprecated", "AppletViewer is deprecated."}, {"appletviewer.usage", "Usage: appletviewer url(s)\n\nwhere include:\n -debug Start the applet viewer in the Java debugger\n -encoding Specify character encoding used by HTML files\n -J Pass argument to the java interpreter\n\nThe -J option is non-standard and subject to change without notice."}, {"appletviewer.main.err.unsupportedopt", "Unsupported option: {0}"}, {"appletviewer.main.err.unrecognizedarg", "Unrecognized argument: {0}"}, diff --git a/jdk/src/java.desktop/share/classes/sun/awt/AWTAccessor.java b/jdk/src/java.desktop/share/classes/sun/awt/AWTAccessor.java index a025ae85e5f..7d67cd6ae47 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/AWTAccessor.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/AWTAccessor.java @@ -85,7 +85,7 @@ public final class AWTAccessor { /* * * Gets the bounds of this component in the form of a - * Rectangle object. The bounds specify this + * {@code Rectangle} object. The bounds specify this * component's width, height, and location relative to * its parent. */ diff --git a/jdk/src/java.desktop/share/classes/sun/awt/AWTAutoShutdown.java b/jdk/src/java.desktop/share/classes/sun/awt/AWTAutoShutdown.java index 95a1fb9ddb3..1ecef9162ca 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/AWTAutoShutdown.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/AWTAutoShutdown.java @@ -41,20 +41,20 @@ import sun.util.logging.PlatformLogger; * This class is to let AWT shutdown automatically when a user is done * with AWT. It tracks AWT state using the following parameters: *
          - *
        • peerMap - the map between the existing peer objects + *
        • {@code peerMap} - the map between the existing peer objects * and their associated targets - *
        • toolkitThreadBusy - whether the toolkit thread + *
        • {@code toolkitThreadBusy} - whether the toolkit thread * is waiting for a new native event to appear in its queue * or is dispatching an event - *
        • busyThreadSet - a set of all the event dispatch + *
        • {@code busyThreadSet} - a set of all the event dispatch * threads that are busy at this moment, i.e. those that are not * waiting for a new event to appear in their event queue. *

        * AWT is considered to be in ready-to-shutdown state when - * peerMap is empty and toolkitThreadBusy - * is false and busyThreadSet is empty. + * {@code peerMap} is empty and {@code toolkitThreadBusy} + * is false and {@code busyThreadSet} is empty. * The internal AWTAutoShutdown logic secures that the single non-daemon - * thread (blockerThread) is running when AWT is not in + * thread ({@code blockerThread}) is running when AWT is not in * ready-to-shutdown state. This blocker thread is to prevent AWT from * exiting since the toolkit thread is now daemon and all the event * dispatch threads are started only when needed. Once it is detected @@ -229,8 +229,8 @@ public final class AWTAutoShutdown implements Runnable { /** * Determine whether AWT is currently in ready-to-shutdown state. * AWT is considered to be in ready-to-shutdown state if - * peerMap is empty and toolkitThreadBusy - * is false and busyThreadSet is empty. + * {@code peerMap} is empty and {@code toolkitThreadBusy} + * is false and {@code busyThreadSet} is empty. * * @return true if AWT is in ready-to-shutdown state. */ diff --git a/jdk/src/java.desktop/share/classes/sun/awt/AppContext.java b/jdk/src/java.desktop/share/classes/sun/awt/AppContext.java index 9023251171d..b4bc32996b2 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/AppContext.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/AppContext.java @@ -71,7 +71,7 @@ import java.util.function.Supplier; * * For example, here we have a Foo service, with its pre-AppContext * code:

        - *

        + * 
        {@code
          *    public class Foo {
          *        private static Foo defaultFoo = new Foo();
          *
        @@ -80,7 +80,8 @@ import java.util.function.Supplier;
          *        }
          *
          *    ... Foo service methods
        - *    }

        + * } + * }

        * * The problem with the above is that the Foo service is global in scope, * so that applets and other untrusted code can execute methods on the @@ -90,7 +91,7 @@ import java.util.function.Supplier; * executes it.

        * * Here's the Foo class written to use the AppContext:

        - *

        + * 
        {@code
          *    public class Foo {
          *        public static Foo getDefaultFoo() {
          *            Foo foo = (Foo)AppContext.getAppContext().get(Foo.class);
        @@ -102,7 +103,8 @@ import java.util.function.Supplier;
          *        }
          *
          *    ... Foo service methods
        - *    }

        + * } + * }

        * * Since a separate AppContext can exist for each ThreadGroup, trusted * and untrusted code have access to different Foo instances. This allows @@ -159,7 +161,7 @@ public final class AppContext { Collections.synchronizedMap(new IdentityHashMap()); /** - * Returns a set containing all AppContexts. + * Returns a set containing all {@code AppContext}s. */ public static Set getAppContexts() { synchronized (threadGroup2appContext) { @@ -187,8 +189,8 @@ public final class AppContext { private final ThreadGroup threadGroup; /** - * If any PropertyChangeListeners have been registered, - * the changeSupport field describes them. + * If any {@code PropertyChangeListeners} have been registered, + * the {@code changeSupport} field describes them. * * @see #addPropertyChangeListener * @see #removePropertyChangeListener @@ -633,7 +635,7 @@ public final class AppContext { * * @param key a key in the AppContext. * @return the value to which the key is mapped in this AppContext; - * null if the key is not mapped to any value. + * {@code null} if the key is not mapped to any value. * @see #put(Object, Object) * @since 1.2 */ @@ -670,19 +672,19 @@ public final class AppContext { } /** - * Maps the specified key to the specified - * value in this AppContext. Neither the key nor the - * value can be null. + * Maps the specified {@code key} to the specified + * {@code value} in this AppContext. Neither the key nor the + * value can be {@code null}. *

        - * The value can be retrieved by calling the get method + * The value can be retrieved by calling the {@code get} method * with a key that is equal to the original key. * * @param key the AppContext key. * @param value the value. * @return the previous value of the specified key in this - * AppContext, or null if it did not have one. + * AppContext, or {@code null} if it did not have one. * @exception NullPointerException if the key or value is - * null. + * {@code null}. * @see #get(Object) * @since 1.2 */ @@ -702,7 +704,7 @@ public final class AppContext { * * @param key the key that needs to be removed. * @return the value to which the key had been mapped in this AppContext, - * or null if the key did not have a mapping. + * or {@code null} if the key did not have a mapping. * @since 1.2 */ public Object remove(Object key) { @@ -746,7 +748,7 @@ public final class AppContext { * Returns an array of all the property change listeners * registered on this component. * - * @return all of this component's PropertyChangeListeners + * @return all of this component's {@code PropertyChangeListener}s * or an empty array if no property change * listeners are currently registered * @@ -825,7 +827,7 @@ public final class AppContext { * Returns an array of all the listeners which have been associated * with the named property. * - * @return all of the PropertyChangeListeners associated with + * @return all of the {@code PropertyChangeListeners} associated with * the named property or an empty array if no listeners have * been added * diff --git a/jdk/src/java.desktop/share/classes/sun/awt/DisplayChangedListener.java b/jdk/src/java.desktop/share/classes/sun/awt/DisplayChangedListener.java index ee0548a2904..747cf9e4124 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/DisplayChangedListener.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/DisplayChangedListener.java @@ -37,7 +37,7 @@ import java.util.EventListener; * screens. * * For win32, the listener object created from that class is then registered - * with the WToolkit object using its addDisplayChangeListener + * with the WToolkit object using its {@code addDisplayChangeListener} * method. When the display resolution is changed (which occurs, * in Windows, either by the user changing the properties of the * display through the control panel or other utility or by diff --git a/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java b/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java index affe2bcb8e7..d096d8c5e7d 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java @@ -348,17 +348,17 @@ public abstract class EmbeddedFrame extends Frame /** * Synthesize native message to activate or deactivate EmbeddedFrame window - * depending on the value of parameter b. + * depending on the value of parameter {@code b}. * Peers should override this method if they are to implement * this functionality. - * @param doActivate if true, activates the window; + * @param doActivate if {@code true}, activates the window; * otherwise, deactivates the window */ public void synthesizeWindowActivation(boolean doActivate) {} /** * Moves this embedded frame to a new location. The top-left corner of - * the new location is specified by the x and y + * the new location is specified by the {@code x} and {@code y} * parameters relative to the native parent component. *

        * setLocation() and setBounds() for EmbeddedFrame really don't move it @@ -418,9 +418,9 @@ public abstract class EmbeddedFrame extends Frame /** * Moves and resizes this embedded frame. The new location of the top-left - * corner is specified by x and y parameters + * corner is specified by {@code x} and {@code y} parameters * relative to the native parent component. The new size is specified by - * width and height. + * {@code width} and {@code height}. *

        * setLocation() and setBounds() for EmbeddedFrame really don't move it * within the native parent. These methods always put embedded frame to @@ -437,8 +437,8 @@ public abstract class EmbeddedFrame extends Frame *

        * @param x the new x-coordinate relative to the parent component * @param y the new y-coordinate relative to the parent component - * @param width the new width of this embedded frame - * @param height the new height of this embedded frame + * @param width the new {@code width} of this embedded frame + * @param height the new {@code height} of this embedded frame * @see java.awt.Component#setBounds * @see #setLocationPrivate * @see #getLocationPrivate diff --git a/jdk/src/java.desktop/share/classes/sun/awt/FwDispatcher.java b/jdk/src/java.desktop/share/classes/sun/awt/FwDispatcher.java index 8ceb67e05b1..8131834b3c7 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/FwDispatcher.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/FwDispatcher.java @@ -48,7 +48,7 @@ public interface FwDispatcher { /** * Forwards a runnable to the delegate, which executes it on an appropriate thread. - * @param r - a runnable calling {@link EventQueue#dispatchEventImpl(java.awt.AWTEvent, Object)} + * @param r a runnable calling {@link EventQueue#dispatchEventImpl(java.awt.AWTEvent, Object)} */ void scheduleDispatch(Runnable r); diff --git a/jdk/src/java.desktop/share/classes/sun/awt/GlobalCursorManager.java b/jdk/src/java.desktop/share/classes/sun/awt/GlobalCursorManager.java index 5337b1956ea..67305e77efd 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/GlobalCursorManager.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/GlobalCursorManager.java @@ -153,7 +153,7 @@ public abstract class GlobalCursorManager { * updates:

        * * (1) InputEvent updates which are outdated are discarded by - * updateCursorImmediately(InputEvent).

        + * {@code updateCursorImmediately(InputEvent)}.

        * * (2) If 'useCache' is true, the native code is free to use a cached * value to determine the most specific, visible, enabled heavyweight diff --git a/jdk/src/java.desktop/share/classes/sun/awt/LightweightFrame.java b/jdk/src/java.desktop/share/classes/sun/awt/LightweightFrame.java index 1a203b83700..5ddeca23ef4 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/LightweightFrame.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/LightweightFrame.java @@ -112,7 +112,7 @@ public abstract class LightweightFrame extends Frame { * frame. Peers should override this method if they are to implement * this functionality. * - * @param activate if true, activates the frame; + * @param activate if {@code true}, activates the frame; * otherwise, deactivates the frame */ public void emulateActivation(boolean activate) { diff --git a/jdk/src/java.desktop/share/classes/sun/awt/PaintEventDispatcher.java b/jdk/src/java.desktop/share/classes/sun/awt/PaintEventDispatcher.java index 7a6312aa99e..eec1fc93c66 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/PaintEventDispatcher.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/PaintEventDispatcher.java @@ -40,7 +40,7 @@ public class PaintEventDispatcher { private static PaintEventDispatcher dispatcher; /** - * Sets the current PaintEventDispatcher. + * Sets the current {@code PaintEventDispatcher}. * * @param dispatcher PaintEventDispatcher */ @@ -52,7 +52,7 @@ public class PaintEventDispatcher { } /** - * Returns the currently active PaintEventDispatcher. This + * Returns the currently active {@code PaintEventDispatcher}. This * will never return null. * * @return PaintEventDispatcher @@ -67,9 +67,9 @@ public class PaintEventDispatcher { } /** - * Creates and returns the PaintEvent that should be + * Creates and returns the {@code PaintEvent} that should be * dispatched for the specified component. If this returns null - * no PaintEvent is dispatched. + * no {@code PaintEvent} is dispatched. *

        * WARNING: This is invoked from the native thread, be careful * what methods you end up invoking here. diff --git a/jdk/src/java.desktop/share/classes/sun/awt/RepaintArea.java b/jdk/src/java.desktop/share/classes/sun/awt/RepaintArea.java index 86723c5d015..e2624f26a0b 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/RepaintArea.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/RepaintArea.java @@ -31,7 +31,7 @@ import java.awt.Rectangle; import java.awt.event.PaintEvent; /** - * The RepaintArea is a geometric construct created for the + * The {@code RepaintArea} is a geometric construct created for the * purpose of holding the geometry of several coalesced paint events. * This geometry is accessed synchronously, although it is written such * that painting may still be executed asynchronously. @@ -59,17 +59,17 @@ public class RepaintArea { /** - * Constructs a new RepaintArea + * Constructs a new {@code RepaintArea} * @since 1.3 */ public RepaintArea() { } /** - * Constructs a new RepaintArea initialized to match + * Constructs a new {@code RepaintArea} initialized to match * the values of the specified RepaintArea. * - * @param ra the RepaintArea from which to copy initial + * @param ra the {@code RepaintArea} from which to copy initial * values to a newly constructed RepaintArea * @since 1.3 */ @@ -82,12 +82,12 @@ public class RepaintArea { } /** - * Adds a Rectangle to this RepaintArea. + * Adds a {@code Rectangle} to this {@code RepaintArea}. * PAINT Rectangles are divided into mostly vertical and mostly horizontal. * Each group is unioned together. * UPDATE Rectangles are unioned. * - * @param r the specified Rectangle + * @param r the specified {@code Rectangle} * @param id possible values PaintEvent.UPDATE or PaintEvent.PAINT * @since 1.3 */ @@ -109,11 +109,11 @@ public class RepaintArea { /** - * Creates a new RepaintArea with the same geometry as this + * Creates a new {@code RepaintArea} with the same geometry as this * RepaintArea, then removes all of the geometry from this * RepaintArea and restores it to an empty RepaintArea. * - * @return ra a new RepaintArea having the same geometry as + * @return ra a new {@code RepaintArea} having the same geometry as * this RepaintArea. * @since 1.3 */ @@ -186,7 +186,7 @@ public class RepaintArea { * MAX_BENEFIT_RATIO times the benefit, then the vertical and horizontal unions are * painted separately. Otherwise the entire bounding rectangle is painted. * - * @param target Component to paint or update + * @param target Component to {@code paint} or {@code update} * @since 1.4 */ public void paint(Object target, boolean shouldClearRectBeforePaint) { @@ -248,7 +248,7 @@ public class RepaintArea { } /** - * Calls Component.update(Graphics) with given Graphics. + * Calls {@code Component.update(Graphics)} with given Graphics. */ protected void updateComponent(Component comp, Graphics g) { if (comp != null) { @@ -257,7 +257,7 @@ public class RepaintArea { } /** - * Calls Component.paint(Graphics) with given Graphics. + * Calls {@code Component.paint(Graphics)} with given Graphics. */ protected void paintComponent(Component comp, Graphics g) { if (comp != null) { diff --git a/jdk/src/java.desktop/share/classes/sun/awt/SunToolkit.java b/jdk/src/java.desktop/share/classes/sun/awt/SunToolkit.java index 8130198e0d2..a1c89a41067 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/SunToolkit.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/SunToolkit.java @@ -339,9 +339,9 @@ public abstract class SunToolkit extends Toolkit /** * Sets the synchronous status of focus requests on lightweight * components in the specified window to the specified value. - * If the boolean parameter is true then the focus + * If the boolean parameter is {@code true} then the focus * requests on lightweight components will be performed - * synchronously, if it is false, then asynchronously. + * synchronously, if it is {@code false}, then asynchronously. * By default, all windows have their lightweight request status * set to asynchronous. *

        @@ -521,7 +521,7 @@ public abstract class SunToolkit extends Toolkit /* * Execute a chunk of code on the Java event handler thread. The * method takes into account provided AppContext and sets - * SunToolkit.getDefaultToolkit() as a target of the + * {@code SunToolkit.getDefaultToolkit()} as a target of the * event. See 6451487 for detailes. * Does not wait for the execution to occur before returning to * the caller. @@ -1159,21 +1159,10 @@ public abstract class SunToolkit extends Toolkit return getStartupLocale(); } - private static DefaultMouseInfoPeer mPeer = null; - - @Override - public synchronized MouseInfoPeer getMouseInfoPeer() { - if (mPeer == null) { - mPeer = new DefaultMouseInfoPeer(); - } - return mPeer; - } - - /** * Returns whether default toolkit needs the support of the xembed * from embedding host(if any). - * @return true, if XEmbed is needed, false otherwise + * @return {@code true}, if XEmbed is needed, {@code false} otherwise */ public static boolean needsXEmbed() { String noxembed = AccessController. @@ -1196,7 +1185,7 @@ public abstract class SunToolkit extends Toolkit /** * Returns whether this toolkit needs the support of the xembed * from embedding host(if any). - * @return true, if XEmbed is needed, false otherwise + * @return {@code true}, if XEmbed is needed, {@code false} otherwise */ protected boolean needsXEmbedImpl() { return false; @@ -1215,8 +1204,8 @@ public abstract class SunToolkit extends Toolkit /** * Returns whether the modal exclusion API is supported by the current toolkit. - * When it isn't supported, calling setModalExcluded has no - * effect, and isModalExcluded returns false for all windows. + * When it isn't supported, calling {@code setModalExcluded} has no + * effect, and {@code isModalExcluded} returns false for all windows. * * @return true if modal exclusion is supported by the toolkit, false otherwise * @@ -1249,7 +1238,7 @@ public abstract class SunToolkit extends Toolkit * events, focus transfer and z-order will continue to work for the * window, it's owned windows and child components, even in the * presence of a modal dialog. - * For details on which Windows are normally blocked + * For details on which {@code Window}s are normally blocked * by modal dialog, see {@link java.awt.Dialog}. * Invoking this method when the modal exclusion API is not supported by * the current toolkit has no effect. @@ -1438,23 +1427,23 @@ public abstract class SunToolkit extends Toolkit * *

        This method allows to write tests without explicit timeouts * or wait for some event. Example: - * + *

        {@code
              * Frame f = ...;
              * f.setVisible(true);
              * ((SunToolkit)Toolkit.getDefaultToolkit()).realSync();
        -     * 
        +     * }
        * - *

        After realSync, f will be completely visible + *

        After realSync, {@code f} will be completely visible * on the screen, its getLocationOnScreen will be returning the * right result and it will be the focus owner. * *

        Another example: - * + *

        {@code
              * b.requestFocus();
              * ((SunToolkit)Toolkit.getDefaultToolkit()).realSync();
        -     * 
        +     * }
        * - *

        After realSync, b will be focus owner. + *

        After realSync, {@code b} will be focus owner. * *

        Notice that realSync isn't guaranteed to work if recurring * actions occur, such as if during processing of some event @@ -1529,8 +1518,8 @@ public abstract class SunToolkit extends Toolkit * sync of the native queue. The method should wait until native * requests are processed, all native events are processed and * corresponding Java events are generated. Should return - * true if some events were processed, - * false otherwise. + * {@code true} if some events were processed, + * {@code false} otherwise. */ protected abstract boolean syncNativeQueue(final long timeout); @@ -1547,8 +1536,8 @@ public abstract class SunToolkit extends Toolkit * Waits for the Java event queue to empty. Ensures that all * events are processed (including paint events), and that if * recursive events were generated, they are also processed. - * Should return true if more processing is - * necessary, false otherwise. + * Should return {@code true} if more processing is + * necessary, {@code false} otherwise. */ @SuppressWarnings("serial") protected final boolean waitForIdle(final long timeout) { @@ -1813,7 +1802,7 @@ public abstract class SunToolkit extends Toolkit } /** - * Returns the Window ancestor of the component comp. + * Returns the {@code Window} ancestor of the component {@code comp}. * @return Window ancestor of the component or component by itself if it is Window; * null, if component is not a part of window hierarchy */ diff --git a/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java b/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java index 1714fea6113..e90e6004ad7 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java @@ -124,7 +124,7 @@ import java.util.stream.Stream; */ public abstract class DataTransferer { /** - * The DataFlavor representing a Java text encoding String + * The {@code DataFlavor} representing a Java text encoding String * encoded in UTF-8, where *

              *     representationClass = [B
        @@ -323,7 +323,7 @@ public abstract class DataTransferer {
              * @param flavors the data flavors
              * @param map the FlavorTable which contains mappings between
              *            DataFlavors and data formats
        -     * @throws NullPointerException if flavors or map is null
        +     * @throws NullPointerException if flavors or map is {@code null}
              */
             public SortedMap getFormatsForFlavors(DataFlavor[] flavors,
                                                                     FlavorTable map)
        @@ -478,7 +478,7 @@ public abstract class DataTransferer {
              * @param formats the data formats
              * @param map the FlavorTable which contains mappings between
              *            DataFlavors and data formats
        -     * @throws NullPointerException if formats or map is null
        +     * @throws NullPointerException if formats or map is {@code null}
              */
             public Set getFlavorsForFormatsAsSet(long[] formats, FlavorTable map) {
                 Set flavorSet = new HashSet<>(formats.length);
        @@ -509,13 +509,13 @@ public abstract class DataTransferer {
              * 2) the data translation for this mapping can be performed by the data
              * transfer subsystem.
              * The array will be sorted according to a
        -     * DataFlavorComparator created with the specified
        +     * {@code DataFlavorComparator} created with the specified
              * map as an argument.
              *
              * @param formats the data formats
              * @param map the FlavorTable which contains mappings between
              *            DataFlavors and data formats
        -     * @throws NullPointerException if formats or map is null
        +     * @throws NullPointerException if formats or map is {@code null}
              */
             public DataFlavor[] getFlavorsForFormatsAsArray(long[] formats,
                                                             FlavorTable map) {
        @@ -1805,21 +1805,21 @@ search:
         
             /**
              * Concatenates the data represented by two objects. Objects can be either
        -     * byte arrays or instances of InputStream. If both arguments
        +     * byte arrays or instances of {@code InputStream}. If both arguments
              * are byte arrays byte array will be returned. Otherwise an
        -     * InputStream will be returned.
        +     * {@code InputStream} will be returned.
              * 

        * Currently is only called from native code to prepend palette data to * platform-specific image data during image transfer on Win32. * * @param obj1 the first object to be concatenated. * @param obj2 the second object to be concatenated. - * @return a byte array or an InputStream which represents + * @return a byte array or an {@code InputStream} which represents * a logical concatenation of the two arguments. * @throws NullPointerException is either of the arguments is - * null + * {@code null} * @throws ClassCastException is either of the arguments is - * neither byte array nor an instance of InputStream. + * neither byte array nor an instance of {@code InputStream}. */ private Object concatData(Object obj1, Object obj2) { InputStream str1 = null; @@ -1962,7 +1962,7 @@ search: /** * Helper function to convert a Set of DataFlavors to a sorted array. - * The array will be sorted according to DataFlavorComparator. + * The array will be sorted according to {@code DataFlavorComparator}. */ public static DataFlavor[] setToSortedDataFlavorArray(Set flavorsSet) { DataFlavor[] flavors = new DataFlavor[flavorsSet.size()]; @@ -1993,7 +1993,7 @@ search: /** * Returns platform-specific mappings for the specified native. * If there are no platform-specific mappings for this native, the method - * returns an empty List. + * returns an empty {@code List}. */ public LinkedHashSet getPlatformMappingsForNative(String nat) { return new LinkedHashSet<>(); @@ -2002,7 +2002,7 @@ search: /** * Returns platform-specific mappings for the specified flavor. * If there are no platform-specific mappings for this flavor, the method - * returns an empty List. + * returns an empty {@code List}. */ public LinkedHashSet getPlatformMappingsForFlavor(DataFlavor df) { return new LinkedHashSet<>(); diff --git a/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/SunClipboard.java b/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/SunClipboard.java index 3b743cbbaab..fe1baa3e631 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/SunClipboard.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/SunClipboard.java @@ -68,8 +68,8 @@ public abstract class SunClipboard extends Clipboard private final Object CLIPBOARD_FLAVOR_LISTENER_KEY; /** - * A number of FlavorListeners currently registered - * on this clipboard across all AppContexts. + * A number of {@code FlavorListener}s currently registered + * on this clipboard across all {@code AppContext}s. */ private volatile int numberOfFlavorListeners = 0; @@ -262,11 +262,11 @@ public abstract class SunClipboard extends Clipboard /** * Clears the clipboard state (contents, owner and contents context) and * notifies the current owner that ownership is lost. Does nothing if the - * argument is not null and is not equal to the current + * argument is not {@code null} and is not equal to the current * contents context. * * @param disposedContext the AppContext that is disposed or - * null if the ownership is lost because another + * {@code null} if the ownership is lost because another * application acquired ownership. */ protected void lostOwnershipLater(final AppContext disposedContext) { @@ -405,10 +405,10 @@ public abstract class SunClipboard extends Clipboard protected abstract void unregisterClipboardViewerChecked(); /** - * Checks change of the DataFlavors and, if necessary, - * posts notifications on FlavorEvents to the + * Checks change of the {@code DataFlavor}s and, if necessary, + * posts notifications on {@code FlavorEvent}s to the * AppContexts' EDTs. - * The parameter formats is null iff we have just + * The parameter {@code formats} is null iff we have just * failed to get formats available on the clipboard. * * @param formats data formats that have just been retrieved from diff --git a/jdk/src/java.desktop/share/classes/sun/awt/event/IgnorePaintEvent.java b/jdk/src/java.desktop/share/classes/sun/awt/event/IgnorePaintEvent.java index 1f59869027d..78a316b0700 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/event/IgnorePaintEvent.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/event/IgnorePaintEvent.java @@ -32,7 +32,7 @@ import java.awt.event.PaintEvent; * PaintEvents that are effectively ignored. This class is used only for * tagging. If a heavy weight peer is asked to handle an event of this * class it'll ignore it. This class is used by Swing. - * Look at javax.swing.SwingPaintEventDispatcher for more. + * Look at {@code javax.swing.SwingPaintEventDispatcher} for more. * */ @SuppressWarnings("serial") // JDK-implementation class diff --git a/jdk/src/java.desktop/share/classes/sun/awt/geom/Order2.java b/jdk/src/java.desktop/share/classes/sun/awt/geom/Order2.java index 64d37c88e27..82a0dc1ef38 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/geom/Order2.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/geom/Order2.java @@ -89,7 +89,7 @@ final class Order2 extends Curve { /* * Return the count of the number of horizontal sections of the * specified quadratic Bezier curve. Put the parameters for the - * horizontal sections into the specified ret array. + * horizontal sections into the specified {@code ret} array. *

        * If we examine the parametric equation in t, we have: * Py(t) = C0*(1-t)^2 + 2*CP*t*(1-t) + C1*t^2 diff --git a/jdk/src/java.desktop/share/classes/sun/awt/geom/Order3.java b/jdk/src/java.desktop/share/classes/sun/awt/geom/Order3.java index 9c9e5962aea..21363f63b1c 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/geom/Order3.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/geom/Order3.java @@ -123,7 +123,7 @@ final class Order3 extends Curve { /* * Return the count of the number of horizontal sections of the * specified cubic Bezier curve. Put the parameters for the - * horizontal sections into the specified ret array. + * horizontal sections into the specified {@code ret} array. *

        * If we examine the parametric equation in t, we have: * Py(t) = C0(1-t)^3 + 3CP0 t(1-t)^2 + 3CP1 t^2(1-t) + C1 t^3 diff --git a/jdk/src/java.desktop/share/classes/sun/awt/im/ExecutableInputMethodManager.java b/jdk/src/java.desktop/share/classes/sun/awt/im/ExecutableInputMethodManager.java index 88ee71163b1..fe533f4cbe0 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/im/ExecutableInputMethodManager.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/im/ExecutableInputMethodManager.java @@ -57,11 +57,11 @@ import sun.awt.InputMethodSupport; import sun.awt.SunToolkit; /** - * ExecutableInputMethodManager is the implementation of the - * InputMethodManager class. It is runnable as a separate + * {@code ExecutableInputMethodManager} is the implementation of the + * {@code InputMethodManager} class. It is runnable as a separate * thread in the AWT environment.  - * InputMethodManager.getInstance() creates an instance of - * ExecutableInputMethodManager and executes it as a deamon + * {@code InputMethodManager.getInstance()} creates an instance of + * {@code ExecutableInputMethodManager} and executes it as a deamon * thread. * * @see InputMethodManager diff --git a/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodManager.java b/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodManager.java index a5000b9836d..8b479d20957 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodManager.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodManager.java @@ -59,10 +59,10 @@ import sun.misc.InnocuousThread; import sun.misc.ManagedLocalsThread; /** - * InputMethodManager is an abstract class that manages the input - * method environment of JVM. There is only one InputMethodManager + * {@code InputMethodManager} is an abstract class that manages the input + * method environment of JVM. There is only one {@code InputMethodManager} * instance in JVM that is executed under a separate daemon thread. - * InputMethodManager performs the following: + * {@code InputMethodManager} performs the following: *

          *
        • * Keeps track of the current input context.
        • @@ -87,7 +87,7 @@ import sun.misc.ManagedLocalsThread; * When more than one input method descriptor can be found or the only input * method descriptor found supports multiple locales, a menu item * is added to the window (manager) menu. This item label is obtained invoking - * getTriggerMenuString(). If null is returned by this method, it + * {@code getTriggerMenuString()}. If null is returned by this method, it * means that there is only input method or none in the environment. Frame and Dialog * invoke this method. * @@ -97,15 +97,15 @@ import sun.misc.ManagedLocalsThread; * *
        • * When the menu item of the window (manager) menu has been selected by the - * user, Frame/Dialog invokes notifyChangeRequest() to notify - * InputMethodManager that the user wants to switch input methods.
        • + * user, Frame/Dialog invokes {@code notifyChangeRequest()} to notify + * {@code InputMethodManager} that the user wants to switch input methods. * *
        • - * InputMethodManager displays a pop-up menu to choose an input method.
        • + * {@code InputMethodManager} displays a pop-up menu to choose an input method. * *
        • - * InputMethodManager notifies the current InputContext of - * the selected InputMethod.
        • + * {@code InputMethodManager} notifies the current {@code InputContext} of + * the selected {@code InputMethod}. *
        * *
          @@ -116,8 +116,8 @@ import sun.misc.ManagedLocalsThread; * *
        • * When the hot key combination is typed by the user, the component which has the input - * focus invokes notifyChangeRequestByHotKey() to notify - * InputMethodManager that the user wants to switch input methods.
        • + * focus invokes {@code notifyChangeRequestByHotKey()} to notify + * {@code InputMethodManager} that the user wants to switch input methods. * *
        • * This results in a popup menu and notification to the current input context, diff --git a/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodPopupMenu.java b/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodPopupMenu.java index d64a5f06f7a..7a2c975918e 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodPopupMenu.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodPopupMenu.java @@ -46,7 +46,7 @@ import javax.swing.JMenu; import javax.swing.JMenuItem; /** - * InputMethodPopupMenu provides the popup selection menu + * {@code InputMethodPopupMenu} provides the popup selection menu */ abstract class InputMethodPopupMenu implements ActionListener { diff --git a/jdk/src/java.desktop/share/classes/sun/awt/image/BufferedImageDevice.java b/jdk/src/java.desktop/share/classes/sun/awt/image/BufferedImageDevice.java index 95dd69f1ff9..a91ffbc5d29 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/image/BufferedImageDevice.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/image/BufferedImageDevice.java @@ -37,8 +37,8 @@ public class BufferedImageDevice extends GraphicsDevice } /** - * Returns the type of this GraphicsDevice. - * @return the type of this GraphicsDevice, which can + * Returns the type of this {@code GraphicsDevice}. + * @return the type of this {@code GraphicsDevice}, which can * either be TYPE_RASTER_SCREEN, TYPE_PRINTER or TYPE_IMAGE_BUFFER. * @see #TYPE_RASTER_SCREEN * @see #TYPE_PRINTER @@ -50,30 +50,30 @@ public class BufferedImageDevice extends GraphicsDevice /** * Returns the identification string associated with this - * GraphicsDevice. - * @return a String that is the identification - * of this GraphicsDevice. + * {@code GraphicsDevice}. + * @return a {@code String} that is the identification + * of this {@code GraphicsDevice}. */ public String getIDstring() { return ("BufferedImage"); } /** - * Returns all of the GraphicsConfiguration - * objects associated with this GraphicsDevice. - * @return an array of GraphicsConfiguration + * Returns all of the {@code GraphicsConfiguration} + * objects associated with this {@code GraphicsDevice}. + * @return an array of {@code GraphicsConfiguration} * objects that are associated with this - * GraphicsDevice. + * {@code GraphicsDevice}. */ public GraphicsConfiguration[] getConfigurations() { return new GraphicsConfiguration[] { gc }; } /** - * Returns the default GraphicsConfiguration - * associated with this GraphicsDevice. - * @return the default GraphicsConfiguration - * of this GraphicsDevice. + * Returns the default {@code GraphicsConfiguration} + * associated with this {@code GraphicsDevice}. + * @return the default {@code GraphicsConfiguration} + * of this {@code GraphicsDevice}. */ public GraphicsConfiguration getDefaultConfiguration() { return gc; diff --git a/jdk/src/java.desktop/share/classes/sun/awt/image/DataBufferNative.java b/jdk/src/java.desktop/share/classes/sun/awt/image/DataBufferNative.java index bb152835f55..c8f33d8d169 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/image/DataBufferNative.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/image/DataBufferNative.java @@ -31,7 +31,7 @@ import sun.java2d.SurfaceData; import java.awt.Rectangle; /** - * This class extends DataBuffer and allows access to + * This class extends {@code DataBuffer} and allows access to * native data via the DataBuffer methods. Note that, unlike other * DataBuffer classes, the data is not stored in this class but * has been created and stored elsewhere and this class is used diff --git a/jdk/src/java.desktop/share/classes/sun/awt/shell/DefaultShellFolder.java b/jdk/src/java.desktop/share/classes/sun/awt/shell/DefaultShellFolder.java index fe349dc90b2..e20d40b2e47 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/shell/DefaultShellFolder.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/shell/DefaultShellFolder.java @@ -46,9 +46,9 @@ class DefaultShellFolder extends ShellFolder { /** * This method is implemented to make sure that no instances - * of ShellFolder are ever serialized. An instance of + * of {@code ShellFolder} are ever serialized. An instance of * this default implementation can always be represented with a - * java.io.File object instead. + * {@code java.io.File} object instead. * * @return a java.io.File replacement object. */ diff --git a/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java b/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java index cf1878a0a7a..90bf4d02389 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java @@ -62,9 +62,9 @@ public abstract class ShellFolder extends File { /** * This method must be implemented to make sure that no instances - * of ShellFolder are ever serialized. If isFileSystem() returns - * true, then the object should be representable with an instance of - * java.io.File instead. If not, then the object is most likely + * of {@code ShellFolder} are ever serialized. If {@code isFileSystem()} returns + * {@code true}, then the object should be representable with an instance of + * {@code java.io.File} instead. If not, then the object is most likely * depending on some internal (native) state and cannot be serialized. * * @return a java.io.File replacement object, or null @@ -74,11 +74,11 @@ public abstract class ShellFolder extends File { /** * Returns the path for this object's parent, - * or null if this object does not name a parent + * or {@code null} if this object does not name a parent * folder. * * @return the path as a String for this object's parent, - * or null if this object does not name a parent + * or {@code null} if this object does not name a parent * folder * * @see java.io.File#getParent() @@ -97,11 +97,11 @@ public abstract class ShellFolder extends File { /** * Returns a File object representing this object's parent, - * or null if this object does not name a parent + * or {@code null} if this object does not name a parent * folder. * * @return a File object representing this object's parent, - * or null if this object does not name a parent + * or {@code null} if this object does not name a parent * folder * * @see java.io.File#getParentFile() @@ -250,8 +250,8 @@ public abstract class ShellFolder extends File { } /** - * @param key a String - * @return An Object matching the string key. + * @param key a {@code String} + * @return An Object matching the string {@code key}. * @see ShellFolderManager#get(String) */ public static Object get(String key) { @@ -259,7 +259,7 @@ public abstract class ShellFolder extends File { } /** - * Does dir represent a "computer" such as a node on the network, or + * Does {@code dir} represent a "computer" such as a node on the network, or * "My Computer" on the desktop. */ public static boolean isComputerNode(File dir) { diff --git a/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolderColumnInfo.java b/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolderColumnInfo.java index 3926b558ba3..eba6b3af1d1 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolderColumnInfo.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolderColumnInfo.java @@ -40,8 +40,8 @@ public class ShellFolderColumnInfo { private SortOrder sortOrder; private Comparator comparator; /** - * false (default) if the {@link #comparator} expects folders as arguments, - * and true if folder's column values. The first option is used default for comparison + * {@code false} (default) if the {@link #comparator} expects folders as arguments, + * and {@code true} if folder's column values. The first option is used default for comparison * on Windows and also for separating files from directories when sorting using * ShellFolderManager's inner comparator. */ diff --git a/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolderManager.java b/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolderManager.java index 955ba3be986..e61b8122d0a 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolderManager.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolderManager.java @@ -44,21 +44,21 @@ class ShellFolderManager { } /** - * @param key a String + * @param key a {@code String} * "fileChooserDefaultFolder": - * Returns a File - the default shellfolder for a new filechooser + * Returns a {@code File} - the default shellfolder for a new filechooser * "roots": - * Returns a File[] - containing the root(s) of the displayable hierarchy + * Returns a {@code File[]} - containing the root(s) of the displayable hierarchy * "fileChooserComboBoxFolders": - * Returns a File[] - an array of shellfolders representing the list to + * Returns a {@code File[]} - an array of shellfolders representing the list to * show by default in the file chooser's combobox * "fileChooserShortcutPanelFolders": - * Returns a File[] - an array of shellfolders representing well-known + * Returns a {@code File[]} - an array of shellfolders representing well-known * folders, such as Desktop, Documents, History, Network, Home, etc. * This is used in the shortcut panel of the filechooser on Windows 2000 * and Windows Me. * "fileChooserIcon ": - * Returns an Image - icon can be ListView, DetailsView, UpFolder, NewFolder or + * Returns an {@code Image} - icon can be ListView, DetailsView, UpFolder, NewFolder or * ViewMenu (Windows only). * * @return An Object matching the key string. @@ -90,7 +90,7 @@ class ShellFolderManager { } /** - * Does dir represent a "computer" such as a node on the network, or + * Does {@code dir} represent a "computer" such as a node on the network, or * "My Computer" on the desktop. */ public boolean isComputerNode(File dir) { diff --git a/jdk/src/java.desktop/share/classes/sun/font/BidiUtils.java b/jdk/src/java.desktop/share/classes/sun/font/BidiUtils.java index 45dcf92aef5..285245ed381 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/BidiUtils.java +++ b/jdk/src/java.desktop/share/classes/sun/font/BidiUtils.java @@ -48,8 +48,8 @@ public final class BidiUtils { * * @param levels the array to receive the character levels * @param start the starting offset into the array - * @throws IndexOutOfBoundsException if start is less than 0 or - * start + getLength() is greater than levels.length. + * @throws IndexOutOfBoundsException if {@code start} is less than 0 or + * {@code start + getLength()} is greater than {@code levels.length}. */ public static void getLevels(Bidi bidi, byte[] levels, int start) { int limit = start + bidi.getLength(); @@ -87,7 +87,7 @@ public final class BidiUtils { * Given level data, compute a a visual to logical mapping. * The leftmost (or topmost) character is at visual index zero. The * logical index of the character is derived from the visual index - * by the expression li = map[vi];. + * by the expression {@code li = map[vi];}. * @param levels the levels array * @return the mapping array from visual to logical */ @@ -148,7 +148,7 @@ public final class BidiUtils { /** * Return the inverse position map. The source array must map one-to-one (each value * is distinct and the values run from zero to the length of the array minus one). - * For example, if values[i] = j, then inverse[j] = i. + * For example, if {@code values[i] = j}, then {@code inverse[j] = i}. * @param values the source ordering array * @return the inverse array */ diff --git a/jdk/src/java.desktop/share/classes/sun/font/FileFont.java b/jdk/src/java.desktop/share/classes/sun/font/FileFont.java index 6b84a5fe288..60b2377c9da 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/FileFont.java +++ b/jdk/src/java.desktop/share/classes/sun/font/FileFont.java @@ -80,7 +80,7 @@ public abstract class FileFont extends PhysicalFont { protected NativeFont[] nativeFonts; protected char[] glyphToCharMap; /* - * @throws FontFormatException - if the font can't be opened + * @throws FontFormatException if the font can't be opened */ FileFont(String platname, Object nativeNames) throws FontFormatException { diff --git a/jdk/src/java.desktop/share/classes/sun/font/FileFontStrike.java b/jdk/src/java.desktop/share/classes/sun/font/FileFontStrike.java index f5c478fb517..5ea5095ace4 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/FileFontStrike.java +++ b/jdk/src/java.desktop/share/classes/sun/font/FileFontStrike.java @@ -734,8 +734,8 @@ public class FileFontStrike extends PhysicalStrike { but if we eventually allow scalers to return NULL pointers this check might be actually useful. */ if (ptr == 0L) { - result.x = (int) Math.floor(pt.x); - result.y = (int) Math.floor(pt.y); + result.x = (int) Math.floor(pt.x+0.5f); + result.y = (int) Math.floor(pt.y+0.5f); result.width = result.height = 0; return; } @@ -743,8 +743,8 @@ public class FileFontStrike extends PhysicalStrike { topLeftX = StrikeCache.unsafe.getFloat(ptr+StrikeCache.topLeftXOffset); topLeftY = StrikeCache.unsafe.getFloat(ptr+StrikeCache.topLeftYOffset); - result.x = (int)Math.floor(pt.x + topLeftX); - result.y = (int)Math.floor(pt.y + topLeftY); + result.x = (int)Math.floor(pt.x + topLeftX + 0.5f); + result.y = (int)Math.floor(pt.y + topLeftY + 0.5f); result.width = StrikeCache.unsafe.getShort(ptr+StrikeCache.widthOffset) &0x0ffff; result.height = diff --git a/jdk/src/java.desktop/share/classes/sun/font/FontDesignMetrics.java b/jdk/src/java.desktop/share/classes/sun/font/FontDesignMetrics.java index 750e5022ca1..15174561c03 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/FontDesignMetrics.java +++ b/jdk/src/java.desktop/share/classes/sun/font/FontDesignMetrics.java @@ -520,14 +520,14 @@ public final class FontDesignMetrics extends FontMetrics { /** * Gets the advance widths of the first 256 characters in the - * Font. The advance is the + * {@code Font}. The advance is the * distance from the leftmost point to the rightmost point on the * character's baseline. Note that the advance of a - * String is not necessarily the sum of the advances + * {@code String} is not necessarily the sum of the advances * of its characters. * @return an array storing the advance widths of the - * characters in the Font - * described by this FontMetrics object. + * characters in the {@code Font} + * described by this {@code FontMetrics} object. */ // More efficient than base class implementation - reuses existing cache public int[] getWidths() { diff --git a/jdk/src/java.desktop/share/classes/sun/font/PhysicalFont.java b/jdk/src/java.desktop/share/classes/sun/font/PhysicalFont.java index a3c7378265d..1ca522e3517 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/PhysicalFont.java +++ b/jdk/src/java.desktop/share/classes/sun/font/PhysicalFont.java @@ -52,7 +52,7 @@ public abstract class PhysicalFont extends Font2D { /** * Opens the file (temporarily) and does basic verification. * Initializes the CMAP - * @throws FontFormatException - if the font can't be opened + * @throws FontFormatException if the font can't be opened * or fails verification, or there's no usable cmap */ PhysicalFont(String platname, Object nativeNames) diff --git a/jdk/src/java.desktop/share/classes/sun/font/ScriptRun.java b/jdk/src/java.desktop/share/classes/sun/font/ScriptRun.java index 485002ded79..52029dcc074 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/ScriptRun.java +++ b/jdk/src/java.desktop/share/classes/sun/font/ScriptRun.java @@ -35,10 +35,10 @@ package sun.font; /** - * ScriptRun is used to find runs of characters in - * the same script, as defined in the Script class. + * {@code ScriptRun} is used to find runs of characters in + * the same script, as defined in the {@code Script} class. * It implements a simple iterator over an array of characters. - * The iterator will assign COMMON and INHERITED + * The iterator will assign {@code COMMON} and {@code INHERITED} * characters to the same script as the preceding characters. If the * COMMON and INHERITED characters are first, they will be assigned to * the same script as the following characters. @@ -88,7 +88,7 @@ public final class ScriptRun } /** - * Construct a ScriptRun object which iterates over a subrange + * Construct a {@code ScriptRun} object which iterates over a subrange * of the given characetrs. * * @param chars the array of characters over which to iterate. @@ -145,10 +145,10 @@ public final class ScriptRun } /** - * Find the next script run. Returns false if there - * isn't another run, returns true if there is. + * Find the next script run. Returns {@code false} if there + * isn't another run, returns {@code true} if there is. * - * @return false if there isn't another run, true if there is. + * @return {@code false} if there isn't another run, {@code true} if there is. */ public boolean next() { int startSP = parenSP; // used to find the first new open character @@ -273,7 +273,7 @@ public final class ScriptRun * * @param scriptOne one of the script codes. * @param scriptTwo the other script code. - * @return true if the two scripts are the same. + * @return {@code true} if the two scripts are the same. * @see Script */ private static boolean sameScript(int scriptOne, int scriptTwo) { diff --git a/jdk/src/java.desktop/share/classes/sun/font/StandardGlyphVector.java b/jdk/src/java.desktop/share/classes/sun/font/StandardGlyphVector.java index 69f1d4babc2..92a7c306cdc 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/StandardGlyphVector.java +++ b/jdk/src/java.desktop/share/classes/sun/font/StandardGlyphVector.java @@ -1261,20 +1261,20 @@ public class StandardGlyphVector extends GlyphVector { // internal use only for possible future extension /** - * A flag used with getLayoutFlags that indicates whether this GlyphVector uses + * A flag used with getLayoutFlags that indicates whether this {@code GlyphVector} uses * a vertical baseline. */ public static final int FLAG_USES_VERTICAL_BASELINE = 128; /** - * A flag used with getLayoutFlags that indicates whether this GlyphVector uses - * vertical glyph metrics. A GlyphVector can use vertical metrics on a + * A flag used with getLayoutFlags that indicates whether this {@code GlyphVector} uses + * vertical glyph metrics. A {@code GlyphVector} can use vertical metrics on a * horizontal line, or vice versa. */ public static final int FLAG_USES_VERTICAL_METRICS = 256; /** - * A flag used with getLayoutFlags that indicates whether this GlyphVector uses + * A flag used with getLayoutFlags that indicates whether this {@code GlyphVector} uses * the 'alternate orientation.' Glyphs have a default orientation given a * particular baseline and metrics orientation, this is the orientation appropriate * for left-to-right text. For example, the letter 'A' can have four orientations, diff --git a/jdk/src/java.desktop/share/classes/sun/font/TrueTypeFont.java b/jdk/src/java.desktop/share/classes/sun/font/TrueTypeFont.java index 7668b6572a8..c04bfb9431f 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/TrueTypeFont.java +++ b/jdk/src/java.desktop/share/classes/sun/font/TrueTypeFont.java @@ -189,7 +189,7 @@ public class TrueTypeFont extends FileFont { * - reads the names (full, family). * - determines the style of the font. * - initializes the CMAP - * @throws FontFormatException - if the font can't be opened + * @throws FontFormatException if the font can't be opened * or fails verification, or there's no usable cmap */ public TrueTypeFont(String platname, Object nativeNames, int fIndex, diff --git a/jdk/src/java.desktop/share/classes/sun/font/Type1Font.java b/jdk/src/java.desktop/share/classes/sun/font/Type1Font.java index 39a1c08d0e0..44f4f58e334 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/Type1Font.java +++ b/jdk/src/java.desktop/share/classes/sun/font/Type1Font.java @@ -161,7 +161,7 @@ public class Type1Font extends FileFont { * - does basic verification of the file * - reads the names (full, family). * - determines the style of the font. - * @throws FontFormatException - if the font can't be opened + * @throws FontFormatException if the font can't be opened * or fails verification, or there's no usable cmap */ public Type1Font(String platname, Object nativeNames, boolean createdCopy) diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/Spans.java b/jdk/src/java.desktop/share/classes/sun/java2d/Spans.java index abd1eda118f..c7be5d5ab36 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/Spans.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/Spans.java @@ -41,7 +41,7 @@ public class Spans { /** * This class will sort and collapse its span * entries after this many span additions via - * the add method. + * the {@code add} method. */ private static final int kMaxAddsSinceSort = 256; @@ -52,7 +52,7 @@ public class Spans { private List mSpans = new Vector<>(kMaxAddsSinceSort); /** - * The number of Span + * The number of {@code Span} * instances that have been added * to this object without a sort * and collapse taking place. @@ -65,8 +65,8 @@ public class Spans { /** * Add a span covering the half open interval - * including start up to - * but not including end. + * including {@code start} up to + * but not including {@code end}. */ public void add(float start, float end) { @@ -82,10 +82,10 @@ public class Spans { /** * Add a span which covers the entire range. * This call is logically equivalent to - * add(Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY) + * {@code add(Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY)} * The result of making this call is that - * all future add calls are ignored - * and the intersects method always + * all future {@code add} calls are ignored + * and the {@code intersects} method always * returns true. */ public void addInfinite() { @@ -94,8 +94,8 @@ public class Spans { /** * Returns true if the span defined by the half-open - * interval from start up to, - * but not including, end intersects + * interval from {@code start} up to, + * but not including, {@code end} intersects * any of the spans defined by this instance. */ public boolean intersects(float start, float end) { @@ -231,8 +231,8 @@ public class Spans { /** * Create a half-open interval including - * start but not including - * end. + * {@code start} but not including + * {@code end}. */ Span(float start, float end) { mStart = start; @@ -240,7 +240,7 @@ public class Spans { } /** - * Return the start of the Span. + * Return the start of the {@code Span}. * The start is considered part of the * half-open interval. */ @@ -249,7 +249,7 @@ public class Spans { } /** - * Return the end of the Span. + * Return the end of the {@code Span}. * The end is not considered part of the * half-open interval. */ @@ -259,7 +259,7 @@ public class Spans { /** * Change the initial position of the - * Span. + * {@code Span}. */ final void setStart(float start) { mStart = start; @@ -267,18 +267,18 @@ public class Spans { /** * Change the terminal position of the - * Span. + * {@code Span}. */ final void setEnd(float end) { mEnd = end; } /** - * Attempt to alter this Span - * to include otherSpan without + * Attempt to alter this {@code Span} + * to include {@code otherSpan} without * altering this span's starting position. - * If otherSpan can be so consumed - * by this Span then true + * If {@code otherSpan} can be so consumed + * by this {@code Span} then {@code true} * is returned. */ boolean subsume(Span otherSpan) { @@ -304,7 +304,7 @@ public class Spans { /** * Return true if the passed in position * lies in the half-open interval defined - * by this Span. + * by this {@code Span}. */ boolean contains(float pos) { return mStart <= pos && pos < mEnd; @@ -337,11 +337,11 @@ public class Spans { } /** - * This class ranks a pair of Span + * This class ranks a pair of {@code Span} * instances. If the instances intersect they * are deemed equal otherwise they are ranked * by their relative position. Use - * SpanIntersection.instance to + * {@code SpanIntersection.instance} to * get the single instance of this class. */ static class SpanIntersection implements Comparator { diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/StateTrackable.java b/jdk/src/java.desktop/share/classes/sun/java2d/StateTrackable.java index 01f0d00cb8f..53896a81894 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/StateTrackable.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/StateTrackable.java @@ -129,9 +129,9 @@ package sun.java2d; * time period of the modifications would be small in most cases * and the 2 changes of state would each require synchronization. *

          - * In comparison the act of setting the curTracker + * In comparison the act of setting the {@code curTracker} * reference to null in the usage pattern above effectively invalidates - * all outstanding Tracker objects as soon as possible + * all outstanding {@code Tracker} objects as soon as possible * after the change to the data and requires very little code and no * synchronization to implement. *

          diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java b/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java index 3cb7207ad2b..869271d1e0c 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java @@ -2759,8 +2759,8 @@ public final class SunGraphics2D } /** - * Intersects destRect with clip and - * overwrites destRect with the result. + * Intersects {@code destRect} with {@code clip} and + * overwrites {@code destRect} with the result. * Returns false if the intersection was empty, true otherwise. */ private boolean clipTo(Rectangle destRect, Rectangle clip) { diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphicsEnvironment.java b/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphicsEnvironment.java index 679f801d2e4..ce14dfa569d 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphicsEnvironment.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphicsEnvironment.java @@ -166,7 +166,7 @@ public abstract class SunGraphicsEnvironment extends GraphicsEnvironment /** * Create and return the screen device with the specified number. The - * device with number 0 will be the default device (returned + * device with number {@code 0} will be the default device (returned * by {@link #getDefaultScreenDevice()}. * * @param screennum the number of the screen to create diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/SurfaceData.java b/jdk/src/java.desktop/share/classes/sun/java2d/SurfaceData.java index 8250d09a43d..4de1a1fc576 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/SurfaceData.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/SurfaceData.java @@ -922,8 +922,8 @@ public abstract class SurfaceData } /** - * Returns the type of this Transparency. - * @return the field type of this Transparency, which is + * Returns the type of this {@code Transparency}. + * @return the field type of this {@code Transparency}, which is * either OPAQUE, BITMASK or TRANSLUCENT. */ public int getTransparency() { diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/MarlinCache.java b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/MarlinCache.java index 9aa35132772..18cb441c571 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/MarlinCache.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/MarlinCache.java @@ -110,7 +110,7 @@ public final class MarlinCache implements MarlinConst { MarlinCache(final RendererContext rdrCtx) { this.rdrCtx = rdrCtx; - rowAAChunk = new OffHeapArray(rdrCtx, INITIAL_CHUNK_ARRAY); + rowAAChunk = new OffHeapArray(rdrCtx.cleanerObj, INITIAL_CHUNK_ARRAY); // 64K touchedTile = touchedTile_initial; diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/OffHeapArray.java b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/OffHeapArray.java index 43dee2477ed..96437cd2f56 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/OffHeapArray.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/OffHeapArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, 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 @@ -25,14 +25,9 @@ package sun.java2d.marlin; -import java.lang.ref.PhantomReference; -import java.lang.ref.ReferenceQueue; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.Vector; import static sun.java2d.marlin.MarlinConst.logUnsafeMalloc; -import sun.awt.util.ThreadGroupUtils; import jdk.internal.misc.Unsafe; +import jdk.internal.ref.CleanerFactory; /** * @@ -45,36 +40,9 @@ final class OffHeapArray { // size of int / float static final int SIZE_INT; - // RendererContext reference queue - private static final ReferenceQueue rdrQueue - = new ReferenceQueue(); - // reference list - private static final Vector refList - = new Vector(32); - static { unsafe = Unsafe.getUnsafe(); SIZE_INT = Unsafe.ARRAY_INT_INDEX_SCALE; - - // Mimics Java2D Disposer: - AccessController.doPrivileged( - (PrivilegedAction) () -> { - /* - * The thread must be a member of a thread group - * which will not get GCed before VM exit. - * Make its parent the top-level thread group. - */ - final ThreadGroup rootTG - = ThreadGroupUtils.getRootThreadGroup(); - final Thread t = new Thread(rootTG, new OffHeapDisposer(), - "MarlinRenderer Disposer"); - t.setContextClassLoader(null); - t.setDaemon(true); - t.setPriority(Thread.MAX_PRIORITY); - t.start(); - return null; - } - ); } /* members */ @@ -89,12 +57,12 @@ final class OffHeapArray { this.used = 0; if (logUnsafeMalloc) { MarlinUtils.logInfo(System.currentTimeMillis() - + ": OffHeapArray.allocateMemory = " + + ": OffHeapArray.allocateMemory = " + len + " to addr = " + this.address); } - // Create the phantom reference to ensure freeing off-heap memory: - refList.add(new OffHeapReference(parent, this)); + // Register a cleaning function to ensure freeing off-heap memory: + CleanerFactory.cleaner().register(parent, () -> this.free()); } /* @@ -117,7 +85,7 @@ final class OffHeapArray { unsafe.freeMemory(this.address); if (logUnsafeMalloc) { MarlinUtils.logInfo(System.currentTimeMillis() - + ": OffHeapEdgeArray.free = " + + ": OffHeapArray.freeMemory = " + this.length + " at addr = " + this.address); } @@ -126,41 +94,4 @@ final class OffHeapArray { void fill(final byte val) { unsafe.setMemory(this.address, this.length, val); } - - static final class OffHeapReference extends PhantomReference { - - private final OffHeapArray array; - - OffHeapReference(final Object parent, final OffHeapArray edges) { - super(parent, rdrQueue); - this.array = edges; - } - - void dispose() { - // free off-heap blocks - this.array.free(); - } - } - - static final class OffHeapDisposer implements Runnable { - @Override - public void run() { - final Thread currentThread = Thread.currentThread(); - OffHeapReference ref; - - // check interrupted: - for (; !currentThread.isInterrupted();) { - try { - ref = (OffHeapReference)rdrQueue.remove(); - ref.dispose(); - - refList.remove(ref); - - } catch (InterruptedException ie) { - MarlinUtils.logException("OffHeapDisposer interrupted:", - ie); - } - } - } - } } diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Renderer.java b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Renderer.java index f59785cd92f..aacd8b2062d 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Renderer.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Renderer.java @@ -514,7 +514,7 @@ final class Renderer implements PathConsumer2D, MarlinConst { Renderer(final RendererContext rdrCtx) { this.rdrCtx = rdrCtx; - this.edges = new OffHeapArray(rdrCtx, INITIAL_EDGES_CAPACITY); // 96K + this.edges = new OffHeapArray(rdrCtx.cleanerObj, INITIAL_EDGES_CAPACITY); // 96K this.curve = rdrCtx.curve; diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/RendererContext.java b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/RendererContext.java index a767651f5d5..f9524c88870 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/RendererContext.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/RendererContext.java @@ -68,6 +68,8 @@ final class RendererContext implements MarlinConst { * @see MarlinRenderingEngine#REF_TYPE */ final Object reference; + // Smallest object used as Cleaner's parent reference + final Object cleanerObj = new Object(); // dirty flag indicating an exception occured during pipeline in pathTo() boolean dirty = false; // dynamic array caches kept using weak reference (low memory footprint) @@ -187,10 +189,10 @@ final class RendererContext implements MarlinConst { if (USE_CACHE_HARD_REF) { // update hard reference: hardRefArrayCaches = holder; + } else { + // update weak reference: + refArrayCaches = new WeakReference(holder); } - - // update weak reference: - refArrayCaches = new WeakReference(holder); } } return holder; diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Stroker.java b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Stroker.java index 1aa48411f04..2946eda28f0 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Stroker.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Stroker.java @@ -87,6 +87,7 @@ final class Stroker implements PathConsumer2D, MarlinConst { private int joinStyle; private float lineWidth2; + private float invHalfLineWidth2Sq; private final float[] offset0 = new float[2]; private final float[] offset1 = new float[2]; @@ -158,6 +159,7 @@ final class Stroker implements PathConsumer2D, MarlinConst { this.out = pc2d; this.lineWidth2 = lineWidth / 2f; + this.invHalfLineWidth2Sq = 1f / (2f * lineWidth2 * lineWidth2); this.capStyle = capStyle; this.joinStyle = joinStyle; @@ -252,11 +254,11 @@ final class Stroker implements PathConsumer2D, MarlinConst { // The sign of the dot product of mx,my and omx,omy is equal to the // the sign of the cosine of ext // (ext is the angle between omx,omy and mx,my). - double cosext = omx * mx + omy * my; + final float cosext = omx * mx + omy * my; // If it is >=0, we know that abs(ext) is <= 90 degrees, so we only // need 1 curve to approximate the circle section that joins omx,omy // and mx,my. - final int numCurves = cosext >= 0 ? 1 : 2; + final int numCurves = (cosext >= 0f) ? 1 : 2; switch (numCurves) { case 1: @@ -302,14 +304,22 @@ final class Stroker implements PathConsumer2D, MarlinConst { final float mx, final float my, boolean rev) { - float cosext2 = (omx * mx + omy * my) / (2f * lineWidth2 * lineWidth2); + final float cosext2 = (omx * mx + omy * my) * invHalfLineWidth2Sq; + + // check round off errors producing cos(ext) > 1 and a NaN below + // cos(ext) == 1 implies colinear segments and an empty join anyway + if (cosext2 >= 0.5f) { + // just return to avoid generating a flat curve: + return; + } + // cv is the length of P1-P0 and P2-P3 divided by the radius of the arc // (so, cv assumes the arc has radius 1). P0, P1, P2, P3 are the points that // define the bezier curve we're computing. // It is computed using the constraints that P1-P0 and P3-P2 are parallel // to the arc tangents at the endpoints, and that |P1-P0|=|P3-P2|. - float cv = (float) ((4.0 / 3.0) * sqrt(0.5-cosext2) / - (1.0 + sqrt(cosext2+0.5))); + float cv = (float) ((4.0 / 3.0) * sqrt(0.5 - cosext2) / + (1.0 + sqrt(cosext2 + 0.5))); // if clockwise, we need to negate cv. if (rev) { // rev is equivalent to isCW(omx, omy, mx, my) cv = -cv; diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Version.java b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Version.java index 16f719a0cbf..94b0e2f1e59 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Version.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Version.java @@ -27,7 +27,7 @@ package sun.java2d.marlin; public final class Version { - private static final String version = "marlin-0.7.2-Unsafe-OpenJDK"; + private static final String version = "marlin-0.7.3-Unsafe-OpenJDK"; public static String getVersion() { return version; diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLUtilities.java b/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLUtilities.java index 02f9b4cef29..601658b11f5 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLUtilities.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLUtilities.java @@ -81,7 +81,7 @@ class OGLUtilities { * * In order to avoid deadlock, it is important that the given Runnable * does not attempt to acquire the AWT lock, as that will be handled - * automatically as part of the rq.flushAndInvokeNow() step. + * automatically as part of the {@code rq.flushAndInvokeNow()} step. * * @param g the Graphics object for the corresponding destination surface; * if null, the step making a context current to the destination surface @@ -134,7 +134,7 @@ class OGLUtilities { * * In order to avoid deadlock, it is important that the given Runnable * does not attempt to acquire the AWT lock, as that will be handled - * automatically as part of the rq.flushAndInvokeNow() step. + * automatically as part of the {@code rq.flushAndInvokeNow()} step. * * @param config the GraphicsConfiguration object whose "shared" * context will be made current during this operation; if this value is @@ -297,7 +297,7 @@ class OGLUtilities { * @return a constant that describes the surface associated with the * given Graphics object; if the given Graphics object is invalid (i.e. * is not associated with an OpenGL surface) this method will return - * OGLUtilities.UNDEFINED + * {@code OGLUtilities.UNDEFINED} */ public static int getOGLSurfaceType(Graphics g) { if (!(g instanceof SunGraphics2D)) { diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/DrawImage.java b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/DrawImage.java index a7e181e9d2a..728a5823e4d 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/DrawImage.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/DrawImage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, 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 @@ -955,6 +955,12 @@ public class DrawImage implements DrawImagePipe { comp = CompositeType.SrcNoEa; } + if (srcData == dstData && sx == dx && sy == dy + && CompositeType.SrcNoEa.equals(comp)) { + // Performance optimization. We skip the Blit/BlitBG if we know that + // it will be noop. + return; + } if (!isBgOperation(srcData, bgColor)) { Blit blit = Blit.getFromCache(srcType, comp, dstType); blit.Blit(srcData, dstData, sg.composite, clipRegion, diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/Region.java b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/Region.java index 723fdaaf97e..95a7aa46674 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/Region.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/Region.java @@ -104,11 +104,11 @@ public class Region { } /** - * Adds the dimension dim to the coordinate - * start with appropriate clipping. If - * dim is non-positive then the method returns + * Adds the dimension {@code dim} to the coordinate + * {@code start} with appropriate clipping. If + * {@code dim} is non-positive then the method returns * the start coordinate. If the sum overflows an integer - * data type then the method returns Integer.MAX_VALUE. + * data type then the method returns {@code Integer.MAX_VALUE}. */ public static int dimAdd(int start, int dim) { if (dim <= 0) return start; @@ -179,9 +179,9 @@ public class Region { * * @param s a non-null Shape object specifying the geometry enclosing * the pixels of interest - * @param at an optional AffineTransform to be applied to the + * @param at an optional {@code AffineTransform} to be applied to the * coordinates as they are returned in the iteration, or - * null if untransformed coordinates are desired + * {@code null} if untransformed coordinates are desired */ public static Region getInstance(Shape s, AffineTransform at) { return getInstance(WHOLE_REGION, false, s, at); @@ -205,9 +205,9 @@ public class Region { * clip the geometry to * @param s a non-null Shape object specifying the geometry enclosing * the pixels of interest - * @param at an optional AffineTransform to be applied to the + * @param at an optional {@code AffineTransform} to be applied to the * coordinates as they are returned in the iteration, or - * null if untransformed coordinates are desired + * {@code null} if untransformed coordinates are desired */ public static Region getInstance(Region devBounds, Shape s, AffineTransform at) @@ -238,9 +238,9 @@ public class Region { * normalization * @param s a non-null Shape object specifying the geometry enclosing * the pixels of interest - * @param at an optional AffineTransform to be applied to the + * @param at an optional {@code AffineTransform} to be applied to the * coordinates as they are returned in the iteration, or - * null if untransformed coordinates are desired + * {@code null} if untransformed coordinates are desired */ public static Region getInstance(Region devBounds, boolean normalize, Shape s, AffineTransform at) @@ -363,7 +363,7 @@ public class Region { * Sets the rectangle of interest for storing and returning * region bands. The rectangle is specified in x, y, width, height * format and appropriate clipping is performed as per the method - * dimAdd. + * {@code dimAdd}. *

          * This method can also be used to initialize a simple rectangular * region. @@ -637,7 +637,7 @@ public class Region { * object with the specified Region object. *

          * If {@code A} and {@code B} are both Region Objects and - * C = A.getIntersection(B); then a point will + * {@code C = A.getIntersection(B);} then a point will * be contained in {@code C} iff it is contained in both * {@code A} and {@code B}. *

          @@ -666,7 +666,7 @@ public class Region { * object with the specified Region object. *

          * If {@code A} and {@code B} are both Region Objects and - * C = A.getUnion(B); then a point will + * {@code C = A.getUnion(B);} then a point will * be contained in {@code C} iff it is contained in either * {@code A} or {@code B}. *

          @@ -693,7 +693,7 @@ public class Region { * specified Region object subtracted from this object. *

          * If {@code A} and {@code B} are both Region Objects and - * C = A.getDifference(B); then a point will + * {@code C = A.getDifference(B);} then a point will * be contained in {@code C} iff it is contained in * {@code A} but not contained in {@code B}. *

          @@ -717,7 +717,7 @@ public class Region { * object with the specified Region object. *

          * If {@code A} and {@code B} are both Region Objects and - * C = A.getExclusiveOr(B); then a point will + * {@code C = A.getExclusiveOr(B);} then a point will * be contained in {@code C} iff it is contained in either * {@code A} or {@code B}, but not if it is contained in both. *

          diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/RenderQueue.java b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/RenderQueue.java index f9dc262f17c..d33db33ec5c 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/RenderQueue.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/RenderQueue.java @@ -115,7 +115,7 @@ public abstract class RenderQueue { /** * Attempts to lock the queue. If successful, this method returns true, * indicating that the caller is responsible for calling - * unlock; otherwise this method returns false. + * {@code unlock}; otherwise this method returns false. */ public final boolean tryLock() { return SunToolkit.awtTryLock(); diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Dasher.java b/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Dasher.java index 386e4ea4377..c7855d6b9e9 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Dasher.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Dasher.java @@ -28,9 +28,9 @@ package sun.java2d.pisces; import sun.awt.geom.PathConsumer2D; /** - * The Dasher class takes a series of linear commands - * (moveTo, lineTo, close and - * end) and breaks them into smaller segments according to a + * The {@code Dasher} class takes a series of linear commands + * ({@code moveTo}, {@code lineTo}, {@code close} and + * {@code end}) and breaks them into smaller segments according to a * dash pattern array and a starting dash phase. * *

          Issues: in J2Se, a zero length dash segment as drawn as a very @@ -60,11 +60,11 @@ final class Dasher implements sun.awt.geom.PathConsumer2D { private float[] curCurvepts; /** - * Constructs a Dasher. + * Constructs a {@code Dasher}. * - * @param out an output PathConsumer2D. - * @param dash an array of floats containing the dash pattern - * @param phase a float containing the dash phase + * @param out an output {@code PathConsumer2D}. + * @param dash an array of {@code float}s containing the dash pattern + * @param phase a {@code float} containing the dash phase */ public Dasher(PathConsumer2D out, float[] dash, float phase) { if (phase < 0) { diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Helpers.java b/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Helpers.java index 38a7fc2baf6..592348c0043 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Helpers.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Helpers.java @@ -239,18 +239,18 @@ final class Helpers { // QuadCurve2D don't provide them. /** * Subdivides the cubic curve specified by the coordinates - * stored in the src array at indices srcoff - * through (srcoff + 7) and stores the + * stored in the {@code src} array at indices {@code srcoff} + * through ({@code srcoff} + 7) and stores the * resulting two subdivided curves into the two result arrays at the * corresponding indices. - * Either or both of the left and right - * arrays may be null or a reference to the same array - * as the src array. + * Either or both of the {@code left} and {@code right} + * arrays may be {@code null} or a reference to the same array + * as the {@code src} array. * Note that the last point in the first subdivided curve is the * same as the first point in the second subdivided curve. Thus, - * it is possible to pass the same array for left - * and right and to use offsets, such as rightoff - * equals (leftoff + 6), in order + * it is possible to pass the same array for {@code left} + * and {@code right} and to use offsets, such as {@code rightoff} + * equals ({@code leftoff} + 6), in order * to avoid allocating extra storage for this common point. * @param src the array holding the coordinates for the source curve * @param srcoff the offset into the array of the beginning of the diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Stroker.java b/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Stroker.java index 6d4a4c75ac5..4480286fae8 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Stroker.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Stroker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2015, 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 @@ -99,16 +99,16 @@ final class Stroker implements PathConsumer2D { private final PolyStack reverse = new PolyStack(); /** - * Constructs a Stroker. + * Constructs a {@code Stroker}. * - * @param pc2d an output PathConsumer2D. + * @param pc2d an output {@code PathConsumer2D}. * @param lineWidth the desired line width in pixels * @param capStyle the desired end cap style, one of - * CAP_BUTT, CAP_ROUND or - * CAP_SQUARE. + * {@code CAP_BUTT}, {@code CAP_ROUND} or + * {@code CAP_SQUARE}. * @param joinStyle the desired line join style, one of - * JOIN_MITER, JOIN_ROUND or - * JOIN_BEVEL. + * {@code JOIN_MITER}, {@code JOIN_ROUND} or + * {@code JOIN_BEVEL}. * @param miterLimit the desired miter limit */ public Stroker(PathConsumer2D pc2d, @@ -193,11 +193,11 @@ final class Stroker implements PathConsumer2D { // The sign of the dot product of mx,my and omx,omy is equal to the // the sign of the cosine of ext // (ext is the angle between omx,omy and mx,my). - double cosext = omx * mx + omy * my; + final float cosext = omx * mx + omy * my; // If it is >=0, we know that abs(ext) is <= 90 degrees, so we only // need 1 curve to approximate the circle section that joins omx,omy // and mx,my. - final int numCurves = cosext >= 0 ? 1 : 2; + final int numCurves = (cosext >= 0f) ? 1 : 2; switch (numCurves) { case 1: @@ -242,14 +242,22 @@ final class Stroker implements PathConsumer2D { final float mx, final float my, boolean rev) { - float cosext2 = (omx * mx + omy * my) / (2 * lineWidth2 * lineWidth2); + final float cosext2 = (omx * mx + omy * my) / (2f * lineWidth2 * lineWidth2); + + // check round off errors producing cos(ext) > 1 and a NaN below + // cos(ext) == 1 implies colinear segments and an empty join anyway + if (cosext2 >= 0.5f) { + // just return to avoid generating a flat curve: + return; + } + // cv is the length of P1-P0 and P2-P3 divided by the radius of the arc // (so, cv assumes the arc has radius 1). P0, P1, P2, P3 are the points that // define the bezier curve we're computing. // It is computed using the constraints that P1-P0 and P3-P2 are parallel // to the arc tangents at the endpoints, and that |P1-P0|=|P3-P2|. - float cv = (float) ((4.0 / 3.0) * sqrt(0.5-cosext2) / - (1.0 + sqrt(cosext2+0.5))); + float cv = (float) ((4.0 / 3.0) * sqrt(0.5 - cosext2) / + (1.0 + sqrt(cosext2 + 0.5))); // if clockwise, we need to negate cv. if (rev) { // rev is equivalent to isCW(omx, omy, mx, my) cv = -cv; diff --git a/jdk/src/java.desktop/share/classes/sun/print/DialogOwner.java b/jdk/src/java.desktop/share/classes/sun/print/DialogOwner.java index a08c06bac58..3b29183e2f4 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/DialogOwner.java +++ b/jdk/src/java.desktop/share/classes/sun/print/DialogOwner.java @@ -82,7 +82,7 @@ public final class DialogOwner * instance. *

          * For class DialogOwner the category name is - * "dialog-owner". + * {@code "dialog-owner"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/sun/print/PSPathGraphics.java b/jdk/src/java.desktop/share/classes/sun/print/PSPathGraphics.java index 1b00d4b7851..2e4bea56f55 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/PSPathGraphics.java +++ b/jdk/src/java.desktop/share/classes/sun/print/PSPathGraphics.java @@ -72,8 +72,8 @@ class PSPathGraphics extends PathGraphics { } /** - * Creates a new Graphics object that is - * a copy of this Graphics object. + * Creates a new {@code Graphics} object that is + * a copy of this {@code Graphics} object. * @return a new graphics context that is a copy of * this graphics context. * @since 1.0 @@ -115,19 +115,19 @@ class PSPathGraphics extends PathGraphics { } /** - * Renders the text specified by the specified String, - * using the current Font and Paint attributes - * in the Graphics2D context. + * Renders the text specified by the specified {@code String}, + * using the current {@code Font} and {@code Paint} attributes + * in the {@code Graphics2D} context. * The baseline of the first character is at position * (xy) in the User Space. - * The rendering attributes applied include the Clip, - * Transform, Paint, Font and - * Composite attributes. For characters in script systems + * The rendering attributes applied include the {@code Clip}, + * {@code Transform}, {@code Paint}, {@code Font} and + * {@code Composite} attributes. For characters in script systems * such as Hebrew and Arabic, the glyphs can be rendered from right to * left, in which case the coordinate supplied is the location of the * leftmost character on the baseline. - * @param str the String to be rendered - * @param x, y the coordinates where the String + * @param str the {@code String} to be rendered + * @param x, y the coordinates where the {@code String} * should be rendered * @see #setPaint * @see java.awt.Graphics#setColor @@ -248,16 +248,16 @@ class PSPathGraphics extends PathGraphics { } /** - * The various drawImage() methods for - * WPathGraphics are all decomposed - * into an invocation of drawImageToPlatform. + * The various {@code drawImage()} methods for + * {@code WPathGraphics} are all decomposed + * into an invocation of {@code drawImageToPlatform}. * The portion of the passed in image defined by - * srcX, srcY, srcWidth, and srcHeight + * {@code srcX, srcY, srcWidth, and srcHeight} * is transformed by the supplied AffineTransform and * drawn using PS to the printer context. * * @param image The image to be drawn. - * This method does nothing if img is null. + * This method does nothing if {@code img} is null. * @param xform Used to transform the image before drawing. * This can be null. * @param bgcolor This color is drawn where the image has transparent @@ -730,7 +730,7 @@ class PSPathGraphics extends PathGraphics { /* - * Fill the path defined by pathIter + * Fill the path defined by {@code pathIter} * with the specified color. * The path is provided in current user space. */ diff --git a/jdk/src/java.desktop/share/classes/sun/print/PSPrinterJob.java b/jdk/src/java.desktop/share/classes/sun/print/PSPrinterJob.java index ad30841d0a7..b22fe72880d 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/PSPrinterJob.java +++ b/jdk/src/java.desktop/share/classes/sun/print/PSPrinterJob.java @@ -116,14 +116,14 @@ public class PSPrinterJob extends RasterPrinterJob { /* Class Constants */ /** - * Passed to the setFillMode + * Passed to the {@code setFillMode} * method this value forces fills to be * done using the even-odd fill rule. */ protected static final int FILL_EVEN_ODD = 1; /** - * Passed to the setFillMode + * Passed to the {@code setFillMode} * method this value forces fills to be * done using the non-zero winding rule. */ @@ -294,14 +294,14 @@ public class PSPrinterJob extends RasterPrinterJob { /** * This string holds the PostScript operator to * be used to fill a path. It can be changed - * by the setFillMode method. + * by the {@code setFillMode} method. */ private String mFillOpStr = WINDING_FILL_STR; /** * This string holds the PostScript operator to * be used to clip to a path. It can be changed - * by the setFillMode method. + * by the {@code setFillMode} method. */ private String mClipOpStr = WINDING_CLIP_STR; @@ -876,14 +876,14 @@ public class PSPrinterJob extends RasterPrinterJob { /** * Convert the 24 bit BGR image buffer represented by - * image to PostScript. The image is drawn at - * (destX, destY) in device coordinates. + * {@code image} to PostScript. The image is drawn at + * {@code (destX, destY)} in device coordinates. * The image is scaled into a square of size - * specified by destWidth and - * destHeight. The portion of the + * specified by {@code destWidth} and + * {@code destHeight}. The portion of the * source image copied into that square is specified - * by srcX, srcY, - * srcWidth, and srcHeight. + * by {@code srcX}, {@code srcY}, + * {@code srcWidth}, and srcHeight. */ protected void drawImageBGR(byte[] bgrData, float destX, float destY, @@ -1026,14 +1026,14 @@ public class PSPrinterJob extends RasterPrinterJob { /** * Examine the metrics captured by the - * PeekGraphics instance and + * {@code PeekGraphics} instance and * if capable of directly converting this * print job to the printer's control language * or the native OS's graphics primitives, then - * return a PSPathGraphics to perform + * return a {@code PSPathGraphics} to perform * that conversion. If there is not an object * capable of the conversion then return - * null. Returning null + * {@code null}. Returning {@code null} * causes the print job to be rasterized. */ @@ -1349,8 +1349,8 @@ public class PSPrinterJob extends RasterPrinterJob { } /** * Set the current path rule to be either - * FILL_EVEN_ODD (using the - * even-odd file rule) or FILL_WINDING + * {@code FILL_EVEN_ODD} (using the + * even-odd file rule) or {@code FILL_WINDING} * (using the non-zero winding rule.) */ protected void setFillMode(int fillRule) { @@ -1375,7 +1375,7 @@ public class PSPrinterJob extends RasterPrinterJob { /** * Set the printer's current color to be that - * defined by color + * defined by {@code color} */ protected void setColor(Color color) { mLastColor = color; @@ -1418,7 +1418,7 @@ public class PSPrinterJob extends RasterPrinterJob { /** * Generate PostScript to move the current pen - * position to (x, y). + * position to {@code (x, y)}. */ protected void moveTo(float x, float y) { @@ -1437,7 +1437,7 @@ public class PSPrinterJob extends RasterPrinterJob { } /** * Generate PostScript to draw a line from the - * current pen position to (x, y). + * current pen position to {@code (x, y)}. */ protected void lineTo(float x, float y) { @@ -1861,7 +1861,7 @@ public class PSPrinterJob extends RasterPrinterJob { } /** - * Given a Java2D PathIterator instance, + * Given a Java2D {@code PathIterator} instance, * this method translates that into a PostScript path.. */ void convertToPSPath(PathIterator pathIter) { @@ -1926,7 +1926,7 @@ public class PSPrinterJob extends RasterPrinterJob { } /* - * Fill the path defined by pathIter + * Fill the path defined by {@code pathIter} * with the specified color. * The path is provided in current user space. */ diff --git a/jdk/src/java.desktop/share/classes/sun/print/PathGraphics.java b/jdk/src/java.desktop/share/classes/sun/print/PathGraphics.java index 467ed39fe9d..c36f8cb9f78 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/PathGraphics.java +++ b/jdk/src/java.desktop/share/classes/sun/print/PathGraphics.java @@ -177,9 +177,9 @@ public abstract class PathGraphics extends ProxyGraphics2D { /** * Draws the outline of the specified rectangle. * The left and right edges of the rectangle are at - * x and x + width. + * {@code x} and x + width. * The top and bottom edges are at - * y and y + height. + * {@code y} and y + height. * The rectangle is drawn using the graphics context's current color. * @param x the x coordinate * of the rectangle to be drawn. @@ -211,12 +211,12 @@ public abstract class PathGraphics extends ProxyGraphics2D { /** * Fills the specified rectangle. * The left and right edges of the rectangle are at - * x and x + width - 1. + * {@code x} and x + width - 1. * The top and bottom edges are at - * y and y + height - 1. + * {@code y} and y + height - 1. * The resulting rectangle covers an area - * width pixels wide by - * height pixels tall. + * {@code width} pixels wide by + * {@code height} pixels tall. * The rectangle is filled using the graphics context's current color. * @param x the x coordinate * of the rectangle to be filled. @@ -251,7 +251,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { *

          * Beginning with Java 1.1, the background color * of offscreen images may be system dependent. Applications should - * use setColor followed by fillRect to + * use {@code setColor} followed by {@code fillRect} to * ensure that an offscreen image is cleared to a specific color. * @param x the x coordinate of the rectangle to clear. * @param y the y coordinate of the rectangle to clear. @@ -271,9 +271,9 @@ public abstract class PathGraphics extends ProxyGraphics2D { /** * Draws an outlined round-cornered rectangle using this graphics * context's current color. The left and right edges of the rectangle - * are at x and x + width, + * are at {@code x} and x + width, * respectively. The top and bottom edges of the rectangle are at - * y and y + height. + * {@code y} and y + height. * @param x the x coordinate of the rectangle to be drawn. * @param y the y coordinate of the rectangle to be drawn. * @param width the width of the rectangle to be drawn. @@ -296,9 +296,9 @@ public abstract class PathGraphics extends ProxyGraphics2D { /** * Fills the specified rounded corner rectangle with the current color. * The left and right edges of the rectangle - * are at x and x + width - 1, + * are at {@code x} and x + width - 1, * respectively. The top and bottom edges of the rectangle are at - * y and y + height - 1. + * {@code y} and y + height - 1. * @param x the x coordinate of the rectangle to be filled. * @param y the y coordinate of the rectangle to be filled. * @param width the width of the rectangle to be filled. @@ -320,8 +320,8 @@ public abstract class PathGraphics extends ProxyGraphics2D { /** * Draws the outline of an oval. * The result is a circle or ellipse that fits within the - * rectangle specified by the x, y, - * width, and height arguments. + * rectangle specified by the {@code x}, {@code y}, + * {@code width}, and {@code height} arguments. *

          * The oval covers an area that is * width + 1 pixels wide @@ -359,8 +359,8 @@ public abstract class PathGraphics extends ProxyGraphics2D { * Draws the outline of a circular or elliptical arc * covering the specified rectangle. *

          - * The resulting arc begins at startAngle and extends - * for arcAngle degrees, using the current color. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees, using the current color. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -368,7 +368,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { *

          * The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

          * The resulting arc covers an area * width + 1 pixels wide @@ -403,8 +403,8 @@ public abstract class PathGraphics extends ProxyGraphics2D { /** * Fills a circular or elliptical arc covering the specified rectangle. *

          - * The resulting arc begins at startAngle and extends - * for arcAngle degrees. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -412,7 +412,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { *

          * The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

          * The resulting arc covers an area * width + 1 pixels wide @@ -478,16 +478,16 @@ public abstract class PathGraphics extends ProxyGraphics2D { * arrays of x and y coordinates. * Each pair of (xy) coordinates defines a point. *

          - * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#fillPolygon * @see java.awt.Graphics#drawPolyline @@ -500,7 +500,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { /** * Draws the outline of a polygon defined by the specified - * Polygon object. + * {@code Polygon} object. * @param p the polygon to draw. * @see java.awt.Graphics#fillPolygon * @see java.awt.Graphics#drawPolyline @@ -513,19 +513,19 @@ public abstract class PathGraphics extends ProxyGraphics2D { * Fills a closed polygon defined by * arrays of x and y coordinates. *

          - * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. *

          * The area inside the polygon is defined using an * even-odd fill rule, also known as the alternating rule. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#drawPolygon(int[], int[], int) */ @@ -1089,7 +1089,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { } /** - * Fill the path defined by pathIter + * Fill the path defined by {@code pathIter} * with the specified color. * The path is provided in device coordinates. */ @@ -1097,7 +1097,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { /* * Set the clipping path to that defined by - * the passed in PathIterator. + * the passed in {@code PathIterator}. */ protected abstract void deviceClip(PathIterator pathIter); @@ -1326,16 +1326,16 @@ public abstract class PathGraphics extends ProxyGraphics2D { /** - * The various drawImage() methods for - * PathGraphics are all decomposed - * into an invocation of drawImageToPlatform. + * The various {@code drawImage()} methods for + * {@code PathGraphics} are all decomposed + * into an invocation of {@code drawImageToPlatform}. * The portion of the passed in image defined by - * srcX, srcY, srcWidth, and srcHeight + * {@code srcX, srcY, srcWidth, and srcHeight} * is transformed by the supplied AffineTransform and * drawn using PS to the printer context. * * @param img The image to be drawn. - * This method does nothing if img is null. + * This method does nothing if {@code img} is null. * @param xform Used to transform the image before drawing. * This can be null. * @param bgcolor This color is drawn where the image has transparent @@ -1373,7 +1373,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { * and converted for the current output device. *

          * If the image has not yet been completely loaded, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. * @param img the specified image to be drawn. @@ -1405,9 +1405,9 @@ public abstract class PathGraphics extends ProxyGraphics2D { * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies - * the image observer by calling its imageUpdate method. + * the image observer by calling its {@code imageUpdate} method. *

          * A scaled version of an image will not necessarily be * available immediately just because an unscaled version of the @@ -1450,11 +1450,11 @@ public abstract class PathGraphics extends ProxyGraphics2D { * and converted for the current output device. *

          * If the image has not yet been completely loaded, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. * @param img the specified image to be drawn. - * This method does nothing if img is null. + * This method does nothing if {@code img} is null. * @param x the x coordinate. * @param y the y coordinate. * @param bgcolor the background color to paint under the @@ -1507,7 +1507,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1517,7 +1517,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { * the image may be cached separately and generated from the original * data in a separate image production sequence. * @param img the specified image to be drawn. - * This method does nothing if img is null. + * This method does nothing if {@code img} is null. * @param x the x coordinate. * @param y the y coordinate. * @param width the width of the rectangle. @@ -1566,7 +1566,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1628,7 +1628,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1642,7 +1642,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { * mapped to the second destination coordinate. The subimage is * scaled and flipped as needed to preserve those mappings. * @param img the specified image to be drawn - * This method does nothing if img is null. + * This method does nothing if {@code img} is null. * @param dx1 the x coordinate of the first corner of the * destination rectangle. * @param dy1 the y coordinate of the first corner of the @@ -1767,7 +1767,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { * and composite attributes. Note that the result is * undefined, if the given transform is noninvertible. * @param img The image to be drawn. - * This method does nothing if img is null. + * This method does nothing if {@code img} is null. * @param xform The transformation from image space into user space. * @param obs The image observer to be notified as more of the image * is converted. @@ -1809,7 +1809,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { * * @param op The filter to be applied to the image before drawing. * @param img The BufferedImage to be drawn. - * This method does nothing if img is null. + * This method does nothing if {@code img} is null. * @param x,y The location in user space where the image should be drawn. * @see #transform * @see #setTransform @@ -1853,7 +1853,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { * and composite attributes. Note that the result is * undefined, if the given transform is noninvertible. * @param img The image to be drawn. - * This method does nothing if img is null. + * This method does nothing if {@code img} is null. * @param xform The transformation from image space into user space. * @see #transform * @see #setTransform diff --git a/jdk/src/java.desktop/share/classes/sun/print/PeekGraphics.java b/jdk/src/java.desktop/share/classes/sun/print/PeekGraphics.java index 0e33bf191eb..b76321d84a3 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/PeekGraphics.java +++ b/jdk/src/java.desktop/share/classes/sun/print/PeekGraphics.java @@ -162,8 +162,8 @@ public class PeekGraphics extends Graphics2D /* The Delegated Graphics Methods */ /** - * Creates a new Graphics object that is - * a copy of this Graphics object. + * Creates a new {@code Graphics} object that is + * a copy of this {@code Graphics} object. * @return a new graphics context that is a copy of * this graphics context. * @since 1.0 @@ -444,7 +444,7 @@ public class PeekGraphics extends Graphics2D /** * Gets the current clipping area. - * @return a Shape object representing the + * @return a {@code Shape} object representing the * current clipping area. * @see java.awt.Graphics#getClipBounds * @see java.awt.Graphics#clipRect @@ -459,12 +459,12 @@ public class PeekGraphics extends Graphics2D /** * Sets the current clipping area to an arbitrary clip shape. - * Not all objects which implement the Shape + * Not all objects which implement the {@code Shape} * interface can be used to set the clip. The only - * Shape objects which are guaranteed to be - * supported are Shape objects which are - * obtained via the getClip method and via - * Rectangle objects. + * {@code Shape} objects which are guaranteed to be + * supported are {@code Shape} objects which are + * obtained via the {@code getClip} method and via + * {@code Rectangle} objects. * @see java.awt.Graphics#getClip() * @see java.awt.Graphics#clipRect * @see java.awt.Graphics#setClip(int, int, int, int) @@ -477,16 +477,16 @@ public class PeekGraphics extends Graphics2D /** * Copies an area of the component by a distance specified by - * dx and dy. From the point specified - * by x and y, this method + * {@code dx} and {@code dy}. From the point specified + * by {@code x} and {@code y}, this method * copies downwards and to the right. To copy an area of the * component to the left or upwards, specify a negative value for - * dx or dy. + * {@code dx} or {@code dy}. * If a portion of the source rectangle lies outside the bounds * of the component, or is obscured by another window or component, - * copyArea will be unable to copy the associated + * {@code copyArea} will be unable to copy the associated * pixels. The area that is omitted can be refreshed by calling - * the component's paint method. + * the component's {@code paint} method. * @param x the x coordinate of the source rectangle. * @param y the y coordinate of the source rectangle. * @param width the width of the source rectangle. @@ -520,12 +520,12 @@ public class PeekGraphics extends Graphics2D /** * Fills the specified rectangle. * The left and right edges of the rectangle are at - * x and x + width - 1. + * {@code x} and x + width - 1. * The top and bottom edges are at - * y and y + height - 1. + * {@code y} and y + height - 1. * The resulting rectangle covers an area - * width pixels wide by - * height pixels tall. + * {@code width} pixels wide by + * {@code height} pixels tall. * The rectangle is filled using the graphics context's current color. * @param x the x coordinate * of the rectangle to be filled. @@ -551,7 +551,7 @@ public class PeekGraphics extends Graphics2D *

          * Beginning with Java 1.1, the background color * of offscreen images may be system dependent. Applications should - * use setColor followed by fillRect to + * use {@code setColor} followed by {@code fillRect} to * ensure that an offscreen image is cleared to a specific color. * @param x the x coordinate of the rectangle to clear. * @param y the y coordinate of the rectangle to clear. @@ -573,9 +573,9 @@ public class PeekGraphics extends Graphics2D /** * Draws an outlined round-cornered rectangle using this graphics * context's current color. The left and right edges of the rectangle - * are at x and x + width, + * are at {@code x} and x + width, * respectively. The top and bottom edges of the rectangle are at - * y and y + height. + * {@code y} and y + height. * @param x the x coordinate of the rectangle to be drawn. * @param y the y coordinate of the rectangle to be drawn. * @param width the width of the rectangle to be drawn. @@ -597,9 +597,9 @@ public class PeekGraphics extends Graphics2D /** * Fills the specified rounded corner rectangle with the current color. * The left and right edges of the rectangle - * are at x and x + width - 1, + * are at {@code x} and x + width - 1, * respectively. The top and bottom edges of the rectangle are at - * y and y + height - 1. + * {@code y} and y + height - 1. * @param x the x coordinate of the rectangle to be filled. * @param y the y coordinate of the rectangle to be filled. * @param width the width of the rectangle to be filled. @@ -621,8 +621,8 @@ public class PeekGraphics extends Graphics2D /** * Draws the outline of an oval. * The result is a circle or ellipse that fits within the - * rectangle specified by the x, y, - * width, and height arguments. + * rectangle specified by the {@code x}, {@code y}, + * {@code width}, and {@code height} arguments. *

          * The oval covers an area that is * width + 1 pixels wide @@ -665,8 +665,8 @@ public class PeekGraphics extends Graphics2D * Draws the outline of a circular or elliptical arc * covering the specified rectangle. *

          - * The resulting arc begins at startAngle and extends - * for arcAngle degrees, using the current color. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees, using the current color. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -674,7 +674,7 @@ public class PeekGraphics extends Graphics2D *

          * The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

          * The resulting arc covers an area * width + 1 pixels wide @@ -701,8 +701,8 @@ public class PeekGraphics extends Graphics2D /** * Fills a circular or elliptical arc covering the specified rectangle. *

          - * The resulting arc begins at startAngle and extends - * for arcAngle degrees. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -710,7 +710,7 @@ public class PeekGraphics extends Graphics2D *

          * The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

          * The resulting arc covers an area * width + 1 pixels wide @@ -767,16 +767,16 @@ public class PeekGraphics extends Graphics2D * arrays of x and y coordinates. * Each pair of (xy) coordinates defines a point. *

          - * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#fillPolygon * @see java.awt.Graphics#drawPolyline @@ -796,19 +796,19 @@ public class PeekGraphics extends Graphics2D * Fills a closed polygon defined by * arrays of x and y coordinates. *

          - * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. *

          * The area inside the polygon is defined using an * even-odd fill rule, also known as the alternating rule. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#drawPolygon(int[], int[], int) * @since 1.0 @@ -931,7 +931,7 @@ public class PeekGraphics extends Graphics2D * and converted for the current output device. *

          * If the image has not yet been completely loaded, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. * @param img the specified image to be drawn. @@ -976,9 +976,9 @@ public class PeekGraphics extends Graphics2D * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies - * the image observer by calling its imageUpdate method. + * the image observer by calling its {@code imageUpdate} method. *

          * A scaled version of an image will not necessarily be * available immediately just because an unscaled version of the @@ -1027,7 +1027,7 @@ public class PeekGraphics extends Graphics2D * and converted for the current output device. *

          * If the image has not yet been completely loaded, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. * @param img the specified image to be drawn. @@ -1078,7 +1078,7 @@ public class PeekGraphics extends Graphics2D * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1127,7 +1127,7 @@ public class PeekGraphics extends Graphics2D * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1199,7 +1199,7 @@ public class PeekGraphics extends Graphics2D * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1304,10 +1304,10 @@ public class PeekGraphics extends Graphics2D /** * Disposes of this graphics context and releases * any system resources that it is using. - * A Graphics object cannot be used after - * disposehas been called. + * A {@code Graphics} object cannot be used after + * {@code dispose} has been called. *

          - * When a Java program runs, a large number of Graphics + * When a Java program runs, a large number of {@code Graphics} * objects can be created within a short time frame. * Although the finalization process of the garbage collector * also disposes of the same system resources, it is preferable @@ -1316,12 +1316,12 @@ public class PeekGraphics extends Graphics2D * may not run to completion for a long period of time. *

          * Graphics objects which are provided as arguments to the - * paint and update methods + * {@code paint} and {@code update} methods * of components are automatically released by the system when * those methods return. For efficiency, programmers should - * call dispose when finished using - * a Graphics object only if it was created - * directly from a component or another Graphics object. + * call {@code dispose} when finished using + * a {@code Graphics} object only if it was created + * directly from a component or another {@code Graphics} object. * @see java.awt.Graphics#finalize * @see java.awt.Component#paint * @see java.awt.Component#update @@ -1735,7 +1735,7 @@ public class PeekGraphics extends Graphics2D } /** - * Return true if the Rectangle rect + * Return true if the Rectangle {@code rect} * intersects the area into which the application * has drawn. */ diff --git a/jdk/src/java.desktop/share/classes/sun/print/PeekMetrics.java b/jdk/src/java.desktop/share/classes/sun/print/PeekMetrics.java index 9b5aae6899d..7f023f30d1d 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/PeekMetrics.java +++ b/jdk/src/java.desktop/share/classes/sun/print/PeekMetrics.java @@ -52,9 +52,9 @@ public class PeekMetrics { private boolean mHasImages; /** - * Return true if the application + * Return {@code true} if the application * has done any drawing with a Paint that - * is not an instance of Color + * is not an instance of {@code Color} */ public boolean hasNonSolidColors() { return mHasNonSolidColors; @@ -119,7 +119,7 @@ public class PeekMetrics { /** * The application is drawing text - * defined by TextLayout + * defined by {@code TextLayout} * so record the needed information. */ public void drawText(Graphics2D g, TextLayout textLayout) { @@ -164,7 +164,7 @@ public class PeekMetrics { /** * Record information about drawing done - * with the supplied Paint. + * with the supplied {@code Paint}. */ private void checkPaint(Paint paint) { @@ -179,7 +179,7 @@ public class PeekMetrics { /** * Record information about drawing done - * with the supplied Composite. + * with the supplied {@code Composite}. */ private void checkAlpha(Composite composite) { diff --git a/jdk/src/java.desktop/share/classes/sun/print/PrintJob2D.java b/jdk/src/java.desktop/share/classes/sun/print/PrintJob2D.java index 9b7de159322..975e52ab86d 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/PrintJob2D.java +++ b/jdk/src/java.desktop/share/classes/sun/print/PrintJob2D.java @@ -928,23 +928,23 @@ public class PrintJob2D extends PrintJob implements Printable, Runnable { /** * Prints the page at the specified index into the specified * {@link Graphics} context in the specified - * format. A PrinterJob calls the - * Printable interface to request that a page be + * format. A {@code PrinterJob} calls the + * {@code Printable} interface to request that a page be * rendered into the context specified by - * graphics. The format of the page to be drawn is - * specified by pageFormat. The zero based index - * of the requested page is specified by pageIndex. + * {@code graphics}. The format of the page to be drawn is + * specified by {@code pageFormat}. The zero based index + * of the requested page is specified by {@code pageIndex}. * If the requested page does not exist then this method returns * NO_SUCH_PAGE; otherwise PAGE_EXISTS is returned. - * The Graphics class or subclass implements the + * The {@code Graphics} class or subclass implements the * {@link java.awt.PrintGraphics} interface to provide additional - * information. If the Printable object + * information. If the {@code Printable} object * aborts the print job then it throws a {@link PrinterException}. * @param graphics the context into which the page is drawn * @param pageFormat the size and orientation of the page being drawn * @param pageIndex the zero based index of the page to be drawn * @return PAGE_EXISTS if the page is rendered successfully - * or NO_SUCH_PAGE if pageIndex specifies a + * or NO_SUCH_PAGE if {@code pageIndex} specifies a * non-existent page. * @exception java.awt.print.PrinterException * thrown when the print job is terminated. diff --git a/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics.java b/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics.java index 9bb3bd254c1..eefb49ee75a 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics.java +++ b/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics.java @@ -63,8 +63,8 @@ public class ProxyGraphics extends Graphics { } /** - * Creates a new Graphics object that is - * a copy of this Graphics object. + * Creates a new {@code Graphics} object that is + * a copy of this {@code Graphics} object. * @return a new graphics context that is a copy of * this graphics context. */ @@ -73,28 +73,28 @@ public class ProxyGraphics extends Graphics { } /** - * Creates a new Graphics object based on this - * Graphics object, but with a new translation and clip area. - * The new Graphics object has its origin + * Creates a new {@code Graphics} object based on this + * {@code Graphics} object, but with a new translation and clip area. + * The new {@code Graphics} object has its origin * translated to the specified point (xy). * Its clip area is determined by the intersection of the original * clip area with the specified rectangle. The arguments are all * interpreted in the coordinate system of the original - * Graphics object. The new graphics context is + * {@code Graphics} object. The new graphics context is * identical to the original, except in two respects: *

          *

            *
          • * The new graphics context is translated by (xy). - * That is to say, the point (00) in the + * That is to say, the point ({@code 0}, {@code 0}) in the * new graphics context is the same as (xy) in * the original graphics context. *
          • * The new graphics context has an additional clipping rectangle, in * addition to whatever (translated) clipping rectangle it inherited * from the original graphics context. The origin of the new clipping - * rectangle is at (00), and its size - * is specified by the width and height + * rectangle is at ({@code 0}, {@code 0}), and its size + * is specified by the {@code width} and {@code height} * arguments. *
          *

          @@ -231,12 +231,12 @@ public class ProxyGraphics extends Graphics { * This method refers to the user clip, which is independent of the * clipping associated with device bounds and window visibility. * If no clip has previously been set, or if the clip has been - * cleared using setClip(null), this method returns - * null. + * cleared using {@code setClip(null)}, this method returns + * {@code null}. * The coordinates in the rectangle are relative to the coordinate * system origin of this graphics context. * @return the bounding rectangle of the current clipping area, - * or null if no clip is set. + * or {@code null} if no clip is set. * @see java.awt.Graphics#getClip * @see java.awt.Graphics#clipRect * @see java.awt.Graphics#setClip(int, int, int, int) @@ -252,7 +252,7 @@ public class ProxyGraphics extends Graphics { * The resulting clipping area is the intersection of the current * clipping area and the specified rectangle. If there is no * current clipping area, either because the clip has never been - * set, or the clip has been cleared using setClip(null), + * set, or the clip has been cleared using {@code setClip(null)}, * the specified rectangle becomes the new clip. * This method sets the user clip, which is independent of the * clipping associated with device bounds and window visibility. @@ -293,10 +293,10 @@ public class ProxyGraphics extends Graphics { * This method returns the user clip, which is independent of the * clipping associated with device bounds and window visibility. * If no clip has previously been set, or if the clip has been - * cleared using setClip(null), this method returns - * null. - * @return a Shape object representing the - * current clipping area, or null if + * cleared using {@code setClip(null)}, this method returns + * {@code null}. + * @return a {@code Shape} object representing the + * current clipping area, or {@code null} if * no clip is set. * @see java.awt.Graphics#getClipBounds * @see java.awt.Graphics#clipRect @@ -310,15 +310,15 @@ public class ProxyGraphics extends Graphics { /** * Sets the current clipping area to an arbitrary clip shape. - * Not all objects that implement the Shape + * Not all objects that implement the {@code Shape} * interface can be used to set the clip. The only - * Shape objects that are guaranteed to be - * supported are Shape objects that are - * obtained via the getClip method and via - * Rectangle objects. This method sets the + * {@code Shape} objects that are guaranteed to be + * supported are {@code Shape} objects that are + * obtained via the {@code getClip} method and via + * {@code Rectangle} objects. This method sets the * user clip, which is independent of the clipping associated * with device bounds and window visibility. - * @param clip the Shape to use to set the clip + * @param clip the {@code Shape} to use to set the clip * @see java.awt.Graphics#getClip() * @see java.awt.Graphics#clipRect * @see java.awt.Graphics#setClip(int, int, int, int) @@ -330,16 +330,16 @@ public class ProxyGraphics extends Graphics { /** * Copies an area of the component by a distance specified by - * dx and dy. From the point specified - * by x and y, this method + * {@code dx} and {@code dy}. From the point specified + * by {@code x} and {@code y}, this method * copies downwards and to the right. To copy an area of the * component to the left or upwards, specify a negative value for - * dx or dy. + * {@code dx} or {@code dy}. * If a portion of the source rectangle lies outside the bounds * of the component, or is obscured by another window or component, - * copyArea will be unable to copy the associated + * {@code copyArea} will be unable to copy the associated * pixels. The area that is omitted can be refreshed by calling - * the component's paint method. + * the component's {@code paint} method. * @param x the x coordinate of the source rectangle. * @param y the y coordinate of the source rectangle. * @param width the width of the source rectangle. @@ -368,12 +368,12 @@ public class ProxyGraphics extends Graphics { /** * Fills the specified rectangle. * The left and right edges of the rectangle are at - * x and x + width - 1. + * {@code x} and x + width - 1. * The top and bottom edges are at - * y and y + height - 1. + * {@code y} and y + height - 1. * The resulting rectangle covers an area - * width pixels wide by - * height pixels tall. + * {@code width} pixels wide by + * {@code height} pixels tall. * The rectangle is filled using the graphics context's current color. * @param x the x coordinate * of the rectangle to be filled. @@ -391,9 +391,9 @@ public class ProxyGraphics extends Graphics { /** * Draws the outline of the specified rectangle. * The left and right edges of the rectangle are at - * x and x + width. + * {@code x} and x + width. * The top and bottom edges are at - * y and y + height. + * {@code y} and y + height. * The rectangle is drawn using the graphics context's current color. * @param x the x coordinate * of the rectangle to be drawn. @@ -415,7 +415,7 @@ public class ProxyGraphics extends Graphics { *

          * Beginning with Java 1.1, the background color * of offscreen images may be system dependent. Applications should - * use setColor followed by fillRect to + * use {@code setColor} followed by {@code fillRect} to * ensure that an offscreen image is cleared to a specific color. * @param x the x coordinate of the rectangle to clear. * @param y the y coordinate of the rectangle to clear. @@ -434,9 +434,9 @@ public class ProxyGraphics extends Graphics { /** * Draws an outlined round-cornered rectangle using this graphics * context's current color. The left and right edges of the rectangle - * are at x and x + width, + * are at {@code x} and x + width, * respectively. The top and bottom edges of the rectangle are at - * y and y + height. + * {@code y} and y + height. * @param x the x coordinate of the rectangle to be drawn. * @param y the y coordinate of the rectangle to be drawn. * @param width the width of the rectangle to be drawn. @@ -455,9 +455,9 @@ public class ProxyGraphics extends Graphics { /** * Fills the specified rounded corner rectangle with the current color. * The left and right edges of the rectangle - * are at x and x + width - 1, + * are at {@code x} and x + width - 1, * respectively. The top and bottom edges of the rectangle are at - * y and y + height - 1. + * {@code y} and y + height - 1. * @param x the x coordinate of the rectangle to be filled. * @param y the y coordinate of the rectangle to be filled. * @param width the width of the rectangle to be filled. @@ -520,8 +520,8 @@ public class ProxyGraphics extends Graphics { /** * Draws the outline of an oval. * The result is a circle or ellipse that fits within the - * rectangle specified by the x, y, - * width, and height arguments. + * rectangle specified by the {@code x}, {@code y}, + * {@code width}, and {@code height} arguments. *

          * The oval covers an area that is * width + 1 pixels wide @@ -557,8 +557,8 @@ public class ProxyGraphics extends Graphics { * Draws the outline of a circular or elliptical arc * covering the specified rectangle. *

          - * The resulting arc begins at startAngle and extends - * for arcAngle degrees, using the current color. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees, using the current color. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -566,7 +566,7 @@ public class ProxyGraphics extends Graphics { *

          * The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

          * The resulting arc covers an area * width + 1 pixels wide @@ -598,8 +598,8 @@ public class ProxyGraphics extends Graphics { /** * Fills a circular or elliptical arc covering the specified rectangle. *

          - * The resulting arc begins at startAngle and extends - * for arcAngle degrees. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -607,7 +607,7 @@ public class ProxyGraphics extends Graphics { *

          * The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

          * The resulting arc covers an area * width + 1 pixels wide @@ -659,16 +659,16 @@ public class ProxyGraphics extends Graphics { * arrays of x and y coordinates. * Each pair of (xy) coordinates defines a point. *

          - * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#fillPolygon * @see java.awt.Graphics#drawPolyline @@ -680,7 +680,7 @@ public class ProxyGraphics extends Graphics { /** * Draws the outline of a polygon defined by the specified - * Polygon object. + * {@code Polygon} object. * @param p the polygon to draw. * @see java.awt.Graphics#fillPolygon * @see java.awt.Graphics#drawPolyline @@ -693,19 +693,19 @@ public class ProxyGraphics extends Graphics { * Fills a closed polygon defined by * arrays of x and y coordinates. *

          - * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. *

          * The area inside the polygon is defined using an * even-odd fill rule, also known as the alternating rule. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#drawPolygon(int[], int[], int) */ @@ -805,7 +805,7 @@ public class ProxyGraphics extends Graphics { * and converted for the current output device. *

          * If the image has not yet been completely loaded, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. * @param img the specified image to be drawn. @@ -835,9 +835,9 @@ public class ProxyGraphics extends Graphics { * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies - * the image observer by calling its imageUpdate method. + * the image observer by calling its {@code imageUpdate} method. *

          * A scaled version of an image will not necessarily be * available immediately just because an unscaled version of the @@ -877,7 +877,7 @@ public class ProxyGraphics extends Graphics { * and converted for the current output device. *

          * If the image has not yet been completely loaded, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. * @param img the specified image to be drawn. @@ -913,7 +913,7 @@ public class ProxyGraphics extends Graphics { * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -953,7 +953,7 @@ public class ProxyGraphics extends Graphics { * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1014,7 +1014,7 @@ public class ProxyGraphics extends Graphics { * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1068,10 +1068,10 @@ public class ProxyGraphics extends Graphics { /** * Disposes of this graphics context and releases * any system resources that it is using. - * A Graphics object cannot be used after - * disposehas been called. + * A {@code Graphics} object cannot be used after + * {@code dispose} has been called. *

          - * When a Java program runs, a large number of Graphics + * When a Java program runs, a large number of {@code Graphics} * objects can be created within a short time frame. * Although the finalization process of the garbage collector * also disposes of the same system resources, it is preferable @@ -1080,12 +1080,12 @@ public class ProxyGraphics extends Graphics { * may not run to completion for a long period of time. *

          * Graphics objects which are provided as arguments to the - * paint and update methods + * {@code paint} and {@code update} methods * of components are automatically released by the system when * those methods return. For efficiency, programmers should - * call dispose when finished using - * a Graphics object only if it was created - * directly from a component or another Graphics object. + * call {@code dispose} when finished using + * a {@code Graphics} object only if it was created + * directly from a component or another {@code Graphics} object. * @see java.awt.Graphics#finalize * @see java.awt.Component#paint * @see java.awt.Component#update @@ -1103,8 +1103,8 @@ public class ProxyGraphics extends Graphics { } /** - * Returns a String object representing this - * Graphics object's value. + * Returns a {@code String} object representing this + * {@code Graphics} object's value. * @return a string representation of this graphics context. */ public String toString() { @@ -1113,7 +1113,7 @@ public class ProxyGraphics extends Graphics { /** * @deprecated As of JDK version 1.1, - * replaced by getClipBounds(). + * replaced by {@code getClipBounds()}. */ @Deprecated public Rectangle getClipRect() { @@ -1144,8 +1144,8 @@ public class ProxyGraphics extends Graphics { * This method refers to the user clip, which is independent of the * clipping associated with device bounds and window visibility. * If no clip has previously been set, or if the clip has been - * cleared using setClip(null), this method returns the - * specified Rectangle. + * cleared using {@code setClip(null)}, this method returns the + * specified {@code Rectangle}. * @param r the rectangle where the current clipping area is * copied to. Any current values in this rectangle are * overwritten. diff --git a/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics2D.java b/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics2D.java index 57f8ec876b3..6ded8e98eab 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics2D.java +++ b/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics2D.java @@ -111,8 +111,8 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /* The Delegated Graphics Methods */ /** - * Creates a new Graphics object that is - * a copy of this Graphics object. + * Creates a new {@code Graphics} object that is + * a copy of this {@code Graphics} object. * @return a new graphics context that is a copy of * this graphics context. * @since 1.0 @@ -380,7 +380,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /** * Gets the current clipping area. - * @return a Shape object representing the + * @return a {@code Shape} object representing the * current clipping area. * @see java.awt.Graphics#getClipBounds * @see java.awt.Graphics#clipRect @@ -395,12 +395,12 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /** * Sets the current clipping area to an arbitrary clip shape. - * Not all objects which implement the Shape + * Not all objects which implement the {@code Shape} * interface can be used to set the clip. The only - * Shape objects which are guaranteed to be - * supported are Shape objects which are - * obtained via the getClip method and via - * Rectangle objects. + * {@code Shape} objects which are guaranteed to be + * supported are {@code Shape} objects which are + * obtained via the {@code getClip} method and via + * {@code Rectangle} objects. * @see java.awt.Graphics#getClip() * @see java.awt.Graphics#clipRect * @see java.awt.Graphics#setClip(int, int, int, int) @@ -413,16 +413,16 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /** * Copies an area of the component by a distance specified by - * dx and dy. From the point specified - * by x and y, this method + * {@code dx} and {@code dy}. From the point specified + * by {@code x} and {@code y}, this method * copies downwards and to the right. To copy an area of the * component to the left or upwards, specify a negative value for - * dx or dy. + * {@code dx} or {@code dy}. * If a portion of the source rectangle lies outside the bounds * of the component, or is obscured by another window or component, - * copyArea will be unable to copy the associated + * {@code copyArea} will be unable to copy the associated * pixels. The area that is omitted can be refreshed by calling - * the component's paint method. + * the component's {@code paint} method. * @param x the x coordinate of the source rectangle. * @param y the y coordinate of the source rectangle. * @param width the width of the source rectangle. @@ -454,12 +454,12 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /** * Fills the specified rectangle. * The left and right edges of the rectangle are at - * x and x + width - 1. + * {@code x} and x + width - 1. * The top and bottom edges are at - * y and y + height - 1. + * {@code y} and y + height - 1. * The resulting rectangle covers an area - * width pixels wide by - * height pixels tall. + * {@code width} pixels wide by + * {@code height} pixels tall. * The rectangle is filled using the graphics context's current color. * @param x the x coordinate * of the rectangle to be filled. @@ -482,7 +482,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { *

          * Beginning with Java 1.1, the background color * of offscreen images may be system dependent. Applications should - * use setColor followed by fillRect to + * use {@code setColor} followed by {@code fillRect} to * ensure that an offscreen image is cleared to a specific color. * @param x the x coordinate of the rectangle to clear. * @param y the y coordinate of the rectangle to clear. @@ -502,9 +502,9 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /** * Draws an outlined round-cornered rectangle using this graphics * context's current color. The left and right edges of the rectangle - * are at x and x + width, + * are at {@code x} and x + width, * respectively. The top and bottom edges of the rectangle are at - * y and y + height. + * {@code y} and y + height. * @param x the x coordinate of the rectangle to be drawn. * @param y the y coordinate of the rectangle to be drawn. * @param width the width of the rectangle to be drawn. @@ -524,9 +524,9 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /** * Fills the specified rounded corner rectangle with the current color. * The left and right edges of the rectangle - * are at x and x + width - 1, + * are at {@code x} and x + width - 1, * respectively. The top and bottom edges of the rectangle are at - * y and y + height - 1. + * {@code y} and y + height - 1. * @param x the x coordinate of the rectangle to be filled. * @param y the y coordinate of the rectangle to be filled. * @param width the width of the rectangle to be filled. @@ -546,8 +546,8 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /** * Draws the outline of an oval. * The result is a circle or ellipse that fits within the - * rectangle specified by the x, y, - * width, and height arguments. + * rectangle specified by the {@code x}, {@code y}, + * {@code width}, and {@code height} arguments. *

          * The oval covers an area that is * width + 1 pixels wide @@ -585,8 +585,8 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * Draws the outline of a circular or elliptical arc * covering the specified rectangle. *

          - * The resulting arc begins at startAngle and extends - * for arcAngle degrees, using the current color. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees, using the current color. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -594,7 +594,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { *

          * The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

          * The resulting arc covers an area * width + 1 pixels wide @@ -619,8 +619,8 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /** * Fills a circular or elliptical arc covering the specified rectangle. *

          - * The resulting arc begins at startAngle and extends - * for arcAngle degrees. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -628,7 +628,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { *

          * The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

          * The resulting arc covers an area * width + 1 pixels wide @@ -672,16 +672,16 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * arrays of x and y coordinates. * Each pair of (xy) coordinates defines a point. *

          - * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#fillPolygon * @see java.awt.Graphics#drawPolyline @@ -696,19 +696,19 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * Fills a closed polygon defined by * arrays of x and y coordinates. *

          - * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. *

          * The area inside the polygon is defined using an * even-odd fill rule, also known as the alternating rule. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#drawPolygon(int[], int[], int) * @since 1.0 @@ -796,7 +796,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * and converted for the current output device. *

          * If the image has not yet been completely loaded, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. * @param img the specified image to be drawn. @@ -828,9 +828,9 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies - * the image observer by calling its imageUpdate method. + * the image observer by calling its {@code imageUpdate} method. *

          * A scaled version of an image will not necessarily be * available immediately just because an unscaled version of the @@ -872,7 +872,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * and converted for the current output device. *

          * If the image has not yet been completely loaded, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. * @param img the specified image to be drawn. @@ -923,7 +923,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -978,7 +978,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1038,7 +1038,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1106,7 +1106,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { } /** - * Return true if drawing img will + * Return true if drawing {@code img} will * invoke a Java2D bug (#4258675). The bug in question * occurs when a draw image call with a background color * parameter tries to render a sheared @@ -1126,14 +1126,14 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { } /** - * Return a new BufferedImage + * Return a new {@code BufferedImage} * that contains a copy of the provided - * Image where its + * {@code Image} where its * transparent pixels have been replaced by - * bgcolor. If the new - * BufferedImage can not be created, + * {@code bgcolor}. If the new + * {@code BufferedImage} can not be created, * probably because the original image has not - * finished loading, then null is + * finished loading, then {@code null} is * returned. */ private BufferedImage getBufferedImageCopy(Image img, Color bgcolor) { @@ -1232,10 +1232,10 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /** * Disposes of this graphics context and releases * any system resources that it is using. - * A Graphics object cannot be used after - * disposehas been called. + * A {@code Graphics} object cannot be used after + * {@code dispose} has been called. *

          - * When a Java program runs, a large number of Graphics + * When a Java program runs, a large number of {@code Graphics} * objects can be created within a short time frame. * Although the finalization process of the garbage collector * also disposes of the same system resources, it is preferable @@ -1244,12 +1244,12 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * may not run to completion for a long period of time. *

          * Graphics objects which are provided as arguments to the - * paint and update methods + * {@code paint} and {@code update} methods * of components are automatically released by the system when * those methods return. For efficiency, programmers should - * call dispose when finished using - * a Graphics object only if it was created - * directly from a component or another Graphics object. + * call {@code dispose} when finished using + * a {@code Graphics} object only if it was created + * directly from a component or another {@code Graphics} object. * @see java.awt.Graphics#finalize * @see java.awt.Component#paint * @see java.awt.Component#update diff --git a/jdk/src/java.desktop/share/classes/sun/print/ProxyPrintGraphics.java b/jdk/src/java.desktop/share/classes/sun/print/ProxyPrintGraphics.java index f46caed3ea3..49480707019 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/ProxyPrintGraphics.java +++ b/jdk/src/java.desktop/share/classes/sun/print/ProxyPrintGraphics.java @@ -54,8 +54,8 @@ public class ProxyPrintGraphics extends ProxyGraphics } /** - * Creates a new Graphics object that is - * a copy of this Graphics object. + * Creates a new {@code Graphics} object that is + * a copy of this {@code Graphics} object. * @return a new graphics context that is a copy of * this graphics context. */ @@ -65,8 +65,8 @@ public class ProxyPrintGraphics extends ProxyGraphics /** - * Creates a new Graphics object based on this - * Graphics object, but with a new translation and + * Creates a new {@code Graphics} object based on this + * {@code Graphics} object, but with a new translation and * clip area. * Refer to * {@link sun.print.ProxyGraphics#create(int, int, int, int)} diff --git a/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java b/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java index 585e6e495b8..1ffb6a18e1d 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java +++ b/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java @@ -431,7 +431,7 @@ public abstract class RasterPrinterJob extends PrinterJob { /* * A convenience method which returns the default service - * for 2D PrinterJobs. + * for 2D {@code PrinterJob}s. * May return null if there is no suitable default (although there * may still be 2D services available). * @return default 2D print service, or null. @@ -495,9 +495,9 @@ public abstract class RasterPrinterJob extends PrinterJob { /** * Associate this PrinterJob with a new PrintService. * - * Throws PrinterException if the specified service - * cannot support the Pageable and - * Printable interfaces necessary to support 2D printing. + * Throws {@code PrinterException} if the specified service + * cannot support the {@code Pageable} and + * {@code Printable} interfaces necessary to support 2D printing. * @param service print service which supports 2D printing. * * @throws PrinterException if the specified service does not support @@ -694,17 +694,17 @@ public abstract class RasterPrinterJob extends PrinterJob { /** * Display a dialog to the user allowing the modification of a * PageFormat instance. - * The page argument is used to initialize controls + * The {@code page} argument is used to initialize controls * in the page setup dialog. * If the user cancels the dialog, then the method returns the - * original page object unmodified. + * original {@code page} object unmodified. * If the user okays the dialog then the method returns a new * PageFormat object with the indicated changes. - * In either case the original page object will + * In either case the original {@code page} object will * not be modified. * @param page the default PageFormat presented to the user * for modification - * @return the original page object if the dialog + * @return the original {@code page} object if the dialog * is cancelled, or a new PageFormat object containing * the format indicated by the user if the dialog is * acknowledged @@ -2350,14 +2350,14 @@ public abstract class RasterPrinterJob extends PrinterJob { /** * Examine the metrics captured by the - * PeekGraphics instance and + * {@code PeekGraphics} instance and * if capable of directly converting this * print job to the printer's control language * or the native OS's graphics primitives, then - * return a PathGraphics to perform + * return a {@code PathGraphics} to perform * that conversion. If there is not an object * capable of the conversion then return - * null. Returning null + * {@code null}. Returning {@code null} * causes the print job to be rasterized. */ protected Graphics2D createPathGraphics(PeekGraphics graphics, @@ -2372,11 +2372,11 @@ public abstract class RasterPrinterJob extends PrinterJob { /** * Create and return an object that will * gather and hold metrics about the print - * job. This method is passed a Graphics2D + * job. This method is passed a {@code Graphics2D} * object that can be used as a proxy for the * object gathering the print job matrics. The * method is also supplied with the instance - * controlling the print job, printerJob. + * controlling the print job, {@code printerJob}. */ protected PeekGraphics createPeekGraphics(Graphics2D graphics, PrinterJob printerJob) { diff --git a/jdk/src/java.desktop/share/classes/sun/swing/UIAction.java b/jdk/src/java.desktop/share/classes/sun/swing/UIAction.java index 98aa04c06c4..d87801fc683 100644 --- a/jdk/src/java.desktop/share/classes/sun/swing/UIAction.java +++ b/jdk/src/java.desktop/share/classes/sun/swing/UIAction.java @@ -87,7 +87,7 @@ public abstract class UIAction implements Action { * Cover method for isEnabled(null). */ public final boolean isEnabled() { - return isEnabled(null); + return accept(null); } /** @@ -96,7 +96,8 @@ public abstract class UIAction implements Action { * * @param sender Widget enabled state is being asked for, may be null. */ - public boolean isEnabled(Object sender) { + @Override + public boolean accept(Object sender) { return true; } diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java b/jdk/src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java index 42dd34e6943..ecee8ade0bc 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java @@ -118,8 +118,8 @@ public abstract class UNIXToolkit extends SunToolkit * Load a native Gtk stock icon. * * @param longname a desktop property name. This contains icon name, size - * and orientation, e.g. "gtk.icon.gtk-add.4.rtl" - * @return an Image for the icon, or null if the + * and orientation, e.g. {@code "gtk.icon.gtk-add.4.rtl"} + * @return an {@code Image} for the icon, or {@code null} if the * icon could not be loaded */ protected Object lazilyLoadGTKIcon(String longname) { diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java index a476628e7c5..72aeb67a3f9 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java @@ -55,7 +55,7 @@ class MotifDnDDragSourceProtocol extends XDragSourceProtocol /** * Creates an instance associated with the specified listener. * - * @throws NullPointerException if listener is null. + * @throws NullPointerException if listener is {@code null}. */ static XDragSourceProtocol createInstance(XDragSourceProtocolListener listener) { return new MotifDnDDragSourceProtocol(listener); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java index e71236a6ff9..8d63906a664 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java @@ -62,7 +62,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol { /** * Creates an instance associated with the specified listener. * - * @throws NullPointerException if listener is null. + * @throws NullPointerException if listener is {@code null}. */ static XDropTargetProtocol createInstance(XDropTargetProtocolListener listener) { return new MotifDnDDropTargetProtocol(listener); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/Native.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/Native.java index e4d5b23ca76..470da61093f 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/Native.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/Native.java @@ -63,7 +63,7 @@ class Native { /** * Set of helper function to read data of different PLATFORM types - * from memory pointer by ptr + * from memory pointer by {@code ptr} * Note, names of types in function are NATIVE PLATFORM types * and they have the same size as they would have in C compiler * on the same platform. @@ -93,7 +93,7 @@ class Native { putByte(ptr+index, data); } /** - * Converts length bytes of data pointed by data into byte array + * Converts length bytes of data pointed by {@code data} into byte array * Returns null if data is zero * @param data native pointer to native memory * @param length size in bytes of native memory @@ -143,7 +143,7 @@ class Native { } /** - * Converts length usnigned bytes of data pointed by data into + * Converts length usnigned bytes of data pointed by {@code data} into * short array * Returns null if data is zero * @param data native pointer to native memory @@ -297,8 +297,8 @@ class Native { } /** * Stores to C long data(four bytes) - * Note: data has long type - * to be able to keep 64-bit C long data + * Note: {@code data} has {@code long} type + * to be able to keep 64-bit C {@code long} data */ static void putLong(long ptr, long data) { if (XlibWrapper.dataModel == 32) { @@ -320,7 +320,7 @@ class Native { } /** * Stores Java long[] array into memory. Memory location is treated as array - * of native longs + * of native {@code long}s */ static void put(long ptr, long[] arr) { for (int i = 0; i < arr.length; i ++, ptr += getLongSize()) { @@ -330,7 +330,7 @@ class Native { /** * Stores Java Vector of Longs into memory. Memory location is treated as array - * of native longs + * of native {@code long}s */ static void putLong(long ptr, Vector arr) { for (int i = 0; i < arr.size(); i ++, ptr += getLongSize()) { @@ -340,7 +340,7 @@ class Native { /** * Stores Java Vector of Longs into memory. Memory location is treated as array - * of native longs. Array is stored in reverse order + * of native {@code long}s. Array is stored in reverse order */ static void putLongReverse(long ptr, Vector arr) { for (int i = arr.size()-1; i >= 0; i--, ptr += getLongSize()) { @@ -348,7 +348,7 @@ class Native { } } /** - * Converts length bytes of data pointed by data into byte array + * Converts length bytes of data pointed by {@code data} into byte array * Returns null if data is zero * @param data native pointer to native memory * @param length size in longs(platform dependent) of native memory @@ -393,7 +393,7 @@ class Native { } /** - * Allocates memory for array of native longs of the size length + * Allocates memory for array of native {@code long}s of the size {@code length} */ static long allocateLongArray(int length) { return unsafe.allocateMemory(getLongSize() * length); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAtom.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAtom.java index eeb46347b56..117e3865241 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAtom.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAtom.java @@ -29,28 +29,31 @@ package sun.awt.X11; * XAtom is a class that allows you to create and modify X Window properties. * An X Atom is an identifier for a property that you can set on any X Window. * Standard X Atom are defined by X11 and these atoms are defined in this class - * for convenience. Common X Atoms like XA_WM_NAME are used to communicate with the + * for convenience. Common X Atoms like {@code XA_WM_NAME} are used to communicate with the * Window manager to let it know the Window name. The use and protocol for these * atoms are defined in the Inter client communications converntions manual. * User specified XAtoms are defined by specifying a name that gets Interned - * by the XServer and an XAtom object is returned. An XAtom can also be created - * by using a pre-exisiting atom like XA_WM_CLASS. A display has to be specified - * in order to create an XAtom.

          + * by the XServer and an {@code XAtom} object is returned. An {@code XAtom} can also be created + * by using a pre-exisiting atom like {@code XA_WM_CLASS}. A {@code display} has to be specified + * in order to create an {@code XAtom}.

          * - * Once an XAtom instance is created, you can call get and set property methods to + * Once an {@code XAtom} instance is created, you can call get and set property methods to * set the values for a particular window.

          * * * Example usage : To set the window name for a top level:

          - * - * XAtom xa = new XAtom(display,XAtom.XA_WM_NAME);

          - * xa.setProperty(window,"Hello World");

          - *

          - *

          - * To get the cut buffer :

          - *

          - * XAtom xa = new XAtom(display,XAtom.XA_CUT_BUFFER0);

          - * String selection = xa.getProperty(root_window);

          + *

          {@code
          + * XAtom xa = new XAtom(display,XAtom.XA_WM_NAME);
          + * xa.setProperty(window,"Hello World");
          + * }
          + *

          + *

          + * To get the cut buffer: + *

          {@code
          + * XAtom xa = new XAtom(display,XAtom.XA_CUT_BUFFER0);
          + * String selection = xa.getProperty(root_window);
          + * }
          + * * @author Bino George * @since 1.5 */ @@ -237,7 +240,7 @@ public final class XAtom { } /** This constructor will create an instance of XAtom that is specified - * by the predefined XAtom specified by u latom + * by the predefined XAtom specified by u {@code latom} * * @param display X display to use. * @param atom a predefined XAtom. @@ -250,7 +253,7 @@ public final class XAtom { } /** This constructor will create the instance, - * and if autoIntern is true intern a new XAtom that is specified + * and if {@code autoIntern} is true intern a new XAtom that is specified * by the supplied name. * * @param display X display to use @@ -450,7 +453,7 @@ public final class XAtom { /** * Gets uninterpreted set of data from property and stores them in data_ptr. - * Property type is type, property is current atom. + * Property type is {@code type}, property is current atom. * Property format is 32. Property 'delete' is false. * Returns boolean if requested type, format, length match returned values * and returned data pointer is not null. @@ -505,7 +508,7 @@ public final class XAtom { /** * Sets uninterpreted set of data into property from data_ptr. - * Property type is type, property is current atom. + * Property type is {@code type}, property is current atom. * Property format is 32. Mode is PropModeReplace. length is a number * of items pointer by data_ptr. */ @@ -526,7 +529,7 @@ public final class XAtom { /** * Sets uninterpreted set of data into property from data_ptr. - * Property type is type, property is current atom. + * Property type is {@code type}, property is current atom. * Property format is 8. Mode is PropModeReplace. length is a number * of bytes pointer by data_ptr. */ @@ -784,7 +787,7 @@ public final class XAtom { } /** - * Sets property on the window to the value window_value + * Sets property on the {@code window} to the value {@code window_value} * Property is assumed to be of type WINDOW/32 */ public void setWindowProperty(long window, long window_value) { @@ -807,7 +810,7 @@ public final class XAtom { } /** - * Gets property on the window. Property is assumed to be + * Gets property on the {@code window}. Property is assumed to be * of type WINDOW/32. */ public long getWindowProperty(long window) { diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAtomList.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAtomList.java index a998850eb4c..624c7040694 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAtomList.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAtomList.java @@ -41,7 +41,7 @@ class XAtomList { /** * Creates instance of XAtomList and initializes it with - * the contents pointer by data. + * the contents pointer by {@code data}. * Uses default display to initialize atoms. */ public XAtomList(long data, int count) { @@ -90,7 +90,7 @@ class XAtomList { } /** - * Returns true if this list contains the atom atom + * Returns true if this list contains the atom {@code atom} */ public boolean contains(XAtom atom) { return atoms.contains(atom); @@ -119,8 +119,8 @@ class XAtomList { } /** - * Returns a subset of a list which is intersection of this set and set build by mapping mask in - * mapping. + * Returns a subset of a list which is intersection of this set and set build by mapping {@code mask} in + * {@code mapping}. */ public XAtomList subset(int mask, Map mapping) { XAtomList res = new XAtomList(); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java index 94cb9fdacaf..c8534aa36e3 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java @@ -170,7 +170,7 @@ public class XBaseWindow { } /** - * Creates window using parameters params + * Creates window using parameters {@code params} * If params contain flag DELAYED doesn't do anything. * Note: Descendants can call this method to create the window * at the time different to instance construction. @@ -316,7 +316,7 @@ public class XBaseWindow { } /** - * Creates window with parameters specified by params + * Creates window with parameters specified by {@code params} * @see #init */ private final void create(XCreateWindowParams params) { @@ -691,7 +691,7 @@ public class XBaseWindow { XToolkit.awtLock(); try { XAtom xa = XAtom.get(XAtom.XA_WM_CLASS); - xa.setProperty8(getWindow(), cl[0] + '\0' + cl[1]); + xa.setProperty8(getWindow(), cl[0] + '\0' + cl[1] + '\0'); } finally { XToolkit.awtUnlock(); } diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XComponentPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XComponentPeer.java index e1331c7fdd0..82715e73ff2 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XComponentPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XComponentPeer.java @@ -680,7 +680,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget * Gets the font metrics for the specified font. * @param font the font for which font metrics is to be * obtained - * @return the font metrics for font + * @return the font metrics for {@code font} * @see #getFont * @see java.awt.peer.ComponentPeer#getFontMetrics(Font) * @see Toolkit#getFontMetrics(Font) @@ -724,8 +724,8 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget /* * The method changes the cursor. - * @param cursor - a new cursor to change to. - * @param ignoreSubComponents - if {@code true} is passed then + * @param cursor a new cursor to change to. + * @param ignoreSubComponents if {@code true} is passed then * the new cursor will be installed on window. * if {@code false} is passed then * subsequent components will try to handle diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDesktopPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDesktopPeer.java index abe706a3652..72a34cf85f8 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDesktopPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDesktopPeer.java @@ -39,7 +39,7 @@ import java.util.List; /** - * Concrete implementation of the interface DesktopPeer for + * Concrete implementation of the interface {@code DesktopPeer} for * the Gnome desktop on Linux and Unix platforms. * * @see DesktopPeer diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDnDDragSourceProtocol.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDnDDragSourceProtocol.java index 26265be30bc..fc60ec97fa8 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDnDDragSourceProtocol.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDnDDragSourceProtocol.java @@ -55,7 +55,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol { /** * Creates an instance associated with the specified listener. * - * @throws NullPointerException if listener is null. + * @throws NullPointerException if listener is {@code null}. */ static XDragSourceProtocol createInstance(XDragSourceProtocolListener listener) { return new XDnDDragSourceProtocol(listener); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDnDDropTargetProtocol.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDnDDropTargetProtocol.java index e1698a424b8..f2e7b62c9f1 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDnDDropTargetProtocol.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDnDDropTargetProtocol.java @@ -70,7 +70,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol { /** * Creates an instance associated with the specified listener. * - * @throws NullPointerException if listener is null. + * @throws NullPointerException if listener is {@code null}. */ static XDropTargetProtocol createInstance(XDropTargetProtocolListener listener) { return new XDnDDropTargetProtocol(listener); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDragSourceProtocol.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDragSourceProtocol.java index 48e611b627a..c8ecb422611 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDragSourceProtocol.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDragSourceProtocol.java @@ -74,7 +74,7 @@ abstract class XDragSourceProtocol { * Initializes a drag operation with the specified supported drop actions, * contents and data formats. * - * @param actions a bitwise mask of DnDConstants that represent + * @param actions a bitwise mask of {@code DnDConstants} that represent * the supported drop actions. * @param contents the contents for the drag operation. * @param formats an array of Atoms that represent the supported data formats. diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbedServerTester.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbedServerTester.java index 9b37a429125..1bbae4f91f9 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbedServerTester.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbedServerTester.java @@ -570,7 +570,7 @@ public class XEmbedServerTester implements XEventDispatcher { } } /** - * Checks if the event is already in a list at position >= position + * Checks if the {@code event} is already in a list at position >= {@code position} */ private int checkEventList(int position, int event) { if (position == -1) { diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRepaintArea.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRepaintArea.java index 97a997958ec..6f7b733c82f 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRepaintArea.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRepaintArea.java @@ -33,7 +33,7 @@ import sun.awt.AWTAccessor; import sun.awt.RepaintArea; /** - * The RepaintArea is a geometric construct created for the + * The {@code RepaintArea} is a geometric construct created for the * purpose of holding the geometry of several coalesced paint events. * This geometry is accessed synchronously, although it is written such * that painting may still be executed asynchronously. @@ -43,7 +43,7 @@ import sun.awt.RepaintArea; final class XRepaintArea extends RepaintArea { /** - * Calls Component.update(Graphics) with given Graphics. + * Calls {@code Component.update(Graphics)} with given Graphics. */ protected void updateComponent(Component comp, Graphics g) { if (comp != null) { @@ -54,7 +54,7 @@ final class XRepaintArea extends RepaintArea { } /** - * Calls Component.paint(Graphics) with given Graphics. + * Calls {@code Component.paint(Graphics)} with given Graphics. */ protected void paintComponent(Component comp, Graphics g) { if (comp != null) { diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java index 6d8473cb47c..368d034687e 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java @@ -31,6 +31,7 @@ import sun.awt.AWTAccessor; import sun.awt.SunToolkit; import sun.awt.UNIXToolkit; import sun.awt.X11GraphicsConfig; +import sun.awt.X11GraphicsEnvironment; class XRobotPeer implements RobotPeer { @@ -64,7 +65,14 @@ class XRobotPeer implements RobotPeer { @Override public void mouseMove(int x, int y) { - mouseMoveImpl(xgc, xgc.scaleUp(x), xgc.scaleUp(y)); + X11GraphicsEnvironment x11ge = (X11GraphicsEnvironment) + GraphicsEnvironment.getLocalGraphicsEnvironment(); + if(x11ge.runningXinerama()) { + Rectangle sb = xgc.getBounds(); + mouseMoveImpl(xgc, xgc.scaleUp(x + sb.x), xgc.scaleUp(y + sb.y)); + } else { + mouseMoveImpl(xgc, xgc.scaleUp(x), xgc.scaleUp(y)); + } } @Override diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XSelection.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XSelection.java index 2fb074855d5..0a9a70487df 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XSelection.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XSelection.java @@ -110,7 +110,7 @@ final class XSelection { /* * Returns the XSelection object for the specified selection atom or - * null if none exists. + * {@code null} if none exists. */ static XSelection getSelection(XAtom atom) { return table.get(atom); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XStateProtocol.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XStateProtocol.java index 72bbc348045..84defe3a912 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XStateProtocol.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XStateProtocol.java @@ -30,7 +30,7 @@ public interface XStateProtocol { /** * Returns whether or not the protocol supports the transition to the state - * represented by state. State contains encoded state + * represented by {@code state}. {@code State} contains encoded state * as a bit mask of state defined in java.awt.Frame */ boolean supportsState(int state); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextAreaPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextAreaPeer.java index 428d1d27d55..9efe70b17c4 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextAreaPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextAreaPeer.java @@ -127,7 +127,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { int end = target.getSelectionEnd(); // Fix for 5100200 // Restoring Motif behaviour - // Since the end position of the selected text can be greater then the length of the text, + // Since the end position of the selected text can be greater than the length of the text, // so we should set caret to max position of the text setCaretPosition(Math.min(end, text.length())); if (end > start) { diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextFieldPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextFieldPeer.java index b936b6bb26a..9df078e9d1f 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextFieldPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextFieldPeer.java @@ -83,7 +83,7 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { int end = target.getSelectionEnd(); // Fix for 5100200 // Restoring Motif behaviour - // Since the end position of the selected text can be greater then the length of the text, + // Since the end position of the selected text can be greater than the length of the text, // so we should set caret to max position of the text setCaretPosition(Math.min(end, text.length())); if (end > start) { diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java index 7297ef72287..d79df149f6d 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java @@ -407,7 +407,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { /** * Returns whether there is last remembered cursor position. The * position is remembered from X mouse events on our peers. The - * position is stored in p. + * position is stored in {@code p}. * @return true, if there is remembered last cursor position, * false otherwise */ @@ -1680,11 +1680,11 @@ public final class XToolkit extends UNIXToolkit implements Runnable { /** * Callback from the native side indicating some, or all, of the * desktop properties have changed and need to be reloaded. - * data is the byte array directly from the x server and + * {@code data} is the byte array directly from the x server and * may be in little endian format. *

          * NB: This could be called from any thread if triggered by - * loadXSettings. It is called from the System EDT + * {@code loadXSettings}. It is called from the System EDT * if triggered by an XSETTINGS change. */ void parseXSettings(int screen_XXX_ignored,Map updatedSettings) { @@ -1941,16 +1941,16 @@ public final class XToolkit extends UNIXToolkit implements Runnable { static native void wakeup_poll(); /** - * Registers a Runnable which run() method will be called + * Registers a Runnable which {@code run()} method will be called * once on the toolkit thread when a specified interval of time elapses. * - * @param task a Runnable which run method will be called - * on the toolkit thread when interval milliseconds + * @param task a Runnable which {@code run} method will be called + * on the toolkit thread when {@code interval} milliseconds * elapse * @param interval an interal in milliseconds * - * @throws NullPointerException if task is null - * @throws IllegalArgumentException if interval is not positive + * @throws NullPointerException if {@code task} is {@code null} + * @throws IllegalArgumentException if {@code interval} is not positive */ static void schedule(Runnable task, long interval) { if (task == null) { diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java index 77fb29d3a97..862508ccfcf 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java @@ -1622,7 +1622,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, * @param transientForWindow the top-level window * @param updateChain specifies if next/prevTransientFor fields are * to be updated - * @param allStates if set to true then TRANSIENT_FOR hint + * @param allStates if set to {@code true} then TRANSIENT_FOR hint * is set regardless of the state of window and transientForWindow, * otherwise it is set only if both are in the same state */ diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/XSettings.java b/jdk/src/java.desktop/unix/classes/sun/awt/XSettings.java index 59fb9a08ad2..812255ea850 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/XSettings.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/XSettings.java @@ -44,13 +44,13 @@ public class XSettings { /** - * Update these settings with data obtained from + * Update these settings with {@code data} obtained from * XSETTINGS manager. * * @param data settings data obtained from - * _XSETTINGS_SETTINGS window property of the + * {@code _XSETTINGS_SETTINGS} window property of the * settings manager. - * @return a Map of changed settings. + * @return a {@code Map} of changed settings. */ public Map update(byte[] data) { return (new Update(data)).update(); @@ -84,10 +84,10 @@ public class XSettings { /** * Construct an Update object for the data read from - * _XSETTINGS_SETTINGS property of the XSETTINGS + * {@code _XSETTINGS_SETTINGS} property of the XSETTINGS * selection owner. * - * @param data _XSETTINGS_SETTINGS contents. + * @param data {@code _XSETTINGS_SETTINGS} contents. */ Update(byte[] data) { this.data = data; diff --git a/jdk/src/java.desktop/unix/classes/sun/font/NativeFont.java b/jdk/src/java.desktop/unix/classes/sun/font/NativeFont.java index ca225f6df5a..b30b6459c3b 100644 --- a/jdk/src/java.desktop/unix/classes/sun/font/NativeFont.java +++ b/jdk/src/java.desktop/unix/classes/sun/font/NativeFont.java @@ -64,7 +64,7 @@ public class NativeFont extends PhysicalFont { /** * Verifies native font is accessible. - * @throws FontFormatException - if the font can't be located. + * @throws FontFormatException if the font can't be located. */ public NativeFont(String platName, boolean bitmapDelegate) throws FontFormatException { diff --git a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c index 07588c80f5e..00d04814e86 100644 --- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c +++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c @@ -221,8 +221,10 @@ wcstombsdmp(wchar_t *wcs, int len) } /* TODO: check return values... Handle invalid characters properly... */ - if (wcstombs(mbs, wcs, n) == (size_t)-1) + if (wcstombs(mbs, wcs, n) == (size_t)-1) { + free(mbs); return NULL; + } return mbs; } diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/Win32GraphicsConfig.java b/jdk/src/java.desktop/windows/classes/sun/awt/Win32GraphicsConfig.java index 4773934e39e..a13c1ff1d50 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/Win32GraphicsConfig.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/Win32GraphicsConfig.java @@ -94,7 +94,7 @@ public class Win32GraphicsConfig extends GraphicsConfiguration /** * @deprecated as of JDK version 1.3 - * replaced by getConfig() + * replaced by {@code getConfig()} */ @Deprecated public Win32GraphicsConfig(GraphicsDevice device, int visualnum) { diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java b/jdk/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java index 8e32e39acc8..dab4129ade5 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java @@ -350,12 +350,12 @@ final class Win32ShellFolder2 extends ShellFolder { /** * This method is implemented to make sure that no instances - * of ShellFolder are ever serialized. If isFileSystem() returns - * true, then the object is representable with an instance of - * java.io.File instead. If not, then the object depends + * of {@code ShellFolder} are ever serialized. If {@code isFileSystem()} returns + * {@code true}, then the object is representable with an instance of + * {@code java.io.File} instead. If not, then the object depends * on native PIDL state and should not be serialized. * - * @return a java.io.File replacement object. If the folder + * @return a {@code java.io.File} replacement object. If the folder * is a not a normal directory, then returns the first non-removable * drive (normally "C:\"). */ @@ -718,7 +718,7 @@ final class Win32ShellFolder2 extends ShellFolder { /** * @return An array of shell folders that are children of this shell folder * object. The array will be empty if the folder is empty. Returns - * null if this shellfolder does not denote a directory. + * {@code null} if this shellfolder does not denote a directory. */ public File[] listFiles(final boolean includeHiddenFiles) { SecurityManager security = System.getSecurityManager(); @@ -1091,7 +1091,7 @@ final class Win32ShellFolder2 extends ShellFolder { } /** - * Gets an icon from the Windows system icon list as an Image + * Gets an icon from the Windows system icon list as an {@code Image} */ static Image getSystemIcon(SystemIcon iconType) { long hIcon = getSystemIcon(iconType.getIconID()); @@ -1101,7 +1101,7 @@ final class Win32ShellFolder2 extends ShellFolder { } /** - * Gets an icon from the Windows system icon list as an Image + * Gets an icon from the Windows system icon list as an {@code Image} */ static Image getShell32Icon(int iconID, boolean getLargeIcon) { boolean useVGAColors = true; // Will be ignored on XP and later diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java b/jdk/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java index e87379a58f0..b01d04443df 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java @@ -225,24 +225,24 @@ final class Win32ShellFolderManager2 extends ShellFolderManager { private static File[] roots; /** - * @param key a String + * @param key a {@code String} * "fileChooserDefaultFolder": - * Returns a File - the default shellfolder for a new filechooser + * Returns a {@code File} - the default shellfolder for a new filechooser * "roots": - * Returns a File[] - containing the root(s) of the displayable hierarchy + * Returns a {@code File[]} - containing the root(s) of the displayable hierarchy * "fileChooserComboBoxFolders": - * Returns a File[] - an array of shellfolders representing the list to + * Returns a {@code File[]} - an array of shellfolders representing the list to * show by default in the file chooser's combobox * "fileChooserShortcutPanelFolders": - * Returns a File[] - an array of shellfolders representing well-known + * Returns a {@code File[]} - an array of shellfolders representing well-known * folders, such as Desktop, Documents, History, Network, Home, etc. * This is used in the shortcut panel of the filechooser on Windows 2000 * and Windows Me. * "fileChooserIcon ": - * Returns an Image - icon can be ListView, DetailsView, UpFolder, NewFolder or + * Returns an {@code Image} - icon can be ListView, DetailsView, UpFolder, NewFolder or * ViewMenu (Windows only). * "optionPaneIcon iconName": - * Returns an Image - icon from the system icon list + * Returns an {@code Image} - icon from the system icon list * * @return An Object matching the key string. */ @@ -415,7 +415,7 @@ final class Win32ShellFolderManager2 extends ShellFolderManager { } /** - * Does dir represent a "computer" such as a node on the network, or + * Does {@code dir} represent a "computer" such as a node on the network, or * "My Computer" on the desktop. */ public boolean isComputerNode(final File dir) { diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WDesktopPeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WDesktopPeer.java index c3d68c7442c..b745e9d41ae 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WDesktopPeer.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WDesktopPeer.java @@ -34,7 +34,7 @@ import java.net.URI; /** - * Concrete implementation of the interface DesktopPeer for + * Concrete implementation of the interface {@code DesktopPeer} for * the Windows platform. * * @see DesktopPeer diff --git a/jdk/src/java.desktop/share/classes/sun/awt/DefaultMouseInfoPeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WMouseInfoPeer.java similarity index 82% rename from jdk/src/java.desktop/share/classes/sun/awt/DefaultMouseInfoPeer.java rename to jdk/src/java.desktop/windows/classes/sun/awt/windows/WMouseInfoPeer.java index 9ac06c4b8bf..e5bef4fe1b9 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/DefaultMouseInfoPeer.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WMouseInfoPeer.java @@ -23,18 +23,24 @@ * questions. */ -package sun.awt; +package sun.awt.windows; +import java.awt.GraphicsEnvironment; import java.awt.Point; import java.awt.Window; import java.awt.peer.MouseInfoPeer; -public final class DefaultMouseInfoPeer implements MouseInfoPeer { +public final class WMouseInfoPeer implements MouseInfoPeer { + + static { + // initialize screen devices for the mouse coordinates scaling + GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); + } /** * Package-private constructor to prevent instantiation. */ - DefaultMouseInfoPeer() { + WMouseInfoPeer() { } public native int fillPointWithCoords(Point point); diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPathGraphics.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPathGraphics.java index f892a88bf6c..b7508fc290e 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPathGraphics.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPathGraphics.java @@ -116,8 +116,8 @@ final class WPathGraphics extends PathGraphics { } /** - * Creates a new Graphics object that is - * a copy of this Graphics object. + * Creates a new {@code Graphics} object that is + * a copy of this {@code Graphics} object. * @return a new graphics context that is a copy of * this graphics context. * @since 1.0 @@ -375,19 +375,19 @@ final class WPathGraphics extends PathGraphics { } /** - * Renders the text specified by the specified String, - * using the current Font and Paint attributes - * in the Graphics2D context. + * Renders the text specified by the specified {@code String}, + * using the current {@code Font} and {@code Paint} attributes + * in the {@code Graphics2D} context. * The baseline of the first character is at position * (xy) in the User Space. - * The rendering attributes applied include the Clip, - * Transform, Paint, Font and - * Composite attributes. For characters in script systems + * The rendering attributes applied include the {@code Clip}, + * {@code Transform}, {@code Paint}, {@code Font} and + * {@code Composite} attributes. For characters in script systems * such as Hebrew and Arabic, the glyphs can be rendered from right to * left, in which case the coordinate supplied is the location of the * leftmost character on the baseline. - * @param str the String to be rendered - * @param x, y the coordinates where the String + * @param str the {@code String} to be rendered + * @param x, y the coordinates where the {@code String} * should be rendered * @see #setPaint * @see java.awt.Graphics#setColor @@ -914,11 +914,11 @@ final class WPathGraphics extends PathGraphics { } /** - * The various drawImage() methods for - * WPathGraphics are all decomposed - * into an invocation of drawImageToPlatform. + * The various {@code drawImage()} methods for + * {@code WPathGraphics} are all decomposed + * into an invocation of {@code drawImageToPlatform}. * The portion of the passed in image defined by - * srcX, srcY, srcWidth, and srcHeight + * {@code srcX, srcY, srcWidth, and srcHeight} * is transformed by the supplied AffineTransform and * drawn using GDI to the printer context. * @@ -1379,7 +1379,7 @@ final class WPathGraphics extends PathGraphics { /** * Have the printing application redraw everything that falls - * within the page bounds defined by region. + * within the page bounds defined by {@code region}. */ @Override public void redrawRegion(Rectangle2D region, double scaleX, double scaleY, @@ -1479,7 +1479,7 @@ final class WPathGraphics extends PathGraphics { } /* - * Fill the path defined by pathIter + * Fill the path defined by {@code pathIter} * with the specified color. * The path is provided in device coordinates. */ @@ -1495,7 +1495,7 @@ final class WPathGraphics extends PathGraphics { /* * Set the printer device's clip to be the - * path defined by pathIter + * path defined by {@code pathIter} * The path is provided in device coordinates. */ @Override @@ -1719,7 +1719,7 @@ final class WPathGraphics extends PathGraphics { /** - * Given a Java2D PathIterator instance, + * Given a Java2D {@code PathIterator} instance, * this method translates that into a Window's path * in the printer device context. */ diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java index 3506e4e6331..89c28502411 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java @@ -336,13 +336,13 @@ public final class WPrinterJob extends RasterPrinterJob /** * The last color set into the print device context or - * null if no color has been set. + * {@code null} if no color has been set. */ private Color mLastColor; /** * The last text color set into the print device context or - * null if no color has been set. + * {@code null} if no color has been set. */ private Color mLastTextColor; @@ -402,17 +402,17 @@ public final class WPrinterJob extends RasterPrinterJob /** * Display a dialog to the user allowing the modification of a * PageFormat instance. - * The page argument is used to initialize controls + * The {@code page} argument is used to initialize controls * in the page setup dialog. * If the user cancels the dialog, then the method returns the - * original page object unmodified. + * original {@code page} object unmodified. * If the user okays the dialog then the method returns a new * PageFormat object with the indicated changes. - * In either case the original page object will + * In either case the original {@code page} object will * not be modified. * @param page the default PageFormat presented to the user * for modification - * @return the original page object if the dialog + * @return the original {@code page} object if the dialog * is cancelled, or a new PageFormat object containing * the format indicated by the user if the dialog is * acknowledged @@ -588,8 +588,8 @@ public final class WPrinterJob extends RasterPrinterJob /** * Associate this PrinterJob with a new PrintService. * - * Throws PrinterException if the specified service - * cannot support the Pageable and + * Throws {@code PrinterException} if the specified service + * cannot support the {@code Pageable} and * Printable interfaces necessary to support 2D printing. * @param service print service which supports 2D printing. * @@ -763,14 +763,14 @@ public final class WPrinterJob extends RasterPrinterJob /** * Examine the metrics captured by the - * PeekGraphics instance and + * {@code PeekGraphics} instance and * if capable of directly converting this * print job to the printer's control language * or the native OS's graphics primitives, then - * return a PathGraphics to perform + * return a {@code PathGraphics} to perform * that conversion. If there is not an object * capable of the conversion then return - * null. Returning null + * {@code null}. Returning {@code null} * causes the print job to be rasterized. */ @@ -976,9 +976,9 @@ public final class WPrinterJob extends RasterPrinterJob /** * Set the current polgon fill rule into the printer device context. - * The fillRule should + * The {@code fillRule} should * be one of the following Windows constants: - * ALTERNATE or WINDING. + * {@code ALTERNATE} or {@code WINDING}. */ protected void setPolyFillMode(int fillRule) { setPolyFillMode(getPrintDC(), fillRule); @@ -986,7 +986,7 @@ public final class WPrinterJob extends RasterPrinterJob /* * Create a Window's solid brush for the color specified - * by (red, green, blue). Once the brush + * by {@code (red, green, blue)}. Once the brush * is created, select it in the current printing device * context and free the old brush. */ @@ -1146,7 +1146,7 @@ public final class WPrinterJob extends RasterPrinterJob } /** - * Draw the string text to the printer's + * Draw the string {@code text} to the printer's * device context at the specified position. */ protected void textOut(String str, float x, float y, @@ -1166,7 +1166,7 @@ public final class WPrinterJob extends RasterPrinterJob } /** - * Draw the glyphs glyphs to the printer's + * Draw the glyphs {@code glyphs} to the printer's * device context at the specified position. */ protected void glyphsOut(int []glyphs, float x, float y, @@ -1208,15 +1208,15 @@ public final class WPrinterJob extends RasterPrinterJob /** * Draw the 24 bit BGR image buffer represented by - * image to the GDI device context - * printDC. The image is drawn at - * (destX, destY) in device coordinates. + * {@code image} to the GDI device context + * {@code printDC}. The image is drawn at + * {@code (destX, destY)} in device coordinates. * The image is scaled into a square of size - * specified by destWidth and - * destHeight. The portion of the + * specified by {@code destWidth} and + * {@code destHeight}. The portion of the * source image copied into that square is specified - * by srcX, srcY, - * srcWidth, and srcHeight. + * by {@code srcX}, {@code srcY}, + * {@code srcWidth}, and srcHeight. */ protected void drawImage3ByteBGR(byte[] image, float destX, float destY, @@ -1412,37 +1412,37 @@ public final class WPrinterJob extends RasterPrinterJob /** * Begin a Window's rendering path in the device - * context printDC. + * context {@code printDC}. */ protected native void beginPath(long printDC); /** * End a Window's rendering path in the device - * context printDC. + * context {@code printDC}. */ protected native void endPath(long printDC); /** * Close a subpath in a Window's rendering path in the device - * context printDC. + * context {@code printDC}. */ protected native void closeFigure(long printDC); /** * Fill a defined Window's rendering path in the device - * context printDC. + * context {@code printDC}. */ protected native void fillPath(long printDC); /** - * Move the Window's pen position to (x,y) - * in the device context printDC. + * Move the Window's pen position to {@code (x,y)} + * in the device context {@code printDC}. */ protected native void moveTo(long printDC, float x, float y); /** * Draw a line from the current pen position to - * (x,y) in the device context printDC. + * {@code (x,y)} in the device context {@code printDC}. */ protected native void lineTo(long printDC, float x, float y); @@ -1453,17 +1453,17 @@ public final class WPrinterJob extends RasterPrinterJob /** * Set the current polgon fill rule into the device context - * printDC. The fillRule should + * {@code printDC}. The {@code fillRule} should * be one of the following Windows constants: - * ALTERNATE or WINDING. + * {@code ALTERNATE} or {@code WINDING}. */ protected native void setPolyFillMode(long printDC, int fillRule); /** * Create a Window's solid brush for the color specified - * by (red, green, blue). Once the brush + * by {@code (red, green, blue)}. Once the brush * is created, select it in the device - * context printDC and free the old brush. + * context {@code printDC} and free the old brush. */ protected native void selectSolidBrush(long printDC, int red, int green, int blue); @@ -1471,14 +1471,14 @@ public final class WPrinterJob extends RasterPrinterJob /** * Return the x coordinate of the current pen * position in the device context - * printDC. + * {@code printDC}. */ protected native int getPenX(long printDC); /** * Return the y coordinate of the current pen * position in the device context - * printDC. + * {@code printDC}. */ protected native int getPenY(long printDC); @@ -1537,8 +1537,8 @@ public final class WPrinterJob extends RasterPrinterJob /** - * Draw the string text into the device - * context printDC at the specified + * Draw the string {@code text} into the device + * context {@code printDC} at the specified * position. */ protected native void textOut(long printDC, String text, @@ -1550,15 +1550,15 @@ public final class WPrinterJob extends RasterPrinterJob /** * Draw the DIB compatible image buffer represented by - * image to the GDI device context - * printDC. The image is drawn at - * (destX, destY) in device coordinates. + * {@code image} to the GDI device context + * {@code printDC}. The image is drawn at + * {@code (destX, destY)} in device coordinates. * The image is scaled into a square of size - * specified by destWidth and - * destHeight. The portion of the + * specified by {@code destWidth} and + * {@code destHeight}. The portion of the * source image copied into that square is specified - * by srcX, srcY, - * srcWidth, and srcHeight. + * by {@code srcX}, {@code srcY}, + * {@code srcWidth}, and srcHeight. * Note that the image isn't completely compatible with DIB format. * At the very least it needs to be padded so each scanline is * DWORD aligned. Also we "flip" the image to make it a bottom-up DIB. diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java index fed3e231731..c7c463a8754 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java @@ -558,6 +558,16 @@ public final class WToolkit extends SunToolkit implements Runnable { return WKeyboardFocusManagerPeer.getInstance(); } + private static WMouseInfoPeer wPeer = null; + + @Override + public synchronized MouseInfoPeer getMouseInfoPeer() { + if (wPeer == null) { + wPeer = new WMouseInfoPeer(); + } + return wPeer; + } + private native void setDynamicLayoutNative(boolean b); @Override @@ -587,7 +597,7 @@ public final class WToolkit extends SunToolkit implements Runnable { } /** - * Returns true if this frame state is supported. + * Returns {@code true} if this frame state is supported. */ @Override public boolean isFrameStateSupported(int state) { diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WTrayIconPeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WTrayIconPeer.java index 09b564f194e..b2828e2503f 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WTrayIconPeer.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WTrayIconPeer.java @@ -180,7 +180,7 @@ final class WTrayIconPeer extends WObjectPeer implements TrayIconPeer { /* * Updates/adds the icon in/to the system tray. - * @param doUpdate if true, updates the icon, + * @param doUpdate if {@code true}, updates the icon, * otherwise, adds the icon */ native void updateNativeIcon(boolean doUpdate); diff --git a/jdk/src/java.desktop/windows/classes/sun/font/NativeFont.java b/jdk/src/java.desktop/windows/classes/sun/font/NativeFont.java index 9b9be888933..7a5c29c7c73 100644 --- a/jdk/src/java.desktop/windows/classes/sun/font/NativeFont.java +++ b/jdk/src/java.desktop/windows/classes/sun/font/NativeFont.java @@ -41,7 +41,7 @@ public class NativeFont extends PhysicalFont { /** * Verifies native font is accessible. - * @throws FontFormatException - if the font can't be located. + * @throws FontFormatException if the font can't be located. */ public NativeFont(String platName, boolean isBitmapDelegate) throws FontFormatException { diff --git a/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java b/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java index 48f1dce490c..4b112b9fcc7 100644 --- a/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java +++ b/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java @@ -140,8 +140,8 @@ public class D3DScreenUpdateManager extends ScreenUpdateManager * method returns GDI surface (we don't want to have two swap chains) * @param isResize whether this surface is being created in response to * a component resize event. This determines whether a repaint event will - * be issued after a surface is created: it will be if isResize - * is true. + * be issued after a surface is created: it will be if {@code isResize} + * is {@code true}. * @return surface data to be use for onscreen rendering */ @Override diff --git a/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DBlitLoops.cpp b/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DBlitLoops.cpp index ac1acd491dd..0b670639783 100644 --- a/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DBlitLoops.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DBlitLoops.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, 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 @@ -508,8 +508,10 @@ D3DBlitTextureToSurface(D3DContext *d3dc, RETURN_STATUS_IF_NULL(srcOps->pResource, E_FAIL); RETURN_STATUS_IF_NULL(dstOps->pResource, E_FAIL); - if ((pSrc = srcOps->pResource->GetTexture()) == NULL || - FAILED(res = d3dc->BeginScene(STATE_TEXTUREOP) || + pSrc = srcOps->pResource->GetTexture(); + RETURN_STATUS_IF_NULL(pSrc, E_FAIL); + + if (FAILED(res = d3dc->BeginScene(STATE_TEXTUREOP) || FAILED(res = d3dc->SetTexture(pSrc)))) { J2dRlsTraceLn(J2D_TRACE_ERROR, diff --git a/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DTextRenderer.cpp b/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DTextRenderer.cpp index 7bd843b93e6..4dde51b98e4 100644 --- a/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DTextRenderer.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DTextRenderer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, 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 @@ -355,7 +355,7 @@ D3DTR_UpdateCachedDestination(D3DContext *d3dc, D3DSDOps *dstOps, jint dx1, dy1, dx2, dy2; D3DResource *pCachedDestTexRes; IDirect3DSurface9 *pCachedDestSurface, *pDst; - HRESULT res; + HRESULT res = S_OK; if (isCachedDestValid && INSIDE(gx1, gy1, gx2, gy2, cachedDestBounds)) { // glyph is already within the cached destination bounds; no need diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/MouseInfo.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/MouseInfo.cpp index e43f6ea3f5f..90cef5303cf 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/MouseInfo.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/windows/MouseInfo.cpp @@ -33,12 +33,12 @@ extern "C" { /* - * Class: sun_awt_DefaultMouseInfoPeer + * Class: sun_awt_windows_WMouseInfoPeer * Method: isWindowUnderMouse * Signature: (Ljava/awt/Window)Z */ JNIEXPORT jboolean JNICALL -Java_sun_awt_DefaultMouseInfoPeer_isWindowUnderMouse(JNIEnv *env, jclass cls, +Java_sun_awt_windows_WMouseInfoPeer_isWindowUnderMouse(JNIEnv *env, jclass cls, jobject window) { POINT pt; @@ -73,12 +73,12 @@ Java_sun_awt_DefaultMouseInfoPeer_isWindowUnderMouse(JNIEnv *env, jclass cls, } /* - * Class: sun_awt_DefaultMouseInfoPeer + * Class: sun_awt_windows_WMouseInfoPeer * Method: fillPointWithCoords * Signature: (Ljava/awt/Point)I */ JNIEXPORT jint JNICALL -Java_sun_awt_DefaultMouseInfoPeer_fillPointWithCoords(JNIEnv *env, jclass cls, jobject point) +Java_sun_awt_windows_WMouseInfoPeer_fillPointWithCoords(JNIEnv *env, jclass cls, jobject point) { static jclass pointClass = NULL; static jfieldID xID, yID; @@ -95,7 +95,8 @@ Java_sun_awt_DefaultMouseInfoPeer_fillPointWithCoords(JNIEnv *env, jclass cls, j env->DeleteLocalRef(pointClassLocal); } - int screen = AwtWin32GraphicsDevice::GetDefaultDeviceIndex(); + HMONITOR monitor = MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY); + int screen = AwtWin32GraphicsDevice::GetScreenFromHMONITOR(monitor); Devices::InstanceAccess devices; AwtWin32GraphicsDevice *device = devices->GetDevice(screen); diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp index b70048a9122..05273d41bad 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp @@ -686,6 +686,9 @@ JNIEXPORT jlong JNICALL Java_sun_awt_shell_Win32ShellFolder2_getLinkLocation case STRRET_WSTR : wstr = strret.pOleStr; break; + + default: + return NULL; } IShellLinkW* psl; diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp index a36db45b72f..d5224df0b62 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp @@ -2605,6 +2605,9 @@ AwtComponent::GetJavaModifiers() if (HIBYTE(::GetKeyState(VK_MENU)) != 0) { modifiers |= java_awt_event_InputEvent_ALT_DOWN_MASK; } + if (HIBYTE(::GetKeyState(VK_RMENU)) != 0) { + modifiers |= java_awt_event_InputEvent_ALT_GRAPH_DOWN_MASK; + } if (HIBYTE(::GetKeyState(VK_MBUTTON)) != 0) { modifiers |= java_awt_event_InputEvent_BUTTON2_DOWN_MASK; } @@ -5231,6 +5234,8 @@ void AwtComponent::SynthesizeMouseMessage(JNIEnv *env, jobject mouseEvent) message = WM_MBUTTONDOWN; break; case java_awt_event_MouseEvent_BUTTON2: message = WM_RBUTTONDOWN; break; + default: + return; } break; } @@ -5242,6 +5247,8 @@ void AwtComponent::SynthesizeMouseMessage(JNIEnv *env, jobject mouseEvent) message = WM_MBUTTONUP; break; case java_awt_event_MouseEvent_BUTTON2: message = WM_RBUTTONUP; break; + default: + return; } break; } @@ -7302,4 +7309,4 @@ void ReleaseDCList(HWND hwnd, DCList &list) { removedDCs = removedDCs->next; delete tmpDCList; } -} \ No newline at end of file +} diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_DesktopProperties.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_DesktopProperties.cpp index 21a4b0074ce..454a2fe74e4 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_DesktopProperties.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_DesktopProperties.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, 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 @@ -388,7 +388,7 @@ void CheckFontSmoothingSettings(HWND hWnd) { } BOOL fontSmoothing = FALSE, settingsChanged; - UINT fontSmoothingType=0, fontSmoothingContrast=0, subPixelOrder; + UINT fontSmoothingType=0, fontSmoothingContrast=0, subPixelOrder=0; if (firstTime) { SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &fontSmoothing, 0); diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp index a8d7fd1bcb6..6a7e49dcce3 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2015, 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 @@ -270,7 +270,7 @@ AwtFont* AwtFont::Create(JNIEnv *env, jobject font, jint angle, jfloat awScale) cfnum = 0; } - LPCWSTR wName; + LPCWSTR wName = NULL; awtFont = new AwtFont(cfnum, env, font); @@ -1202,7 +1202,7 @@ void AwtFontCache::IncRefCount(HFONT hFont){ } LONG AwtFontCache::IncRefCount(Item* item){ - LONG newVal; + LONG newVal = 0; if(NULL != item){ newVal = InterlockedIncrement((long*)&item->refCount); @@ -1211,7 +1211,7 @@ LONG AwtFontCache::IncRefCount(Item* item){ } LONG AwtFontCache::DecRefCount(Item* item){ - LONG newVal; + LONG newVal = 0; if(NULL != item){ newVal = InterlockedDecrement((long*)&item->refCount); diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp index e9a4167a6e1..ed8311ff3b3 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp @@ -156,7 +156,7 @@ AwtFrame* AwtFrame::Create(jobject self, jobject parent) PDATA pData; HWND hwndParent = NULL; - AwtFrame* frame; + AwtFrame* frame = NULL; jclass cls = NULL; jclass inputMethodWindowCls = NULL; jobject target = NULL; @@ -993,7 +993,9 @@ MsgRouting AwtFrame::WmActivate(UINT nState, BOOL fMinimized, HWND opposite) AwtComponent::SetFocusedWindow(GetHWnd()); } else { - if (!::IsWindow(AwtWindow::GetModalBlocker(opposite))) { + if (::IsWindow(AwtWindow::GetModalBlocker(opposite))) { + return mrConsume; + } else { // If deactivation happens because of press on grabbing // window - this is nonsense, since grabbing window is // assumed to have focus and watch for deactivation. But diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Label.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Label.cpp index d755d5fc68d..722151cd864 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Label.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Label.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, 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 @@ -146,15 +146,16 @@ void AwtLabel::DoPaint(HDC hDC, RECT& r) jint alignment = env->GetIntField(target, AwtLabel::alignmentID); switch (alignment) { - case java_awt_Label_LEFT: - x = r.left + 2; - break; case java_awt_Label_CENTER: x = (r.left + r.right - size.cx) / 2; break; case java_awt_Label_RIGHT: x = r.right - 2 - size.cx; break; + case java_awt_Label_LEFT: + default: + x = r.left + 2; + break; } /* draw string */ if (isEnabled()) { diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp index d904da8774b..53057bb4dbd 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, 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 @@ -1108,7 +1108,7 @@ Java_sun_awt_windows_WPrinterJob_initPrinter(JNIEnv *env, jobject self) { // check for collation HGLOBAL hDevNames = AwtPrintControl::getPrintHDName(env, self); if (hDevNames != NULL) { - DWORD dmFields; + DWORD dmFields = 0; DEVNAMES *devnames = (DEVNAMES *)::GlobalLock(hDevNames); if (devnames != NULL) { diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_TextComponent.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_TextComponent.cpp index eaa8bca03d4..de60f0ed702 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_TextComponent.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_TextComponent.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, 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 @@ -129,6 +129,7 @@ AwtTextComponent* AwtTextComponent::Create(jobject peer, jobject parent, BOOL is scroll_style = WS_HSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL; break; case java_awt_TextArea_SCROLLBARS_BOTH: + default: scroll_style = WS_VSCROLL | WS_HSCROLL | ES_AUTOVSCROLL | ES_AUTOHSCROLL; break; diff --git a/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java b/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java index 24c848800fd..8d0083ff807 100644 --- a/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java +++ b/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java @@ -519,9 +519,13 @@ public class ManagementFactory { * {@code MBeanServerConnection} where * {@link java.io.IOException IOException} may be thrown * when the communication problem occurs with the connector server. - * An application remotely accesses the platform MXBeans using - * proxy should prepare to catch {@code IOException} as if - * accessing with the {@code MBeanServerConnector} interface. + * If thrown, {@link java.io.IOException IOException} will be wrappped in + * {@link java.lang.reflect.UndeclaredThrowableException UndeclaredThrowableException}. + * An application remotely accessing the platform MXBeans using + * proxy should prepare to catch {@code UndeclaredThrowableException} and + * handle its {@linkplain java.lang.reflect.UndeclaredThrowableException#getCause() cause} + * as if that cause had been thrown by the {@code MBeanServerConnection} + * interface. * *

        • When a client application is designed to remotely access MXBeans * for a running virtual machine whose version is different than @@ -530,7 +534,11 @@ public class ManagementFactory { * {@link java.io.InvalidObjectException InvalidObjectException} * which is thrown when an MXBean proxy receives a name of an * enum constant which is missing in the enum class loaded in - * the client application.
        • + * the client application. If thrown, + * {@link java.io.InvalidObjectException InvalidObjectException} will be + * wrappped in + * {@link java.lang.reflect.UndeclaredThrowableException UndeclaredThrowableException}. + * * *
        • {@link javax.management.MBeanServerInvocationHandler * MBeanServerInvocationHandler} or its diff --git a/jdk/src/jdk.crypto.pkcs11/solaris/conf/security/sunpkcs11-solaris.cfg b/jdk/src/jdk.crypto.pkcs11/solaris/conf/security/sunpkcs11-solaris.cfg index c120c5e3242..bd5539a0210 100644 --- a/jdk/src/jdk.crypto.pkcs11/solaris/conf/security/sunpkcs11-solaris.cfg +++ b/jdk/src/jdk.crypto.pkcs11/solaris/conf/security/sunpkcs11-solaris.cfg @@ -18,5 +18,6 @@ attributes = compatibility disabledMechanisms = { CKM_DSA_KEY_PAIR_GEN + SecureRandom } diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 08a1eb94c28..1b7cc2da8b5 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -315,6 +315,9 @@ javax/sound/midi/Gervill/SoftProvider/GetDevice.java generic-all ############################################################################ # jdk_imageio +javax/imageio/plugins/shared/CanWriteSequence.java generic-all +javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java generic-all +javax/imageio/plugins/tiff/WriteToSequenceAfterAbort.java generic-all ############################################################################ @@ -372,9 +375,6 @@ com/sun/jdi/GetLocalVariables4Test.sh windows-all # 8062512 java/util/spi/ResourceBundleControlProvider/UserDefaultControlTest.java generic-all -# 8076458 -java/util/stream/test/org/openjdk/tests/java/util/stream/FlatMapOpTest.java generic-all - # 8130337 java/util/stream/test/org/openjdk/tests/java/util/stream/IntPrimitiveOpsTests.java generic-all diff --git a/jdk/test/TEST.groups b/jdk/test/TEST.groups index e608d9d98b5..f621295f82d 100644 --- a/jdk/test/TEST.groups +++ b/jdk/test/TEST.groups @@ -78,6 +78,7 @@ jdk_lang = \ sun/reflect \ jdk/lambda \ jdk/internal/misc \ + jdk/internal/ref \ vm # All of the java.util package diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java index b94644d1fd1..f6c82e21c3b 100644 --- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java +++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, 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 @@ -24,8 +24,6 @@ /* * @test * @bug 8028994 - * @ignore 8147477 - * @ignore 8147494 * @author Staffan Larsen * @library /lib/testlibrary * @modules jdk.attach/sun.tools.attach @@ -73,7 +71,7 @@ public class CheckOrigin { Map env = pb.environment(); // "UseCMSGC" should be ignored. - env.put("_JAVA_OPTIONS", "-XX:+TraceExceptions -XX:+UseCMSGC"); + env.put("_JAVA_OPTIONS", "-XX:+CheckJNICalls -XX:+UseCMSGC"); // "UseGOneGC" should be ignored. env.put("JAVA_TOOL_OPTIONS", "-XX:+IgnoreUnrecognizedVMOptions " + "-XX:+PrintVMOptions -XX:+UseGOneGC"); @@ -101,7 +99,7 @@ public class CheckOrigin { // Set on the command line checkOrigin("UseCodeAging", Origin.VM_CREATION); // Set in _JAVA_OPTIONS - checkOrigin("TraceExceptions", Origin.ENVIRON_VAR); + checkOrigin("CheckJNICalls", Origin.ENVIRON_VAR); // Set in JAVA_TOOL_OPTIONS checkOrigin("IgnoreUnrecognizedVMOptions", Origin.ENVIRON_VAR); checkOrigin("PrintVMOptions", Origin.ENVIRON_VAR); diff --git a/jdk/test/java/awt/Focus/TranserFocusToWindow/TranserFocusToWindow.java b/jdk/test/java/awt/Focus/TranserFocusToWindow/TranserFocusToWindow.java index 5512e4febb5..bf2252832f8 100644 --- a/jdk/test/java/awt/Focus/TranserFocusToWindow/TranserFocusToWindow.java +++ b/jdk/test/java/awt/Focus/TranserFocusToWindow/TranserFocusToWindow.java @@ -23,12 +23,12 @@ /* @test - @bug 6562853 - @summary Tests that focus transfered directy to window w/o transfering it to frame. - @author Oleg Sukhodolsky: area=awt.focus - @library ../../regtesthelpers - @build Util - @run main TranserFocusToWindow + @bug 6562853 7035459 + @summary Tests that focus transfered directy to window w/o transfering it to frame. + @author Oleg Sukhodolsky: area=awt.focus + @library ../../regtesthelpers + @build Util + @run main TranserFocusToWindow */ import java.awt.Button; @@ -44,10 +44,13 @@ import test.java.awt.regtesthelpers.Util; public class TranserFocusToWindow { + private static final int WIDTH = 300; + private static final int HEIGHT = 200; + public static void main(String[] args) { Robot robot = Util.createRobot(); Frame owner_frame = new Frame("Owner frame"); - owner_frame.setBounds(0, 0, 200, 200); + owner_frame.setBounds(0, 0, WIDTH, HEIGHT); owner_frame.setVisible(true); Util.waitForIdle(robot); @@ -55,7 +58,7 @@ public class TranserFocusToWindow Button btn1 = new Button("button for focus"); window.add(btn1); window.pack(); - window.setLocation(0, 300); + window.setLocation(0, HEIGHT + 100); window.setVisible(true); Util.waitForIdle(robot); @@ -63,17 +66,10 @@ public class TranserFocusToWindow Button btn2 = new Button("button in a frame"); another_frame.add(btn2); another_frame.pack(); - another_frame.setLocation(300, 0); + another_frame.setLocation(WIDTH + 100, 0); another_frame.setVisible(true); Util.waitForIdle(robot); - Util.clickOnTitle(owner_frame, robot); - Util.waitForIdle(robot); - - setFocus(btn1, robot); - - setFocus(btn2, robot); - owner_frame.addWindowFocusListener(new WindowFocusListener() { public void windowLostFocus(WindowEvent we) { System.out.println(we); @@ -100,6 +96,10 @@ public class TranserFocusToWindow } }); + Util.clickOnTitle(owner_frame, robot); + Util.waitForIdle(robot); + setFocus(btn1, robot); + setFocus(btn2, robot); // we need this delay so WM can not treat two clicks on title as double click robot.delay(500); Util.clickOnTitle(owner_frame, robot); diff --git a/jdk/test/java/awt/FontClass/DrawStringWithInfiniteXform.java b/jdk/test/java/awt/FontClass/DrawStringWithInfiniteXform.java new file mode 100644 index 00000000000..bd23226cb54 --- /dev/null +++ b/jdk/test/java/awt/FontClass/DrawStringWithInfiniteXform.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * @test + * @bug 8023213 + * @summary Font/Text APIs should not crash/takes long time + * if transform includes INIFINITY + * @run main DrawStringWithInfiniteXform + */ +import java.awt.*; +import java.awt.font.*; +import java.awt.geom.*; +import java.awt.image.*; +import java.util.Timer; +import java.util.TimerTask; + +public class DrawStringWithInfiniteXform { + Timer timer; + boolean done; + class ScheduleTask extends TimerTask { + public void run() { + timer.cancel(); + if (!done) { + throw new + RuntimeException("drawString with InfiniteXform transform takes long time"); + } + } + } + public DrawStringWithInfiniteXform() { + timer = new Timer(); + timer.schedule(new ScheduleTask(), 10000); + } + + public static void main(String [] args) { + DrawStringWithInfiniteXform test = new DrawStringWithInfiniteXform(); + test.start(); + } + + private void start() { + float[] vals = new float[6]; + for (int i=0;i<6;i++) vals[i]=Float.POSITIVE_INFINITY; + AffineTransform nanTX = new AffineTransform(vals); + + BufferedImage bi = new BufferedImage(1,1,BufferedImage.TYPE_INT_RGB); + Graphics2D g2d = bi.createGraphics(); + + g2d.rotate(Float.POSITIVE_INFINITY); + Font font = g2d.getFont(); + Font xfiniteFont; + for (int i=0; i<2000; i++) { + xfiniteFont = font.deriveFont(Float.POSITIVE_INFINITY); + g2d.setFont(xfiniteFont); + g2d.drawString("abc", 20, 20); + } + done = true; + System.out.println("Test passed"); + } +} diff --git a/jdk/test/java/awt/FontClass/NaNTransform.java b/jdk/test/java/awt/FontClass/NaNTransform.java new file mode 100644 index 00000000000..ab525ec2d2c --- /dev/null +++ b/jdk/test/java/awt/FontClass/NaNTransform.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/** + * @test + * @bug 6357987 6513889 8023213 + * @summary Font/Text APIs should not crash if transform includes NaN + * @author prr + * @run main NaNTransform + */ +import java.awt.*; +import java.awt.font.*; +import java.awt.geom.*; +import java.awt.image.*; + +public class NaNTransform { + + private static void testShape(String msg, Shape s) { + if (!(new Area(s).isEmpty())) { + System.out.println(msg+"="+s); + throw new RuntimeException("Warning: expected this to be empty"); + } + } + + public static void main(String [] args) { + + float NaN=0f/0f; + float[] vals = new float[6]; + for (int i=0;i<6;i++) vals[i]=NaN; + AffineTransform nanTX = new AffineTransform(vals); + + BufferedImage bi = new BufferedImage(1,1,BufferedImage.TYPE_INT_RGB); + Graphics2D g2d = bi.createGraphics(); + + g2d.rotate(NaN); + + Font font = g2d.getFont(); + FontMetrics fm = g2d.getFontMetrics(); + FontRenderContext frc = g2d.getFontRenderContext(); + + int adv = fm.stringWidth("ABCDEF"); + if (adv != 0) { + System.out.println("strWidth="+adv); + throw new RuntimeException("Warning: expected this to be zero"); + } + testShape("strBounds", font.getStringBounds("12345", frc)); + + TextLayout tl = new TextLayout("Some text", font, frc); + testShape("tl PixelBounds 1", tl.getPixelBounds(frc, 20, 10)); + testShape("tl PixelBounds 2", tl.getPixelBounds(frc, NaN, NaN)); + testShape("tl Outline", tl.getOutline(nanTX)); + + GlyphVector gv = font.createGlyphVector(frc, "abcdef"); + testShape("gv PixelBounds 1", gv.getPixelBounds(frc, 0, 0)); + testShape("gv PixelBounds 2", gv.getPixelBounds(frc, NaN, NaN)); + testShape("gv Outline", gv.getOutline(NaN, NaN)); + + gv.setGlyphTransform(0, nanTX); + testShape("gv PixelBounds 1A", gv.getPixelBounds(frc, 0, 0)); + testShape("gv PixelBounds 2A", gv.getPixelBounds(frc, NaN, NaN)); + testShape("gv Outline A", gv.getOutline(NaN, NaN)); + + g2d.drawString("BOO!", 20, 20); + + Font nanFont; + for (int i=0; i<5000; i++) { + nanFont = font.deriveFont(Float.NaN); + g2d.setFont(nanFont); + g2d.drawString("abc", 20, 20); + } + System.out.println("Test passed (no crash)"); + } +} diff --git a/jdk/test/java/awt/Frame/MaximizedToMaximized/MaximizedToMaximized.java b/jdk/test/java/awt/Frame/MaximizedToMaximized/MaximizedToMaximized.java index e0da056b035..0b295470328 100644 --- a/jdk/test/java/awt/Frame/MaximizedToMaximized/MaximizedToMaximized.java +++ b/jdk/test/java/awt/Frame/MaximizedToMaximized/MaximizedToMaximized.java @@ -32,7 +32,7 @@ import java.awt.Robot; /** * @test - * @bug 8007219 + * @bug 8007219 8146168 * @author Alexander Scherbatiy * @summary Frame size reverts meaning of maximized attribute * @run main MaximizedToMaximized @@ -41,7 +41,8 @@ public class MaximizedToMaximized { public static void main(String[] args) throws Exception { - Frame frame = new Frame(); + Frame frame = new Frame(); + Robot robot = new Robot(); final Toolkit toolkit = Toolkit.getDefaultToolkit(); final GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment(); @@ -62,13 +63,15 @@ public class MaximizedToMaximized { frame.setBounds(availableScreenBounds.x, availableScreenBounds.y, availableScreenBounds.width, availableScreenBounds.height); frame.setVisible(true); + robot.waitForIdle(); Rectangle frameBounds = frame.getBounds(); frame.setExtendedState(Frame.MAXIMIZED_BOTH); - Robot robot = new Robot(); robot.waitForIdle(); Rectangle maximizedFrameBounds = frame.getBounds(); + + frame.dispose(); if (maximizedFrameBounds.width < frameBounds.width || maximizedFrameBounds.height < frameBounds.height) { throw new RuntimeException("Maximized frame is smaller than non maximized"); diff --git a/jdk/test/java/awt/Graphics2D/MTGraphicsAccessTest/MTGraphicsAccessTest.java b/jdk/test/java/awt/Graphics2D/MTGraphicsAccessTest/MTGraphicsAccessTest.java index 39117195a65..9545c57c220 100644 --- a/jdk/test/java/awt/Graphics2D/MTGraphicsAccessTest/MTGraphicsAccessTest.java +++ b/jdk/test/java/awt/Graphics2D/MTGraphicsAccessTest/MTGraphicsAccessTest.java @@ -23,7 +23,7 @@ /* @test - @bug 5089429 6982632 + @bug 5089429 6982632 8145808 @summary Checks that we don't crash if rendering operations and state changes are performed on a graphics context from different threads. @@ -34,6 +34,7 @@ import java.awt.*; import java.awt.image.*; import java.awt.geom.*; +import java.util.concurrent.atomic.AtomicInteger; public class MTGraphicsAccessTest { @@ -46,7 +47,7 @@ public class MTGraphicsAccessTest { static long testRunTime; volatile boolean done; - volatile int stillRunning; + AtomicInteger stillRunning = new AtomicInteger(0); volatile int numexceptions; Graphics2D sharedGraphics; @@ -108,7 +109,7 @@ public class MTGraphicsAccessTest { mysleep(testRunTime); done = true; - while (stillRunning > 0) { mysleep(500); } + while (stillRunning.get() > 0) { mysleep(500); } if (numexceptions == 0) { System.err.println("Test passed"); @@ -187,7 +188,7 @@ public class MTGraphicsAccessTest { Runnable testRunnable; public TesterThread(Runnable testRunnable) { - stillRunning++; + stillRunning.incrementAndGet(); this.testRunnable = testRunnable; } @@ -203,7 +204,7 @@ public class MTGraphicsAccessTest { } } } finally { - stillRunning--; + stillRunning.decrementAndGet(); } } } diff --git a/jdk/test/java/awt/Mouse/ExtraMouseClick/ExtraMouseClick.java b/jdk/test/java/awt/Mouse/ExtraMouseClick/ExtraMouseClick.java index 832713d187f..e52b6b95f13 100644 --- a/jdk/test/java/awt/Mouse/ExtraMouseClick/ExtraMouseClick.java +++ b/jdk/test/java/awt/Mouse/ExtraMouseClick/ExtraMouseClick.java @@ -23,7 +23,7 @@ /* test - @bug 5039416 6404008 + @bug 5039416 6404008 7087869 @summary REGRESSION: Extra mouse click dispatched after press-drag- release sequence. @library ../../regtesthelpers @build Util @@ -32,8 +32,16 @@ */ import java.applet.Applet; -import java.awt.*; -import java.awt.event.*; +import java.awt.AWTException; +import java.awt.BorderLayout; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Robot; +import java.awt.Toolkit; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionAdapter; import test.java.awt.regtesthelpers.Util; //** @@ -141,7 +149,12 @@ public class ExtraMouseClick extends Applet smallWin32Drag(dragWidth, dragHeight); clearFlags(); } - }else{ + } else if ("sun.lwawt.macosx.LWCToolkit".equals(sToolkit)) { + // On MacOS X every mouse move event is MOUSE_DRAGGED event and + // MOUSE_DRAGGED is sent back form the Native code to the java code + // for every mouse move. Therefore 'smallDrag test should be + // disabled for toolkit 'sun.lwawt.macosx.LWCToolkit'. + } else { for (int i = 0; i< TRIALS; i++){ smallDrag(SMUDGE_WIDTH - 1, SMUDGE_HEIGHT - 1); //on Motif and XAWT SMUDGE area is 4-pixels wide clearFlags(); @@ -157,8 +170,10 @@ public class ExtraMouseClick extends Applet for (int i = 1; i=0; --k) { + for (int k = keys.length - 1; k >= 0; --k) { robot.keyRelease(keys[k]); - robot.delay(keyDelay); + robot.delay(KEY_DELAY); } - - assertEQ(modifiersEx, modEx, "invalid extended modifiers"); + assertEQ(expectedMask, modEx, "invalid extended modifiers"); for (int k = 0; k < keys.length; ++k) { String keyText = KeyEvent.getKeyText(keys[k]).toLowerCase(); - assertTrue(exText.toLowerCase().contains(keyText), "invalid extended modifier keys description"); + assertTrue(exText.toLowerCase().contains(keyText), + "invalid extended modifier keys description"); } System.out.println(exText + " : passed"); robot.type(KeyEvent.VK_ESCAPE); - - robot.delay(robotDelay); + robot.waitForIdle(); } private void doTest() throws Exception { @@ -201,7 +209,7 @@ public class ExtendedModifiersTest implements KeyListener { String OS = System.getProperty("os.name").toLowerCase(); System.out.println(OS); - for (Component c: components) { + for (Component c : components) { String className = c.getClass().getName(); System.out.println("component class : " + className); @@ -211,18 +219,19 @@ public class ExtendedModifiersTest implements KeyListener { int yc = origin.y + c.getHeight() / 2; Point center = new Point(xc, yc); - robot.delay(robotDelay); + robot.waitForIdle(); robot.glide(origin, center); robot.click(); - robot.delay(robotDelay); + robot.waitForIdle(); // 1. shift + control runScenario(new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL}, InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK); // 2. alt + shift + control - runScenario(new int[]{KeyEvent.VK_ALT, KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL}, - InputEvent.ALT_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK); + runScenario(new int[]{KeyEvent.VK_ALT, KeyEvent.VK_SHIFT, + KeyEvent.VK_CONTROL}, InputEvent.ALT_DOWN_MASK + | InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK); // 3. shift runScenario(new int[]{KeyEvent.VK_SHIFT}, @@ -236,26 +245,31 @@ public class ExtendedModifiersTest implements KeyListener { runScenario(new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_ALT}, InputEvent.SHIFT_DOWN_MASK | InputEvent.ALT_DOWN_MASK); - if (OS.contains("os x") || OS.contains("sunos")) { // 6. meta - runScenario(new int[]{KeyEvent.VK_META}, InputEvent.META_DOWN_MASK); + runScenario(new int[]{KeyEvent.VK_META}, + InputEvent.META_DOWN_MASK); // 7. shift + ctrl + alt + meta - runScenario(new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT, KeyEvent.VK_META}, - InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK | InputEvent.META_DOWN_MASK); + runScenario(new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL, + KeyEvent.VK_ALT, KeyEvent.VK_META}, + InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK + | InputEvent.ALT_DOWN_MASK | InputEvent.META_DOWN_MASK); // 8. meta + shift + ctrl - runScenario(new int[]{KeyEvent.VK_META, KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL}, - InputEvent.META_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK); + runScenario(new int[]{KeyEvent.VK_META, KeyEvent.VK_SHIFT, + KeyEvent.VK_CONTROL}, InputEvent.META_DOWN_MASK + | InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK); // 9. meta + shift + alt - runScenario(new int[]{KeyEvent.VK_META, KeyEvent.VK_SHIFT, KeyEvent.VK_ALT}, - InputEvent.META_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK | InputEvent.ALT_DOWN_MASK); + runScenario(new int[]{KeyEvent.VK_META, KeyEvent.VK_SHIFT, + KeyEvent.VK_ALT}, InputEvent.META_DOWN_MASK + | InputEvent.SHIFT_DOWN_MASK | InputEvent.ALT_DOWN_MASK); // 10. meta + ctrl + alt - runScenario(new int[]{KeyEvent.VK_META, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT}, - InputEvent.META_DOWN_MASK | InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK); + runScenario(new int[]{KeyEvent.VK_META, KeyEvent.VK_CONTROL, + KeyEvent.VK_ALT}, InputEvent.META_DOWN_MASK + | InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK); } } @@ -267,5 +281,4 @@ public class ExtendedModifiersTest implements KeyListener { ExtendedModifiersTest test = new ExtendedModifiersTest(); test.doTest(); } -} - +} \ No newline at end of file diff --git a/jdk/test/java/awt/event/MouseEvent/AltGraphModifierTest/AltGraphModifierTest.java b/jdk/test/java/awt/event/MouseEvent/AltGraphModifierTest/AltGraphModifierTest.java new file mode 100644 index 00000000000..92dcc214376 --- /dev/null +++ b/jdk/test/java/awt/event/MouseEvent/AltGraphModifierTest/AltGraphModifierTest.java @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 8041928 + @summary Confirm that the Alt-Gr Modifier bit is set correctly. + @run main/manual AltGraphModifierTest + */ +import java.awt.Button; +import java.awt.Dialog; +import java.awt.Frame; +import java.awt.Panel; +import java.awt.TextArea; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +public class AltGraphModifierTest { + private static void init() throws Exception { + String[] instructions + = { + "This test is for verifying Alt-Gr modifier of an event.", + "Windows :-", + "1. Please check if Alt-Gr key is present on keyboard.", + "2. If present, press the Alt-Gr key and perform", + " mouse click on the TestWindow.", + "3. If Alt-Gr key is not present, press Ctrl+Alt keys &", + " perform mouse click on the TestWindow.", + "4. Test will exit by itself with appropriate result.", + "", + "Linux :-", + "1. Please check if Alt-Gr key is present on keyboard.", + "2. If present, press the Alt-Gr key and perform", + " mouse click on the TestWindow.", + "3. Navigate to System Settings-> Keyboard-> Shortcuts->", + " Typing.", + "4. Select an option for the Alternative Characters Key", + " For example. Right Alt", + "5. Close the settings and navigate to test", + "6. Press Right Alt Key & perform mouse click on the", + " TestWindow", + "7. Test will exit by itself with appropriate result.", + "", + "Mac :-", + " Mac fix is under progress, & will be fixed soon.", + " Please click Fail" + }; + + Sysout.createDialog(); + Sysout.printInstructions(instructions); + } + + static Frame mainFrame; + public static void initTestWindow() { + mainFrame = new Frame(); + mainFrame.setTitle("TestWindow"); + mainFrame.setSize(300, 200); + mainFrame.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + int ex = e.getModifiersEx(); + if ((ex & InputEvent.ALT_GRAPH_DOWN_MASK) == 0) { + AltGraphModifierTest.fail("Alt-Gr Modifier bit is not set."); + } else { + AltGraphModifierTest.pass(); + } + } + }); + mainFrame.setVisible(true); + } + + public static void dispose() { + Sysout.dispose(); + mainFrame.dispose(); + } + + /** + * *************************************************** + * Standard Test Machinery Section DO NOT modify anything in this section -- + * it's a standard chunk of code which has all of the synchronisation + * necessary for the test harness. By keeping it the same in all tests, it + * is easier to read and understand someone else's test, as well as insuring + * that all tests behave correctly with the test harness. There is a section + * following this for test-defined classes + * **************************************************** + */ + private static boolean theTestPassed = false; + private static boolean testGeneratedInterrupt = false; + private static String failureMessage = ""; + private static Thread mainThread = null; + final private static int sleepTime = 300000; + + public static void main(String args[]) throws Exception { + mainThread = Thread.currentThread(); + try { + init(); + initTestWindow(); + } catch (Exception e) { + e.printStackTrace(); + } + try { + mainThread.sleep(sleepTime); + } catch (InterruptedException e) { + dispose(); + if (testGeneratedInterrupt && !theTestPassed) { + throw new Exception(failureMessage); + } + } + if (!testGeneratedInterrupt) { + dispose(); + throw new RuntimeException("Timed out after " + sleepTime / 1000 + + " seconds"); + } + } + + public static synchronized void pass() { + theTestPassed = true; + testGeneratedInterrupt = true; + mainThread.interrupt(); + } + + public static synchronized void fail(String whyFailed) { + theTestPassed = false; + testGeneratedInterrupt = true; + failureMessage = whyFailed; + mainThread.interrupt(); + } +} + +// *********** End Standard Test Machinery Section ********** +/** + * ************************************************** + * Standard Test Machinery DO NOT modify anything below -- it's a standard chunk + * of code whose purpose is to make user interaction uniform, and thereby make + * it simpler to read and understand someone else's test. + * ************************************************** + */ +/** + * This is part of the standard test machinery. It creates a dialog (with the + * instructions), and is the interface for sending text messages to the user. To + * print the instructions, send an array of strings to Sysout.createDialog + * WithInstructions method. Put one line of instructions per array entry. To + * display a message for the tester to see, simply call Sysout.println with the + * string to be displayed. This mimics System.out.println but works within the + * test harness as well as standalone. + */ +class Sysout { + private static TestDialog dialog; + private static Frame frame; + + public static void createDialog() { + frame = new Frame(); + dialog = new TestDialog(frame, "Instructions"); + String[] defInstr = {"Instructions will appear here. ", ""}; + dialog.printInstructions(defInstr); + dialog.show(); + println("Any messages for the tester will display here."); + } + + public static void printInstructions(String[] instructions) { + dialog.printInstructions(instructions); + } + + public static void println(String messageIn) { + dialog.displayMessage(messageIn); + } + + public static void dispose() { + dialog.dispose(); + frame.dispose(); + } +} + +/** + * This is part of the standard test machinery. It provides a place for the test + * instructions to be displayed, and a place for interactive messages to the + * user to be displayed. To have the test instructions displayed, see Sysout. To + * have a message to the user be displayed, see Sysout. Do not call anything in + * this dialog directly. + */ +class TestDialog extends Dialog implements ActionListener { + TextArea instructionsText; + TextArea messageText; + int maxStringLength = 80; + Panel buttonP; + Button failB; + + // DO NOT call this directly, go through Sysout + public TestDialog(Frame frame, String name) { + super(frame, name); + int scrollBoth = TextArea.SCROLLBARS_BOTH; + instructionsText = new TextArea("", 15, maxStringLength, scrollBoth); + add("North", instructionsText); + + messageText = new TextArea("", 5, maxStringLength, scrollBoth); + add("Center", messageText); + + buttonP = new Panel(); + failB = new Button("Fail"); + failB.setActionCommand("fail"); + failB.addActionListener(this); + buttonP.add("Center", failB); + + add("South", buttonP); + pack(); + setVisible(true); + } + + // DO NOT call this directly, go through Sysout + public void printInstructions(String[] instructions) { + instructionsText.setText(""); + String printStr, remainingStr; + for (int i = 0; i < instructions.length; i++) { + remainingStr = instructions[i]; + while (remainingStr.length() > 0) { + if (remainingStr.length() >= maxStringLength) { + int posOfSpace = remainingStr. + lastIndexOf(' ', maxStringLength - 1); + + if (posOfSpace <= 0) { + posOfSpace = maxStringLength - 1; + } + + printStr = remainingStr.substring(0, posOfSpace + 1); + remainingStr = remainingStr.substring(posOfSpace + 1); + } + else { + printStr = remainingStr; + remainingStr = ""; + } + instructionsText.append(printStr + "\n"); + } + } + } + + public void displayMessage(String messageIn) { + messageText.append(messageIn + "\n"); + } + + public void actionPerformed(ActionEvent e) { + if (e.getActionCommand() == "fail") { + AltGraphModifierTest.fail("User Clicked Fail"); + } + } +} \ No newline at end of file diff --git a/jdk/test/java/awt/font/TextLayout/TestGetPixelBounds.java b/jdk/test/java/awt/font/TextLayout/TestGetPixelBounds.java new file mode 100644 index 00000000000..459ff695bf3 --- /dev/null +++ b/jdk/test/java/awt/font/TextLayout/TestGetPixelBounds.java @@ -0,0 +1,261 @@ +/* + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 6271221 8145584 + * @summary ask a text layout for its pixel bounds, then render it and + * compute the actual pixel bounds when rendering-- the actual pixel bounds + * must be contained within the bounds reported by the text layout, or there + * will be an exception. + */ + +/* + * Copyright 2005 IBM Corp. All Rights Reserved. + */ + +import java.awt.*; +import java.awt.font.*; +import java.awt.geom.*; +import java.awt.image.*; +import java.text.*; +import java.util.*; + +import static java.awt.Font.*; +import static java.awt.font.GraphicAttribute.*; +import static java.awt.font.ShapeGraphicAttribute.*; +import static java.awt.font.TextAttribute.*; + +public class TestGetPixelBounds { + static final boolean DEBUG; + static final boolean DUMP; + static { + String dbg = null; + String dmp = null; + try { + dbg = System.getProperty("DEBUG"); + dmp = System.getProperty("DUMP"); + } + catch (SecurityException e) { + dbg = dmp = null; + } + + DEBUG = dbg != null; + DUMP = dmp != null; + } + + public static void main(String[] args) { + float x = 0; + float y = 0; + boolean rotate = false; + boolean underline = false; + boolean graphic = false; + String text = "Ping"; + for (int i = 0; i < args.length; ++i) { + String arg = args[i]; + if (arg.startsWith("-x")) { + x = Float.parseFloat(args[++i]); + } else if (arg.startsWith("-y")) { + y = Float.parseFloat(args[++i]); + } else if (arg.startsWith("-r")) { + rotate = true; + } else if (arg.startsWith("-u")) { + underline = true; + } else if (arg.startsWith("-g")) { + graphic = true; + } else if (arg.startsWith("-t")) { + text = args[++i]; + } + } + FontRenderContext frc = new FontRenderContext(null, true, true); + Map m = new HashMap(); + m.put(FAMILY, SANS_SERIF); + m.put(SIZE, 16); + if (underline) { + m.put(UNDERLINE, UNDERLINE_ON); + } + if (rotate) { + m.put(TRANSFORM, AffineTransform.getRotateInstance(Math.PI/4)); + } + Font font = Font.getFont(m); + + AttributedString as; + if (graphic) { + GraphicAttribute sga = new ShapeGraphicAttribute( + new Ellipse2D.Float(0,-10,10,20), TOP_ALIGNMENT, STROKE); + as = new AttributedString(text + '*' + text, m); + as.addAttribute(CHAR_REPLACEMENT, sga, text.length(), text.length() + 1); + } else { + as = new AttributedString(text, m); + } + TextLayout tl = new TextLayout(as.getIterator(), frc); + System.out.println("tl bounds: " + tl.getBounds()); + System.out.println("tl compute: " + computeLayoutBounds(tl, x, y, frc)); + System.out.println("tl pixel bounds: " + tl.getPixelBounds(frc, x, y)); + System.out.println(" again int off: " + tl.getPixelBounds(frc, x+2, y - 2)); + System.out.println(" again frac off: " + tl.getPixelBounds(frc, x+.5f, y + .2f)); + System.out.println(" again frc: " + tl.getPixelBounds( + new FontRenderContext(AffineTransform.getScaleInstance(100, 100), true, true), x, y)); + System.out.println(" again int off: " + tl.getPixelBounds(frc, x-2, y+2)); + + GlyphVector gv = font.createGlyphVector(frc, text); + System.out.println("gv bounds: " + gv.getPixelBounds(frc, x, y)); + System.out.println("gv compute: " + computeLayoutBounds(gv, x, y, frc)); + + if (!tl.getPixelBounds(frc, x, y).contains(computeLayoutBounds(tl, x, y, frc))) { + throw new RuntimeException("error, tl.bounds does not contain computed bounds"); + } + } + + static Rectangle computeLayoutBounds(TextLayout tl, float x, float y, FontRenderContext frc) { + Rectangle bounds = tl.getBounds().getBounds(); + BufferedImage im = new BufferedImage(bounds.width + 4, bounds.height + 4, + BufferedImage.TYPE_INT_ARGB); + + Graphics2D g2d = im.createGraphics(); + g2d.setColor(Color.WHITE); + g2d.fillRect(0, 0, im.getWidth(), im.getHeight()); + + float fx = (float)Math.IEEEremainder(x,1); + float fy = (float)Math.IEEEremainder(y,1); + g2d.setColor(Color.BLACK); + tl.draw(g2d, fx + 2 - bounds.x, fy + 2 - bounds.y); + + Rectangle r = computePixelBounds(im); + r.x += (int)Math.floor(x) - 2 + bounds.x; + r.y += (int)Math.floor(y) - 2 + bounds.y; + + return r; + } + + static Rectangle computeLayoutBounds(GlyphVector gv, float x, float y, FontRenderContext frc) { + Rectangle bounds = gv.getVisualBounds().getBounds(); + BufferedImage im = new BufferedImage(bounds.width + 4, bounds.height + 4, + BufferedImage.TYPE_INT_ARGB); + + Graphics2D g2d = im.createGraphics(); + g2d.setColor(Color.WHITE); + g2d.fillRect(0, 0, im.getWidth(), im.getHeight()); + + float fx = (float)Math.IEEEremainder(x,1); + float fy = (float)Math.IEEEremainder(y,1); + g2d.setColor(Color.BLACK); + g2d.drawGlyphVector(gv, fx + 2 - bounds.x, fy + 2 - bounds.y); + + Rectangle r = computePixelBounds(im); + r.x += (int)Math.floor(x) - 2 + bounds.x; + r.y += (int)Math.floor(y) - 2 + bounds.y; + + return r; + } + + static Rectangle computePixelBounds(BufferedImage im) { + int w = im.getWidth(); + int h = im.getHeight(); + + Formatter fmt = DEBUG ? new Formatter(System.err) : null; + + // dump + if (DUMP && DEBUG) { + fmt.format(" "); + for (int j = 0; j < w; ++j) { + fmt.format("%2d", j); + } + for (int i = 0; i < h; ++i) { + fmt.format("\n[%2d] ", i); + for (int j = 0; j < w; ++j) { + fmt.format("%c ", im.getRGB(j, i) == -1 ? ' ' : '*'); + } + } + fmt.format("\n"); + } + + int l = -1, t = -1, r = w, b = h; + + { + // get top + int[] buf = new int[w]; + loop: + while (++t < h) { + im.getRGB(0, t, buf.length, 1, buf, 0, w); // w ignored + for (int i = 0; i < buf.length; i++) { + if (buf[i] != -1) { + if (DEBUG) fmt.format("top pixel at %d,%d = 0x%08x\n", i, t, buf[i]); + break loop; + } + } + } + if (DEBUG) fmt.format("t: %d\n", t); + } + + // get bottom + { + int[] buf = new int[w]; + loop: + while (--b > t) { + im.getRGB(0, b, buf.length, 1, buf, 0, w); // w ignored + for (int i = 0; i < buf.length; ++i) { + if (buf[i] != -1) { + if (DEBUG) fmt.format("bottom pixel at %d,%d = 0x%08x\n", i, b, buf[i]); + break loop; + } + } + } + ++b; + if (DEBUG) fmt.format("b: %d\n", b); + } + + // get left + { + loop: + while (++l < r) { + for (int i = t; i < b; ++i) { + int v = im.getRGB(l, i); + if (v != -1) { + if (DEBUG) fmt.format("left pixel at %d,%d = 0x%08x\n", l, i, v); + break loop; + } + } + } + if (DEBUG) fmt.format("l: %d\n", l); + } + + // get right + { + loop: + while (--r > l) { + for (int i = t; i < b; ++i) { + int v = im.getRGB(r, i); + if (v != -1) { + if (DEBUG) fmt.format("right pixel at %d,%d = 0x%08x\n", r, i, v); + break loop; + } + } + } + ++r; + if (DEBUG) fmt.format("r: %d\n", r); + } + + return new Rectangle(l, t, r-l, b-t); + } +} diff --git a/jdk/test/java/awt/image/multiresolution/MultiResolutionImagePropertiesTest.java b/jdk/test/java/awt/image/multiresolution/MultiResolutionImagePropertiesTest.java new file mode 100644 index 00000000000..67bdf08c606 --- /dev/null +++ b/jdk/test/java/awt/image/multiresolution/MultiResolutionImagePropertiesTest.java @@ -0,0 +1,216 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.*; +import java.awt.image.*; +import java.util.*; + +/* @test + * @bug 8147966 + * @summary test multiresolution image properties + * @author a.stepanov + * + * @run main MultiResolutionImagePropertiesTest + */ + +public class MultiResolutionImagePropertiesTest { + + private final static Map PROPS; + static { + PROPS = new HashMap<>(); + PROPS.put("one", "ONE"); + PROPS.put("two", "TWO"); + PROPS.put("three", "THREE"); + PROPS.put("other", "OTHER"); + PROPS.put("test", "TEST"); + } + + private final static int SZ = 100; + private final static Object UNDEF = Image.UndefinedProperty; + + private static BufferedImage generateImage(int scale, Properties p) { + + int x = (int) (SZ * scale); + BufferedImage tmp = new BufferedImage(x, x, BufferedImage.TYPE_INT_RGB); + + return new BufferedImage(tmp.getColorModel(), + tmp.getRaster(), + tmp.isAlphaPremultiplied(), + p); + } + + private static void checkProperties(BufferedImage img, + String keys[], + String undefined[]) { + boolean numOK = true; + + if (keys.length == 0) { + numOK = (img.getPropertyNames() == null); + } else { + numOK = (img.getPropertyNames().length == keys.length); + } + + if (!numOK) { + throw new RuntimeException("invalid number of properties"); + } + + for (String k: keys) { + if (!img.getProperty(k).equals(PROPS.get(k))) { + throw new RuntimeException("invalid property for name " + k); + } + } + + for (String k: undefined) { + if (!img.getProperty(k).equals(UNDEF)) { + throw new RuntimeException("property for name " + k + + " must be undefined"); + } + } + } + + private static void checkProperties(BaseMultiResolutionImage img, + String keys[], + String undefined[]) { + for (String k: keys) { + if (!img.getProperty(k, null).equals(PROPS.get(k))) { + throw new RuntimeException("invalid property for name " + k); + } + } + + for (String k: undefined) { + if (!img.getProperty(k, null).equals(UNDEF)) { + throw new RuntimeException("property for name " + k + + " must be undefined"); + } + } + } + + + public static void main(String[] args) throws Exception { + + String keys[] = new String[]{"one", "two", "three"}; + String otherKeys[] = new String[]{"other", "test"}; + String empty[] = new String[]{}; + + Properties props = new Properties(); + for (String k: keys) { props.setProperty(k, PROPS.get(k)); } + + Properties otherProps = new Properties(); + for (String k: otherKeys) { otherProps.setProperty(k, PROPS.get(k)); } + + Properties defaultProps = new Properties(); + + + // === check the default state === + BaseMultiResolutionImage image = + new BaseMultiResolutionImage(new BufferedImage[]{ + generateImage(1, defaultProps), + generateImage(2, defaultProps), + generateImage(3, defaultProps) + }); + + for (Image var: image.getResolutionVariants()) { + if (((BufferedImage) var).getPropertyNames() != null) { + throw new RuntimeException("PropertyNames should be null"); + } + } + + // === default: base image is the 1st one === + image = + new BaseMultiResolutionImage(new BufferedImage[]{ + generateImage(1, props), + generateImage(2, otherProps), + generateImage(3, defaultProps) + }); + + checkProperties(image, keys, otherKeys); + + BufferedImage var = (BufferedImage) image.getResolutionVariant(SZ, SZ); + checkProperties(var, keys, otherKeys); + + var = (BufferedImage) image.getResolutionVariant(2 * SZ, 2 * SZ); + checkProperties(var, otherKeys, keys); + + var = (BufferedImage) image.getResolutionVariant(3 * SZ, 3 * SZ); + checkProperties(var, empty, keys); + checkProperties(var, empty, otherKeys); + + // === let the 2nd image be a base one === + image = + new BaseMultiResolutionImage(1, new BufferedImage[]{ + generateImage(1, props), + generateImage(2, otherProps), + generateImage(3, defaultProps) + }); + + checkProperties(image, otherKeys, keys); + + var = (BufferedImage) image.getResolutionVariant(SZ, SZ); + checkProperties(var, keys, otherKeys); + + var = (BufferedImage) image.getResolutionVariant(2 * SZ, 2 * SZ); + checkProperties(var, otherKeys, keys); + + var = (BufferedImage) image.getResolutionVariant(3 * SZ, 3 * SZ); + checkProperties(var, empty, keys); + checkProperties(var, empty, otherKeys); + + // === let the 3rd image be a base one === + image = + new BaseMultiResolutionImage(2, new BufferedImage[]{ + generateImage(1, defaultProps), + generateImage(2, defaultProps), + generateImage(3, props) + }); + + checkProperties(image, keys, otherKeys); + + var = (BufferedImage) image.getResolutionVariant(SZ, SZ); + checkProperties(var, empty, keys); + checkProperties(var, empty, otherKeys); + + var = (BufferedImage) image.getResolutionVariant(2 * SZ, 2 * SZ); + checkProperties(var, empty, keys); + checkProperties(var, empty, otherKeys); + + var = (BufferedImage) image.getResolutionVariant(3 * SZ, 3 * SZ); + checkProperties(var, keys, otherKeys); + + // === check the other properties don't affect base === + checkProperties( + new BaseMultiResolutionImage(new BufferedImage[]{ + generateImage(1, defaultProps), + generateImage(2, props), + generateImage(3, props) + }), + empty, keys); + + checkProperties( + new BaseMultiResolutionImage(2, new BufferedImage[]{ + generateImage(1, props), + generateImage(2, props), + generateImage(3, defaultProps) + }), + empty, keys); + } +} diff --git a/jdk/test/java/lang/Math/SinCosCornerCasesTests.java b/jdk/test/java/lang/Math/SinCosCornerCasesTests.java new file mode 100644 index 00000000000..e144857443f --- /dev/null +++ b/jdk/test/java/lang/Math/SinCosCornerCasesTests.java @@ -0,0 +1,2927 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143353 + * @summary Test corner cases of sin and cos + * @build Tests + * @build SinCosCornerCasesTests + * @run main SinCosCornerCasesTests + * @author Vivek Deshpande + */ + +public class SinCosCornerCasesTests { + private SinCosCornerCasesTests() {throw new AssertionError("No instances for you.");} + + public static void main(String... args) { + int failures = 0; + + + failures += testCornerCasesSin(); + failures += testCornerCasesCos(); + + if (failures > 0) { + System.err.printf("Testing worst cases incurred %d failures.%n", failures); + throw new RuntimeException(); + } + } + + + private static int testCornerCasesSin() { + int failures = 0; + double[][] testCases = { + {0x1.9283586503fep-5, 0x1.9259e3708bd3ap-5, 0x1.9259e3708bd39p-5}, + {-0x1.9283586503fep-5, -0x1.9259e3708bd3ap-5, -0x1.9259e3708bd39p-5}, + {0x1.d7bdcd778049fp-5, 0x1.d77b117f230d6p-5, 0x1.d77b117f230d5p-5}, + {-0x1.d7bdcd778049fp-5, -0x1.d77b117f230d6p-5, -0x1.d77b117f230d5p-5}, + {0x1.a202b3fb84788p-4, 0x1.a1490c8c06ba7p-4, 0x1.a1490c8c06ba6p-4}, + {-0x1.a202b3fb84788p-4, -0x1.a1490c8c06ba7p-4, -0x1.a1490c8c06ba6p-4}, + {0x1.d037cb27ee6dfp-3, 0x1.cc40c3805229ap-3, 0x1.cc40c3805229bp-3}, + {-0x1.d037cb27ee6dfp-3, -0x1.cc40c3805229ap-3, -0x1.cc40c3805229bp-3}, + {0x1.d5064e6fe82c5p-3, 0x1.d0ef799001ba9p-3, 0x1.d0ef799001baap-3}, + {-0x1.d5064e6fe82c5p-3, -0x1.d0ef799001ba9p-3, -0x1.d0ef799001baap-3}, + {0x1.fe767739d0f6dp-2, 0x1.e9950730c4696p-2, 0x1.e9950730c4696p-2}, + {-0x1.fe767739d0f6dp-2, -0x1.e9950730c4696p-2, -0x1.e9950730c4696p-2}, + {0x1.d98c4c612718dp-1, 0x1.98dcd09337793p-1, 0x1.98dcd09337792p-1}, + {-0x1.d98c4c612718dp-1, -0x1.98dcd09337793p-1, -0x1.98dcd09337792p-1}, + {0x1.921fb54442d18p0, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p0, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.0000001f8p500, 0x1.70a9d825b5064p-1, 0x1.70a9d825b5065p-1}, + {0x1.0000001f8p500, -0x1.70a9d825b5064p-1, -0x1.70a9d825b5065p-1}, + {-0x1.00c0bf8p700, 0x1.bf3980c6c1e9fp-1, 0x1.bf3980c6c1eap-1}, + {0x1.00c0bf8p700, -0x1.bf3980c6c1e9fp-1, -0x1.bf3980c6c1eap-1}, + {-0x1.13fffffffff8p6, 0x1.d62899d48b43ap-4, 0x1.d62899d48b439p-4}, + {0x1.13fffffffff8p6, -0x1.d62899d48b43ap-4, -0x1.d62899d48b439p-4}, + {-0x1.17c5920767dfcp-5, -0x1.17b7a60ce1f15p-5, -0x1.17b7a60ce1f14p-5}, + {0x1.17c5920767dfcp-5, 0x1.17b7a60ce1f15p-5, 0x1.17b7a60ce1f14p-5}, + {-0x1.1d99be08713ccp2, 0x1.f0192b794fbbep-1, 0x1.f0192b794fbbfp-1}, + {0x1.1d99be08713ccp2, -0x1.f0192b794fbbep-1, -0x1.f0192b794fbbfp-1}, + {-0x1.1ddbfd64fc0d3p81, -0x1.5e61328c0034fp-3, -0x1.5e61328c0034ep-3}, + {0x1.1ddbfd64fc0d3p81, 0x1.5e61328c0034fp-3, 0x1.5e61328c0034ep-3}, + {-0x1.1e2a1563e068ep7, 0x1.fb028c5df1db4p-1, 0x1.fb028c5df1db3p-1}, + {0x1.1e2a1563e068ep7, -0x1.fb028c5df1db4p-1, -0x1.fb028c5df1db3p-1}, + {-0x1.2e07a91314dp-3, -0x1.2cefb196ba208p-3, -0x1.2cefb196ba207p-3}, + {0x1.2e07a91314dp-3, 0x1.2cefb196ba208p-3, 0x1.2cefb196ba207p-3}, + {-0x1.3bcec270444e2p3, 0x1.b80f489d3edf5p-2, 0x1.b80f489d3edf4p-2}, + {0x1.3bcec270444e2p3, -0x1.b80f489d3edf5p-2, -0x1.b80f489d3edf4p-2}, + {-0x1.500000000004p-20, -0x1.4fffffffffa39p-20, -0x1.4fffffffffa38p-20}, + {0x1.500000000004p-20, 0x1.4fffffffffa39p-20, 0x1.4fffffffffa38p-20}, + {-0x1.559001a42d90cp1, -0x1.d29da5b44f51cp-2, -0x1.d29da5b44f51bp-2}, + {0x1.559001a42d90cp1, 0x1.d29da5b44f51cp-2, 0x1.d29da5b44f51bp-2}, + {-0x1.597bf3e9776b7p99, -0x1.f85f526147f78p-1, -0x1.f85f526147f79p-1}, + {0x1.597bf3e9776b7p99, 0x1.f85f526147f78p-1, 0x1.f85f526147f79p-1}, + {-0x1.6c6cbc45dc8dep7, -0x1.6d61b58c99c43p-59, -0x1.6d61b58c99c42p-59}, + {0x1.6c6cbc45dc8dep7, 0x1.6d61b58c99c43p-59, 0x1.6d61b58c99c42p-59}, + {-0x1.73d8d173f90dp4, 0x1.e5c3c08a258a8p-1, 0x1.e5c3c08a258a7p-1}, + {0x1.73d8d173f90dp4, -0x1.e5c3c08a258a8p-1, -0x1.e5c3c08a258a7p-1}, + {-0x1.8c202d3a31802p6, 0x1.feb36806ca5fbp-1, 0x1.feb36806ca5fcp-1}, + {0x1.8c202d3a31802p6, -0x1.feb36806ca5fbp-1, -0x1.feb36806ca5fcp-1}, + {-0x1.acd538b1a6d5dp-1, -0x1.7c6c7b01b98dap-1, -0x1.7c6c7b01b98d9p-1}, + {0x1.acd538b1a6d5dp-1, 0x1.7c6c7b01b98dap-1, 0x1.7c6c7b01b98d9p-1}, + {-0x1.b7525ac97e0d2p2, -0x1.191be2059dcb6p-1, -0x1.191be2059dcb5p-1}, + {0x1.b7525ac97e0d2p2, 0x1.191be2059dcb6p-1, 0x1.191be2059dcb5p-1}, + {-0x1.bee5fa8a84b02p0, -0x1.f8305993a212cp-1, -0x1.f8305993a212dp-1}, + {0x1.bee5fa8a84b02p0, 0x1.f8305993a212cp-1, 0x1.f8305993a212dp-1}, + {-0x1.c393979fe5921p9, 0x1.ff3b13530fd71p-1, 0x1.ff3b13530fd7p-1}, + {0x1.c393979fe5921p9, -0x1.ff3b13530fd71p-1, -0x1.ff3b13530fd7p-1}, + {-0x1.c48ffc72563c8p18, -0x1.f119da81a4da6p-1, -0x1.f119da81a4da5p-1}, + {0x1.c48ffc72563c8p18, 0x1.f119da81a4da6p-1, 0x1.f119da81a4da5p-1}, + {-0x1.c79548bc31856p3, -0x1.fd73b81e04cccp-1, -0x1.fd73b81e04ccdp-1}, + {0x1.c79548bc31856p3, 0x1.fd73b81e04cccp-1, 0x1.fd73b81e04ccdp-1}, + {-0x1.cb6p-3, -0x1.c7885aef33a95p-3, -0x1.c7885aef33a94p-3}, + {0x1.cb6p-3, 0x1.c7885aef33a95p-3, 0x1.c7885aef33a94p-3}, + {-0x1.e64ddaf7bd72fp-7, -0x1.e6494911eedd1p-7, -0x1.e6494911eeddp-7}, + {0x1.e64ddaf7bd72fp-7, 0x1.e6494911eedd1p-7, 0x1.e6494911eeddp-7}, + {-0x1.ecdd0fbf07942p5, 0x1.e180eef5b1c88p-1, 0x1.e180eef5b1c89p-1}, + {0x1.ecdd0fbf07942p5, -0x1.e180eef5b1c88p-1, -0x1.e180eef5b1c89p-1}, + {-0x1.f073a23292337p2, -0x1.fd98d20c1be44p-1, -0x1.fd98d20c1be43p-1}, + {0x1.f073a23292337p2, 0x1.fd98d20c1be44p-1, 0x1.fd98d20c1be43p-1}, + {-0x1.f5e4c410f4ef8p15, -0x1.7268c112297c8p-5, -0x1.7268c112297c9p-5}, + {0x1.f5e4c410f4ef8p15, 0x1.7268c112297c8p-5, 0x1.7268c112297c9p-5}, + {-0x1.f8000000002p95, 0x1.420796146070ep-18, 0x1.420796146070fp-18}, + {0x1.f8000000002p95, -0x1.420796146070ep-18, -0x1.420796146070fp-18}, + {-0x1.f9365d79546e1p-2, -0x1.e4f6dc499d9ccp-2, -0x1.e4f6dc499d9cdp-2}, + {0x1.f9365d79546e1p-2, 0x1.e4f6dc499d9ccp-2, 0x1.e4f6dc499d9cdp-2}, + {-0x1.ffffffffffe7ep1023, 0x1.b2ef99b140d65p-14, 0x1.b2ef99b140d66p-14}, + {0x1.ffffffffffe7ep1023, -0x1.b2ef99b140d65p-14, -0x1.b2ef99b140d66p-14}, + {0x1.0p15, 0x1.db0ffc3ecc6e4p-1, 0x1.db0ffc3ecc6e3p-1}, + {-0x1.0p15, -0x1.db0ffc3ecc6e4p-1, -0x1.db0ffc3ecc6e3p-1}, + {0x1.0000000000001p13, -0x1.e98f87098b627p-1, -0x1.e98f87098b626p-1}, + {-0x1.0000000000001p13, 0x1.e98f87098b627p-1, 0x1.e98f87098b626p-1}, + {0x1.0000000000001p52, 0x1.053c35068e10dp-4, 0x1.053c35068e10ep-4}, + {-0x1.0000000000001p52, -0x1.053c35068e10dp-4, -0x1.053c35068e10ep-4}, + {0x1.0000000000001p228, 0x1.72d421b6884e5p-1, 0x1.72d421b6884e6p-1}, + {-0x1.0000000000001p228, -0x1.72d421b6884e5p-1, -0x1.72d421b6884e6p-1}, + {0x1.0000000000001p491, 0x1.77fba987c5654p-1, 0x1.77fba987c5653p-1}, + {-0x1.0000000000001p491, -0x1.77fba987c5654p-1, -0x1.77fba987c5653p-1}, + {0x1.0000000000003p215, -0x1.723b2625331afp-1, -0x1.723b2625331bp-1}, + {-0x1.0000000000003p215, 0x1.723b2625331afp-1, 0x1.723b2625331bp-1}, + {0x1.0000000000006p0, 0x1.aed548f090cf5p-1, 0x1.aed548f090cf4p-1}, + {-0x1.0000000000006p0, -0x1.aed548f090cf5p-1, -0x1.aed548f090cf4p-1}, + {0x1.0000000000007p8, -0x1.ff983208c7dc9p-1, -0x1.ff983208c7dcap-1}, + {-0x1.0000000000007p8, 0x1.ff983208c7dc9p-1, 0x1.ff983208c7dcap-1}, + {0x1.0000000000007p275, 0x1.ffef29dc38453p-1, 0x1.ffef29dc38452p-1}, + {-0x1.0000000000007p275, -0x1.ffef29dc38453p-1, -0x1.ffef29dc38452p-1}, + {0x1.0000000000007p449, -0x1.fa88c375723c1p-8, -0x1.fa88c375723cp-8}, + {-0x1.0000000000007p449, 0x1.fa88c375723c1p-8, 0x1.fa88c375723cp-8}, + {0x1.0000000000011p644, 0x1.fff5322c94eaep-1, 0x1.fff5322c94eafp-1}, + {-0x1.0000000000011p644, -0x1.fff5322c94eaep-1, -0x1.fff5322c94eafp-1}, + {0x1.000000000001fp164, -0x1.a73630af8f15cp-1, -0x1.a73630af8f15bp-1}, + {-0x1.000000000001fp164, 0x1.a73630af8f15cp-1, 0x1.a73630af8f15bp-1}, + {0x1.0000000000038p380, 0x1.1c548f9249e44p-2, 0x1.1c548f9249e45p-2}, + {-0x1.0000000000038p380, -0x1.1c548f9249e44p-2, -0x1.1c548f9249e45p-2}, + {0x1.0000000000118p380, 0x1.ca965bd2c4dffp-3, 0x1.ca965bd2c4dfep-3}, + {-0x1.0000000000118p380, -0x1.ca965bd2c4dffp-3, -0x1.ca965bd2c4dfep-3}, + {0x1.000000000012cp2, -0x1.837b9dddc24dp-1, -0x1.837b9dddc24cfp-1}, + {-0x1.000000000012cp2, 0x1.837b9dddc24dp-1, 0x1.837b9dddc24cfp-1}, + {0x1.00000000001f8p700, 0x1.d82c1784c3eccp-2, 0x1.d82c1784c3ecbp-2}, + {-0x1.00000000001f8p700, -0x1.d82c1784c3eccp-2, -0x1.d82c1784c3ecbp-2}, + {0x1.00000000002p-7, 0x1.fffeaaaaef2eep-8, 0x1.fffeaaaaef2efp-8}, + {-0x1.00000000002p-7, -0x1.fffeaaaaef2eep-8, -0x1.fffeaaaaef2efp-8}, + {0x1.00000000002p40, -0x1.0871bddd90fc6p-1, -0x1.0871bddd90fc5p-1}, + {-0x1.00000000002p40, 0x1.0871bddd90fc6p-1, 0x1.0871bddd90fc5p-1}, + {0x1.0000000000201p-7, 0x1.fffeaaaaef2fp-8, 0x1.fffeaaaaef2f1p-8}, + {-0x1.0000000000201p-7, -0x1.fffeaaaaef2fp-8, -0x1.fffeaaaaef2f1p-8}, + {0x1.0000000000221p-7, 0x1.fffeaaaaef33p-8, 0x1.fffeaaaaef331p-8}, + {-0x1.0000000000221p-7, -0x1.fffeaaaaef33p-8, -0x1.fffeaaaaef331p-8}, + {0x1.000000000023ap-7, 0x1.fffeaaaaef362p-8, 0x1.fffeaaaaef363p-8}, + {-0x1.000000000023ap-7, -0x1.fffeaaaaef362p-8, -0x1.fffeaaaaef363p-8}, + {0x1.0000000004p45, 0x1.e0c6edfa93601p-9, 0x1.e0c6edfa93602p-9}, + {-0x1.0000000004p45, -0x1.e0c6edfa93601p-9, -0x1.e0c6edfa93602p-9}, + {0x1.0000000cp40, 0x1.ea1f618356db1p-5, 0x1.ea1f618356dbp-5}, + {-0x1.0000000cp40, -0x1.ea1f618356db1p-5, -0x1.ea1f618356dbp-5}, + {0x1.00000013c86f4p-2, 0x1.faaeed7587542p-3, 0x1.faaeed7587541p-3}, + {-0x1.00000013c86f4p-2, -0x1.faaeed7587542p-3, -0x1.faaeed7587541p-3}, + {0x1.001p13, 0x1.540bc7785680bp-1, 0x1.540bc7785680ap-1}, + {-0x1.001p13, -0x1.540bc7785680bp-1, -0x1.540bc7785680ap-1}, + {0x1.003p699, -0x1.37a7cb907a2e5p-1, -0x1.37a7cb907a2e6p-1}, + {-0x1.003p699, 0x1.37a7cb907a2e5p-1, 0x1.37a7cb907a2e6p-1}, + {0x1.0038p40, -0x1.29e5845fc54b5p-1, -0x1.29e5845fc54b6p-1}, + {-0x1.0038p40, 0x1.29e5845fc54b5p-1, 0x1.29e5845fc54b6p-1}, + {0x1.007p10, 0x1.ffe5ca4656491p-1, 0x1.ffe5ca4656492p-1}, + {-0x1.007p10, -0x1.ffe5ca4656491p-1, -0x1.ffe5ca4656492p-1}, + {0x1.007p25, 0x1.ea4df82db014bp-1, 0x1.ea4df82db014ap-1}, + {-0x1.007p25, -0x1.ea4df82db014bp-1, -0x1.ea4df82db014ap-1}, + {0x1.007p41, 0x1.fe757aef1c80cp-1, 0x1.fe757aef1c80dp-1}, + {-0x1.007p41, -0x1.fe757aef1c80cp-1, -0x1.fe757aef1c80dp-1}, + {0x1.00cp41, 0x1.e9b71805ec068p-7, 0x1.e9b71805ec069p-7}, + {-0x1.00cp41, -0x1.e9b71805ec068p-7, -0x1.e9b71805ec069p-7}, + {0x1.01c00000001p0, 0x1.b0b6d0a540583p-1, 0x1.b0b6d0a540582p-1}, + {-0x1.01c00000001p0, -0x1.b0b6d0a540583p-1, -0x1.b0b6d0a540582p-1}, + {0x1.02322e46da919p-2, 0x1.fef0092627012p-3, 0x1.fef0092627013p-3}, + {-0x1.02322e46da919p-2, -0x1.fef0092627012p-3, -0x1.fef0092627013p-3}, + {0x1.02a236478p-2, 0x1.ffc90059804a1p-3, 0x1.ffc90059804ap-3}, + {-0x1.02a236478p-2, -0x1.ffc90059804a1p-3, -0x1.ffc90059804ap-3}, + {0x1.02a65d08ca5e5p-2, 0x1.ffd10a6b5429fp-3, 0x1.ffd10a6b5429ep-3}, + {-0x1.02a65d08ca5e5p-2, -0x1.ffd10a6b5429fp-3, -0x1.ffd10a6b5429ep-3}, + {0x1.02a65d2dce49ap-2, 0x1.ffd10ab302a3fp-3, 0x1.ffd10ab302a4p-3}, + {-0x1.02a65d2dce49ap-2, -0x1.ffd10ab302a3fp-3, -0x1.ffd10ab302a4p-3}, + {0x1.02ae7238ap-2, 0x1.ffe0b1764ca4cp-3, 0x1.ffe0b1764ca4dp-3}, + {-0x1.02ae7238ap-2, -0x1.ffe0b1764ca4cp-3, -0x1.ffe0b1764ca4dp-3}, + {0x1.0501d22221dacp621, -0x1.f68f0e26c0f6bp-3, -0x1.f68f0e26c0f6ap-3}, + {-0x1.0501d22221dacp621, 0x1.f68f0e26c0f6bp-3, 0x1.f68f0e26c0f6ap-3}, + {0x1.06ffffffffff8p0, 0x1.b63c41f09eb75p-1, 0x1.b63c41f09eb74p-1}, + {-0x1.06ffffffffff8p0, -0x1.b63c41f09eb75p-1, -0x1.b63c41f09eb74p-1}, + {0x1.07023d3d44215p12, -0x1.ffdc173adabb2p-1, -0x1.ffdc173adabb1p-1}, + {-0x1.07023d3d44215p12, 0x1.ffdc173adabb2p-1, 0x1.ffdc173adabb1p-1}, + {0x1.0895a7a3e8ae6p-5, 0x1.0889e11bef135p-5, 0x1.0889e11bef136p-5}, + {-0x1.0895a7a3e8ae6p-5, -0x1.0889e11bef135p-5, -0x1.0889e11bef136p-5}, + {0x1.08d5d69840601p-5, 0x1.08ca077c76445p-5, 0x1.08ca077c76446p-5}, + {-0x1.08d5d69840601p-5, -0x1.08ca077c76445p-5, -0x1.08ca077c76446p-5}, + {0x1.0ep6, -0x1.ff7fbe518023fp-1, -0x1.ff7fbe518023ep-1}, + {-0x1.0ep6, 0x1.ff7fbe518023fp-1, 0x1.ff7fbe518023ep-1}, + {0x1.107ba49c346e4p9, -0x1.fd6c68b877afep-1, -0x1.fd6c68b877affp-1}, + {-0x1.107ba49c346e4p9, 0x1.fd6c68b877afep-1, 0x1.fd6c68b877affp-1}, + {0x1.149154477444p745, -0x1.a2ba6bc70bce4p-1, -0x1.a2ba6bc70bce5p-1}, + {-0x1.149154477444p745, 0x1.a2ba6bc70bce4p-1, 0x1.a2ba6bc70bce5p-1}, + {0x1.1663c0e51818p-5, 0x1.165609790f235p-5, 0x1.165609790f234p-5}, + {-0x1.1663c0e51818p-5, -0x1.165609790f235p-5, -0x1.165609790f234p-5}, + {0x1.1745d1745d176p238, -0x1.fc0523ff94e45p-1, -0x1.fc0523ff94e44p-1}, + {-0x1.1745d1745d176p238, 0x1.fc0523ff94e45p-1, 0x1.fc0523ff94e44p-1}, + {0x1.17472a408a3ep97, 0x1.f34a729c584bdp-1, 0x1.f34a729c584bcp-1}, + {-0x1.17472a408a3ep97, -0x1.f34a729c584bdp-1, -0x1.f34a729c584bcp-1}, + {0x1.178d91b6b992dp-5, 0x1.177fae169fdf1p-5, 0x1.177fae169fdfp-5}, + {-0x1.178d91b6b992dp-5, -0x1.177fae169fdf1p-5, -0x1.177fae169fdfp-5}, + {0x1.178d91b6bad4ep-5, 0x1.177fae16a120fp-5, 0x1.177fae16a120ep-5}, + {-0x1.178d91b6bad4ep-5, -0x1.177fae16a120fp-5, -0x1.177fae16a120ep-5}, + {0x1.178d91b6bbabap-5, 0x1.177fae16a1f79p-5, 0x1.177fae16a1f78p-5}, + {-0x1.178d91b6bbabap-5, -0x1.177fae16a1f79p-5, -0x1.177fae16a1f78p-5}, + {0x1.178d91b6bdc45p-5, 0x1.177fae16a40ffp-5, 0x1.177fae16a40fep-5}, + {-0x1.178d91b6bdc45p-5, -0x1.177fae16a40ffp-5, -0x1.177fae16a40fep-5}, + {0x1.19752dbee5f6ap933, 0x1.297c768f2413p-1, 0x1.297c768f24131p-1}, + {-0x1.19752dbee5f6ap933, -0x1.297c768f2413p-1, -0x1.297c768f24131p-1}, + {0x1.1b3009cfe4dbcp8, 0x1.b826df5cafafap-2, 0x1.b826df5cafafbp-2}, + {-0x1.1b3009cfe4dbcp8, -0x1.b826df5cafafap-2, -0x1.b826df5cafafbp-2}, + {0x1.1f6475d95bf18p3, 0x1.b7a5956250b6bp-2, 0x1.b7a5956250b6ap-2}, + {-0x1.1f6475d95bf18p3, -0x1.b7a5956250b6bp-2, -0x1.b7a5956250b6ap-2}, + {0x1.229148a452291p118, 0x1.4db6566b64548p-1, 0x1.4db6566b64547p-1}, + {-0x1.229148a452291p118, -0x1.4db6566b64548p-1, -0x1.4db6566b64547p-1}, + {0x1.268p-1, 0x1.1686fee2c49a8p-1, 0x1.1686fee2c49a7p-1}, + {-0x1.268p-1, -0x1.1686fee2c49a8p-1, -0x1.1686fee2c49a7p-1}, + {0x1.26fb3844dd19p-2, 0x1.22eb21a44d627p-2, 0x1.22eb21a44d628p-2}, + {-0x1.26fb3844dd19p-2, -0x1.22eb21a44d627p-2, -0x1.22eb21a44d628p-2}, + {0x1.27fffffffe6bp0, 0x1.d4a216d89b2b3p-1, 0x1.d4a216d89b2b4p-1}, + {-0x1.27fffffffe6bp0, -0x1.d4a216d89b2b3p-1, -0x1.d4a216d89b2b4p-1}, + {0x1.284b84048d481p204, -0x1.76c9b0f3a22f8p-1, -0x1.76c9b0f3a22f7p-1}, + {-0x1.284b84048d481p204, 0x1.76c9b0f3a22f8p-1, 0x1.76c9b0f3a22f7p-1}, + {0x1.2999e3109cad4p2, -0x1.ff01226f97d33p-1, -0x1.ff01226f97d32p-1}, + {-0x1.2999e3109cad4p2, 0x1.ff01226f97d33p-1, 0x1.ff01226f97d32p-1}, + {0x1.2aap-5, 0x1.2a8f11e7ae82cp-5, 0x1.2a8f11e7ae82dp-5}, + {-0x1.2aap-5, -0x1.2a8f11e7ae82cp-5, -0x1.2a8f11e7ae82dp-5}, + {0x1.2b14d3be0c23p-5, 0x1.2b03d1bf773dfp-5, 0x1.2b03d1bf773ep-5}, + {-0x1.2b14d3be0c23p-5, -0x1.2b03d1bf773dfp-5, -0x1.2b03d1bf773ep-5}, + {0x1.2b7cb44849981p2, -0x1.ffb90ee641792p-1, -0x1.ffb90ee641791p-1}, + {-0x1.2b7cb44849981p2, 0x1.ffb90ee641792p-1, 0x1.ffb90ee641791p-1}, + {0x1.2becc8685258p200, -0x1.ffffff79e71a4p-1, -0x1.ffffff79e71a3p-1}, + {-0x1.2becc8685258p200, 0x1.ffffff79e71a4p-1, 0x1.ffffff79e71a3p-1}, + {0x1.2cfa14ce27cd5p2, -0x1.fff9edaf85b77p-1, -0x1.fff9edaf85b76p-1}, + {-0x1.2cfa14ce27cd5p2, 0x1.fff9edaf85b77p-1, 0x1.fff9edaf85b76p-1}, + {0x1.2dp-4, 0x1.2cbaaa4cebb52p-4, 0x1.2cbaaa4cebb51p-4}, + {-0x1.2dp-4, -0x1.2cbaaa4cebb52p-4, -0x1.2cbaaa4cebb51p-4}, + {0x1.2d76d18721be8p2, -0x1.ffffbc177e01p-1, -0x1.ffffbc177e00fp-1}, + {-0x1.2d76d18721be8p2, 0x1.ffffbc177e01p-1, 0x1.ffffbc177e00fp-1}, + {0x1.302a494e0909p97, 0x1.745843dfafefdp-18, 0x1.745843dfafefep-18}, + {-0x1.302a494e0909p97, -0x1.745843dfafefdp-18, -0x1.745843dfafefep-18}, + {0x1.31cc731cc731cp1000, 0x1.ffcc568d42376p-1, 0x1.ffcc568d42377p-1}, + {-0x1.31cc731cc731cp1000, -0x1.ffcc568d42376p-1, -0x1.ffcc568d42377p-1}, + {0x1.328463d4f8ca6p441, 0x1.b676077d4faf8p-1, 0x1.b676077d4faf7p-1}, + {-0x1.328463d4f8ca6p441, -0x1.b676077d4faf8p-1, -0x1.b676077d4faf7p-1}, + {0x1.32ce90b32171ep18, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.32ce90b32171ep18, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.35debd7f020ecp-5, 0x1.35cbd3240d149p-5, 0x1.35cbd3240d148p-5}, + {-0x1.35debd7f020ecp-5, -0x1.35cbd3240d149p-5, -0x1.35cbd3240d148p-5}, + {0x1.3bb3487893405p-7, 0x1.3bb2086559faap-7, 0x1.3bb2086559fa9p-7}, + {-0x1.3bb3487893405p-7, -0x1.3bb2086559faap-7, -0x1.3bb2086559fa9p-7}, + {0x1.3bb3487893407p-7, 0x1.3bb2086559facp-7, 0x1.3bb2086559fabp-7}, + {-0x1.3bb3487893407p-7, -0x1.3bb2086559facp-7, -0x1.3bb2086559fabp-7}, + {0x1.3bb681d65aa6p100, 0x1.dff197edc51d2p-16, 0x1.dff197edc51d3p-16}, + {-0x1.3bb681d65aa6p100, -0x1.dff197edc51d2p-16, -0x1.dff197edc51d3p-16}, + {0x1.3f9aa8626042fp83, -0x1.5d08d3dbb41bp-3, -0x1.5d08d3dbb41afp-3}, + {-0x1.3f9aa8626042fp83, 0x1.5d08d3dbb41bp-3, 0x1.5d08d3dbb41afp-3}, + {0x1.3fep19, 0x1.fb503983f94bbp-3, 0x1.fb503983f94bcp-3}, + {-0x1.3fep19, -0x1.fb503983f94bbp-3, -0x1.fb503983f94bcp-3}, + {0x1.4285478f1e3c8p58, -0x1.d3876eacc9ee7p-1, -0x1.d3876eacc9ee6p-1}, + {-0x1.4285478f1e3c8p58, 0x1.d3876eacc9ee7p-1, 0x1.d3876eacc9ee6p-1}, + {0x1.42cbcf45a169ep-5, 0x1.42b66d54f69c1p-5, 0x1.42b66d54f69cp-5}, + {-0x1.42cbcf45a169ep-5, -0x1.42b66d54f69c1p-5, -0x1.42b66d54f69cp-5}, + {0x1.43fffffffff6ap557, 0x1.b45e9e9427554p-1, 0x1.b45e9e9427553p-1}, + {-0x1.43fffffffff6ap557, -0x1.b45e9e9427554p-1, -0x1.b45e9e9427553p-1}, + {0x1.44p-17, 0x1.43ffffffea603p-17, 0x1.43ffffffea602p-17}, + {-0x1.44p-17, -0x1.43ffffffea603p-17, -0x1.43ffffffea602p-17}, + {0x1.4748c08dc0976p200, -0x1.6a4e98d2d8b1cp-1, -0x1.6a4e98d2d8b1bp-1}, + {-0x1.4748c08dc0976p200, 0x1.6a4e98d2d8b1cp-1, 0x1.6a4e98d2d8b1bp-1}, + {0x1.478fc08p43, -0x1.b57ca8aacf2a9p-1, -0x1.b57ca8aacf2aap-1}, + {-0x1.478fc08p43, 0x1.b57ca8aacf2a9p-1, 0x1.b57ca8aacf2aap-1}, + {0x1.4cf36d17c596ep200, 0x1.ffe38008ef6b5p-1, 0x1.ffe38008ef6b4p-1}, + {-0x1.4cf36d17c596ep200, -0x1.ffe38008ef6b5p-1, -0x1.ffe38008ef6b4p-1}, + {0x1.4f0f308p488, 0x1.d6457a3f12e6cp-1, 0x1.d6457a3f12e6dp-1}, + {-0x1.4f0f308p488, -0x1.d6457a3f12e6cp-1, -0x1.d6457a3f12e6dp-1}, + {0x1.5p-20, 0x1.4fffffffff9f9p-20, 0x1.4fffffffff9f8p-20}, + {-0x1.5p-20, -0x1.4fffffffff9f9p-20, -0x1.4fffffffff9f8p-20}, + {0x1.5143e25a488f1p3, -0x1.cbad095f503a2p-1, -0x1.cbad095f503a1p-1}, + {-0x1.5143e25a488f1p3, 0x1.cbad095f503a2p-1, 0x1.cbad095f503a1p-1}, + {0x1.51f0f44da4df4p200, -0x1.f942d6262e82ep-5, -0x1.f942d6262e82dp-5}, + {-0x1.51f0f44da4df4p200, 0x1.f942d6262e82ep-5, 0x1.f942d6262e82dp-5}, + {0x1.52ad6c5a3602fp16, -0x1.fc466ccaece8p-3, -0x1.fc466ccaece81p-3}, + {-0x1.52ad6c5a3602fp16, 0x1.fc466ccaece8p-3, 0x1.fc466ccaece81p-3}, + {0x1.52f00ep793, 0x1.d69c3cf4eecdep-1, 0x1.d69c3cf4eecddp-1}, + {-0x1.52f00ep793, -0x1.d69c3cf4eecdep-1, -0x1.d69c3cf4eecddp-1}, + {0x1.5555555555556p239, 0x1.e120292f3d495p-1, 0x1.e120292f3d496p-1}, + {-0x1.5555555555556p239, -0x1.e120292f3d495p-1, -0x1.e120292f3d496p-1}, + {0x1.5a0000008p6, -0x1.fd1d85b7ef004p-1, -0x1.fd1d85b7ef003p-1}, + {-0x1.5a0000008p6, 0x1.fd1d85b7ef004p-1, 0x1.fd1d85b7ef003p-1}, + {0x1.5b063ad2dd08fp-6, 0x1.5aff9664b07e2p-6, 0x1.5aff9664b07e1p-6}, + {-0x1.5b063ad2dd08fp-6, -0x1.5aff9664b07e2p-6, -0x1.5aff9664b07e1p-6}, + {0x1.5b179d75fa285p2, -0x1.83f8bbb59f2f8p-1, -0x1.83f8bbb59f2f9p-1}, + {-0x1.5b179d75fa285p2, 0x1.83f8bbb59f2f8p-1, 0x1.83f8bbb59f2f9p-1}, + {0x1.5bb5967402f9cp79, 0x1.fa865b0d99497p-1, 0x1.fa865b0d99496p-1}, + {-0x1.5bb5967402f9cp79, -0x1.fa865b0d99497p-1, -0x1.fa865b0d99496p-1}, + {0x1.5bea01p468, 0x1.e8a523fce884dp-2, 0x1.e8a523fce884ep-2}, + {-0x1.5bea01p468, -0x1.e8a523fce884dp-2, -0x1.e8a523fce884ep-2}, + {0x1.5f19fbc507af6p9, -0x1.ff2ad941f0a41p-1, -0x1.ff2ad941f0a4p-1}, + {-0x1.5f19fbc507af6p9, 0x1.ff2ad941f0a41p-1, 0x1.ff2ad941f0a4p-1}, + {0x1.60a610a658da9p889, -0x1.75ce4a0d0bd03p-1, -0x1.75ce4a0d0bd04p-1}, + {-0x1.60a610a658da9p889, 0x1.75ce4a0d0bd03p-1, 0x1.75ce4a0d0bd04p-1}, + {0x1.62ad7ce17143dp62, -0x1.721586594ab48p-1, -0x1.721586594ab49p-1}, + {-0x1.62ad7ce17143dp62, 0x1.721586594ab48p-1, 0x1.721586594ab49p-1}, + {0x1.645926cc1132cp9, 0x1.b8d27019d1b9fp-2, 0x1.b8d27019d1b9ep-2}, + {-0x1.645926cc1132cp9, -0x1.b8d27019d1b9fp-2, -0x1.b8d27019d1b9ep-2}, + {0x1.647e25d391f17p-9, 0x1.647e09059c1eap-9, 0x1.647e09059c1e9p-9}, + {-0x1.647e25d391f17p-9, -0x1.647e09059c1eap-9, -0x1.647e09059c1e9p-9}, + {0x1.64ef438p142, -0x1.8d3b53ff85a82p-1, -0x1.8d3b53ff85a83p-1}, + {-0x1.64ef438p142, 0x1.8d3b53ff85a82p-1, 0x1.8d3b53ff85a83p-1}, + {0x1.6599665996658p3, -0x1.f7c8630e62a02p-1, -0x1.f7c8630e62a01p-1}, + {-0x1.6599665996658p3, 0x1.f7c8630e62a02p-1, 0x1.f7c8630e62a01p-1}, + {0x1.672p-5, 0x1.67028e3602035p-5, 0x1.67028e3602034p-5}, + {-0x1.672p-5, -0x1.67028e3602035p-5, -0x1.67028e3602034p-5}, + {0x1.688ae6c138ea8p299, 0x1.bc60c8c33cb5fp-2, 0x1.bc60c8c33cb5ep-2}, + {-0x1.688ae6c138ea8p299, -0x1.bc60c8c33cb5fp-2, -0x1.bc60c8c33cb5ep-2}, + {0x1.6aa78p17, -0x1.fc3b4bb8b012ep-1, -0x1.fc3b4bb8b012fp-1}, + {-0x1.6aa78p17, 0x1.fc3b4bb8b012ep-1, 0x1.fc3b4bb8b012fp-1}, + {0x1.6ac5b262ca1ffp849, 0x1.0p0, 0x1.0p0}, + {-0x1.6ac5b262ca1ffp849, -0x1.0p0, -0x1.0p0}, + {0x1.6d88083749412p4, -0x1.82317836a97c8p-1, -0x1.82317836a97c9p-1}, + {-0x1.6d88083749412p4, 0x1.82317836a97c8p-1, 0x1.82317836a97c9p-1}, + {0x1.6f8p-6, 0x1.6f781c78cc82bp-6, 0x1.6f781c78cc82ap-6}, + {-0x1.6f8p-6, -0x1.6f781c78cc82bp-6, -0x1.6f781c78cc82ap-6}, + {0x1.729aa6859d1f4p396, -0x1.fdbe5085494aep-1, -0x1.fdbe5085494afp-1}, + {-0x1.729aa6859d1f4p396, 0x1.fdbe5085494aep-1, 0x1.fdbe5085494afp-1}, + {0x1.73e2dbe9a2f8p10, -0x1.fffffae862b5p-1, -0x1.fffffae862b4fp-1}, + {-0x1.73e2dbe9a2f8p10, 0x1.fffffae862b5p-1, 0x1.fffffae862b4fp-1}, + {0x1.769cde0b90b8p-7, 0x1.769ac74459b06p-7, 0x1.769ac74459b05p-7}, + {-0x1.769cde0b90b8p-7, -0x1.769ac74459b06p-7, -0x1.769ac74459b05p-7}, + {0x1.76cp-5, 0x1.769e8afb6a4ecp-5, 0x1.769e8afb6a4ebp-5}, + {-0x1.76cp-5, -0x1.769e8afb6a4ecp-5, -0x1.769e8afb6a4ebp-5}, + {0x1.78001p0, 0x1.fd562611f5bd4p-1, 0x1.fd562611f5bd5p-1}, + {-0x1.78001p0, -0x1.fd562611f5bd4p-1, -0x1.fd562611f5bd5p-1}, + {0x1.7ap0, 0x1.fdba784ca00f2p-1, 0x1.fdba784ca00f1p-1}, + {-0x1.7ap0, -0x1.fdba784ca00f2p-1, -0x1.fdba784ca00f1p-1}, + {0x1.7abd870381c2dp38, 0x1.f930c222a8683p-5, 0x1.f930c222a8682p-5}, + {-0x1.7abd870381c2dp38, -0x1.f930c222a8683p-5, -0x1.f930c222a8682p-5}, + {0x1.7dc945c21248p95, 0x1.ffeb2ff2b6923p-1, 0x1.ffeb2ff2b6924p-1}, + {-0x1.7dc945c21248p95, -0x1.ffeb2ff2b6923p-1, -0x1.ffeb2ff2b6924p-1}, + {0x1.7f73e1594b70cp98, 0x1.b279153c23fb2p-2, 0x1.b279153c23fb1p-2}, + {-0x1.7f73e1594b70cp98, -0x1.b279153c23fb2p-2, -0x1.b279153c23fb1p-2}, + {0x1.7f7ef77e83f1ap21, -0x1.599fad35cf60bp-41, -0x1.599fad35cf60ap-41}, + {-0x1.7f7ef77e83f1ap21, 0x1.599fad35cf60bp-41, 0x1.599fad35cf60ap-41}, + {0x1.8p0, 0x1.feb7a9b2c6d8bp-1, 0x1.feb7a9b2c6d8ap-1}, + {-0x1.8p0, -0x1.feb7a9b2c6d8bp-1, -0x1.feb7a9b2c6d8ap-1}, + {0x1.8p6, 0x1.f798d01ec615cp-1, 0x1.f798d01ec615bp-1}, + {-0x1.8p6, -0x1.f798d01ec615cp-1, -0x1.f798d01ec615bp-1}, + {0x1.8132ceb1c4f39p0, 0x1.fee1a2a977bcfp-1, 0x1.fee1a2a977bcep-1}, + {-0x1.8132ceb1c4f39p0, -0x1.fee1a2a977bcfp-1, -0x1.fee1a2a977bcep-1}, + {0x1.81ae0dffa3b33p959, -0x1.24245af4cd995p-52, -0x1.24245af4cd994p-52}, + {-0x1.81ae0dffa3b33p959, 0x1.24245af4cd995p-52, 0x1.24245af4cd994p-52}, + {0x1.85ec5a399a2e6p1, 0x1.85d41b0bf3091p-4, 0x1.85d41b0bf309p-4}, + {-0x1.85ec5a399a2e6p1, -0x1.85d41b0bf3091p-4, -0x1.85d41b0bf309p-4}, + {0x1.86a0092754022p16, 0x1.1e42ae3cfbdc6p-24, 0x1.1e42ae3cfbdc7p-24}, + {-0x1.86a0092754022p16, -0x1.1e42ae3cfbdc6p-24, -0x1.1e42ae3cfbdc7p-24}, + {0x1.8720588p392, -0x1.dbf4e594cefe1p-1, -0x1.dbf4e594cefe2p-1}, + {-0x1.8720588p392, 0x1.dbf4e594cefe1p-1, 0x1.dbf4e594cefe2p-1}, + {0x1.8929354ebc6aap43, 0x1.44302d6a82d4p-9, 0x1.44302d6a82d41p-9}, + {-0x1.8929354ebc6aap43, -0x1.44302d6a82d4p-9, -0x1.44302d6a82d41p-9}, + {0x1.8a791e4791e75p-5, 0x1.8a52189ec3487p-5, 0x1.8a52189ec3488p-5}, + {-0x1.8a791e4791e75p-5, -0x1.8a52189ec3487p-5, -0x1.8a52189ec3488p-5}, + {0x1.8ba761438f5edp11, -0x1.fe8566e538123p-1, -0x1.fe8566e538122p-1}, + {-0x1.8ba761438f5edp11, 0x1.fe8566e538123p-1, 0x1.fe8566e538122p-1}, + {0x1.8eaf16de6392p0, 0x1.fff42aca4cb5ap-1, 0x1.fff42aca4cb5bp-1}, + {-0x1.8eaf16de6392p0, -0x1.fff42aca4cb5ap-1, -0x1.fff42aca4cb5bp-1}, + {0x1.9p0, 0x1.fffb7d3f3a253p-1, 0x1.fffb7d3f3a252p-1}, + {-0x1.9p0, -0x1.fffb7d3f3a253p-1, -0x1.fffb7d3f3a252p-1}, + {0x1.91a5657fb6a9ap6, -0x1.e815770667fd9p-4, -0x1.e815770667fd8p-4}, + {-0x1.91a5657fb6a9ap6, 0x1.e815770667fd9p-4, 0x1.e815770667fd8p-4}, + {0x1.921fb54468847p37, -0x1.fffffffd311dcp-1, -0x1.fffffffd311ddp-1}, + {-0x1.921fb54468847p37, 0x1.fffffffd311dcp-1, 0x1.fffffffd311ddp-1}, + {0x1.921ff54442d18p2, 0x1.ffffffff875e6p-17, 0x1.ffffffff875e5p-17}, + {-0x1.921ff54442d18p2, -0x1.ffffffff875e6p-17, -0x1.ffffffff875e5p-17}, + {0x1.928p2, 0x1.812a5da3777cdp-8, 0x1.812a5da3777cep-8}, + {-0x1.928p2, -0x1.812a5da3777cdp-8, -0x1.812a5da3777cep-8}, + {0x1.94ap0, 0x1.fff9be8d82573p-1, 0x1.fff9be8d82572p-1}, + {-0x1.94ap0, -0x1.fff9be8d82573p-1, -0x1.fff9be8d82572p-1}, + {0x1.94a5294a51bdep-5, 0x1.947b0ace235f3p-5, 0x1.947b0ace235f2p-5}, + {-0x1.94a5294a51bdep-5, -0x1.947b0ace235f3p-5, -0x1.947b0ace235f2p-5}, + {0x1.94a5294a52948p100, 0x1.c34f70e55a708p-2, 0x1.c34f70e55a707p-2}, + {-0x1.94a5294a52948p100, -0x1.c34f70e55a708p-2, -0x1.c34f70e55a707p-2}, + {0x1.95361b8f7697dp-5, 0x1.950bcfc0f3d51p-5, 0x1.950bcfc0f3d5p-5}, + {-0x1.95361b8f7697dp-5, -0x1.950bcfc0f3d51p-5, -0x1.950bcfc0f3d5p-5}, + {0x1.956p-1, 0x1.6c548bfcce696p-1, 0x1.6c548bfcce695p-1}, + {-0x1.956p-1, -0x1.6c548bfcce696p-1, -0x1.6c548bfcce695p-1}, + {0x1.962p0, 0x1.ffeffdbf67ca6p-1, 0x1.ffeffdbf67ca7p-1}, + {-0x1.962p0, -0x1.ffeffdbf67ca6p-1, -0x1.ffeffdbf67ca7p-1}, + {0x1.97330d2ea16d9p-5, 0x1.9708213bf67f5p-5, 0x1.9708213bf67f4p-5}, + {-0x1.97330d2ea16d9p-5, -0x1.9708213bf67f5p-5, -0x1.9708213bf67f4p-5}, + {0x1.9756f073b6b61p-5, 0x1.972bf92713d51p-5, 0x1.972bf92713d5p-5}, + {-0x1.9756f073b6b61p-5, -0x1.972bf92713d51p-5, -0x1.972bf92713d5p-5}, + {0x1.97935055cec1bp-5, 0x1.976845ebe7119p-5, 0x1.976845ebe7118p-5}, + {-0x1.97935055cec1bp-5, -0x1.976845ebe7119p-5, -0x1.976845ebe7118p-5}, + {0x1.98p-4, 0x1.97535cee51a43p-4, 0x1.97535cee51a42p-4}, + {-0x1.98p-4, -0x1.97535cee51a43p-4, -0x1.97535cee51a42p-4}, + {0x1.999999a42160cp-1, 0x1.6f494c3356177p-1, 0x1.6f494c3356178p-1}, + {-0x1.999999a42160cp-1, -0x1.6f494c3356177p-1, -0x1.6f494c3356178p-1}, + {0x1.999999aab8f5p-1, 0x1.6f494c37edd6ep-1, 0x1.6f494c37edd6dp-1}, + {-0x1.999999aab8f5p-1, -0x1.6f494c37edd6ep-1, -0x1.6f494c37edd6dp-1}, + {0x1.9a2324b9c6326p-1, 0x1.6fa912bdeaab2p-1, 0x1.6fa912bdeaab3p-1}, + {-0x1.9a2324b9c6326p-1, -0x1.6fa912bdeaab2p-1, -0x1.6fa912bdeaab3p-1}, + {0x1.9bcp-1, 0x1.70c7ef4ef9b34p-1, 0x1.70c7ef4ef9b35p-1}, + {-0x1.9bcp-1, -0x1.70c7ef4ef9b34p-1, -0x1.70c7ef4ef9b35p-1}, + {0x1.a0d1d817d6c4ap0, 0x1.ff28176ad3164p-1, 0x1.ff28176ad3163p-1}, + {-0x1.a0d1d817d6c4ap0, -0x1.ff28176ad3164p-1, -0x1.ff28176ad3163p-1}, + {0x1.a141c9de12fdfp-1, 0x1.749468a7248dep-1, 0x1.749468a7248ddp-1}, + {-0x1.a141c9de12fdfp-1, -0x1.749468a7248dep-1, -0x1.749468a7248ddp-1}, + {0x1.a251bc6766f2p-1, 0x1.754ebb7e73f46p-1, 0x1.754ebb7e73f45p-1}, + {-0x1.a251bc6766f2p-1, -0x1.754ebb7e73f46p-1, -0x1.754ebb7e73f45p-1}, + {0x1.a2689ae1b86ddp62, -0x1.7c3bfefa74bd1p-1, -0x1.7c3bfefa74bdp-1}, + {-0x1.a2689ae1b86ddp62, 0x1.7c3bfefa74bd1p-1, 0x1.7c3bfefa74bdp-1}, + {0x1.a3f66180c455p100, -0x1.ffff4f3648e03p-1, -0x1.ffff4f3648e02p-1}, + {-0x1.a3f66180c455p100, 0x1.ffff4f3648e03p-1, 0x1.ffff4f3648e02p-1}, + {0x1.a3fdd2a5286c3p1, -0x1.1cf463983c0e3p-3, -0x1.1cf463983c0e2p-3}, + {-0x1.a3fdd2a5286c3p1, 0x1.1cf463983c0e3p-3, 0x1.1cf463983c0e2p-3}, + {0x1.a44p0, 0x1.feb7948d224d8p-1, 0x1.feb7948d224d7p-1}, + {-0x1.a44p0, -0x1.feb7948d224d8p-1, -0x1.feb7948d224d7p-1}, + {0x1.a701ef3c7d54bp-1, 0x1.78801e3e11665p-1, 0x1.78801e3e11664p-1}, + {-0x1.a701ef3c7d54bp-1, -0x1.78801e3e11665p-1, -0x1.78801e3e11664p-1}, + {0x1.a8c01fd43cp537, -0x1.fff11e871d59cp-1, -0x1.fff11e871d59dp-1}, + {-0x1.a8c01fd43cp537, 0x1.fff11e871d59cp-1, 0x1.fff11e871d59dp-1}, + {0x1.a8e29b7602f3bp0, 0x1.fdfa4366eb733p-1, 0x1.fdfa4366eb734p-1}, + {-0x1.a8e29b7602f3bp0, -0x1.fdfa4366eb733p-1, -0x1.fdfa4366eb734p-1}, + {0x1.a94p0, 0x1.fde98b94e7948p-1, 0x1.fde98b94e7947p-1}, + {-0x1.a94p0, -0x1.fde98b94e7948p-1, -0x1.fde98b94e7947p-1}, + {0x1.aa445fce93b82p2, 0x1.7931cba100008p-2, 0x1.7931cba100009p-2}, + {-0x1.aa445fce93b82p2, -0x1.7931cba100008p-2, -0x1.7931cba100009p-2}, + {0x1.aaa3fbc359fbep-1, 0x1.7af3f76c7a708p-1, 0x1.7af3f76c7a709p-1}, + {-0x1.aaa3fbc359fbep-1, -0x1.7af3f76c7a708p-1, -0x1.7af3f76c7a709p-1}, + {0x1.abdd3dbd4d86p119, 0x1.fd74e53ae32fdp-6, 0x1.fd74e53ae32fcp-6}, + {-0x1.abdd3dbd4d86p119, -0x1.fd74e53ae32fdp-6, -0x1.fd74e53ae32fcp-6}, + {0x1.ae2165a0c9f8ep-1, 0x1.7d4a7bf183a34p-1, 0x1.7d4a7bf183a33p-1}, + {-0x1.ae2165a0c9f8ep-1, -0x1.7d4a7bf183a34p-1, -0x1.7d4a7bf183a33p-1}, + {0x1.ae8dfefcfe13bp2, 0x1.b81410edc79e1p-2, 0x1.b81410edc79ep-2}, + {-0x1.ae8dfefcfe13bp2, -0x1.b81410edc79e1p-2, -0x1.b81410edc79ep-2}, + {0x1.b5597f950ee8cp29, -0x1.ff751561dc50ap-2, -0x1.ff751561dc509p-2}, + {-0x1.b5597f950ee8cp29, 0x1.ff751561dc50ap-2, 0x1.ff751561dc509p-2}, + {0x1.bab62ed655019p970, 0x1.027d184afb198p-52, 0x1.027d184afb199p-52}, + {-0x1.bab62ed655019p970, -0x1.027d184afb198p-52, -0x1.027d184afb199p-52}, + {0x1.bc573c4ffffffp-10, 0x1.bc572e5e413e1p-10, 0x1.bc572e5e413e2p-10}, + {-0x1.bc573c4ffffffp-10, -0x1.bc572e5e413e1p-10, -0x1.bc572e5e413e2p-10}, + {0x1.bef5cd25ab1adp9, 0x1.fb300f1e39afep-1, 0x1.fb300f1e39affp-1}, + {-0x1.bef5cd25ab1adp9, -0x1.fb300f1e39afep-1, -0x1.fb300f1e39affp-1}, + {0x1.bfdf6df2a24c1p-2, 0x1.b1baaf622d3a3p-2, 0x1.b1baaf622d3a2p-2}, + {-0x1.bfdf6df2a24c1p-2, -0x1.b1baaf622d3a3p-2, -0x1.b1baaf622d3a2p-2}, + {0x1.bfffffdffffffp-1, 0x1.88fb762c35ce4p-1, 0x1.88fb762c35ce3p-1}, + {-0x1.bfffffdffffffp-1, -0x1.88fb762c35ce4p-1, -0x1.88fb762c35ce3p-1}, + {0x1.c2b489520e376p920, 0x1.fe0ebff99ab8dp-1, 0x1.fe0ebff99ab8cp-1}, + {-0x1.c2b489520e376p920, -0x1.fe0ebff99ab8dp-1, -0x1.fe0ebff99ab8cp-1}, + {0x1.c54beb008547p5, 0x1.cf7f749f2a836p-4, 0x1.cf7f749f2a835p-4}, + {-0x1.c54beb008547p5, -0x1.cf7f749f2a836p-4, -0x1.cf7f749f2a835p-4}, + {0x1.c5ad34f5f472ap-2, 0x1.b6facf6658915p-2, 0x1.b6facf6658914p-2}, + {-0x1.c5ad34f5f472ap-2, -0x1.b6facf6658915p-2, -0x1.b6facf6658914p-2}, + {0x1.c728fc2f34bd6p-2, 0x1.b851cd9b84ee7p-2, 0x1.b851cd9b84ee6p-2}, + {-0x1.c728fc2f34bd6p-2, -0x1.b851cd9b84ee7p-2, -0x1.b851cd9b84ee6p-2}, + {0x1.c92b0f6105089p-2, 0x1.ba21b53cf2ff3p-2, 0x1.ba21b53cf2ff2p-2}, + {-0x1.c92b0f6105089p-2, -0x1.ba21b53cf2ff3p-2, -0x1.ba21b53cf2ff2p-2}, + {0x1.c9dfbbe9ec704p-5, 0x1.c9a2b68e30ec7p-5, 0x1.c9a2b68e30ec8p-5}, + {-0x1.c9dfbbe9ec704p-5, -0x1.c9a2b68e30ec7p-5, -0x1.c9a2b68e30ec8p-5}, + {0x1.caf31bd7ee217p0, 0x1.f370115c9ab35p-1, 0x1.f370115c9ab36p-1}, + {-0x1.caf31bd7ee217p0, -0x1.f370115c9ab35p-1, -0x1.f370115c9ab36p-1}, + {0x1.cb44e86bc192bp648, -0x1.dd38a1f1d289bp-54, -0x1.dd38a1f1d289cp-54}, + {-0x1.cb44e86bc192bp648, 0x1.dd38a1f1d289bp-54, 0x1.dd38a1f1d289cp-54}, + {0x1.cb44e86bc192bp649, 0x1.dd38a1f1d289bp-53, 0x1.dd38a1f1d289cp-53}, + {-0x1.cb44e86bc192bp649, -0x1.dd38a1f1d289bp-53, -0x1.dd38a1f1d289cp-53}, + {0x1.cb6p-3, 0x1.c7885aef33a95p-3, 0x1.c7885aef33a94p-3}, + {-0x1.cb6p-3, -0x1.c7885aef33a95p-3, -0x1.c7885aef33a94p-3}, + {0x1.ce2271d2f662fp-4, 0x1.cd279aa6196b6p-4, 0x1.cd279aa6196b5p-4}, + {-0x1.ce2271d2f662fp-4, -0x1.cd279aa6196b6p-4, -0x1.cd279aa6196b5p-4}, + {0x1.d0000000004p-1, 0x1.930b705f9fad2p-1, 0x1.930b705f9fad1p-1}, + {-0x1.d0000000004p-1, -0x1.930b705f9fad2p-1, -0x1.930b705f9fad1p-1}, + {0x1.d01p199, 0x1.7ef24c8e67d9ap-1, 0x1.7ef24c8e67d9bp-1}, + {-0x1.d01p199, -0x1.7ef24c8e67d9ap-1, -0x1.7ef24c8e67d9bp-1}, + {0x1.d024ba6f953cfp1000, 0x1.ffff124c001abp-1, 0x1.ffff124c001aap-1}, + {-0x1.d024ba6f953cfp1000, -0x1.ffff124c001abp-1, -0x1.ffff124c001aap-1}, + {0x1.d4067c60f471ep1, -0x1.f83a0983dd15dp-2, -0x1.f83a0983dd15ep-2}, + {-0x1.d4067c60f471ep1, 0x1.f83a0983dd15dp-2, 0x1.f83a0983dd15ep-2}, + {0x1.d7de6263bcaabp-5, 0x1.d79b9896ff555p-5, 0x1.d79b9896ff554p-5}, + {-0x1.d7de6263bcaabp-5, -0x1.d79b9896ff555p-5, -0x1.d79b9896ff554p-5}, + {0x1.d800000002274p0, 0x1.ed0b908a2983p-1, 0x1.ed0b908a2982fp-1}, + {-0x1.d800000002274p0, -0x1.ed0b908a2983p-1, -0x1.ed0b908a2982fp-1}, + {0x1.d96e058p488, -0x1.f2c217cbc7dcdp-1, -0x1.f2c217cbc7dccp-1}, + {-0x1.d96e058p488, 0x1.f2c217cbc7dcdp-1, 0x1.f2c217cbc7dccp-1}, + {0x1.d98c4c612718dp-1, 0x1.98dcd09337793p-1, 0x1.98dcd09337792p-1}, + {-0x1.d98c4c612718dp-1, -0x1.98dcd09337793p-1, -0x1.98dcd09337792p-1}, + {0x1.db8p-5, 0x1.db3ba8775ca26p-5, 0x1.db3ba8775ca25p-5}, + {-0x1.db8p-5, -0x1.db3ba8775ca26p-5, -0x1.db3ba8775ca25p-5}, + {0x1.de386d6090303p200, -0x1.9fee37697d582p-2, -0x1.9fee37697d583p-2}, + {-0x1.de386d6090303p200, 0x1.9fee37697d582p-2, 0x1.9fee37697d583p-2}, + {0x1.de5e5054e921bp35, -0x1.5361ee6553188p-53, -0x1.5361ee6553189p-53}, + {-0x1.de5e5054e921bp35, 0x1.5361ee6553188p-53, 0x1.5361ee6553189p-53}, + {0x1.df77ddf77ddf4p10, 0x1.fec48d5e769ecp-1, 0x1.fec48d5e769ebp-1}, + {-0x1.df77ddf77ddf4p10, -0x1.fec48d5e769ecp-1, -0x1.fec48d5e769ebp-1}, + {0x1.e1562b0448a86p1, -0x1.2902a83d72632p-1, -0x1.2902a83d72633p-1}, + {-0x1.e1562b0448a86p1, 0x1.2902a83d72632p-1, 0x1.2902a83d72633p-1}, + {0x1.e2700cdc86635p-1, 0x1.9e26c7bc96b69p-1, 0x1.9e26c7bc96b68p-1}, + {-0x1.e2700cdc86635p-1, -0x1.9e26c7bc96b69p-1, -0x1.9e26c7bc96b68p-1}, + {0x1.e64ddaf7bd73p-7, 0x1.e6494911eedd2p-7, 0x1.e6494911eedd1p-7}, + {-0x1.e64ddaf7bd73p-7, -0x1.e6494911eedd2p-7, -0x1.e6494911eedd1p-7}, + {0x1.eb7239bca8afap-5, 0x1.eb26c690bda25p-5, 0x1.eb26c690bda24p-5}, + {-0x1.eb7239bca8afap-5, -0x1.eb26c690bda25p-5, -0x1.eb26c690bda24p-5}, + {0x1.ef7b83f7bdef4p3, 0x1.c73238790a4cfp-3, 0x1.c73238790a4cep-3}, + {-0x1.ef7b83f7bdef4p3, -0x1.c73238790a4cfp-3, -0x1.c73238790a4cep-3}, + {0x1.f20000000109bp-3, 0x1.ed1b575acb8c8p-3, 0x1.ed1b575acb8c9p-3}, + {-0x1.f20000000109bp-3, -0x1.ed1b575acb8c8p-3, -0x1.ed1b575acb8c9p-3}, + {0x1.f40ca67a9e8d7p9, 0x1.c1b50a56c8809p-1, 0x1.c1b50a56c880ap-1}, + {-0x1.f40ca67a9e8d7p9, -0x1.c1b50a56c8809p-1, -0x1.c1b50a56c880ap-1}, + {0x1.f7224d2c7754p-2, 0x1.e321fea643a96p-2, 0x1.e321fea643a97p-2}, + {-0x1.f7224d2c7754p-2, -0x1.e321fea643a96p-2, -0x1.e321fea643a97p-2}, + {0x1.f78a0d05e60e2p6, 0x1.c1269b020a108p-3, 0x1.c1269b020a107p-3}, + {-0x1.f78a0d05e60e2p6, -0x1.c1269b020a108p-3, -0x1.c1269b020a107p-3}, + {0x1.f7bdef7bdf073p-5, 0x1.f76cae28a0775p-5, 0x1.f76cae28a0774p-5}, + {-0x1.f7bdef7bdf073p-5, -0x1.f76cae28a0775p-5, -0x1.f76cae28a0774p-5}, + {0x1.f8502d5955443p-2, 0x1.e42c139dc2054p-2, 0x1.e42c139dc2053p-2}, + {-0x1.f8502d5955443p-2, -0x1.e42c139dc2054p-2, -0x1.e42c139dc2053p-2}, + {0x1.f8fc824d2693bp61, 0x1.0fa749e07f64p-9, 0x1.0fa749e07f63fp-9}, + {-0x1.f8fc824d2693bp61, -0x1.0fa749e07f64p-9, -0x1.0fa749e07f63fp-9}, + {0x1.f8fffffffffffp2, 0x1.ffa80324e2d8fp-1, 0x1.ffa80324e2d8ep-1}, + {-0x1.f8fffffffffffp2, -0x1.ffa80324e2d8fp-1, -0x1.ffa80324e2d8ep-1}, + {0x1.fd8p1, -0x1.7cdf79d5e37b8p-1, -0x1.7cdf79d5e37b9p-1}, + {-0x1.fd8p1, 0x1.7cdf79d5e37b8p-1, 0x1.7cdf79d5e37b9p-1}, + {0x1.fd9364d936596p-5, 0x1.fd3f48847a1d1p-5, 0x1.fd3f48847a1d2p-5}, + {-0x1.fd9364d936596p-5, -0x1.fd3f48847a1d1p-5, -0x1.fd3f48847a1d2p-5}, + {0x1.fe8p-3, 0x1.f93ad471d262fp-3, 0x1.f93ad471d263p-3}, + {-0x1.fe8p-3, -0x1.f93ad471d262fp-3, -0x1.f93ad471d263p-3}, + {0x1.febb646e2ee57p13, 0x1.83b3062414974p-1, 0x1.83b3062414973p-1}, + {-0x1.febb646e2ee57p13, -0x1.83b3062414974p-1, -0x1.83b3062414973p-1}, + {0x1.feeffffffffc6p995, 0x1.3b45bd7449775p-1, 0x1.3b45bd7449776p-1}, + {-0x1.feeffffffffc6p995, -0x1.3b45bd7449775p-1, -0x1.3b45bd7449776p-1}, + {0x1.ff8ffffffffffp7, -0x1.eefb59d143646p-1, -0x1.eefb59d143645p-1}, + {-0x1.ff8ffffffffffp7, 0x1.eefb59d143646p-1, 0x1.eefb59d143645p-1}, + {0x1.ff8ffffffffffp870, -0x1.56433f0c6bceep-1, -0x1.56433f0c6bcefp-1}, + {-0x1.ff8ffffffffffp870, 0x1.56433f0c6bceep-1, 0x1.56433f0c6bcefp-1}, + {0x1.ffcfff8p19, -0x1.930006246a6cp-2, -0x1.930006246a6c1p-2}, + {-0x1.ffcfff8p19, 0x1.930006246a6cp-2, 0x1.930006246a6c1p-2}, + {0x1.ffcfff8p365, 0x1.ded37a1f0aa6dp-1, 0x1.ded37a1f0aa6ep-1}, + {-0x1.ffcfff8p365, -0x1.ded37a1f0aa6dp-1, -0x1.ded37a1f0aa6ep-1}, + {0x1.ffcffffffff6cp720, -0x1.93e4d96b621ep-1, -0x1.93e4d96b621e1p-1}, + {-0x1.ffcffffffff6cp720, 0x1.93e4d96b621ep-1, 0x1.93e4d96b621e1p-1}, + {0x1.ffcfffffffff9p320, 0x1.9068b90e42606p-1, 0x1.9068b90e42605p-1}, + {-0x1.ffcfffffffff9p320, -0x1.9068b90e42606p-1, -0x1.9068b90e42605p-1}, + {0x1.ffcffffffffffp12, 0x1.cf81642e7421cp-1, 0x1.cf81642e7421dp-1}, + {-0x1.ffcffffffffffp12, -0x1.cf81642e7421cp-1, -0x1.cf81642e7421dp-1}, + {0x1.ffcffffffffffp404, 0x1.ffffffe61fe61p-1, 0x1.ffffffe61fe62p-1}, + {-0x1.ffcffffffffffp404, -0x1.ffffffe61fe61p-1, -0x1.ffffffe61fe62p-1}, + {0x1.ffeffffffffccp995, -0x1.406ee9ae91e17p-1, -0x1.406ee9ae91e16p-1}, + {-0x1.ffeffffffffccp995, 0x1.406ee9ae91e17p-1, 0x1.406ee9ae91e16p-1}, + {0x1.ffeffffffffffp-3, 0x1.fa9f6ca0ec44ep-3, 0x1.fa9f6ca0ec44fp-3}, + {-0x1.ffeffffffffffp-3, -0x1.fa9f6ca0ec44ep-3, -0x1.fa9f6ca0ec44fp-3}, + {0x1.ffeffffffffffp55, 0x1.6b491db8b66d9p-4, 0x1.6b491db8b66d8p-4}, + {-0x1.ffeffffffffffp55, -0x1.6b491db8b66d9p-4, -0x1.6b491db8b66d8p-4}, + {0x1.ffeffffffffffp180, 0x1.fb0ab102cb13p-1, 0x1.fb0ab102cb12fp-1}, + {-0x1.ffeffffffffffp180, -0x1.fb0ab102cb13p-1, -0x1.fb0ab102cb12fp-1}, + {0x1.ffeffffffffffp706, 0x1.e4315ec04635dp-3, 0x1.e4315ec04635cp-3}, + {-0x1.ffeffffffffffp706, -0x1.e4315ec04635dp-3, -0x1.e4315ec04635cp-3}, + {0x1.fff1fffffffffp41, 0x1.ffffc39997ef6p-1, 0x1.ffffc39997ef7p-1}, + {-0x1.fff1fffffffffp41, -0x1.ffffc39997ef6p-1, -0x1.ffffc39997ef7p-1}, + {0x1.fff6b89ffffffp-7, 0x1.fff163992831fp-7, 0x1.fff163992831ep-7}, + {-0x1.fff6b89ffffffp-7, -0x1.fff163992831fp-7, -0x1.fff163992831ep-7}, + {0x1.fffdffff0001fp105, -0x1.d9757a05fcc43p-1, -0x1.d9757a05fcc42p-1}, + {-0x1.fffdffff0001fp105, 0x1.d9757a05fcc43p-1, 0x1.d9757a05fcc42p-1}, + {0x1.ffff0c0000002p1, -0x1.83791fe63a17ap-1, -0x1.83791fe63a17bp-1}, + {-0x1.ffff0c0000002p1, 0x1.83791fe63a17ap-1, 0x1.83791fe63a17bp-1}, + {0x1.ffffc00000055p150, -0x1.d9d3a85acc50dp-1, -0x1.d9d3a85acc50cp-1}, + {-0x1.ffffc00000055p150, 0x1.d9d3a85acc50dp-1, 0x1.d9d3a85acc50cp-1}, + {0x1.ffffe3fffffffp40, -0x1.f25d858dcdee7p-3, -0x1.f25d858dcdee8p-3}, + {-0x1.ffffe3fffffffp40, 0x1.f25d858dcdee7p-3, 0x1.f25d858dcdee8p-3}, + {0x1.ffffefffcffaep0, 0x1.d18f7bfe557ecp-1, 0x1.d18f7bfe557ebp-1}, + {-0x1.ffffefffcffaep0, -0x1.d18f7bfe557ecp-1, -0x1.d18f7bfe557ebp-1}, + {0x1.fffffbfffffffp228, -0x1.bc14ebf6bfb52p-4, -0x1.bc14ebf6bfb51p-4}, + {-0x1.fffffbfffffffp228, 0x1.bc14ebf6bfb52p-4, 0x1.bc14ebf6bfb51p-4}, + {0x1.fffffbfffffffp735, 0x1.bb887a06f6c51p-3, 0x1.bb887a06f6c5p-3}, + {-0x1.fffffbfffffffp735, -0x1.bb887a06f6c51p-3, -0x1.bb887a06f6c5p-3}, + {0x1.fffffefffffffp-5, 0x1.ffaaadef54e2fp-5, 0x1.ffaaadef54e3p-5}, + {-0x1.fffffefffffffp-5, -0x1.ffaaadef54e2fp-5, -0x1.ffaaadef54e3p-5}, + {0x1.ffffff8p119, 0x1.d4a3c62c5be09p-1, 0x1.d4a3c62c5be08p-1}, + {-0x1.ffffff8p119, -0x1.d4a3c62c5be09p-1, -0x1.d4a3c62c5be08p-1}, + {0x1.ffffff8p192, 0x1.cec20f197703fp-3, 0x1.cec20f197704p-3}, + {-0x1.ffffff8p192, -0x1.cec20f197703fp-3, -0x1.cec20f197704p-3}, + {0x1.ffffff8p543, 0x1.d37aadc7c8662p-2, 0x1.d37aadc7c8663p-2}, + {-0x1.ffffff8p543, -0x1.d37aadc7c8662p-2, -0x1.d37aadc7c8663p-2}, + {0x1.ffffffc0018ffp2, 0x1.fa8d2a4d0a202p-1, 0x1.fa8d2a4d0a203p-1}, + {-0x1.ffffffc0018ffp2, -0x1.fa8d2a4d0a202p-1, -0x1.fa8d2a4d0a203p-1}, + {0x1.ffffffffeffffp2, 0x1.fa8d2a029f978p-1, 0x1.fa8d2a029f977p-1}, + {-0x1.ffffffffeffffp2, -0x1.fa8d2a029f978p-1, -0x1.fa8d2a029f977p-1}, + {0x1.fffffffff825p943, -0x1.2763f02a2d1eap-4, -0x1.2763f02a2d1e9p-4}, + {-0x1.fffffffff825p943, 0x1.2763f02a2d1eap-4, 0x1.2763f02a2d1e9p-4}, + {0x1.fffffffffe09dp320, 0x1.fcff128f77ddbp-1, 0x1.fcff128f77ddap-1}, + {-0x1.fffffffffe09dp320, -0x1.fcff128f77ddbp-1, -0x1.fcff128f77ddap-1}, + {0x1.fffffffffe6e3p720, -0x1.fcc0bfedd84a6p-1, -0x1.fcc0bfedd84a5p-1}, + {-0x1.fffffffffe6e3p720, 0x1.fcc0bfedd84a6p-1, 0x1.fcc0bfedd84a5p-1}, + {0x1.ffffffffffe7fp-1, 0x1.aed548f090c1ep-1, 0x1.aed548f090c1dp-1}, + {-0x1.ffffffffffe7fp-1, -0x1.aed548f090c1ep-1, -0x1.aed548f090c1dp-1}, + {0x1.ffffffffffeffp250, -0x1.f5e11def99d2bp-1, -0x1.f5e11def99d2cp-1}, + {-0x1.ffffffffffeffp250, 0x1.f5e11def99d2bp-1, 0x1.f5e11def99d2cp-1}, + {0x1.fffffffffff78p920, 0x1.8a9cbf48fec9fp-1, 0x1.8a9cbf48fecap-1}, + {-0x1.fffffffffff78p920, -0x1.8a9cbf48fec9fp-1, -0x1.8a9cbf48fecap-1}, + {0x1.fffffffffff83p150, -0x1.7eba5894844ccp-3, -0x1.7eba5894844cdp-3}, + {-0x1.fffffffffff83p150, 0x1.7eba5894844ccp-3, 0x1.7eba5894844cdp-3}, + {0x1.fffffffffffd5p995, 0x1.92c4f06d2cdd1p-1, 0x1.92c4f06d2cdd2p-1}, + {-0x1.fffffffffffd5p995, -0x1.92c4f06d2cdd1p-1, -0x1.92c4f06d2cdd2p-1}, + {0x1.fffffffffffe8p720, -0x1.3d5f7deb1d3bbp-1, -0x1.3d5f7deb1d3bap-1}, + {-0x1.fffffffffffe8p720, 0x1.3d5f7deb1d3bbp-1, 0x1.3d5f7deb1d3bap-1}, + {0x1.fffffffffffebp920, -0x1.91349b0ae90e5p-1, -0x1.91349b0ae90e6p-1}, + {-0x1.fffffffffffebp920, 0x1.91349b0ae90e5p-1, 0x1.91349b0ae90e6p-1}, + {0x1.ffffffffffff1p1, -0x1.837b9dddc1e88p-1, -0x1.837b9dddc1e87p-1}, + {-0x1.ffffffffffff1p1, 0x1.837b9dddc1e88p-1, 0x1.837b9dddc1e87p-1}, + {0x1.ffffffffffff1p245, 0x1.510e062e7fa2p-1, 0x1.510e062e7fa21p-1}, + {-0x1.ffffffffffff1p245, -0x1.510e062e7fa2p-1, -0x1.510e062e7fa21p-1}, + {0x1.ffffffffffff3p-2, 0x1.eaee8744b05e5p-2, 0x1.eaee8744b05e4p-2}, + {-0x1.ffffffffffff3p-2, -0x1.eaee8744b05e5p-2, -0x1.eaee8744b05e4p-2}, + {0x1.ffffffffffff4p845, 0x1.8a4dee8f40628p-1, 0x1.8a4dee8f40627p-1}, + {-0x1.ffffffffffff4p845, -0x1.8a4dee8f40628p-1, -0x1.8a4dee8f40627p-1}, + {0x1.ffffffffffff4p1020, 0x1.5118d6bbde07ep-1, 0x1.5118d6bbde07fp-1}, + {-0x1.ffffffffffff4p1020, -0x1.5118d6bbde07ep-1, -0x1.5118d6bbde07fp-1}, + {0x1.ffffffffffff8p616, -0x1.5cd5c53cf30a9p-1, -0x1.5cd5c53cf30aap-1}, + {-0x1.ffffffffffff8p616, 0x1.5cd5c53cf30a9p-1, 0x1.5cd5c53cf30aap-1}, + {0x1.ffffffffffffcp475, 0x1.ffffa1f0d7dafp-1, 0x1.ffffa1f0d7dbp-1}, + {-0x1.ffffffffffffcp475, -0x1.ffffa1f0d7dafp-1, -0x1.ffffa1f0d7dbp-1}, + {0x1.ffffffffffffep970, 0x1.51e9d840106d7p-1, 0x1.51e9d840106d8p-1}, + {-0x1.ffffffffffffep970, -0x1.51e9d840106d7p-1, -0x1.51e9d840106d8p-1}, + {-0x0.0000000000001p-1022, -0x0.0000000000001p-1022, -0x0.0p0}, + {0x0.0000000000001p-1022, 0x0.0000000000001p-1022, 0x0.0p0}, + {-0x0.0p0, -0x0.0p0, -0x0.0p0}, + {0x0.0000000000001p-1022, 0x0.0000000000001p-1022, 0x0.0p0}, + {-0x0.0000000000001p-1022, -0x0.0000000000001p-1022, -0x0.0p0}, + {-0x1.0000000000001p-1022, -0x1.0000000000001p-1022, -0x1.0000000000001p-1022}, + {0x1.0000000000001p-1022, 0x1.0000000000001p-1022, 0x1.0000000000001p-1022}, + {-0x1.0p-1022, -0x1.0p-1022, -0x1.0p-1022}, + {0x1.0p-1022, 0x1.0p-1022, 0x1.0p-1022}, + {-0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022}, + {0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022}, + {0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022}, + {-0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022}, + {0x1.0p-1022, 0x1.0p-1022, 0x1.0p-1022}, + {-0x1.0p-1022, -0x1.0p-1022, -0x1.0p-1022}, + {0x1.0000000000001p-1022, 0x1.0000000000001p-1022, 0x1.0000000000001p-1022}, + {-0x1.0000000000001p-1022, -0x1.0000000000001p-1022, -0x1.0000000000001p-1022}, + {0x1.999999999999ap-13, 0x1.9999996de8ca2p-13, 0x1.9999996de8ca1p-13}, + {-0x1.999999999999ap-13, -0x1.9999996de8ca2p-13, -0x1.9999996de8ca1p-13}, + {0x1.999999999999ap-12, 0x1.999998ead65b9p-12, 0x1.999998ead65bap-12}, + {-0x1.999999999999ap-12, -0x1.999998ead65b9p-12, -0x1.999998ead65bap-12}, + {0x1.3333333333334p-11, 0x1.3333320c49bacp-11, 0x1.3333320c49babp-11}, + {-0x1.3333333333334p-11, -0x1.3333320c49bacp-11, -0x1.3333320c49babp-11}, + {0x1.999999999999ap-11, 0x1.999996de8ca29p-11, 0x1.999996de8ca28p-11}, + {-0x1.999999999999ap-11, -0x1.999996de8ca29p-11, -0x1.999996de8ca28p-11}, + {0x1.0p-10, 0x1.fffffaaaaaaefp-11, 0x1.fffffaaaaaaeep-11}, + {-0x1.0p-10, -0x1.fffffaaaaaaefp-11, -0x1.fffffaaaaaaeep-11}, + {0x1.3333333333333p-10, 0x1.33332e978d553p-10, 0x1.33332e978d552p-10}, + {-0x1.3333333333333p-10, -0x1.33332e978d553p-10, -0x1.33332e978d552p-10}, + {0x1.6666666666666p-10, 0x1.66665f1529bp-10, 0x1.66665f1529affp-10}, + {-0x1.6666666666666p-10, -0x1.66665f1529bp-10, -0x1.66665f1529affp-10}, + {0x1.9999999999999p-10, 0x1.99998ead65cep-10, 0x1.99998ead65cdfp-10}, + {-0x1.9999999999999p-10, -0x1.99998ead65cep-10, -0x1.99998ead65cdfp-10}, + {0x1.cccccccccccccp-10, 0x1.ccccbd3f7d15dp-10, 0x1.ccccbd3f7d15ep-10}, + {-0x1.cccccccccccccp-10, -0x1.ccccbd3f7d15dp-10, -0x1.ccccbd3f7d15ep-10}, + {0x1.0666666666666p-7, 0x1.0665ae9c7b44fp-7, 0x1.0665ae9c7b44ep-7}, + {-0x1.0666666666666p-7, -0x1.0665ae9c7b44fp-7, -0x1.0665ae9c7b44ep-7}, + {0x1.cccccccccccccp-7, 0x1.ccc8e97b59f62p-7, 0x1.ccc8e97b59f61p-7}, + {-0x1.cccccccccccccp-7, -0x1.ccc8e97b59f62p-7, -0x1.ccc8e97b59f61p-7}, + {0x1.4999999999999p-6, 0x1.4993e8a8ff79bp-6, 0x1.4993e8a8ff79cp-6}, + {-0x1.4999999999999p-6, -0x1.4993e8a8ff79bp-6, -0x1.4993e8a8ff79cp-6}, + {0x1.accccccccccccp-6, 0x1.acc044c56db0ep-6, 0x1.acc044c56db0fp-6}, + {-0x1.accccccccccccp-6, -0x1.acc044c56db0ep-6, -0x1.acc044c56db0fp-6}, + {0x1.08p-5, 0x1.07f44d67cf41bp-5, 0x1.07f44d67cf41ap-5}, + {-0x1.08p-5, -0x1.07f44d67cf41bp-5, -0x1.07f44d67cf41ap-5}, + {0x1.399999999999ap-5, 0x1.3985fe46f1c87p-5, 0x1.3985fe46f1c88p-5}, + {-0x1.399999999999ap-5, -0x1.3985fe46f1c87p-5, -0x1.3985fe46f1c88p-5}, + {0x1.6b33333333334p-5, 0x1.6b14bde93ac5fp-5, 0x1.6b14bde93ac6p-5}, + {-0x1.6b33333333334p-5, -0x1.6b14bde93ac5fp-5, -0x1.6b14bde93ac6p-5}, + {0x1.9cccccccccccep-5, 0x1.9ca0153ed8397p-5, 0x1.9ca0153ed8396p-5}, + {-0x1.9cccccccccccep-5, -0x1.9ca0153ed8397p-5, -0x1.9ca0153ed8396p-5}, + {0x1.ce66666666666p-5, 0x1.ce278d4027d34p-5, 0x1.ce278d4027d35p-5}, + {-0x1.ce66666666666p-5, -0x1.ce278d4027d34p-5, -0x1.ce278d4027d35p-5}, + {0x1.5e7fc4369bdadp-1, 0x1.43c1e9c171a66p-1, 0x1.43c1e9c171a67p-1}, + {-0x1.5e7fc4369bdadp-1, -0x1.43c1e9c171a66p-1, -0x1.43c1e9c171a67p-1}, + {0x1.4e7fc4369bdadp0, 0x1.ee3d6bcea09cap-1, 0x1.ee3d6bcea09cbp-1}, + {-0x1.4e7fc4369bdadp0, -0x1.ee3d6bcea09cap-1, -0x1.ee3d6bcea09cbp-1}, + {0x1.edbfa651e9c84p0, 0x1.df8e22ea809d6p-1, 0x1.df8e22ea809d7p-1}, + {-0x1.edbfa651e9c84p0, -0x1.df8e22ea809d6p-1, -0x1.df8e22ea809d7p-1}, + {0x1.467fc4369bdadp1, 0x1.1d3479eac7ae3p-1, 0x1.1d3479eac7ae4p-1}, + {-0x1.467fc4369bdadp1, -0x1.1d3479eac7ae3p-1, -0x1.1d3479eac7ae4p-1}, + {0x1.961fb54442d18p1, -0x1.ffeaaaeeee84bp-6, -0x1.ffeaaaeeee84cp-6}, + {-0x1.961fb54442d18p1, 0x1.ffeaaaeeee84bp-6, 0x1.ffeaaaeeee84cp-6}, + {0x1.e5bfa651e9c83p1, -0x1.3734d32d49bd1p-1, -0x1.3734d32d49bdp-1}, + {-0x1.e5bfa651e9c83p1, 0x1.3734d32d49bd1p-1, 0x1.3734d32d49bdp-1}, + {0x1.1aafcbafc85f7p2, -0x1.e9d25d19911e2p-1, -0x1.e9d25d19911e3p-1}, + {-0x1.1aafcbafc85f7p2, 0x1.e9d25d19911e2p-1, 0x1.e9d25d19911e3p-1}, + {0x1.427fc4369bdadp2, -0x1.e4ecdc5a4e466p-1, -0x1.e4ecdc5a4e465p-1}, + {-0x1.427fc4369bdadp2, 0x1.e4ecdc5a4e466p-1, 0x1.e4ecdc5a4e465p-1}, + {0x1.6a4fbcbd6f562p2, -0x1.2a59f10344262p-1, -0x1.2a59f10344261p-1}, + {-0x1.6a4fbcbd6f562p2, 0x1.2a59f10344262p-1, 0x1.2a59f10344261p-1}, + {0x1.6af2eff0a2896p2, -0x1.26312443bd35fp-1, -0x1.26312443bd36p-1}, + {-0x1.6af2eff0a2896p2, 0x1.26312443bd35fp-1, 0x1.26312443bd36p-1}, + {0x1.43c62a9d02414p2, -0x1.e18e660a5e2fbp-1, -0x1.e18e660a5e2fcp-1}, + {-0x1.43c62a9d02414p2, 0x1.e18e660a5e2fbp-1, 0x1.e18e660a5e2fcp-1}, + {0x1.1c99654961f92p2, -0x1.ee0e83a0198b7p-1, -0x1.ee0e83a0198b6p-1}, + {-0x1.1c99654961f92p2, 0x1.ee0e83a0198b7p-1, 0x1.ee0e83a0198b6p-1}, + {0x1.ead93feb8361fp1, -0x1.4727747338e46p-1, -0x1.4727747338e47p-1}, + {-0x1.ead93feb8361fp1, 0x1.4727747338e46p-1, 0x1.4727747338e47p-1}, + {0x1.9c7fb54442d1ap1, -0x1.4ba2f75dda5fep-4, -0x1.4ba2f75dda5ffp-4}, + {-0x1.9c7fb54442d1ap1, 0x1.4ba2f75dda5fep-4, 0x1.4ba2f75dda5ffp-4}, + {0x1.4e262a9d02415p1, 0x1.034c4d633b4efp-1, 0x1.034c4d633b4fp-1}, + {-0x1.4e262a9d02415p1, -0x1.034c4d633b4efp-1, -0x1.034c4d633b4fp-1}, + {0x1.ff993feb8362p0, 0x1.d1e4cde2f3945p-1, 0x1.d1e4cde2f3944p-1}, + {-0x1.ff993feb8362p0, -0x1.d1e4cde2f3945p-1, -0x1.d1e4cde2f3944p-1}, + {0x1.62e62a9d02416p0, 0x1.f750235c94992p-1, 0x1.f750235c94993p-1}, + {-0x1.62e62a9d02416p0, -0x1.f750235c94992p-1, -0x1.f750235c94993p-1}, + {0x1.8c662a9d02419p-1, 0x1.65f7d571279b1p-1, 0x1.65f7d571279bp-1}, + {-0x1.8c662a9d02419p-1, -0x1.65f7d571279b1p-1, -0x1.65f7d571279bp-1}, + {-0x1.a8aa1d11c44ffp0, -0x1.fe043f57369d7p-1, -0x1.fe043f57369d6p-1}, + {0x1.a8aa1d11c44ffp0, 0x1.fe043f57369d7p-1, 0x1.fe043f57369d6p-1}, + {-0x1.95ec8b9e03d54p0, -0x1.fff18f24f3e4cp-1, -0x1.fff18f24f3e4bp-1}, + {0x1.95ec8b9e03d54p0, 0x1.fff18f24f3e4cp-1, 0x1.fff18f24f3e4bp-1}, + {-0x1.832efa2a435a9p0, -0x1.ff20d961624e7p-1, -0x1.ff20d961624e8p-1}, + {0x1.832efa2a435a9p0, 0x1.ff20d961624e7p-1, 0x1.ff20d961624e8p-1}, + {-0x1.707168b682dfep0, -0x1.fb933c40107fdp-1, -0x1.fb933c40107fep-1}, + {0x1.707168b682dfep0, 0x1.fb933c40107fdp-1, 0x1.fb933c40107fep-1}, + {-0x1.5db3d742c2653p0, -0x1.f54d971881ad7p-1, -0x1.f54d971881ad6p-1}, + {0x1.5db3d742c2653p0, 0x1.f54d971881ad7p-1, 0x1.f54d971881ad6p-1}, + {-0x1.4af645cf01ea8p0, -0x1.ec5883b7b6cf5p-1, -0x1.ec5883b7b6cf4p-1}, + {0x1.4af645cf01ea8p0, 0x1.ec5883b7b6cf5p-1, 0x1.ec5883b7b6cf4p-1}, + {-0x1.3838b45b416fdp0, -0x1.e0c04a94e1731p-1, -0x1.e0c04a94e173p-1}, + {0x1.3838b45b416fdp0, 0x1.e0c04a94e1731p-1, 0x1.e0c04a94e173p-1}, + {-0x1.257b22e780f52p0, -0x1.d294d1f96c7ecp-1, -0x1.d294d1f96c7ebp-1}, + {0x1.257b22e780f52p0, 0x1.d294d1f96c7ecp-1, 0x1.d294d1f96c7ebp-1}, + {-0x1.12bd9173c07abp0, -0x1.c1e9883373d7fp-1, -0x1.c1e9883373d7ep-1}, + {0x1.12bd9173c07abp0, 0x1.c1e9883373d7fp-1, 0x1.c1e9883373d7ep-1}, + {-0x1.ea5c3ed5b385p-1, -0x1.a2c289d9d055bp-1, -0x1.a2c289d9d055ap-1}, + {0x1.ea5c3ed5b385p-1, 0x1.a2c289d9d055bp-1, 0x1.a2c289d9d055ap-1}, + {-0x1.d4b87dab670ap-1, -0x1.95f05257dbcb6p-1, -0x1.95f05257dbcb5p-1}, + {0x1.d4b87dab670ap-1, 0x1.95f05257dbcb6p-1, 0x1.95f05257dbcb5p-1}, + {-0x1.bf14bc811a8fp-1, -0x1.88647f26a6e0fp-1, -0x1.88647f26a6e1p-1}, + {0x1.bf14bc811a8fp-1, 0x1.88647f26a6e0fp-1, 0x1.88647f26a6e1p-1}, + {-0x1.a970fb56ce14p-1, -0x1.7a2541dfd4e75p-1, -0x1.7a2541dfd4e76p-1}, + {0x1.a970fb56ce14p-1, 0x1.7a2541dfd4e75p-1, 0x1.7a2541dfd4e76p-1}, + {-0x1.93cd3a2c8199p-1, -0x1.6b391e25bc26dp-1, -0x1.6b391e25bc26cp-1}, + {0x1.93cd3a2c8199p-1, 0x1.6b391e25bc26dp-1, 0x1.6b391e25bc26cp-1}, + {-0x1.7e297902351ep-1, -0x1.5ba6e6a8e7065p-1, -0x1.5ba6e6a8e7066p-1}, + {0x1.7e297902351ep-1, 0x1.5ba6e6a8e7065p-1, 0x1.5ba6e6a8e7066p-1}, + {-0x1.6885b7d7e8a3p-1, -0x1.4b75ba096fa55p-1, -0x1.4b75ba096fa54p-1}, + {0x1.6885b7d7e8a3p-1, 0x1.4b75ba096fa55p-1, 0x1.4b75ba096fa54p-1}, + {-0x1.52e1f6ad9c28p-1, -0x1.3aacff95a3123p-1, -0x1.3aacff95a3122p-1}, + {0x1.52e1f6ad9c28p-1, 0x1.3aacff95a3123p-1, 0x1.3aacff95a3122p-1}, + {-0x1.3d3e35834fadp-1, -0x1.295463e769285p-1, -0x1.295463e769284p-1}, + {0x1.3d3e35834fadp-1, 0x1.295463e769285p-1, 0x1.295463e769284p-1}, + {-0x1.0a0b02501c799p-1, -0x1.fc769b77e5885p-2, -0x1.fc769b77e5884p-2}, + {0x1.0a0b02501c799p-1, 0x1.fc769b77e5885p-2, 0x1.fc769b77e5884p-2}, + {-0x1.d8f7208e6b82cp-2, -0x1.c853c78462de4p-2, -0x1.c853c78462de5p-2}, + {0x1.d8f7208e6b82cp-2, 0x1.c853c78462de4p-2, 0x1.c853c78462de5p-2}, + {-0x1.9dd83c7c9e126p-2, -0x1.92aba90aaf272p-2, -0x1.92aba90aaf273p-2}, + {0x1.9dd83c7c9e126p-2, 0x1.92aba90aaf272p-2, 0x1.92aba90aaf273p-2}, + {-0x1.62b9586ad0a2p-2, -0x1.5bac064658f39p-2, -0x1.5bac064658f3ap-2}, + {0x1.62b9586ad0a2p-2, 0x1.5bac064658f39p-2, 0x1.5bac064658f3ap-2}, + {-0x1.279a74590331ap-2, -0x1.2383ca8078e58p-2, -0x1.2383ca8078e59p-2}, + {0x1.279a74590331ap-2, 0x1.2383ca8078e58p-2, 0x1.2383ca8078e59p-2}, + {-0x1.d8f7208e6b829p-3, -0x1.d4c5bc11d2372p-3, -0x1.d4c5bc11d2371p-3}, + {0x1.d8f7208e6b829p-3, 0x1.d4c5bc11d2372p-3, 0x1.d4c5bc11d2371p-3}, + {-0x1.62b9586ad0a1ep-3, -0x1.60f3faaf43024p-3, -0x1.60f3faaf43023p-3}, + {0x1.62b9586ad0a1ep-3, 0x1.60f3faaf43024p-3, 0x1.60f3faaf43023p-3}, + {-0x1.d8f7208e6b826p-4, -0x1.d7ea3de45a9d6p-4, -0x1.d7ea3de45a9d7p-4}, + {0x1.d8f7208e6b826p-4, 0x1.d7ea3de45a9d6p-4, 0x1.d7ea3de45a9d7p-4}, + {-0x1.d8f7208e6b82dp-5, -0x1.d8b3df489987ap-5, -0x1.d8b3df489987bp-5}, + {0x1.d8f7208e6b82dp-5, 0x1.d8b3df489987ap-5, 0x1.d8b3df489987bp-5}, + {0x1.d8f7208e6b82dp-5, 0x1.d8b3df489987ap-5, 0x1.d8b3df489987bp-5}, + {-0x1.d8f7208e6b82dp-5, -0x1.d8b3df489987ap-5, -0x1.d8b3df489987bp-5}, + {0x1.d8f7208e6b82dp-4, 0x1.d7ea3de45a9ddp-4, 0x1.d7ea3de45a9dep-4}, + {-0x1.d8f7208e6b82dp-4, -0x1.d7ea3de45a9ddp-4, -0x1.d7ea3de45a9dep-4}, + {0x1.62b9586ad0a22p-3, 0x1.60f3faaf43028p-3, 0x1.60f3faaf43027p-3}, + {-0x1.62b9586ad0a22p-3, -0x1.60f3faaf43028p-3, -0x1.60f3faaf43027p-3}, + {0x1.d8f7208e6b82dp-3, 0x1.d4c5bc11d2376p-3, 0x1.d4c5bc11d2375p-3}, + {-0x1.d8f7208e6b82dp-3, -0x1.d4c5bc11d2376p-3, -0x1.d4c5bc11d2375p-3}, + {0x1.279a74590331cp-2, 0x1.2383ca8078e5ap-2, 0x1.2383ca8078e5bp-2}, + {-0x1.279a74590331cp-2, -0x1.2383ca8078e5ap-2, -0x1.2383ca8078e5bp-2}, + {0x1.62b9586ad0a22p-2, 0x1.5bac064658f3bp-2, 0x1.5bac064658f3cp-2}, + {-0x1.62b9586ad0a22p-2, -0x1.5bac064658f3bp-2, -0x1.5bac064658f3cp-2}, + {0x1.9dd83c7c9e128p-2, 0x1.92aba90aaf274p-2, 0x1.92aba90aaf275p-2}, + {-0x1.9dd83c7c9e128p-2, -0x1.92aba90aaf274p-2, -0x1.92aba90aaf275p-2}, + {0x1.d8f7208e6b82ep-2, 0x1.c853c78462de6p-2, 0x1.c853c78462de7p-2}, + {-0x1.d8f7208e6b82ep-2, -0x1.c853c78462de6p-2, -0x1.c853c78462de7p-2}, + {0x1.0a0b02501c799p-1, 0x1.fc769b77e5885p-2, 0x1.fc769b77e5884p-2}, + {-0x1.0a0b02501c799p-1, -0x1.fc769b77e5885p-2, -0x1.fc769b77e5884p-2}, + {0x1.3d3e35834faccp-1, 0x1.295463e769281p-1, 0x1.295463e769282p-1}, + {-0x1.3d3e35834faccp-1, -0x1.295463e769281p-1, -0x1.295463e769282p-1}, + {0x1.52e1f6ad9c27cp-1, 0x1.3aacff95a312p-1, 0x1.3aacff95a311fp-1}, + {-0x1.52e1f6ad9c27cp-1, -0x1.3aacff95a312p-1, -0x1.3aacff95a311fp-1}, + {0x1.6885b7d7e8a2cp-1, 0x1.4b75ba096fa52p-1, 0x1.4b75ba096fa51p-1}, + {-0x1.6885b7d7e8a2cp-1, -0x1.4b75ba096fa52p-1, -0x1.4b75ba096fa51p-1}, + {0x1.7e297902351dcp-1, 0x1.5ba6e6a8e7062p-1, 0x1.5ba6e6a8e7063p-1}, + {-0x1.7e297902351dcp-1, -0x1.5ba6e6a8e7062p-1, -0x1.5ba6e6a8e7063p-1}, + {0x1.93cd3a2c8198cp-1, 0x1.6b391e25bc26ap-1, 0x1.6b391e25bc269p-1}, + {-0x1.93cd3a2c8198cp-1, -0x1.6b391e25bc26ap-1, -0x1.6b391e25bc269p-1}, + {0x1.a970fb56ce13cp-1, 0x1.7a2541dfd4e73p-1, 0x1.7a2541dfd4e72p-1}, + {-0x1.a970fb56ce13cp-1, -0x1.7a2541dfd4e73p-1, -0x1.7a2541dfd4e72p-1}, + {0x1.bf14bc811a8ecp-1, 0x1.88647f26a6e0dp-1, 0x1.88647f26a6e0cp-1}, + {-0x1.bf14bc811a8ecp-1, -0x1.88647f26a6e0dp-1, -0x1.88647f26a6e0cp-1}, + {0x1.d4b87dab6709cp-1, 0x1.95f05257dbcb4p-1, 0x1.95f05257dbcb3p-1}, + {-0x1.d4b87dab6709cp-1, -0x1.95f05257dbcb4p-1, -0x1.95f05257dbcb3p-1}, + {0x1.ea5c3ed5b384cp-1, 0x1.a2c289d9d0558p-1, 0x1.a2c289d9d0559p-1}, + {-0x1.ea5c3ed5b384cp-1, -0x1.a2c289d9d0558p-1, -0x1.a2c289d9d0559p-1}, + {0x1.12bd9173c07abp0, 0x1.c1e9883373d7fp-1, 0x1.c1e9883373d7ep-1}, + {-0x1.12bd9173c07abp0, -0x1.c1e9883373d7fp-1, -0x1.c1e9883373d7ep-1}, + {0x1.257b22e780f56p0, 0x1.d294d1f96c7efp-1, 0x1.d294d1f96c7fp-1}, + {-0x1.257b22e780f56p0, -0x1.d294d1f96c7efp-1, -0x1.d294d1f96c7fp-1}, + {0x1.3838b45b41701p0, 0x1.e0c04a94e1733p-1, 0x1.e0c04a94e1734p-1}, + {-0x1.3838b45b41701p0, -0x1.e0c04a94e1733p-1, -0x1.e0c04a94e1734p-1}, + {0x1.4af645cf01eacp0, 0x1.ec5883b7b6cf7p-1, 0x1.ec5883b7b6cf8p-1}, + {-0x1.4af645cf01eacp0, -0x1.ec5883b7b6cf7p-1, -0x1.ec5883b7b6cf8p-1}, + {0x1.5db3d742c2657p0, 0x1.f54d971881ad8p-1, 0x1.f54d971881ad9p-1}, + {-0x1.5db3d742c2657p0, -0x1.f54d971881ad8p-1, -0x1.f54d971881ad9p-1}, + {0x1.707168b682e02p0, 0x1.fb933c40107fep-1, 0x1.fb933c40107ffp-1}, + {-0x1.707168b682e02p0, -0x1.fb933c40107fep-1, -0x1.fb933c40107ffp-1}, + {0x1.832efa2a435adp0, 0x1.ff20d961624e7p-1, 0x1.ff20d961624e8p-1}, + {-0x1.832efa2a435adp0, -0x1.ff20d961624e7p-1, -0x1.ff20d961624e8p-1}, + {0x1.95ec8b9e03d58p0, 0x1.fff18f24f3e4bp-1, 0x1.fff18f24f3e4cp-1}, + {-0x1.95ec8b9e03d58p0, -0x1.fff18f24f3e4bp-1, -0x1.fff18f24f3e4cp-1}, + {0x1.a8aa1d11c44ffp0, 0x1.fe043f57369d7p-1, 0x1.fe043f57369d6p-1}, + {-0x1.a8aa1d11c44ffp0, -0x1.fe043f57369d7p-1, -0x1.fe043f57369d6p-1}, + {0x1.04aff6d330942p0, 0x1.b3d3695acc413p-1, 0x1.b3d3695acc414p-1}, + {-0x1.04aff6d330942p0, -0x1.b3d3695acc413p-1, -0x1.b3d3695acc414p-1}, + {0x1.04b09e98dcdb4p0, 0x1.b3d41972dc806p-1, 0x1.b3d41972dc807p-1}, + {-0x1.04b09e98dcdb4p0, -0x1.b3d41972dc806p-1, -0x1.b3d41972dc807p-1}, + {0x1.04b1465e89226p0, 0x1.b3d4c98a318fbp-1, 0x1.b3d4c98a318fcp-1}, + {-0x1.04b1465e89226p0, -0x1.b3d4c98a318fbp-1, -0x1.b3d4c98a318fcp-1}, + {0x1.04b1ee2435698p0, 0x1.b3d579a0cb6eep-1, 0x1.b3d579a0cb6efp-1}, + {-0x1.04b1ee2435698p0, -0x1.b3d579a0cb6eep-1, -0x1.b3d579a0cb6efp-1}, + {0x1.04b295e9e1b0ap0, 0x1.b3d629b6aa1dap-1, 0x1.b3d629b6aa1d9p-1}, + {-0x1.04b295e9e1b0ap0, -0x1.b3d629b6aa1dap-1, -0x1.b3d629b6aa1d9p-1}, + {0x1.04b33daf8df7cp0, 0x1.b3d6d9cbcd9bap-1, 0x1.b3d6d9cbcd9b9p-1}, + {-0x1.04b33daf8df7cp0, -0x1.b3d6d9cbcd9bap-1, -0x1.b3d6d9cbcd9b9p-1}, + {0x1.04b3e5753a3eep0, 0x1.b3d789e035e89p-1, 0x1.b3d789e035e8ap-1}, + {-0x1.04b3e5753a3eep0, -0x1.b3d789e035e89p-1, -0x1.b3d789e035e8ap-1}, + {0x1.04b48d3ae686p0, 0x1.b3d839f3e3043p-1, 0x1.b3d839f3e3044p-1}, + {-0x1.04b48d3ae686p0, -0x1.b3d839f3e3043p-1, -0x1.b3d839f3e3044p-1}, + {0x1.04b5350092ccfp0, 0x1.b3d8ea06d4eep-1, 0x1.b3d8ea06d4ee1p-1}, + {-0x1.04b5350092ccfp0, -0x1.b3d8ea06d4eep-1, -0x1.b3d8ea06d4ee1p-1}, + {-0x0.0000000000001p-1022, -0x0.0000000000001p-1022, -0x0.0p0}, + {0x0.0000000000001p-1022, 0x0.0000000000001p-1022, 0x0.0p0}, + {-0x0.0p0, -0x0.0p0, -0x0.0p0}, + {0x0.0000000000001p-1022, 0x0.0000000000001p-1022, 0x0.0p0}, + {-0x0.0000000000001p-1022, -0x0.0000000000001p-1022, -0x0.0p0}, + {0x1.279a74590331bp-1, 0x1.1773d561fd506p-1, 0x1.1773d561fd507p-1}, + {-0x1.279a74590331bp-1, -0x1.1773d561fd506p-1, -0x1.1773d561fd507p-1}, + {0x1.279a74590331cp-1, 0x1.1773d561fd507p-1, 0x1.1773d561fd508p-1}, + {-0x1.279a74590331cp-1, -0x1.1773d561fd507p-1, -0x1.1773d561fd508p-1}, + {0x1.279a74590331dp-1, 0x1.1773d561fd508p-1, 0x1.1773d561fd509p-1}, + {-0x1.279a74590331dp-1, -0x1.1773d561fd508p-1, -0x1.1773d561fd509p-1}, + {0x1.bb67ae8584ca9p0, 0x1.f95b8e7107419p-1, 0x1.f95b8e7107418p-1}, + {-0x1.bb67ae8584ca9p0, -0x1.f95b8e7107419p-1, -0x1.f95b8e7107418p-1}, + {0x1.bb67ae8584caap0, 0x1.f95b8e7107418p-1, 0x1.f95b8e7107419p-1}, + {-0x1.bb67ae8584caap0, -0x1.f95b8e7107418p-1, -0x1.f95b8e7107419p-1}, + {0x1.bb67ae8584cabp0, 0x1.f95b8e7107418p-1, 0x1.f95b8e7107419p-1}, + {-0x1.bb67ae8584cabp0, -0x1.f95b8e7107418p-1, -0x1.f95b8e7107419p-1}, + {0x1.bffffffffffffp-2, 0x1.b1d8305321616p-2, 0x1.b1d8305321615p-2}, + {-0x1.bffffffffffffp-2, -0x1.b1d8305321616p-2, -0x1.b1d8305321615p-2}, + {0x1.cp-2, 0x1.b1d8305321617p-2, 0x1.b1d8305321616p-2}, + {-0x1.cp-2, -0x1.b1d8305321617p-2, -0x1.b1d8305321616p-2}, + {0x1.c000000000001p-2, 0x1.b1d8305321617p-2, 0x1.b1d8305321618p-2}, + {-0x1.c000000000001p-2, -0x1.b1d8305321617p-2, -0x1.b1d8305321618p-2}, + {0x1.5ffffffffffffp-1, 0x1.44eb381cf386ap-1, 0x1.44eb381cf3869p-1}, + {-0x1.5ffffffffffffp-1, -0x1.44eb381cf386ap-1, -0x1.44eb381cf3869p-1}, + {0x1.6p-1, 0x1.44eb381cf386bp-1, 0x1.44eb381cf386ap-1}, + {-0x1.6p-1, -0x1.44eb381cf386bp-1, -0x1.44eb381cf386ap-1}, + {0x1.6000000000001p-1, 0x1.44eb381cf386cp-1, 0x1.44eb381cf386bp-1}, + {-0x1.6000000000001p-1, -0x1.44eb381cf386cp-1, -0x1.44eb381cf386bp-1}, + {0x1.2ffffffffffffp0, 0x1.dad902fa8ac86p-1, 0x1.dad902fa8ac87p-1}, + {-0x1.2ffffffffffffp0, -0x1.dad902fa8ac86p-1, -0x1.dad902fa8ac87p-1}, + {0x1.3p0, 0x1.dad902fa8ac87p-1, 0x1.dad902fa8ac88p-1}, + {-0x1.3p0, -0x1.dad902fa8ac87p-1, -0x1.dad902fa8ac88p-1}, + {0x1.3000000000001p0, 0x1.dad902fa8ac88p-1, 0x1.dad902fa8ac87p-1}, + {-0x1.3000000000001p0, -0x1.dad902fa8ac88p-1, -0x1.dad902fa8ac87p-1}, + {0x1.37fffffffffffp1, 0x1.4b707a7acdedp-1, 0x1.4b707a7acdecfp-1}, + {-0x1.37fffffffffffp1, -0x1.4b707a7acdedp-1, -0x1.4b707a7acdecfp-1}, + {0x1.38p1, 0x1.4b707a7acdecdp-1, 0x1.4b707a7acdeccp-1}, + {-0x1.38p1, -0x1.4b707a7acdecdp-1, -0x1.4b707a7acdeccp-1}, + {0x1.3800000000001p1, 0x1.4b707a7acdecap-1, 0x1.4b707a7acdec9p-1}, + {-0x1.3800000000001p1, -0x1.4b707a7acdecap-1, -0x1.4b707a7acdec9p-1}, + {0x1.069c8b46b3792p-4, 0x1.066e7eb76f5c6p-4, 0x1.066e7eb76f5c7p-4}, + {-0x1.069c8b46b3792p-4, -0x1.066e7eb76f5c6p-4, -0x1.066e7eb76f5c7p-4}, + {0x1.069c8b46b3792p-3, 0x1.05e4761ab8d8fp-3, 0x1.05e4761ab8d9p-3}, + {-0x1.069c8b46b3792p-3, -0x1.05e4761ab8d8fp-3, -0x1.05e4761ab8d9p-3}, + {0x1.89ead0ea0d35bp-3, 0x1.877e2cd4f6fdap-3, 0x1.877e2cd4f6fd9p-3}, + {-0x1.89ead0ea0d35bp-3, -0x1.877e2cd4f6fdap-3, -0x1.877e2cd4f6fd9p-3}, + {0x1.069c8b46b3792p-2, 0x1.03be06f97cbeep-2, 0x1.03be06f97cbefp-2}, + {-0x1.069c8b46b3792p-2, -0x1.03be06f97cbeep-2, -0x1.03be06f97cbefp-2}, + {0x1.4843ae1860576p-2, 0x1.42abba8c72fbcp-2, 0x1.42abba8c72fbbp-2}, + {-0x1.4843ae1860576p-2, -0x1.42abba8c72fbcp-2, -0x1.42abba8c72fbbp-2}, + {0x1.89ead0ea0d35ap-2, 0x1.8045fe64e62dcp-2, 0x1.8045fe64e62ddp-2}, + {-0x1.89ead0ea0d35ap-2, -0x1.8045fe64e62dcp-2, -0x1.8045fe64e62ddp-2}, + {0x1.cb91f3bbba13ep-2, 0x1.bc4c04d71abbfp-2, 0x1.bc4c04d71abbep-2}, + {-0x1.cb91f3bbba13ep-2, -0x1.bc4c04d71abbfp-2, -0x1.bc4c04d71abbep-2}, + {0x1.069c8b46b3791p-1, 0x1.f67ea975b86ap-2, 0x1.f67ea975b86a1p-2}, + {-0x1.069c8b46b3791p-1, -0x1.f67ea975b86ap-2, -0x1.f67ea975b86a1p-2}, + {0x1.27701caf89e83p-1, 0x1.175059bf0d425p-1, 0x1.175059bf0d426p-1}, + {-0x1.27701caf89e83p-1, -0x1.175059bf0d425p-1, -0x1.175059bf0d426p-1}, + {0x1.4843ae1860575p-1, 0x1.323b8b1fb4ba2p-1, 0x1.323b8b1fb4ba3p-1}, + {-0x1.4843ae1860575p-1, -0x1.323b8b1fb4ba2p-1, -0x1.323b8b1fb4ba3p-1}, + {0x1.69173f8136c67p-1, 0x1.4be4979c5efb3p-1, 0x1.4be4979c5efb4p-1}, + {-0x1.69173f8136c67p-1, -0x1.4be4979c5efb3p-1, -0x1.4be4979c5efb4p-1}, + {0x1.89ead0ea0d359p-1, 0x1.643080d67acc1p-1, 0x1.643080d67acc2p-1}, + {-0x1.89ead0ea0d359p-1, -0x1.643080d67acc1p-1, -0x1.643080d67acc2p-1}, + {0x1.aabe6252e3a4bp-1, 0x1.7b05b7b6c612ep-1, 0x1.7b05b7b6c612fp-1}, + {-0x1.aabe6252e3a4bp-1, -0x1.7b05b7b6c612ep-1, -0x1.7b05b7b6c612fp-1}, + {0x1.cb91f3bbba13dp-1, 0x1.904c37505de49p-1, 0x1.904c37505de48p-1}, + {-0x1.cb91f3bbba13dp-1, -0x1.904c37505de49p-1, -0x1.904c37505de48p-1}, + {0x1.ec6585249082fp-1, 0x1.a3ed9e252938ap-1, 0x1.a3ed9e252938bp-1}, + {-0x1.ec6585249082fp-1, -0x1.a3ed9e252938ap-1, -0x1.a3ed9e252938bp-1}, + {0x1.069c8b46b3791p0, 0x1.b5d545b109bf9p-1, 0x1.b5d545b109bfap-1}, + {-0x1.069c8b46b3791p0, -0x1.b5d545b109bf9p-1, -0x1.b5d545b109bfap-1}, + {0x1.170653fb1eb0ap0, 0x1.c5f058230e7fdp-1, 0x1.c5f058230e7fep-1}, + {-0x1.170653fb1eb0ap0, -0x1.c5f058230e7fdp-1, -0x1.c5f058230e7fep-1}, + {0x1.27701caf89e83p0, 0x1.d42de42dce134p-1, 0x1.d42de42dce135p-1}, + {-0x1.27701caf89e83p0, -0x1.d42de42dce134p-1, -0x1.d42de42dce135p-1}, + {0x1.37d9e563f51fcp0, 0x1.e07eeeda109cbp-1, 0x1.e07eeeda109ccp-1}, + {-0x1.37d9e563f51fcp0, -0x1.e07eeeda109cbp-1, -0x1.e07eeeda109ccp-1}, + {0x1.4843ae1860575p0, 0x1.ead6834909b93p-1, 0x1.ead6834909b94p-1}, + {-0x1.4843ae1860575p0, -0x1.ead6834909b93p-1, -0x1.ead6834909b94p-1}, + {0x1.58ad76cccb8eep0, 0x1.f329c0558e968p-1, 0x1.f329c0558e967p-1}, + {-0x1.58ad76cccb8eep0, -0x1.f329c0558e968p-1, -0x1.f329c0558e967p-1}, + {0x1.69173f8136c67p0, 0x1.f96fe405f1ac6p-1, 0x1.f96fe405f1ac5p-1}, + {-0x1.69173f8136c67p0, -0x1.f96fe405f1ac6p-1, -0x1.f96fe405f1ac5p-1}, + {0x1.79810835a1fep0, 0x1.fda254c27a01fp-1, 0x1.fda254c27a02p-1}, + {-0x1.79810835a1fep0, -0x1.fda254c27a01fp-1, -0x1.fda254c27a02p-1}, + {0x1.89ead0ea0d359p0, 0x1.ffbca846c4fcap-1, 0x1.ffbca846c4fc9p-1}, + {-0x1.89ead0ea0d359p0, -0x1.ffbca846c4fcap-1, -0x1.ffbca846c4fc9p-1}, + {0x1.9a54999e786d2p0, 0x1.ffbca846c4fcap-1, 0x1.ffbca846c4fc9p-1}, + {-0x1.9a54999e786d2p0, -0x1.ffbca846c4fcap-1, -0x1.ffbca846c4fc9p-1}, + {0x1.aabe6252e3a4bp0, 0x1.fda254c27a02p-1, 0x1.fda254c27a021p-1}, + {-0x1.aabe6252e3a4bp0, -0x1.fda254c27a02p-1, -0x1.fda254c27a021p-1}, + {0x1.bb282b074edc4p0, 0x1.f96fe405f1ac8p-1, 0x1.f96fe405f1ac7p-1}, + {-0x1.bb282b074edc4p0, -0x1.f96fe405f1ac8p-1, -0x1.f96fe405f1ac7p-1}, + {0x1.cb91f3bbba13dp0, 0x1.f329c0558e96ap-1, 0x1.f329c0558e96bp-1}, + {-0x1.cb91f3bbba13dp0, -0x1.f329c0558e96ap-1, -0x1.f329c0558e96bp-1}, + {0x1.dbfbbc70254b6p0, 0x1.ead6834909b96p-1, 0x1.ead6834909b97p-1}, + {-0x1.dbfbbc70254b6p0, -0x1.ead6834909b96p-1, -0x1.ead6834909b97p-1}, + {0x1.ec6585249082fp0, 0x1.e07eeeda109cfp-1, 0x1.e07eeeda109dp-1}, + {-0x1.ec6585249082fp0, -0x1.e07eeeda109cfp-1, -0x1.e07eeeda109dp-1}, + {0x1.fccf4dd8fbba8p0, 0x1.d42de42dce139p-1, 0x1.d42de42dce138p-1}, + {-0x1.fccf4dd8fbba8p0, -0x1.d42de42dce139p-1, -0x1.d42de42dce138p-1}, + {0x1.069c8b46b3791p1, 0x1.c5f058230e801p-1, 0x1.c5f058230e802p-1}, + {-0x1.069c8b46b3791p1, -0x1.c5f058230e801p-1, -0x1.c5f058230e802p-1}, + {0x1.0ed16fa0e914ep1, 0x1.b5d545b109bfdp-1, 0x1.b5d545b109bfcp-1}, + {-0x1.0ed16fa0e914ep1, -0x1.b5d545b109bfdp-1, -0x1.b5d545b109bfcp-1}, + {0x1.170653fb1eb0bp1, 0x1.a3ed9e252938dp-1, 0x1.a3ed9e252938ep-1}, + {-0x1.170653fb1eb0bp1, -0x1.a3ed9e252938dp-1, -0x1.a3ed9e252938ep-1}, + {0x1.1f3b3855544c8p1, 0x1.904c37505de4cp-1, 0x1.904c37505de4bp-1}, + {-0x1.1f3b3855544c8p1, -0x1.904c37505de4cp-1, -0x1.904c37505de4bp-1}, + {0x1.27701caf89e85p1, 0x1.7b05b7b6c613p-1, 0x1.7b05b7b6c612fp-1}, + {-0x1.27701caf89e85p1, -0x1.7b05b7b6c613p-1, -0x1.7b05b7b6c612fp-1}, + {0x1.2fa50109bf842p1, 0x1.643080d67acc1p-1, 0x1.643080d67acc2p-1}, + {-0x1.2fa50109bf842p1, -0x1.643080d67acc1p-1, -0x1.643080d67acc2p-1}, + {0x1.37d9e563f51ffp1, 0x1.4be4979c5efb2p-1, 0x1.4be4979c5efb1p-1}, + {-0x1.37d9e563f51ffp1, -0x1.4be4979c5efb2p-1, -0x1.4be4979c5efb1p-1}, + {0x1.400ec9be2abbcp1, 0x1.323b8b1fb4b9fp-1, 0x1.323b8b1fb4b9ep-1}, + {-0x1.400ec9be2abbcp1, -0x1.323b8b1fb4b9fp-1, -0x1.323b8b1fb4b9ep-1}, + {0x1.4843ae1860579p1, 0x1.175059bf0d42p-1, 0x1.175059bf0d421p-1}, + {-0x1.4843ae1860579p1, -0x1.175059bf0d42p-1, -0x1.175059bf0d421p-1}, + {0x1.5078927295f36p1, 0x1.f67ea975b8692p-2, 0x1.f67ea975b8693p-2}, + {-0x1.5078927295f36p1, -0x1.f67ea975b8692p-2, -0x1.f67ea975b8693p-2}, + {0x1.58ad76cccb8f3p1, 0x1.bc4c04d71abadp-2, 0x1.bc4c04d71abaep-2}, + {-0x1.58ad76cccb8f3p1, -0x1.bc4c04d71abadp-2, -0x1.bc4c04d71abaep-2}, + {0x1.60e25b27012bp1, 0x1.8045fe64e62c6p-2, 0x1.8045fe64e62c7p-2}, + {-0x1.60e25b27012bp1, -0x1.8045fe64e62c6p-2, -0x1.8045fe64e62c7p-2}, + {0x1.69173f8136c6dp1, 0x1.42abba8c72fa1p-2, 0x1.42abba8c72fa2p-2}, + {-0x1.69173f8136c6dp1, -0x1.42abba8c72fa1p-2, -0x1.42abba8c72fa2p-2}, + {0x1.714c23db6c62ap1, 0x1.03be06f97cbdp-2, 0x1.03be06f97cbcfp-2}, + {-0x1.714c23db6c62ap1, -0x1.03be06f97cbdp-2, -0x1.03be06f97cbcfp-2}, + {0x1.79810835a1fe7p1, 0x1.877e2cd4f6f94p-3, 0x1.877e2cd4f6f95p-3}, + {-0x1.79810835a1fe7p1, -0x1.877e2cd4f6f94p-3, -0x1.877e2cd4f6f95p-3}, + {0x1.81b5ec8fd79a4p1, 0x1.05e4761ab8d42p-3, 0x1.05e4761ab8d43p-3}, + {-0x1.81b5ec8fd79a4p1, -0x1.05e4761ab8d42p-3, -0x1.05e4761ab8d43p-3}, + {0x1.89ead0ea0d35bp1, 0x1.066e7eb76f5ddp-4, 0x1.066e7eb76f5dep-4}, + {-0x1.89ead0ea0d35bp1, -0x1.066e7eb76f5ddp-4, -0x1.066e7eb76f5dep-4}, + {-0x1.81b5ec8fd799fp2, 0x1.03be06f97cbf1p-2, 0x1.03be06f97cbfp-2}, + {0x1.81b5ec8fd799fp2, -0x1.03be06f97cbf1p-2, -0x1.03be06f97cbfp-2}, + {-0x1.714c23db6c626p2, 0x1.f67ea975b86a2p-2, 0x1.f67ea975b86a3p-2}, + {0x1.714c23db6c626p2, -0x1.f67ea975b86a2p-2, -0x1.f67ea975b86a3p-2}, + {-0x1.60e25b27012adp2, 0x1.643080d67acc2p-1, 0x1.643080d67acc3p-1}, + {0x1.60e25b27012adp2, -0x1.643080d67acc2p-1, -0x1.643080d67acc3p-1}, + {-0x1.5078927295f34p2, 0x1.b5d545b109bf9p-1, 0x1.b5d545b109bfap-1}, + {0x1.5078927295f34p2, -0x1.b5d545b109bf9p-1, -0x1.b5d545b109bfap-1}, + {-0x1.400ec9be2abbbp2, 0x1.ead6834909b93p-1, 0x1.ead6834909b94p-1}, + {0x1.400ec9be2abbbp2, -0x1.ead6834909b93p-1, -0x1.ead6834909b94p-1}, + {-0x1.2fa50109bf842p2, 0x1.ffbca846c4fcap-1, 0x1.ffbca846c4fc9p-1}, + {0x1.2fa50109bf842p2, -0x1.ffbca846c4fcap-1, -0x1.ffbca846c4fc9p-1}, + {-0x1.1f3b3855544c9p2, 0x1.f329c0558e96ap-1, 0x1.f329c0558e96bp-1}, + {0x1.1f3b3855544c9p2, -0x1.f329c0558e96ap-1, -0x1.f329c0558e96bp-1}, + {-0x1.0ed16fa0e915p2, 0x1.c5f058230e802p-1, 0x1.c5f058230e803p-1}, + {0x1.0ed16fa0e915p2, -0x1.c5f058230e802p-1, -0x1.c5f058230e803p-1}, + {-0x1.fccf4dd8fbbaep1, 0x1.7b05b7b6c6136p-1, 0x1.7b05b7b6c6137p-1}, + {0x1.fccf4dd8fbbaep1, -0x1.7b05b7b6c6136p-1, -0x1.7b05b7b6c6137p-1}, + {-0x1.dbfbbc70254bcp1, 0x1.175059bf0d42fp-1, 0x1.175059bf0d43p-1}, + {0x1.dbfbbc70254bcp1, -0x1.175059bf0d42fp-1, -0x1.175059bf0d43p-1}, + {-0x1.bb282b074edcap1, 0x1.42abba8c72fd2p-2, 0x1.42abba8c72fd3p-2}, + {0x1.bb282b074edcap1, -0x1.42abba8c72fd2p-2, -0x1.42abba8c72fd3p-2}, + {-0x1.9a54999e786d8p1, 0x1.066e7eb76f62bp-4, 0x1.066e7eb76f62cp-4}, + {0x1.9a54999e786d8p1, -0x1.066e7eb76f62bp-4, -0x1.066e7eb76f62cp-4}, + {-0x1.79810835a1fe6p1, -0x1.877e2cd4f6fa4p-3, -0x1.877e2cd4f6fa5p-3}, + {0x1.79810835a1fe6p1, 0x1.877e2cd4f6fa4p-3, 0x1.877e2cd4f6fa5p-3}, + {-0x1.58ad76cccb8f4p1, -0x1.bc4c04d71aba6p-2, -0x1.bc4c04d71aba5p-2}, + {0x1.58ad76cccb8f4p1, 0x1.bc4c04d71aba6p-2, 0x1.bc4c04d71aba5p-2}, + {-0x1.37d9e563f5202p1, -0x1.4be4979c5efa8p-1, -0x1.4be4979c5efa9p-1}, + {0x1.37d9e563f5202p1, 0x1.4be4979c5efa8p-1, 0x1.4be4979c5efa9p-1}, + {-0x1.170653fb1eb1p1, -0x1.a3ed9e2529382p-1, -0x1.a3ed9e2529383p-1}, + {0x1.170653fb1eb1p1, 0x1.a3ed9e2529382p-1, 0x1.a3ed9e2529383p-1}, + {-0x1.ec6585249083cp0, -0x1.e07eeeda109c6p-1, -0x1.e07eeeda109c7p-1}, + {0x1.ec6585249083cp0, 0x1.e07eeeda109c6p-1, 0x1.e07eeeda109c7p-1}, + {-0x1.aabe6252e3a58p0, -0x1.fda254c27a01ep-1, -0x1.fda254c27a01dp-1}, + {0x1.aabe6252e3a58p0, 0x1.fda254c27a01ep-1, 0x1.fda254c27a01dp-1}, + {-0x1.69173f8136c74p0, -0x1.f96fe405f1acap-1, -0x1.f96fe405f1acbp-1}, + {0x1.69173f8136c74p0, 0x1.f96fe405f1acap-1, 0x1.f96fe405f1acbp-1}, + {-0x1.27701caf89e9p0, -0x1.d42de42dce13fp-1, -0x1.d42de42dce13ep-1}, + {0x1.27701caf89e9p0, 0x1.d42de42dce13fp-1, 0x1.d42de42dce13ep-1}, + {-0x1.cb91f3bbba157p-1, -0x1.904c37505de59p-1, -0x1.904c37505de5ap-1}, + {0x1.cb91f3bbba157p-1, 0x1.904c37505de59p-1, 0x1.904c37505de5ap-1}, + {-0x1.4843ae186058ep-1, -0x1.323b8b1fb4bb6p-1, -0x1.323b8b1fb4bb7p-1}, + {0x1.4843ae186058ep-1, 0x1.323b8b1fb4bb6p-1, 0x1.323b8b1fb4bb7p-1}, + {-0x1.89ead0ea0d38ap-2, -0x1.8045fe64e6309p-2, -0x1.8045fe64e6308p-2}, + {0x1.89ead0ea0d38ap-2, 0x1.8045fe64e6309p-2, 0x1.8045fe64e6308p-2}, + {-0x1.069c8b46b37fp-3, -0x1.05e4761ab8decp-3, -0x1.05e4761ab8dedp-3}, + {0x1.069c8b46b37fp-3, 0x1.05e4761ab8decp-3, 0x1.05e4761ab8dedp-3}, + {0x1.069c8b46b3734p-3, 0x1.05e4761ab8d32p-3, 0x1.05e4761ab8d31p-3}, + {-0x1.069c8b46b3734p-3, -0x1.05e4761ab8d32p-3, -0x1.05e4761ab8d31p-3}, + {0x1.89ead0ea0d32cp-2, 0x1.8045fe64e62b2p-2, 0x1.8045fe64e62b1p-2}, + {-0x1.89ead0ea0d32cp-2, -0x1.8045fe64e62b2p-2, -0x1.8045fe64e62b1p-2}, + {0x1.4843ae186055fp-1, 0x1.323b8b1fb4b9p-1, 0x1.323b8b1fb4b91p-1}, + {-0x1.4843ae186055fp-1, -0x1.323b8b1fb4b9p-1, -0x1.323b8b1fb4b91p-1}, + {0x1.cb91f3bbba128p-1, 0x1.904c37505de3cp-1, 0x1.904c37505de3bp-1}, + {-0x1.cb91f3bbba128p-1, -0x1.904c37505de3cp-1, -0x1.904c37505de3bp-1}, + {0x1.27701caf89e78p0, 0x1.d42de42dce12bp-1, 0x1.d42de42dce12cp-1}, + {-0x1.27701caf89e78p0, -0x1.d42de42dce12bp-1, -0x1.d42de42dce12cp-1}, + {0x1.69173f8136c5cp0, 0x1.f96fe405f1ac2p-1, 0x1.f96fe405f1ac3p-1}, + {-0x1.69173f8136c5cp0, -0x1.f96fe405f1ac2p-1, -0x1.f96fe405f1ac3p-1}, + {0x1.aabe6252e3a4p0, 0x1.fda254c27a022p-1, 0x1.fda254c27a023p-1}, + {-0x1.aabe6252e3a4p0, -0x1.fda254c27a022p-1, -0x1.fda254c27a023p-1}, + {0x1.ec65852490824p0, 0x1.e07eeeda109d7p-1, 0x1.e07eeeda109d6p-1}, + {-0x1.ec65852490824p0, -0x1.e07eeeda109d7p-1, -0x1.e07eeeda109d6p-1}, + {0x1.170653fb1eb04p1, 0x1.a3ed9e252939ep-1, 0x1.a3ed9e252939dp-1}, + {-0x1.170653fb1eb04p1, -0x1.a3ed9e252939ep-1, -0x1.a3ed9e252939dp-1}, + {0x1.37d9e563f51f6p1, 0x1.4be4979c5efcdp-1, 0x1.4be4979c5efccp-1}, + {-0x1.37d9e563f51f6p1, -0x1.4be4979c5efcdp-1, -0x1.4be4979c5efccp-1}, + {0x1.58ad76cccb8e8p1, 0x1.bc4c04d71abfcp-2, 0x1.bc4c04d71abfdp-2}, + {-0x1.58ad76cccb8e8p1, -0x1.bc4c04d71abfcp-2, -0x1.bc4c04d71abfdp-2}, + {0x1.79810835a1fdap1, 0x1.877e2cd4f7061p-3, 0x1.877e2cd4f706p-3}, + {-0x1.79810835a1fdap1, -0x1.877e2cd4f7061p-3, -0x1.877e2cd4f706p-3}, + {0x1.9a54999e786ccp1, -0x1.066e7eb76f4acp-4, -0x1.066e7eb76f4adp-4}, + {-0x1.9a54999e786ccp1, 0x1.066e7eb76f4acp-4, 0x1.066e7eb76f4adp-4}, + {0x1.bb282b074edbep1, -0x1.42abba8c72f77p-2, -0x1.42abba8c72f78p-2}, + {-0x1.bb282b074edbep1, 0x1.42abba8c72f77p-2, 0x1.42abba8c72f78p-2}, + {0x1.dbfbbc70254bp1, -0x1.175059bf0d407p-1, -0x1.175059bf0d406p-1}, + {-0x1.dbfbbc70254bp1, 0x1.175059bf0d407p-1, 0x1.175059bf0d406p-1}, + {0x1.fccf4dd8fbba2p1, -0x1.7b05b7b6c6116p-1, -0x1.7b05b7b6c6117p-1}, + {-0x1.fccf4dd8fbba2p1, 0x1.7b05b7b6c6116p-1, 0x1.7b05b7b6c6117p-1}, + {0x1.0ed16fa0e914ap2, -0x1.c5f058230e7ecp-1, -0x1.c5f058230e7ebp-1}, + {-0x1.0ed16fa0e914ap2, 0x1.c5f058230e7ecp-1, 0x1.c5f058230e7ebp-1}, + {0x1.1f3b3855544c3p2, -0x1.f329c0558e96p-1, -0x1.f329c0558e95fp-1}, + {-0x1.1f3b3855544c3p2, 0x1.f329c0558e96p-1, 0x1.f329c0558e95fp-1}, + {0x1.2fa50109bf83cp2, -0x1.ffbca846c4fcbp-1, -0x1.ffbca846c4fccp-1}, + {-0x1.2fa50109bf83cp2, 0x1.ffbca846c4fcbp-1, 0x1.ffbca846c4fccp-1}, + {0x1.400ec9be2abb5p2, -0x1.ead6834909ba1p-1, -0x1.ead6834909bap-1}, + {-0x1.400ec9be2abb5p2, 0x1.ead6834909ba1p-1, 0x1.ead6834909bap-1}, + {0x1.5078927295f2ep2, -0x1.b5d545b109c12p-1, -0x1.b5d545b109c13p-1}, + {-0x1.5078927295f2ep2, 0x1.b5d545b109c12p-1, 0x1.b5d545b109c13p-1}, + {0x1.60e25b27012a7p2, -0x1.643080d67ace4p-1, -0x1.643080d67ace5p-1}, + {-0x1.60e25b27012a7p2, 0x1.643080d67ace4p-1, 0x1.643080d67ace5p-1}, + {0x1.714c23db6c62p2, -0x1.f67ea975b86f6p-2, -0x1.f67ea975b86f5p-2}, + {-0x1.714c23db6c62p2, 0x1.f67ea975b86f6p-2, 0x1.f67ea975b86f5p-2}, + {0x1.81b5ec8fd7999p2, -0x1.03be06f97cc4dp-2, -0x1.03be06f97cc4ep-2}, + {-0x1.81b5ec8fd7999p2, 0x1.03be06f97cc4dp-2, 0x1.03be06f97cc4ep-2}, + {0x1.effffffffffffp-5, 0x1.efb26ef930c4cp-5, 0x1.efb26ef930c4dp-5}, + {-0x1.effffffffffffp-5, -0x1.efb26ef930c4cp-5, -0x1.efb26ef930c4dp-5}, + {0x1.fp-5, 0x1.efb26ef930c4dp-5, 0x1.efb26ef930c4ep-5}, + {-0x1.fp-5, -0x1.efb26ef930c4dp-5, -0x1.efb26ef930c4ep-5}, + {0x1.f000000000001p-5, 0x1.efb26ef930c4ep-5, 0x1.efb26ef930c4fp-5}, + {-0x1.f000000000001p-5, -0x1.efb26ef930c4ep-5, -0x1.efb26ef930c4fp-5}, + {0x1.f7fffffffffffp-4, 0x1.f6baaa131de63p-4, 0x1.f6baaa131de64p-4}, + {-0x1.f7fffffffffffp-4, -0x1.f6baaa131de63p-4, -0x1.f6baaa131de64p-4}, + {0x1.f8p-4, 0x1.f6baaa131de64p-4, 0x1.f6baaa131de65p-4}, + {-0x1.f8p-4, -0x1.f6baaa131de64p-4, -0x1.f6baaa131de65p-4}, + {0x1.f800000000001p-4, 0x1.f6baaa131de65p-4, 0x1.f6baaa131de66p-4}, + {-0x1.f800000000001p-4, -0x1.f6baaa131de65p-4, -0x1.f6baaa131de66p-4}, + {0x1.4bfffffffffffp-3, 0x1.4a8c3b4e9c7ffp-3, 0x1.4a8c3b4e9c8p-3}, + {-0x1.4bfffffffffffp-3, -0x1.4a8c3b4e9c7ffp-3, -0x1.4a8c3b4e9c8p-3}, + {0x1.4cp-3, 0x1.4a8c3b4e9c8p-3, 0x1.4a8c3b4e9c7ffp-3}, + {-0x1.4cp-3, -0x1.4a8c3b4e9c8p-3, -0x1.4a8c3b4e9c7ffp-3}, + {0x1.4c00000000001p-3, 0x1.4a8c3b4e9c801p-3, 0x1.4a8c3b4e9c8p-3}, + {-0x1.4c00000000001p-3, -0x1.4a8c3b4e9c801p-3, -0x1.4a8c3b4e9c8p-3}, + {0x1.3333333333332p-2, 0x1.2e9cd95baba32p-2, 0x1.2e9cd95baba33p-2}, + {-0x1.3333333333332p-2, -0x1.2e9cd95baba32p-2, -0x1.2e9cd95baba33p-2}, + {0x1.3333333333333p-2, 0x1.2e9cd95baba33p-2, 0x1.2e9cd95baba34p-2}, + {-0x1.3333333333333p-2, -0x1.2e9cd95baba33p-2, -0x1.2e9cd95baba34p-2}, + {0x1.3333333333334p-2, 0x1.2e9cd95baba34p-2, 0x1.2e9cd95baba35p-2}, + {-0x1.3333333333334p-2, -0x1.2e9cd95baba34p-2, -0x1.2e9cd95baba35p-2}, + {0x1.594317acc4ef8p-1, 0x1.3faefc7a5466fp-1, 0x1.3faefc7a5466ep-1}, + {-0x1.594317acc4ef8p-1, -0x1.3faefc7a5466fp-1, -0x1.3faefc7a5466ep-1}, + {0x1.594317acc4ef9p-1, 0x1.3faefc7a5467p-1, 0x1.3faefc7a5466fp-1}, + {-0x1.594317acc4ef9p-1, -0x1.3faefc7a5467p-1, -0x1.3faefc7a5466fp-1}, + {0x1.594317acc4efap-1, 0x1.3faefc7a5467p-1, 0x1.3faefc7a54671p-1}, + {-0x1.594317acc4efap-1, -0x1.3faefc7a5467p-1, -0x1.3faefc7a54671p-1}, + {0x1.8ffffffffffffp-1, 0x1.6888a4e134b2ep-1, 0x1.6888a4e134b2dp-1}, + {-0x1.8ffffffffffffp-1, -0x1.6888a4e134b2ep-1, -0x1.6888a4e134b2dp-1}, + {0x1.9p-1, 0x1.6888a4e134b2fp-1, 0x1.6888a4e134b2ep-1}, + {-0x1.9p-1, -0x1.6888a4e134b2fp-1, -0x1.6888a4e134b2ep-1}, + {0x1.9000000000001p-1, 0x1.6888a4e134b2fp-1, 0x1.6888a4e134b3p-1}, + {-0x1.9000000000001p-1, -0x1.6888a4e134b2fp-1, -0x1.6888a4e134b3p-1}, + {-0x0.0000000000001p-1022, -0x0.0000000000001p-1022, -0x0.0p0}, + {0x0.0000000000001p-1022, 0x0.0000000000001p-1022, 0x0.0p0}, + {-0x0.0p0, -0x0.0p0, -0x0.0p0}, + {0x0.0000000000001p-1022, 0x0.0000000000001p-1022, 0x0.0p0}, + {-0x0.0000000000001p-1022, -0x0.0000000000001p-1022, -0x0.0p0}, + {0x1.921fb54442d17p-5, 0x1.91f65f10dd813p-5, 0x1.91f65f10dd812p-5}, + {-0x1.921fb54442d17p-5, -0x1.91f65f10dd813p-5, -0x1.91f65f10dd812p-5}, + {0x1.921fb54442d18p-5, 0x1.91f65f10dd814p-5, 0x1.91f65f10dd813p-5}, + {-0x1.921fb54442d18p-5, -0x1.91f65f10dd814p-5, -0x1.91f65f10dd813p-5}, + {0x1.921fb54442d19p-5, 0x1.91f65f10dd815p-5, 0x1.91f65f10dd814p-5}, + {-0x1.921fb54442d19p-5, -0x1.91f65f10dd815p-5, -0x1.91f65f10dd814p-5}, + {0x1.921fb54442d17p-4, 0x1.917a6bc29b42bp-4, 0x1.917a6bc29b42ap-4}, + {-0x1.921fb54442d17p-4, -0x1.917a6bc29b42bp-4, -0x1.917a6bc29b42ap-4}, + {0x1.921fb54442d18p-4, 0x1.917a6bc29b42cp-4, 0x1.917a6bc29b42bp-4}, + {-0x1.921fb54442d18p-4, -0x1.917a6bc29b42cp-4, -0x1.917a6bc29b42bp-4}, + {0x1.921fb54442d19p-4, 0x1.917a6bc29b42dp-4, 0x1.917a6bc29b42cp-4}, + {-0x1.921fb54442d19p-4, -0x1.917a6bc29b42dp-4, -0x1.917a6bc29b42cp-4}, + {0x1.921fb54442d17p-3, 0x1.8f8b83c69a609p-3, 0x1.8f8b83c69a60ap-3}, + {-0x1.921fb54442d17p-3, -0x1.8f8b83c69a609p-3, -0x1.8f8b83c69a60ap-3}, + {0x1.921fb54442d18p-3, 0x1.8f8b83c69a60ap-3, 0x1.8f8b83c69a60bp-3}, + {-0x1.921fb54442d18p-3, -0x1.8f8b83c69a60ap-3, -0x1.8f8b83c69a60bp-3}, + {0x1.921fb54442d19p-3, 0x1.8f8b83c69a60bp-3, 0x1.8f8b83c69a60cp-3}, + {-0x1.921fb54442d19p-3, -0x1.8f8b83c69a60bp-3, -0x1.8f8b83c69a60cp-3}, + {0x1.921fb54442d17p-2, 0x1.87de2a6aea962p-2, 0x1.87de2a6aea961p-2}, + {-0x1.921fb54442d17p-2, -0x1.87de2a6aea962p-2, -0x1.87de2a6aea961p-2}, + {0x1.921fb54442d18p-2, 0x1.87de2a6aea963p-2, 0x1.87de2a6aea962p-2}, + {-0x1.921fb54442d18p-2, -0x1.87de2a6aea963p-2, -0x1.87de2a6aea962p-2}, + {0x1.921fb54442d19p-2, 0x1.87de2a6aea964p-2, 0x1.87de2a6aea963p-2}, + {-0x1.921fb54442d19p-2, -0x1.87de2a6aea964p-2, -0x1.87de2a6aea963p-2}, + {0x1.921fb54442d17p-1, 0x1.6a09e667f3bccp-1, 0x1.6a09e667f3bcbp-1}, + {-0x1.921fb54442d17p-1, -0x1.6a09e667f3bccp-1, -0x1.6a09e667f3bcbp-1}, + {0x1.921fb54442d18p-1, 0x1.6a09e667f3bccp-1, 0x1.6a09e667f3bcdp-1}, + {-0x1.921fb54442d18p-1, -0x1.6a09e667f3bccp-1, -0x1.6a09e667f3bcdp-1}, + {0x1.921fb54442d19p-1, 0x1.6a09e667f3bcdp-1, 0x1.6a09e667f3bcep-1}, + {-0x1.921fb54442d19p-1, -0x1.6a09e667f3bcdp-1, -0x1.6a09e667f3bcep-1}, + {0x1.921fb54442d17p0, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d17p0, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.921fb54442d18p0, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p0, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.921fb54442d19p0, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d19p0, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.921fb54442d17p1, 0x1.469898cc51702p-51, 0x1.469898cc51701p-51}, + {-0x1.921fb54442d17p1, -0x1.469898cc51702p-51, -0x1.469898cc51701p-51}, + {0x1.921fb54442d18p1, 0x1.1a62633145c07p-53, 0x1.1a62633145c06p-53}, + {-0x1.921fb54442d18p1, -0x1.1a62633145c07p-53, -0x1.1a62633145c06p-53}, + {0x1.921fb54442d19p1, -0x1.72cece675d1fdp-52, -0x1.72cece675d1fcp-52}, + {-0x1.921fb54442d19p1, 0x1.72cece675d1fdp-52, 0x1.72cece675d1fcp-52}, + {0x1.921fb54442d17p2, -0x1.469898cc51702p-50, -0x1.469898cc51701p-50}, + {-0x1.921fb54442d17p2, 0x1.469898cc51702p-50, 0x1.469898cc51701p-50}, + {0x1.921fb54442d18p2, -0x1.1a62633145c07p-52, -0x1.1a62633145c06p-52}, + {-0x1.921fb54442d18p2, 0x1.1a62633145c07p-52, 0x1.1a62633145c06p-52}, + {0x1.921fb54442d19p2, 0x1.72cece675d1fdp-51, 0x1.72cece675d1fcp-51}, + {-0x1.921fb54442d19p2, -0x1.72cece675d1fdp-51, -0x1.72cece675d1fcp-51}, + {0x1.921fb54442d17p3, -0x1.469898cc51702p-49, -0x1.469898cc51701p-49}, + {-0x1.921fb54442d17p3, 0x1.469898cc51702p-49, 0x1.469898cc51701p-49}, + {0x1.921fb54442d18p3, -0x1.1a62633145c07p-51, -0x1.1a62633145c06p-51}, + {-0x1.921fb54442d18p3, 0x1.1a62633145c07p-51, 0x1.1a62633145c06p-51}, + {0x1.921fb54442d19p3, 0x1.72cece675d1fdp-50, 0x1.72cece675d1fcp-50}, + {-0x1.921fb54442d19p3, -0x1.72cece675d1fdp-50, -0x1.72cece675d1fcp-50}, + {0x1.921fb54442d17p4, -0x1.469898cc51702p-48, -0x1.469898cc51701p-48}, + {-0x1.921fb54442d17p4, 0x1.469898cc51702p-48, 0x1.469898cc51701p-48}, + {0x1.921fb54442d18p4, -0x1.1a62633145c07p-50, -0x1.1a62633145c06p-50}, + {-0x1.921fb54442d18p4, 0x1.1a62633145c07p-50, 0x1.1a62633145c06p-50}, + {0x1.921fb54442d19p4, 0x1.72cece675d1fdp-49, 0x1.72cece675d1fcp-49}, + {-0x1.921fb54442d19p4, -0x1.72cece675d1fdp-49, -0x1.72cece675d1fcp-49}, + {0x1.921fb54442d17p5, -0x1.469898cc51702p-47, -0x1.469898cc51701p-47}, + {-0x1.921fb54442d17p5, 0x1.469898cc51702p-47, 0x1.469898cc51701p-47}, + {0x1.921fb54442d18p5, -0x1.1a62633145c07p-49, -0x1.1a62633145c06p-49}, + {-0x1.921fb54442d18p5, 0x1.1a62633145c07p-49, 0x1.1a62633145c06p-49}, + {0x1.921fb54442d19p5, 0x1.72cece675d1fdp-48, 0x1.72cece675d1fcp-48}, + {-0x1.921fb54442d19p5, -0x1.72cece675d1fdp-48, -0x1.72cece675d1fcp-48}, + {0x1.921fb54442d17p6, -0x1.469898cc51702p-46, -0x1.469898cc51701p-46}, + {-0x1.921fb54442d17p6, 0x1.469898cc51702p-46, 0x1.469898cc51701p-46}, + {0x1.921fb54442d18p6, -0x1.1a62633145c07p-48, -0x1.1a62633145c06p-48}, + {-0x1.921fb54442d18p6, 0x1.1a62633145c07p-48, 0x1.1a62633145c06p-48}, + {0x1.921fb54442d19p6, 0x1.72cece675d1fdp-47, 0x1.72cece675d1fcp-47}, + {-0x1.921fb54442d19p6, -0x1.72cece675d1fdp-47, -0x1.72cece675d1fcp-47}, + {0x1.921fb54442d17p7, -0x1.469898cc51702p-45, -0x1.469898cc51701p-45}, + {-0x1.921fb54442d17p7, 0x1.469898cc51702p-45, 0x1.469898cc51701p-45}, + {0x1.921fb54442d18p7, -0x1.1a62633145c07p-47, -0x1.1a62633145c06p-47}, + {-0x1.921fb54442d18p7, 0x1.1a62633145c07p-47, 0x1.1a62633145c06p-47}, + {0x1.921fb54442d19p7, 0x1.72cece675d1fdp-46, 0x1.72cece675d1fcp-46}, + {-0x1.921fb54442d19p7, -0x1.72cece675d1fdp-46, -0x1.72cece675d1fcp-46}, + {0x1.2d97c7f3321d1p1, 0x1.6a09e667f3bdp-1, 0x1.6a09e667f3bcfp-1}, + {-0x1.2d97c7f3321d1p1, -0x1.6a09e667f3bdp-1, -0x1.6a09e667f3bcfp-1}, + {0x1.2d97c7f3321d2p1, 0x1.6a09e667f3bcdp-1, 0x1.6a09e667f3bcep-1}, + {-0x1.2d97c7f3321d2p1, -0x1.6a09e667f3bcdp-1, -0x1.6a09e667f3bcep-1}, + {0x1.2d97c7f3321d3p1, 0x1.6a09e667f3bcap-1, 0x1.6a09e667f3bcbp-1}, + {-0x1.2d97c7f3321d3p1, -0x1.6a09e667f3bcap-1, -0x1.6a09e667f3bcbp-1}, + {0x1.f6a7a2955385dp1, -0x1.6a09e667f3bc9p-1, -0x1.6a09e667f3bc8p-1}, + {-0x1.f6a7a2955385dp1, 0x1.6a09e667f3bc9p-1, 0x1.6a09e667f3bc8p-1}, + {0x1.f6a7a2955385ep1, -0x1.6a09e667f3bccp-1, -0x1.6a09e667f3bcbp-1}, + {-0x1.f6a7a2955385ep1, 0x1.6a09e667f3bccp-1, 0x1.6a09e667f3bcbp-1}, + {0x1.f6a7a2955385fp1, -0x1.6a09e667f3bcep-1, -0x1.6a09e667f3bcfp-1}, + {-0x1.f6a7a2955385fp1, 0x1.6a09e667f3bcep-1, 0x1.6a09e667f3bcfp-1}, + {0x1.2d97c7f3321d1p2, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.2d97c7f3321d1p2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.2d97c7f3321d2p2, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.2d97c7f3321d2p2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.2d97c7f3321d3p2, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.2d97c7f3321d3p2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.5fdbbe9bba774p2, -0x1.6a09e667f3bd4p-1, -0x1.6a09e667f3bd3p-1}, + {-0x1.5fdbbe9bba774p2, 0x1.6a09e667f3bd4p-1, 0x1.6a09e667f3bd3p-1}, + {0x1.5fdbbe9bba775p2, -0x1.6a09e667f3bcep-1, -0x1.6a09e667f3bcdp-1}, + {-0x1.5fdbbe9bba775p2, 0x1.6a09e667f3bcep-1, 0x1.6a09e667f3bcdp-1}, + {0x1.5fdbbe9bba776p2, -0x1.6a09e667f3bc8p-1, -0x1.6a09e667f3bc9p-1}, + {-0x1.5fdbbe9bba776p2, 0x1.6a09e667f3bc8p-1, 0x1.6a09e667f3bc9p-1}, + {0x1.c463abeccb2bap2, 0x1.6a09e667f3bc5p-1, 0x1.6a09e667f3bc6p-1}, + {-0x1.c463abeccb2bap2, -0x1.6a09e667f3bc5p-1, -0x1.6a09e667f3bc6p-1}, + {0x1.c463abeccb2bbp2, 0x1.6a09e667f3bcbp-1, 0x1.6a09e667f3bcap-1}, + {-0x1.c463abeccb2bbp2, -0x1.6a09e667f3bcbp-1, -0x1.6a09e667f3bcap-1}, + {0x1.c463abeccb2bcp2, 0x1.6a09e667f3bd1p-1, 0x1.6a09e667f3bdp-1}, + {-0x1.c463abeccb2bcp2, -0x1.6a09e667f3bd1p-1, -0x1.6a09e667f3bdp-1}, + {0x1.f6a7a2955385dp2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.f6a7a2955385dp2, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.f6a7a2955385ep2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.f6a7a2955385ep2, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.f6a7a2955385fp2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.f6a7a2955385fp2, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.1475cc9eedeffp3, 0x1.6a09e667f3bdfp-1, 0x1.6a09e667f3bep-1}, + {-0x1.1475cc9eedeffp3, -0x1.6a09e667f3bdfp-1, -0x1.6a09e667f3bep-1}, + {0x1.1475cc9eedfp3, 0x1.6a09e667f3bd4p-1, 0x1.6a09e667f3bd5p-1}, + {-0x1.1475cc9eedfp3, -0x1.6a09e667f3bd4p-1, -0x1.6a09e667f3bd5p-1}, + {0x1.1475cc9eedf01p3, 0x1.6a09e667f3bc9p-1, 0x1.6a09e667f3bcap-1}, + {-0x1.1475cc9eedf01p3, -0x1.6a09e667f3bc9p-1, -0x1.6a09e667f3bcap-1}, + {0x1.2d97c7f3321d1p3, 0x1.34f272993d141p-49, 0x1.34f272993d142p-49}, + {-0x1.2d97c7f3321d1p3, -0x1.34f272993d141p-49, -0x1.34f272993d142p-49}, + {0x1.2d97c7f3321d2p3, 0x1.a79394c9e8a0ap-52, 0x1.a79394c9e8a0bp-52}, + {-0x1.2d97c7f3321d2p3, -0x1.a79394c9e8a0ap-52, -0x1.a79394c9e8a0bp-52}, + {0x1.2d97c7f3321d3p3, -0x1.961b1acd85d7dp-50, -0x1.961b1acd85d7ep-50}, + {-0x1.2d97c7f3321d3p3, 0x1.961b1acd85d7dp-50, 0x1.961b1acd85d7ep-50}, + {0x1.46b9c347764a2p3, -0x1.6a09e667f3bb9p-1, -0x1.6a09e667f3bbap-1}, + {-0x1.46b9c347764a2p3, 0x1.6a09e667f3bb9p-1, 0x1.6a09e667f3bbap-1}, + {0x1.46b9c347764a3p3, -0x1.6a09e667f3bc4p-1, -0x1.6a09e667f3bc5p-1}, + {-0x1.46b9c347764a3p3, 0x1.6a09e667f3bc4p-1, 0x1.6a09e667f3bc5p-1}, + {0x1.46b9c347764a4p3, -0x1.6a09e667f3bdp-1, -0x1.6a09e667f3bcfp-1}, + {-0x1.46b9c347764a4p3, 0x1.6a09e667f3bdp-1, 0x1.6a09e667f3bcfp-1}, + {0x1.5fdbbe9bba774p3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.5fdbbe9bba774p3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.5fdbbe9bba775p3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.5fdbbe9bba775p3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.5fdbbe9bba776p3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.5fdbbe9bba776p3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.78fdb9effea45p3, -0x1.6a09e667f3bep-1, -0x1.6a09e667f3be1p-1}, + {-0x1.78fdb9effea45p3, 0x1.6a09e667f3bep-1, 0x1.6a09e667f3be1p-1}, + {0x1.78fdb9effea46p3, -0x1.6a09e667f3bd5p-1, -0x1.6a09e667f3bd6p-1}, + {-0x1.78fdb9effea46p3, 0x1.6a09e667f3bd5p-1, 0x1.6a09e667f3bd6p-1}, + {0x1.78fdb9effea47p3, -0x1.6a09e667f3bcap-1, -0x1.6a09e667f3bc9p-1}, + {-0x1.78fdb9effea47p3, 0x1.6a09e667f3bcap-1, 0x1.6a09e667f3bc9p-1}, + {0x1.ab41b09886fe8p3, 0x1.6a09e667f3bb8p-1, 0x1.6a09e667f3bb9p-1}, + {-0x1.ab41b09886fe8p3, -0x1.6a09e667f3bb8p-1, -0x1.6a09e667f3bb9p-1}, + {0x1.ab41b09886fe9p3, 0x1.6a09e667f3bc4p-1, 0x1.6a09e667f3bc3p-1}, + {-0x1.ab41b09886fe9p3, -0x1.6a09e667f3bc4p-1, -0x1.6a09e667f3bc3p-1}, + {0x1.ab41b09886feap3, 0x1.6a09e667f3bcfp-1, 0x1.6a09e667f3bcep-1}, + {-0x1.ab41b09886feap3, -0x1.6a09e667f3bcfp-1, -0x1.6a09e667f3bcep-1}, + {0x1.c463abeccb2bap3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.c463abeccb2bap3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.c463abeccb2bbp3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.c463abeccb2bbp3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.c463abeccb2bcp3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.c463abeccb2bcp3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.dd85a7410f58bp3, 0x1.6a09e667f3be1p-1, 0x1.6a09e667f3be2p-1}, + {-0x1.dd85a7410f58bp3, -0x1.6a09e667f3be1p-1, -0x1.6a09e667f3be2p-1}, + {0x1.dd85a7410f58cp3, 0x1.6a09e667f3bd6p-1, 0x1.6a09e667f3bd5p-1}, + {-0x1.dd85a7410f58cp3, -0x1.6a09e667f3bd6p-1, -0x1.6a09e667f3bd5p-1}, + {0x1.dd85a7410f58dp3, 0x1.6a09e667f3bcbp-1, 0x1.6a09e667f3bcap-1}, + {-0x1.dd85a7410f58dp3, -0x1.6a09e667f3bcbp-1, -0x1.6a09e667f3bcap-1}, + {0x1.f6a7a2955385dp3, 0x1.583ebeff65cc2p-49, 0x1.583ebeff65cc3p-49}, + {-0x1.f6a7a2955385dp3, -0x1.583ebeff65cc2p-49, -0x1.583ebeff65cc3p-49}, + {0x1.f6a7a2955385ep3, 0x1.60fafbfd97309p-51, 0x1.60fafbfd97308p-51}, + {-0x1.f6a7a2955385ep3, -0x1.60fafbfd97309p-51, -0x1.60fafbfd97308p-51}, + {0x1.f6a7a2955385fp3, -0x1.4f8282013467cp-50, -0x1.4f8282013467bp-50}, + {-0x1.f6a7a2955385fp3, 0x1.4f8282013467cp-50, 0x1.4f8282013467bp-50}, + {0x1.07e4cef4cbd96p4, -0x1.6a09e667f3ba1p-1, -0x1.6a09e667f3bap-1}, + {-0x1.07e4cef4cbd96p4, 0x1.6a09e667f3ba1p-1, 0x1.6a09e667f3bap-1}, + {0x1.07e4cef4cbd97p4, -0x1.6a09e667f3bb8p-1, -0x1.6a09e667f3bb7p-1}, + {-0x1.07e4cef4cbd97p4, 0x1.6a09e667f3bb8p-1, 0x1.6a09e667f3bb7p-1}, + {0x1.07e4cef4cbd98p4, -0x1.6a09e667f3bcep-1, -0x1.6a09e667f3bcfp-1}, + {-0x1.07e4cef4cbd98p4, 0x1.6a09e667f3bcep-1, 0x1.6a09e667f3bcfp-1}, + {0x1.1475cc9eedeffp4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.1475cc9eedeffp4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.1475cc9eedfp4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.1475cc9eedfp4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.1475cc9eedf01p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.1475cc9eedf01p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.2106ca4910068p4, -0x1.6a09e667f3bedp-1, -0x1.6a09e667f3beep-1}, + {-0x1.2106ca4910068p4, 0x1.6a09e667f3bedp-1, 0x1.6a09e667f3beep-1}, + {0x1.2106ca4910069p4, -0x1.6a09e667f3bd7p-1, -0x1.6a09e667f3bd6p-1}, + {-0x1.2106ca4910069p4, 0x1.6a09e667f3bd7p-1, 0x1.6a09e667f3bd6p-1}, + {0x1.2106ca491006ap4, -0x1.6a09e667f3bcp-1, -0x1.6a09e667f3bc1p-1}, + {-0x1.2106ca491006ap4, 0x1.6a09e667f3bcp-1, 0x1.6a09e667f3bc1p-1}, + {0x1.2d97c7f3321d1p4, -0x1.34f272993d141p-48, -0x1.34f272993d142p-48}, + {-0x1.2d97c7f3321d1p4, 0x1.34f272993d141p-48, 0x1.34f272993d142p-48}, + {0x1.2d97c7f3321d2p4, -0x1.a79394c9e8a0ap-51, -0x1.a79394c9e8a0bp-51}, + {-0x1.2d97c7f3321d2p4, 0x1.a79394c9e8a0ap-51, 0x1.a79394c9e8a0bp-51}, + {0x1.2d97c7f3321d3p4, 0x1.961b1acd85d7dp-49, 0x1.961b1acd85d7ep-49}, + {-0x1.2d97c7f3321d3p4, -0x1.961b1acd85d7dp-49, -0x1.961b1acd85d7ep-49}, + {0x1.3a28c59d54339p4, 0x1.6a09e667f3bap-1, 0x1.6a09e667f3ba1p-1}, + {-0x1.3a28c59d54339p4, -0x1.6a09e667f3bap-1, -0x1.6a09e667f3ba1p-1}, + {0x1.3a28c59d5433ap4, 0x1.6a09e667f3bb7p-1, 0x1.6a09e667f3bb6p-1}, + {-0x1.3a28c59d5433ap4, -0x1.6a09e667f3bb7p-1, -0x1.6a09e667f3bb6p-1}, + {0x1.3a28c59d5433bp4, 0x1.6a09e667f3bcep-1, 0x1.6a09e667f3bcdp-1}, + {-0x1.3a28c59d5433bp4, -0x1.6a09e667f3bcep-1, -0x1.6a09e667f3bcdp-1}, + {0x1.46b9c347764a2p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.46b9c347764a2p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.46b9c347764a3p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.46b9c347764a3p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.46b9c347764a4p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.46b9c347764a4p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.534ac0f19860bp4, 0x1.6a09e667f3beep-1, 0x1.6a09e667f3befp-1}, + {-0x1.534ac0f19860bp4, -0x1.6a09e667f3beep-1, -0x1.6a09e667f3befp-1}, + {0x1.534ac0f19860cp4, 0x1.6a09e667f3bd8p-1, 0x1.6a09e667f3bd7p-1}, + {-0x1.534ac0f19860cp4, -0x1.6a09e667f3bd8p-1, -0x1.6a09e667f3bd7p-1}, + {0x1.534ac0f19860dp4, 0x1.6a09e667f3bc1p-1, 0x1.6a09e667f3bcp-1}, + {-0x1.534ac0f19860dp4, -0x1.6a09e667f3bc1p-1, -0x1.6a09e667f3bcp-1}, + {0x1.5fdbbe9bba774p4, 0x1.3dc585b2c7422p-48, 0x1.3dc585b2c7421p-48}, + {-0x1.5fdbbe9bba774p4, -0x1.3dc585b2c7422p-48, -0x1.3dc585b2c7421p-48}, + {0x1.5fdbbe9bba775p4, 0x1.ee2c2d963a10cp-51, 0x1.ee2c2d963a10dp-51}, + {-0x1.5fdbbe9bba775p4, -0x1.ee2c2d963a10cp-51, -0x1.ee2c2d963a10dp-51}, + {0x1.5fdbbe9bba776p4, -0x1.8474f49a717bdp-49, -0x1.8474f49a717bcp-49}, + {-0x1.5fdbbe9bba776p4, 0x1.8474f49a717bdp-49, 0x1.8474f49a717bcp-49}, + {0x1.6c6cbc45dc8dcp4, -0x1.6a09e667f3b9fp-1, -0x1.6a09e667f3bap-1}, + {-0x1.6c6cbc45dc8dcp4, 0x1.6a09e667f3b9fp-1, 0x1.6a09e667f3bap-1}, + {0x1.6c6cbc45dc8ddp4, -0x1.6a09e667f3bb6p-1, -0x1.6a09e667f3bb5p-1}, + {-0x1.6c6cbc45dc8ddp4, 0x1.6a09e667f3bb6p-1, 0x1.6a09e667f3bb5p-1}, + {0x1.6c6cbc45dc8dep4, -0x1.6a09e667f3bcdp-1, -0x1.6a09e667f3bccp-1}, + {-0x1.6c6cbc45dc8dep4, 0x1.6a09e667f3bcdp-1, 0x1.6a09e667f3bccp-1}, + {0x1.78fdb9effea45p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.78fdb9effea45p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.78fdb9effea46p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.78fdb9effea46p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.78fdb9effea47p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.78fdb9effea47p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.858eb79a20baep4, -0x1.6a09e667f3befp-1, -0x1.6a09e667f3beep-1}, + {-0x1.858eb79a20baep4, 0x1.6a09e667f3befp-1, 0x1.6a09e667f3beep-1}, + {0x1.858eb79a20bafp4, -0x1.6a09e667f3bd8p-1, -0x1.6a09e667f3bd9p-1}, + {-0x1.858eb79a20bafp4, 0x1.6a09e667f3bd8p-1, 0x1.6a09e667f3bd9p-1}, + {0x1.858eb79a20bbp4, -0x1.6a09e667f3bc2p-1, -0x1.6a09e667f3bc1p-1}, + {-0x1.858eb79a20bbp4, 0x1.6a09e667f3bc2p-1, 0x1.6a09e667f3bc1p-1}, + {0x1.fffffffffffffp62, 0x1.fa7299b17573dp-1, 0x1.fa7299b17573ep-1}, + {-0x1.fffffffffffffp62, -0x1.fa7299b17573dp-1, -0x1.fa7299b17573ep-1}, + {0x1.0p63, 0x1.fff6dfd42dc54p-1, 0x1.fff6dfd42dc55p-1}, + {-0x1.0p63, -0x1.fff6dfd42dc54p-1, -0x1.fff6dfd42dc55p-1}, + {0x1.0000000000001p63, 0x1.e456b818e7397p-1, 0x1.e456b818e7396p-1}, + {-0x1.0000000000001p63, -0x1.e456b818e7397p-1, -0x1.e456b818e7396p-1}, + {0x1.fffffffffffffp26, -0x1.86dcca0d689e8p-1, -0x1.86dcca0d689e7p-1}, + {-0x1.fffffffffffffp26, 0x1.86dcca0d689e8p-1, 0x1.86dcca0d689e7p-1}, + {0x1.0p27, -0x1.86dcc9babb0a4p-1, -0x1.86dcc9babb0a5p-1}, + {-0x1.0p27, 0x1.86dcc9babb0a4p-1, 0x1.86dcc9babb0a5p-1}, + {0x1.0000000000001p27, -0x1.86dcc9155fe18p-1, -0x1.86dcc9155fe19p-1}, + {-0x1.0000000000001p27, 0x1.86dcc9155fe18p-1, 0x1.86dcc9155fe19p-1}, + {0x1.fffffffffffffp23, -0x1.8f22f84d42da2p-1, -0x1.8f22f84d42da1p-1}, + {-0x1.fffffffffffffp23, 0x1.8f22f84d42da2p-1, 0x1.8f22f84d42da1p-1}, + {0x1.0p24, -0x1.8f22f8433d6eep-1, -0x1.8f22f8433d6edp-1}, + {-0x1.0p24, 0x1.8f22f8433d6eep-1, 0x1.8f22f8433d6edp-1}, + {0x1.0000000000001p24, -0x1.8f22f82f32986p-1, -0x1.8f22f82f32985p-1}, + {-0x1.0000000000001p24, 0x1.8f22f82f32986p-1, 0x1.8f22f82f32985p-1}, + {0x1.fffffffffffffp1, -0x1.837b9dddc1eacp-1, -0x1.837b9dddc1eabp-1}, + {-0x1.fffffffffffffp1, 0x1.837b9dddc1eacp-1, 0x1.837b9dddc1eabp-1}, + {0x1.0p2, -0x1.837b9dddc1eaep-1, -0x1.837b9dddc1eafp-1}, + {-0x1.0p2, 0x1.837b9dddc1eaep-1, 0x1.837b9dddc1eafp-1}, + {0x1.0000000000001p2, -0x1.837b9dddc1eb4p-1, -0x1.837b9dddc1eb3p-1}, + {-0x1.0000000000001p2, 0x1.837b9dddc1eb4p-1, 0x1.837b9dddc1eb3p-1}, + {0x1.fffffffffffffp0, 0x1.d18f6ead1b447p-1, 0x1.d18f6ead1b446p-1}, + {-0x1.fffffffffffffp0, -0x1.d18f6ead1b447p-1, -0x1.d18f6ead1b446p-1}, + {0x1.0p1, 0x1.d18f6ead1b446p-1, 0x1.d18f6ead1b445p-1}, + {-0x1.0p1, -0x1.d18f6ead1b446p-1, -0x1.d18f6ead1b445p-1}, + {0x1.0000000000001p1, 0x1.d18f6ead1b444p-1, 0x1.d18f6ead1b445p-1}, + {-0x1.0000000000001p1, -0x1.d18f6ead1b444p-1, -0x1.d18f6ead1b445p-1}, + {0x1.fffffffffffffp-1, 0x1.aed548f090cedp-1, 0x1.aed548f090ceep-1}, + {-0x1.fffffffffffffp-1, -0x1.aed548f090cedp-1, -0x1.aed548f090ceep-1}, + {0x1.0p0, 0x1.aed548f090ceep-1, 0x1.aed548f090cefp-1}, + {-0x1.0p0, -0x1.aed548f090ceep-1, -0x1.aed548f090cefp-1}, + {0x1.0000000000001p0, 0x1.aed548f090cefp-1, 0x1.aed548f090cfp-1}, + {-0x1.0000000000001p0, -0x1.aed548f090cefp-1, -0x1.aed548f090cfp-1}, + {0x1.fffffffffffffp-2, 0x1.eaee8744b05efp-2, 0x1.eaee8744b05fp-2}, + {-0x1.fffffffffffffp-2, -0x1.eaee8744b05efp-2, -0x1.eaee8744b05fp-2}, + {0x1.0p-1, 0x1.eaee8744b05fp-2, 0x1.eaee8744b05efp-2}, + {-0x1.0p-1, -0x1.eaee8744b05fp-2, -0x1.eaee8744b05efp-2}, + {0x1.0000000000001p-1, 0x1.eaee8744b05f2p-2, 0x1.eaee8744b05f1p-2}, + {-0x1.0000000000001p-1, -0x1.eaee8744b05f2p-2, -0x1.eaee8744b05f1p-2}, + {0x1.fffffffffffffp-3, 0x1.faaeed4f31576p-3, 0x1.faaeed4f31575p-3}, + {-0x1.fffffffffffffp-3, -0x1.faaeed4f31576p-3, -0x1.faaeed4f31575p-3}, + {0x1.0p-2, 0x1.faaeed4f31577p-3, 0x1.faaeed4f31576p-3}, + {-0x1.0p-2, -0x1.faaeed4f31577p-3, -0x1.faaeed4f31576p-3}, + {0x1.0000000000001p-2, 0x1.faaeed4f31579p-3, 0x1.faaeed4f31578p-3}, + {-0x1.0000000000001p-2, -0x1.faaeed4f31579p-3, -0x1.faaeed4f31578p-3}, + {0x1.fffffffffffffp-4, 0x1.feaaeee86ee35p-4, 0x1.feaaeee86ee34p-4}, + {-0x1.fffffffffffffp-4, -0x1.feaaeee86ee35p-4, -0x1.feaaeee86ee34p-4}, + {0x1.0p-3, 0x1.feaaeee86ee36p-4, 0x1.feaaeee86ee35p-4}, + {-0x1.0p-3, -0x1.feaaeee86ee36p-4, -0x1.feaaeee86ee35p-4}, + {0x1.0000000000001p-3, 0x1.feaaeee86ee38p-4, 0x1.feaaeee86ee37p-4}, + {-0x1.0000000000001p-3, -0x1.feaaeee86ee38p-4, -0x1.feaaeee86ee37p-4}, + {0x1.fffffffffffffp-5, 0x1.ffaaaeeed4edap-5, 0x1.ffaaaeeed4ed9p-5}, + {-0x1.fffffffffffffp-5, -0x1.ffaaaeeed4edap-5, -0x1.ffaaaeeed4ed9p-5}, + {0x1.0p-4, 0x1.ffaaaeeed4edbp-5, 0x1.ffaaaeeed4edap-5}, + {-0x1.0p-4, -0x1.ffaaaeeed4edbp-5, -0x1.ffaaaeeed4edap-5}, + {0x1.0000000000001p-4, 0x1.ffaaaeeed4eddp-5, 0x1.ffaaaeeed4edcp-5}, + {-0x1.0000000000001p-4, -0x1.ffaaaeeed4eddp-5, -0x1.ffaaaeeed4edcp-5}, + {0x1.fffffffffffffp-6, 0x1.ffeaaaeeee86ep-6, 0x1.ffeaaaeeee86dp-6}, + {-0x1.fffffffffffffp-6, -0x1.ffeaaaeeee86ep-6, -0x1.ffeaaaeeee86dp-6}, + {0x1.0p-5, 0x1.ffeaaaeeee86fp-6, 0x1.ffeaaaeeee86ep-6}, + {-0x1.0p-5, -0x1.ffeaaaeeee86fp-6, -0x1.ffeaaaeeee86ep-6}, + {0x1.0000000000001p-5, 0x1.ffeaaaeeee871p-6, 0x1.ffeaaaeeee87p-6}, + {-0x1.0000000000001p-5, -0x1.ffeaaaeeee871p-6, -0x1.ffeaaaeeee87p-6}, + {0x1.fffffffffffffp-7, 0x1.fffaaaaeeeed4p-7, 0x1.fffaaaaeeeed3p-7}, + {-0x1.fffffffffffffp-7, -0x1.fffaaaaeeeed4p-7, -0x1.fffaaaaeeeed3p-7}, + {0x1.0p-6, 0x1.fffaaaaeeeed5p-7, 0x1.fffaaaaeeeed4p-7}, + {-0x1.0p-6, -0x1.fffaaaaeeeed5p-7, -0x1.fffaaaaeeeed4p-7}, + {0x1.0000000000001p-6, 0x1.fffaaaaeeeed7p-7, 0x1.fffaaaaeeeed6p-7}, + {-0x1.0000000000001p-6, -0x1.fffaaaaeeeed7p-7, -0x1.fffaaaaeeeed6p-7}, + {0x1.fffffffffffffp-15, 0x1.fffffffaaaaaap-15, 0x1.fffffffaaaaa9p-15}, + {-0x1.fffffffffffffp-15, -0x1.fffffffaaaaaap-15, -0x1.fffffffaaaaa9p-15}, + {0x1.0p-14, 0x1.fffffffaaaaabp-15, 0x1.fffffffaaaaaap-15}, + {-0x1.0p-14, -0x1.fffffffaaaaabp-15, -0x1.fffffffaaaaaap-15}, + {0x1.0000000000001p-14, 0x1.fffffffaaaaadp-15, 0x1.fffffffaaaaacp-15}, + {-0x1.0000000000001p-14, -0x1.fffffffaaaaadp-15, -0x1.fffffffaaaaacp-15}, + {0x1.fffffffffffffp-28, 0x1.fffffffffffffp-28, 0x1.ffffffffffffep-28}, + {-0x1.fffffffffffffp-28, -0x1.fffffffffffffp-28, -0x1.ffffffffffffep-28}, + {0x1.0p-27, 0x1.0p-27, 0x1.fffffffffffffp-28}, + {-0x1.0p-27, -0x1.0p-27, -0x1.fffffffffffffp-28}, + {0x1.0000000000001p-27, 0x1.0000000000001p-27, 0x1.0p-27}, + {-0x1.0000000000001p-27, -0x1.0000000000001p-27, -0x1.0p-27}, + {0x1.fffffffffffffp-31, 0x1.fffffffffffffp-31, 0x1.ffffffffffffep-31}, + {-0x1.fffffffffffffp-31, -0x1.fffffffffffffp-31, -0x1.ffffffffffffep-31}, + {0x1.0p-30, 0x1.0p-30, 0x1.fffffffffffffp-31}, + {-0x1.0p-30, -0x1.0p-30, -0x1.fffffffffffffp-31}, + {0x1.0000000000001p-30, 0x1.0000000000001p-30, 0x1.0p-30}, + {-0x1.0000000000001p-30, -0x1.0000000000001p-30, -0x1.0p-30}, + {-0x1.fffffffffffffp1023, -0x1.452fc98b34e97p-8, -0x1.452fc98b34e96p-8}, + {0x1.fffffffffffffp1023, 0x1.452fc98b34e97p-8, 0x1.452fc98b34e96p-8}, + {0x1.fffffffffffffp1023, 0x1.452fc98b34e97p-8, 0x1.452fc98b34e96p-8}, + {-0x1.fffffffffffffp1023, -0x1.452fc98b34e97p-8, -0x1.452fc98b34e96p-8}, + {0x1.fffffffffffffp1023, 0x1.452fc98b34e97p-8, 0x1.452fc98b34e96p-8}, + {-0x1.fffffffffffffp1023, -0x1.452fc98b34e97p-8, -0x1.452fc98b34e96p-8}, + {0x1.ffffffffffffep1023, 0x1.daa3677c6ee8ap-1, 0x1.daa3677c6ee8bp-1}, + {-0x1.ffffffffffffep1023, -0x1.daa3677c6ee8ap-1, -0x1.daa3677c6ee8bp-1}, + {0x1.921fb54442d18p1, 0x1.1a62633145c07p-53, 0x1.1a62633145c06p-53}, + {-0x1.921fb54442d18p1, -0x1.1a62633145c07p-53, -0x1.1a62633145c06p-53}, + {0x1.921fb54442d18p0, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p0, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.0000000000001p0, 0x1.aed548f090cefp-1, 0x1.aed548f090cfp-1}, + {-0x1.0000000000001p0, -0x1.aed548f090cefp-1, -0x1.aed548f090cfp-1}, + {0x1.0p0, 0x1.aed548f090ceep-1, 0x1.aed548f090cefp-1}, + {-0x1.0p0, -0x1.aed548f090ceep-1, -0x1.aed548f090cefp-1}, + {0x1.fffffffffffffp-1, 0x1.aed548f090cedp-1, 0x1.aed548f090ceep-1}, + {-0x1.fffffffffffffp-1, -0x1.aed548f090cedp-1, -0x1.aed548f090ceep-1}, + {0x1.921fb54442d18p-1, 0x1.6a09e667f3bccp-1, 0x1.6a09e667f3bcdp-1}, + {-0x1.921fb54442d18p-1, -0x1.6a09e667f3bccp-1, -0x1.6a09e667f3bcdp-1}, + {0x1.0000000000001p-1022, 0x1.0000000000001p-1022, 0x1.0000000000001p-1022}, + {-0x1.0000000000001p-1022, -0x1.0000000000001p-1022, -0x1.0000000000001p-1022}, + {0x1.0p-1022, 0x1.0p-1022, 0x1.0p-1022}, + {-0x1.0p-1022, -0x1.0p-1022, -0x1.0p-1022}, + {0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022}, + {-0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022}, + {0x0.ffffffffffffep-1022, 0x0.ffffffffffffep-1022, 0x0.ffffffffffffep-1022}, + {-0x0.ffffffffffffep-1022, -0x0.ffffffffffffep-1022, -0x0.ffffffffffffep-1022}, + {0x0.0000000000002p-1022, 0x0.0000000000002p-1022, 0x0.0000000000002p-1022}, + {-0x0.0000000000002p-1022, -0x0.0000000000002p-1022, -0x0.0000000000001p-1022}, + {0x0.0000000000001p-1022, 0x0.0000000000001p-1022, 0x0.0p0}, + {-0x0.0000000000001p-1022, -0x0.0000000000001p-1022, -0x0.0p0}, + {0x0.0p0, 0x0.0p0, 0x0.0p0}, + {-0x0.0p0, -0x0.0p0, -0x0.0p0} + + }; + + for(double[] testCase: testCases) { + failures += testSinCase(testCase[0], testCase[1], testCase[2]); + } + + return failures; + } + + private static int testSinCase(double input, double bound1, double bound2) { + int failures = 0; + failures += Tests.testBounds("Math.sin", input, Math.sin(input), bound1, bound2); + return failures; + } + + private static int testCornerCasesCos() { + int failures = 0; + double[][] testCases = { + {0x1.feb1f7920e248p-2, 0x1.c1a27ae836f13p-1, 0x1.c1a27ae836f12p-1}, + {-0x1.feb1f7920e248p-2, 0x1.c1a27ae836f13p-1, 0x1.c1a27ae836f12p-1}, + {0x1.7cb7648526f99p-1, 0x1.78daf01036d0dp-1, 0x1.78daf01036d0cp-1}, + {-0x1.7cb7648526f99p-1, 0x1.78daf01036d0dp-1, 0x1.78daf01036d0cp-1}, + {0x1.549ec0c0c5afap-5, 0x1.ff8eb6a91ecbp-1, 0x1.ff8eb6a91ecb1p-1}, + {-0x1.549ec0c0c5afap-5, 0x1.ff8eb6a91ecbp-1, 0x1.ff8eb6a91ecb1p-1}, + {0x1.16e534ee3658p-4, 0x1.fed0476fc75cap-1, 0x1.fed0476fc75c9p-1}, + {-0x1.16e534ee3658p-4, 0x1.fed0476fc75cap-1, 0x1.fed0476fc75c9p-1}, + {0x1.efeef61d39ac2p-3, 0x1.f10fc61e2c78fp-1, 0x1.f10fc61e2c78ep-1}, + {-0x1.efeef61d39ac2p-3, 0x1.f10fc61e2c78fp-1, 0x1.f10fc61e2c78ep-1}, + {0x1.c65a170474549p-1, 0x1.434a3645be208p-1, 0x1.434a3645be209p-1}, + {-0x1.c65a170474549p-1, 0x1.434a3645be208p-1, 0x1.434a3645be209p-1}, + {0x1.6b8a6273d7c21p0, 0x1.337fc5b072c53p-3, 0x1.337fc5b072c52p-3}, + {-0x1.6b8a6273d7c21p0, 0x1.337fc5b072c53p-3, 0x1.337fc5b072c52p-3}, + {-0x1.036f4ba7e90aap-2, 0x1.efa7cddb128fcp-1, 0x1.efa7cddb128fbp-1}, + {0x1.036f4ba7e90aap-2, 0x1.efa7cddb128fcp-1, 0x1.efa7cddb128fbp-1}, + {-0x1.1500766c9df2p-31, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.1500766c9df2p-31, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.1e2a1563e068ep-2, 0x1.ec231802917bep-1, 0x1.ec231802917bdp-1}, + {0x1.1e2a1563e068ep-2, 0x1.ec231802917bep-1, 0x1.ec231802917bdp-1}, + {-0x1.2115aa73f8d05p5, 0x1.dc044ac92b7fcp-8, 0x1.dc044ac92b7fbp-8}, + {0x1.2115aa73f8d05p5, 0x1.dc044ac92b7fcp-8, 0x1.dc044ac92b7fbp-8}, + {-0x1.34e3bcdf8f69ap2, 0x1.d1fa67c50dd53p-4, 0x1.d1fa67c50dd52p-4}, + {0x1.34e3bcdf8f69ap2, 0x1.d1fa67c50dd53p-4, 0x1.d1fa67c50dd52p-4}, + {-0x1.380000000000bp7, 0x1.e2f8d19fb8db8p-2, 0x1.e2f8d19fb8db9p-2}, + {0x1.380000000000bp7, 0x1.e2f8d19fb8db8p-2, 0x1.e2f8d19fb8db9p-2}, + {-0x1.440000004p6, 0x1.8da9c90c3eda1p-1, 0x1.8da9c90c3eda2p-1}, + {0x1.440000004p6, 0x1.8da9c90c3eda1p-1, 0x1.8da9c90c3eda2p-1}, + {-0x1.550c8ee67a4c4p29, 0x1.b59b320603f83p-1, 0x1.b59b320603f84p-1}, + {0x1.550c8ee67a4c4p29, 0x1.b59b320603f83p-1, 0x1.b59b320603f84p-1}, + {-0x1.711789fdb2e8ap-13, 0x1.ffffff7af6c88p-1, 0x1.ffffff7af6c89p-1}, + {0x1.711789fdb2e8ap-13, 0x1.ffffff7af6c88p-1, 0x1.ffffff7af6c89p-1}, + {-0x1.77e000002p8, 0x1.c1b68ebb0b4fep-2, 0x1.c1b68ebb0b4ffp-2}, + {0x1.77e000002p8, 0x1.c1b68ebb0b4fep-2, 0x1.c1b68ebb0b4ffp-2}, + {-0x1.8106561931b43p0, 0x1.1161e1dad76dcp-4, 0x1.1161e1dad76dbp-4}, + {0x1.8106561931b43p0, 0x1.1161e1dad76dcp-4, 0x1.1161e1dad76dbp-4}, + {-0x1.825be2461cad4p0, 0x1.f828c3226b3d7p-5, 0x1.f828c3226b3d8p-5}, + {0x1.825be2461cad4p0, 0x1.f828c3226b3d7p-5, 0x1.f828c3226b3d8p-5}, + {-0x1.8288755803b08p0, 0x1.f2990d742e9fbp-5, 0x1.f2990d742e9fap-5}, + {0x1.8288755803b08p0, 0x1.f2990d742e9fbp-5, 0x1.f2990d742e9fap-5}, + {-0x1.8a75701f4ccd3p1, -0x1.ff150dda7524dp-1, -0x1.ff150dda7524cp-1}, + {0x1.8a75701f4ccd3p1, -0x1.ff150dda7524dp-1, -0x1.ff150dda7524cp-1}, + {-0x1.b389316f37f37p3, 0x1.015c47c32b574p-1, 0x1.015c47c32b575p-1}, + {0x1.b389316f37f37p3, 0x1.015c47c32b574p-1, 0x1.015c47c32b575p-1}, + {-0x1.c602c465d7d27p6, 0x1.d681a366a0534p-1, 0x1.d681a366a0535p-1}, + {0x1.c602c465d7d27p6, 0x1.d681a366a0534p-1, 0x1.d681a366a0535p-1}, + {-0x1.cfb81fe69664cp4, -0x1.84e896c7543d6p-1, -0x1.84e896c7543d5p-1}, + {0x1.cfb81fe69664cp4, -0x1.84e896c7543d6p-1, -0x1.84e896c7543d5p-1}, + {-0x1.d08f2d86b12c6p13, 0x1.fc5dcfddd54cp-1, 0x1.fc5dcfddd54c1p-1}, + {0x1.d08f2d86b12c6p13, 0x1.fc5dcfddd54cp-1, 0x1.fc5dcfddd54c1p-1}, + {-0x1.de13f0943c494p99, 0x1.fe83235fbe016p-3, 0x1.fe83235fbe015p-3}, + {0x1.de13f0943c494p99, 0x1.fe83235fbe016p-3, 0x1.fe83235fbe015p-3}, + {-0x1.de3c1f1285e8bp3, -0x1.720321239ec5p-1, -0x1.720321239ec4fp-1}, + {0x1.de3c1f1285e8bp3, -0x1.720321239ec5p-1, -0x1.720321239ec4fp-1}, + {-0x1.fffffffffff7fp1023, 0x1.f7143c8bba407p-4, 0x1.f7143c8bba406p-4}, + {0x1.fffffffffff7fp1023, 0x1.f7143c8bba407p-4, 0x1.f7143c8bba406p-4}, + {-0x1.fffffffffffffp1023, -0x1.fffe62ecfab75p-1, -0x1.fffe62ecfab76p-1}, + {0x1.fffffffffffffp1023, -0x1.fffe62ecfab75p-1, -0x1.fffe62ecfab76p-1}, + {0x1.0000000000001p51, 0x1.055e457ac1227p-5, 0x1.055e457ac1228p-5}, + {-0x1.0000000000001p51, 0x1.055e457ac1227p-5, 0x1.055e457ac1228p-5}, + {0x1.0000000000003p-1, 0x1.c1528065b7d4ep-1, 0x1.c1528065b7d4fp-1}, + {-0x1.0000000000003p-1, 0x1.c1528065b7d4ep-1, 0x1.c1528065b7d4fp-1}, + {0x1.0000000000003p-32, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.0000000000003p-32, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.000000000002p150, 0x1.fffea444bc05ep-1, 0x1.fffea444bc05fp-1}, + {-0x1.000000000002p150, 0x1.fffea444bc05ep-1, 0x1.fffea444bc05fp-1}, + {0x1.0000000000038p380, -0x1.ebddee876f434p-1, -0x1.ebddee876f433p-1}, + {-0x1.0000000000038p380, -0x1.ebddee876f434p-1, -0x1.ebddee876f433p-1}, + {0x1.0000000000118p380, -0x1.f2ffc51dc6968p-1, -0x1.f2ffc51dc6969p-1}, + {-0x1.0000000000118p380, -0x1.f2ffc51dc6968p-1, -0x1.f2ffc51dc6969p-1}, + {0x1.00000000003ffp641, -0x1.f8fbb4d358b2p-1, -0x1.f8fbb4d358b21p-1}, + {-0x1.00000000003ffp641, -0x1.f8fbb4d358b2p-1, -0x1.f8fbb4d358b21p-1}, + {0x1.0000000001p1, -0x1.aa2265753e668p-2, -0x1.aa2265753e669p-2}, + {-0x1.0000000001p1, -0x1.aa2265753e668p-2, -0x1.aa2265753e669p-2}, + {0x1.000000008p452, 0x1.fd1242c25994dp-1, 0x1.fd1242c25994ep-1}, + {-0x1.000000008p452, 0x1.fd1242c25994dp-1, 0x1.fd1242c25994ep-1}, + {0x1.00000000effafp-7, 0x1.fffc0001554dap-1, 0x1.fffc0001554dbp-1}, + {-0x1.00000000effafp-7, 0x1.fffc0001554dap-1, 0x1.fffc0001554dbp-1}, + {0x1.00000114fefe2p0, 0x1.14a27f2925522p-1, 0x1.14a27f2925523p-1}, + {-0x1.00000114fefe2p0, 0x1.14a27f2925522p-1, 0x1.14a27f2925523p-1}, + {0x1.000007p40, 0x1.bf81e0269c59dp-3, 0x1.bf81e0269c59cp-3}, + {-0x1.000007p40, 0x1.bf81e0269c59dp-3, 0x1.bf81e0269c59cp-3}, + {0x1.00000acadb3d3p0, 0x1.14a26ed1960d6p-1, 0x1.14a26ed1960d7p-1}, + {-0x1.00000acadb3d3p0, 0x1.14a26ed1960d6p-1, 0x1.14a26ed1960d7p-1}, + {0x1.00003p-17, 0x1.ffffffffbfffep-1, 0x1.ffffffffbffffp-1}, + {-0x1.00003p-17, 0x1.ffffffffbfffep-1, 0x1.ffffffffbffffp-1}, + {0x1.00003ffffffaep-18, 0x1.ffffffffeffffp-1, 0x1.fffffffffp-1}, + {-0x1.00003ffffffaep-18, 0x1.ffffffffeffffp-1, 0x1.fffffffffp-1}, + {0x1.00003ffffffffp-18, 0x1.ffffffffeffffp-1, 0x1.fffffffffp-1}, + {-0x1.00003ffffffffp-18, 0x1.ffffffffeffffp-1, 0x1.fffffffffp-1}, + {0x1.00007ffffdeap41, -0x1.dab7efeb35baep-2, -0x1.dab7efeb35badp-2}, + {-0x1.00007ffffdeap41, -0x1.dab7efeb35baep-2, -0x1.dab7efeb35badp-2}, + {0x1.0000ffff8p-19, 0x1.fffffffffcp-1, 0x1.fffffffffbfffp-1}, + {-0x1.0000ffff8p-19, 0x1.fffffffffcp-1, 0x1.fffffffffbfffp-1}, + {0x1.0003fff800051p-20, 0x1.ffffffffffp-1, 0x1.fffffffffefffp-1}, + {-0x1.0003fff800051p-20, 0x1.ffffffffffp-1, 0x1.fffffffffefffp-1}, + {0x1.0003fff800096p-20, 0x1.ffffffffffp-1, 0x1.fffffffffefffp-1}, + {-0x1.0003fff800096p-20, 0x1.ffffffffffp-1, 0x1.fffffffffefffp-1}, + {0x1.000fd2p334, -0x1.fbf2b71a23a58p-2, -0x1.fbf2b71a23a57p-2}, + {-0x1.000fd2p334, -0x1.fbf2b71a23a58p-2, -0x1.fbf2b71a23a57p-2}, + {0x1.003p514, 0x1.fccc87eae7737p-5, 0x1.fccc87eae7736p-5}, + {-0x1.003p514, 0x1.fccc87eae7737p-5, 0x1.fccc87eae7736p-5}, + {0x1.00600000015f4p41, -0x1.a43f40d92b7edp-7, -0x1.a43f40d92b7eep-7}, + {-0x1.00600000015f4p41, -0x1.a43f40d92b7edp-7, -0x1.a43f40d92b7eep-7}, + {0x1.007p-1, 0x1.c11cc38f40ab3p-1, 0x1.c11cc38f40ab2p-1}, + {-0x1.007p-1, 0x1.c11cc38f40ab3p-1, 0x1.c11cc38f40ab2p-1}, + {0x1.007p-21, 0x1.ffffffffffbfcp-1, 0x1.ffffffffffbfdp-1}, + {-0x1.007p-21, 0x1.ffffffffffbfcp-1, 0x1.ffffffffffbfdp-1}, + {0x1.00cp40, 0x1.e9ba98231f734p-8, 0x1.e9ba98231f735p-8}, + {-0x1.00cp40, 0x1.e9ba98231f734p-8, 0x1.e9ba98231f735p-8}, + {0x1.011p-4, 0x1.fefdf48ed649dp-1, 0x1.fefdf48ed649cp-1}, + {-0x1.011p-4, 0x1.fefdf48ed649dp-1, 0x1.fefdf48ed649cp-1}, + {0x1.011p996, -0x1.ffc16a0f12ff2p-1, -0x1.ffc16a0f12ff3p-1}, + {-0x1.011p996, -0x1.ffc16a0f12ff2p-1, -0x1.ffc16a0f12ff3p-1}, + {0x1.02p-2, 0x1.efd5b61a30a38p-1, 0x1.efd5b61a30a39p-1}, + {-0x1.02p-2, 0x1.efd5b61a30a38p-1, 0x1.efd5b61a30a39p-1}, + {0x1.0204260c18307p59, 0x1.c97b8161dc50ap-2, 0x1.c97b8161dc50bp-2}, + {-0x1.0204260c18307p59, 0x1.c97b8161dc50ap-2, 0x1.c97b8161dc50bp-2}, + {0x1.02e78a321155ep1, -0x1.bf26a3c9b9fbfp-2, -0x1.bf26a3c9b9fbep-2}, + {-0x1.02e78a321155ep1, -0x1.bf26a3c9b9fbfp-2, -0x1.bf26a3c9b9fbep-2}, + {0x1.04p-4, 0x1.fef806b1f84e5p-1, 0x1.fef806b1f84e4p-1}, + {-0x1.04p-4, 0x1.fef806b1f84e5p-1, 0x1.fef806b1f84e4p-1}, + {0x1.04bde8bb80258p98, 0x1.fe851fbf87d17p-1, 0x1.fe851fbf87d18p-1}, + {-0x1.04bde8bb80258p98, 0x1.fe851fbf87d17p-1, 0x1.fe851fbf87d18p-1}, + {0x1.077e749e37ceep236, 0x1.70f6a51da8effp-1, 0x1.70f6a51da8efep-1}, + {-0x1.077e749e37ceep236, 0x1.70f6a51da8effp-1, 0x1.70f6a51da8efep-1}, + {0x1.07f8p300, 0x1.6b408c856bda6p-3, 0x1.6b408c856bda5p-3}, + {-0x1.07f8p300, 0x1.6b408c856bda6p-3, 0x1.6b408c856bda5p-3}, + {0x1.07f9bea1b3546p27, 0x1.2b2f965ae40fcp-1, 0x1.2b2f965ae40fdp-1}, + {-0x1.07f9bea1b3546p27, 0x1.2b2f965ae40fcp-1, 0x1.2b2f965ae40fdp-1}, + {0x1.090d18372f2d5p4, -0x1.4eed2f3fc76a8p-1, -0x1.4eed2f3fc76a7p-1}, + {-0x1.090d18372f2d5p4, -0x1.4eed2f3fc76a8p-1, -0x1.4eed2f3fc76a7p-1}, + {0x1.0b4p-3, 0x1.fba59aecee5p-1, 0x1.fba59aecee501p-1}, + {-0x1.0b4p-3, 0x1.fba59aecee5p-1, 0x1.fba59aecee501p-1}, + {0x1.0c0d5c2af3c2ep346, 0x1.fffd1bcda7a7dp-1, 0x1.fffd1bcda7a7ep-1}, + {-0x1.0c0d5c2af3c2ep346, 0x1.fffd1bcda7a7dp-1, 0x1.fffd1bcda7a7ep-1}, + {0x1.0d30596ee91fdp216, -0x1.e4dfe83129286p-1, -0x1.e4dfe83129287p-1}, + {-0x1.0d30596ee91fdp216, -0x1.e4dfe83129286p-1, -0x1.e4dfe83129287p-1}, + {0x1.0d6p0, 0x1.fb8432886a284p-2, 0x1.fb8432886a283p-2}, + {-0x1.0d6p0, 0x1.fb8432886a284p-2, 0x1.fb8432886a283p-2}, + {0x1.0e9474c68831cp-10, 0x1.ffffee202854p-1, 0x1.ffffee202853fp-1}, + {-0x1.0e9474c68831cp-10, 0x1.ffffee202854p-1, 0x1.ffffee202853fp-1}, + {0x1.113bae4049849p2, -0x1.b70d3d5584b1bp-2, -0x1.b70d3d5584b1ap-2}, + {-0x1.113bae4049849p2, -0x1.b70d3d5584b1bp-2, -0x1.b70d3d5584b1ap-2}, + {0x1.12eb87097654p-4, 0x1.fed8df58f626p-1, 0x1.fed8df58f625fp-1}, + {-0x1.12eb87097654p-4, 0x1.fed8df58f626p-1, 0x1.fed8df58f625fp-1}, + {0x1.13cp0, 0x1.e536ae395dfcep-2, 0x1.e536ae395dfcfp-2}, + {-0x1.13cp0, 0x1.e536ae395dfcep-2, 0x1.e536ae395dfcfp-2}, + {0x1.16e534ee3658p-4, 0x1.fed0476fc75cap-1, 0x1.fed0476fc75c9p-1}, + {-0x1.16e534ee3658p-4, 0x1.fed0476fc75cap-1, 0x1.fed0476fc75c9p-1}, + {0x1.17fffffffea98p-3, 0x1.fb38e82e3193ap-1, 0x1.fb38e82e3193bp-1}, + {-0x1.17fffffffea98p-3, 0x1.fb38e82e3193ap-1, 0x1.fb38e82e3193bp-1}, + {0x1.18p-3, 0x1.fb38e82e3188p-1, 0x1.fb38e82e3187fp-1}, + {-0x1.18p-3, 0x1.fb38e82e3188p-1, 0x1.fb38e82e3187fp-1}, + {0x1.1a191ebbb4d7fp7, -0x1.e59647f1fe9c7p-1, -0x1.e59647f1fe9c8p-1}, + {-0x1.1a191ebbb4d7fp7, -0x1.e59647f1fe9c7p-1, -0x1.e59647f1fe9c8p-1}, + {0x1.1da84f2b7b1d8p7, -0x1.d0dca1f8715bep-4, -0x1.d0dca1f8715bdp-4}, + {-0x1.1da84f2b7b1d8p7, -0x1.d0dca1f8715bep-4, -0x1.d0dca1f8715bdp-4}, + {0x1.201e973251302p0, 0x1.b917ebbc30e1ep-2, 0x1.b917ebbc30e1dp-2}, + {-0x1.201e973251302p0, 0x1.b917ebbc30e1ep-2, 0x1.b917ebbc30e1dp-2}, + {0x1.21e02p-7, 0x1.fffadf12ff414p-1, 0x1.fffadf12ff415p-1}, + {-0x1.21e02p-7, 0x1.fffadf12ff414p-1, 0x1.fffadf12ff415p-1}, + {0x1.27e29a4b985bfp1, -0x1.598a4dab3de5ap-1, -0x1.598a4dab3de59p-1}, + {-0x1.27e29a4b985bfp1, -0x1.598a4dab3de5ap-1, -0x1.598a4dab3de59p-1}, + {0x1.2a1f28dbfb6cp-3, 0x1.fa95c1154abf5p-1, 0x1.fa95c1154abf6p-1}, + {-0x1.2a1f28dbfb6cp-3, 0x1.fa95c1154abf5p-1, 0x1.fa95c1154abf6p-1}, + {0x1.2b8p1, -0x1.6412293adb7bcp-1, -0x1.6412293adb7bdp-1}, + {-0x1.2b8p1, -0x1.6412293adb7bcp-1, -0x1.6412293adb7bdp-1}, + {0x1.31199def72f4dp-7, 0x1.fffa518a7d0e7p-1, 0x1.fffa518a7d0e8p-1}, + {-0x1.31199def72f4dp-7, 0x1.fffa518a7d0e7p-1, 0x1.fffa518a7d0e8p-1}, + {0x1.31260e1485014p4, 0x1.f36895fe177f8p-1, 0x1.f36895fe177f7p-1}, + {-0x1.31260e1485014p4, 0x1.f36895fe177f8p-1, 0x1.f36895fe177f7p-1}, + {0x1.34e964cd103bdp2, 0x1.d36207b4fee17p-4, 0x1.d36207b4fee16p-4}, + {-0x1.34e964cd103bdp2, 0x1.d36207b4fee17p-4, 0x1.d36207b4fee16p-4}, + {0x1.37618a0ba785p1, -0x1.84a37f4fa7616p-1, -0x1.84a37f4fa7617p-1}, + {-0x1.37618a0ba785p1, -0x1.84a37f4fa7616p-1, -0x1.84a37f4fa7617p-1}, + {0x1.379704f5f1eb3p24, -0x1.c830bbc99e229p-39, -0x1.c830bbc99e22ap-39}, + {-0x1.379704f5f1eb3p24, -0x1.c830bbc99e229p-39, -0x1.c830bbc99e22ap-39}, + {0x1.3b61dd166d47p2, 0x1.b5daaa233bd5p-3, 0x1.b5daaa233bd4fp-3}, + {-0x1.3b61dd166d47p2, 0x1.b5daaa233bd5p-3, 0x1.b5daaa233bd4fp-3}, + {0x1.3c011022acbdp37, -0x1.ffd00dc4db401p-4, -0x1.ffd00dc4db4p-4}, + {-0x1.3c011022acbdp37, -0x1.ffd00dc4db401p-4, -0x1.ffd00dc4db4p-4}, + {0x1.3e7788e900b7p727, -0x1.14052b4016ff5p-1, -0x1.14052b4016ff6p-1}, + {-0x1.3e7788e900b7p727, -0x1.14052b4016ff5p-1, -0x1.14052b4016ff6p-1}, + {0x1.423eafdcc2779p-10, 0x1.ffffe6a5e4198p-1, 0x1.ffffe6a5e4197p-1}, + {-0x1.423eafdcc2779p-10, 0x1.ffffe6a5e4198p-1, 0x1.ffffe6a5e4197p-1}, + {0x1.4321828c1b538p119, -0x1.fe09fc3d16feep-6, -0x1.fe09fc3d16fedp-6}, + {-0x1.4321828c1b538p119, -0x1.fe09fc3d16feep-6, -0x1.fe09fc3d16fedp-6}, + {0x1.43506cb22975dp22, 0x1.b685d949a27ap-14, 0x1.b685d949a27a1p-14}, + {-0x1.43506cb22975dp22, 0x1.b685d949a27ap-14, 0x1.b685d949a27a1p-14}, + {0x1.439f63495786ap67, 0x1.fe398090e203cp-1, 0x1.fe398090e203bp-1}, + {-0x1.439f63495786ap67, 0x1.fe398090e203cp-1, 0x1.fe398090e203bp-1}, + {0x1.457538a6bd073p-4, 0x1.fe6274e000974p-1, 0x1.fe6274e000973p-1}, + {-0x1.457538a6bd073p-4, 0x1.fe6274e000974p-1, 0x1.fe6274e000973p-1}, + {0x1.478fc08p43, 0x1.09fcb69359c0ap-1, 0x1.09fcb69359c09p-1}, + {-0x1.478fc08p43, 0x1.09fcb69359c0ap-1, 0x1.09fcb69359c09p-1}, + {0x1.48a45797cbe63p61, -0x1.20c2158511e79p-9, -0x1.20c2158511e78p-9}, + {-0x1.48a45797cbe63p61, -0x1.20c2158511e79p-9, -0x1.20c2158511e78p-9}, + {0x1.4a62e0e12c173p-1, 0x1.990d17aae253p-1, 0x1.990d17aae2531p-1}, + {-0x1.4a62e0e12c173p-1, 0x1.990d17aae253p-1, 0x1.990d17aae2531p-1}, + {0x1.4c596642a9488p9, 0x1.fdd4f1e00b387p-3, 0x1.fdd4f1e00b388p-3}, + {-0x1.4c596642a9488p9, 0x1.fdd4f1e00b387p-3, 0x1.fdd4f1e00b388p-3}, + {0x1.4dp-4, 0x1.fe4f141032f38p-1, 0x1.fe4f141032f37p-1}, + {-0x1.4dp-4, 0x1.fe4f141032f38p-1, 0x1.fe4f141032f37p-1}, + {0x1.4f0f308p488, 0x1.94e9f45d43c14p-2, 0x1.94e9f45d43c13p-2}, + {-0x1.4f0f308p488, 0x1.94e9f45d43c14p-2, 0x1.94e9f45d43c13p-2}, + {0x1.52f00ep793, 0x1.9355f69ad4326p-2, 0x1.9355f69ad4327p-2}, + {-0x1.52f00ep793, 0x1.9355f69ad4326p-2, 0x1.9355f69ad4327p-2}, + {0x1.52f06c730ec02p2, 0x1.1a19be8bea10ap-1, 0x1.1a19be8bea10bp-1}, + {-0x1.52f06c730ec02p2, 0x1.1a19be8bea10ap-1, 0x1.1a19be8bea10bp-1}, + {0x1.53e7d5845fe3dp220, 0x1.385d92ec0c734p-1, 0x1.385d92ec0c733p-1}, + {-0x1.53e7d5845fe3dp220, 0x1.385d92ec0c734p-1, 0x1.385d92ec0c733p-1}, + {0x1.59p-20, 0x1.fffffffffe2f1p-1, 0x1.fffffffffe2fp-1}, + {-0x1.59p-20, 0x1.fffffffffe2f1p-1, 0x1.fffffffffe2fp-1}, + {0x1.592f1176f098p86, -0x1.ffd7bc28ded92p-1, -0x1.ffd7bc28ded91p-1}, + {-0x1.592f1176f098p86, -0x1.ffd7bc28ded92p-1, -0x1.ffd7bc28ded91p-1}, + {0x1.5999999dc09dcp1, -0x1.cee28b3d79799p-1, -0x1.cee28b3d7979ap-1}, + {-0x1.5999999dc09dcp1, -0x1.cee28b3d79799p-1, -0x1.cee28b3d7979ap-1}, + {0x1.5bea01p468, 0x1.c1f1eb08c2604p-1, 0x1.c1f1eb08c2605p-1}, + {-0x1.5bea01p468, 0x1.c1f1eb08c2604p-1, 0x1.c1f1eb08c2605p-1}, + {0x1.5cb80a6135e5ap1000, 0x1.fffe35ab09a65p-1, 0x1.fffe35ab09a66p-1}, + {-0x1.5cb80a6135e5ap1000, 0x1.fffe35ab09a65p-1, 0x1.fffe35ab09a66p-1}, + {0x1.5d5be48730d2dp13, -0x1.07b85f606e75dp-3, -0x1.07b85f606e75ep-3}, + {-0x1.5d5be48730d2dp13, -0x1.07b85f606e75dp-3, -0x1.07b85f606e75ep-3}, + {0x1.614p-21, 0x1.ffffffffff862p-1, 0x1.ffffffffff863p-1}, + {-0x1.614p-21, 0x1.ffffffffff862p-1, 0x1.ffffffffff863p-1}, + {0x1.62adc8a660364p1, -0x1.dd3a806e89cf2p-1, -0x1.dd3a806e89cf1p-1}, + {-0x1.62adc8a660364p1, -0x1.dd3a806e89cf2p-1, -0x1.dd3a806e89cf1p-1}, + {0x1.64ef438p142, -0x1.4308b14f4b6eep-1, -0x1.4308b14f4b6edp-1}, + {-0x1.64ef438p142, -0x1.4308b14f4b6eep-1, -0x1.4308b14f4b6edp-1}, + {0x1.652p0, 0x1.6623d2eb6add2p-3, 0x1.6623d2eb6add1p-3}, + {-0x1.652p0, 0x1.6623d2eb6add2p-3, 0x1.6623d2eb6add1p-3}, + {0x1.65865b2cb08a2p-7, 0x1.fff832c50f472p-1, 0x1.fff832c50f471p-1}, + {-0x1.65865b2cb08a2p-7, 0x1.fff832c50f472p-1, 0x1.fff832c50f471p-1}, + {0x1.6a937daabc20ep375, 0x1.acc251be33023p-1, 0x1.acc251be33022p-1}, + {-0x1.6a937daabc20ep375, 0x1.acc251be33023p-1, 0x1.acc251be33022p-1}, + {0x1.6ac5b262ca1ffp849, -0x1.14ae72e6ba22fp-61, -0x1.14ae72e6ba22ep-61}, + {-0x1.6ac5b262ca1ffp849, -0x1.14ae72e6ba22fp-61, -0x1.14ae72e6ba22ep-61}, + {0x1.6f7bdef7bdef4p3, 0x1.e0619960a11c6p-2, 0x1.e0619960a11c7p-2}, + {-0x1.6f7bdef7bdef4p3, 0x1.e0619960a11c6p-2, 0x1.e0619960a11c7p-2}, + {0x1.739ce759ce738p200, 0x1.8d23f97901a3p-1, 0x1.8d23f97901a31p-1}, + {-0x1.739ce759ce738p200, 0x1.8d23f97901a3p-1, 0x1.8d23f97901a31p-1}, + {0x1.7450c3f49d0b2p-11, 0x1.fffff78a14ba1p-1, 0x1.fffff78a14bap-1}, + {-0x1.7450c3f49d0b2p-11, 0x1.fffff78a14ba1p-1, 0x1.fffff78a14bap-1}, + {0x1.749fe53f963fdp0, 0x1.d6f1c727fb2ccp-4, 0x1.d6f1c727fb2cbp-4}, + {-0x1.749fe53f963fdp0, 0x1.d6f1c727fb2ccp-4, 0x1.d6f1c727fb2cbp-4}, + {0x1.74af6725c6206p1, -0x1.f284b5028c184p-1, -0x1.f284b5028c185p-1}, + {-0x1.74af6725c6206p1, -0x1.f284b5028c184p-1, -0x1.f284b5028c185p-1}, + {0x1.7550d28ffccc4p1, -0x1.f3165a0b306b2p-1, -0x1.f3165a0b306b1p-1}, + {-0x1.7550d28ffccc4p1, -0x1.f3165a0b306b2p-1, -0x1.f3165a0b306b1p-1}, + {0x1.775e397cd6aap6, 0x1.d66d2078ebdecp-1, 0x1.d66d2078ebdebp-1}, + {-0x1.775e397cd6aap6, 0x1.d66d2078ebdecp-1, 0x1.d66d2078ebdebp-1}, + {0x1.799302bf7f29p-1, 0x1.7af9a13085f53p-1, 0x1.7af9a13085f54p-1}, + {-0x1.799302bf7f29p-1, 0x1.7af9a13085f53p-1, 0x1.7af9a13085f54p-1}, + {0x1.799fffffffffdp-6, 0x1.ffdd2fdac0c25p-1, 0x1.ffdd2fdac0c24p-1}, + {-0x1.799fffffffffdp-6, 0x1.ffdd2fdac0c25p-1, 0x1.ffdd2fdac0c24p-1}, + {0x1.7a3692ca9449p-7, 0x1.fff744f185a73p-1, 0x1.fff744f185a74p-1}, + {-0x1.7a3692ca9449p-7, 0x1.fff744f185a73p-1, 0x1.fff744f185a74p-1}, + {0x1.7a66a638ac5b5p-1, 0x1.7a6b326b690fbp-1, 0x1.7a6b326b690fap-1}, + {-0x1.7a66a638ac5b5p-1, 0x1.7a6b326b690fbp-1, 0x1.7a6b326b690fap-1}, + {0x1.7ba65462b49ap0, 0x1.671fdb64ffbeep-4, 0x1.671fdb64ffbedp-4}, + {-0x1.7ba65462b49ap0, 0x1.671fdb64ffbeep-4, 0x1.671fdb64ffbedp-4}, + {0x1.7cdf37cdf37c9p239, 0x1.ffa55490f206ep-1, 0x1.ffa55490f206fp-1}, + {-0x1.7cdf37cdf37c9p239, 0x1.ffa55490f206ep-1, 0x1.ffa55490f206fp-1}, + {0x1.7d542565f472ep0, 0x1.4c5b5970a3a49p-4, 0x1.4c5b5970a3a48p-4}, + {-0x1.7d542565f472ep0, 0x1.4c5b5970a3a49p-4, 0x1.4c5b5970a3a48p-4}, + {0x1.7da0751649058p0, 0x1.479a5667c63f6p-4, 0x1.479a5667c63f5p-4}, + {-0x1.7da0751649058p0, 0x1.479a5667c63f6p-4, 0x1.479a5667c63f5p-4}, + {0x1.7e0ddcda6cc0dp-7, 0x1.fff717511dcb5p-1, 0x1.fff717511dcb6p-1}, + {-0x1.7e0ddcda6cc0dp-7, 0x1.fff717511dcb5p-1, 0x1.fff717511dcb6p-1}, + {0x1.7f6p-21, 0x1.ffffffffff707p-1, 0x1.ffffffffff708p-1}, + {-0x1.7f6p-21, 0x1.ffffffffff707p-1, 0x1.ffffffffff708p-1}, + {0x1.7f90117d44c74p100, -0x1.fff9e1554698p-1, -0x1.fff9e15546981p-1}, + {-0x1.7f90117d44c74p100, -0x1.fff9e1554698p-1, -0x1.fff9e15546981p-1}, + {0x1.7ffffffffef7ap-6, 0x1.ffdc006bff7eap-1, 0x1.ffdc006bff7e9p-1}, + {-0x1.7ffffffffef7ap-6, 0x1.ffdc006bff7eap-1, 0x1.ffdc006bff7e9p-1}, + {0x1.7fffffffffa26p-6, 0x1.ffdc006bff7e8p-1, 0x1.ffdc006bff7e7p-1}, + {-0x1.7fffffffffa26p-6, 0x1.ffdc006bff7e8p-1, 0x1.ffdc006bff7e7p-1}, + {0x1.7ffffffffff8p-6, 0x1.ffdc006bff7e7p-1, 0x1.ffdc006bff7e6p-1}, + {-0x1.7ffffffffff8p-6, 0x1.ffdc006bff7e7p-1, 0x1.ffdc006bff7e6p-1}, + {0x1.80ep-1, 0x1.760718ab44398p-1, 0x1.760718ab44397p-1}, + {-0x1.80ep-1, 0x1.760718ab44398p-1, 0x1.760718ab44397p-1}, + {0x1.81ae0dffa3b33p959, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.81ae0dffa3b33p959, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.81d612289c5cfp1, -0x1.fbdc48125b345p-1, -0x1.fbdc48125b346p-1}, + {-0x1.81d612289c5cfp1, -0x1.fbdc48125b345p-1, -0x1.fbdc48125b346p-1}, + {0x1.8220192270a0ep0, 0x1.ff9e396651ccap-5, 0x1.ff9e396651cc9p-5}, + {-0x1.8220192270a0ep0, 0x1.ff9e396651ccap-5, 0x1.ff9e396651cc9p-5}, + {0x1.822bb780e9104p0, 0x1.fe2b26dddb5c9p-5, 0x1.fe2b26dddb5c8p-5}, + {-0x1.822bb780e9104p0, 0x1.fe2b26dddb5c9p-5, 0x1.fe2b26dddb5c8p-5}, + {0x1.82c119c4b8e49p0, 0x1.eb87cff7c9115p-5, 0x1.eb87cff7c9116p-5}, + {-0x1.82c119c4b8e49p0, 0x1.eb87cff7c9115p-5, 0x1.eb87cff7c9116p-5}, + {0x1.82c119c4b9fc4p0, 0x1.eb87cff7a62b7p-5, 0x1.eb87cff7a62b8p-5}, + {-0x1.82c119c4b9fc4p0, 0x1.eb87cff7a62b7p-5, 0x1.eb87cff7a62b8p-5}, + {0x1.82c119c4ba808p0, 0x1.eb87cff795ab1p-5, 0x1.eb87cff795ab2p-5}, + {-0x1.82c119c4ba808p0, 0x1.eb87cff795ab1p-5, 0x1.eb87cff795ab2p-5}, + {0x1.832c9fc76527p0, 0x1.de1d17ab0d6a5p-5, 0x1.de1d17ab0d6a4p-5}, + {-0x1.832c9fc76527p0, 0x1.de1d17ab0d6a5p-5, 0x1.de1d17ab0d6a4p-5}, + {0x1.833956ce7d1f9p0, 0x1.dc86e7bec0c45p-5, 0x1.dc86e7bec0c44p-5}, + {-0x1.833956ce7d1f9p0, 0x1.dc86e7bec0c45p-5, 0x1.dc86e7bec0c44p-5}, + {0x1.834574eb1c099p0, 0x1.db03cbb942a7bp-5, 0x1.db03cbb942a7ap-5}, + {-0x1.834574eb1c099p0, 0x1.db03cbb942a7bp-5, 0x1.db03cbb942a7ap-5}, + {0x1.83aba5688e13ep0, 0x1.ce431710d1507p-5, 0x1.ce431710d1508p-5}, + {-0x1.83aba5688e13ep0, 0x1.ce431710d1507p-5, 0x1.ce431710d1508p-5}, + {0x1.83b38bbafd75bp0, 0x1.cd46b3a77f6ddp-5, 0x1.cd46b3a77f6dep-5}, + {-0x1.83b38bbafd75bp0, 0x1.cd46b3a77f6ddp-5, 0x1.cd46b3a77f6dep-5}, + {0x1.86a017cb1c31cp16, -0x1.ff29bc666bee7p-1, -0x1.ff29bc666bee6p-1}, + {-0x1.86a017cb1c31cp16, -0x1.ff29bc666bee7p-1, -0x1.ff29bc666bee6p-1}, + {0x1.8720588p392, -0x1.7968916e4c646p-2, -0x1.7968916e4c647p-2}, + {-0x1.8720588p392, -0x1.7968916e4c646p-2, -0x1.7968916e4c647p-2}, + {0x1.88a2288a22888p9, 0x1.fb97c7e452918p-1, 0x1.fb97c7e452917p-1}, + {-0x1.88a2288a22888p9, 0x1.fb97c7e452918p-1, 0x1.fb97c7e452917p-1}, + {0x1.8cf013991c308p1000, -0x1.ae44a5f01bf63p-1, -0x1.ae44a5f01bf64p-1}, + {-0x1.8cf013991c308p1000, -0x1.ae44a5f01bf63p-1, -0x1.ae44a5f01bf64p-1}, + {0x1.9p-2, 0x1.d96e82f71a9dcp-1, 0x1.d96e82f71a9ddp-1}, + {-0x1.9p-2, 0x1.d96e82f71a9dcp-1, 0x1.d96e82f71a9ddp-1}, + {0x1.9p0, 0x1.0fd9d5c093df5p-7, 0x1.0fd9d5c093df4p-7}, + {-0x1.9p0, 0x1.0fd9d5c093df5p-7, 0x1.0fd9d5c093df4p-7}, + {0x1.90000000006bp0, 0x1.0fd9d5c05e5fdp-7, 0x1.0fd9d5c05e5fcp-7}, + {-0x1.90000000006bp0, 0x1.0fd9d5c05e5fdp-7, 0x1.0fd9d5c05e5fcp-7}, + {0x1.900c206d44162p6, 0x1.bc8be725417d8p-1, 0x1.bc8be725417d9p-1}, + {-0x1.900c206d44162p6, 0x1.bc8be725417d8p-1, 0x1.bc8be725417d9p-1}, + {0x1.900c2af7baef3p-19, 0x1.fffffffff63b6p-1, 0x1.fffffffff63b7p-1}, + {-0x1.900c2af7baef3p-19, 0x1.fffffffff63b6p-1, 0x1.fffffffff63b7p-1}, + {0x1.900f11bd8955dp6, 0x1.bd464c9352d11p-1, 0x1.bd464c9352d1p-1}, + {-0x1.900f11bd8955dp6, 0x1.bd464c9352d11p-1, 0x1.bd464c9352d1p-1}, + {0x1.910b35c3253d4p100, 0x1.fffffda85cdd1p-1, 0x1.fffffda85cddp-1}, + {-0x1.910b35c3253d4p100, 0x1.fffffda85cdd1p-1, 0x1.fffffda85cddp-1}, + {0x1.921fb54442d18p0, 0x1.1a62633145c07p-54, 0x1.1a62633145c06p-54}, + {-0x1.921fb54442d18p0, 0x1.1a62633145c07p-54, 0x1.1a62633145c06p-54}, + {0x1.922p0, -0x1.2aeef4b9ea1aep-18, -0x1.2aeef4b9ea1afp-18}, + {-0x1.922p0, -0x1.2aeef4b9ea1aep-18, -0x1.2aeef4b9ea1afp-18}, + {0x1.9220354442d18p0, -0x1.ffffffffd9048p-18, -0x1.ffffffffd9049p-18}, + {-0x1.9220354442d18p0, -0x1.ffffffffd9048p-18, -0x1.ffffffffd9049p-18}, + {0x1.9251f93aeb59dp12, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.9251f93aeb59dp12, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.943be221d909ap2, 0x1.ffb8c4d1f78a8p-1, 0x1.ffb8c4d1f78a9p-1}, + {-0x1.943be221d909ap2, 0x1.ffb8c4d1f78a8p-1, 0x1.ffb8c4d1f78a9p-1}, + {0x1.94af699302875p-7, 0x1.fff6011fdddabp-1, 0x1.fff6011fdddacp-1}, + {-0x1.94af699302875p-7, 0x1.fff6011fdddabp-1, 0x1.fff6011fdddacp-1}, + {0x1.999999ab7b0edp-2, 0x1.d7954e7a3ee99p-1, 0x1.d7954e7a3ee9ap-1}, + {-0x1.999999ab7b0edp-2, 0x1.d7954e7a3ee99p-1, 0x1.d7954e7a3ee9ap-1}, + {0x1.999999bd4190bp-2, 0x1.d7954e76c8e31p-1, 0x1.d7954e76c8e3p-1}, + {-0x1.999999bd4190bp-2, 0x1.d7954e76c8e31p-1, 0x1.d7954e76c8e3p-1}, + {0x1.9bd0f19479a24p2, 0x1.fa23cfb820224p-1, 0x1.fa23cfb820225p-1}, + {-0x1.9bd0f19479a24p2, 0x1.fa23cfb820224p-1, 0x1.fa23cfb820225p-1}, + {0x1.9c55835e7e83ep8, -0x1.6a09e667f3af1p-1, -0x1.6a09e667f3afp-1}, + {-0x1.9c55835e7e83ep8, -0x1.6a09e667f3af1p-1, -0x1.6a09e667f3afp-1}, + {0x1.9c9942b14448dp-7, 0x1.fff59c1255809p-1, 0x1.fff59c125580ap-1}, + {-0x1.9c9942b14448dp-7, 0x1.fff59c1255809p-1, 0x1.fff59c125580ap-1}, + {0x1.9d3d92485e2b5p523, 0x1.ffece5cab4ca5p-1, 0x1.ffece5cab4ca6p-1}, + {-0x1.9d3d92485e2b5p523, 0x1.ffece5cab4ca5p-1, 0x1.ffece5cab4ca6p-1}, + {0x1.a0d068341a08p1000, -0x1.ff55301d3a781p-5, -0x1.ff55301d3a78p-5}, + {-0x1.a0d068341a08p1000, -0x1.ff55301d3a781p-5, -0x1.ff55301d3a78p-5}, + {0x1.a7ep-1, 0x1.5a5615acd0dcp-1, 0x1.5a5615acd0dc1p-1}, + {-0x1.a7ep-1, 0x1.5a5615acd0dcp-1, 0x1.5a5615acd0dc1p-1}, + {0x1.a858343863965p119, 0x1.766ad27a1de5p-14, 0x1.766ad27a1de4fp-14}, + {-0x1.a858343863965p119, 0x1.766ad27a1de5p-14, 0x1.766ad27a1de4fp-14}, + {0x1.ab190633d88eap3, 0x1.6bd4d5be72494p-1, 0x1.6bd4d5be72493p-1}, + {-0x1.ab190633d88eap3, 0x1.6bd4d5be72494p-1, 0x1.6bd4d5be72493p-1}, + {0x1.af4bd2f4bd2fp-21, 0x1.ffffffffff4a5p-1, 0x1.ffffffffff4a6p-1}, + {-0x1.af4bd2f4bd2fp-21, 0x1.ffffffffff4a5p-1, 0x1.ffffffffff4a6p-1}, + {0x1.afa70300aee6p72, 0x1.7ff2934ad29a8p-1, 0x1.7ff2934ad29a7p-1}, + {-0x1.afa70300aee6p72, 0x1.7ff2934ad29a8p-1, 0x1.7ff2934ad29a7p-1}, + {0x1.b5ab427cffb4cp94, 0x1.ff866aebdce0ap-1, 0x1.ff866aebdce0bp-1}, + {-0x1.b5ab427cffb4cp94, 0x1.ff866aebdce0ap-1, 0x1.ff866aebdce0bp-1}, + {0x1.b951f1572eba5p23, -0x1.f54f5227a4e84p-60, -0x1.f54f5227a4e83p-60}, + {-0x1.b951f1572eba5p23, -0x1.f54f5227a4e84p-60, -0x1.f54f5227a4e83p-60}, + {0x1.b96e5b96e5b91p-8, 0x1.fffd06d35579cp-1, 0x1.fffd06d35579dp-1}, + {-0x1.b96e5b96e5b91p-8, 0x1.fffd06d35579cp-1, 0x1.fffd06d35579dp-1}, + {0x1.ba3b18395d17bp8, -0x1.7c4128e2aff4cp-1, -0x1.7c4128e2aff4bp-1}, + {-0x1.ba3b18395d17bp8, -0x1.7c4128e2aff4cp-1, -0x1.7c4128e2aff4bp-1}, + {0x1.bab62ed655019p970, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.bab62ed655019p970, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.bd55aa411ab46p-13, 0x1.ffffff3e53446p-1, 0x1.ffffff3e53447p-1}, + {-0x1.bd55aa411ab46p-13, 0x1.ffffff3e53446p-1, 0x1.ffffff3e53447p-1}, + {0x1.bd616d4fe95cdp36, -0x1.7fdb07b9f77ep-1, -0x1.7fdb07b9f77e1p-1}, + {-0x1.bd616d4fe95cdp36, -0x1.7fdb07b9f77ep-1, -0x1.7fdb07b9f77e1p-1}, + {0x1.beap-6, 0x1.ffcf4da76222dp-1, 0x1.ffcf4da76222cp-1}, + {-0x1.beap-6, 0x1.ffcf4da76222dp-1, 0x1.ffcf4da76222cp-1}, + {0x1.c11516af585a4p1, -0x1.ddee13357ec6fp-1, -0x1.ddee13357ec7p-1}, + {-0x1.c11516af585a4p1, -0x1.ddee13357ec6fp-1, -0x1.ddee13357ec7p-1}, + {0x1.c75e54de4c06ep2, 0x1.58cccec059da2p-1, 0x1.58cccec059da1p-1}, + {-0x1.c75e54de4c06ep2, 0x1.58cccec059da2p-1, 0x1.58cccec059da1p-1}, + {0x1.cb44e86bc192bp648, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.cb44e86bc192bp648, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.cb44e86bc192bp649, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.cb44e86bc192bp649, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.cd5a6f8762affp1, -0x1.ca281d7fe44bp-1, -0x1.ca281d7fe44b1p-1}, + {-0x1.cd5a6f8762affp1, -0x1.ca281d7fe44bp-1, -0x1.ca281d7fe44b1p-1}, + {0x1.d0cb95f02ad77p464, 0x1.e80ad4fe54c72p-5, 0x1.e80ad4fe54c71p-5}, + {-0x1.d0cb95f02ad77p464, 0x1.e80ad4fe54c72p-5, 0x1.e80ad4fe54c71p-5}, + {0x1.d31bd604903ap2, 0x1.0df8eb409efe4p-1, 0x1.0df8eb409efe3p-1}, + {-0x1.d31bd604903ap2, 0x1.0df8eb409efe4p-1, 0x1.0df8eb409efe3p-1}, + {0x1.d32f4610180f6p-5, 0x1.ff2ae968efe71p-1, 0x1.ff2ae968efe7p-1}, + {-0x1.d32f4610180f6p-5, 0x1.ff2ae968efe71p-1, 0x1.ff2ae968efe7p-1}, + {0x1.d96e058p488, -0x1.cec307a674d3fp-3, -0x1.cec307a674d3ep-3}, + {-0x1.d96e058p488, -0x1.cec307a674d3fp-3, -0x1.cec307a674d3ep-3}, + {0x1.db0803c392b4cp15, -0x1.ac8dbf9cdc955p-5, -0x1.ac8dbf9cdc954p-5}, + {-0x1.db0803c392b4cp15, -0x1.ac8dbf9cdc955p-5, -0x1.ac8dbf9cdc954p-5}, + {0x1.db0803c3ff51dp15, -0x1.ac94870ca6317p-5, -0x1.ac94870ca6316p-5}, + {-0x1.db0803c3ff51dp15, -0x1.ac94870ca6317p-5, -0x1.ac94870ca6316p-5}, + {0x1.dc4p-5, 0x1.ff229073fd8b6p-1, 0x1.ff229073fd8b5p-1}, + {-0x1.dc4p-5, 0x1.ff229073fd8b6p-1, 0x1.ff229073fd8b5p-1}, + {0x1.dcf73dcf73dccp-5, 0x1.ff21e5f976p-1, 0x1.ff21e5f975fffp-1}, + {-0x1.dcf73dcf73dccp-5, 0x1.ff21e5f976p-1, 0x1.ff21e5f975fffp-1}, + {0x1.dffffffffffffp-1, 0x1.2f011326420e5p-1, 0x1.2f011326420e6p-1}, + {-0x1.dffffffffffffp-1, 0x1.2f011326420e5p-1, 0x1.2f011326420e6p-1}, + {0x1.e123691a7c4bep26, 0x1.f72c8e16dbc79p-1, 0x1.f72c8e16dbc78p-1}, + {-0x1.e123691a7c4bep26, 0x1.f72c8e16dbc79p-1, 0x1.f72c8e16dbc78p-1}, + {0x1.e666666f9cf49p0, -0x1.4b0c6bb623f58p-2, -0x1.4b0c6bb623f57p-2}, + {-0x1.e666666f9cf49p0, -0x1.4b0c6bb623f58p-2, -0x1.4b0c6bb623f57p-2}, + {0x1.e83accfc50b7p995, 0x1.fd74b55875885p-1, 0x1.fd74b55875884p-1}, + {-0x1.e83accfc50b7p995, 0x1.fd74b55875885p-1, 0x1.fd74b55875884p-1}, + {0x1.e8ep-7, 0x1.fff169b6ab7d1p-1, 0x1.fff169b6ab7d2p-1}, + {-0x1.e8ep-7, 0x1.fff169b6ab7d1p-1, 0x1.fff169b6ab7d2p-1}, + {0x1.eaf5ea5317442p4, 0x1.7d39c9f1b0b3cp-1, 0x1.7d39c9f1b0b3dp-1}, + {-0x1.eaf5ea5317442p4, 0x1.7d39c9f1b0b3cp-1, 0x1.7d39c9f1b0b3dp-1}, + {0x1.eb0c2b00b1b83p4, 0x1.7f13af7081a68p-1, 0x1.7f13af7081a67p-1}, + {-0x1.eb0c2b00b1b83p4, 0x1.7f13af7081a68p-1, 0x1.7f13af7081a67p-1}, + {0x1.ebc6b555311c4p15, -0x1.7ad7b88a1fe1p-1, -0x1.7ad7b88a1fe0fp-1}, + {-0x1.ebc6b555311c4p15, -0x1.7ad7b88a1fe1p-1, -0x1.7ad7b88a1fe0fp-1}, + {0x1.ef7bdef7bdef2p239, 0x1.b06b2b58a2a24p-5, 0x1.b06b2b58a2a23p-5}, + {-0x1.ef7bdef7bdef2p239, 0x1.b06b2b58a2a24p-5, 0x1.b06b2b58a2a23p-5}, + {0x1.efbbeefbbeef8p15, 0x1.fe6ded53172a7p-1, 0x1.fe6ded53172a6p-1}, + {-0x1.efbbeefbbeef8p15, 0x1.fe6ded53172a7p-1, 0x1.fe6ded53172a6p-1}, + {0x1.f07c1f07c1ef7p239, -0x1.fe2bcb87a7e16p-1, -0x1.fe2bcb87a7e15p-1}, + {-0x1.f07c1f07c1ef7p239, -0x1.fe2bcb87a7e16p-1, -0x1.fe2bcb87a7e15p-1}, + {0x1.f0f2b5e060b29p1, -0x1.79d08d6b3a883p-1, -0x1.79d08d6b3a882p-1}, + {-0x1.f0f2b5e060b29p1, -0x1.79d08d6b3a883p-1, -0x1.79d08d6b3a882p-1}, + {0x1.f4p-3, 0x1.f0d11d321178ep-1, 0x1.f0d11d321178dp-1}, + {-0x1.f4p-3, 0x1.f0d11d321178ep-1, 0x1.f0d11d321178dp-1}, + {0x1.f43d49f947e87p9, 0x1.e3ff5b15f723ep-4, 0x1.e3ff5b15f723dp-4}, + {-0x1.f43d49f947e87p9, 0x1.e3ff5b15f723ep-4, 0x1.e3ff5b15f723dp-4}, + {0x1.f7fffffffffffp1, -0x1.6636c9f6a87aap-1, -0x1.6636c9f6a87a9p-1}, + {-0x1.f7fffffffffffp1, -0x1.6636c9f6a87aap-1, -0x1.6636c9f6a87a9p-1}, + {0x1.f8fffffffffffp-6, 0x1.ffc1be3309286p-1, 0x1.ffc1be3309285p-1}, + {-0x1.f8fffffffffffp-6, 0x1.ffc1be3309286p-1, 0x1.ffc1be3309285p-1}, + {0x1.f9p-6, 0x1.ffc1be3309285p-1, 0x1.ffc1be3309286p-1}, + {-0x1.f9p-6, 0x1.ffc1be3309285p-1, 0x1.ffc1be3309286p-1}, + {0x1.fa0236523ce54p344, -0x1.fffffffcab0d6p-1, -0x1.fffffffcab0d5p-1}, + {-0x1.fa0236523ce54p344, -0x1.fffffffcab0d6p-1, -0x1.fffffffcab0d5p-1}, + {0x1.fceab54d37dap-4, 0x1.fc0d98ace2308p-1, 0x1.fc0d98ace2309p-1}, + {-0x1.fceab54d37dap-4, 0x1.fc0d98ace2308p-1, 0x1.fc0d98ace2309p-1}, + {0x1.fd0072fffffffp2, -0x1.9589bca128b92p-4, -0x1.9589bca128b91p-4}, + {-0x1.fd0072fffffffp2, -0x1.9589bca128b92p-4, -0x1.9589bca128b91p-4}, + {0x1.fe0f827673422p62, -0x1.4d304b07fc898p-2, -0x1.4d304b07fc897p-2}, + {-0x1.fe0f827673422p62, -0x1.4d304b07fc898p-2, -0x1.4d304b07fc897p-2}, + {0x1.feb1f7920e248p-2, 0x1.c1a27ae836f13p-1, 0x1.c1a27ae836f12p-1}, + {-0x1.feb1f7920e248p-2, 0x1.c1a27ae836f13p-1, 0x1.c1a27ae836f12p-1}, + {0x1.feeffffffffc6p995, -0x1.936b64e955979p-1, -0x1.936b64e955978p-1}, + {-0x1.feeffffffffc6p995, -0x1.936b64e955979p-1, -0x1.936b64e955978p-1}, + {0x1.ff8ffffffffffp-7, 0x1.fff007147ea57p-1, 0x1.fff007147ea58p-1}, + {-0x1.ff8ffffffffffp-7, 0x1.fff007147ea57p-1, 0x1.fff007147ea58p-1}, + {0x1.ff8ffffffffffp-10, 0x1.ffffc01bfe443p-1, 0x1.ffffc01bfe442p-1}, + {-0x1.ff8ffffffffffp-10, 0x1.ffffc01bfe443p-1, 0x1.ffffc01bfe442p-1}, + {0x1.ff8ffffffffffp870, 0x1.7cc9fb75317aep-1, 0x1.7cc9fb75317afp-1}, + {-0x1.ff8ffffffffffp870, 0x1.7cc9fb75317aep-1, 0x1.7cc9fb75317afp-1}, + {0x1.ffcfff8p19, 0x1.d6aea48015589p-1, 0x1.d6aea48015588p-1}, + {-0x1.ffcfff8p19, 0x1.d6aea48015589p-1, 0x1.d6aea48015588p-1}, + {0x1.ffcfff8p365, -0x1.6a9972eee19bbp-2, -0x1.6a9972eee19bap-2}, + {-0x1.ffcfff8p365, -0x1.6a9972eee19bbp-2, -0x1.6a9972eee19bap-2}, + {0x1.ffcffffffff6cp720, -0x1.3aaa15f7544b7p-1, -0x1.3aaa15f7544b6p-1}, + {-0x1.ffcffffffff6cp720, -0x1.3aaa15f7544b7p-1, -0x1.3aaa15f7544b6p-1}, + {0x1.ffcfffffffff9p320, 0x1.3f164bce055c5p-1, 0x1.3f164bce055c4p-1}, + {-0x1.ffcfffffffff9p320, 0x1.3f164bce055c5p-1, 0x1.3f164bce055c4p-1}, + {0x1.ffcffffffffffp-11, 0x1.fffff002fff15p-1, 0x1.fffff002fff14p-1}, + {-0x1.ffcffffffffffp-11, 0x1.fffff002fff15p-1, 0x1.fffff002fff14p-1}, + {0x1.ffcffffffffffp405, -0x1.ffffff987f986p-1, -0x1.ffffff987f985p-1}, + {-0x1.ffcffffffffffp405, -0x1.ffffff987f986p-1, -0x1.ffffff987f985p-1}, + {0x1.ffcffffffffffp567, -0x1.ffff6235a25eep-1, -0x1.ffff6235a25edp-1}, + {-0x1.ffcffffffffffp567, -0x1.ffff6235a25eep-1, -0x1.ffff6235a25edp-1}, + {0x1.ffefff8ffffffp16, 0x1.fdf11ae4608b1p-3, 0x1.fdf11ae4608bp-3}, + {-0x1.ffefff8ffffffp16, 0x1.fdf11ae4608b1p-3, 0x1.fdf11ae4608bp-3}, + {0x1.ffeffffffffccp995, 0x1.8f5525ab4583cp-1, 0x1.8f5525ab4583dp-1}, + {-0x1.ffeffffffffccp995, 0x1.8f5525ab4583cp-1, 0x1.8f5525ab4583dp-1}, + {0x1.ffeffffffffffp77, 0x1.a0af44a45c057p-8, 0x1.a0af44a45c056p-8}, + {-0x1.ffeffffffffffp77, 0x1.a0af44a45c057p-8, 0x1.a0af44a45c056p-8}, + {0x1.ffeffffffffffp122, -0x1.df7546c31bf8dp-1, -0x1.df7546c31bf8cp-1}, + {-0x1.ffeffffffffffp122, -0x1.df7546c31bf8dp-1, -0x1.df7546c31bf8cp-1}, + {0x1.ffeffffffffffp179, -0x1.825a7bea27d5bp-1, -0x1.825a7bea27d5cp-1}, + {-0x1.ffeffffffffffp179, -0x1.825a7bea27d5bp-1, -0x1.825a7bea27d5cp-1}, + {0x1.ffeffffffffffp238, -0x1.1be2ab2078d54p-1, -0x1.1be2ab2078d55p-1}, + {-0x1.ffeffffffffffp238, -0x1.1be2ab2078d54p-1, -0x1.1be2ab2078d55p-1}, + {0x1.fff0000002511p492, -0x1.a4cc5f838f529p-7, -0x1.a4cc5f838f52ap-7}, + {-0x1.fff0000002511p492, -0x1.a4cc5f838f529p-7, -0x1.a4cc5f838f52ap-7}, + {0x1.fff1fffffffffp41, 0x1.f16437d6119f9p-10, 0x1.f16437d6119f8p-10}, + {-0x1.fff1fffffffffp41, 0x1.f16437d6119f9p-10, 0x1.f16437d6119f8p-10}, + {0x1.ffffc7fffffffp45, 0x1.898324c2f1cfcp-11, 0x1.898324c2f1cfdp-11}, + {-0x1.ffffc7fffffffp45, 0x1.898324c2f1cfcp-11, 0x1.898324c2f1cfdp-11}, + {0x1.ffffdf1ffffffp-3, 0x1.f0154c00688f8p-1, 0x1.f0154c00688f9p-1}, + {-0x1.ffffdf1ffffffp-3, 0x1.f0154c00688f8p-1, 0x1.f0154c00688f9p-1}, + {0x1.fffff8fffffffp-6, 0x1.ffc00157126a8p-1, 0x1.ffc00157126a7p-1}, + {-0x1.fffff8fffffffp-6, 0x1.ffc00157126a8p-1, 0x1.ffc00157126a7p-1}, + {0x1.fffffbfffffffp968, -0x1.e0d9f0f38c73fp-2, -0x1.e0d9f0f38c74p-2}, + {-0x1.fffffbfffffffp968, -0x1.e0d9f0f38c73fp-2, -0x1.e0d9f0f38c74p-2}, + {0x1.fffffcfffffffp40, 0x1.fff4699dd560bp-1, 0x1.fff4699dd560cp-1}, + {-0x1.fffffcfffffffp40, 0x1.fff4699dd560bp-1, 0x1.fff4699dd560cp-1}, + {0x1.ffffff000004p-5, 0x1.ff0015559f228p-1, 0x1.ff0015559f229p-1}, + {-0x1.ffffff000004p-5, 0x1.ff0015559f228p-1, 0x1.ff0015559f229p-1}, + {0x1.ffffff8p119, -0x1.9c6951cccd39cp-2, -0x1.9c6951cccd39bp-2}, + {-0x1.ffffff8p119, -0x1.9c6951cccd39cp-2, -0x1.9c6951cccd39bp-2}, + {0x1.ffffff8p192, -0x1.f2c2263590035p-1, -0x1.f2c2263590034p-1}, + {-0x1.ffffff8p192, -0x1.f2c2263590035p-1, -0x1.f2c2263590034p-1}, + {0x1.ffffff8p543, 0x1.c7884d6cfb551p-1, 0x1.c7884d6cfb552p-1}, + {-0x1.ffffff8p543, 0x1.c7884d6cfb551p-1, 0x1.c7884d6cfb552p-1}, + {0x1.ffffffc3fffffp500, 0x1.e66c79e776a1fp-2, 0x1.e66c79e776a1ep-2}, + {-0x1.ffffffc3fffffp500, 0x1.e66c79e776a1fp-2, 0x1.e66c79e776a1ep-2}, + {0x1.ffffffe1fffffp700, 0x1.c7c9a9c57c0b2p-3, 0x1.c7c9a9c57c0b3p-3}, + {-0x1.ffffffe1fffffp700, 0x1.c7c9a9c57c0b2p-3, 0x1.c7c9a9c57c0b3p-3}, + {0x1.ffffffff0f0ffp400, 0x1.7bb28daf5f9aep-1, 0x1.7bb28daf5f9adp-1}, + {-0x1.ffffffff0f0ffp400, 0x1.7bb28daf5f9aep-1, 0x1.7bb28daf5f9adp-1}, + {0x1.ffffffff3ffffp-4, 0x1.fc015527d8bb3p-1, 0x1.fc015527d8bb4p-1}, + {-0x1.ffffffff3ffffp-4, 0x1.fc015527d8bb3p-1, 0x1.fc015527d8bb4p-1}, + {0x1.ffffffff8ffffp3, -0x1.ea5257eb66e3cp-1, -0x1.ea5257eb66e3bp-1}, + {-0x1.ffffffff8ffffp3, -0x1.ea5257eb66e3cp-1, -0x1.ea5257eb66e3bp-1}, + {0x1.fffffffffbcffp1, -0x1.4eaa606dbef97p-1, -0x1.4eaa606dbef96p-1}, + {-0x1.fffffffffbcffp1, -0x1.4eaa606dbef97p-1, -0x1.4eaa606dbef96p-1}, + {0x1.fffffffffe0b5p720, -0x1.fc9cd6b5f0095p-1, -0x1.fc9cd6b5f0094p-1}, + {-0x1.fffffffffe0b5p720, -0x1.fc9cd6b5f0095p-1, -0x1.fc9cd6b5f0094p-1}, + {0x1.fffffffffe7ffp41, 0x1.e96ac045dd139p-3, 0x1.e96ac045dd138p-3}, + {-0x1.fffffffffe7ffp41, 0x1.e96ac045dd139p-3, 0x1.e96ac045dd138p-3}, + {0x1.fffffffffee09p720, -0x1.fcaf39cfb94d5p-1, -0x1.fcaf39cfb94d4p-1}, + {-0x1.fffffffffee09p720, -0x1.fcaf39cfb94d5p-1, -0x1.fcaf39cfb94d4p-1}, + {0x1.ffffffffffdffp40, 0x1.8432232a6d1dap-1, 0x1.8432232a6d1dbp-1}, + {-0x1.ffffffffffdffp40, 0x1.8432232a6d1dap-1, 0x1.8432232a6d1dbp-1}, + {0x1.ffffffffffeffp41, 0x1.9e375143139dap-6, 0x1.9e375143139d9p-6}, + {-0x1.ffffffffffeffp41, 0x1.9e375143139dap-6, 0x1.9e375143139d9p-6}, + {0x1.fffffffffff4ap-8, 0x1.fffc000155552p-1, 0x1.fffc000155553p-1}, + {-0x1.fffffffffff4ap-8, 0x1.fffc000155552p-1, 0x1.fffc000155553p-1}, + {0x1.fffffffffff78p920, 0x1.463a895c4ea5dp-1, 0x1.463a895c4ea5cp-1}, + {-0x1.fffffffffff78p920, 0x1.463a895c4ea5dp-1, 0x1.463a895c4ea5cp-1}, + {0x1.fffffffffffd5p995, 0x1.3c1a48635cf38p-1, 0x1.3c1a48635cf39p-1}, + {-0x1.fffffffffffd5p995, 0x1.3c1a48635cf38p-1, 0x1.3c1a48635cf39p-1}, + {0x1.fffffffffffe8p720, 0x1.91c4e0708bd48p-1, 0x1.91c4e0708bd49p-1}, + {-0x1.fffffffffffe8p720, 0x1.91c4e0708bd48p-1, 0x1.91c4e0708bd49p-1}, + {0x1.fffffffffffebp920, -0x1.3e15cb849b5eap-1, -0x1.3e15cb849b5ebp-1}, + {-0x1.fffffffffffebp920, -0x1.3e15cb849b5eap-1, -0x1.3e15cb849b5ebp-1}, + {0x1.ffffffffffff1p245, -0x1.816808349b80ep-1, -0x1.816808349b80dp-1}, + {-0x1.ffffffffffff1p245, -0x1.816808349b80ep-1, -0x1.816808349b80dp-1}, + {0x1.ffffffffffff4p845, 0x1.4699c814c5f07p-1, 0x1.4699c814c5f08p-1}, + {-0x1.ffffffffffff4p845, 0x1.4699c814c5f07p-1, 0x1.4699c814c5f08p-1}, + {0x1.ffffffffffff4p1020, -0x1.815e92b7a2a01p-1, -0x1.815e92b7a2a02p-1}, + {-0x1.ffffffffffff4p1020, -0x1.815e92b7a2a01p-1, -0x1.815e92b7a2a02p-1}, + {0x1.ffffffffffffcp45, -0x1.3e8d028153202p-10, -0x1.3e8d028153201p-10}, + {-0x1.ffffffffffffcp45, -0x1.3e8d028153202p-10, -0x1.3e8d028153201p-10}, + {0x1.ffffffffffffep105, 0x1.7d6765714c786p-1, 0x1.7d6765714c785p-1}, + {-0x1.ffffffffffffep105, 0x1.7d6765714c786p-1, 0x1.7d6765714c785p-1}, + {0x1.ffffffffffffep480, -0x1.f869fb14d2569p-3, -0x1.f869fb14d2568p-3}, + {-0x1.ffffffffffffep480, -0x1.f869fb14d2569p-3, -0x1.f869fb14d2568p-3}, + {0x1.ffffffffffffep970, -0x1.80a75b369d3c4p-1, -0x1.80a75b369d3c3p-1}, + {-0x1.ffffffffffffep970, -0x1.80a75b369d3c4p-1, -0x1.80a75b369d3c3p-1}, + {0x1.0000000000001p42, -0x1.9dba69e853bd8p-4, -0x1.9dba69e853bd7p-4}, + {-0x1.0000000000001p42, -0x1.9dba69e853bd8p-4, -0x1.9dba69e853bd7p-4}, + {-0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.0p0, 0x1.0p0, 0x1.0p0}, + {0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x1.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {0x1.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x1.0p-1022, 0x1.0p0, 0x1.0p0}, + {0x1.0p-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.fffffffffffffp-1022, 0x1.0p0, 0x1.0p0}, + {0x0.fffffffffffffp-1022, 0x1.0p0, 0x1.0p0}, + {0x0.fffffffffffffp-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.fffffffffffffp-1022, 0x1.0p0, 0x1.0p0}, + {0x1.0p-1022, 0x1.0p0, 0x1.0p0}, + {-0x1.0p-1022, 0x1.0p0, 0x1.0p0}, + {0x1.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x1.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {0x1.999999999999ap-13, 0x1.ffffff5c28f5dp-1, 0x1.ffffff5c28f5cp-1}, + {-0x1.999999999999ap-13, 0x1.ffffff5c28f5dp-1, 0x1.ffffff5c28f5cp-1}, + {0x1.999999999999ap-12, 0x1.fffffd70a3d79p-1, 0x1.fffffd70a3d7ap-1}, + {-0x1.999999999999ap-12, 0x1.fffffd70a3d79p-1, 0x1.fffffd70a3d7ap-1}, + {0x1.3333333333334p-11, 0x1.fffffa3d70a6ap-1, 0x1.fffffa3d70a69p-1}, + {-0x1.3333333333334p-11, 0x1.fffffa3d70a6ap-1, 0x1.fffffa3d70a69p-1}, + {0x1.999999999999ap-11, 0x1.fffff5c28f64ep-1, 0x1.fffff5c28f64fp-1}, + {-0x1.999999999999ap-11, 0x1.fffff5c28f64ep-1, 0x1.fffff5c28f64fp-1}, + {0x1.0p-10, 0x1.fffff00000155p-1, 0x1.fffff00000156p-1}, + {-0x1.0p-10, 0x1.fffff00000155p-1, 0x1.fffff00000156p-1}, + {0x1.3333333333333p-10, 0x1.ffffe8f5c2bbap-1, 0x1.ffffe8f5c2bb9p-1}, + {-0x1.3333333333333p-10, 0x1.ffffe8f5c2bbap-1, 0x1.ffffe8f5c2bb9p-1}, + {0x1.6666666666666p-10, 0x1.ffffe0a3d75c3p-1, 0x1.ffffe0a3d75c4p-1}, + {-0x1.6666666666666p-10, 0x1.ffffe0a3d75c3p-1, 0x1.ffffe0a3d75c4p-1}, + {0x1.9999999999999p-10, 0x1.ffffd70a3dfc7p-1, 0x1.ffffd70a3dfc8p-1}, + {-0x1.9999999999999p-10, 0x1.ffffd70a3dfc7p-1, 0x1.ffffd70a3dfc8p-1}, + {0x1.cccccccccccccp-10, 0x1.ffffcc28f6a28p-1, 0x1.ffffcc28f6a29p-1}, + {-0x1.cccccccccccccp-10, 0x1.ffffcc28f6a28p-1, 0x1.ffffcc28f6a29p-1}, + {0x1.0666666666666p-7, 0x1.fffbcc2a6e87p-1, 0x1.fffbcc2a6e86fp-1}, + {-0x1.0666666666666p-7, 0x1.fffbcc2a6e87p-1, 0x1.fffbcc2a6e86fp-1}, + {0x1.cccccccccccccp-7, 0x1.fff30a4b6fcc1p-1, 0x1.fff30a4b6fcc2p-1}, + {-0x1.cccccccccccccp-7, 0x1.fff30a4b6fcc1p-1, 0x1.fff30a4b6fcc2p-1}, + {0x1.4999999999999p-6, 0x1.ffe57a780f38cp-1, 0x1.ffe57a780f38dp-1}, + {-0x1.4999999999999p-6, 0x1.ffe57a780f38cp-1, 0x1.ffe57a780f38dp-1}, + {0x1.accccccccccccp-6, 0x1.ffd31cd0e1d63p-1, 0x1.ffd31cd0e1d62p-1}, + {-0x1.accccccccccccp-6, 0x1.ffd31cd0e1d63p-1, 0x1.ffd31cd0e1d62p-1}, + {0x1.08p-5, 0x1.ffbbf18207543p-1, 0x1.ffbbf18207542p-1}, + {-0x1.08p-5, 0x1.ffbbf18207543p-1, 0x1.ffbbf18207542p-1}, + {0x1.399999999999ap-5, 0x1.ff9ff8c3299f5p-1, 0x1.ff9ff8c3299f6p-1}, + {-0x1.399999999999ap-5, 0x1.ff9ff8c3299f5p-1, 0x1.ff9ff8c3299f6p-1}, + {0x1.6b33333333334p-5, 0x1.ff7f32d77c5b2p-1, 0x1.ff7f32d77c5b1p-1}, + {-0x1.6b33333333334p-5, 0x1.ff7f32d77c5b2p-1, 0x1.ff7f32d77c5b1p-1}, + {0x1.9cccccccccccep-5, 0x1.ff59a00dbc409p-1, 0x1.ff59a00dbc408p-1}, + {-0x1.9cccccccccccep-5, 0x1.ff59a00dbc409p-1, 0x1.ff59a00dbc408p-1}, + {0x1.ce66666666666p-5, 0x1.ff2f40c02e60fp-1, 0x1.ff2f40c02e61p-1}, + {-0x1.ce66666666666p-5, 0x1.ff2f40c02e60fp-1, 0x1.ff2f40c02e61p-1}, + {0x1.5e7fc4369bdadp-1, 0x1.8ca46c7d8975ep-1, 0x1.8ca46c7d8975fp-1}, + {-0x1.5e7fc4369bdadp-1, 0x1.8ca46c7d8975ep-1, 0x1.8ca46c7d8975fp-1}, + {0x1.4e7fc4369bdadp0, 0x1.0b5d3802fc799p-2, 0x1.0b5d3802fc79ap-2}, + {-0x1.4e7fc4369bdadp0, 0x1.0b5d3802fc799p-2, 0x1.0b5d3802fc79ap-2}, + {0x1.edbfa651e9c84p0, -0x1.66b96f53323afp-2, -0x1.66b96f53323bp-2}, + {-0x1.edbfa651e9c84p0, -0x1.66b96f53323afp-2, -0x1.66b96f53323bp-2}, + {0x1.467fc4369bdadp1, -0x1.a93554888c33p-1, -0x1.a93554888c32fp-1}, + {-0x1.467fc4369bdadp1, -0x1.a93554888c33p-1, -0x1.a93554888c32fp-1}, + {0x1.961fb54442d18p1, -0x1.ffc00155527d3p-1, -0x1.ffc00155527d2p-1}, + {-0x1.961fb54442d18p1, -0x1.ffc00155527d3p-1, -0x1.ffc00155527d2p-1}, + {0x1.e5bfa651e9c83p1, -0x1.96907c5c7c25cp-1, -0x1.96907c5c7c25bp-1}, + {-0x1.e5bfa651e9c83p1, -0x1.96907c5c7c25cp-1, -0x1.96907c5c7c25bp-1}, + {0x1.1aafcbafc85f7p2, -0x1.2a1e5a50f948dp-2, -0x1.2a1e5a50f948cp-2}, + {-0x1.1aafcbafc85f7p2, -0x1.2a1e5a50f948dp-2, -0x1.2a1e5a50f948cp-2}, + {0x1.427fc4369bdadp2, 0x1.4894f695dc56cp-2, 0x1.4894f695dc56bp-2}, + {-0x1.427fc4369bdadp2, 0x1.4894f695dc56cp-2, 0x1.4894f695dc56bp-2}, + {0x1.6a4fbcbd6f562p2, 0x1.a016ea3a692cep-1, 0x1.a016ea3a692cfp-1}, + {-0x1.6a4fbcbd6f562p2, 0x1.a016ea3a692cep-1, 0x1.a016ea3a692cfp-1}, + {0x1.6af2eff0a2896p2, 0x1.a30a69f5537ecp-1, 0x1.a30a69f5537ebp-1}, + {-0x1.6af2eff0a2896p2, 0x1.a30a69f5537ecp-1, 0x1.a30a69f5537ebp-1}, + {0x1.43c62a9d02414p2, 0x1.5bd62e8b04ad6p-2, 0x1.5bd62e8b04ad5p-2}, + {-0x1.43c62a9d02414p2, 0x1.5bd62e8b04ad6p-2, 0x1.5bd62e8b04ad5p-2}, + {0x1.1c99654961f92p2, -0x1.0cb71f671e634p-2, -0x1.0cb71f671e635p-2}, + {-0x1.1c99654961f92p2, -0x1.0cb71f671e634p-2, -0x1.0cb71f671e635p-2}, + {0x1.ead93feb8361fp1, -0x1.89d86aa8521c1p-1, -0x1.89d86aa8521c2p-1}, + {-0x1.ead93feb8361fp1, -0x1.89d86aa8521c1p-1, -0x1.89d86aa8521c2p-1}, + {0x1.9c7fb54442d1ap1, -0x1.fe51ac554a16bp-1, -0x1.fe51ac554a16ap-1}, + {-0x1.9c7fb54442d1ap1, -0x1.fe51ac554a16bp-1, -0x1.fe51ac554a16ap-1}, + {0x1.4e262a9d02415p1, -0x1.b97c04d08bc5dp-1, -0x1.b97c04d08bc5ep-1}, + {-0x1.4e262a9d02415p1, -0x1.b97c04d08bc5dp-1, -0x1.b97c04d08bc5ep-1}, + {0x1.ff993feb8362p0, -0x1.a8ac8a3e58f6dp-2, -0x1.a8ac8a3e58f6cp-2}, + {-0x1.ff993feb8362p0, -0x1.a8ac8a3e58f6dp-2, -0x1.a8ac8a3e58f6cp-2}, + {0x1.62e62a9d02416p0, 0x1.77a8b9b3d254bp-3, 0x1.77a8b9b3d254ap-3}, + {-0x1.62e62a9d02416p0, 0x1.77a8b9b3d254bp-3, 0x1.77a8b9b3d254ap-3}, + {0x1.8c662a9d02419p-1, 0x1.6e1061205dd79p-1, 0x1.6e1061205dd7ap-1}, + {-0x1.8c662a9d02419p-1, 0x1.6e1061205dd79p-1, 0x1.6e1061205dd7ap-1}, + {-0x1.a8aa1d11c44ffp0, -0x1.682f3cc3c7a09p-4, -0x1.682f3cc3c7a08p-4}, + {0x1.a8aa1d11c44ffp0, -0x1.682f3cc3c7a09p-4, -0x1.682f3cc3c7a08p-4}, + {-0x1.95ec8b9e03d54p0, -0x1.e6669a270c36dp-7, -0x1.e6669a270c36ep-7}, + {0x1.95ec8b9e03d54p0, -0x1.e6669a270c36dp-7, -0x1.e6669a270c36ep-7}, + {-0x1.832efa2a435a9p0, 0x1.ddd1ec25e209fp-5, 0x1.ddd1ec25e20ap-5}, + {0x1.832efa2a435a9p0, 0x1.ddd1ec25e209fp-5, 0x1.ddd1ec25e20ap-5}, + {-0x1.707168b682dfep0, 0x1.0cab9115640dap-3, 0x1.0cab9115640d9p-3}, + {0x1.707168b682dfep0, 0x1.0cab9115640dap-3, 0x1.0cab9115640d9p-3}, + {-0x1.5db3d742c2653p0, 0x1.a0723a95492eep-3, 0x1.a0723a95492edp-3}, + {0x1.5db3d742c2653p0, 0x1.a0723a95492eep-3, 0x1.a0723a95492edp-3}, + {-0x1.4af645cf01ea8p0, 0x1.18fee96a1a586p-2, 0x1.18fee96a1a585p-2}, + {0x1.4af645cf01ea8p0, 0x1.18fee96a1a586p-2, 0x1.18fee96a1a585p-2}, + {-0x1.3838b45b416fdp0, 0x1.6043621b13be3p-2, 0x1.6043621b13be2p-2}, + {0x1.3838b45b416fdp0, 0x1.6043621b13be3p-2, 0x1.6043621b13be2p-2}, + {-0x1.257b22e780f52p0, 0x1.a5a4ccf40d9dap-2, 0x1.a5a4ccf40d9d9p-2}, + {0x1.257b22e780f52p0, 0x1.a5a4ccf40d9dap-2, 0x1.a5a4ccf40d9d9p-2}, + {-0x1.12bd9173c07abp0, 0x1.e8c405f36f85cp-2, 0x1.e8c405f36f85bp-2}, + {0x1.12bd9173c07abp0, 0x1.e8c405f36f85cp-2, 0x1.e8c405f36f85bp-2}, + {-0x1.ea5c3ed5b385p-1, 0x1.26976a6c4e0f8p-1, 0x1.26976a6c4e0f9p-1}, + {0x1.ea5c3ed5b385p-1, 0x1.26976a6c4e0f8p-1, 0x1.26976a6c4e0f9p-1}, + {-0x1.d4b87dab670ap-1, 0x1.3805a1882009fp-1, 0x1.3805a188200ap-1}, + {0x1.d4b87dab670ap-1, 0x1.3805a1882009fp-1, 0x1.3805a188200ap-1}, + {-0x1.bf14bc811a8fp-1, 0x1.48e52e0a65bcbp-1, 0x1.48e52e0a65bccp-1}, + {0x1.bf14bc811a8fp-1, 0x1.48e52e0a65bcbp-1, 0x1.48e52e0a65bccp-1}, + {-0x1.a970fb56ce14p-1, 0x1.592e58ea0a9efp-1, 0x1.592e58ea0a9eep-1}, + {0x1.a970fb56ce14p-1, 0x1.592e58ea0a9efp-1, 0x1.592e58ea0a9eep-1}, + {-0x1.93cd3a2c8199p-1, 0x1.68d9afe052d1fp-1, 0x1.68d9afe052d2p-1}, + {0x1.93cd3a2c8199p-1, 0x1.68d9afe052d1fp-1, 0x1.68d9afe052d2p-1}, + {-0x1.7e297902351ep-1, 0x1.77e008d0775e7p-1, 0x1.77e008d0775e8p-1}, + {0x1.7e297902351ep-1, 0x1.77e008d0775e7p-1, 0x1.77e008d0775e8p-1}, + {-0x1.6885b7d7e8a3p-1, 0x1.863a850e438fep-1, 0x1.863a850e438ffp-1}, + {0x1.6885b7d7e8a3p-1, 0x1.863a850e438fep-1, 0x1.863a850e438ffp-1}, + {-0x1.52e1f6ad9c28p-1, 0x1.93e2948233fcep-1, 0x1.93e2948233fcfp-1}, + {0x1.52e1f6ad9c28p-1, 0x1.93e2948233fcep-1, 0x1.93e2948233fcfp-1}, + {-0x1.3d3e35834fadp-1, 0x1.a0d1f8a9a791dp-1, 0x1.a0d1f8a9a791ep-1}, + {0x1.3d3e35834fadp-1, 0x1.a0d1f8a9a791dp-1, 0x1.a0d1f8a9a791ep-1}, + {-0x1.0a0b02501c799p-1, 0x1.bc6bd861e13dep-1, 0x1.bc6bd861e13dfp-1}, + {0x1.0a0b02501c799p-1, 0x1.bc6bd861e13dep-1, 0x1.bc6bd861e13dfp-1}, + {-0x1.d8f7208e6b82cp-2, 0x1.ca59c6fa3d9cep-1, 0x1.ca59c6fa3d9cfp-1}, + {0x1.d8f7208e6b82cp-2, 0x1.ca59c6fa3d9cep-1, 0x1.ca59c6fa3d9cfp-1}, + {-0x1.9dd83c7c9e126p-2, 0x1.d6c0b125791dp-1, 0x1.d6c0b125791cfp-1}, + {0x1.9dd83c7c9e126p-2, 0x1.d6c0b125791dp-1, 0x1.d6c0b125791cfp-1}, + {-0x1.62b9586ad0a2p-2, 0x1.e196026182986p-1, 0x1.e196026182985p-1}, + {0x1.62b9586ad0a2p-2, 0x1.e196026182986p-1, 0x1.e196026182985p-1}, + {-0x1.279a74590331ap-2, 0x1.ead07cc635696p-1, 0x1.ead07cc635697p-1}, + {0x1.279a74590331ap-2, 0x1.ead07cc635696p-1, 0x1.ead07cc635697p-1}, + {-0x1.d8f7208e6b829p-3, 0x1.f26840e7b2189p-1, 0x1.f26840e7b2188p-1}, + {0x1.d8f7208e6b829p-3, 0x1.f26840e7b2189p-1, 0x1.f26840e7b2188p-1}, + {-0x1.62b9586ad0a1ep-3, 0x1.f856d48db797ep-1, 0x1.f856d48db797dp-1}, + {0x1.62b9586ad0a1ep-3, 0x1.f856d48db797ep-1, 0x1.f856d48db797dp-1}, + {-0x1.d8f7208e6b826p-4, 0x1.fc97283a42479p-1, 0x1.fc97283a4247ap-1}, + {0x1.d8f7208e6b826p-4, 0x1.fc97283a42479p-1, 0x1.fc97283a4247ap-1}, + {-0x1.d8f7208e6b82dp-5, 0x1.ff259b7ab9f5p-1, 0x1.ff259b7ab9f4fp-1}, + {0x1.d8f7208e6b82dp-5, 0x1.ff259b7ab9f5p-1, 0x1.ff259b7ab9f4fp-1}, + {0x1.d8f7208e6b82dp-5, 0x1.ff259b7ab9f5p-1, 0x1.ff259b7ab9f4fp-1}, + {-0x1.d8f7208e6b82dp-5, 0x1.ff259b7ab9f5p-1, 0x1.ff259b7ab9f4fp-1}, + {0x1.d8f7208e6b82dp-4, 0x1.fc97283a42479p-1, 0x1.fc97283a4247ap-1}, + {-0x1.d8f7208e6b82dp-4, 0x1.fc97283a42479p-1, 0x1.fc97283a4247ap-1}, + {0x1.62b9586ad0a22p-3, 0x1.f856d48db797ep-1, 0x1.f856d48db797dp-1}, + {-0x1.62b9586ad0a22p-3, 0x1.f856d48db797ep-1, 0x1.f856d48db797dp-1}, + {0x1.d8f7208e6b82dp-3, 0x1.f26840e7b2189p-1, 0x1.f26840e7b2188p-1}, + {-0x1.d8f7208e6b82dp-3, 0x1.f26840e7b2189p-1, 0x1.f26840e7b2188p-1}, + {0x1.279a74590331cp-2, 0x1.ead07cc635696p-1, 0x1.ead07cc635697p-1}, + {-0x1.279a74590331cp-2, 0x1.ead07cc635696p-1, 0x1.ead07cc635697p-1}, + {0x1.62b9586ad0a22p-2, 0x1.e196026182985p-1, 0x1.e196026182986p-1}, + {-0x1.62b9586ad0a22p-2, 0x1.e196026182985p-1, 0x1.e196026182986p-1}, + {0x1.9dd83c7c9e128p-2, 0x1.d6c0b125791dp-1, 0x1.d6c0b125791cfp-1}, + {-0x1.9dd83c7c9e128p-2, 0x1.d6c0b125791dp-1, 0x1.d6c0b125791cfp-1}, + {0x1.d8f7208e6b82ep-2, 0x1.ca59c6fa3d9cep-1, 0x1.ca59c6fa3d9cdp-1}, + {-0x1.d8f7208e6b82ep-2, 0x1.ca59c6fa3d9cep-1, 0x1.ca59c6fa3d9cdp-1}, + {0x1.0a0b02501c799p-1, 0x1.bc6bd861e13dep-1, 0x1.bc6bd861e13dfp-1}, + {-0x1.0a0b02501c799p-1, 0x1.bc6bd861e13dep-1, 0x1.bc6bd861e13dfp-1}, + {0x1.3d3e35834faccp-1, 0x1.a0d1f8a9a792p-1, 0x1.a0d1f8a9a791fp-1}, + {-0x1.3d3e35834faccp-1, 0x1.a0d1f8a9a792p-1, 0x1.a0d1f8a9a791fp-1}, + {0x1.52e1f6ad9c27cp-1, 0x1.93e2948233fd1p-1, 0x1.93e2948233fdp-1}, + {-0x1.52e1f6ad9c27cp-1, 0x1.93e2948233fd1p-1, 0x1.93e2948233fdp-1}, + {0x1.6885b7d7e8a2cp-1, 0x1.863a850e439p-1, 0x1.863a850e43901p-1}, + {-0x1.6885b7d7e8a2cp-1, 0x1.863a850e439p-1, 0x1.863a850e43901p-1}, + {0x1.7e297902351dcp-1, 0x1.77e008d0775eap-1, 0x1.77e008d0775e9p-1}, + {-0x1.7e297902351dcp-1, 0x1.77e008d0775eap-1, 0x1.77e008d0775e9p-1}, + {0x1.93cd3a2c8198cp-1, 0x1.68d9afe052d22p-1, 0x1.68d9afe052d21p-1}, + {-0x1.93cd3a2c8198cp-1, 0x1.68d9afe052d22p-1, 0x1.68d9afe052d21p-1}, + {0x1.a970fb56ce13cp-1, 0x1.592e58ea0a9f2p-1, 0x1.592e58ea0a9f1p-1}, + {-0x1.a970fb56ce13cp-1, 0x1.592e58ea0a9f2p-1, 0x1.592e58ea0a9f1p-1}, + {0x1.bf14bc811a8ecp-1, 0x1.48e52e0a65bcep-1, 0x1.48e52e0a65bcfp-1}, + {-0x1.bf14bc811a8ecp-1, 0x1.48e52e0a65bcep-1, 0x1.48e52e0a65bcfp-1}, + {0x1.d4b87dab6709cp-1, 0x1.3805a188200a2p-1, 0x1.3805a188200a3p-1}, + {-0x1.d4b87dab6709cp-1, 0x1.3805a188200a2p-1, 0x1.3805a188200a3p-1}, + {0x1.ea5c3ed5b384cp-1, 0x1.26976a6c4e0fcp-1, 0x1.26976a6c4e0fbp-1}, + {-0x1.ea5c3ed5b384cp-1, 0x1.26976a6c4e0fcp-1, 0x1.26976a6c4e0fbp-1}, + {0x1.12bd9173c07abp0, 0x1.e8c405f36f85cp-2, 0x1.e8c405f36f85bp-2}, + {-0x1.12bd9173c07abp0, 0x1.e8c405f36f85cp-2, 0x1.e8c405f36f85bp-2}, + {0x1.257b22e780f56p0, 0x1.a5a4ccf40d9cbp-2, 0x1.a5a4ccf40d9ccp-2}, + {-0x1.257b22e780f56p0, 0x1.a5a4ccf40d9cbp-2, 0x1.a5a4ccf40d9ccp-2}, + {0x1.3838b45b41701p0, 0x1.6043621b13bd4p-2, 0x1.6043621b13bd3p-2}, + {-0x1.3838b45b41701p0, 0x1.6043621b13bd4p-2, 0x1.6043621b13bd3p-2}, + {0x1.4af645cf01eacp0, 0x1.18fee96a1a576p-2, 0x1.18fee96a1a577p-2}, + {-0x1.4af645cf01eacp0, 0x1.18fee96a1a576p-2, 0x1.18fee96a1a577p-2}, + {0x1.5db3d742c2657p0, 0x1.a0723a95492cfp-3, 0x1.a0723a95492cep-3}, + {-0x1.5db3d742c2657p0, 0x1.a0723a95492cfp-3, 0x1.a0723a95492cep-3}, + {0x1.707168b682e02p0, 0x1.0cab9115640bap-3, 0x1.0cab9115640b9p-3}, + {-0x1.707168b682e02p0, 0x1.0cab9115640bap-3, 0x1.0cab9115640b9p-3}, + {0x1.832efa2a435adp0, 0x1.ddd1ec25e201fp-5, 0x1.ddd1ec25e202p-5}, + {-0x1.832efa2a435adp0, 0x1.ddd1ec25e201fp-5, 0x1.ddd1ec25e202p-5}, + {0x1.95ec8b9e03d58p0, -0x1.e6669a270c56dp-7, -0x1.e6669a270c56ep-7}, + {-0x1.95ec8b9e03d58p0, -0x1.e6669a270c56dp-7, -0x1.e6669a270c56ep-7}, + {0x1.a8aa1d11c44ffp0, -0x1.682f3cc3c7a09p-4, -0x1.682f3cc3c7a08p-4}, + {-0x1.a8aa1d11c44ffp0, -0x1.682f3cc3c7a09p-4, -0x1.682f3cc3c7a08p-4}, + {0x1.04aff6d330942p0, 0x1.0cb3469a29ea6p-1, 0x1.0cb3469a29ea7p-1}, + {-0x1.04aff6d330942p0, 0x1.0cb3469a29ea6p-1, 0x1.0cb3469a29ea7p-1}, + {0x1.04b09e98dcdb4p0, 0x1.0cb228fa7f811p-1, 0x1.0cb228fa7f812p-1}, + {-0x1.04b09e98dcdb4p0, 0x1.0cb228fa7f811p-1, 0x1.0cb228fa7f812p-1}, + {0x1.04b1465e89226p0, 0x1.0cb10b5a61b06p-1, 0x1.0cb10b5a61b05p-1}, + {-0x1.04b1465e89226p0, 0x1.0cb10b5a61b06p-1, 0x1.0cb10b5a61b05p-1}, + {0x1.04b1ee2435698p0, 0x1.0cafedb9d078bp-1, 0x1.0cafedb9d078ap-1}, + {-0x1.04b1ee2435698p0, 0x1.0cafedb9d078bp-1, 0x1.0cafedb9d078ap-1}, + {0x1.04b295e9e1b0ap0, 0x1.0caed018cbda8p-1, 0x1.0caed018cbda7p-1}, + {-0x1.04b295e9e1b0ap0, 0x1.0caed018cbda8p-1, 0x1.0caed018cbda7p-1}, + {0x1.04b33daf8df7cp0, 0x1.0cadb27753d65p-1, 0x1.0cadb27753d66p-1}, + {-0x1.04b33daf8df7cp0, 0x1.0cadb27753d65p-1, 0x1.0cadb27753d66p-1}, + {0x1.04b3e5753a3eep0, 0x1.0cac94d5686cbp-1, 0x1.0cac94d5686cap-1}, + {-0x1.04b3e5753a3eep0, 0x1.0cac94d5686cbp-1, 0x1.0cac94d5686cap-1}, + {0x1.04b48d3ae686p0, 0x1.0cab7733099dfp-1, 0x1.0cab7733099ep-1}, + {-0x1.04b48d3ae686p0, 0x1.0cab7733099dfp-1, 0x1.0cab7733099ep-1}, + {0x1.04b5350092ccfp0, 0x1.0caa5990376bp-1, 0x1.0caa5990376b1p-1}, + {-0x1.04b5350092ccfp0, 0x1.0caa5990376bp-1, 0x1.0caa5990376b1p-1}, + {-0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.0p0, 0x1.0p0, 0x1.0p0}, + {0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {0x1.279a74590331bp-1, 0x1.ad02c771c35edp-1, 0x1.ad02c771c35eep-1}, + {-0x1.279a74590331bp-1, 0x1.ad02c771c35edp-1, 0x1.ad02c771c35eep-1}, + {0x1.279a74590331cp-1, 0x1.ad02c771c35edp-1, 0x1.ad02c771c35ecp-1}, + {-0x1.279a74590331cp-1, 0x1.ad02c771c35edp-1, 0x1.ad02c771c35ecp-1}, + {0x1.279a74590331dp-1, 0x1.ad02c771c35ecp-1, 0x1.ad02c771c35edp-1}, + {-0x1.279a74590331dp-1, 0x1.ad02c771c35ecp-1, 0x1.ad02c771c35edp-1}, + {0x1.bb67ae8584ca9p0, -0x1.48d1ddd2b2b4p-3, -0x1.48d1ddd2b2b3fp-3}, + {-0x1.bb67ae8584ca9p0, -0x1.48d1ddd2b2b4p-3, -0x1.48d1ddd2b2b3fp-3}, + {0x1.bb67ae8584caap0, -0x1.48d1ddd2b2b47p-3, -0x1.48d1ddd2b2b48p-3}, + {-0x1.bb67ae8584caap0, -0x1.48d1ddd2b2b47p-3, -0x1.48d1ddd2b2b48p-3}, + {0x1.bb67ae8584cabp0, -0x1.48d1ddd2b2b4fp-3, -0x1.48d1ddd2b2b5p-3}, + {-0x1.bb67ae8584cabp0, -0x1.48d1ddd2b2b4fp-3, -0x1.48d1ddd2b2b5p-3}, + {0x1.bffffffffffffp-2, 0x1.cfc6cfa52adap-1, 0x1.cfc6cfa52ad9fp-1}, + {-0x1.bffffffffffffp-2, 0x1.cfc6cfa52adap-1, 0x1.cfc6cfa52ad9fp-1}, + {0x1.cp-2, 0x1.cfc6cfa52ad9fp-1, 0x1.cfc6cfa52adap-1}, + {-0x1.cp-2, 0x1.cfc6cfa52ad9fp-1, 0x1.cfc6cfa52adap-1}, + {0x1.c000000000001p-2, 0x1.cfc6cfa52ad9fp-1, 0x1.cfc6cfa52adap-1}, + {-0x1.c000000000001p-2, 0x1.cfc6cfa52ad9fp-1, 0x1.cfc6cfa52adap-1}, + {0x1.5ffffffffffffp-1, 0x1.8bb105a5dc901p-1, 0x1.8bb105a5dc902p-1}, + {-0x1.5ffffffffffffp-1, 0x1.8bb105a5dc901p-1, 0x1.8bb105a5dc902p-1}, + {0x1.6p-1, 0x1.8bb105a5dc9p-1, 0x1.8bb105a5dc901p-1}, + {-0x1.6p-1, 0x1.8bb105a5dc9p-1, 0x1.8bb105a5dc901p-1}, + {0x1.6000000000001p-1, 0x1.8bb105a5dc9p-1, 0x1.8bb105a5dc8ffp-1}, + {-0x1.6000000000001p-1, 0x1.8bb105a5dc9p-1, 0x1.8bb105a5dc8ffp-1}, + {0x1.2ffffffffffffp0, 0x1.7ef4842f0bcd1p-2, 0x1.7ef4842f0bcd2p-2}, + {-0x1.2ffffffffffffp0, 0x1.7ef4842f0bcd1p-2, 0x1.7ef4842f0bcd2p-2}, + {0x1.3p0, 0x1.7ef4842f0bccdp-2, 0x1.7ef4842f0bccep-2}, + {-0x1.3p0, 0x1.7ef4842f0bccdp-2, 0x1.7ef4842f0bccep-2}, + {0x1.3000000000001p0, 0x1.7ef4842f0bccap-2, 0x1.7ef4842f0bcc9p-2}, + {-0x1.3000000000001p0, 0x1.7ef4842f0bccap-2, 0x1.7ef4842f0bcc9p-2}, + {0x1.37fffffffffffp1, -0x1.863efa361dc22p-1, -0x1.863efa361dc23p-1}, + {-0x1.37fffffffffffp1, -0x1.863efa361dc22p-1, -0x1.863efa361dc23p-1}, + {0x1.38p1, -0x1.863efa361dc25p-1, -0x1.863efa361dc26p-1}, + {-0x1.38p1, -0x1.863efa361dc25p-1, -0x1.863efa361dc26p-1}, + {0x1.3800000000001p1, -0x1.863efa361dc28p-1, -0x1.863efa361dc27p-1}, + {-0x1.3800000000001p1, -0x1.863efa361dc28p-1, -0x1.863efa361dc27p-1}, + {0x1.069c8b46b3792p-4, 0x1.fef2b2d21cf6cp-1, 0x1.fef2b2d21cf6dp-1}, + {-0x1.069c8b46b3792p-4, 0x1.fef2b2d21cf6cp-1, 0x1.fef2b2d21cf6dp-1}, + {0x1.069c8b46b3792p-3, 0x1.fbcbe693bd8edp-1, 0x1.fbcbe693bd8ecp-1}, + {-0x1.069c8b46b3792p-3, 0x1.fbcbe693bd8edp-1, 0x1.fbcbe693bd8ecp-1}, + {0x1.89ead0ea0d35bp-3, 0x1.f68eebfcbb5e8p-1, 0x1.f68eebfcbb5e9p-1}, + {-0x1.89ead0ea0d35bp-3, 0x1.f68eebfcbb5e8p-1, 0x1.f68eebfcbb5e9p-1}, + {0x1.069c8b46b3792p-2, 0x1.ef4145b4aedp-1, 0x1.ef4145b4aecffp-1}, + {-0x1.069c8b46b3792p-2, 0x1.ef4145b4aedp-1, 0x1.ef4145b4aecffp-1}, + {0x1.4843ae1860576p-2, 0x1.e5eaa286fbbc6p-1, 0x1.e5eaa286fbbc7p-1}, + {-0x1.4843ae1860576p-2, 0x1.e5eaa286fbbc6p-1, 0x1.e5eaa286fbbc7p-1}, + {0x1.89ead0ea0d35ap-2, 0x1.da94d54dd4c08p-1, 0x1.da94d54dd4c09p-1}, + {-0x1.89ead0ea0d35ap-2, 0x1.da94d54dd4c08p-1, 0x1.da94d54dd4c09p-1}, + {0x1.cb91f3bbba13ep-2, 0x1.cd4bca9cb5c71p-1, 0x1.cd4bca9cb5c72p-1}, + {-0x1.cb91f3bbba13ep-2, 0x1.cd4bca9cb5c71p-1, 0x1.cd4bca9cb5c72p-1}, + {0x1.069c8b46b3791p-1, 0x1.be1d7c3534c4p-1, 0x1.be1d7c3534c41p-1}, + {-0x1.069c8b46b3791p-1, 0x1.be1d7c3534c4p-1, 0x1.be1d7c3534c41p-1}, + {0x1.27701caf89e83p-1, 0x1.ad19e2535aa96p-1, 0x1.ad19e2535aa97p-1}, + {-0x1.27701caf89e83p-1, 0x1.ad19e2535aa96p-1, 0x1.ad19e2535aa97p-1}, + {0x1.4843ae1860575p-1, 0x1.9a52e2e0fbcb4p-1, 0x1.9a52e2e0fbcb3p-1}, + {-0x1.4843ae1860575p-1, 0x1.9a52e2e0fbcb4p-1, 0x1.9a52e2e0fbcb3p-1}, + {0x1.69173f8136c67p-1, 0x1.85dc3ea1bbceap-1, 0x1.85dc3ea1bbce9p-1}, + {-0x1.69173f8136c67p-1, 0x1.85dc3ea1bbceap-1, 0x1.85dc3ea1bbce9p-1}, + {0x1.89ead0ea0d359p-1, 0x1.6fcb7c6b8b91ap-1, 0x1.6fcb7c6b8b919p-1}, + {-0x1.89ead0ea0d359p-1, 0x1.6fcb7c6b8b91ap-1, 0x1.6fcb7c6b8b919p-1}, + {0x1.aabe6252e3a4bp-1, 0x1.5837d2817cf3p-1, 0x1.5837d2817cf31p-1}, + {-0x1.aabe6252e3a4bp-1, 0x1.5837d2817cf3p-1, 0x1.5837d2817cf31p-1}, + {0x1.cb91f3bbba13dp-1, 0x1.3f3a0e28bedd4p-1, 0x1.3f3a0e28bedd5p-1}, + {-0x1.cb91f3bbba13dp-1, 0x1.3f3a0e28bedd4p-1, 0x1.3f3a0e28bedd5p-1}, + {0x1.ec6585249082fp-1, 0x1.24ec799171643p-1, 0x1.24ec799171642p-1}, + {-0x1.ec6585249082fp-1, 0x1.24ec799171643p-1, 0x1.24ec799171642p-1}, + {0x1.069c8b46b3791p0, 0x1.096ac02ec42c8p-1, 0x1.096ac02ec42c9p-1}, + {-0x1.069c8b46b3791p0, 0x1.096ac02ec42c8p-1, 0x1.096ac02ec42c9p-1}, + {0x1.170653fb1eb0ap0, 0x1.d9a3a336edb76p-2, 0x1.d9a3a336edb77p-2}, + {-0x1.170653fb1eb0ap0, 0x1.d9a3a336edb76p-2, 0x1.d9a3a336edb77p-2}, + {0x1.27701caf89e83p0, 0x1.9e7f8652b4758p-2, 0x1.9e7f8652b4759p-2}, + {-0x1.27701caf89e83p0, 0x1.9e7f8652b4758p-2, 0x1.9e7f8652b4759p-2}, + {0x1.37d9e563f51fcp0, 0x1.61a76077aee08p-2, 0x1.61a76077aee07p-2}, + {-0x1.37d9e563f51fcp0, 0x1.61a76077aee08p-2, 0x1.61a76077aee07p-2}, + {0x1.4843ae1860575p0, 0x1.235b331d8f749p-2, 0x1.235b331d8f748p-2}, + {-0x1.4843ae1860575p0, 0x1.235b331d8f749p-2, 0x1.235b331d8f748p-2}, + {0x1.58ad76cccb8eep0, 0x1.c7b90e3024594p-3, 0x1.c7b90e3024593p-3}, + {-0x1.58ad76cccb8eep0, 0x1.c7b90e3024594p-3, 0x1.c7b90e3024593p-3}, + {0x1.69173f8136c67p0, 0x1.46dc4f4ce83dap-3, 0x1.46dc4f4ce83dbp-3}, + {-0x1.69173f8136c67p0, 0x1.46dc4f4ce83dap-3, 0x1.46dc4f4ce83dbp-3}, + {0x1.79810835a1fep0, 0x1.894f70befbb9ap-4, 0x1.894f70befbb99p-4}, + {-0x1.79810835a1fep0, 0x1.894f70befbb9ap-4, 0x1.894f70befbb99p-4}, + {0x1.89ead0ea0d359p0, 0x1.069107ae9333p-5, 0x1.069107ae9332fp-5}, + {-0x1.89ead0ea0d359p0, 0x1.069107ae9333p-5, 0x1.069107ae9332fp-5}, + {0x1.9a54999e786d2p0, -0x1.069107ae9327ep-5, -0x1.069107ae9327fp-5}, + {-0x1.9a54999e786d2p0, -0x1.069107ae9327ep-5, -0x1.069107ae9327fp-5}, + {0x1.aabe6252e3a4bp0, -0x1.894f70befbb41p-4, -0x1.894f70befbb42p-4}, + {-0x1.aabe6252e3a4bp0, -0x1.894f70befbb41p-4, -0x1.894f70befbb42p-4}, + {0x1.bb282b074edc4p0, -0x1.46dc4f4ce83afp-3, -0x1.46dc4f4ce83aep-3}, + {-0x1.bb282b074edc4p0, -0x1.46dc4f4ce83afp-3, -0x1.46dc4f4ce83aep-3}, + {0x1.cb91f3bbba13dp0, -0x1.c7b90e3024569p-3, -0x1.c7b90e3024568p-3}, + {-0x1.cb91f3bbba13dp0, -0x1.c7b90e3024569p-3, -0x1.c7b90e3024568p-3}, + {0x1.dbfbbc70254b6p0, -0x1.235b331d8f734p-2, -0x1.235b331d8f733p-2}, + {-0x1.dbfbbc70254b6p0, -0x1.235b331d8f734p-2, -0x1.235b331d8f733p-2}, + {0x1.ec6585249082fp0, -0x1.61a76077aedf3p-2, -0x1.61a76077aedf2p-2}, + {-0x1.ec6585249082fp0, -0x1.61a76077aedf3p-2, -0x1.61a76077aedf2p-2}, + {0x1.fccf4dd8fbba8p0, -0x1.9e7f8652b4744p-2, -0x1.9e7f8652b4743p-2}, + {-0x1.fccf4dd8fbba8p0, -0x1.9e7f8652b4744p-2, -0x1.9e7f8652b4743p-2}, + {0x1.069c8b46b3791p1, -0x1.d9a3a336edb66p-2, -0x1.d9a3a336edb65p-2}, + {-0x1.069c8b46b3791p1, -0x1.d9a3a336edb66p-2, -0x1.d9a3a336edb65p-2}, + {0x1.0ed16fa0e914ep1, -0x1.096ac02ec42c2p-1, -0x1.096ac02ec42c3p-1}, + {-0x1.0ed16fa0e914ep1, -0x1.096ac02ec42c2p-1, -0x1.096ac02ec42c3p-1}, + {0x1.170653fb1eb0bp1, -0x1.24ec79917163ep-1, -0x1.24ec79917163dp-1}, + {-0x1.170653fb1eb0bp1, -0x1.24ec79917163ep-1, -0x1.24ec79917163dp-1}, + {0x1.1f3b3855544c8p1, -0x1.3f3a0e28bedd1p-1, -0x1.3f3a0e28beddp-1}, + {-0x1.1f3b3855544c8p1, -0x1.3f3a0e28bedd1p-1, -0x1.3f3a0e28beddp-1}, + {0x1.27701caf89e85p1, -0x1.5837d2817cf2fp-1, -0x1.5837d2817cf2ep-1}, + {-0x1.27701caf89e85p1, -0x1.5837d2817cf2fp-1, -0x1.5837d2817cf2ep-1}, + {0x1.2fa50109bf842p1, -0x1.6fcb7c6b8b91ap-1, -0x1.6fcb7c6b8b919p-1}, + {-0x1.2fa50109bf842p1, -0x1.6fcb7c6b8b91ap-1, -0x1.6fcb7c6b8b919p-1}, + {0x1.37d9e563f51ffp1, -0x1.85dc3ea1bbcebp-1, -0x1.85dc3ea1bbceap-1}, + {-0x1.37d9e563f51ffp1, -0x1.85dc3ea1bbcebp-1, -0x1.85dc3ea1bbceap-1}, + {0x1.400ec9be2abbcp1, -0x1.9a52e2e0fbcb6p-1, -0x1.9a52e2e0fbcb5p-1}, + {-0x1.400ec9be2abbcp1, -0x1.9a52e2e0fbcb6p-1, -0x1.9a52e2e0fbcb5p-1}, + {0x1.4843ae1860579p1, -0x1.ad19e2535aa9ap-1, -0x1.ad19e2535aa99p-1}, + {-0x1.4843ae1860579p1, -0x1.ad19e2535aa9ap-1, -0x1.ad19e2535aa99p-1}, + {0x1.5078927295f36p1, -0x1.be1d7c3534c44p-1, -0x1.be1d7c3534c45p-1}, + {-0x1.5078927295f36p1, -0x1.be1d7c3534c44p-1, -0x1.be1d7c3534c45p-1}, + {0x1.58ad76cccb8f3p1, -0x1.cd4bca9cb5c76p-1, -0x1.cd4bca9cb5c75p-1}, + {-0x1.58ad76cccb8f3p1, -0x1.cd4bca9cb5c76p-1, -0x1.cd4bca9cb5c75p-1}, + {0x1.60e25b27012bp1, -0x1.da94d54dd4c0dp-1, -0x1.da94d54dd4c0cp-1}, + {-0x1.60e25b27012bp1, -0x1.da94d54dd4c0dp-1, -0x1.da94d54dd4c0cp-1}, + {0x1.69173f8136c6dp1, -0x1.e5eaa286fbbcbp-1, -0x1.e5eaa286fbbcap-1}, + {-0x1.69173f8136c6dp1, -0x1.e5eaa286fbbcbp-1, -0x1.e5eaa286fbbcap-1}, + {0x1.714c23db6c62ap1, -0x1.ef4145b4aed04p-1, -0x1.ef4145b4aed03p-1}, + {-0x1.714c23db6c62ap1, -0x1.ef4145b4aed04p-1, -0x1.ef4145b4aed03p-1}, + {0x1.79810835a1fe7p1, -0x1.f68eebfcbb5ecp-1, -0x1.f68eebfcbb5ebp-1}, + {-0x1.79810835a1fe7p1, -0x1.f68eebfcbb5ecp-1, -0x1.f68eebfcbb5ebp-1}, + {0x1.81b5ec8fd79a4p1, -0x1.fbcbe693bd8efp-1, -0x1.fbcbe693bd8fp-1}, + {-0x1.81b5ec8fd79a4p1, -0x1.fbcbe693bd8efp-1, -0x1.fbcbe693bd8fp-1}, + {0x1.89ead0ea0d35bp1, -0x1.fef2b2d21cf6cp-1, -0x1.fef2b2d21cf6bp-1}, + {-0x1.89ead0ea0d35bp1, -0x1.fef2b2d21cf6cp-1, -0x1.fef2b2d21cf6bp-1}, + {-0x1.81b5ec8fd799fp2, 0x1.ef4145b4aecffp-1, 0x1.ef4145b4aedp-1}, + {0x1.81b5ec8fd799fp2, 0x1.ef4145b4aecffp-1, 0x1.ef4145b4aedp-1}, + {-0x1.714c23db6c626p2, 0x1.be1d7c3534c4p-1, 0x1.be1d7c3534c3fp-1}, + {0x1.714c23db6c626p2, 0x1.be1d7c3534c4p-1, 0x1.be1d7c3534c3fp-1}, + {-0x1.60e25b27012adp2, 0x1.6fcb7c6b8b919p-1, 0x1.6fcb7c6b8b918p-1}, + {0x1.60e25b27012adp2, 0x1.6fcb7c6b8b919p-1, 0x1.6fcb7c6b8b918p-1}, + {-0x1.5078927295f34p2, 0x1.096ac02ec42c8p-1, 0x1.096ac02ec42c9p-1}, + {0x1.5078927295f34p2, 0x1.096ac02ec42c8p-1, 0x1.096ac02ec42c9p-1}, + {-0x1.400ec9be2abbbp2, 0x1.235b331d8f748p-2, 0x1.235b331d8f749p-2}, + {0x1.400ec9be2abbbp2, 0x1.235b331d8f748p-2, 0x1.235b331d8f749p-2}, + {-0x1.2fa50109bf842p2, 0x1.069107ae9332cp-5, 0x1.069107ae9332dp-5}, + {0x1.2fa50109bf842p2, 0x1.069107ae9332cp-5, 0x1.069107ae9332dp-5}, + {-0x1.1f3b3855544c9p2, -0x1.c7b90e3024569p-3, -0x1.c7b90e302456ap-3}, + {0x1.1f3b3855544c9p2, -0x1.c7b90e3024569p-3, -0x1.c7b90e302456ap-3}, + {-0x1.0ed16fa0e915p2, -0x1.d9a3a336edb63p-2, -0x1.d9a3a336edb62p-2}, + {0x1.0ed16fa0e915p2, -0x1.d9a3a336edb63p-2, -0x1.d9a3a336edb62p-2}, + {-0x1.fccf4dd8fbbaep1, -0x1.5837d2817cf28p-1, -0x1.5837d2817cf27p-1}, + {0x1.fccf4dd8fbbaep1, -0x1.5837d2817cf28p-1, -0x1.5837d2817cf27p-1}, + {-0x1.dbfbbc70254bcp1, -0x1.ad19e2535aa9p-1, -0x1.ad19e2535aa8fp-1}, + {0x1.dbfbbc70254bcp1, -0x1.ad19e2535aa9p-1, -0x1.ad19e2535aa8fp-1}, + {-0x1.bb282b074edcap1, -0x1.e5eaa286fbbc3p-1, -0x1.e5eaa286fbbc2p-1}, + {0x1.bb282b074edcap1, -0x1.e5eaa286fbbc3p-1, -0x1.e5eaa286fbbc2p-1}, + {-0x1.9a54999e786d8p1, -0x1.fef2b2d21cf6bp-1, -0x1.fef2b2d21cf6cp-1}, + {0x1.9a54999e786d8p1, -0x1.fef2b2d21cf6bp-1, -0x1.fef2b2d21cf6cp-1}, + {-0x1.79810835a1fe6p1, -0x1.f68eebfcbb5ebp-1, -0x1.f68eebfcbb5eap-1}, + {0x1.79810835a1fe6p1, -0x1.f68eebfcbb5ebp-1, -0x1.f68eebfcbb5eap-1}, + {-0x1.58ad76cccb8f4p1, -0x1.cd4bca9cb5c77p-1, -0x1.cd4bca9cb5c78p-1}, + {0x1.58ad76cccb8f4p1, -0x1.cd4bca9cb5c77p-1, -0x1.cd4bca9cb5c78p-1}, + {-0x1.37d9e563f5202p1, -0x1.85dc3ea1bbcf3p-1, -0x1.85dc3ea1bbcf2p-1}, + {0x1.37d9e563f5202p1, -0x1.85dc3ea1bbcf3p-1, -0x1.85dc3ea1bbcf2p-1}, + {-0x1.170653fb1eb1p1, -0x1.24ec79917164ep-1, -0x1.24ec79917164fp-1}, + {0x1.170653fb1eb1p1, -0x1.24ec79917164ep-1, -0x1.24ec79917164fp-1}, + {-0x1.ec6585249083cp0, -0x1.61a76077aee24p-2, -0x1.61a76077aee23p-2}, + {0x1.ec6585249083cp0, -0x1.61a76077aee24p-2, -0x1.61a76077aee23p-2}, + {-0x1.aabe6252e3a58p0, -0x1.894f70befbc1p-4, -0x1.894f70befbc11p-4}, + {0x1.aabe6252e3a58p0, -0x1.894f70befbc1p-4, -0x1.894f70befbc11p-4}, + {-0x1.69173f8136c74p0, 0x1.46dc4f4ce8374p-3, 0x1.46dc4f4ce8373p-3}, + {0x1.69173f8136c74p0, 0x1.46dc4f4ce8374p-3, 0x1.46dc4f4ce8373p-3}, + {-0x1.27701caf89e9p0, 0x1.9e7f8652b4729p-2, 0x1.9e7f8652b4728p-2}, + {0x1.27701caf89e9p0, 0x1.9e7f8652b4729p-2, 0x1.9e7f8652b4728p-2}, + {-0x1.cb91f3bbba157p-1, 0x1.3f3a0e28bedcp-1, 0x1.3f3a0e28bedbfp-1}, + {0x1.cb91f3bbba157p-1, 0x1.3f3a0e28bedcp-1, 0x1.3f3a0e28bedbfp-1}, + {-0x1.4843ae186058ep-1, 0x1.9a52e2e0fbca5p-1, 0x1.9a52e2e0fbca4p-1}, + {0x1.4843ae186058ep-1, 0x1.9a52e2e0fbca5p-1, 0x1.9a52e2e0fbca4p-1}, + {-0x1.89ead0ea0d38ap-2, 0x1.da94d54dd4bffp-1, 0x1.da94d54dd4cp-1}, + {0x1.89ead0ea0d38ap-2, 0x1.da94d54dd4bffp-1, 0x1.da94d54dd4cp-1}, + {-0x1.069c8b46b37fp-3, 0x1.fbcbe693bd8eap-1, 0x1.fbcbe693bd8e9p-1}, + {0x1.069c8b46b37fp-3, 0x1.fbcbe693bd8eap-1, 0x1.fbcbe693bd8e9p-1}, + {0x1.069c8b46b3734p-3, 0x1.fbcbe693bd8fp-1, 0x1.fbcbe693bd8efp-1}, + {-0x1.069c8b46b3734p-3, 0x1.fbcbe693bd8fp-1, 0x1.fbcbe693bd8efp-1}, + {0x1.89ead0ea0d32cp-2, 0x1.da94d54dd4c11p-1, 0x1.da94d54dd4c12p-1}, + {-0x1.89ead0ea0d32cp-2, 0x1.da94d54dd4c11p-1, 0x1.da94d54dd4c12p-1}, + {0x1.4843ae186055fp-1, 0x1.9a52e2e0fbcc1p-1, 0x1.9a52e2e0fbccp-1}, + {-0x1.4843ae186055fp-1, 0x1.9a52e2e0fbcc1p-1, 0x1.9a52e2e0fbccp-1}, + {0x1.cb91f3bbba128p-1, 0x1.3f3a0e28bede4p-1, 0x1.3f3a0e28bede5p-1}, + {-0x1.cb91f3bbba128p-1, 0x1.3f3a0e28bede4p-1, 0x1.3f3a0e28bede5p-1}, + {0x1.27701caf89e78p0, 0x1.9e7f8652b478p-2, 0x1.9e7f8652b4781p-2}, + {-0x1.27701caf89e78p0, 0x1.9e7f8652b478p-2, 0x1.9e7f8652b4781p-2}, + {0x1.69173f8136c5cp0, 0x1.46dc4f4ce8431p-3, 0x1.46dc4f4ce8432p-3}, + {-0x1.69173f8136c5cp0, 0x1.46dc4f4ce8431p-3, 0x1.46dc4f4ce8432p-3}, + {0x1.aabe6252e3a4p0, -0x1.894f70befba92p-4, -0x1.894f70befba93p-4}, + {-0x1.aabe6252e3a4p0, -0x1.894f70befba92p-4, -0x1.894f70befba93p-4}, + {0x1.ec65852490824p0, -0x1.61a76077aedcap-2, -0x1.61a76077aedc9p-2}, + {-0x1.ec65852490824p0, -0x1.61a76077aedcap-2, -0x1.61a76077aedc9p-2}, + {0x1.170653fb1eb04p1, -0x1.24ec799171627p-1, -0x1.24ec799171626p-1}, + {-0x1.170653fb1eb04p1, -0x1.24ec799171627p-1, -0x1.24ec799171626p-1}, + {0x1.37d9e563f51f6p1, -0x1.85dc3ea1bbcd3p-1, -0x1.85dc3ea1bbcd4p-1}, + {-0x1.37d9e563f51f6p1, -0x1.85dc3ea1bbcd3p-1, -0x1.85dc3ea1bbcd4p-1}, + {0x1.58ad76cccb8e8p1, -0x1.cd4bca9cb5c63p-1, -0x1.cd4bca9cb5c62p-1}, + {-0x1.58ad76cccb8e8p1, -0x1.cd4bca9cb5c63p-1, -0x1.cd4bca9cb5c62p-1}, + {0x1.79810835a1fdap1, -0x1.f68eebfcbb5e2p-1, -0x1.f68eebfcbb5e1p-1}, + {-0x1.79810835a1fdap1, -0x1.f68eebfcbb5e2p-1, -0x1.f68eebfcbb5e1p-1}, + {0x1.9a54999e786ccp1, -0x1.fef2b2d21cf6ep-1, -0x1.fef2b2d21cf6fp-1}, + {-0x1.9a54999e786ccp1, -0x1.fef2b2d21cf6ep-1, -0x1.fef2b2d21cf6fp-1}, + {0x1.bb282b074edbep1, -0x1.e5eaa286fbbd2p-1, -0x1.e5eaa286fbbd1p-1}, + {-0x1.bb282b074edbep1, -0x1.e5eaa286fbbd2p-1, -0x1.e5eaa286fbbd1p-1}, + {0x1.dbfbbc70254bp1, -0x1.ad19e2535aaaap-1, -0x1.ad19e2535aaabp-1}, + {-0x1.dbfbbc70254bp1, -0x1.ad19e2535aaaap-1, -0x1.ad19e2535aaabp-1}, + {0x1.fccf4dd8fbba2p1, -0x1.5837d2817cf4bp-1, -0x1.5837d2817cf4ap-1}, + {-0x1.fccf4dd8fbba2p1, -0x1.5837d2817cf4bp-1, -0x1.5837d2817cf4ap-1}, + {0x1.0ed16fa0e914ap2, -0x1.d9a3a336edbb8p-2, -0x1.d9a3a336edbb7p-2}, + {-0x1.0ed16fa0e914ap2, -0x1.d9a3a336edbb8p-2, -0x1.d9a3a336edbb7p-2}, + {0x1.1f3b3855544c3p2, -0x1.c7b90e3024625p-3, -0x1.c7b90e3024624p-3}, + {-0x1.1f3b3855544c3p2, -0x1.c7b90e3024625p-3, -0x1.c7b90e3024624p-3}, + {0x1.2fa50109bf83cp2, 0x1.069107ae9302dp-5, 0x1.069107ae9302cp-5}, + {-0x1.2fa50109bf83cp2, 0x1.069107ae9302dp-5, 0x1.069107ae9302cp-5}, + {0x1.400ec9be2abb5p2, 0x1.235b331d8f6ecp-2, 0x1.235b331d8f6edp-2}, + {-0x1.400ec9be2abb5p2, 0x1.235b331d8f6ecp-2, 0x1.235b331d8f6edp-2}, + {0x1.5078927295f2ep2, 0x1.096ac02ec429fp-1, 0x1.096ac02ec42ap-1}, + {-0x1.5078927295f2ep2, 0x1.096ac02ec429fp-1, 0x1.096ac02ec42ap-1}, + {0x1.60e25b27012a7p2, 0x1.6fcb7c6b8b8f7p-1, 0x1.6fcb7c6b8b8f8p-1}, + {-0x1.60e25b27012a7p2, 0x1.6fcb7c6b8b8f7p-1, 0x1.6fcb7c6b8b8f8p-1}, + {0x1.714c23db6c62p2, 0x1.be1d7c3534c28p-1, 0x1.be1d7c3534c29p-1}, + {-0x1.714c23db6c62p2, 0x1.be1d7c3534c28p-1, 0x1.be1d7c3534c29p-1}, + {0x1.81b5ec8fd7999p2, 0x1.ef4145b4aecf3p-1, 0x1.ef4145b4aecf4p-1}, + {-0x1.81b5ec8fd7999p2, 0x1.ef4145b4aecf3p-1, 0x1.ef4145b4aecf4p-1}, + {0x1.effffffffffffp-5, 0x1.ff0fd2c96adfcp-1, 0x1.ff0fd2c96adfbp-1}, + {-0x1.effffffffffffp-5, 0x1.ff0fd2c96adfcp-1, 0x1.ff0fd2c96adfbp-1}, + {0x1.fp-5, 0x1.ff0fd2c96adfcp-1, 0x1.ff0fd2c96adfbp-1}, + {-0x1.fp-5, 0x1.ff0fd2c96adfcp-1, 0x1.ff0fd2c96adfbp-1}, + {0x1.f000000000001p-5, 0x1.ff0fd2c96adfcp-1, 0x1.ff0fd2c96adfbp-1}, + {-0x1.f000000000001p-5, 0x1.ff0fd2c96adfcp-1, 0x1.ff0fd2c96adfbp-1}, + {0x1.f7fffffffffffp-4, 0x1.fc210055467fep-1, 0x1.fc210055467ffp-1}, + {-0x1.f7fffffffffffp-4, 0x1.fc210055467fep-1, 0x1.fc210055467ffp-1}, + {0x1.f8p-4, 0x1.fc210055467fep-1, 0x1.fc210055467ffp-1}, + {-0x1.f8p-4, 0x1.fc210055467fep-1, 0x1.fc210055467ffp-1}, + {0x1.f800000000001p-4, 0x1.fc210055467fep-1, 0x1.fc210055467ffp-1}, + {-0x1.f800000000001p-4, 0x1.fc210055467fep-1, 0x1.fc210055467ffp-1}, + {0x1.4bfffffffffffp-3, 0x1.f94984b2552e2p-1, 0x1.f94984b2552e1p-1}, + {-0x1.4bfffffffffffp-3, 0x1.f94984b2552e2p-1, 0x1.f94984b2552e1p-1}, + {0x1.4cp-3, 0x1.f94984b2552e2p-1, 0x1.f94984b2552e1p-1}, + {-0x1.4cp-3, 0x1.f94984b2552e2p-1, 0x1.f94984b2552e1p-1}, + {0x1.4c00000000001p-3, 0x1.f94984b2552e2p-1, 0x1.f94984b2552e1p-1}, + {-0x1.4c00000000001p-3, 0x1.f94984b2552e2p-1, 0x1.f94984b2552e1p-1}, + {0x1.3333333333332p-2, 0x1.e921dd42f09bbp-1, 0x1.e921dd42f09bap-1}, + {-0x1.3333333333332p-2, 0x1.e921dd42f09bbp-1, 0x1.e921dd42f09bap-1}, + {0x1.3333333333333p-2, 0x1.e921dd42f09bap-1, 0x1.e921dd42f09bbp-1}, + {-0x1.3333333333333p-2, 0x1.e921dd42f09bap-1, 0x1.e921dd42f09bbp-1}, + {0x1.3333333333334p-2, 0x1.e921dd42f09bap-1, 0x1.e921dd42f09bbp-1}, + {-0x1.3333333333334p-2, 0x1.e921dd42f09bap-1, 0x1.e921dd42f09bbp-1}, + {0x1.594317acc4ef8p-1, 0x1.8feedb86bf0efp-1, 0x1.8feedb86bf0fp-1}, + {-0x1.594317acc4ef8p-1, 0x1.8feedb86bf0efp-1, 0x1.8feedb86bf0fp-1}, + {0x1.594317acc4ef9p-1, 0x1.8feedb86bf0efp-1, 0x1.8feedb86bf0eep-1}, + {-0x1.594317acc4ef9p-1, 0x1.8feedb86bf0efp-1, 0x1.8feedb86bf0eep-1}, + {0x1.594317acc4efap-1, 0x1.8feedb86bf0eep-1, 0x1.8feedb86bf0edp-1}, + {-0x1.594317acc4efap-1, 0x1.8feedb86bf0eep-1, 0x1.8feedb86bf0edp-1}, + {0x1.8ffffffffffffp-1, 0x1.6b898fa9efb5ep-1, 0x1.6b898fa9efb5dp-1}, + {-0x1.8ffffffffffffp-1, 0x1.6b898fa9efb5ep-1, 0x1.6b898fa9efb5dp-1}, + {0x1.9p-1, 0x1.6b898fa9efb5dp-1, 0x1.6b898fa9efb5ep-1}, + {-0x1.9p-1, 0x1.6b898fa9efb5dp-1, 0x1.6b898fa9efb5ep-1}, + {0x1.9000000000001p-1, 0x1.6b898fa9efb5cp-1, 0x1.6b898fa9efb5dp-1}, + {-0x1.9000000000001p-1, 0x1.6b898fa9efb5cp-1, 0x1.6b898fa9efb5dp-1}, + {-0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.0p0, 0x1.0p0, 0x1.0p0}, + {0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {0x1.921fb54442d17p-5, 0x1.ff621e3796d7ep-1, 0x1.ff621e3796d7dp-1}, + {-0x1.921fb54442d17p-5, 0x1.ff621e3796d7ep-1, 0x1.ff621e3796d7dp-1}, + {0x1.921fb54442d18p-5, 0x1.ff621e3796d7ep-1, 0x1.ff621e3796d7dp-1}, + {-0x1.921fb54442d18p-5, 0x1.ff621e3796d7ep-1, 0x1.ff621e3796d7dp-1}, + {0x1.921fb54442d19p-5, 0x1.ff621e3796d7ep-1, 0x1.ff621e3796d7dp-1}, + {-0x1.921fb54442d19p-5, 0x1.ff621e3796d7ep-1, 0x1.ff621e3796d7dp-1}, + {0x1.921fb54442d17p-4, 0x1.fd88da3d12526p-1, 0x1.fd88da3d12525p-1}, + {-0x1.921fb54442d17p-4, 0x1.fd88da3d12526p-1, 0x1.fd88da3d12525p-1}, + {0x1.921fb54442d18p-4, 0x1.fd88da3d12526p-1, 0x1.fd88da3d12525p-1}, + {-0x1.921fb54442d18p-4, 0x1.fd88da3d12526p-1, 0x1.fd88da3d12525p-1}, + {0x1.921fb54442d19p-4, 0x1.fd88da3d12526p-1, 0x1.fd88da3d12525p-1}, + {-0x1.921fb54442d19p-4, 0x1.fd88da3d12526p-1, 0x1.fd88da3d12525p-1}, + {0x1.921fb54442d17p-3, 0x1.f6297cff75cbp-1, 0x1.f6297cff75cb1p-1}, + {-0x1.921fb54442d17p-3, 0x1.f6297cff75cbp-1, 0x1.f6297cff75cb1p-1}, + {0x1.921fb54442d18p-3, 0x1.f6297cff75cbp-1, 0x1.f6297cff75cb1p-1}, + {-0x1.921fb54442d18p-3, 0x1.f6297cff75cbp-1, 0x1.f6297cff75cb1p-1}, + {0x1.921fb54442d19p-3, 0x1.f6297cff75cbp-1, 0x1.f6297cff75cb1p-1}, + {-0x1.921fb54442d19p-3, 0x1.f6297cff75cbp-1, 0x1.f6297cff75cb1p-1}, + {0x1.921fb54442d17p-2, 0x1.d906bcf328d46p-1, 0x1.d906bcf328d47p-1}, + {-0x1.921fb54442d17p-2, 0x1.d906bcf328d46p-1, 0x1.d906bcf328d47p-1}, + {0x1.921fb54442d18p-2, 0x1.d906bcf328d46p-1, 0x1.d906bcf328d47p-1}, + {-0x1.921fb54442d18p-2, 0x1.d906bcf328d46p-1, 0x1.d906bcf328d47p-1}, + {0x1.921fb54442d19p-2, 0x1.d906bcf328d46p-1, 0x1.d906bcf328d47p-1}, + {-0x1.921fb54442d19p-2, 0x1.d906bcf328d46p-1, 0x1.d906bcf328d47p-1}, + {0x1.921fb54442d17p-1, 0x1.6a09e667f3bcep-1, 0x1.6a09e667f3bcdp-1}, + {-0x1.921fb54442d17p-1, 0x1.6a09e667f3bcep-1, 0x1.6a09e667f3bcdp-1}, + {0x1.921fb54442d18p-1, 0x1.6a09e667f3bcdp-1, 0x1.6a09e667f3bccp-1}, + {-0x1.921fb54442d18p-1, 0x1.6a09e667f3bcdp-1, 0x1.6a09e667f3bccp-1}, + {0x1.921fb54442d19p-1, 0x1.6a09e667f3bccp-1, 0x1.6a09e667f3bcdp-1}, + {-0x1.921fb54442d19p-1, 0x1.6a09e667f3bccp-1, 0x1.6a09e667f3bcdp-1}, + {0x1.921fb54442d17p0, 0x1.469898cc51702p-52, 0x1.469898cc51701p-52}, + {-0x1.921fb54442d17p0, 0x1.469898cc51702p-52, 0x1.469898cc51701p-52}, + {0x1.921fb54442d18p0, 0x1.1a62633145c07p-54, 0x1.1a62633145c06p-54}, + {-0x1.921fb54442d18p0, 0x1.1a62633145c07p-54, 0x1.1a62633145c06p-54}, + {0x1.921fb54442d19p0, -0x1.72cece675d1fdp-53, -0x1.72cece675d1fcp-53}, + {-0x1.921fb54442d19p0, -0x1.72cece675d1fdp-53, -0x1.72cece675d1fcp-53}, + {0x1.921fb54442d17p1, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.921fb54442d17p1, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.921fb54442d18p1, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p1, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.921fb54442d19p1, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.921fb54442d19p1, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.921fb54442d17p2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d17p2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d18p2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d19p2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d19p2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d17p3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d17p3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d18p3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d19p3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d19p3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d17p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d17p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d18p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d19p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d19p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d17p5, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d17p5, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d18p5, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p5, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d19p5, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d19p5, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d17p6, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d17p6, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d18p6, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p6, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d19p6, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d19p6, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d17p7, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d17p7, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d18p7, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p7, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d19p7, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d19p7, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.2d97c7f3321d1p1, -0x1.6a09e667f3bc9p-1, -0x1.6a09e667f3bcap-1}, + {-0x1.2d97c7f3321d1p1, -0x1.6a09e667f3bc9p-1, -0x1.6a09e667f3bcap-1}, + {0x1.2d97c7f3321d2p1, -0x1.6a09e667f3bccp-1, -0x1.6a09e667f3bcbp-1}, + {-0x1.2d97c7f3321d2p1, -0x1.6a09e667f3bccp-1, -0x1.6a09e667f3bcbp-1}, + {0x1.2d97c7f3321d3p1, -0x1.6a09e667f3bcfp-1, -0x1.6a09e667f3bcep-1}, + {-0x1.2d97c7f3321d3p1, -0x1.6a09e667f3bcfp-1, -0x1.6a09e667f3bcep-1}, + {0x1.f6a7a2955385dp1, -0x1.6a09e667f3bdp-1, -0x1.6a09e667f3bd1p-1}, + {-0x1.f6a7a2955385dp1, -0x1.6a09e667f3bdp-1, -0x1.6a09e667f3bd1p-1}, + {0x1.f6a7a2955385ep1, -0x1.6a09e667f3bcep-1, -0x1.6a09e667f3bcdp-1}, + {-0x1.f6a7a2955385ep1, -0x1.6a09e667f3bcep-1, -0x1.6a09e667f3bcdp-1}, + {0x1.f6a7a2955385fp1, -0x1.6a09e667f3bcbp-1, -0x1.6a09e667f3bcap-1}, + {-0x1.f6a7a2955385fp1, -0x1.6a09e667f3bcbp-1, -0x1.6a09e667f3bcap-1}, + {0x1.2d97c7f3321d1p2, -0x1.34f272993d141p-50, -0x1.34f272993d142p-50}, + {-0x1.2d97c7f3321d1p2, -0x1.34f272993d141p-50, -0x1.34f272993d142p-50}, + {0x1.2d97c7f3321d2p2, -0x1.a79394c9e8a0ap-53, -0x1.a79394c9e8a0bp-53}, + {-0x1.2d97c7f3321d2p2, -0x1.a79394c9e8a0ap-53, -0x1.a79394c9e8a0bp-53}, + {0x1.2d97c7f3321d3p2, 0x1.961b1acd85d7dp-51, 0x1.961b1acd85d7ep-51}, + {-0x1.2d97c7f3321d3p2, 0x1.961b1acd85d7dp-51, 0x1.961b1acd85d7ep-51}, + {0x1.5fdbbe9bba774p2, 0x1.6a09e667f3bc6p-1, 0x1.6a09e667f3bc5p-1}, + {-0x1.5fdbbe9bba774p2, 0x1.6a09e667f3bc6p-1, 0x1.6a09e667f3bc5p-1}, + {0x1.5fdbbe9bba775p2, 0x1.6a09e667f3bcbp-1, 0x1.6a09e667f3bccp-1}, + {-0x1.5fdbbe9bba775p2, 0x1.6a09e667f3bcbp-1, 0x1.6a09e667f3bccp-1}, + {0x1.5fdbbe9bba776p2, 0x1.6a09e667f3bd1p-1, 0x1.6a09e667f3bdp-1}, + {-0x1.5fdbbe9bba776p2, 0x1.6a09e667f3bd1p-1, 0x1.6a09e667f3bdp-1}, + {0x1.c463abeccb2bap2, 0x1.6a09e667f3bd4p-1, 0x1.6a09e667f3bd3p-1}, + {-0x1.c463abeccb2bap2, 0x1.6a09e667f3bd4p-1, 0x1.6a09e667f3bd3p-1}, + {0x1.c463abeccb2bbp2, 0x1.6a09e667f3bcep-1, 0x1.6a09e667f3bcfp-1}, + {-0x1.c463abeccb2bbp2, 0x1.6a09e667f3bcep-1, 0x1.6a09e667f3bcfp-1}, + {0x1.c463abeccb2bcp2, 0x1.6a09e667f3bc9p-1, 0x1.6a09e667f3bc8p-1}, + {-0x1.c463abeccb2bcp2, 0x1.6a09e667f3bc9p-1, 0x1.6a09e667f3bc8p-1}, + {0x1.f6a7a2955385dp2, 0x1.583ebeff65cc2p-50, 0x1.583ebeff65cc3p-50}, + {-0x1.f6a7a2955385dp2, 0x1.583ebeff65cc2p-50, 0x1.583ebeff65cc3p-50}, + {0x1.f6a7a2955385ep2, 0x1.60fafbfd97309p-52, 0x1.60fafbfd97308p-52}, + {-0x1.f6a7a2955385ep2, 0x1.60fafbfd97309p-52, 0x1.60fafbfd97308p-52}, + {0x1.f6a7a2955385fp2, -0x1.4f8282013467cp-51, -0x1.4f8282013467bp-51}, + {-0x1.f6a7a2955385fp2, -0x1.4f8282013467cp-51, -0x1.4f8282013467bp-51}, + {0x1.1475cc9eedeffp3, -0x1.6a09e667f3bb9p-1, -0x1.6a09e667f3bbap-1}, + {-0x1.1475cc9eedeffp3, -0x1.6a09e667f3bb9p-1, -0x1.6a09e667f3bbap-1}, + {0x1.1475cc9eedfp3, -0x1.6a09e667f3bc5p-1, -0x1.6a09e667f3bc4p-1}, + {-0x1.1475cc9eedfp3, -0x1.6a09e667f3bc5p-1, -0x1.6a09e667f3bc4p-1}, + {0x1.1475cc9eedf01p3, -0x1.6a09e667f3bdp-1, -0x1.6a09e667f3bd1p-1}, + {-0x1.1475cc9eedf01p3, -0x1.6a09e667f3bdp-1, -0x1.6a09e667f3bd1p-1}, + {0x1.2d97c7f3321d1p3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.2d97c7f3321d1p3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.2d97c7f3321d2p3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.2d97c7f3321d2p3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.2d97c7f3321d3p3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.2d97c7f3321d3p3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.46b9c347764a2p3, -0x1.6a09e667f3bep-1, -0x1.6a09e667f3be1p-1}, + {-0x1.46b9c347764a2p3, -0x1.6a09e667f3bep-1, -0x1.6a09e667f3be1p-1}, + {0x1.46b9c347764a3p3, -0x1.6a09e667f3bd5p-1, -0x1.6a09e667f3bd4p-1}, + {-0x1.46b9c347764a3p3, -0x1.6a09e667f3bd5p-1, -0x1.6a09e667f3bd4p-1}, + {0x1.46b9c347764a4p3, -0x1.6a09e667f3bc9p-1, -0x1.6a09e667f3bcap-1}, + {-0x1.46b9c347764a4p3, -0x1.6a09e667f3bc9p-1, -0x1.6a09e667f3bcap-1}, + {0x1.5fdbbe9bba774p3, -0x1.3dc585b2c7422p-49, -0x1.3dc585b2c7421p-49}, + {-0x1.5fdbbe9bba774p3, -0x1.3dc585b2c7422p-49, -0x1.3dc585b2c7421p-49}, + {0x1.5fdbbe9bba775p3, -0x1.ee2c2d963a10cp-52, -0x1.ee2c2d963a10dp-52}, + {-0x1.5fdbbe9bba775p3, -0x1.ee2c2d963a10cp-52, -0x1.ee2c2d963a10dp-52}, + {0x1.5fdbbe9bba776p3, 0x1.8474f49a717bdp-50, 0x1.8474f49a717bcp-50}, + {-0x1.5fdbbe9bba776p3, 0x1.8474f49a717bdp-50, 0x1.8474f49a717bcp-50}, + {0x1.78fdb9effea45p3, 0x1.6a09e667f3bb9p-1, 0x1.6a09e667f3bb8p-1}, + {-0x1.78fdb9effea45p3, 0x1.6a09e667f3bb9p-1, 0x1.6a09e667f3bb8p-1}, + {0x1.78fdb9effea46p3, 0x1.6a09e667f3bc4p-1, 0x1.6a09e667f3bc3p-1}, + {-0x1.78fdb9effea46p3, 0x1.6a09e667f3bc4p-1, 0x1.6a09e667f3bc3p-1}, + {0x1.78fdb9effea47p3, 0x1.6a09e667f3bcfp-1, 0x1.6a09e667f3bdp-1}, + {-0x1.78fdb9effea47p3, 0x1.6a09e667f3bcfp-1, 0x1.6a09e667f3bdp-1}, + {0x1.ab41b09886fe8p3, 0x1.6a09e667f3be1p-1, 0x1.6a09e667f3bep-1}, + {-0x1.ab41b09886fe8p3, 0x1.6a09e667f3be1p-1, 0x1.6a09e667f3bep-1}, + {0x1.ab41b09886fe9p3, 0x1.6a09e667f3bd6p-1, 0x1.6a09e667f3bd5p-1}, + {-0x1.ab41b09886fe9p3, 0x1.6a09e667f3bd6p-1, 0x1.6a09e667f3bd5p-1}, + {0x1.ab41b09886feap3, 0x1.6a09e667f3bcap-1, 0x1.6a09e667f3bcbp-1}, + {-0x1.ab41b09886feap3, 0x1.6a09e667f3bcap-1, 0x1.6a09e667f3bcbp-1}, + {0x1.c463abeccb2bap3, 0x1.4f6babe5db9e2p-49, 0x1.4f6babe5db9e1p-49}, + {-0x1.c463abeccb2bap3, 0x1.4f6babe5db9e2p-49, 0x1.4f6babe5db9e1p-49}, + {0x1.c463abeccb2bbp3, 0x1.3daeaf976e788p-51, 0x1.3daeaf976e787p-51}, + {-0x1.c463abeccb2bbp3, 0x1.3daeaf976e788p-51, 0x1.3daeaf976e787p-51}, + {0x1.c463abeccb2bcp3, -0x1.6128a83448c3cp-50, -0x1.6128a83448c3dp-50}, + {-0x1.c463abeccb2bcp3, -0x1.6128a83448c3cp-50, -0x1.6128a83448c3dp-50}, + {0x1.dd85a7410f58bp3, -0x1.6a09e667f3bb8p-1, -0x1.6a09e667f3bb7p-1}, + {-0x1.dd85a7410f58bp3, -0x1.6a09e667f3bb8p-1, -0x1.6a09e667f3bb7p-1}, + {0x1.dd85a7410f58cp3, -0x1.6a09e667f3bc3p-1, -0x1.6a09e667f3bc4p-1}, + {-0x1.dd85a7410f58cp3, -0x1.6a09e667f3bc3p-1, -0x1.6a09e667f3bc4p-1}, + {0x1.dd85a7410f58dp3, -0x1.6a09e667f3bcep-1, -0x1.6a09e667f3bcfp-1}, + {-0x1.dd85a7410f58dp3, -0x1.6a09e667f3bcep-1, -0x1.6a09e667f3bcfp-1}, + {0x1.f6a7a2955385dp3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.f6a7a2955385dp3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.f6a7a2955385ep3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.f6a7a2955385ep3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.f6a7a2955385fp3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.f6a7a2955385fp3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.07e4cef4cbd96p4, -0x1.6a09e667f3bf8p-1, -0x1.6a09e667f3bf9p-1}, + {-0x1.07e4cef4cbd96p4, -0x1.6a09e667f3bf8p-1, -0x1.6a09e667f3bf9p-1}, + {0x1.07e4cef4cbd97p4, -0x1.6a09e667f3be2p-1, -0x1.6a09e667f3be1p-1}, + {-0x1.07e4cef4cbd97p4, -0x1.6a09e667f3be2p-1, -0x1.6a09e667f3be1p-1}, + {0x1.07e4cef4cbd98p4, -0x1.6a09e667f3bcbp-1, -0x1.6a09e667f3bccp-1}, + {-0x1.07e4cef4cbd98p4, -0x1.6a09e667f3bcbp-1, -0x1.6a09e667f3bccp-1}, + {0x1.1475cc9eedeffp4, -0x1.b088e90c77fd1p-48, -0x1.b088e90c77fd2p-48}, + {-0x1.1475cc9eedeffp4, -0x1.b088e90c77fd1p-48, -0x1.b088e90c77fd2p-48}, + {0x1.1475cc9eedfp4, -0x1.6111d218effa2p-49, -0x1.6111d218effa3p-49}, + {-0x1.1475cc9eedfp4, -0x1.6111d218effa2p-49, -0x1.6111d218effa3p-49}, + {0x1.1475cc9eedf01p4, 0x1.3ddc5bce200bbp-50, 0x1.3ddc5bce200bcp-50}, + {-0x1.1475cc9eedf01p4, 0x1.3ddc5bce200bbp-50, 0x1.3ddc5bce200bcp-50}, + {0x1.2106ca4910068p4, 0x1.6a09e667f3bacp-1, 0x1.6a09e667f3babp-1}, + {-0x1.2106ca4910068p4, 0x1.6a09e667f3bacp-1, 0x1.6a09e667f3babp-1}, + {0x1.2106ca4910069p4, 0x1.6a09e667f3bc3p-1, 0x1.6a09e667f3bc2p-1}, + {-0x1.2106ca4910069p4, 0x1.6a09e667f3bc3p-1, 0x1.6a09e667f3bc2p-1}, + {0x1.2106ca491006ap4, 0x1.6a09e667f3bd9p-1, 0x1.6a09e667f3bdap-1}, + {-0x1.2106ca491006ap4, 0x1.6a09e667f3bd9p-1, 0x1.6a09e667f3bdap-1}, + {0x1.2d97c7f3321d1p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.2d97c7f3321d1p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.2d97c7f3321d2p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.2d97c7f3321d2p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.2d97c7f3321d3p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.2d97c7f3321d3p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.3a28c59d54339p4, 0x1.6a09e667f3bf9p-1, 0x1.6a09e667f3bfap-1}, + {-0x1.3a28c59d54339p4, 0x1.6a09e667f3bf9p-1, 0x1.6a09e667f3bfap-1}, + {0x1.3a28c59d5433ap4, 0x1.6a09e667f3be2p-1, 0x1.6a09e667f3be3p-1}, + {-0x1.3a28c59d5433ap4, 0x1.6a09e667f3be2p-1, 0x1.6a09e667f3be3p-1}, + {0x1.3a28c59d5433bp4, 0x1.6a09e667f3bccp-1, 0x1.6a09e667f3bcbp-1}, + {-0x1.3a28c59d5433bp4, 0x1.6a09e667f3bccp-1, 0x1.6a09e667f3bcbp-1}, + {0x1.46b9c347764a2p4, 0x1.b95bfc26022b1p-48, 0x1.b95bfc26022b2p-48}, + {-0x1.46b9c347764a2p4, 0x1.b95bfc26022b1p-48, 0x1.b95bfc26022b2p-48}, + {0x1.46b9c347764a3p4, 0x1.72b7f84c04563p-49, 0x1.72b7f84c04562p-49}, + {-0x1.46b9c347764a3p4, 0x1.72b7f84c04563p-49, 0x1.72b7f84c04562p-49}, + {0x1.46b9c347764a4p4, -0x1.1a900f67f753ap-50, -0x1.1a900f67f753bp-50}, + {-0x1.46b9c347764a4p4, -0x1.1a900f67f753ap-50, -0x1.1a900f67f753bp-50}, + {0x1.534ac0f19860bp4, -0x1.6a09e667f3babp-1, -0x1.6a09e667f3bacp-1}, + {-0x1.534ac0f19860bp4, -0x1.6a09e667f3babp-1, -0x1.6a09e667f3bacp-1}, + {0x1.534ac0f19860cp4, -0x1.6a09e667f3bc2p-1, -0x1.6a09e667f3bc1p-1}, + {-0x1.534ac0f19860cp4, -0x1.6a09e667f3bc2p-1, -0x1.6a09e667f3bc1p-1}, + {0x1.534ac0f19860dp4, -0x1.6a09e667f3bd8p-1, -0x1.6a09e667f3bd9p-1}, + {-0x1.534ac0f19860dp4, -0x1.6a09e667f3bd8p-1, -0x1.6a09e667f3bd9p-1}, + {0x1.5fdbbe9bba774p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.5fdbbe9bba774p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.5fdbbe9bba775p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.5fdbbe9bba775p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.5fdbbe9bba776p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.5fdbbe9bba776p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.6c6cbc45dc8dcp4, -0x1.6a09e667f3bfap-1, -0x1.6a09e667f3bf9p-1}, + {-0x1.6c6cbc45dc8dcp4, -0x1.6a09e667f3bfap-1, -0x1.6a09e667f3bf9p-1}, + {0x1.6c6cbc45dc8ddp4, -0x1.6a09e667f3be3p-1, -0x1.6a09e667f3be4p-1}, + {-0x1.6c6cbc45dc8ddp4, -0x1.6a09e667f3be3p-1, -0x1.6a09e667f3be4p-1}, + {0x1.6c6cbc45dc8dep4, -0x1.6a09e667f3bcdp-1, -0x1.6a09e667f3bccp-1}, + {-0x1.6c6cbc45dc8dep4, -0x1.6a09e667f3bcdp-1, -0x1.6a09e667f3bccp-1}, + {0x1.78fdb9effea45p4, -0x1.c22f0f3f8c592p-48, -0x1.c22f0f3f8c591p-48}, + {-0x1.78fdb9effea45p4, -0x1.c22f0f3f8c592p-48, -0x1.c22f0f3f8c591p-48}, + {0x1.78fdb9effea46p4, -0x1.845e1e7f18b23p-49, -0x1.845e1e7f18b24p-49}, + {-0x1.78fdb9effea46p4, -0x1.845e1e7f18b23p-49, -0x1.845e1e7f18b24p-49}, + {0x1.78fdb9effea47p4, 0x1.ee8786039d373p-51, 0x1.ee8786039d374p-51}, + {-0x1.78fdb9effea47p4, 0x1.ee8786039d373p-51, 0x1.ee8786039d374p-51}, + {0x1.858eb79a20baep4, 0x1.6a09e667f3baap-1, 0x1.6a09e667f3babp-1}, + {-0x1.858eb79a20baep4, 0x1.6a09e667f3baap-1, 0x1.6a09e667f3babp-1}, + {0x1.858eb79a20bafp4, 0x1.6a09e667f3bc1p-1, 0x1.6a09e667f3bcp-1}, + {-0x1.858eb79a20bafp4, 0x1.6a09e667f3bc1p-1, 0x1.6a09e667f3bcp-1}, + {0x1.858eb79a20bbp4, 0x1.6a09e667f3bd8p-1, 0x1.6a09e667f3bd7p-1}, + {-0x1.858eb79a20bbp4, 0x1.6a09e667f3bd8p-1, 0x1.6a09e667f3bd7p-1}, + {0x1.fffffffffffffp62, -0x1.2ccaf641d4262p-3, -0x1.2ccaf641d4261p-3}, + {-0x1.fffffffffffffp62, -0x1.2ccaf641d4262p-3, -0x1.2ccaf641d4261p-3}, + {0x1.0p63, 0x1.82aa375b3c33ep-7, 0x1.82aa375b3c33fp-7}, + {-0x1.0p63, 0x1.82aa375b3c33ep-7, 0x1.82aa375b3c33fp-7}, + {0x1.0000000000001p63, 0x1.4c0622a6e35dep-2, 0x1.4c0622a6e35ddp-2}, + {-0x1.0000000000001p63, 0x1.4c0622a6e35dep-2, 0x1.4c0622a6e35ddp-2}, + {0x1.fffffffffffffp26, 0x1.4ab650b8c6073p-1, 0x1.4ab650b8c6074p-1}, + {-0x1.fffffffffffffp26, 0x1.4ab650b8c6073p-1, 0x1.4ab650b8c6074p-1}, + {0x1.0p27, 0x1.4ab6511a7d39bp-1, 0x1.4ab6511a7d39ap-1}, + {-0x1.0p27, 0x1.4ab6511a7d39bp-1, 0x1.4ab6511a7d39ap-1}, + {0x1.0000000000001p27, 0x1.4ab651ddeb9e6p-1, 0x1.4ab651ddeb9e7p-1}, + {-0x1.0000000000001p27, 0x1.4ab651ddeb9e6p-1, 0x1.4ab651ddeb9e7p-1}, + {0x1.fffffffffffffp23, 0x1.40ad67e777b1ep-1, 0x1.40ad67e777b1dp-1}, + {-0x1.fffffffffffffp23, 0x1.40ad67e777b1ep-1, 0x1.40ad67e777b1dp-1}, + {0x1.0p24, 0x1.40ad67f3f0c9ap-1, 0x1.40ad67f3f0c9bp-1}, + {-0x1.0p24, 0x1.40ad67f3f0c9ap-1, 0x1.40ad67f3f0c9bp-1}, + {0x1.0000000000001p24, 0x1.40ad680ce2f92p-1, 0x1.40ad680ce2f93p-1}, + {-0x1.0000000000001p24, 0x1.40ad680ce2f92p-1, 0x1.40ad680ce2f93p-1}, + {0x1.fffffffffffffp1, -0x1.4eaa606db24c4p-1, -0x1.4eaa606db24c3p-1}, + {-0x1.fffffffffffffp1, -0x1.4eaa606db24c4p-1, -0x1.4eaa606db24c3p-1}, + {0x1.0p2, -0x1.4eaa606db24c1p-1, -0x1.4eaa606db24cp-1}, + {-0x1.0p2, -0x1.4eaa606db24c1p-1, -0x1.4eaa606db24cp-1}, + {0x1.0000000000001p2, -0x1.4eaa606db24bbp-1, -0x1.4eaa606db24bap-1}, + {-0x1.0000000000001p2, -0x1.4eaa606db24bbp-1, -0x1.4eaa606db24bap-1}, + {0x1.fffffffffffffp0, -0x1.aa22657537201p-2, -0x1.aa22657537202p-2}, + {-0x1.fffffffffffffp0, -0x1.aa22657537201p-2, -0x1.aa22657537202p-2}, + {0x1.0p1, -0x1.aa22657537205p-2, -0x1.aa22657537204p-2}, + {-0x1.0p1, -0x1.aa22657537205p-2, -0x1.aa22657537204p-2}, + {0x1.0000000000001p1, -0x1.aa2265753720cp-2, -0x1.aa2265753720bp-2}, + {-0x1.0000000000001p1, -0x1.aa2265753720cp-2, -0x1.aa2265753720bp-2}, + {0x1.fffffffffffffp-1, 0x1.14a280fb5068cp-1, 0x1.14a280fb5068dp-1}, + {-0x1.fffffffffffffp-1, 0x1.14a280fb5068cp-1, 0x1.14a280fb5068dp-1}, + {0x1.0p0, 0x1.14a280fb5068cp-1, 0x1.14a280fb5068bp-1}, + {-0x1.0p0, 0x1.14a280fb5068cp-1, 0x1.14a280fb5068bp-1}, + {0x1.0000000000001p0, 0x1.14a280fb5068ap-1, 0x1.14a280fb50689p-1}, + {-0x1.0000000000001p0, 0x1.14a280fb5068ap-1, 0x1.14a280fb50689p-1}, + {0x1.fffffffffffffp-2, 0x1.c1528065b7d5p-1, 0x1.c1528065b7d4fp-1}, + {-0x1.fffffffffffffp-2, 0x1.c1528065b7d5p-1, 0x1.c1528065b7d4fp-1}, + {0x1.0p-1, 0x1.c1528065b7d5p-1, 0x1.c1528065b7d4fp-1}, + {-0x1.0p-1, 0x1.c1528065b7d5p-1, 0x1.c1528065b7d4fp-1}, + {0x1.0000000000001p-1, 0x1.c1528065b7d4fp-1, 0x1.c1528065b7d5p-1}, + {-0x1.0000000000001p-1, 0x1.c1528065b7d4fp-1, 0x1.c1528065b7d5p-1}, + {0x1.fffffffffffffp-3, 0x1.f01549f7deea2p-1, 0x1.f01549f7deea1p-1}, + {-0x1.fffffffffffffp-3, 0x1.f01549f7deea2p-1, 0x1.f01549f7deea1p-1}, + {0x1.0p-2, 0x1.f01549f7deea1p-1, 0x1.f01549f7deea2p-1}, + {-0x1.0p-2, 0x1.f01549f7deea1p-1, 0x1.f01549f7deea2p-1}, + {0x1.0000000000001p-2, 0x1.f01549f7deea1p-1, 0x1.f01549f7deea2p-1}, + {-0x1.0000000000001p-2, 0x1.f01549f7deea1p-1, 0x1.f01549f7deea2p-1}, + {0x1.fffffffffffffp-4, 0x1.fc015527d5bd3p-1, 0x1.fc015527d5bd4p-1}, + {-0x1.fffffffffffffp-4, 0x1.fc015527d5bd3p-1, 0x1.fc015527d5bd4p-1}, + {0x1.0p-3, 0x1.fc015527d5bd3p-1, 0x1.fc015527d5bd4p-1}, + {-0x1.0p-3, 0x1.fc015527d5bd3p-1, 0x1.fc015527d5bd4p-1}, + {0x1.0000000000001p-3, 0x1.fc015527d5bd3p-1, 0x1.fc015527d5bd4p-1}, + {-0x1.0000000000001p-3, 0x1.fc015527d5bd3p-1, 0x1.fc015527d5bd4p-1}, + {0x1.fffffffffffffp-5, 0x1.ff0015549f4d3p-1, 0x1.ff0015549f4d4p-1}, + {-0x1.fffffffffffffp-5, 0x1.ff0015549f4d3p-1, 0x1.ff0015549f4d4p-1}, + {0x1.0p-4, 0x1.ff0015549f4d3p-1, 0x1.ff0015549f4d4p-1}, + {-0x1.0p-4, 0x1.ff0015549f4d3p-1, 0x1.ff0015549f4d4p-1}, + {0x1.0000000000001p-4, 0x1.ff0015549f4d3p-1, 0x1.ff0015549f4d4p-1}, + {-0x1.0000000000001p-4, 0x1.ff0015549f4d3p-1, 0x1.ff0015549f4d4p-1}, + {0x1.fffffffffffffp-6, 0x1.ffc00155527d3p-1, 0x1.ffc00155527d2p-1}, + {-0x1.fffffffffffffp-6, 0x1.ffc00155527d3p-1, 0x1.ffc00155527d2p-1}, + {0x1.0p-5, 0x1.ffc00155527d3p-1, 0x1.ffc00155527d2p-1}, + {-0x1.0p-5, 0x1.ffc00155527d3p-1, 0x1.ffc00155527d2p-1}, + {0x1.0000000000001p-5, 0x1.ffc00155527d3p-1, 0x1.ffc00155527d2p-1}, + {-0x1.0000000000001p-5, 0x1.ffc00155527d3p-1, 0x1.ffc00155527d2p-1}, + {0x1.fffffffffffffp-7, 0x1.fff000155549fp-1, 0x1.fff00015554ap-1}, + {-0x1.fffffffffffffp-7, 0x1.fff000155549fp-1, 0x1.fff00015554ap-1}, + {0x1.0p-6, 0x1.fff000155549fp-1, 0x1.fff00015554ap-1}, + {-0x1.0p-6, 0x1.fff000155549fp-1, 0x1.fff00015554ap-1}, + {0x1.0000000000001p-6, 0x1.fff000155549fp-1, 0x1.fff00015554ap-1}, + {-0x1.0000000000001p-6, 0x1.fff000155549fp-1, 0x1.fff00015554ap-1}, + {0x1.fffffffffffffp-15, 0x1.fffffffp-1, 0x1.fffffff000001p-1}, + {-0x1.fffffffffffffp-15, 0x1.fffffffp-1, 0x1.fffffff000001p-1}, + {0x1.0p-14, 0x1.fffffffp-1, 0x1.fffffff000001p-1}, + {-0x1.0p-14, 0x1.fffffffp-1, 0x1.fffffff000001p-1}, + {0x1.0000000000001p-14, 0x1.fffffffp-1, 0x1.fffffff000001p-1}, + {-0x1.0000000000001p-14, 0x1.fffffffp-1, 0x1.fffffff000001p-1}, + {0x1.fffffffffffffp-28, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.fffffffffffffp-28, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.0p-27, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.0p-27, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.0000000000001p-27, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.0000000000001p-27, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.fffffffffffffp-31, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.fffffffffffffp-31, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.0p-30, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.0p-30, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.0000000000001p-30, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.0000000000001p-30, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.fffffffffffffp1023, -0x1.fffe62ecfab75p-1, -0x1.fffe62ecfab76p-1}, + {0x1.fffffffffffffp1023, -0x1.fffe62ecfab75p-1, -0x1.fffe62ecfab76p-1}, + {0x1.fffffffffffffp1023, -0x1.fffe62ecfab75p-1, -0x1.fffe62ecfab76p-1}, + {-0x1.fffffffffffffp1023, -0x1.fffe62ecfab75p-1, -0x1.fffe62ecfab76p-1}, + {0x1.fffffffffffffp1023, -0x1.fffe62ecfab75p-1, -0x1.fffe62ecfab76p-1}, + {-0x1.fffffffffffffp1023, -0x1.fffe62ecfab75p-1, -0x1.fffe62ecfab76p-1}, + {0x1.ffffffffffffep1023, 0x1.7ffdfb4c5309p-2, 0x1.7ffdfb4c5308fp-2}, + {-0x1.ffffffffffffep1023, 0x1.7ffdfb4c5309p-2, 0x1.7ffdfb4c5308fp-2}, + {0x1.921fb54442d18p1, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p1, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.921fb54442d18p0, 0x1.1a62633145c07p-54, 0x1.1a62633145c06p-54}, + {-0x1.921fb54442d18p0, 0x1.1a62633145c07p-54, 0x1.1a62633145c06p-54}, + {0x1.0000000000001p0, 0x1.14a280fb5068ap-1, 0x1.14a280fb50689p-1}, + {-0x1.0000000000001p0, 0x1.14a280fb5068ap-1, 0x1.14a280fb50689p-1}, + {0x1.0p0, 0x1.14a280fb5068cp-1, 0x1.14a280fb5068bp-1}, + {-0x1.0p0, 0x1.14a280fb5068cp-1, 0x1.14a280fb5068bp-1}, + {0x1.fffffffffffffp-1, 0x1.14a280fb5068cp-1, 0x1.14a280fb5068dp-1}, + {-0x1.fffffffffffffp-1, 0x1.14a280fb5068cp-1, 0x1.14a280fb5068dp-1}, + {0x1.921fb54442d18p-1, 0x1.6a09e667f3bcdp-1, 0x1.6a09e667f3bccp-1}, + {-0x1.921fb54442d18p-1, 0x1.6a09e667f3bcdp-1, 0x1.6a09e667f3bccp-1}, + {0x1.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x1.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {0x1.0p-1022, 0x1.0p0, 0x1.0p0}, + {-0x1.0p-1022, 0x1.0p0, 0x1.0p0}, + {0x0.fffffffffffffp-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.fffffffffffffp-1022, 0x1.0p0, 0x1.0p0}, + {0x0.ffffffffffffep-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.ffffffffffffep-1022, 0x1.0p0, 0x1.0p0}, + {0x0.0000000000002p-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.0000000000002p-1022, 0x1.0p0, 0x1.0p0}, + {0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {0x0.0p0, 0x1.0p0, 0x1.0p0}, + {-0x0.0p0, 0x1.0p0, 0x1.0p0} + }; + + for(double[] testCase: testCases) { + failures += testCosCase(testCase[0], testCase[1], testCase[2]); + } + + return failures; + } + + private static int testCosCase(double input, double bound1, double bound2) { + int failures = 0; + failures += Tests.testBounds("Math.cos", input, Math.cos(input), bound1, bound2); + return failures; + } +} diff --git a/jdk/test/java/lang/String/concat/CompactStringsInitialCoder.java b/jdk/test/java/lang/String/concat/CompactStringsInitialCoder.java new file mode 100644 index 00000000000..6f566c33eb9 --- /dev/null +++ b/jdk/test/java/lang/String/concat/CompactStringsInitialCoder.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2016, 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @summary StringConcatFactory MH_INLINE_SIZED_EXACT strategy does not work with -XX:-CompactStrings + * @bug 8148869 + * + * @compile -XDstringConcat=indy -source 1.9 -target 1.9 CompactStringsInitialCoder.java + * + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -XX:+CompactStrings CompactStringsInitialCoder + * + * @compile -XDstringConcat=indyWithConstants -source 1.9 -target 1.9 CompactStringsInitialCoder.java + * + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -XX:+CompactStrings CompactStringsInitialCoder + * + * @compile -XDstringConcat=indy -source 1.9 -target 1.9 CompactStringsInitialCoder.java + * + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -XX:-CompactStrings CompactStringsInitialCoder + * + * @compile -XDstringConcat=indyWithConstants -source 1.9 -target 1.9 CompactStringsInitialCoder.java + * + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -XX:-CompactStrings CompactStringsInitialCoder +*/ +import java.lang.StringBuilder; + +public class CompactStringsInitialCoder { + + static String strEmpty = ""; + static String strLatin1 = "\u0042"; + static String strUTF16 = "\u4242"; + static char charLatin1 = '\u0042'; + static char charUTF16 = '\u4242'; + + public static void main(String[] args) throws Exception { + test("\u0042", "" + '\u0042'); + test("\u4242", "" + '\u4242'); + + test("\u0042", "" + charLatin1); + test("\u4242", "" + charUTF16); + + test("\u0042", strEmpty + '\u0042'); + test("\u4242", strEmpty + '\u4242'); + + test("\u0042\u0042", strLatin1 + '\u0042'); + test("\u0042\u4242", strLatin1 + '\u4242'); + test("\u4242\u0042", strUTF16 + '\u0042'); + test("\u4242\u4242", strUTF16 + '\u4242'); + + test("\u0042\u0042", "\u0042" + charLatin1); + test("\u0042\u4242", "\u0042" + charUTF16); + test("\u4242\u0042", "\u4242" + charLatin1); + test("\u4242\u4242", "\u4242" + charUTF16); + + test("\u0042\u0042", "" + charLatin1 + charLatin1); + test("\u0042\u4242", "" + charLatin1 + charUTF16); + test("\u4242\u0042", "" + charUTF16 + charLatin1); + test("\u4242\u4242", "" + charUTF16 + charUTF16); + } + + public static void test(String expected, String actual) { + if (!expected.equals(actual)) { + StringBuilder sb = new StringBuilder(); + sb.append("Expected = "); + sb.append(expected); + sb.append(", actual = "); + sb.append(actual); + throw new IllegalStateException(sb.toString()); + } + } + + +} diff --git a/jdk/test/java/lang/String/concat/ImplicitStringConcat.java b/jdk/test/java/lang/String/concat/ImplicitStringConcat.java index 5eb78602498..f0ef90d02db 100644 --- a/jdk/test/java/lang/String/concat/ImplicitStringConcat.java +++ b/jdk/test/java/lang/String/concat/ImplicitStringConcat.java @@ -26,70 +26,70 @@ * @summary test implicit String concatenations * * @compile ImplicitStringConcat.java - * @run main/othervm ImplicitStringConcat + * @run main/othervm -Xverify:all ImplicitStringConcat * * @compile -XDstringConcat=inline ImplicitStringConcat.java - * @run main/othervm ImplicitStringConcat + * @run main/othervm -Xverify:all ImplicitStringConcat * * @compile -XDstringConcat=indy -source 1.9 -target 1.9 ImplicitStringConcat.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcat * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat * * @compile -XDstringConcat=indyWithConstants -source 1.9 -target 1.9 ImplicitStringConcat.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcat * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat */ import java.lang.StringBuilder; diff --git a/jdk/test/java/lang/String/concat/ImplicitStringConcatArgCount.java b/jdk/test/java/lang/String/concat/ImplicitStringConcatArgCount.java index 0cc0a2a7887..108cce0b23b 100644 --- a/jdk/test/java/lang/String/concat/ImplicitStringConcatArgCount.java +++ b/jdk/test/java/lang/String/concat/ImplicitStringConcatArgCount.java @@ -26,70 +26,70 @@ * @summary Test multiple number of arguments to concatenate. * * @compile ImplicitStringConcatArgCount.java - * @run main/othervm ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all ImplicitStringConcatArgCount * * @compile -XDallowStringFolding=false -XDstringConcat=inline ImplicitStringConcatArgCount.java - * @run main/othervm ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all ImplicitStringConcatArgCount * * @compile -XDallowStringFolding=false -XDstringConcat=indy -source 1.9 -target 1.9 ImplicitStringConcatArgCount.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatArgCount * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount * * @compile -XDallowStringFolding=false -XDstringConcat=indyWithConstants -source 1.9 -target 1.9 ImplicitStringConcatArgCount.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatArgCount * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount */ public class ImplicitStringConcatArgCount { static final String s = "f"; diff --git a/jdk/test/java/lang/String/concat/ImplicitStringConcatBoundaries.java b/jdk/test/java/lang/String/concat/ImplicitStringConcatBoundaries.java index f8e677b12bb..0ae6137e9fe 100644 --- a/jdk/test/java/lang/String/concat/ImplicitStringConcatBoundaries.java +++ b/jdk/test/java/lang/String/concat/ImplicitStringConcatBoundaries.java @@ -26,70 +26,70 @@ * @summary Test the boundary values for concatenation arguments. * * @compile ImplicitStringConcatBoundaries.java - * @run main/othervm ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all ImplicitStringConcatBoundaries * * @compile -XDstringConcat=inline ImplicitStringConcatBoundaries.java - * @run main/othervm ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all ImplicitStringConcatBoundaries * * @compile -XDstringConcat=indy -source 1.9 -target 1.9 ImplicitStringConcatBoundaries.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatBoundaries * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries * * @compile -XDstringConcat=indyWithConstants -source 1.9 -target 1.9 ImplicitStringConcatBoundaries.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatBoundaries * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries */ diff --git a/jdk/test/java/lang/String/concat/ImplicitStringConcatMany.java b/jdk/test/java/lang/String/concat/ImplicitStringConcatMany.java index 7af7e7d5e05..00780b0758a 100644 --- a/jdk/test/java/lang/String/concat/ImplicitStringConcatMany.java +++ b/jdk/test/java/lang/String/concat/ImplicitStringConcatMany.java @@ -26,70 +26,70 @@ * @summary Test implicit String concatenations with lots of arguments. * * @compile ImplicitStringConcatMany.java - * @run main/othervm ImplicitStringConcatMany + * @run main/othervm -Xverify:all ImplicitStringConcatMany * * @compile -XDstringConcat=inline ImplicitStringConcatMany.java - * @run main/othervm ImplicitStringConcatMany + * @run main/othervm -Xverify:all ImplicitStringConcatMany * * @compile -XDstringConcat=indy -source 1.9 -target 1.9 ImplicitStringConcatMany.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatMany * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany * * @compile -XDstringConcat=indyWithConstants -source 1.9 -target 1.9 ImplicitStringConcatMany.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatMany * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany */ import java.lang.reflect.Field; diff --git a/jdk/test/java/lang/String/concat/ImplicitStringConcatManyLongs.java b/jdk/test/java/lang/String/concat/ImplicitStringConcatManyLongs.java index cc14a100cec..bea78ca8693 100644 --- a/jdk/test/java/lang/String/concat/ImplicitStringConcatManyLongs.java +++ b/jdk/test/java/lang/String/concat/ImplicitStringConcatManyLongs.java @@ -26,70 +26,70 @@ * @summary Test implicit String concatenations with lots of arguments (two-slot version) * * @compile ImplicitStringConcatManyLongs.java - * @run main/othervm ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all ImplicitStringConcatManyLongs * * @compile -XDstringConcat=inline ImplicitStringConcatManyLongs.java - * @run main/othervm ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all ImplicitStringConcatManyLongs * * @compile -XDstringConcat=indy -source 1.9 -target 1.9 ImplicitStringConcatManyLongs.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatManyLongs * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs * * @compile -XDstringConcat=indyWithConstants -source 1.9 -target 1.9 ImplicitStringConcatManyLongs.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatManyLongs * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs */ import java.lang.reflect.Field; diff --git a/jdk/test/java/lang/String/concat/ImplicitStringConcatShapes-head.template b/jdk/test/java/lang/String/concat/ImplicitStringConcatShapes-head.template index 10fd57f0616..f832cef1f03 100644 --- a/jdk/test/java/lang/String/concat/ImplicitStringConcatShapes-head.template +++ b/jdk/test/java/lang/String/concat/ImplicitStringConcatShapes-head.template @@ -26,70 +26,70 @@ * @summary Test implicit String concatenations, multiple shapes. * * @compile ImplicitStringConcatShapes.java - * @run main/othervm ImplicitStringConcatShapes + * @run main/othervm -Xverify:all ImplicitStringConcatShapes * * @compile -XDstringConcat=inline ImplicitStringConcatShapes.java - * @run main/othervm ImplicitStringConcatShapes + * @run main/othervm -Xverify:all ImplicitStringConcatShapes * * @compile -XDstringConcat=indy -source 1.9 -target 1.9 ImplicitStringConcatShapes.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes * * @compile -XDstringConcat=indyWithConstants -source 1.9 -target 1.9 ImplicitStringConcatShapes.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes */ public class ImplicitStringConcatShapes { public static void test(String expected, String actual) { diff --git a/jdk/test/java/lang/String/concat/ImplicitStringConcatShapes.java b/jdk/test/java/lang/String/concat/ImplicitStringConcatShapes.java index c4a673721ae..5ed9d863810 100644 --- a/jdk/test/java/lang/String/concat/ImplicitStringConcatShapes.java +++ b/jdk/test/java/lang/String/concat/ImplicitStringConcatShapes.java @@ -26,70 +26,70 @@ * @summary Test implicit String concatenations, multiple shapes. * * @compile ImplicitStringConcatShapes.java - * @run main/othervm ImplicitStringConcatShapes + * @run main/othervm -Xverify:all ImplicitStringConcatShapes * * @compile -XDstringConcat=inline ImplicitStringConcatShapes.java - * @run main/othervm ImplicitStringConcatShapes + * @run main/othervm -Xverify:all ImplicitStringConcatShapes * * @compile -XDstringConcat=indy -source 1.9 -target 1.9 ImplicitStringConcatShapes.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes * * @compile -XDstringConcat=indyWithConstants -source 1.9 -target 1.9 ImplicitStringConcatShapes.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes */ public class ImplicitStringConcatShapes { public static void test(String expected, String actual) { diff --git a/jdk/test/java/lang/String/concat/StringConcatFactoryEmptyMethods.java b/jdk/test/java/lang/String/concat/StringConcatFactoryEmptyMethods.java new file mode 100644 index 00000000000..31b29cd30fd --- /dev/null +++ b/jdk/test/java/lang/String/concat/StringConcatFactoryEmptyMethods.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2016, 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.Serializable; +import java.lang.invoke.*; +import java.util.concurrent.Callable; + +/** + * @test + * @summary StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested + * @bug 8148787 + * + * @compile StringConcatFactoryEmptyMethods.java + * + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryEmptyMethods + * +*/ +public class StringConcatFactoryEmptyMethods { + + public static void main(String[] args) throws Throwable { + StringConcatFactory.makeConcat( + MethodHandles.lookup(), + "foo", + MethodType.methodType(String.class) + ); + + StringConcatFactory.makeConcatWithConstants( + MethodHandles.lookup(), + "foo", + MethodType.methodType(String.class), + "" + ); + } + +} diff --git a/jdk/test/java/lang/String/concat/StringConcatFactoryInvariants.java b/jdk/test/java/lang/String/concat/StringConcatFactoryInvariants.java index e1a3e8085c6..a174e3e4ffe 100644 --- a/jdk/test/java/lang/String/concat/StringConcatFactoryInvariants.java +++ b/jdk/test/java/lang/String/concat/StringConcatFactoryInvariants.java @@ -31,33 +31,33 @@ import java.util.concurrent.Callable; * * @compile StringConcatFactoryInvariants.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT StringConcatFactoryInvariants * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants * */ public class StringConcatFactoryInvariants { diff --git a/jdk/test/java/lang/ref/CleanerTest.java b/jdk/test/java/lang/ref/CleanerTest.java index fedcaf88713..396fbed88bd 100644 --- a/jdk/test/java/lang/ref/CleanerTest.java +++ b/jdk/test/java/lang/ref/CleanerTest.java @@ -41,14 +41,17 @@ import jdk.internal.ref.CleanerFactory; import sun.hotspot.WhiteBox; +import jdk.test.lib.Utils; + import org.testng.Assert; import org.testng.TestNG; import org.testng.annotations.Test; /* * @test - * @library /lib/testlibrary /test/lib + * @library /test/lib/share/classes /lib/testlibrary /test/lib * @build sun.hotspot.WhiteBox + * @build jdk.test.lib.Utils * @modules java.base/jdk.internal.misc java.base/jdk.internal.ref * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run testng/othervm @@ -88,8 +91,7 @@ public class CleanerTest { CleanableCase s = setupPhantom(COMMON, cleaner); cleaner = null; - Assert.assertTrue(checkCleaned(s.getSemaphore()), - "Cleaner cleanup should have occurred"); + checkCleaned(s.getSemaphore(), true, "Cleaner was cleaned:"); } /** @@ -124,8 +126,7 @@ public class CleanerTest { CleanableCase s = setupPhantom(COMMON, cleaner); cleaner = null; - Assert.assertTrue(checkCleaned(s.getSemaphore()), - "Cleaner cleanup should have occurred"); + checkCleaned(s.getSemaphore(), true, "Cleaner was cleaned:"); } /** @@ -213,16 +214,11 @@ public class CleanerTest { CleanableCase cc = setupPhantom(COMMON, test.getCleanable()); test.clearCleanable(); // release this hard reference - boolean result = checkCleaned(test.getSemaphore()); - if (result) { - Assert.assertEquals(r, CleanableCase.EV_CLEAN, - "cleaned; but not expected"); - } else { - Assert.assertNotEquals(r, CleanableCase.EV_CLEAN, - "not cleaned; expected cleaning"); - } - Assert.assertTrue(checkCleaned(cc.getSemaphore()), - "The reference to the Cleanable should have been freed"); + checkCleaned(test.getSemaphore(), + r == CleanableCase.EV_CLEAN, + "Cleanable was cleaned:"); + checkCleaned(cc.getSemaphore(), true, + "The reference to the Cleanable was freed:"); } /** @@ -278,27 +274,32 @@ public class CleanerTest { * Check a semaphore having been released by cleanup handler. * Force a number of GC cycles to give the GC a chance to process * the Reference and for the cleanup action to be run. + * Use a larger number of cycles to wait for an expected cleaning to occur. * * @param semaphore a Semaphore - * @return true if the semaphores has 1 permit, false otherwise. + * @param expectCleaned true if cleaning should occur + * @param msg a message to explain the error */ - static boolean checkCleaned(Semaphore semaphore) { - int cycle = 0; - for (; cycle < 3; cycle++) { + static void checkCleaned(Semaphore semaphore, boolean expectCleaned, + String msg) { + long max_cycles = expectCleaned ? 10 : 3; + long cycle = 0; + for (; cycle < max_cycles; cycle++) { + // Force GC + whitebox.fullGC(); + try { - if (semaphore.tryAcquire(10L, TimeUnit.MILLISECONDS)) { + if (semaphore.tryAcquire(Utils.adjustTimeout(10L), TimeUnit.MILLISECONDS)) { System.out.printf(" Cleanable cleaned in cycle: %d%n", cycle); - return true; + Assert.assertEquals(true, expectCleaned, msg); + return; } } catch (InterruptedException ie) { // retry in outer loop } - // Force GC - whitebox.fullGC(); } // Object has not been cleaned - System.out.printf(" Cleanable not cleaned%n"); - return false; // Failing result + Assert.assertEquals(false, expectCleaned, msg); } /** @@ -622,7 +623,7 @@ public class CleanerTest { System.gc(); Assert.assertNotEquals(map.get(k2), data, "value should not be found in the map"); - final int CYCLE_MAX = 30; + final long CYCLE_MAX = Utils.adjustTimeout(30L); for (int i = 1; map.size() > 0 && i < CYCLE_MAX; i++) { map.forEach( (k, v) -> System.out.printf(" k: %s, v: %s%n", k, v)); try { @@ -699,7 +700,7 @@ public class CleanerTest { } obj = null; - Assert.assertTrue(checkCleaned(s1), "reference should be cleaned;"); + checkCleaned(s1, true, "reference was cleaned:"); cleaner = null; } @@ -713,7 +714,7 @@ public class CleanerTest { Object obj = new Object(); CleanableCase s = setupPhantom(cleaner, obj); obj = null; - Assert.assertTrue(checkCleaned(s.getSemaphore()), - "Object cleaning should have occurred using CleanerFactor.cleaner()"); + checkCleaned(s.getSemaphore(), true, + "Object was cleaned using CleanerFactor.cleaner():"); } } diff --git a/jdk/test/java/net/NetworkInterface/NetworkInterfaceStreamTest.java b/jdk/test/java/net/NetworkInterface/NetworkInterfaceStreamTest.java index ef97aa3f225..6659cd861d2 100644 --- a/jdk/test/java/net/NetworkInterface/NetworkInterfaceStreamTest.java +++ b/jdk/test/java/net/NetworkInterface/NetworkInterfaceStreamTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ * @build java.util.stream.OpTestCase * @run testng/othervm NetworkInterfaceStreamTest * @run testng/othervm -Djava.net.preferIPv4Stack=true NetworkInterfaceStreamTest + * @key intermittent */ import org.testng.annotations.Test; diff --git a/jdk/test/java/rmi/Naming/DefaultRegistryPort.java b/jdk/test/java/rmi/Naming/DefaultRegistryPort.java index a1f2b7adfc6..0c5efcb55d8 100644 --- a/jdk/test/java/rmi/Naming/DefaultRegistryPort.java +++ b/jdk/test/java/rmi/Naming/DefaultRegistryPort.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, 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 @@ -33,6 +33,7 @@ * java.rmi/sun.rmi.transport.tcp * @build TestLibrary * @run main/othervm DefaultRegistryPort + * @key intermittent */ /* diff --git a/jdk/test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java b/jdk/test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java index 7016e00f43c..eb4d408227b 100644 --- a/jdk/test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java +++ b/jdk/test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, 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 @@ -33,6 +33,7 @@ * java.rmi/sun.rmi.transport.tcp * @build TestLibrary Legal LegalRegistryNames_Stub * @run main/othervm LegalRegistryNames + * @key intermittent */ import java.net.InetAddress; diff --git a/jdk/test/java/rmi/registry/altSecurityManager/AltSecurityManager.java b/jdk/test/java/rmi/registry/altSecurityManager/AltSecurityManager.java index 7f36832e98a..12188414001 100644 --- a/jdk/test/java/rmi/registry/altSecurityManager/AltSecurityManager.java +++ b/jdk/test/java/rmi/registry/altSecurityManager/AltSecurityManager.java @@ -58,7 +58,7 @@ public class AltSecurityManager implements Runnable { public AltSecurityManager(int port) { if (port <= 0) { - TestLibrary.bomb("Port must be greater then 0."); + TestLibrary.bomb("Port must be greater than 0."); } this.regPort = port; diff --git a/jdk/test/java/rmi/transport/closeServerSocket/CloseServerSocket.java b/jdk/test/java/rmi/transport/closeServerSocket/CloseServerSocket.java index 4209bdccc57..9525535447c 100644 --- a/jdk/test/java/rmi/transport/closeServerSocket/CloseServerSocket.java +++ b/jdk/test/java/rmi/transport/closeServerSocket/CloseServerSocket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, 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 @@ -37,6 +37,7 @@ * java.rmi/sun.rmi.transport.tcp * @build TestLibrary * @run main/othervm CloseServerSocket + * @key intermittent */ import java.io.IOException; diff --git a/jdk/test/java/security/SecureRandom/DefaultProvider.java b/jdk/test/java/security/SecureRandom/DefaultProvider.java index 50b4719acc6..597f2352a4b 100644 --- a/jdk/test/java/security/SecureRandom/DefaultProvider.java +++ b/jdk/test/java/security/SecureRandom/DefaultProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -43,12 +43,7 @@ public class DefaultProvider { out.println("TEST: Default provider with constructor"); SecureRandom secureRandom = new SecureRandom(); String provider = secureRandom.getProvider().getName(); - if (OS_NAME.startsWith(SUNOS)) { - if (!provider.startsWith("SunPKCS11-")) { - throw new RuntimeException("Unexpected provider name: " - + provider); - } - } else if (!provider.equals("SUN")) { + if (!provider.equals("SUN")) { throw new RuntimeException("Unexpected provider name: " + provider); } @@ -77,16 +72,6 @@ public class DefaultProvider { instance = SecureRandom.getInstance(algorithm); assertInstance(instance, algorithm, provider); out.println("Passed."); - - if (OS_NAME.startsWith(SUNOS)) { - out.println( - "TEST: PKCS11 is supported on Solaris by SunPKCS11 provider"); - algorithm = "PKCS11"; - provider = "SunPKCS11-Solaris"; - instance = SecureRandom.getInstance(algorithm); - assertInstance(instance, algorithm, provider); - out.println("Passed."); - } } private static void assertInstance(SecureRandom instance, diff --git a/jdk/test/java/time/tck/java/time/TCKDuration.java b/jdk/test/java/time/tck/java/time/TCKDuration.java index 40eefd0603c..1e83db7ab8f 100644 --- a/jdk/test/java/time/tck/java/time/TCKDuration.java +++ b/jdk/test/java/time/tck/java/time/TCKDuration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -2496,8 +2496,9 @@ public class TCKDuration extends AbstractTCKTest { //----------------------------------------------------------------------- @Test public void test_toNanos() { - Duration test = Duration.ofSeconds(321, 123456789); - assertEquals(test.toNanos(), 321123456789L); + assertEquals(Duration.ofSeconds(321, 123456789).toNanos(), 321123456789L); + assertEquals(Duration.ofNanos(Long.MAX_VALUE).toNanos(), 9223372036854775807L); + assertEquals(Duration.ofNanos(Long.MIN_VALUE).toNanos(), -9223372036854775808L); } @Test @@ -2512,13 +2513,26 @@ public class TCKDuration extends AbstractTCKTest { test.toNanos(); } + @Test + public void test_toNanos_min() { + Duration test = Duration.ofSeconds(0, Long.MIN_VALUE); + assertEquals(test.toNanos(), Long.MIN_VALUE); + } + + @Test(expectedExceptions=ArithmeticException.class) + public void test_toNanos_tooSmall() { + Duration test = Duration.ofSeconds(0, Long.MIN_VALUE).minusNanos(1); + test.toNanos(); + } + //----------------------------------------------------------------------- // toMillis() //----------------------------------------------------------------------- @Test public void test_toMillis() { - Duration test = Duration.ofSeconds(321, 123456789); - assertEquals(test.toMillis(), 321000 + 123); + assertEquals(Duration.ofSeconds(321, 123456789).toMillis(), 321000 + 123); + assertEquals(Duration.ofMillis(Long.MAX_VALUE).toMillis(), 9223372036854775807L); + assertEquals(Duration.ofMillis(Long.MIN_VALUE).toMillis(), -9223372036854775808L); } @Test @@ -2533,6 +2547,18 @@ public class TCKDuration extends AbstractTCKTest { test.toMillis(); } + @Test + public void test_toMillis_min() { + Duration test = Duration.ofSeconds(Long.MIN_VALUE / 1000, (Long.MIN_VALUE % 1000) * 1000000); + assertEquals(test.toMillis(), Long.MIN_VALUE); + } + + @Test(expectedExceptions=ArithmeticException.class) + public void test_toMillis_tooSmall() { + Duration test = Duration.ofSeconds(Long.MIN_VALUE / 1000, ((Long.MIN_VALUE % 1000) - 1) * 1000000); + test.toMillis(); + } + //----------------------------------------------------------------------- // toSeconds() //----------------------------------------------------------------------- diff --git a/jdk/test/java/time/tck/java/time/TCKLocalDate.java b/jdk/test/java/time/tck/java/time/TCKLocalDate.java index 96290401c97..2b5832465c9 100644 --- a/jdk/test/java/time/tck/java/time/TCKLocalDate.java +++ b/jdk/test/java/time/tck/java/time/TCKLocalDate.java @@ -119,6 +119,8 @@ import java.time.temporal.UnsupportedTemporalTypeException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; @@ -2385,4 +2387,204 @@ public class TCKLocalDate extends AbstractDateTimeTest { assertSame(isoEra,IsoEra.CE); assertSame(LocalDate.MIN.getEra(),IsoEra.BCE); } + + //----------------------------------------------------------------- + // datesUntil() + // ---------------------------------------------------------------- + @Test + public void test_datesUntil() { + assertEquals( + date(2015, 9, 29).datesUntil(date(2015, 10, 3)).collect( + Collectors.toList()), Arrays.asList(date(2015, 9, 29), + date(2015, 9, 30), date(2015, 10, 1), date(2015, 10, 2))); + assertEquals(date(2015, 9, 29).datesUntil(date(2015, 10, 3), Period.ofDays(2)) + .collect(Collectors.toList()), Arrays.asList(date(2015, 9, 29), + date(2015, 10, 1))); + assertEquals(date(2015, 1, 31).datesUntil(date(2015, 6, 1), Period.ofMonths(1)) + .collect(Collectors.toList()), Arrays.asList(date(2015, 1, 31), + date(2015, 2, 28), date(2015, 3, 31), date(2015, 4, 30), + date(2015, 5, 31))); + } + + @Test(expectedExceptions=NullPointerException.class) + public void test_datesUntil_nullEnd() { + LocalDate date = date(2015, 1, 31); + date.datesUntil(null); + } + + @Test(expectedExceptions=NullPointerException.class) + public void test_datesUntil_nullEndStep() { + LocalDate date = date(2015, 1, 31); + date.datesUntil(null, Period.ofDays(1)); + } + + @Test(expectedExceptions=NullPointerException.class) + public void test_datesUntil_nullStep() { + LocalDate date = date(2015, 1, 31); + date.datesUntil(date, null); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void test_datesUntil_endBeforeStart() { + date(2015, 1, 31).datesUntil(date(2015, 1, 30)); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void test_datesUntil_endBeforeStartPositiveStep() { + date(2015, 1, 31).datesUntil(date(2015, 1, 30), Period.of(1, 0, 0)); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void test_datesUntil_endAfterStartNegativeStep() { + date(2015, 1, 30).datesUntil(date(2015, 1, 31), Period.of(0, -1, -1)); + } + + @Test(expectedExceptions=IllegalArgumentException.class) + public void test_datesUntil_zeroStep() { + LocalDate date = date(2015, 1, 31); + date.datesUntil(date, Period.ZERO); + } + + @Test(expectedExceptions=IllegalArgumentException.class) + public void test_datesUntil_oppositeSign() { + LocalDate date = date(2015, 1, 31); + date.datesUntil(date, Period.of(1, 0, -1)); + } + + @Test(expectedExceptions=IllegalArgumentException.class) + public void test_datesUntil_oppositeSign2() { + LocalDate date = date(2015, 1, 31); + date.datesUntil(date, Period.of(0, -1, 1)); + } + + @DataProvider(name="datesUntil") + public Object[][] provider_datesUntil() { + return new Object[][] { + {MIN_DATE, MIN_DATE}, + {MIN_DATE, MAX_DATE}, + {MAX_DATE, MAX_DATE}, + {date(2015,10,1), date(2015,10,2)}, + {date(2015,10,1), date(2015,11,1)}, + {date(2015,10,31), date(2015,11,1)}, + {date(2015,10,1), MAX_DATE}, + {MIN_DATE, date(2015,10,1)} + }; + } + + @Test(dataProvider = "datesUntil") + public void test_datesUntil_count(LocalDate start, LocalDate end) { + assertEquals(start.datesUntil(end).count(), start.until(end, ChronoUnit.DAYS)); + assertEquals(start.datesUntil(end, Period.ofDays(1)).count(), + start.until(end, ChronoUnit.DAYS)); + } + + @DataProvider(name="datesUntilSteps") + public Object[][] provider_datesUntil_steps() { + List data = new ArrayList<>(Arrays.asList(new Object[][] { + {MIN_DATE, MAX_DATE, Period.ofYears(Year.MAX_VALUE)}, + {MIN_DATE, MAX_DATE, Period.ofDays(2)}, + {MIN_DATE, MAX_DATE, Period.of(1,2,3)}, + {MIN_DATE, MAX_DATE, Period.of(1,2,1000000)}, + {MIN_DATE, MAX_DATE, Period.of(1,1000000,3)}, + {MIN_DATE, MAX_DATE, Period.of(1000000,2,3)}, + {MIN_DATE, MIN_DATE.plusMonths(1), Period.ofMonths(1)}, + {MIN_DATE, date(Year.MIN_VALUE, 2, 2), Period.ofMonths(1)}, + {MIN_DATE, date(Year.MIN_VALUE, 8, 9), Period.of(0, 1, 1)}, + {MIN_DATE, MAX_DATE.minusYears(1), Period.ofYears(Year.MAX_VALUE)}, + {MAX_DATE.minusMonths(1), MAX_DATE, Period.ofMonths(1)}, + {date(Year.MAX_VALUE, 2, 20), MAX_DATE, Period.of(0, 1, 1)}, + {date(2015,1,1), date(2016,1,1), Period.ofYears(1)}, + {date(2015,1,1), date(2016,1,1), Period.ofDays(365)}, + {date(2015,1,1), date(2016,1,1), Period.ofDays(366)}, + {date(2015,1,1), date(2016,1,1), Period.ofDays(4)}, + {date(2015,1,1), date(2016,1,1), Period.of(0,1,2)}, + {date(2015,1,1), date(2016,1,1), Period.ofMonths(1)}, + {date(2015,1,1), date(2016,1,1), Period.ofMonths(12)}, + {date(2015,1,1), date(2016,1,2), Period.ofMonths(12)}, + {date(2015,1,1), date(2016,1,1), Period.of(0, 11, 30)}, + {date(2015,1,1), date(2015,12,31), Period.of(0, 11, 30)}, + {date(2015,1,31), date(2015,12,31), Period.ofMonths(2)}, + {date(2015,1,31), date(2015,12,1), Period.ofMonths(2)}, + {date(2015,1,31), date(2015,11,30), Period.ofMonths(2)}, + {date(2015,1,31), date(2030,11,30), Period.of(1,30,365)}, + {date(2015,1,31), date(2043,1,31), Period.of(4,0,0)}, + {date(2015,1,31), date(2043,2,1), Period.of(4,0,0)}, + {date(2015,1,31), date(2043,1,31), Period.of(3,11,30)}, + {date(2015,1,31), date(2043,2,1), Period.of(3,11,30)}, + {date(2015,1,31), date(2043,1,31), Period.of(0,0,1460)}, + {date(2015,1,31), date(2043,1,31), Period.of(0,0,1461)}, + {date(2015,1,31), date(2043,2,1), Period.of(0,0,1461)}, + {date(2015,1,31), MAX_DATE, Period.of(10,100,1000)}, + {date(2015,1,31), MAX_DATE, Period.of(1000000,10000,100000)}, + {date(2015,1,31), MAX_DATE, Period.ofDays(10000000)}, + {date(2015,1,31), MAX_DATE, Period.ofDays(Integer.MAX_VALUE)}, + {date(2015,1,31), MAX_DATE, Period.ofMonths(Integer.MAX_VALUE)}, + {date(2015,1,31), MAX_DATE, Period.ofYears(Integer.MAX_VALUE)} + })); + LocalDate start = date(2014, 1, 15); + LocalDate end = date(2015, 3, 4); + for (int months : new int[] { 0, 1, 2, 3, 5, 7, 12, 13 }) { + for (int days : new int[] { 0, 1, 2, 3, 5, 10, 17, 27, 28, 29, 30, 31, 32, 57, 58, 59, + 60, 61, 62, 70, 80, 90 }) { + if (months > 0 || days > 0) + data.add(new Object[] { start, end, Period.of(0, months, days) }); + } + } + for (int days = 27; days < 100; days++) { + data.add(new Object[] { start, start.plusDays(days), Period.ofMonths(1) }); + } + return data.toArray(new Object[data.size()][]); + } + + @Test(dataProvider="datesUntilSteps") + public void test_datesUntil_step(LocalDate start, LocalDate end, Period step) { + assertEquals(start.datesUntil(start, step).count(), 0); + long count = start.datesUntil(end, step).count(); + assertTrue(count > 0); + // the last value must be before the end date + assertTrue(start.plusMonths(step.toTotalMonths()*(count-1)).plusDays(step.getDays()*(count-1)).isBefore(end)); + try { + // the next after the last value must be either invalid or not before the end date + assertFalse(start.plusMonths(step.toTotalMonths()*count).plusDays(step.getDays()*count).isBefore(end)); + } catch (ArithmeticException | DateTimeException e) { + // ignore: possible overflow for the next value is ok + } + if(count < 1000) { + assertTrue(start.datesUntil(end, step).allMatch(date -> !date.isBefore(start) && date.isBefore(end))); + List list = new ArrayList<>(); + for(long i=0; i 0); + // the last value must be after the start date + assertTrue(end.minusMonths(step.toTotalMonths()*(count-1)).minusDays(step.getDays()*(count-1)).isAfter(start)); + try { + // the next after the last value must be either invalid or not after the start date + assertFalse(end.minusMonths(step.toTotalMonths()*count).minusDays(step.getDays()*count).isAfter(start)); + } catch (ArithmeticException | DateTimeException e) { + // ignore: possible overflow for the next value is ok + } + if(count < 1000) { + assertTrue(end.datesUntil(start, step.negated()).allMatch(date -> date.isAfter(start) && !date.isAfter(end))); + List list = new ArrayList<>(); + for(long i=0; i stream = date.datesUntil(date.plusDays(5)); + long sum = stream.mapToInt(LocalDate::getDayOfMonth).sum(); + assertEquals(sum, 60, "sum of 10, 11, 12, 13, 14 is wrong"); + } } diff --git a/jdk/test/java/time/tck/java/time/format/TCKDTFParsedInstant.java b/jdk/test/java/time/tck/java/time/format/TCKDTFParsedInstant.java index 11f103dd317..ec60f0f586d 100644 --- a/jdk/test/java/time/tck/java/time/format/TCKDTFParsedInstant.java +++ b/jdk/test/java/time/tck/java/time/format/TCKDTFParsedInstant.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -30,6 +30,7 @@ import java.time.ZoneId; import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; +import java.util.Locale; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; @@ -194,7 +195,7 @@ public class TCKDTFParsedInstant { @Test(dataProvider="parseWithZoneWithoutOffset") public void testWithZoneWithoutOffset(String withZoneWithoutOffset, ZonedDateTime expectedZDT) { - dtFormatter = DateTimeFormatter.ofPattern("d MMM HH:mm:ss uuuu VV"); + dtFormatter = DateTimeFormatter.ofPattern("d MMM HH:mm:ss uuuu VV").withLocale(Locale.ENGLISH); zdt1 = ZonedDateTime.parse(withZoneWithoutOffset, dtFormatter); assertEquals(expectedZDT, zdt1); } diff --git a/jdk/test/java/time/test/java/time/TestClock_System.java b/jdk/test/java/time/test/java/time/TestClock_System.java index b311dad6e6c..55ef1cd851e 100644 --- a/jdk/test/java/time/test/java/time/TestClock_System.java +++ b/jdk/test/java/time/test/java/time/TestClock_System.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -179,11 +179,17 @@ public class TestClock_System { int count=0; // let's preheat the system a bit: + int lastNanos = 0; for (int i = 0; i < 1000 ; i++) { system1 = Instant.ofEpochMilli(System.currentTimeMillis()); - highest1 = highestUTC.instant(); final int sysnan = system1.getNano(); - final int nanos = highest1.getNano(); + int nanos; + do { + highest1 = highestUTC.instant(); + nanos = highest1.getNano(); + } while (nanos == lastNanos); // Repeat to get a different value + lastNanos = nanos; + if ((nanos % 1000000) > 0) { count++; // we have micro seconds } diff --git a/jdk/test/java/util/Collections/EmptyNavigableMap.java b/jdk/test/java/util/Collections/EmptyNavigableMap.java index 306f05657b9..5daf055786a 100644 --- a/jdk/test/java/util/Collections/EmptyNavigableMap.java +++ b/jdk/test/java/util/Collections/EmptyNavigableMap.java @@ -265,7 +265,7 @@ public class EmptyNavigableMap { navigableMap.subMap(last, true, first, false); }, IllegalArgumentException.class, description - + ": Must throw IllegalArgumentException when fromElement is not less then then toElement."); + + ": Must throw IllegalArgumentException when fromElement is not less than toElement."); navigableMap.subMap(first, true, last, false); } diff --git a/jdk/test/java/util/Collections/EmptyNavigableSet.java b/jdk/test/java/util/Collections/EmptyNavigableSet.java index fa28e097006..7541f3d363b 100644 --- a/jdk/test/java/util/Collections/EmptyNavigableSet.java +++ b/jdk/test/java/util/Collections/EmptyNavigableSet.java @@ -284,7 +284,7 @@ public class EmptyNavigableSet { navigableSet.subSet(last, true, first, false); }, IllegalArgumentException.class, description - + ": Must throw IllegalArgumentException when fromElement is not less then then toElement."); + + ": Must throw IllegalArgumentException when fromElement is not less than toElement."); navigableSet.subSet(first, true, last, false); } diff --git a/jdk/test/java/util/UUID/UUIDTest.java b/jdk/test/java/util/UUID/UUIDTest.java index 06b240fa9fa..46e91e6df06 100644 --- a/jdk/test/java/util/UUID/UUIDTest.java +++ b/jdk/test/java/util/UUID/UUIDTest.java @@ -22,9 +22,11 @@ */ /* @test - * @bug 4173528 5068772 + * @bug 4173528 5068772 8148936 * @summary Unit tests for java.util.UUID * @key randomness + * @run main/othervm -XX:+CompactStrings UUIDTest + * @run main/othervm -XX:-CompactStrings UUIDTest */ import java.util.*; diff --git a/jdk/test/java/util/concurrent/tck/TimeUnitTest.java b/jdk/test/java/util/concurrent/tck/TimeUnitTest.java index 3b33c9a4971..30f955978d8 100644 --- a/jdk/test/java/util/concurrent/tck/TimeUnitTest.java +++ b/jdk/test/java/util/concurrent/tck/TimeUnitTest.java @@ -41,6 +41,7 @@ import static java.util.concurrent.TimeUnit.MINUTES; import static java.util.concurrent.TimeUnit.NANOSECONDS; import static java.util.concurrent.TimeUnit.SECONDS; +import java.time.temporal.ChronoUnit; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -456,8 +457,53 @@ public class TimeUnitTest extends JSR166TestCase { * a deserialized serialized unit is the same instance */ public void testSerialization() throws Exception { - TimeUnit x = MILLISECONDS; - assertSame(x, serialClone(x)); + for (TimeUnit x : TimeUnit.values()) + assertSame(x, serialClone(x)); + } + + /** + * tests for toChronoUnit. + */ + public void testToChronoUnit() throws Exception { + assertSame(ChronoUnit.NANOS, NANOSECONDS.toChronoUnit()); + assertSame(ChronoUnit.MICROS, MICROSECONDS.toChronoUnit()); + assertSame(ChronoUnit.MILLIS, MILLISECONDS.toChronoUnit()); + assertSame(ChronoUnit.SECONDS, SECONDS.toChronoUnit()); + assertSame(ChronoUnit.MINUTES, MINUTES.toChronoUnit()); + assertSame(ChronoUnit.HOURS, HOURS.toChronoUnit()); + assertSame(ChronoUnit.DAYS, DAYS.toChronoUnit()); + + // Every TimeUnit has a defined ChronoUnit equivalent + for (TimeUnit x : TimeUnit.values()) + assertSame(x, TimeUnit.of(x.toChronoUnit())); + } + + /** + * tests for TimeUnit.of(ChronoUnit). + */ + public void testTimeUnitOf() throws Exception { + assertSame(NANOSECONDS, TimeUnit.of(ChronoUnit.NANOS)); + assertSame(MICROSECONDS, TimeUnit.of(ChronoUnit.MICROS)); + assertSame(MILLISECONDS, TimeUnit.of(ChronoUnit.MILLIS)); + assertSame(SECONDS, TimeUnit.of(ChronoUnit.SECONDS)); + assertSame(MINUTES, TimeUnit.of(ChronoUnit.MINUTES)); + assertSame(HOURS, TimeUnit.of(ChronoUnit.HOURS)); + assertSame(DAYS, TimeUnit.of(ChronoUnit.DAYS)); + + assertThrows(NullPointerException.class, + () -> TimeUnit.of((ChronoUnit)null)); + + // ChronoUnits either round trip to their TimeUnit + // equivalents, or throw IllegalArgumentException. + for (ChronoUnit cu : ChronoUnit.values()) { + final TimeUnit tu; + try { + tu = TimeUnit.of(cu); + } catch (IllegalArgumentException acceptable) { + continue; + } + assertSame(cu, tu.toChronoUnit()); + } } } diff --git a/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/LambdaTestHelpers.java b/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/LambdaTestHelpers.java index 76a4d72ad2a..dbeada29c55 100644 --- a/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/LambdaTestHelpers.java +++ b/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/LambdaTestHelpers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,6 +47,7 @@ import java.util.function.ToLongFunction; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; +import static org.testng.Assert.assertFalse; /** * LambdaTestHelpers -- assertion methods and useful objects for lambda test cases @@ -400,6 +401,16 @@ public class LambdaTestHelpers { assertEquals(toBoxedMultiset(actual), toBoxedMultiset(expected)); } + public static void assertContains(Optional actual, Iterator it) { + actual.ifPresentOrElse(r -> { + boolean contained = false; + while (!contained && it.hasNext()) { + contained = Objects.equals(r, it.next()); + } + assertTrue(contained, "Not found: "+r); + }, () -> assertFalse(it.hasNext())); + } + public static void launderAssertion(Runnable r, Supplier additionalInfo) { try { r.run(); diff --git a/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/StreamTestDataProvider.java b/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/StreamTestDataProvider.java index 8a849015260..b3aa58ac842 100644 --- a/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/StreamTestDataProvider.java +++ b/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/StreamTestDataProvider.java @@ -47,6 +47,7 @@ public class StreamTestDataProvider { private static final Object[][] testData; private static final Object[][] testSmallData; + private static final Object[][] testMiniData; private static final Object[][] withNullTestData; private static final Object[][] spliteratorTestData; @@ -85,6 +86,7 @@ public class StreamTestDataProvider { static { { + List listMini = new ArrayList<>(); List listSmall = new ArrayList<>(); List list1000 = new ArrayList<>(); List list = null; @@ -93,7 +95,7 @@ public class StreamTestDataProvider { final Integer[] ints = (Integer[])data[1]; final List intsAsList = Arrays.asList(ints); - list = ints.length >= 1000 ? list1000 : listSmall; + list = ints.length >= 1000 ? list1000 : (ints.length >= 100 ? listSmall : listMini); list.add(arrayDataDescr("array:" + name, ints)); list.add(collectionDataDescr("ArrayList.asList:" + name, intsAsList)); @@ -119,6 +121,8 @@ public class StreamTestDataProvider { // @@@ Add more } + testMiniData = listMini.toArray(new Object[0][]); + listSmall.addAll(listMini); testSmallData = listSmall.toArray(new Object[0][]); list1000.addAll(listSmall); testData = list1000.toArray(new Object[0][]); @@ -204,6 +208,11 @@ public class StreamTestDataProvider { return testSmallData; } + @DataProvider(name = "StreamTestData.mini") + public static Object[][] makeMiniStreamTestData() { + return testMiniData; + } + @DataProvider(name = "withNull:StreamTestData") public static Object[][] makeStreamWithNullTestData() { return withNullTestData; diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FindAnyOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FindAnyOpTest.java index 64a9240fecd..6dd44206f17 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FindAnyOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FindAnyOpTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -20,6 +20,12 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +/** + * @test + * @bug 8148115 + */ + package org.openjdk.tests.java.util.stream; import java.util.*; @@ -61,18 +67,7 @@ public class FindAnyOpTest extends OpTestCase { void exerciseStream(TestData.OfRef data, Function, Stream> fs) { Optional or = withData(data).terminal(fs, s -> s.findAny()).equalator(VALID_ANSWER).exercise(); - if (or.isPresent()) { - Integer r = or.get(); - Iterator it = fs.apply(data.stream()).iterator(); - boolean contained = false; - while (!contained && it.hasNext()) { - contained = Objects.equals(r, it.next()); - } - assertTrue(contained); - } - else { - assertFalse(fs.apply(data.stream()).iterator().hasNext()); - } + assertContains(or, fs.apply(data.stream()).iterator()); } @Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class) diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FindFirstOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FindFirstOpTest.java index 02e3d0727b8..40ec1cca108 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FindFirstOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FindFirstOpTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -20,6 +20,12 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +/** + * @test + * @bug 8148115 + */ + package org.openjdk.tests.java.util.stream; import java.util.*; @@ -59,15 +65,19 @@ public class FindFirstOpTest extends OpTestCase { } void exerciseStream(TestData.OfRef data, Function, Stream> fs) { - Optional r = exerciseTerminalOps(data, fs, s -> s.findFirst()); - if (r.isPresent()) { - Iterator i = fs.apply(data.stream()).iterator(); - assertTrue(i.hasNext()); - assertEquals(i.next(), r.get()); - } - else { - assertFalse(fs.apply(data.stream()).iterator().hasNext()); - } + Iterator i = fs.apply(data.stream()).iterator(); + Optional expected = i.hasNext() ? Optional.of(i.next()) : Optional.empty(); + withData(data).terminal(fs, s -> s.findFirst()) + .expectedResult(expected) + .resultAsserter((act, exp, ord, par) -> { + if (par & !ord) { + assertContains(act, fs.apply(data.stream()).iterator()); + } + else { + assertEquals(act, exp); + } + }) + .exercise(); } @Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class) diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SequentialOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SequentialOpTest.java index efa5c62e640..6951bc2ded7 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SequentialOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SequentialOpTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -94,7 +94,7 @@ public class SequentialOpTest extends OpTestCase { } @SuppressWarnings({"rawtypes", "unchecked"}) - @Test(dataProvider = "StreamTestData", dataProviderClass = StreamTestDataProvider.class) + @Test(dataProvider = "StreamTestData.mini", dataProviderClass = StreamTestDataProvider.class) public void testMixedSeqPar(String name, TestData.OfRef data) { Function id = LambdaTestHelpers.identity(); UnaryOperator>[] changers diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SliceOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SliceOpTest.java index 7fe0006dc1b..c43b3deed68 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SliceOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SliceOpTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -20,6 +20,12 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +/* + * @test + * @bug 8148250 + */ + package org.openjdk.tests.java.util.stream; import org.testng.annotations.Test; @@ -341,4 +347,13 @@ public class SliceOpTest extends OpTestCase { return Arrays.asList(0, 1, size / 2, size - 1, size, size + 1, 2 * size); } } + + public void testLimitParallelHugeInput() { + for (int n : new int[] {10, 100, 1000, 10000}) { + long[] actual = LongStream.range(0, Long.MAX_VALUE) + .parallel().filter(x -> true) // remove SIZED + .limit(n).toArray(); + assertEquals(LongStream.range(0, n).toArray(), actual); + } + } } diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java index f3739784b34..0d07e7cb67a 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -20,6 +20,12 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +/** + * @test + * @bug 8148838 + */ + package org.openjdk.tests.java.util.stream; import java.util.Arrays; @@ -282,7 +288,7 @@ public class StreamSpliteratorTest extends OpTestCase { } } - @Test(dataProvider = "StreamTestData", + @Test(dataProvider = "StreamTestData.small", dataProviderClass = StreamTestDataProvider.class, groups = { "serialization-hostile" }) public void testStreamSpliterators(String name, TestData.OfRef data) { @@ -303,14 +309,14 @@ public class StreamSpliteratorTest extends OpTestCase { } } - @Test(dataProvider = "StreamTestData", dataProviderClass = StreamTestDataProvider.class) + @Test(dataProvider = "StreamTestData.small", dataProviderClass = StreamTestDataProvider.class) public void testSpliterators(String name, TestData.OfRef data) { for (Function, Stream> f : streamFunctions()) { SpliteratorTestHelper.testSpliterator(() -> f.apply(data.stream()).spliterator()); } } - @Test(dataProvider = "StreamTestData", dataProviderClass = StreamTestDataProvider.class) + @Test(dataProvider = "StreamTestData.small", dataProviderClass = StreamTestDataProvider.class) public void testParSpliterators(String name, TestData.OfRef data) { for (Function, Stream> f : streamFunctions()) { SpliteratorTestHelper.testSpliterator(() -> f.apply(data.parallelStream()).spliterator()); @@ -323,7 +329,7 @@ public class StreamSpliteratorTest extends OpTestCase { if (streamFunctions == null) { List, Stream>> opFunctions = Arrays.asList( s -> s.filter(pEven), - s -> s.map(mDoubler), + s -> s.flatMap(x -> Stream.of(x, x)), // @@@ Add distinct once asserting results with or without order // is correctly supported // s -> s.distinct(), @@ -378,7 +384,7 @@ public class StreamSpliteratorTest extends OpTestCase { } } - @Test(dataProvider = "IntStreamTestData", + @Test(dataProvider = "IntStreamTestData.small", dataProviderClass = IntStreamTestDataProvider.class, groups = { "serialization-hostile" }) public void testIntStreamSpliterators(String name, TestData.OfInt data) { @@ -399,14 +405,14 @@ public class StreamSpliteratorTest extends OpTestCase { } } - @Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class) + @Test(dataProvider = "IntStreamTestData.small", dataProviderClass = IntStreamTestDataProvider.class) public void testIntSpliterators(String name, TestData.OfInt data) { for (Function f : intStreamFunctions()) { SpliteratorTestHelper.testIntSpliterator(() -> f.apply(data.stream()).spliterator()); } } - @Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class) + @Test(dataProvider = "IntStreamTestData.small", dataProviderClass = IntStreamTestDataProvider.class) public void testIntParSpliterators(String name, TestData.OfInt data) { for (Function f : intStreamFunctions()) { SpliteratorTestHelper.testIntSpliterator(() -> f.apply(data.parallelStream()).spliterator()); @@ -419,7 +425,7 @@ public class StreamSpliteratorTest extends OpTestCase { if (intStreamFunctions == null) { List> opFunctions = Arrays.asList( s -> s.filter(ipEven), - s -> s.map(irDoubler), + s -> s.flatMap(x -> IntStream.of(x, x)), s -> s.sorted()); intStreamFunctions = permuteStreamFunctions(opFunctions); @@ -471,7 +477,7 @@ public class StreamSpliteratorTest extends OpTestCase { } } - @Test(dataProvider = "LongStreamTestData", + @Test(dataProvider = "LongStreamTestData.small", dataProviderClass = LongStreamTestDataProvider.class, groups = { "serialization-hostile" }) public void testLongStreamSpliterators(String name, TestData.OfLong data) { @@ -492,14 +498,14 @@ public class StreamSpliteratorTest extends OpTestCase { } } - @Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class) + @Test(dataProvider = "LongStreamTestData.small", dataProviderClass = LongStreamTestDataProvider.class) public void testLongSpliterators(String name, TestData.OfLong data) { for (Function f : longStreamFunctions()) { SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.stream()).spliterator()); } } - @Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class) + @Test(dataProvider = "LongStreamTestData.small", dataProviderClass = LongStreamTestDataProvider.class) public void testLongParSpliterators(String name, TestData.OfLong data) { for (Function f : longStreamFunctions()) { SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.parallelStream()).spliterator()); @@ -512,7 +518,7 @@ public class StreamSpliteratorTest extends OpTestCase { if (longStreamFunctions == null) { List> opFunctions = Arrays.asList( s -> s.filter(lpEven), - s -> s.map(x -> x * 2L), + s -> s.flatMap(x -> LongStream.of(x, x)), s -> s.sorted()); longStreamFunctions = permuteStreamFunctions(opFunctions); @@ -564,7 +570,7 @@ public class StreamSpliteratorTest extends OpTestCase { } } - @Test(dataProvider = "DoubleStreamTestData", + @Test(dataProvider = "DoubleStreamTestData.small", dataProviderClass = DoubleStreamTestDataProvider.class, groups = { "serialization-hostile" }) public void testDoubleStreamSpliterators(String name, TestData.OfDouble data) { @@ -585,14 +591,14 @@ public class StreamSpliteratorTest extends OpTestCase { } } - @Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class) + @Test(dataProvider = "DoubleStreamTestData.small", dataProviderClass = DoubleStreamTestDataProvider.class) public void testDoubleSpliterators(String name, TestData.OfDouble data) { for (Function f : doubleStreamFunctions()) { SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.stream()).spliterator()); } } - @Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class) + @Test(dataProvider = "DoubleStreamTestData.small", dataProviderClass = DoubleStreamTestDataProvider.class) public void testDoubleParSpliterators(String name, TestData.OfDouble data) { for (Function f : doubleStreamFunctions()) { SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.parallelStream()).spliterator()); @@ -605,7 +611,7 @@ public class StreamSpliteratorTest extends OpTestCase { if (doubleStreamFunctions == null) { List> opFunctions = Arrays.asList( s -> s.filter(dpEven), - s -> s.map(x -> x * 2.0), + s -> s.flatMap(x -> DoubleStream.of(x, x)), s -> s.sorted()); doubleStreamFunctions = permuteStreamFunctions(opFunctions); diff --git a/jdk/test/javax/imageio/MultiReadTest.java b/jdk/test/javax/imageio/MultiReadTest.java index daea61610be..2e19d0b360c 100644 --- a/jdk/test/javax/imageio/MultiReadTest.java +++ b/jdk/test/javax/imageio/MultiReadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,7 +52,7 @@ public class MultiReadTest { private static final int max = 5; public static void main(String[] args) throws IOException { - final String[] formats = { "bmp", "png", "gif", "jpg" }; + final String[] formats = { "bmp", "png", "gif", "jpg", "tif" }; for (String f : formats) { test(f); diff --git a/jdk/test/javax/imageio/plugins/jpeg/JpegRawImageTypeTest.java b/jdk/test/javax/imageio/plugins/jpeg/JpegRawImageTypeTest.java new file mode 100644 index 00000000000..8749ca0daa6 --- /dev/null +++ b/jdk/test/javax/imageio/plugins/jpeg/JpegRawImageTypeTest.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8143562 + * @summary Test verifies whether getRawImageType API returns proper raw + * image type when color space is of type YCbCr. + * @run main JpegRawImageTypeTest + */ + +import java.io.File; +import java.util.Iterator; +import javax.imageio.ImageIO; +import javax.imageio.ImageReader; +import javax.imageio.ImageTypeSpecifier; +import javax.imageio.stream.ImageInputStream; + +public class JpegRawImageTypeTest { + + public static void main(String[] args) throws Exception { + + //nomarkers.jpg has YCbCr color space + String fileName = "nomarkers.jpg"; + String sep = System.getProperty("file.separator"); + String dir = System.getProperty("test.src", "."); + String filePath = dir+sep+fileName; + System.out.println("Test file: " + filePath); + File imageFile = new File(filePath); + + ImageInputStream inputStream = ImageIO. + createImageInputStream(imageFile); + Iterator readers = ImageIO.getImageReaders(inputStream); + + if(readers.hasNext()) { + ImageReader reader = readers.next(); + reader.setInput(inputStream); + + ImageTypeSpecifier typeSpecifier = reader.getRawImageType(0); + //check if ImageTypeSpecifier is null for YCbCr JPEG Image + if (typeSpecifier == null) { + throw new RuntimeException("ImageReader returns null raw image" + + " type"); + } + } + } +} diff --git a/jdk/test/javax/imageio/plugins/shared/BitDepth.java b/jdk/test/javax/imageio/plugins/shared/BitDepth.java index 9f1e2ee6da9..4e051738590 100644 --- a/jdk/test/javax/imageio/plugins/shared/BitDepth.java +++ b/jdk/test/javax/imageio/plugins/shared/BitDepth.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, 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 @@ -23,11 +23,11 @@ /** * @test - * @bug 4413109 4418221 6607198 + * @bug 4413109 4418221 6607198 8147448 * @run main BitDepth - * @summary Checks that the PNG and JPEG writers can handle various - * BufferedImage types. An optional list of arguments may be used to - * test a different format writer or writers. + * @summary Checks that ImageIO writers for standard formats can handle + * various BufferedImage RGB types. An optional list of arguments + * may be used to test the writers for a different list of formats. */ import java.awt.Color; @@ -81,21 +81,19 @@ public class BitDepth { BufferedImage.TYPE_INT_BGR, BufferedImage.TYPE_3BYTE_BGR, BufferedImage.TYPE_USHORT_565_RGB, - BufferedImage.TYPE_USHORT_555_RGB - }; - - private static final int[] biRGBATypes = { + BufferedImage.TYPE_USHORT_555_RGB, BufferedImage.TYPE_INT_ARGB, BufferedImage.TYPE_INT_ARGB_PRE, BufferedImage.TYPE_4BYTE_ABGR, BufferedImage.TYPE_4BYTE_ABGR_PRE }; - private static final int[] biGrayTypes = { - BufferedImage.TYPE_BYTE_GRAY, - BufferedImage.TYPE_USHORT_GRAY, - BufferedImage.TYPE_BYTE_BINARY - }; + //private static final int[] biGrayTypes = { + // BufferedImage.TYPE_BYTE_GRAY, + // BufferedImage.TYPE_USHORT_GRAY, + // BufferedImage.TYPE_BYTE_BINARY + //}; + private static final String[] biTypeNames = { "CUSTOM", @@ -116,7 +114,7 @@ public class BitDepth { private int width = 80; private int height = 80; - private String[] format = { "png", "jpeg" }; + private String[] format = { "png", "jpeg", "tif", "bmp", "gif" }; public BitDepth(String[] args) throws IOException { if (args.length > 0) { @@ -129,10 +127,28 @@ public class BitDepth { } private void testFormat(String format) throws IOException { + boolean allOK = true; for (int i = 0; i < biRGBTypes.length; i++) { + int type = biRGBTypes[i]; + + + // TODO: remove the following 'if' block after the 8147448 fix + if ( format.toLowerCase().equals("bmp") && ( + (type == BufferedImage.TYPE_INT_ARGB ) || + (type == BufferedImage.TYPE_INT_ARGB_PRE ) || + (type == BufferedImage.TYPE_4BYTE_ABGR ) || + (type == BufferedImage.TYPE_4BYTE_ABGR_PRE ))) { + + System.err.println("cannot use " + biTypeNames[type] + + " for bmp because of JDK-8147448.\t" + + " please update the test after fix of this bug!"); + continue; + } + + System.out.println("Testing " + format + " writer for type " + biTypeNames[type]); File f = testWriteRGB(format, type); @@ -143,6 +159,8 @@ public class BitDepth { allOK = allOK && ok; } + + if (format.equals("png")) { System.out.println("Testing png writer for black stripe"); boolean ok = testPNGByteBinary(); @@ -154,8 +172,8 @@ public class BitDepth { } } - private File testWriteRGB(String format, int type) - throws IOException { + private File testWriteRGB(String format, int type) throws IOException { + BufferedImage bi = new BufferedImage(width, height, type); Graphics2D g = bi.createGraphics(); diff --git a/jdk/test/javax/imageio/plugins/shared/ImageWriterCompressionTest.java b/jdk/test/javax/imageio/plugins/shared/ImageWriterCompressionTest.java new file mode 100644 index 00000000000..9f633c0d300 --- /dev/null +++ b/jdk/test/javax/imageio/plugins/shared/ImageWriterCompressionTest.java @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Locale; +import java.util.Set; +import javax.imageio.IIOImage; +import javax.imageio.ImageIO; +import javax.imageio.ImageWriteParam; +import javax.imageio.ImageWriter; +import javax.imageio.stream.ImageOutputStream; + +/** + * @test @bug 6488522 + * @summary Check the compression support in imageio ImageWriters + * @run main ImageWriterCompressionTest + */ +public class ImageWriterCompressionTest { + + // ignore jpg (fail): + // Caused by: javax.imageio.IIOException: Invalid argument to native writeImage + private static final Set IGNORE_FILE_SUFFIXES + = new HashSet(Arrays.asList(new String[] { + "bmp", "gif", + "jpg", "jpeg" + } )); + + public static void main(String[] args) { + Locale.setDefault(Locale.US); + + final BufferedImage image + = new BufferedImage(512, 512, BufferedImage.TYPE_INT_ARGB); + + final Graphics2D g2d = image.createGraphics(); + try { + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + g2d.setRenderingHint(RenderingHints.KEY_RENDERING, + RenderingHints.VALUE_RENDER_QUALITY); + g2d.scale(2.0, 2.0); + + g2d.setColor(Color.red); + g2d.draw(new Rectangle2D.Float(10, 10, 100, 100)); + g2d.setColor(Color.blue); + g2d.fill(new Rectangle2D.Float(12, 12, 98, 98)); + g2d.setColor(Color.green); + g2d.setFont(new Font(Font.SERIF, Font.BOLD, 14)); + + for (int i = 0; i < 15; i++) { + g2d.drawString("Testing Compression ...", 20, 20 + i * 16); + } + + final String[] fileSuffixes = ImageIO.getWriterFileSuffixes(); + + final Set testedWriterClasses = new HashSet(); + + for (String suffix : fileSuffixes) { + + if (!IGNORE_FILE_SUFFIXES.contains(suffix)) { + final Iterator itWriters + = ImageIO.getImageWritersBySuffix(suffix); + + final ImageWriter writer; + final ImageWriteParam writerParams; + + if (itWriters.hasNext()) { + writer = itWriters.next(); + + if (testedWriterClasses.add(writer.getClass().getName())) { + writerParams = writer.getDefaultWriteParam(); + + if (writerParams.canWriteCompressed()) { + testCompression(image, writer, writerParams, suffix); + } + } + } else { + throw new RuntimeException("Unable to get writer !"); + } + } + } + } catch (IOException ioe) { + throw new RuntimeException("IO failure", ioe); + } + finally { + g2d.dispose(); + } + } + + private static void testCompression(final BufferedImage image, + final ImageWriter writer, + final ImageWriteParam writerParams, + final String suffix) + throws IOException + { + System.out.println("Compression types: " + + Arrays.toString(writerParams.getCompressionTypes())); + + // Test Compression modes: + try { + writerParams.setCompressionMode(ImageWriteParam.MODE_DISABLED); + saveImage(image, writer, writerParams, "disabled", suffix); + } catch (Exception e) { + System.out.println("CompressionMode Disabled not supported: "+ e.getMessage()); + } + + try { + writerParams.setCompressionMode(ImageWriteParam.MODE_DEFAULT); + saveImage(image, writer, writerParams, "default", suffix); + } catch (Exception e) { + System.out.println("CompressionMode Default not supported: "+ e.getMessage()); + } + + writerParams.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); + writerParams.setCompressionType(selectCompressionType(suffix, + writerParams.getCompressionTypes())); + + System.out.println("Selected Compression type: " + + writerParams.getCompressionType()); + + long prev = Long.MAX_VALUE; + for (int i = 10; i >= 0; i--) { + float quality = 0.1f * i; + writerParams.setCompressionQuality(quality); + + long len = saveImage(image, writer, writerParams, + String.format("explicit-%.1f", quality), suffix); + + if (len <= 0) { + throw new RuntimeException("zero file length !"); + } else if (len > prev) { + throw new RuntimeException("Incorrect file length: " + len + + " larger than previous: " + prev + " !"); + } + prev = len; + } + } + + private static String selectCompressionType(final String suffix, + final String[] types) + { + switch (suffix) { + case "tif": + case "tiff": + return "LZW"; + default: + return types[0]; + } + } + + private static long saveImage(final BufferedImage image, + final ImageWriter writer, + final ImageWriteParam writerParams, + final String mode, + final String suffix) throws IOException + { + final File imgFile = new File("WriterCompressionTest-" + + mode + '.' + suffix); + System.out.println("Writing file: " + imgFile.getAbsolutePath()); + + final ImageOutputStream imgOutStream + = ImageIO.createImageOutputStream(new FileOutputStream(imgFile)); + try { + writer.setOutput(imgOutStream); + writer.write(null, new IIOImage(image, null, null), writerParams); + } finally { + imgOutStream.close(); + } + return imgFile.length(); + } +} diff --git a/jdk/test/javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java b/jdk/test/javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java new file mode 100644 index 00000000000..2edb9a1f1c5 --- /dev/null +++ b/jdk/test/javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java @@ -0,0 +1,239 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @library /lib/testlibrary/ + * @build jdk.testlibrary.* + * + * @bug 8145776 + * @author a.stepanov + * @summary A simple write-read test for the multi-page tiff. + * Create the file programmaticaly, then do some simple checks + * (number of pages, sizes, colors). Use -Dseed=X to set + * the random generator seed. + * + * @run main MultiPageTest + * @key randomness + */ + + +import java.awt.*; +import java.awt.image.*; +import java.io.*; + +import java.util.*; + +import javax.imageio.*; +import javax.imageio.stream.*; + +import jdk.testlibrary.RandomFactory; + + +public class MultiPageTest { + + private final String fileName; + + private final int NUM_IMAGES = 51; + + private final static Random rnd = RandomFactory.getRandom(); + + private final int w[], h[]; + private final Color colors[]; + private final int BLACK_SIZE = 100; + + private final int imageType; + + + public MultiPageTest(int type, String tName) { + + imageType = type; + fileName = "test__" + tName + ".tif"; + + w = new int[NUM_IMAGES + 4]; + h = new int[NUM_IMAGES + 4]; + + for (int i = 2; i < NUM_IMAGES + 2; i++) { + w[i] = 10 + rnd.nextInt(21); + h[i] = 10 + rnd.nextInt(21); + } + + w[0] = BLACK_SIZE; h[0] = BLACK_SIZE; + w[1] = BLACK_SIZE; h[1] = BLACK_SIZE; + w[NUM_IMAGES + 2] = BLACK_SIZE; h[NUM_IMAGES + 2] = BLACK_SIZE; + w[NUM_IMAGES + 3] = BLACK_SIZE; h[NUM_IMAGES + 3] = BLACK_SIZE; + + + colors = new Color[NUM_IMAGES + 4]; + for (int i = 2; i < NUM_IMAGES + 2; ++i) { + colors[i] = new Color( + rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256)); + } + + colors[0] = Color.black; + colors[1] = Color.black; + colors[NUM_IMAGES + 2] = Color.black; + colors[NUM_IMAGES + 3] = Color.black; + } + + + private ImageWriter getTIFFWriter() throws Exception { + + Iterator writers = ImageIO.getImageWritersByFormatName("TIFF"); + if (!writers.hasNext()) { + throw new RuntimeException("No writers available for " + fileName); + } + return writers.next(); + } + + private ImageReader getTIFFReader() throws Exception { + + Iterator readers = ImageIO.getImageReadersByFormatName("TIFF"); + if (!readers.hasNext()) { + throw new RuntimeException("No readers available for " + fileName); + } + return readers.next(); + } + + + private void createImage() throws Exception { + + OutputStream s = new BufferedOutputStream(new FileOutputStream(fileName)); + try (ImageOutputStream ios = ImageIO.createImageOutputStream(s)) { + + ImageWriter writer = getTIFFWriter(); + writer.setOutput(ios); + + Graphics g; + + BufferedImage blackImg = + new BufferedImage(BLACK_SIZE, BLACK_SIZE, imageType); + g = blackImg.getGraphics(); + g.setColor(Color.black); + g.fillRect(0, 0, BLACK_SIZE, BLACK_SIZE); + + writer.prepareWriteSequence(null); + + for (int i = 2; i < NUM_IMAGES + 2; i++) { + BufferedImage img = new BufferedImage(w[i], h[i], imageType); + + g = img.getGraphics(); + g.setColor(colors[i]); + g.fillRect(0, 0, w[i], h[i]); + + writer.writeToSequence(new IIOImage(img, null, null), null); + } + + writer.endWriteSequence(); + + // check: insert to the beginning + writer.writeInsert(0, new IIOImage(blackImg, null, null), null); + + // check: insert to non-zero position + writer.writeInsert(1, new IIOImage(blackImg, null, null), null); + + // check: append to the end by index + writer.writeInsert(NUM_IMAGES + 2, + new IIOImage(blackImg, null, null), null); + + // check: append to the end using index "-1" + writer.writeInsert(-1, new IIOImage(blackImg, null, null), null); + + ios.flush(); + writer.dispose(); + } + s.close(); + } + + + + private void readAndCheckImage() throws Exception { + + ImageReader reader = getTIFFReader(); + + ImageInputStream s = ImageIO.createImageInputStream(new File(fileName)); + reader.setInput(s); + + + // check number of pages + if ((NUM_IMAGES + 4) != reader.getNumImages(true)) { + throw new RuntimeException("invalid number of images!"); + } + + // check colors / sizes + for (int i = 0; i < NUM_IMAGES + 4; i++) { + + BufferedImage img = reader.read(i); + + int imw = w[i], imh = h[i]; + + if ( (img.getWidth() != imw) || (img.getHeight() != imh) ) { + throw new RuntimeException("NOK: size(" + i + ")"); + } + + Color + c1 = new Color(img.getRGB(0, 0)), + c2 = new Color(img.getRGB(imw / 2, imh / 2)), + c3 = new Color(img.getRGB(imw - 1, imh - 1)); + if (! (c1.equals(colors[i]) && c1.equals(c2) && c1.equals(c3) ) ) { + throw new RuntimeException("NOK: color(" + i + ")"); + } + } + + reader.dispose(); + s.close(); + } + + public void doTest() throws Exception { + createImage(); + readAndCheckImage(); + } + + public static void main(String[] args) throws Exception { + + int types[] = new int[]{ + BufferedImage.TYPE_INT_RGB, + BufferedImage.TYPE_INT_ARGB, + BufferedImage.TYPE_INT_ARGB_PRE, + BufferedImage.TYPE_INT_BGR, + BufferedImage.TYPE_3BYTE_BGR, + BufferedImage.TYPE_4BYTE_ABGR, + BufferedImage.TYPE_4BYTE_ABGR_PRE + }; + + String names[] = new String[]{ + "TYPE_INT_RGB", + "TYPE_INT_ARGB", + "TYPE_INT_ARGB_PRE", + "TYPE_INT_BGR", + "TYPE_3BYTE_BGR", + "TYPE_4BYTE_ABGR", + "TYPE_4BYTE_ABGR_PRE" + }; + + for (int i = 0; i < types.length; i++) { + System.out.println("image type: " + names[i]); + (new MultiPageTest(types[i], names[i])).doTest(); + } + } +} diff --git a/jdk/test/javax/sound/sampled/AudioInputStream/SkipOnConvertSampleSize.java b/jdk/test/javax/sound/sampled/AudioInputStream/SkipOnConvertSampleSize.java new file mode 100644 index 00000000000..9ed02136301 --- /dev/null +++ b/jdk/test/javax/sound/sampled/AudioInputStream/SkipOnConvertSampleSize.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.ByteArrayInputStream; + +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioFormat.Encoding; +import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; + +/** + * @test + * @bug 6459818 + * @summary Audio A-law and law decoder skip() method not implemented + * @author Klaus Jaensch + */ +public class SkipOnConvertSampleSize { + + private static final int TEST_FRAME_LENGTH = 20000; + + private static void testskipping(final Encoding encoding) throws Exception { + + // create temporary PCM_SIGNED audio file + int pcmBufSize = TEST_FRAME_LENGTH * 2; + byte[] tempAudioBuf = new byte[pcmBufSize]; + for (int i = 0; i < TEST_FRAME_LENGTH; i++) { + // fill with noise + tempAudioBuf[i * 2] = (byte) ((Math.random() - 1) * Byte.MAX_VALUE); + tempAudioBuf[i * 2 + 1] = (byte) ((Math.random() - 1) + * Byte.MAX_VALUE); + } + final ByteArrayInputStream bis = new ByteArrayInputStream(tempAudioBuf); + AudioFormat format = new AudioFormat(8000, 16, 1, true, false); + final AudioInputStream testAis = new AudioInputStream(bis, format, + TEST_FRAME_LENGTH); + final AudioFormat lawFormat; + final byte[] alawAudioBuf; + try (AudioInputStream lawStream = AudioSystem.getAudioInputStream( + encoding, testAis)) { + + lawFormat = lawStream.getFormat(); + int alawFrameSize = lawFormat.getFrameSize(); + + int lawBufSize = TEST_FRAME_LENGTH * alawFrameSize; + alawAudioBuf = new byte[lawBufSize]; + int r1 = 0; + int totalRead = 0; + while ((r1 = lawStream.read(alawAudioBuf, totalRead, + lawBufSize - totalRead)) != -1) { + totalRead += r1; + } + } + + // Convert back to PCM + + ByteArrayInputStream alawBis = new ByteArrayInputStream(alawAudioBuf); + AudioInputStream lawAis = new AudioInputStream(alawBis, lawFormat, + TEST_FRAME_LENGTH); + try (AudioInputStream convPcmStream = AudioSystem.getAudioInputStream( + Encoding.PCM_SIGNED, lawAis)) { + final AudioFormat convPcmAudioFormat = convPcmStream.getFormat(); + final int convPcmFrameSize = convPcmAudioFormat.getFrameSize(); + + // skip half of the stream + final long toSkip = (TEST_FRAME_LENGTH / 2) * convPcmFrameSize; + long skipped = 0; + do { + skipped += convPcmStream.skip(toSkip - skipped); + } while (skipped < toSkip); + int r2 = convPcmStream.read(new byte[convPcmFrameSize]); + // if skip is not correctly implemented we are at the end of the + // stream + if (r2 == -1) { + throw new RuntimeException( + "Skip method of decoder not correctly implemented!"); + } + // otherwise we could read the rest ... + // we don't do it here + } + } + + public static void main(final String[] args) throws Exception { + testskipping(Encoding.ALAW); + testskipping(Encoding.ULAW); + } +} diff --git a/jdk/test/javax/sound/sampled/DirectAudio/bug6400879.java b/jdk/test/javax/sound/sampled/DirectAudio/bug6400879.java index 8ddae19a0aa..770e774f609 100644 --- a/jdk/test/javax/sound/sampled/DirectAudio/bug6400879.java +++ b/jdk/test/javax/sound/sampled/DirectAudio/bug6400879.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2016, 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 @@ -21,12 +21,13 @@ * questions. */ -/* @test - @bug 6400879 - @bug 7100140 - @summary Tests that Start/Stop sequence doesn't hang - @author Alexey Menkov - @run main bug6400879 +/* + * @test + * @bug 6400879 7100140 + * @summary Tests that Start/Stop sequence doesn't hang + * @author Alexey Menkov + * @run main bug6400879 + * @key intermittent */ import javax.sound.sampled.*; diff --git a/jdk/test/javax/sound/sampled/spi/AudioFileReader/RecognizeWaveExtensible.java b/jdk/test/javax/sound/sampled/spi/AudioFileReader/RecognizeWaveExtensible.java new file mode 100644 index 00000000000..59f9d24ade1 --- /dev/null +++ b/jdk/test/javax/sound/sampled/spi/AudioFileReader/RecognizeWaveExtensible.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.ByteArrayInputStream; +import java.io.InputStream; + +import javax.sound.sampled.AudioFileFormat; +import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; + +/** + * @test + * @bug 8147407 + */ +public final class RecognizeWaveExtensible { + + private static byte[] data = { + 82, 73, 70, 70, 72, 0, 0, 0, 87, 65, 86, 69, 102, 109, 116, 32, 40, + 0, 0, 0, -2, -1, 1, 0, 64, 31, 0, 0, 0, 125, 0, 0, 4, 0, 32, 0, 22, + 0, 32, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 16, 0, -128, 0, 0, -86, 0, + 56, -101, 113, 102, 97, 99, 116, 4, 0, 0, 0, 0, 0, 0, 0, 100, 97, + 116, 97, 0, 0, 0, 0 + }; + + public static void main(final String[] args) throws Exception { + final InputStream is = new ByteArrayInputStream(data); + final AudioFileFormat aff = AudioSystem.getAudioFileFormat(is); + System.out.println("AudioFileFormat: " + aff); + try (AudioInputStream ais = AudioSystem.getAudioInputStream(is)) { + System.out.println("AudioFormat: " + ais.getFormat()); + } + System.out.println("new String(data) = " + new String(data)); + } +} diff --git a/jdk/test/javax/sound/sampled/spi/AudioFileReader/ShortHeader.java b/jdk/test/javax/sound/sampled/spi/AudioFileReader/ShortHeader.java new file mode 100644 index 00000000000..1f30587889b --- /dev/null +++ b/jdk/test/javax/sound/sampled/spi/AudioFileReader/ShortHeader.java @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URL; +import java.nio.file.Files; +import java.util.Arrays; + +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.UnsupportedAudioFileException; +import javax.sound.sampled.spi.AudioFileReader; + +import static java.util.ServiceLoader.load; + +/** + * @test + * @bug 8131974 + * @summary Short files should be reported as unsupported + */ +public final class ShortHeader { + + private static byte[] W = {-12, 3, 45}; + + private static byte[] R = new byte[3]; + + public static void main(final String[] args) throws Exception { + final File file = Files.createTempFile("audio", "test").toFile(); + file.deleteOnExit(); + try (final OutputStream fos = new FileOutputStream(file)) { + fos.write(W); + } + + testAS(file); + for (final AudioFileReader afr : load(AudioFileReader.class)) { + testAFR(afr, file); + } + } + + /** + * Tests the part of AudioSystem API, which implemented via + * AudioFileReader. + * + * @see AudioSystem#getAudioFileFormat(InputStream) + * @see AudioSystem#getAudioFileFormat(File) + * @see AudioSystem#getAudioFileFormat(URL) + * @see AudioSystem#getAudioInputStream(InputStream) + * @see AudioSystem#getAudioInputStream(File) + * @see AudioSystem#getAudioInputStream(URL) + */ + private static void testAS(final File file) throws IOException { + try { + AudioSystem.getAudioFileFormat(file); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + try { + AudioSystem.getAudioFileFormat(file.toURL()); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + try { + AudioSystem.getAudioInputStream(file); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + try { + AudioSystem.getAudioInputStream(file.toURL()); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + + // AudioSystem.getAudioXXX(stream) should properly reset the stream + + try (FileInputStream fis = new FileInputStream(file); + InputStream stream = new BufferedInputStream(fis)) { + + try { + AudioSystem.getAudioFileFormat(stream); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + try { + AudioSystem.getAudioInputStream(stream); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + stream.read(R, 0, R.length); + } + + if (!Arrays.equals(R, W)) { + System.err.println("Expected = " + Arrays.toString(W)); + System.err.println("Actual = " + Arrays.toString(R)); + throw new RuntimeException(); + } + } + /** + * Tests the AudioFileReader API directly. + * + * @see AudioFileReader#getAudioFileFormat(InputStream) + * @see AudioFileReader#getAudioFileFormat(File) + * @see AudioFileReader#getAudioFileFormat(URL) + * @see AudioFileReader#getAudioInputStream(InputStream) + * @see AudioFileReader#getAudioInputStream(File) + * @see AudioFileReader#getAudioInputStream(URL) + */ + private static void testAFR(final AudioFileReader fcp, final File file) + throws Exception { + try { + fcp.getAudioFileFormat(file); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + try { + fcp.getAudioFileFormat(file.toURL()); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + try { + fcp.getAudioInputStream(file); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + try { + fcp.getAudioInputStream(file.toURL()); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + + // AudioFileReader should properly reset the stream + + try (FileInputStream fis = new FileInputStream(file); + InputStream stream = new BufferedInputStream(fis)) { + + try { + fcp.getAudioFileFormat(stream); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + try { + fcp.getAudioInputStream(stream); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + stream.read(R, 0, R.length); + } + + if (!Arrays.equals(R, W)) { + System.err.println("Expected = " + Arrays.toString(W)); + System.err.println("Actual = " + Arrays.toString(R)); + throw new RuntimeException(); + } + } +} diff --git a/jdk/test/javax/sound/sampled/spi/AudioFileWriter/WriteUnsupportedAudioFormat.java b/jdk/test/javax/sound/sampled/spi/AudioFileWriter/WriteUnsupportedAudioFormat.java new file mode 100644 index 00000000000..893205944c3 --- /dev/null +++ b/jdk/test/javax/sound/sampled/spi/AudioFileWriter/WriteUnsupportedAudioFormat.java @@ -0,0 +1,208 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.List; + +import javax.sound.sampled.AudioFileFormat; +import javax.sound.sampled.AudioFileFormat.Type; +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.spi.AudioFileWriter; + +import static java.util.ServiceLoader.load; +import static javax.sound.sampled.AudioFileFormat.Type.AIFC; +import static javax.sound.sampled.AudioFileFormat.Type.AIFF; +import static javax.sound.sampled.AudioFileFormat.Type.AU; +import static javax.sound.sampled.AudioFileFormat.Type.SND; +import static javax.sound.sampled.AudioFileFormat.Type.WAVE; + +/** + * @test + * @bug 8064800 + */ +public final class WriteUnsupportedAudioFormat { + + /** + * We will try to use all formats, in this case all our providers will be + * covered by supported/unsupported formats. + */ + private static final List formats = new ArrayList<>(23000); + + private static final AudioFormat.Encoding[] encodings = { + AudioFormat.Encoding.ALAW, AudioFormat.Encoding.ULAW, + AudioFormat.Encoding.PCM_SIGNED, AudioFormat.Encoding.PCM_UNSIGNED, + AudioFormat.Encoding.PCM_FLOAT, new AudioFormat.Encoding("Test") + }; + + private static final int[] sampleRates = { + /*AudioSystem.NOT_SPECIFIED,*/ 8000, 11025, 16000, 22050, 32000, + 37800, 44056, 44100, 47250, 48000, 50000, 50400, 88200, 96000, + 176400, 192000, 352800, 2822400, 5644800 + }; + + private static final int[] sampleBits = { + /*AudioSystem.NOT_SPECIFIED, 4,*/ 8,/* 11,*/ 16/*, 20*/, 24, + 32/*, 48, 64, 128*/ + }; + + public static final int BUFFER_LEN = 127; + + private static final int[] channels = { + /*AudioSystem.NOT_SPECIFIED,*/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + }; + + static final Type[] types = { + WAVE, AU, AIFF, AIFC, SND, new Type("TestName", "TestExt") + }; + + private static final File FILE; + + static { + try { + FILE = File.createTempFile("sound", null); + } catch (final IOException e) { + throw new RuntimeException(e); + } + FILE.deleteOnExit(); + + for (final Boolean end : new boolean[]{false, true}) { + for (final int sampleSize : sampleBits) { + for (final int sampleRate : sampleRates) { + for (final int channel : channels) { + for (final AudioFormat.Encoding enc : encodings) { + + if (enc.equals(AudioFormat.Encoding.PCM_FLOAT) + && sampleSize != 32) { + continue; + } + if (enc.equals(AudioFormat.Encoding.ALAW) + && sampleSize != 8) { + continue; + } + if (enc.equals(AudioFormat.Encoding.ULAW) + && sampleSize != 8) { + continue; + } + + final int frameSize = ((sampleSize + 7) / 8) + * channel; + formats.add( + new AudioFormat(enc, sampleRate, sampleSize, + channel, frameSize, + sampleRate, end)); + } + } + } + } + } + } + + public static void main(final String[] args) throws Exception { + for (final AudioFileFormat.Type type : types) { + for (final AudioFormat format : formats) { + testAS(type, format); + for (final AudioFileWriter afw : load(AudioFileWriter.class)) { + testAFW(afw, type, format); + } + } + } + } + + /** + * Tests the part of AudioSystem API, which implemented via AudioFileWriter. + */ + private static void testAS(final AudioFileFormat.Type type, + final AudioFormat format) throws Exception { + final AudioInputStream ais = getStream(format); + final OutputStream buffer = new ByteArrayOutputStream(BUFFER_LEN); + + if (AudioSystem.isFileTypeSupported(type, ais)) { + if (!AudioSystem.isFileTypeSupported(type)) { + throw new RuntimeException(type + ", " + format); + } + try { + AudioSystem.write(ais, type, buffer); + AudioSystem.write(ais, type, FILE); + } catch (final IllegalArgumentException e) { + throw new RuntimeException(type + ", " + format, e); + } + } else { + try { + AudioSystem.write(ais, type, buffer); + throw new RuntimeException(type + ", " + format); + } catch (final IllegalArgumentException ignored) { + } + try { + AudioSystem.write(ais, type, FILE); + throw new RuntimeException(type + ", " + format); + } catch (final IllegalArgumentException ignored) { + } + } + } + + /** + * Tests the AudioFileWriter API directly. + */ + private static void testAFW(final AudioFileWriter afw, + final AudioFileFormat.Type type, + final AudioFormat format) throws Exception { + final AudioInputStream ais = getStream(format); + final OutputStream buffer = new ByteArrayOutputStream(BUFFER_LEN); + + if (afw.isFileTypeSupported(type, ais)) { + if (!afw.isFileTypeSupported(type)) { + throw new RuntimeException(type + "," + format + ',' + afw); + } + try { + afw.write(ais, type, buffer); + afw.write(ais, type, FILE); + } catch (final IllegalArgumentException e) { + throw new RuntimeException(type + "," + format + ',' + afw, e); + } + } else { + try { + afw.write(ais, type, buffer); + throw new RuntimeException(type + "," + format + ',' + afw); + } catch (final IllegalArgumentException ignored) { + } + try { + afw.write(ais, type, FILE); + throw new RuntimeException(type + "," + format + ',' + afw); + } catch (final IllegalArgumentException ignored) { + } + } + } + + private static AudioInputStream getStream(final AudioFormat format) { + final InputStream in = new ByteArrayInputStream(new byte[BUFFER_LEN]); + return new AudioInputStream(in, format, 10); + } +} diff --git a/jdk/test/javax/sound/sampled/spi/FormatConversionProvider/GetAudioStreamConversionSupported.java b/jdk/test/javax/sound/sampled/spi/FormatConversionProvider/GetAudioStreamConversionSupported.java new file mode 100644 index 00000000000..c12e13f9b71 --- /dev/null +++ b/jdk/test/javax/sound/sampled/spi/FormatConversionProvider/GetAudioStreamConversionSupported.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.ByteArrayInputStream; +import java.io.InputStream; + +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.spi.FormatConversionProvider; + +import static java.util.ServiceLoader.load; + +/** + * @test + * @bug 8146144 + */ +public final class GetAudioStreamConversionSupported { + + static final AudioFormat.Encoding[] encodings = { + AudioFormat.Encoding.ALAW, AudioFormat.Encoding.ULAW, + AudioFormat.Encoding.PCM_SIGNED, AudioFormat.Encoding.PCM_UNSIGNED, + AudioFormat.Encoding.PCM_FLOAT, new AudioFormat.Encoding("Test") + }; + + public static void main(final String[] args) { + for (final int sampleSize : new int[]{4, 8, 16, 24, 32}) { + for (final AudioFormat.Encoding enc : encodings) { + for (final Boolean endian : new boolean[]{false, true}) { + testAS(enc, endian, sampleSize); + for (final FormatConversionProvider fcp : load + (FormatConversionProvider.class)) { + testFCP(fcp, enc, endian, sampleSize); + } + } + } + } + } + + /** + * Tests the part of AudioSystem API, which implemented via + * FormatConversionProvider. + *

          + * AudioSystem always support conversion to the same encoding/format. + */ + private static void testAS(final AudioFormat.Encoding enc, + final Boolean endian, final int sampleSize) { + final AudioInputStream ais = getStream(enc, endian, sampleSize); + final AudioFormat format = ais.getFormat(); + if (!AudioSystem.isConversionSupported(enc, format)) { + throw new RuntimeException("Format: " + format); + } + if (!AudioSystem.isConversionSupported(format, format)) { + throw new RuntimeException("Format: " + format); + } + AudioSystem.getAudioInputStream(enc, ais); + AudioSystem.getAudioInputStream(format, ais); + } + + /** + * Tests the FormatConversionProvider API directly. + */ + private static void testFCP(final FormatConversionProvider fcp, + final AudioFormat.Encoding enc, + final Boolean endian, final int sampleSize) { + System.out.println("fcp = " + fcp); + final AudioInputStream ais = getStream(enc, endian, sampleSize); + final AudioFormat frmt = ais.getFormat(); + if (fcp.isConversionSupported(enc, frmt)) { + try { + fcp.getAudioInputStream(enc, ais); + } catch (final IllegalArgumentException ex) { + throw new RuntimeException("Format: " + frmt, ex); + } + } else { + try { + fcp.getAudioInputStream(enc, ais); + throw new RuntimeException("Format: " + frmt); + } catch (final IllegalArgumentException ignored) { + } + try { + fcp.getAudioInputStream(frmt, ais); + throw new RuntimeException("Format: " + frmt); + } catch (final IllegalArgumentException ignored) { + } + } + if (fcp.isConversionSupported(frmt, frmt)) { + try { + fcp.getAudioInputStream(enc, ais); + fcp.getAudioInputStream(frmt, ais); + } catch (final IllegalArgumentException ex) { + throw new RuntimeException("Format: " + frmt, ex); + } + } else { + try { + fcp.getAudioInputStream(frmt, ais); + throw new RuntimeException("Format: " + frmt); + } catch (final IllegalArgumentException ignored) { + } + } + } + + private static AudioInputStream getStream(final AudioFormat.Encoding enc, + final Boolean end, + final int sampleSize) { + final AudioFormat ftmt + = new AudioFormat(enc, 8000, sampleSize, 1, 1, 8000, end); + final byte[] fakedata = new byte[100]; + final InputStream in = new ByteArrayInputStream(fakedata); + return new AudioInputStream(in, ftmt, fakedata.length); + } +} diff --git a/jdk/test/javax/sound/sampled/spi/FormatConversionProvider/GetTargetIsSupported.java b/jdk/test/javax/sound/sampled/spi/FormatConversionProvider/GetTargetIsSupported.java new file mode 100644 index 00000000000..2a44b89ff19 --- /dev/null +++ b/jdk/test/javax/sound/sampled/spi/FormatConversionProvider/GetTargetIsSupported.java @@ -0,0 +1,294 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioFormat.Encoding; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.spi.FormatConversionProvider; + +import static java.util.ServiceLoader.load; + +/** + * @test + * @bug 8146144 + */ +public final class GetTargetIsSupported { + + /** + * We will try to use all formats, in this case all our providers will be + * covered by supported/unsupported formats. + */ + private static final List formats = new ArrayList<>(23000); + + private static final Encoding[] encodings = { + Encoding.ALAW, Encoding.ULAW, Encoding.PCM_SIGNED, + Encoding.PCM_UNSIGNED, Encoding.PCM_FLOAT, new Encoding("Test") + }; + + private static final int[] sampleRates = { + AudioSystem.NOT_SPECIFIED, 8000, 11025, 16000, 22050, 32000, 37800, + 44056, 44100, 47250, 48000, 50000, 50400, 88200, 96000, 176400, + 192000, 352800, 2822400, 5644800 + }; + + private static final int[] sampleBits = { + AudioSystem.NOT_SPECIFIED, 4, 8, 11, 16, 20, 24, 32, 48, 64, 128 + }; + + private static final int[] channels = { + AudioSystem.NOT_SPECIFIED, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + }; + + static { + for (final Boolean end : new boolean[]{false, true}) { + for (final int sampleSize : sampleBits) { + for (final int sampleRate : sampleRates) { + for (final int channel : channels) { + for (final Encoding enc : encodings) { + formats.add(new AudioFormat(enc, sampleRate, + sampleSize, channel, + 1, sampleRate, end)); + } + } + } + } + } + } + + public static void main(final String[] args) { + for (final AudioFormat format : formats) { + testAS(format); + for (final FormatConversionProvider fcp : load + (FormatConversionProvider.class)) { + testFCP(fcp, format); + } + } + } + + /** + * Tests the part of AudioSystem API, which implemented via + * FormatConversionProvider. + * + * @see AudioSystem#getTargetEncodings(Encoding) + * @see AudioSystem#getTargetEncodings(AudioFormat) + * @see AudioSystem#getTargetFormats(Encoding, AudioFormat) + * @see AudioSystem#isConversionSupported(AudioFormat, AudioFormat) + * @see AudioSystem#isConversionSupported(Encoding, AudioFormat) + */ + private static void testAS(final AudioFormat source) { + Encoding[] all = AudioSystem.getTargetEncodings(source.getEncoding()); + Encoding[] part = AudioSystem.getTargetEncodings(source); + + // Check encodings which are reported as supported + for (final Encoding enc : part) { + // If encoding is reported for the source format means that + // the list of target formats should not be empty + AudioFormat[] targets = AudioSystem.getTargetFormats(enc, source); + // all reported formats should be supported + for (final AudioFormat target : targets) { + if (!AudioSystem.isConversionSupported(target, source)) { + throw new RuntimeException("Error:" + enc); + } + if (!enc.equals(target.getEncoding())) { + throw new RuntimeException("Error:" + enc); + } + } + // If encoding is reported for the source format means that + // conversion source -> encoding is supported + if (!AudioSystem.isConversionSupported(enc, source)) { + throw new RuntimeException("Error:" + enc); + } + // encoding for a particular source should be included in the + // list of all encodings for the source's encoding + if (!Arrays.asList(all).contains(enc)) { + throw new RuntimeException("Error:" + enc); + } + // If conversion source -> encoding is supported then an + // array of target formats should not be empty + if (source.getEncoding().equals(enc)) { + // this is unspecified but we works this way + if (!isContains(source, targets)) { + throw new RuntimeException("Error:" + enc); + } + } else { + if (targets.length == 0) { + throw new RuntimeException("Error:" + enc); + } + } + } + + // Check all encodings + for (final Encoding enc : encodings) { + AudioFormat[] targets = AudioSystem.getTargetFormats(enc, source); + // If target format is reported for the source format means that + // conversion source -> target is supported + for (final AudioFormat target : targets) { + if (!AudioSystem.isConversionSupported(target, source)) { + throw new RuntimeException("Error:" + enc); + } + if (!enc.equals(target.getEncoding())) { + throw new RuntimeException("Error:" + enc); + } + } + if (AudioSystem.isConversionSupported(enc, source)) { + // encoding for a particular source should be included in the + // list of all encodings for the source's encoding + if (!Arrays.asList(all).contains(enc)) { + throw new RuntimeException("Error:" + enc); + } + if (!Arrays.asList(part).contains(enc)) { + System.out.println("enc = " + enc); + System.out.println("part = " + Arrays.toString(part)); + System.out.println("source = " + source); + throw new RuntimeException("Error:" + enc); + } + // If conversion source -> encoding is supported then an + // array of target formats should not be empty + if (source.getEncoding().equals(enc)) { + // this is unspecified but we works this way + if (!isContains(source, targets)) { + throw new RuntimeException("Error:" + enc); + } + } else { + if (targets.length == 0) { + throw new RuntimeException("Error:" + enc); + } + } + } else { + // If conversion source -> encoding is not supported then an + // array of target formats should be empty + if (targets.length != 0) { + throw new RuntimeException("Error:" + enc); + } + if (Arrays.asList(part).contains(enc)) { + throw new RuntimeException("Error:" + enc); + } + } + } + } + + /** + * Tests the FormatConversionProvider API directly. + * + * @see FormatConversionProvider#getTargetEncodings() + * @see FormatConversionProvider#getTargetEncodings(AudioFormat) + * @see FormatConversionProvider#getTargetFormats(Encoding, AudioFormat) + * @see FormatConversionProvider#isTargetEncodingSupported(Encoding) + * @see FormatConversionProvider#isConversionSupported(Encoding, + * AudioFormat) + * @see FormatConversionProvider#isConversionSupported(AudioFormat, + * AudioFormat) + */ + private static void testFCP(final FormatConversionProvider fcp, + final AudioFormat source) { + final Encoding[] all = fcp.getTargetEncodings(); + for (final Encoding enc : all) { + if (!fcp.isTargetEncodingSupported(enc)) { + throw new RuntimeException("Error:" + enc); + } + } + + // Check encodings which are reported as supported + final Encoding[] part = fcp.getTargetEncodings(source); + for (final Encoding enc : part) { + // If encoding is reported for the source format means that + // the list of target formats should not be empty for this encoding + AudioFormat[] targets = fcp.getTargetFormats(enc, source); + // all reported formats should be supported + for (final AudioFormat target : targets) { + if (!fcp.isConversionSupported(target, source)) { + throw new RuntimeException("Error:" + enc); + } + if (!enc.equals(target.getEncoding())) { + throw new RuntimeException("Error:" + enc); + } + } + // If encoding is reported for the source format means that + // conversion source -> encoding is supported + if (!fcp.isConversionSupported(enc, source)) { + throw new RuntimeException("Error:" + enc); + } + // If conversion source -> encoding is supported then an + // array of target formats should not be empty + if (targets.length == 0) { + throw new RuntimeException("Error:" + enc); + } + // encoding for a particular source should be included in the + // list of all encodings for the source's encoding + if (!Arrays.asList(all).contains(enc)) { + throw new RuntimeException("Error:" + enc); + } + } + // Check all encodings + for (final Encoding enc : encodings) { + AudioFormat[] targets = fcp.getTargetFormats(enc, source); + // If target format is reported for the source format means that + // conversion source -> target is supported + for (final AudioFormat target : targets) { + if (!fcp.isConversionSupported(target, source)) { + throw new RuntimeException("Error:" + enc); + } + if (!enc.equals(target.getEncoding())) { + throw new RuntimeException("Error:" + enc); + } + } + if (fcp.isConversionSupported(enc, source)) { + // If conversion source -> encoding is supported then an + // array of target formats should not be empty + if (targets.length == 0) { + throw new RuntimeException("Error:" + enc); + } + // encoding for a particular source should be included in the + // list of all encodings for the source's encoding + if (!Arrays.asList(all).contains(enc)) { + throw new RuntimeException("Error:" + enc); + } + if (!Arrays.asList(part).contains(enc)) { + throw new RuntimeException("Error:" + enc); + } + } else { + // If conversion source -> encoding is not supported then an + // array of target formats should be empty + if (targets.length != 0) { + throw new RuntimeException("Error:" + enc); + } + if (Arrays.asList(part).contains(enc)) { + throw new RuntimeException("Error:" + enc); + } + } + } + } + + private static boolean isContains(AudioFormat obj, AudioFormat[] array) { + for (final AudioFormat format : array) { + if (obj.matches(format)) { + return true; + } + } + return false; + } +} diff --git a/jdk/test/javax/swing/Action/8133039/bug8133039.java b/jdk/test/javax/swing/Action/8133039/bug8133039.java new file mode 100644 index 00000000000..94ad929707b --- /dev/null +++ b/jdk/test/javax/swing/Action/8133039/bug8133039.java @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Robot; +import java.awt.event.ActionEvent; +import java.awt.event.KeyEvent; +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.KeyStroke; +import javax.swing.SwingUtilities; +import sun.swing.UIAction; + +/** + * @test + * @bug 8133039 + * @summary Provide public API to sun.swing.UIAction#isEnabled(Object) + * @author Alexander Scherbatiy + */ +public class bug8133039 { + + private static volatile int ACTION_PERFORMED_CALLS = 0; + private static volatile int ACTION_ACCEPTED_CALLS = 0; + + public static void main(String[] args) throws Exception { + testActionNotification(); + testPopupAction(); + } + + private static void testActionNotification() { + + KeyEvent keyEvent = new KeyEvent(new JLabel("Test"), 0, 0, 0, 0, 'A'); + SenderObject rejectedSenderObject = new SenderObject(); + SwingUtilities.notifyAction(new TestAction(false), null, keyEvent, + rejectedSenderObject, 0); + + if (rejectedSenderObject.accepted) { + throw new RuntimeException("The sender is incorrectly accepted!"); + } + + if (rejectedSenderObject.performed) { + throw new RuntimeException("The action is incorrectly performed!"); + } + + SenderObject acceptedSenderObject = new SenderObject(); + SwingUtilities.notifyAction(new TestAction(true), null, keyEvent, + acceptedSenderObject, 0); + + if (!acceptedSenderObject.accepted) { + throw new RuntimeException("The sender is not accepted!"); + } + + if (!acceptedSenderObject.performed) { + throw new RuntimeException("The action is not performed!"); + } + } + + private static void testPopupAction() throws Exception { + + SwingUtilities.invokeAndWait(bug8133039::createAndShowGUI); + + Robot robot = new Robot(); + robot.setAutoDelay(50); + robot.waitForIdle(); + + robot.keyPress(KeyEvent.VK_A); + robot.keyRelease(KeyEvent.VK_A); + robot.waitForIdle(); + + if (ACTION_ACCEPTED_CALLS != 1) { + throw new RuntimeException("Method accept is not invoked!"); + } + + if (ACTION_PERFORMED_CALLS != 1) { + throw new RuntimeException("Method actionPerformed is not invoked!"); + } + + robot.keyPress(KeyEvent.VK_A); + robot.keyRelease(KeyEvent.VK_A); + robot.waitForIdle(); + + if (ACTION_ACCEPTED_CALLS != 2) { + throw new RuntimeException("Method accept is not invoked!"); + } + + if (ACTION_PERFORMED_CALLS != 1) { + throw new RuntimeException("Method actionPerformed is invoked twice!"); + } + } + + private static void createAndShowGUI() { + + JFrame frame = new JFrame(); + frame.setSize(300, 300); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + JComboBox comboBox = new JComboBox<>(new String[]{"1", "2", "3"}); + + Action showPopupAction = new ShowPopupAction(); + comboBox.getInputMap().put(KeyStroke.getKeyStroke("A"), "showPopup"); + comboBox.getActionMap().put("showPopup", showPopupAction); + + frame.getContentPane().add(comboBox); + frame.setVisible(true); + } + + private static class ShowPopupAction extends UIAction { + + public ShowPopupAction() { + super("showPopup"); + } + + @Override + public void actionPerformed(ActionEvent e) { + ACTION_PERFORMED_CALLS++; + Object src = e.getSource(); + if (src instanceof JComboBox) { + ((JComboBox) src).showPopup(); + } + } + + @Override + public boolean accept(Object sender) { + ACTION_ACCEPTED_CALLS++; + if (sender instanceof JComboBox) { + JComboBox c = (JComboBox) sender; + return !c.isPopupVisible(); + } + return false; + } + } + + private static class SenderObject { + + private boolean accepted; + private boolean performed; + } + + private static class TestAction extends AbstractAction { + + private final boolean acceptSender; + + public TestAction(boolean acceptSender) { + this.acceptSender = acceptSender; + } + + @Override + public boolean accept(Object sender) { + ((SenderObject) sender).accepted = acceptSender; + return acceptSender; + } + + @Override + public void actionPerformed(ActionEvent e) { + ((SenderObject) e.getSource()).performed = true; + } + } +} diff --git a/jdk/test/javax/swing/JFileChooser/8016665/JFileChooserOrientation.java b/jdk/test/javax/swing/JFileChooser/8016665/JFileChooserOrientation.java new file mode 100644 index 00000000000..4296d48fd2d --- /dev/null +++ b/jdk/test/javax/swing/JFileChooser/8016665/JFileChooserOrientation.java @@ -0,0 +1,253 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 8016665 + * @summary verifies different behaviour of JFileChooser changing orientation + * @run main JFileChooserOrientation + */ +import java.awt.Color; +import java.awt.ComponentOrientation; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.BorderFactory; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextArea; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; + +public class JFileChooserOrientation { + + private static JFrame frame; + private static GridBagLayout layout; + private static JPanel panel; + private static JPanel lookAndFeelPanel; + private static JPanel orientationPanel; + private static JPanel passFailPanel; + private static JTextArea instructionsTextArea; + private static JLabel lookAndFeelLabel; + private static JLabel orientationLabel; + private static JComboBox lookAndFeelComboBox; + private static JComboBox orientationComboBox; + + private static JButton fileChooserButton; + private static JButton passButton; + private static JButton failButton; + private static JFileChooser openChooser; + private static UIManager.LookAndFeelInfo[] lookAndFeelArray; + + private static final String orientationLTR = " Left to Right"; + private static final String orientationRTL = " Right to Left"; + private static final String fileChooserString = "Show File Chooser"; + + public static void main(String[] args) throws Exception { + createManualTestUI(); + } + + private static void createManualTestUI() throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + layout = new GridBagLayout(); + GridBagConstraints gbc = new GridBagConstraints(); + panel = new JPanel(layout); + gbc.fill = GridBagConstraints.HORIZONTAL; + gbc.gridx = 0; + gbc.gridy = 0; + instructionsTextArea = new JTextArea(); + String instructions + = "1) Select Look and feel from combobox" + + "\n2) Select component orientation" + + "\n3) Click on \"Show File Chooser\"" + + "\n4) Check if orientation is as selected" + + "\n5) Press \"Cancel\" on the File Chooser Dialog" + + "\n\n Perform steps 1- 4 for all LAFs & orientations" + + "\n If all are correct press Pass or else press Fail"; + instructionsTextArea.setText(instructions); + instructionsTextArea.setBorder( + BorderFactory.createLineBorder(Color.black)); + panel.add(instructionsTextArea, gbc); + + lookAndFeelPanel = new JPanel(); + lookAndFeelPanel.setBorder( + BorderFactory.createLineBorder(Color.black)); + lookAndFeelLabel = new JLabel("Look And Feel: "); + gbc.gridx = 0; + gbc.gridy = 0; + lookAndFeelPanel.add(lookAndFeelLabel, gbc); + + lookAndFeelComboBox = new JComboBox(); + lookAndFeelArray = UIManager.getInstalledLookAndFeels(); + for (UIManager.LookAndFeelInfo lookAndFeelItem + : lookAndFeelArray) { + lookAndFeelComboBox.addItem(lookAndFeelItem.getClassName()); + } + gbc.gridx = 1; + gbc.gridy = 0; + lookAndFeelPanel.add(lookAndFeelComboBox, gbc); + gbc.gridx = 0; + gbc.gridy = 1; + panel.add(lookAndFeelPanel, gbc); + + orientationPanel = new JPanel(); + orientationPanel.setBorder( + BorderFactory.createLineBorder(Color.black)); + orientationLabel = new JLabel("Orientation: "); + gbc.gridx = 0; + gbc.gridy = 0; + orientationPanel.add(orientationLabel, gbc); + + orientationComboBox = new JComboBox(); + orientationComboBox.addItem(orientationLTR); + orientationComboBox.addItem(orientationRTL); + gbc.gridx = 1; + gbc.gridy = 0; + orientationPanel.add(orientationComboBox, gbc); + gbc.gridx = 0; + gbc.gridy = 2; + panel.add(orientationPanel, gbc); + + fileChooserButton = new JButton(fileChooserString); + fileChooserButton.setActionCommand(fileChooserString); + + fileChooserButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + + try { + showFileChooser(); + } catch (Exception ex) { + Logger.getLogger(JFileChooserOrientation.class + .getName()).log(Level.SEVERE, null, ex); + } + + } + }); + gbc.gridx = 0; + gbc.gridy = 3; + panel.add(fileChooserButton, gbc); + + passFailPanel = new JPanel(); + passFailPanel.setBorder(BorderFactory.createLineBorder(Color.black)); + passButton = new JButton(" Pass "); + passButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + try { + pass(); + } catch (Exception ex) { + Logger.getLogger(JFileChooserOrientation.class + .getName()).log(Level.SEVERE, null, ex); + } + } + }); + gbc.gridx = 0; + gbc.gridy = 0; + passFailPanel.add(passButton, gbc); + failButton = new JButton(" Fail "); + failButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + try { + fail(); + } catch (Exception ex) { + Logger.getLogger(JFileChooserOrientation.class + .getName()).log(Level.SEVERE, null, ex); + } + } + }); + gbc.gridx = 1; + gbc.gridy = 0; + passFailPanel.add(failButton, gbc); + gbc.gridx = 0; + gbc.gridy = 4; + panel.add(passFailPanel, gbc); + frame = new JFrame(); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setContentPane(panel); + frame.pack(); + frame.setVisible(true); + } + }); + } + + private static void pass() throws Exception + { + + frame.dispose(); + + } + + private static void fail() throws Exception + { + + frame.dispose(); + System.err.println(lookAndFeelComboBox.getSelectedItem().toString() + + " : Incorrect Orientation"); + } + + private static void showFileChooser() throws Exception { + if (tryLookAndFeel(lookAndFeelComboBox.getSelectedItem().toString())) { + + openChooser = new JFileChooser(); + + ComponentOrientation orientation + = ComponentOrientation.UNKNOWN; + + switch (orientationComboBox.getSelectedItem().toString()) { + case orientationLTR: + orientation = ComponentOrientation.LEFT_TO_RIGHT; + break; + case orientationRTL: + orientation = ComponentOrientation.RIGHT_TO_LEFT; + break; + } + openChooser.setComponentOrientation(orientation); + openChooser.showOpenDialog(frame); + + } + } + private static boolean tryLookAndFeel(String lookAndFeelString) + throws Exception { + try { + UIManager.setLookAndFeel( + lookAndFeelString); + } catch (UnsupportedLookAndFeelException + | ClassNotFoundException + | InstantiationException + | IllegalAccessException e) { + return false; + } + return true; + } +} diff --git a/jdk/test/javax/swing/JInternalFrame/4769772/TestJInternalFrameIconify.java b/jdk/test/javax/swing/JInternalFrame/4769772/TestJInternalFrameIconify.java new file mode 100644 index 00000000000..12bd49d1b49 --- /dev/null +++ b/jdk/test/javax/swing/JInternalFrame/4769772/TestJInternalFrameIconify.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4769772 + * @summary JInternalFrame.setIcon(true) before JDesktopPane.add(JIF) causes wrong state + * @run main TestJInternalFrameIconify + */ +import java.beans.PropertyVetoException; +import javax.swing.JFrame; +import javax.swing.JDesktopPane; +import javax.swing.JInternalFrame; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import java.awt.Robot; +import javax.swing.SwingUtilities; + +public class TestJInternalFrameIconify { + + private static JDesktopPane desktopPane; + private static JFrame frame; + private static Robot robot; + private static volatile String errorMessage = ""; + + public static void main(String[] args) throws Exception { + robot = new java.awt.Robot(); + UIManager.LookAndFeelInfo[] lookAndFeelArray + = UIManager.getInstalledLookAndFeels(); + for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) { + String lookAndFeelString = lookAndFeelItem.getClassName(); + if (tryLookAndFeel(lookAndFeelString)) { + createUI(lookAndFeelString); + robot.waitForIdle(); + executeTest(lookAndFeelString); + } + } + if (!"".equals(errorMessage)) { + throw new RuntimeException(errorMessage); + } + } + + private static boolean tryLookAndFeel(String lookAndFeelString) { + try { + UIManager.setLookAndFeel(lookAndFeelString); + return true; + } catch (UnsupportedLookAndFeelException | ClassNotFoundException | + InstantiationException | IllegalAccessException e) { + errorMessage += e.getMessage() + "\n"; + System.err.println("Caught Exception: " + e.getMessage()); + return false; + } + } + + private static void createUI(String lookAndFeelString) throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + frame = new JFrame(lookAndFeelString); + desktopPane = new JDesktopPane(); + frame.getContentPane().add(desktopPane); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + JInternalFrame f = new JInternalFrame("Child ", true, true, + true, true); + f.setSize(200, 300); + f.setLocation(20, 20); + try { + f.setIcon(true); + } catch (PropertyVetoException ex) { + errorMessage += ex.getMessage() + "\n"; + } + desktopPane.add(f); + f.setVisible(true); + + frame.setSize(500, 500); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + }); + + } + + private static void executeTest(String lookAndFeelString) throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + + @Override + public void run() { + try { + JInternalFrame internalFrames[] + = desktopPane.getAllFrames(); + if (internalFrames[0].isShowing()) { + errorMessage += "Test Failed for " + + lookAndFeelString + " look and feel\n"; + System.err.println(errorMessage); + } + } finally { + frame.dispose(); + } + } + }); + } +} diff --git a/jdk/test/javax/swing/JInternalFrame/8145060/TestJInternalFrameMinimize.java b/jdk/test/javax/swing/JInternalFrame/8145060/TestJInternalFrameMinimize.java new file mode 100644 index 00000000000..a8e4001e704 --- /dev/null +++ b/jdk/test/javax/swing/JInternalFrame/8145060/TestJInternalFrameMinimize.java @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8145060 + * @summary Minimizing a JInternalFrame not shifting focus to frame below it + * @library ../../regtesthelpers + * @build Util + * @run main TestJInternalFrameMinimize + */ +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.InputEvent; +import java.beans.PropertyVetoException; +import javax.swing.JFrame; +import javax.swing.JDesktopPane; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JInternalFrame; +import javax.swing.SwingUtilities; +import javax.swing.Timer; + +public class TestJInternalFrameMinimize { + + private static JDesktopPane desktopPane; + private static JFrame frame = new JFrame("Test Frame"); + private static int count = 0; + private static JMenu menu; + private static JMenuBar menuBar; + private static JMenuItem menuItem; + private static Robot robot; + private static ActionListener listener; + private static Timer timer; + private static int counter; + private static boolean testFailed; + + public static void main(String[] args) throws Exception { + robot = new Robot(); + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + createUI(); + } + }); + robot.waitForIdle(); + executeTest(); + if (testFailed) { + throw new RuntimeException("Test Failed"); + } + dispose(); + } + + private static void createUI() { + + desktopPane = new JDesktopPane(); + frame.getContentPane().add(desktopPane); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + menuBar = new JMenuBar(); + frame.setJMenuBar(menuBar); + + menu = new JMenu("File"); + menuBar.add(menu); + + menuItem = new JMenuItem("New Child"); + menuItem.addActionListener( + new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + JInternalFrame f = new JInternalFrame("Child " + + (++count), true, true, true, true); + f.setSize(200, 300); + f.setLocation(count * 20, count * 20); + desktopPane.add(f); + f.setVisible(true); + } + }); + menu.add(menuItem); + frame.setSize(500, 500); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + + private static void executeTest() throws Exception { + + Point point = Util.getCenterPoint(menu); + performMouseOperations(point); + point = Util.getCenterPoint(menuItem); + performMouseOperations(point); + point = Util.getCenterPoint(menu); + performMouseOperations(point); + point = Util.getCenterPoint(menuItem); + performMouseOperations(point); + point = Util.getCenterPoint(menu); + performMouseOperations(point); + point = Util.getCenterPoint(menuItem); + performMouseOperations(point); + point = Util.getCenterPoint(menu); + performMouseOperations(point); + point = Util.getCenterPoint(menuItem); + performMouseOperations(point); + SwingUtilities.invokeAndWait(new Runnable() { + + @Override + public void run() { + listener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent ae) { + JInternalFrame internalFrame + = desktopPane.getSelectedFrame(); + if (internalFrame != null) { + try { + internalFrame.setIcon(true); + ++counter; + } catch (PropertyVetoException ex) { + } + } + if (counter == 4) { + try { + timer.stop(); + JInternalFrame currentSelectedFrame + = desktopPane.getSelectedFrame(); + if (internalFrame.equals(currentSelectedFrame)) { + frame.dispose(); + testFailed = true; + } + } catch (Exception ex) { + } + } + } + }; + } + }); + timer = new Timer(100, listener); + timer.start(); + robot.delay(1000); + } + + private static void dispose() throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + + @Override + public void run() { + frame.dispose(); + } + }); + } + + private static void performMouseOperations(Point point) { + robot.mouseMove(point.x, point.y); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.delay(1000); + robot.waitForIdle(); + } +} diff --git a/jdk/test/javax/swing/JMenu/8067346/bug8067346.java b/jdk/test/javax/swing/JMenu/8067346/bug8067346.java index ffa2fe4a034..561bf466127 100644 --- a/jdk/test/javax/swing/JMenu/8067346/bug8067346.java +++ b/jdk/test/javax/swing/JMenu/8067346/bug8067346.java @@ -27,7 +27,6 @@ @requires (os.family == "windows") @run main bug8067346 */ -import com.sun.java.swing.plaf.windows.WindowsLookAndFeel; import java.awt.Insets; import javax.swing.JFrame; import javax.swing.JMenu; @@ -56,9 +55,17 @@ public class bug8067346 { bug8067346 test = new bug8067346(); try { // set windows look and feel - UIManager.setLookAndFeel(new WindowsLookAndFeel()); + String lnf = + "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"; + UIManager.setLookAndFeel(lnf); } catch (UnsupportedLookAndFeelException e) { runTest = false; + } catch (ClassNotFoundException e) { + runTest = false; + } catch (InstantiationException e) { + runTest = false; + } catch (IllegalAccessException e) { + runTest = false; } if(runTest) { test.createUI(); diff --git a/jdk/test/javax/swing/JOptionPane/8139213/OptionPaneTest.java b/jdk/test/javax/swing/JOptionPane/8139213/OptionPaneTest.java new file mode 100644 index 00000000000..0230ce1b022 --- /dev/null +++ b/jdk/test/javax/swing/JOptionPane/8139213/OptionPaneTest.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8139213 + * @summary Mac OS Aqua X LAF: JOptionPane truncates the first button + * @run main OptionPaneTest + */ +import java.awt.Component; +import java.awt.Insets; +import java.awt.Robot; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; + +public class OptionPaneTest { + + private volatile static boolean testFailed; + private static JDialog dialog; + private static Robot robot; + + public static void main(final String[] args) throws Exception { + robot = new Robot(); + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + try { + JOptionPane optionPane = new JOptionPane("JOptionPane", + JOptionPane.INFORMATION_MESSAGE, + JOptionPane.DEFAULT_OPTION, + null, + new String[]{"3", "2", "1"}, + null); + dialog = optionPane.createDialog("JOptionPane"); + int width = 0; + Component[] comps = optionPane.getComponents(); + for (Component comp : comps) { + if (comp instanceof JPanel) { + Component[] child = ((JPanel) comp).getComponents(); + for (Component c : child) { + if (c instanceof JButton) { + width += c.getWidth(); + } + } + } + } + Insets in = optionPane.getInsets(); + width += in.left + in.right; + if (width > optionPane.getWidth()) { + testFailed = true; + } + } finally { + dialog.dispose(); + } + } + }); + robot.waitForIdle(); + if (testFailed) { + throw new RuntimeException("Test Failed"); + } + } +} diff --git a/jdk/test/javax/swing/JProgressBar/8015748/JProgressBarOrientationRobotTest.java b/jdk/test/javax/swing/JProgressBar/8015748/JProgressBarOrientationRobotTest.java new file mode 100644 index 00000000000..bc2a6855f87 --- /dev/null +++ b/jdk/test/javax/swing/JProgressBar/8015748/JProgressBarOrientationRobotTest.java @@ -0,0 +1,216 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 8015748 + * @summary verifies ProgressBar RightToLeft orientations for all Look and Feels + * @library ../../regtesthelpers + * @build Util + * @run main JProgressBarOrientationRobotTest + */ +import java.awt.Color; +import java.awt.ComponentOrientation; +import java.awt.Point; +import java.awt.Robot; +import javax.swing.JFrame; +import javax.swing.JProgressBar; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; + +public class JProgressBarOrientationRobotTest { + + private static JFrame frame; + private static JProgressBar progressBar; + private static Robot robot; + private static Color colorCenter; + private static Color colorLeft; + private static Color colorRight; + private static final int widthBuffer = 20; + private static volatile String errorString = ""; + + public static void main(String[] args) throws Exception { + robot = new Robot(); + robot.waitForIdle(); + UIManager.LookAndFeelInfo[] lookAndFeelArray + = UIManager.getInstalledLookAndFeels(); + for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) { + executeCase(lookAndFeelItem.getClassName(), + lookAndFeelItem.getName()); + + } + if (!"".equals(errorString)) { + System.err.println(errorString); + } + } + + private static void executeCase(String lookAndFeelString, + String shortenedLandFeelString) throws Exception { + if (tryLookAndFeel(lookAndFeelString)) { + createUI(shortenedLandFeelString); + robot.waitForIdle(); + + createLTR(); + robot.delay(1000); + runTestCase(); + robot.delay(1000); + testCaseLTR(shortenedLandFeelString); + robot.delay(1000); + + createRTL(); + robot.delay(1000); + runTestCase(); + robot.delay(1000); + testCaseRTL(shortenedLandFeelString); + robot.delay(1000); + + cleanUp(); + } + + } + + private static void createUI(final String shortenedLookAndFeelString) + throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + progressBar = new JProgressBar(); + progressBar.setValue(30); + frame = new JFrame(shortenedLookAndFeelString); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.getContentPane().add(progressBar); + frame.pack(); + frame.setSize(500, frame.getSize().height); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + frame.toFront(); + } + }); + } + + private static void createLTR() + throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + progressBar.applyComponentOrientation( + ComponentOrientation.LEFT_TO_RIGHT); + progressBar.repaint(); + } + }); + } + + private static void createRTL() + throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + progressBar.applyComponentOrientation( + ComponentOrientation.RIGHT_TO_LEFT); + progressBar.repaint(); + } + }); + } + + private static void runTestCase() throws Exception { + Point centerPoint = Util.getCenterPoint(progressBar); + colorCenter = robot.getPixelColor(centerPoint.x, centerPoint.y); + colorRight = robot.getPixelColor( + (centerPoint.x + progressBar.getWidth() / 2 - widthBuffer), + centerPoint.y); + colorLeft = robot.getPixelColor( + (centerPoint.x - progressBar.getWidth() / 2 + widthBuffer), + centerPoint.y); + robot.waitForIdle(); + } + + private static void testCaseLTR(String shortenedLookAndFeelString) + throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + + if (colorCenter.equals(colorRight)) { + if (!colorCenter.equals(colorLeft)) { + System.out.println("[" + shortenedLookAndFeelString + + "]: LTR orientation test passed"); + } + } else { + frame.dispose(); + String error = "[" + shortenedLookAndFeelString + + "]: [Error]: LTR orientation test failed"; + errorString += error; + System.err.println(error); + } + } + }); + + } + + private static void testCaseRTL(String shortenedLookAndFeelString) + throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + if (colorCenter.equals(colorLeft)) { + if (!colorCenter.equals(colorRight)) { + System.out.println("[" + shortenedLookAndFeelString + + "]: RTL orientation test passed"); + } + } else { + frame.dispose(); + String error = "[" + shortenedLookAndFeelString + + "]: [Error]: LTR orientation test failed"; + errorString += error; + System.err.println(error); + } + } + }); + } + + private static void cleanUp() throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + frame.dispose(); + } + }); + } + + private static boolean tryLookAndFeel(String lookAndFeelString) + throws Exception { + try { + UIManager.setLookAndFeel( + lookAndFeelString); + + } catch (UnsupportedLookAndFeelException + | ClassNotFoundException + | InstantiationException + | IllegalAccessException e) { + errorString += e.getMessage() + "\n"; + System.err.println("[Exception]: " + e.getMessage()); + return false; + } + return true; + } +} diff --git a/jdk/test/javax/swing/JSpinner/8008657/bug8008657.java b/jdk/test/javax/swing/JSpinner/8008657/bug8008657.java index 3cbe7a61d03..1acb45da597 100644 --- a/jdk/test/javax/swing/JSpinner/8008657/bug8008657.java +++ b/jdk/test/javax/swing/JSpinner/8008657/bug8008657.java @@ -32,6 +32,8 @@ import javax.swing.SpinnerDateModel; import javax.swing.SpinnerModel; import javax.swing.SpinnerNumberModel; import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; /** * @test @@ -44,18 +46,28 @@ public class bug8008657 { private static Robot robot; private static JSpinner spinner; + private static JFrame frame; public static void main(String[] args) throws Exception { robot = new Robot(); + UIManager.LookAndFeelInfo[] lookAndFeelArray + = UIManager.getInstalledLookAndFeels(); + for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) { + executeCase(lookAndFeelItem.getClassName()); + } - SwingUtilities.invokeAndWait(() -> { + } + static void executeCase(String lookAndFeelString) throws Exception { + if (tryLookAndFeel(lookAndFeelString)) { + SwingUtilities.invokeAndWait(() -> { createDateSpinner(); createAndShowUI(); }); robot.waitForIdle(); testSpinner(false); + cleanUp(); SwingUtilities.invokeAndWait(() -> { createNumberSpinner(); @@ -64,14 +76,16 @@ public class bug8008657 { robot.waitForIdle(); testSpinner(true); + cleanUp(); + } } - static void testSpinner(boolean checkHorizontalAligment) throws Exception { SwingUtilities.invokeAndWait(() -> { spinner.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); - }); + + }); robot.waitForIdle(); SwingUtilities.invokeAndWait(() -> { @@ -145,10 +159,34 @@ public class bug8008657 { } static void createAndShowUI() { - JFrame frame = new JFrame("Test"); + frame = new JFrame("Test"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(300, 100); frame.getContentPane().add(spinner); frame.setVisible(true); } + + private static void cleanUp() throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + frame.dispose(); + } + }); + } + + private static boolean tryLookAndFeel(String lookAndFeelString) + throws Exception { + try { + UIManager.setLookAndFeel( + lookAndFeelString); + + } catch (UnsupportedLookAndFeelException + | ClassNotFoundException + | InstantiationException + | IllegalAccessException e) { + return false; + } + return true; + } } diff --git a/jdk/test/javax/swing/JTabbedPane/8134116/Bug8134116.java b/jdk/test/javax/swing/JTabbedPane/8134116/Bug8134116.java index 15aa9f43260..ed408d969d9 100644 --- a/jdk/test/javax/swing/JTabbedPane/8134116/Bug8134116.java +++ b/jdk/test/javax/swing/JTabbedPane/8134116/Bug8134116.java @@ -4,7 +4,6 @@ import java.awt.event.KeyEvent; import java.util.ArrayList; import java.util.List; import javax.accessibility.Accessible; -import javax.accessibility.AccessibleComponent; import javax.accessibility.AccessibleContext; import javax.accessibility.AccessibleState; import javax.accessibility.AccessibleStateSet; @@ -19,6 +18,8 @@ import javax.swing.plaf.nimbus.NimbusLookAndFeel; */ public class Bug8134116 { + private static volatile Exception exception = null; + public static void main(String args[]) throws Exception { try { @@ -29,75 +30,138 @@ public class Bug8134116 { SwingUtilities.invokeAndWait(() -> { JPanel panel0 = new JPanel(); + JPanel panel2 = new JPanel(); BadPane badPane = new BadPane(); badPane.add("zero", panel0); - badPane.add("one", null); + badPane.add("one", null); // no component + badPane.add("", panel2); // no title + badPane.add("", null); // no component, no title + // but give it that via a tabComponent + JPanel tabComponent = new JPanel(); + JLabel tabComponentLabel = new JLabel("three"); + tabComponent.add(tabComponentLabel); + badPane.setTabComponentAt(3, tabComponent); JFrame frame = new JFrame(); frame.add(badPane); frame.setSize(300, 300); frame.setVisible(true); - AccessibleContext ac = badPane.getAccessibleContext(); - Accessible page0 = ac.getAccessibleChild(0); - if (page0 == null) { - // Not something being tested, but checking anyway - throw new RuntimeException("getAccessibleChild(0) is null"); - } - Accessible page1 = ac.getAccessibleChild(1); - if (page1 == null) { - // Not something being tested, but checking anyway - throw new RuntimeException("getAccessibleChild(1) is null"); - } - // page0 and page1 are a JTabbedPane.Page, a private inner class - // and is an AccessibleContext - // and implements Accessible and AccessibleComponent - AccessibleContext pac0 = page0.getAccessibleContext(); - AccessibleContext pac1 = page1.getAccessibleContext(); + try { + AccessibleContext ac = badPane.getAccessibleContext(); + Accessible page0 = ac.getAccessibleChild(0); + if (page0 == null) { + // Not something being tested, but checking anyway + throw new RuntimeException("getAccessibleChild(0) is null"); + } + Accessible page1 = ac.getAccessibleChild(1); + if (page1 == null) { + // Not something being tested, but checking anyway + throw new RuntimeException("getAccessibleChild(1) is null"); + } + Accessible page2 = ac.getAccessibleChild(2); + Accessible page3 = ac.getAccessibleChild(3); + // page0 - page3 are JTabbedPane.Page, a private inner class + // and is an AccessibleContext + // and implements Accessible and AccessibleComponent + AccessibleContext pac0 = page0.getAccessibleContext(); + AccessibleContext pac1 = page1.getAccessibleContext(); + AccessibleContext pac2 = page2.getAccessibleContext(); + AccessibleContext pac3 = page3.getAccessibleContext(); - // the following would fail if JDK-8134116 fix not present + // test Page.getBounds + // ensure no IndexOutOfBoundsException + Rectangle r0 = pac0.getAccessibleComponent().getBounds(); + // make sure second Bounds is different than first + Rectangle r1 = pac1.getAccessibleComponent().getBounds(); + if (r1.equals(r0)) { + String msg = "Second tab should not have same bounds as first tab"; + throw new RuntimeException(msg); + } - // test Page.getBounds - // ensure no IndexOutOfBoundsException - pac0.getAccessibleComponent().getBounds(); + // test Page.getAccessibleStateSet + // At this point page 0 is selected + AccessibleStateSet accSS0 = pac0.getAccessibleStateSet(); + if (!accSS0.contains(AccessibleState.SELECTED)) { + String msg = "Empty title -> AccessibleState.SELECTED not set"; + throw new RuntimeException(msg); + } + // select second tab + badPane.setSelectedIndex(1); + AccessibleStateSet accSS1 = pac1.getAccessibleStateSet(); + if (!accSS1.contains(AccessibleState.SELECTED)) { + String msg = "Second tab selected but AccessibleState.SELECTED not set"; + throw new RuntimeException(msg); + } + // select third tab + badPane.setSelectedIndex(2); + AccessibleStateSet accSS2 = pac2.getAccessibleStateSet(); + if (!accSS1.contains(AccessibleState.SELECTED)) { + String msg = "Third tab selected but AccessibleState.SELECTED not set"; + throw new RuntimeException(msg); + } + // select fourth tab + badPane.setSelectedIndex(3); + AccessibleStateSet accSS3 = pac3.getAccessibleStateSet(); + if (!accSS1.contains(AccessibleState.SELECTED)) { + String msg = "Fourth tab selected but AccessibleState.SELECTED not set"; + throw new RuntimeException(msg); + } - // test Page.getAccessibleStateSet - // At this point page 0 is selected - AccessibleStateSet accSS0 = pac0.getAccessibleStateSet(); - if (!accSS0.contains(AccessibleState.SELECTED)) { - String msg = "Empty title -> AccessibleState.SELECTED not set"; - throw new RuntimeException(msg); - } + // test Page.getAccessibleIndexInParent + if (pac0.getAccessibleIndexInParent() == -1) { + String msg = "Empty title -> negative AccessibleIndexInParent"; + throw new RuntimeException(msg); + } + if (pac0.getAccessibleIndexInParent() != 0) { + String msg = "first tab is not at index 0 in parent"; + throw new RuntimeException(msg); + } + if (pac1.getAccessibleIndexInParent() != 1) { + String msg = "second tab (null component) is not at index 1 in parent"; + throw new RuntimeException(msg); + } + if (pac2.getAccessibleIndexInParent() != 2) { + String msg = "third tab (empty title) string is not at index 2 in parent"; + throw new RuntimeException(msg); + } + if (pac3.getAccessibleIndexInParent() != 3) { + String msg = "fourth tab (empty title, null component, has tabComponent) string is not at index 3 in parent"; + throw new RuntimeException(msg); + } - // test Page.getAccessibleIndexInParent - if (pac0.getAccessibleIndexInParent() == -1) { - String msg = "Empty title -> negative AccessibleIndexInParent"; - throw new RuntimeException(msg); - } + // test Page.getAccessibleName + String accName = pac0.getAccessibleName(); + if (!accName.equals("zero")) { + String msg = "Empty title -> empty AccessibleName"; + throw new RuntimeException(msg); + } + // test Page.getAccessibleName when component is null + accName = pac1.getAccessibleName(); + if (!accName.equals("one")) { + String msg = "AccessibleName of null panel not 'one'"; + throw new RuntimeException(msg); + } - // test Page.getAccessibleName - String accName = pac0.getAccessibleName(); - if (!accName.equals("zero")) { - String msg = "Empty title -> empty AccessibleName"; - throw new RuntimeException(msg); - } - // test Page.getAccessibleName when component is null - accName = pac1.getAccessibleName(); - if (!accName.equals("one")) { - String msg = "AccessibleName of null panel not 'one'"; - throw new RuntimeException(msg); - } + // test Page.setDisplayedMnemonicIndex + // Empty title -> IllegalArgumnetException + badPane.setDisplayedMnemonicIndexAt(0, 1); - // test Page.setDisplayedMnemonicIndex - // Empty title -> IllegalArgumnetException - badPane.setDisplayedMnemonicIndexAt(0, 1); - - // test Page.updateDisplayedMnemonicIndex - badPane.setMnemonicAt(0, KeyEvent.VK_Z); - if (badPane.getDisplayedMnemonicIndexAt(0) == -1) { - String msg="Empty title -> getDisplayedMnemonicIndexAt failure"; - throw new RuntimeException(msg); + // test Page.updateDisplayedMnemonicIndex + badPane.setMnemonicAt(0, KeyEvent.VK_Z); + if (badPane.getDisplayedMnemonicIndexAt(0) == -1) { + String msg="Empty title -> getDisplayedMnemonicIndexAt failure"; + throw new RuntimeException(msg); + } + } catch (Exception e) { + exception = e; } }); + if (exception != null) { + System.out.println("Test failed: " + exception.getMessage()); + throw exception; + } else { + System.out.println("Test passed."); + } } // The following is likely what is being done in Burp Suite diff --git a/jdk/test/javax/swing/LookAndFeel/8146276/NimbusGlueTest.java b/jdk/test/javax/swing/LookAndFeel/8146276/NimbusGlueTest.java new file mode 100644 index 00000000000..cd64ee723ab --- /dev/null +++ b/jdk/test/javax/swing/LookAndFeel/8146276/NimbusGlueTest.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8146276 + * @summary Right aligned toolbar component does not appear + * @run main NimbusGlueTest + */ +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import javax.swing.Box; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JToolBar; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import java.awt.Robot; +import javax.swing.UnsupportedLookAndFeelException; + +public class NimbusGlueTest { + + private static JFrame frame; + private static Robot robot; + private static volatile String errorMessage = ""; + private static JToolBar bar; + + public static void main(String[] args) throws Exception { + robot = new Robot(); + UIManager.LookAndFeelInfo[] lookAndFeelArray + = UIManager.getInstalledLookAndFeels(); + for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) { + String lookAndFeelString = lookAndFeelItem.getClassName(); + if (tryLookAndFeel(lookAndFeelString)) { + createUI(); + performTest(); + robot.waitForIdle(); + } + } + if (!"".equals(errorMessage)) { + throw new RuntimeException(errorMessage); + } + } + + private static boolean tryLookAndFeel(String lookAndFeelString) { + try { + UIManager.setLookAndFeel(lookAndFeelString); + return true; + } catch (UnsupportedLookAndFeelException | ClassNotFoundException | + InstantiationException | IllegalAccessException e) { + errorMessage += e.getMessage() + "\n"; + System.err.println("Caught Exception: " + e.getMessage()); + return false; + } + } + + private static void performTest() throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + try { + int width = 0; + for (Component comp : bar.getComponents()) { + width += comp.getWidth(); + } + if (width > 600) { + errorMessage = "Test Failed"; + } + } finally { + frame.dispose(); + } + + } + }); + } + + private static void createUI() throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + frame = new JFrame(); + bar = new JToolBar(); + bar.add(createButton(1)); + bar.add(createButton(2)); + bar.add(Box.createHorizontalGlue()); + bar.add(createButton(3)); + frame.add(bar, BorderLayout.NORTH); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setSize(600, 400); + frame.setVisible(true); + } + }); + } + + private static JButton createButton(int id) { + JButton b = new JButton("B: " + id); + b.setPreferredSize(new Dimension(60, b.getPreferredSize().height)); + return b; + } +} diff --git a/jdk/test/javax/swing/text/html/HTMLEditorKit/7104635/HTMLEditorKitWriterBug.java b/jdk/test/javax/swing/text/html/HTMLEditorKit/7104635/HTMLEditorKitWriterBug.java new file mode 100644 index 00000000000..d37f9fd69d6 --- /dev/null +++ b/jdk/test/javax/swing/text/html/HTMLEditorKit/7104635/HTMLEditorKitWriterBug.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7104635 + * @summary HTMLEditorKit fails to write down some html files + * @run main HTMLEditorKitWriterBug + */ +import java.io.CharArrayReader; +import java.io.CharArrayWriter; +import javax.swing.text.html.HTMLDocument; +import javax.swing.text.html.HTMLEditorKit; + +public class HTMLEditorKitWriterBug { + + public static void main(String[] args) { + String htmlDoc = "

          "; + try { + HTMLEditorKit kit = new HTMLEditorKit(); + Class c = Class.forName( + "javax.swing.text.html.parser.ParserDelegator"); + HTMLEditorKit.Parser parser = (HTMLEditorKit.Parser) c.newInstance(); + HTMLDocument doc = (HTMLDocument) kit.createDefaultDocument(); + HTMLEditorKit.ParserCallback htmlReader = doc.getReader(0); + parser.parse(new CharArrayReader(htmlDoc.toCharArray()), + htmlReader, true); + htmlReader.flush(); + CharArrayWriter writer = new CharArrayWriter(1000); + kit.write(writer, doc, 0, doc.getLength()); + writer.flush(); + } catch (Exception ex) { + throw new RuntimeException("Test Failed " + ex); + } + } +} diff --git a/jdk/test/jdk/Version/Basic.java b/jdk/test/jdk/Version/Basic.java new file mode 100644 index 00000000000..b94180c8daf --- /dev/null +++ b/jdk/test/jdk/Version/Basic.java @@ -0,0 +1,400 @@ +/* + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary Unit test for jdk.Version. + * @bug 8072379 + */ + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.math.BigInteger; +import java.util.stream.Collectors; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import jdk.Version; +import static java.lang.System.out; + +public class Basic { + private static final Class IAE + = IllegalArgumentException.class; + private static final Class NPE + = NullPointerException.class; + private static final Class NFE + = NumberFormatException.class; + private static final Class VERSION = Version.class; + + private static final BigInteger TOO_BIG + = (BigInteger.valueOf(Integer.MAX_VALUE)).add(BigInteger.ONE); + private static final String TOO_BIG_STR = TOO_BIG.toString(); + + public static void main(String ... args) { + + //// Tests for parse(), major(), minor(), security(), pre(), + //// build(), opt(), version(), toString() + // v M m sec pre bld opt + + // $VNUM + test("9", 9, 0, 0, "", 0, ""); + test("9.1", 9, 1, 0, "", 0, ""); + test("9.0.1", 9, 0, 1, "", 0, ""); + test("404.1.2", 404, 1, 2, "", 0, ""); + test("9.1.2.3", 9, 1, 2, "", 0, ""); + test("1000.0.0.0.0.0.99999999", 1000, 0, 0, "", 0, ""); + + tryCatch(null, NPE); + tryCatch("", IAE); + tryCatch("foo", IAE); + tryCatch("7a", IAE); + tryCatch("0", IAE); + tryCatch("09", IAE); + tryCatch("9.0", IAE); + tryCatch("9.0.", IAE); + tryCatch("1.9,1", IAE); + tryCatch(TOO_BIG_STR, NFE); + + // $PRE + test("9-ea", 9, 0, 0, "ea", 0, ""); + test("9-internal", 9, 0, 0, "internal", 0, ""); + test("9-0", 9, 0, 0, "0", 0, ""); + test("9.2.7-8", 9, 2, 7, "8", 0, ""); + test("1-ALL", 1, 0, 0, "ALL", 0, ""); + test("2.3.4.5-1a", 2, 3, 4, "1a", 0, ""); + test("1-" + TOO_BIG_STR, 1, 0, 0, TOO_BIG_STR, 0, ""); + + tryCatch("9:-ea", IAE); + tryCatch("3.14159-", IAE); + tryCatch("3.14159-%", IAE); + + // $BUILD + test("9+0", 9, 0, 0, "", 0, ""); + test("3.14+9999900", 3, 14, 0, "", 9999900, ""); + test("9-pre+105", 9, 0, 0, "pre", 105, ""); + test("6.0.42-8beta+4", 6, 0, 42, "8beta", 4, ""); + + tryCatch("9+", IAE); + tryCatch("7+a", IAE); + tryCatch("9+00", IAE); + tryCatch("4.2+01", IAE); + tryCatch("4.2+1a", IAE); + tryCatch("1+" + TOO_BIG_STR, NFE); + + // $OPT + test("9+-foo", 9, 0, 0, "", 0, "foo"); + test("9-pre-opt", 9, 0, 0, "pre", 0, "opt"); + test("42+---bar", 42, 0, 0, "", 0, "--bar"); + test("2.91+-8061493-", 2, 91, 0, "", 0, "8061493-"); + test("24+-foo.bar", 24, 0, 0, "", 0, "foo.bar"); + test("9-ribbit+17-...", 9, 0, 0, "ribbit", 17, "..."); + test("7+1-" + TOO_BIG_STR, 7,0, 0, "", 1, TOO_BIG_STR); + + tryCatch("9-pre+-opt", IAE); + tryCatch("1.4142+-", IAE); + tryCatch("2.9979+-%", IAE); + + //// Test for current() + testCurrent(); + + //// Test for equals{IgnoreOpt}?(), hashCode(), compareTo{IgnoreOpt}?() + // compare: after "<" == -1, equal == 0, before ">" == 1 + // v0 v1 eq eqNO cmp cmpNO + testEHC("9", "9", true, true, 0, 0); + + testEHC("8", "9", false, false, -1, -1); + testEHC("9", "10", false, false, -1, -1); + testEHC("9", "8", false, false, 1, 1); + + // $OPT comparison + testEHC("9", "9+-oink", false, true, -1, 0); + testEHC("9+-ribbit", "9+-moo", false, true, 1, 0); + testEHC("9-quack+3-ribbit", + "9-quack+3-moo", false, true, 1, 0); + testEHC("9.1+7", "9.1+7-moo-baa-la", false, true, -1, 0); + + // numeric vs. non-numeric $PRE + testEHC("9.1.1.2-2a", "9.1.1.2-12", false, false, 1, 1); + testEHC("9.1.1.2-12", "9.1.1.2-4", false, false, 1, 1); + + testEHC("27.16", "27.16+120", false, false, 1, 1); + testEHC("10", "10-ea", false, false, 1, 1); + testEHC("10.1+1", "10.1-ea+1", false, false, 1, 1); + testEHC("10.0.1+22", "10.0.1+21", false, false, 1, 1); + + // numeric vs. non-numeric $PRE + testEHC("9.1.1.2-12", "9.1.1.2-a2", false, false, -1, -1); + testEHC("9.1.1.2-1", "9.1.1.2-4", false, false, -1, -1); + + testEHC("9-internal", "9", false, false, -1, -1); + testEHC("9-ea+120", "9+120", false, false, -1, -1); + testEHC("9-ea+120", "9+120", false, false, -1, -1); + testEHC("9+101", "9", false, false, -1, -1); + testEHC("9+101", "9+102", false, false, -1, -1); + testEHC("1.9-ea", "9-ea", false, false, -1, -1); + + if (fail != 0) + throw new RuntimeException((fail + pass) + " tests: " + + fail + " failure(s), first", first); + else + out.println("all " + (fail + pass) + " tests passed"); + + } + + private static void test(String s, Integer major, Integer minor, + Integer sec, String pre, Integer build, + String opt) + { + Version v = testParse(s); + + testStr(v.toString(), s); + + testInt(v.major(), major); + testInt(v.minor(), minor); + testInt(v.security(), sec); + testStr((v.pre().isPresent() ? v.pre().get() : ""), pre); + testInt((v.build().isPresent() ? v.build().get() : 0), build); + testStr((v.optional().isPresent() ? v.optional().get() : ""), opt); + + testVersion(v.version(), s); + } + + private static Version testParse(String s) { + Version v = Version.parse(s); + pass(); + return v; + } + + private static void testInt(int got, int exp) { + if (got != exp) { + fail("testInt()", Integer.toString(exp), Integer.toString(got)); + } else { + pass(); + } + } + + private static void testStr(String got, String exp) { + if (!got.equals(exp)) { + fail("testStr()", exp, got); + } else { + pass(); + } + } + + private static void tryCatch(String s, Class ex) { + Throwable t = null; + try { + Version.parse(s); + } catch (Throwable x) { + if (ex.isAssignableFrom(x.getClass())) { + t = x; + } else + x.printStackTrace(); + } + if ((t == null) && (ex != null)) + fail(s, ex); + else + pass(); + } + + private static void testCurrent() { + Version current = Version.current(); + String javaVer = System.getProperty("java.version"); + + // java.version == $VNUM(\-$PRE) + String [] ver = javaVer.split("-"); + List javaVerVNum + = Arrays.stream(ver[0].split("\\.")) + .map(v -> Integer.parseInt(v)) + .collect(Collectors.toList()); + if (!javaVerVNum.equals(current.version())) { + fail("testCurrent() version()", javaVerVNum.toString(), + current.version().toString()); + } else { + pass(); + } + + Optional javaVerPre + = (ver.length == 2) + ? Optional.ofNullable(ver[1]) + : Optional.empty(); + if (!javaVerPre.equals(current.pre())) { + fail("testCurrent() pre()", javaVerPre.toString(), + current.pre().toString()); + } else { + pass(); + } + + testEHC(current.toString(), javaVer, true, true, 0, 0); + } + + private static void testVersion(List vnum, String s) { + List svnum = new ArrayList(); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < s.length(); i++) { + Character c = s.charAt(i); + if (Character.isDigit(c)) { + sb.append(c); + } else { + svnum.add(Integer.parseInt(sb.toString())); + sb = new StringBuilder(); + if (c == '+' || c == '-') { + break; + } + } + } + if (sb.length() > 0) { + svnum.add(Integer.parseInt(sb.toString())); + } + + if (!svnum.equals(vnum)) { + fail("testVersion() equals()", svnum.toString(), vnum.toString()); + } else { + pass(); + } + } + + private static void testEHC(String s0, String s1, boolean eq, boolean eqNO, + int cmp, int cmpNO) + { + Version v0 = Version.parse(s0); + Version v1 = Version.parse(s1); + + testEquals(v0, v1, eq); + testEqualsNO(v0, v1, eqNO); + + testHashCode(v0, v1, eq); + + testCompare(v0, v1, cmp); + testCompareNO(v0, v1, cmpNO); + } + + private static void testEqualsNO(Version v0, Version v1, boolean eq) { + if ((eq && !v0.equalsIgnoreOpt(v1)) + || (!eq && v0.equalsIgnoreOpt(v1))) { + fail("equalsIgnoreOpt() " + Boolean.toString(eq), + v0.toString(), v1.toString()); + } else { + pass(); + } + } + + private static void testEquals(Version v0, Version v1, boolean eq) { + if ((eq && !v0.equals(v1)) || (!eq && v0.equals(v1))) { + fail("equals() " + Boolean.toString(eq), + v0.toString(), v1.toString()); + } else { + pass(); + } + } + + private static void testHashCode(Version v0, Version v1, boolean eq) { + int h0 = v0.hashCode(); + int h1 = v1.hashCode(); + if (eq) { + testInt(h0, h1); + } else if (h0 == h1) { + fail(String.format("hashCode() %s", h0), + Integer.toString(h0), + Integer.toString(h1)); + } else { // !eq && (h0 != h1) + pass(); + } + } + + private static void testCompareNO(Version v0, Version v1, int compare) + { + try { + Method m = VERSION.getMethod("compareToIgnoreOpt", VERSION); + int cmp = (int) m.invoke(v0, v1); + checkCompare(v0, v1, compare, cmp); + } catch (IllegalAccessException | InvocationTargetException | + NoSuchMethodException ex) { + fail(String.format("compareToIgnoreOpt() invocation: %s", + ex.getClass()), + null); + } + } + + private static void testCompare(Version v0, Version v1, int compare) { + try { + Method m = VERSION.getMethod("compareTo", VERSION); + int cmp = (int) m.invoke(v0, v1); + checkCompare(v0, v1, compare, cmp); + } catch (IllegalAccessException | InvocationTargetException | + NoSuchMethodException ex) { + fail(String.format("compareTo() invocation: %s", ex.getClass()), + null); + } + } + + private static void checkCompare(Version v0, Version v1, + int compare, int cmp) + { + if (((cmp == 0) && (compare == 0)) + || (compare == (cmp / Math.abs(cmp == 0 ? 1 : cmp)))) { + pass(); + } else { + fail(String.format("compare() (cmp = %s) (compare = %s)", + cmp, compare), + v0.toString(), v1.toString()); + } + } + + private static int fail = 0; + private static int pass = 0; + + private static Throwable first; + + static void pass() { + pass++; + } + + static void fail(String fs, Class ex) { + String s = "'" + fs + "'"; + if (ex != null) + s += ": " + ex.getName() + " not thrown"; + if (first == null) + setFirst(s); + System.err.println("FAILED: " + s); + fail++; + } + + static void fail(String t, String exp, String got) { + String s = t + ": Expected '" + exp + "', got '" + got + "'"; + if (first == null) + setFirst(s); + System.err.println("FAILED: " + s); + fail++; + } + + private static void setFirst(String s) { + try { + throw new RuntimeException(s); + } catch (RuntimeException x) { + first = x; + } + } +} diff --git a/jdk/test/jdk/internal/misc/JavaLangAccess/FormatUnsigned.java b/jdk/test/jdk/internal/misc/JavaLangAccess/FormatUnsigned.java deleted file mode 100644 index e1e4b4288e1..00000000000 --- a/jdk/test/jdk/internal/misc/JavaLangAccess/FormatUnsigned.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import jdk.internal.misc.JavaLangAccess; -import jdk.internal.misc.SharedSecrets; - -/* - * @test - * @bug 8050114 - * @summary Test JavaLangAccess.formatUnsignedInt/-Long - * @modules java.base/jdk.internal.misc - */ -public class FormatUnsigned { - - static final JavaLangAccess jla = SharedSecrets.getJavaLangAccess(); - - public static void testFormatUnsignedInt() { - testFormatUnsignedInt("7fffffff", Integer.MAX_VALUE, 8, 4, 0, 8); - testFormatUnsignedInt("80000000", Integer.MIN_VALUE, 8, 4, 0, 8); - testFormatUnsignedInt("4711", 04711, 4, 3, 0, 4); - testFormatUnsignedInt("4711", 0x4711, 4, 4, 0, 4); - testFormatUnsignedInt("1010", 0b1010, 4, 1, 0, 4); - testFormatUnsignedInt("00001010", 0b1010, 8, 1, 0, 8); - testFormatUnsignedInt("\u0000\u000000001010", 0b1010, 10, 1, 2, 8); - } - - public static void testFormatUnsignedLong() { - testFormatUnsignedLong("7fffffffffffffff", Long.MAX_VALUE, 16, 4, 0, 16); - testFormatUnsignedLong("8000000000000000", Long.MIN_VALUE, 16, 4, 0, 16); - testFormatUnsignedLong("4711", 04711L, 4, 3, 0, 4); - testFormatUnsignedLong("4711", 0x4711L, 4, 4, 0, 4); - testFormatUnsignedLong("1010", 0b1010L, 4, 1, 0, 4); - testFormatUnsignedLong("00001010", 0b1010L, 8, 1, 0, 8); - testFormatUnsignedLong("\u0000\u000000001010", 0b1010L, 10, 1, 2, 8); - } - - public static void testFormatUnsignedInt(String expected, int value, int arraySize, int shift, int offset, int length) { - char[] chars = new char[arraySize]; - jla.formatUnsignedInt(value, shift, chars, offset, length); - String s = new String(chars); - if (!expected.equals(s)) { - throw new Error(s + " should be equal to expected " + expected); - } - } - - public static void testFormatUnsignedLong(String expected, long value, int arraySize, int shift, int offset, int length) { - char[] chars = new char[arraySize]; - jla.formatUnsignedLong(value, shift, chars, offset, length); - String s = new String(chars); - if (!expected.equals(s)) { - throw new Error(s + " should be equal to expected " + expected); - } - } - - public static void main(String[] args) { - testFormatUnsignedInt(); - testFormatUnsignedLong(); - } -} diff --git a/jdk/test/jdk/internal/ref/Cleaner/ExitOnThrow.java b/jdk/test/jdk/internal/ref/Cleaner/ExitOnThrow.java new file mode 100644 index 00000000000..994cee3f896 --- /dev/null +++ b/jdk/test/jdk/internal/ref/Cleaner/ExitOnThrow.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4954921 8009259 + * @library /test/lib/share/classes + * @build jdk.test.lib.* + * @build jdk.test.lib.process.* + * @run main ExitOnThrow + * @summary Ensure that if a cleaner throws an exception then the VM exits + */ +import java.util.Arrays; + +import jdk.internal.ref.Cleaner; +import jdk.test.lib.JDKToolLauncher; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +public class ExitOnThrow { + + static final String cp = System.getProperty("test.classes", "."); + + public static void main(String[] args) throws Exception { + if (args.length == 0) { + String[] cmd = JDKToolLauncher.createUsingTestJDK("java") + .addToolArg("-cp") + .addToolArg(cp) + .addToolArg("ExitOnThrow") + .addToolArg("-executeCleaner") + .getCommand(); + ProcessBuilder pb = new ProcessBuilder(cmd); + OutputAnalyzer out = ProcessTools.executeProcess(pb); + System.out.println("======================"); + System.out.println(Arrays.toString(cmd)); + String msg = " stdout: [" + out.getStdout() + "]\n" + + " stderr: [" + out.getStderr() + "]\n" + + " exitValue = " + out.getExitValue() + "\n"; + System.out.println(msg); + + if (out.getExitValue() != 1) + throw new RuntimeException("Unexpected exit code: " + + out.getExitValue()); + + } else { + Cleaner.create(new Object(), + () -> { throw new RuntimeException("Foo!"); } ); + while (true) { + System.gc(); + Thread.sleep(100); + } + } + } + +} diff --git a/jdk/test/jdk/lambda/separate/ClassToInterfaceConverter.java b/jdk/test/jdk/lambda/separate/ClassToInterfaceConverter.java index 7efedc9aa96..61598bd035d 100644 --- a/jdk/test/jdk/lambda/separate/ClassToInterfaceConverter.java +++ b/jdk/test/jdk/lambda/separate/ClassToInterfaceConverter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -62,6 +62,25 @@ public class ClassToInterfaceConverter implements ClassFilePreprocessor { } } cf.methods = new_methods; + // Convert method tag. Find Methodref, which is not "" and only invoked by other methods + // in the interface, convert it to InterfaceMethodref + ArrayList cpool = new ArrayList<>(); + for (int i = 0; i < cf.constant_pool.size(); i++) { + ClassFile.CpEntry ce = cf.constant_pool.get(i); + if (ce instanceof ClassFile.CpMethodRef) { + ClassFile.CpMethodRef me = (ClassFile.CpMethodRef)ce; + ClassFile.CpNameAndType nameType = (ClassFile.CpNameAndType)cf.constant_pool.get(me.name_and_type_index); + ClassFile.CpEntry name = cf.constant_pool.get(nameType.name_index); + if (!utf8Matches(name, "") && cf.this_class == me.class_index) { + ClassFile.CpInterfaceMethodRef newEntry = new ClassFile.CpInterfaceMethodRef(); + newEntry.class_index = me.class_index; + newEntry.name_and_type_index = me.name_and_type_index; + ce = newEntry; + } + } + cpool.add(ce); + } + cf.constant_pool = cpool; } public byte[] preprocess(String classname, byte[] bytes) { diff --git a/jdk/test/sun/applet/DeprecatedAppletViewer/DeprecatedAppletViewer.java b/jdk/test/sun/applet/DeprecatedAppletViewer/DeprecatedAppletViewer.java new file mode 100644 index 00000000000..f3b43f83eee --- /dev/null +++ b/jdk/test/sun/applet/DeprecatedAppletViewer/DeprecatedAppletViewer.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; + +/** + * @test + * @bug 8074165 + * @modules java.desktop/sun.applet + * @run main/othervm -Duser.language=en DeprecatedAppletViewer + */ +public final class DeprecatedAppletViewer { + + private static final String TEXT = "AppletViewer is deprecated."; + + public static void main(final String[] args) { + final PrintStream old = System.out; + final ByteArrayOutputStream baos = new ByteArrayOutputStream(1000); + final PrintStream ps = new PrintStream(baos); + try { + System.setOut(ps); + sun.applet.Main.main(new String[]{}); + } finally { + System.setOut(old); + } + + final String text = new String(baos.toByteArray()); + if (!text.contains(TEXT)) { + System.err.println("The text should contain: \"" + TEXT + "\""); + System.err.println("But the current text is: "); + System.err.println(text); + throw new RuntimeException("Error"); + } + } +} diff --git a/jdk/test/sun/java2d/marlin/ArrayCacheSizeTest.java b/jdk/test/sun/java2d/marlin/ArrayCacheSizeTest.java index 8c40fe4cfae..79fc9ac0ff4 100644 --- a/jdk/test/sun/java2d/marlin/ArrayCacheSizeTest.java +++ b/jdk/test/sun/java2d/marlin/ArrayCacheSizeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -23,11 +23,12 @@ import sun.java2d.marlin.ArrayCache; -/** +/* * @test * @bug 8144445 * @summary Check the ArrayCache getNewLargeSize() method * @run main ArrayCacheSizeTest + * @modules java.desktop/sun.java2d.marlin */ public class ArrayCacheSizeTest { diff --git a/jdk/test/sun/java2d/marlin/CeilAndFloorTests.java b/jdk/test/sun/java2d/marlin/CeilAndFloorTests.java index 5f7fcc153c2..81d9faea97f 100644 --- a/jdk/test/sun/java2d/marlin/CeilAndFloorTests.java +++ b/jdk/test/sun/java2d/marlin/CeilAndFloorTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ import sun.java2d.marlin.FloatMath; * @test * @summary Check for correct implementation of FloatMath.ceil/floor * @run main CeilAndFloorTests + * @modules java.desktop/sun.java2d.marlin */ public class CeilAndFloorTests { diff --git a/jdk/test/sun/java2d/marlin/TextClipErrorTest.java b/jdk/test/sun/java2d/marlin/TextClipErrorTest.java new file mode 100644 index 00000000000..efce137256c --- /dev/null +++ b/jdk/test/sun/java2d/marlin/TextClipErrorTest.java @@ -0,0 +1,322 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.geom.AffineTransform; +import java.awt.geom.Line2D; +import java.awt.geom.Path2D; +import java.awt.geom.PathIterator; +import static java.awt.geom.PathIterator.SEG_CLOSE; +import static java.awt.geom.PathIterator.SEG_CUBICTO; +import static java.awt.geom.PathIterator.SEG_LINETO; +import static java.awt.geom.PathIterator.SEG_MOVETO; +import static java.awt.geom.PathIterator.SEG_QUADTO; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Locale; +import java.util.logging.Handler; +import java.util.logging.LogRecord; +import java.util.logging.Logger; +import javax.imageio.ImageIO; + +/** + * @test @bug 8144718 + * @summary Check the Stroker.drawBezApproxForArc() bug (stoke with round + * joins): if cosext2 > 0.5, it generates curves with NaN coordinates + * @run main TextClipErrorTest + */ +public class TextClipErrorTest { + + static final boolean SAVE_IMAGE = false; + static final boolean SERIALIZE = false; + + public static void main(String[] args) { + Locale.setDefault(Locale.US); + + // initialize j.u.l Looger: + final Logger log = Logger.getLogger("sun.java2d.marlin"); + log.addHandler(new Handler() { + @Override + public void publish(LogRecord record) { + Throwable th = record.getThrown(); + // detect potential Throwable thrown by XxxArrayCache.check(): + if (th != null && th.getClass() == Throwable.class) { + StackTraceElement[] stackElements = th.getStackTrace(); + + for (int i = 0; i < stackElements.length; i++) { + StackTraceElement e = stackElements[i]; + + if (e.getClassName().startsWith("sun.java2d.marlin") + && e.getClassName().contains("ArrayCache") + && "check".equals(e.getMethodName())) + { + System.out.println("Test failed:\n" + + record.getMessage()); + th.printStackTrace(System.out); + + throw new RuntimeException("Test failed: ", th); + } + } + } + } + + @Override + public void flush() { + } + + @Override + public void close() throws SecurityException { + } + }); + + log.info("TextClipErrorTest: start"); + + // enable Marlin logging & internal checks: + System.setProperty("sun.java2d.renderer.log", "true"); + System.setProperty("sun.java2d.renderer.useLogger", "true"); + System.setProperty("sun.java2d.renderer.doChecks", "true"); + + BufferedImage image = new BufferedImage(256, 256, + BufferedImage.TYPE_INT_ARGB); + + Graphics2D g2d = image.createGraphics(); + g2d.setColor(Color.red); + try { + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + + Font font = g2d.getFont(); + FontRenderContext frc = new FontRenderContext( + new AffineTransform(), true, true); + + g2d.setStroke(new BasicStroke(4.0f, + BasicStroke.CAP_ROUND, + BasicStroke.JOIN_ROUND)); + + final Shape badShape; + if (SERIALIZE) { + final GlyphVector gv1 = font.createGlyphVector(frc, "\u00d6"); + final Shape textShape = gv1.getOutline(); + + final AffineTransform at1 = AffineTransform.getTranslateInstance( + -2091202.554154681, 5548.601436981691); + badShape = at1.createTransformedShape(textShape); + serializeShape(badShape); + } else { + badShape = deserializeShape(); + } + + g2d.draw(badShape); + + // Draw anything within bounds and it fails: + g2d.draw(new Line2D.Double(10, 20, 30, 40)); + + if (SAVE_IMAGE) { + final File file = new File("TextClipErrorTest.png"); + System.out.println("Writing file: " + file.getAbsolutePath()); + ImageIO.write(image, "PNG", file); + } + } catch (IOException ex) { + ex.printStackTrace(); + } finally { + g2d.dispose(); + log.info("TextClipErrorTest: end"); + } + } + + private static void serializeShape(Shape shape) { + final double[] coords = new double[6]; + + final int len = 32; + final ArrayList typeList = new ArrayList(len); + final ArrayList coordsList = new ArrayList(len); + + for (PathIterator pi = shape.getPathIterator(null); + !pi.isDone(); pi.next()) + { + switch (pi.currentSegment(coords)) { + case SEG_MOVETO: + typeList.add(SEG_MOVETO); + coordsList.add(Arrays.copyOf(coords, 2)); + break; + case SEG_LINETO: + typeList.add(SEG_LINETO); + coordsList.add(Arrays.copyOf(coords, 2)); + break; + case SEG_QUADTO: + typeList.add(SEG_QUADTO); + coordsList.add(Arrays.copyOf(coords, 4)); + break; + case SEG_CUBICTO: + typeList.add(SEG_CUBICTO); + coordsList.add(Arrays.copyOf(coords, 6)); + break; + case SEG_CLOSE: + typeList.add(SEG_CLOSE); + coordsList.add(null); + break; + default: + } + } + + final StringBuilder sb = new StringBuilder(1024); + // types: + sb.append("private static final int[] SHAPE_TYPES = new int[]{\n"); + for (Integer i : typeList) { + sb.append(i).append(",\n"); + } + sb.append("};\n"); + + // coords: + sb.append("private static final double[][] SHAPE_COORDS = new double[][]{\n"); + for (double[] c : coordsList) { + if (c == null) { + sb.append("null,\n"); + } else { + sb.append("new double[]{"); + for (int i = 0; i < c.length; i++) { + sb.append(c[i]).append(","); + } + sb.append("},\n"); + } + } + sb.append("};\n"); + + System.out.println("Shape size: " + typeList.size()); + System.out.println("Serialized shape:\n" + sb.toString()); + } + + private static Shape deserializeShape() { + final Path2D.Double path = new Path2D.Double(); + + for (int i = 0; i < SHAPE_TYPES.length; i++) { + double[] coords = SHAPE_COORDS[i]; + + switch (SHAPE_TYPES[i]) { + case SEG_MOVETO: + path.moveTo(coords[0], coords[1]); + break; + case SEG_LINETO: + path.lineTo(coords[0], coords[1]); + break; + case SEG_QUADTO: + path.quadTo(coords[0], coords[1], + coords[2], coords[3]); + break; + case SEG_CUBICTO: + path.curveTo(coords[0], coords[1], + coords[2], coords[3], + coords[4], coords[5]); + break; + case SEG_CLOSE: + path.closePath(); + break; + default: + } + } + + return path; + } + + // generated code: + private static final int[] SHAPE_TYPES = new int[]{ + 0, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 4, + 0, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 4, + 0, + 1, + 1, + 1, + 1, + 4, + 0, + 1, + 1, + 1, + 1, + 4, + }; + + private static final double[][] SHAPE_COORDS = new double[][]{ + new double[]{-2091197.819779681, 5540.648311981691,}, + new double[]{-2091199.116654681, 5540.648311981691, -2091199.874467181, 5541.609249481691,}, + new double[]{-2091200.632279681, 5542.570186981691, -2091200.632279681, 5544.242061981691,}, + new double[]{-2091200.632279681, 5545.882686981691, -2091199.874467181, 5546.843624481691,}, + new double[]{-2091199.116654681, 5547.804561981691, -2091197.819779681, 5547.804561981691,}, + new double[]{-2091196.538529681, 5547.804561981691, -2091195.780717181, 5546.843624481691,}, + new double[]{-2091195.022904681, 5545.882686981691, -2091195.022904681, 5544.242061981691,}, + new double[]{-2091195.022904681, 5542.570186981691, -2091195.780717181, 5541.609249481691,}, + new double[]{-2091196.538529681, 5540.648311981691, -2091197.819779681, 5540.648311981691,}, + null, + new double[]{-2091197.819779681, 5539.695186981691,}, + new double[]{-2091195.991654681, 5539.695186981691, -2091194.890092181, 5540.929561981691,}, + new double[]{-2091193.788529681, 5542.163936981691, -2091193.788529681, 5544.242061981691,}, + new double[]{-2091193.788529681, 5546.304561981691, -2091194.890092181, 5547.538936981691,}, + new double[]{-2091195.991654681, 5548.773311981691, -2091197.819779681, 5548.773311981691,}, + new double[]{-2091199.663529681, 5548.773311981691, -2091200.772904681, 5547.538936981691,}, + new double[]{-2091201.882279681, 5546.304561981691, -2091201.882279681, 5544.242061981691,}, + new double[]{-2091201.882279681, 5542.163936981691, -2091200.772904681, 5540.929561981691,}, + new double[]{-2091199.663529681, 5539.695186981691, -2091197.819779681, 5539.695186981691,}, + null, + new double[]{-2091197.210404681, 5537.835811981691,}, + new double[]{-2091196.022904681, 5537.835811981691,}, + new double[]{-2091196.022904681, 5539.023311981691,}, + new double[]{-2091197.210404681, 5539.023311981691,}, + new double[]{-2091197.210404681, 5537.835811981691,}, + null, + new double[]{-2091199.632279681, 5537.835811981691,}, + new double[]{-2091198.444779681, 5537.835811981691,}, + new double[]{-2091198.444779681, 5539.023311981691,}, + new double[]{-2091199.632279681, 5539.023311981691,}, + new double[]{-2091199.632279681, 5537.835811981691,}, + null, + }; + +} diff --git a/jdk/test/sun/management/jmxremote/bootstrap/JMXAgentInterfaceBinding.java b/jdk/test/sun/management/jmxremote/bootstrap/JMXAgentInterfaceBinding.java index 8b46a4c3169..4647f280fef 100644 --- a/jdk/test/sun/management/jmxremote/bootstrap/JMXAgentInterfaceBinding.java +++ b/jdk/test/sun/management/jmxremote/bootstrap/JMXAgentInterfaceBinding.java @@ -130,7 +130,7 @@ public class JMXAgentInterfaceBinding { private static class JMXConnectorThread extends Thread { - private final InetAddress addr; + private final String addr; private final int jmxPort; private final int rmiPort; private final boolean useSSL; @@ -139,7 +139,7 @@ public class JMXAgentInterfaceBinding { private boolean jmxConnectWorked; private boolean rmiConnectWorked; - private JMXConnectorThread(InetAddress addr, + private JMXConnectorThread(String addr, int jmxPort, int rmiPort, boolean useSSL, @@ -163,11 +163,11 @@ public class JMXAgentInterfaceBinding { private void connect() throws IOException { System.out.println( "JMXConnectorThread: Attempting JMX connection on: " - + addr.getHostAddress() + " on port " + jmxPort); + + addr + " on port " + jmxPort); JMXServiceURL url; try { url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" - + addr.getHostAddress() + ":" + jmxPort + "/jmxrmi"); + + addr + ":" + jmxPort + "/jmxrmi"); } catch (MalformedURLException e) { throw new RuntimeException("Test failed.", e); } @@ -200,7 +200,7 @@ public class JMXAgentInterfaceBinding { } System.out.println( "JMXConnectorThread: connection to rmi socket worked host/port = " - + addr.getHostAddress() + "/" + rmiPort); + + addr + "/" + rmiPort); rmiConnectWorked = true; // Closing the channel without sending any data will cause an // java.io.EOFException on the server endpoint. We don't care about this @@ -224,7 +224,7 @@ public class JMXAgentInterfaceBinding { private static class MainThread extends Thread { private static final int WAIT_FOR_JMX_AGENT_TIMEOUT_MS = 500; - private final InetAddress bindAddress; + private final String addr; private final int jmxPort; private final int rmiPort; private final boolean useSSL; @@ -233,7 +233,7 @@ public class JMXAgentInterfaceBinding { private Exception excptn; private MainThread(InetAddress bindAddress, int jmxPort, int rmiPort, boolean useSSL) { - this.bindAddress = bindAddress; + this.addr = wrapAddress(bindAddress.getHostAddress()); this.jmxPort = jmxPort; this.rmiPort = rmiPort; this.useSSL = useSSL; @@ -259,7 +259,7 @@ public class JMXAgentInterfaceBinding { private void waitUntilReadyForConnections() { CountDownLatch latch = new CountDownLatch(1); JMXConnectorThread connectionTester = new JMXConnectorThread( - bindAddress, jmxPort, rmiPort, useSSL, latch); + addr, jmxPort, rmiPort, useSSL, latch); connectionTester.start(); boolean expired = false; try { @@ -294,4 +294,13 @@ public class JMXAgentInterfaceBinding { } } + /** + * Will wrap IPv6 address in '[]' + */ + static String wrapAddress(String address) { + if (address.contains(":")) { + return "[" + address + "]"; + } + return address; + } } diff --git a/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java b/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java index 45370151d22..d3b5f13d3a6 100644 --- a/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java +++ b/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java @@ -23,9 +23,11 @@ import java.io.File; import java.net.InetAddress; -import java.net.UnknownHostException; +import java.net.NetworkInterface; +import java.net.SocketException; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; import jdk.testlibrary.ProcessThread; import jdk.testlibrary.ProcessTools; @@ -72,25 +74,28 @@ public class JMXInterfaceBindingTest { "truststore"; public static final String TEST_CLASSPATH = System.getProperty("test.classes", "."); - public void run(InetAddress[] addrs) { + public void run(List addrs) { System.out.println("DEBUG: Running tests with plain sockets."); runTests(addrs, false); System.out.println("DEBUG: Running tests with SSL sockets."); runTests(addrs, true); } - private void runTests(InetAddress[] addrs, boolean useSSL) { - ProcessThread[] jvms = new ProcessThread[addrs.length]; - for (int i = 0; i < addrs.length; i++) { + private void runTests(List addrs, boolean useSSL) { + List jvms = new ArrayList<>(addrs.size()); + int i = 1; + for (InetAddress addr : addrs) { + String address = JMXAgentInterfaceBinding.wrapAddress(addr.getHostAddress()); System.out.println(); String msg = String.format("DEBUG: Launching java tester for triplet (HOSTNAME,JMX_PORT,RMI_PORT) == (%s,%d,%d)", - addrs[i].getHostAddress(), + address, JMX_PORT, RMI_PORT); System.out.println(msg); - jvms[i] = runJMXBindingTest(addrs[i], useSSL); - jvms[i].start(); - System.out.println("DEBUG: Started " + (i + 1) + " Process(es)."); + ProcessThread jvm = runJMXBindingTest(address, useSSL); + jvms.add(jvm); + jvm.start(); + System.out.println("DEBUG: Started " + (i++) + " Process(es)."); } int failedProcesses = 0; for (ProcessThread pt: jvms) { @@ -117,15 +122,15 @@ public class JMXInterfaceBindingTest { } } if (failedProcesses > 0) { - throw new RuntimeException("Test FAILED. " + failedProcesses + " out of " + addrs.length + " process(es) failed to start the JMX agent."); + throw new RuntimeException("Test FAILED. " + failedProcesses + " out of " + addrs.size() + " process(es) failed to start the JMX agent."); } } - private ProcessThread runJMXBindingTest(InetAddress a, boolean useSSL) { + private ProcessThread runJMXBindingTest(String address, boolean useSSL) { List args = new ArrayList<>(); args.add("-classpath"); args.add(TEST_CLASSPATH); - args.add("-Dcom.sun.management.jmxremote.host=" + a.getHostAddress()); + args.add("-Dcom.sun.management.jmxremote.host=" + address); args.add("-Dcom.sun.management.jmxremote.port=" + JMX_PORT); args.add("-Dcom.sun.management.jmxremote.rmi.port=" + RMI_PORT); args.add("-Dcom.sun.management.jmxremote.authenticate=false"); @@ -138,14 +143,14 @@ public class JMXInterfaceBindingTest { args.add("-Djavax.net.ssl.trustStorePassword=trustword"); } args.add(TEST_CLASS); - args.add(a.getHostAddress()); + args.add(address); args.add(Integer.toString(JMX_PORT)); args.add(Integer.toString(RMI_PORT)); args.add(Boolean.toString(useSSL)); try { ProcessBuilder builder = ProcessTools.createJavaProcessBuilder(args.toArray(new String[] {})); System.out.println(ProcessTools.getCommandLine(builder)); - ProcessThread jvm = new ProcessThread("JMX-Tester-" + a.getHostAddress(), JMXInterfaceBindingTest::isJMXAgentResponseAvailable, builder); + ProcessThread jvm = new ProcessThread("JMX-Tester-" + address, JMXInterfaceBindingTest::isJMXAgentResponseAvailable, builder); return jvm; } catch (Exception e) { throw new RuntimeException("Test failed", e); @@ -171,8 +176,8 @@ public class JMXInterfaceBindingTest { } public static void main(String[] args) { - InetAddress[] addrs = getAddressesForLocalHost(); - if (addrs.length < 2) { + List addrs = getAddressesForLocalHost(); + if (addrs.size() < 2) { System.out.println("Ignoring manual test since no more than one IPs are configured for 'localhost'"); return; } @@ -181,13 +186,24 @@ public class JMXInterfaceBindingTest { System.out.println("All tests PASSED."); } - private static InetAddress[] getAddressesForLocalHost() { - InetAddress[] addrs; + private static List getAddressesForLocalHost() { + try { - addrs = InetAddress.getAllByName("localhost"); - } catch (UnknownHostException e) { + return NetworkInterface.networkInterfaces() + .flatMap(NetworkInterface::inetAddresses) + .filter(JMXInterfaceBindingTest::isNonloopbackLocalhost) + .collect(Collectors.toList()); + } catch (SocketException e) { throw new RuntimeException("Test failed", e); } - return addrs; + } + + // we need 'real' localhost addresses only (eg. not loopback ones) + // so we can bind the remote JMX connector to them + private static boolean isNonloopbackLocalhost(InetAddress i) { + if (!i.isLoopbackAddress()) { + return i.getHostName().toLowerCase().equals("localhost"); + } + return false; } } diff --git a/jdk/test/sun/misc/Cleaner/exitOnThrow.sh b/jdk/test/sun/misc/Cleaner/exitOnThrow.sh deleted file mode 100644 index 4a22114ab18..00000000000 --- a/jdk/test/sun/misc/Cleaner/exitOnThrow.sh +++ /dev/null @@ -1,48 +0,0 @@ -#! /bin/sh - -# -# Copyright (c) 2003, 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. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# -# @test -# @bug 4954921 8009259 -# @summary Ensure that if a cleaner throws an exception then the VM exits -# -# @build ExitOnThrow -# @run shell exitOnThrow.sh - -# Command-line usage: sh exitOnThrow.sh /path/to/build - -if [ -z "$TESTJAVA" ]; then - if [ $# -lt 1 ]; then exit 1; fi - TESTJAVA=$1; shift - TESTCLASSES=`pwd` -fi - -if $TESTJAVA/bin/java ${TESTVMOPTS} -cp $TESTCLASSES ExitOnThrow; then - echo Failed: VM exited normally - exit 1 -else - echo Passed: VM exited with code $? - exit 0 -fi diff --git a/jdk/test/sun/reflect/constantPool/ConstantPoolTest.java b/jdk/test/sun/reflect/constantPool/ConstantPoolTest.java new file mode 100644 index 00000000000..3ede807577d --- /dev/null +++ b/jdk/test/sun/reflect/constantPool/ConstantPoolTest.java @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8141615 + * @summary Tests new public methods at sun.reflect.ConstantPool + * @modules java.base/sun.reflect + * @library /lib/testlibrary + * @compile ConstantPoolTestDummy.jasm + * @run main sun.reflect.constantPool.ConstantPoolTest + */ + +package sun.reflect.constantPool; + +import java.util.HashMap; +import java.util.Map; +import jdk.internal.misc.SharedSecrets; +import jdk.testlibrary.Asserts; +import sun.reflect.ConstantPool; + +public class ConstantPoolTest { + + private static final Class TEST_CLASS = ConstantPoolTestDummy.class; + private static final ConstantPool CP = SharedSecrets.getJavaLangAccess() + .getConstantPool(TEST_CLASS); + + public static void main(String[] s) { + for (TestCase testCase : TestCase.values()) { + testCase.test(); + } + } + + public static enum TestCase { + GET_TAG_AT { + { + referenceMap.put(1, ConstantPool.Tag.METHODREF); + referenceMap.put(2, ConstantPool.Tag.CLASS); + referenceMap.put(4, ConstantPool.Tag.UTF8); + referenceMap.put(10, ConstantPool.Tag.NAMEANDTYPE); + referenceMap.put(13, ConstantPool.Tag.LONG); + referenceMap.put(15, ConstantPool.Tag.INTEGER); + referenceMap.put(16, ConstantPool.Tag.INTERFACEMETHODREF); + referenceMap.put(21, ConstantPool.Tag.DOUBLE); + referenceMap.put(23, ConstantPool.Tag.STRING); + referenceMap.put(25, ConstantPool.Tag.INVOKEDYNAMIC); + referenceMap.put(29, ConstantPool.Tag.METHODHANDLE); + referenceMap.put(30, ConstantPool.Tag.METHODTYPE); + referenceMap.put(48, ConstantPool.Tag.FIELDREF); + referenceMap.put(52, ConstantPool.Tag.FLOAT); + } + @Override + void testIndex(int cpi, Object reference) { + ConstantPool.Tag tagToVerify = CP.getTagAt(cpi); + ConstantPool.Tag tagToRefer = (ConstantPool.Tag) reference; + String msg = String.format("Method getTagAt works not as expected" + + "at CP entry #%d: got CP tag %s, but should be %s", + cpi, tagToVerify.name(), tagToRefer.name()); + Asserts.assertEquals(tagToVerify, tagToRefer, msg); + } + }, + GET_CLASS_REF_INDEX_AT { + { + referenceMap.put(1, 3); + referenceMap.put(16, 17); + referenceMap.put(32, 35); + referenceMap.put(34, 3); + referenceMap.put(48, 2); + } + @Override + void testIndex(int cpi, Object reference) { + int indexToVerify = CP.getClassRefIndexAt(cpi); + int indexToRefer = (int) reference; + String msg = String.format("Method getClassRefIndexAt works not" + + " as expected at CP entry #%d:" + + " got index %d, but should be %d", + cpi, indexToVerify, indexToRefer); + Asserts.assertEquals(indexToVerify, indexToRefer, msg); + } + }, + GET_NAME_AND_TYPE_REF_INDEX_AT { + { + referenceMap.put(1, 10); + referenceMap.put(16, 18); + referenceMap.put(25, 26); + referenceMap.put(32, 36); + referenceMap.put(34, 37); + referenceMap.put(48, 49); + } + @Override + void testIndex(int cpi, Object reference) { + int indexToRefer = (int) reference; + int indexToVerify = CP.getNameAndTypeRefIndexAt(cpi); + String msg = String.format("Method getNameAndTypeRefIndexAt works" + + " not as expected at CP entry #%d:" + + " got index %d, but should be %d", + cpi, indexToVerify, indexToRefer); + Asserts.assertEquals(indexToVerify, indexToRefer, msg); + } + }, + GET_NAME_AND_TYPE_REF_INFO_AT { + { + referenceMap.put(10, new String[]{"", "()V"}); + referenceMap.put(18, new String[]{"run", "()V"}); + referenceMap.put(26, new String[]{"accept", "()Ljava/util/function/Consumer;"}); + referenceMap.put(36, new String[]{"metafactory", + "(Ljava/lang/invoke/MethodHandles$Lookup;" + + "Ljava/lang/String;Ljava/lang/invoke/MethodType;" + + "Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;" + + "Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;"}); + referenceMap.put(37, new String[]{"toString", "()Ljava/lang/String;"}); + referenceMap.put(49, new String[]{"myField", "I"}); + } + @Override + void testIndex(int cpi, Object reference) { + String[] natInfo = CP.getNameAndTypeRefInfoAt(cpi); + String msg = String.format("Method getNameAndTypeRefInfoAt" + + " works not as expected at CP entry #%d:" + + " returned value should not be null", cpi); + Asserts.assertNotNull(natInfo, msg); + String[] castedReference = (String[]) reference; + int natInfoLength = natInfo.length; + msg = String.format("Method getNameAndTypeRefInfoAt" + + " works not as expected at CP entry #%d:" + + " length of the returned string array is %d, but should be 2", + cpi, natInfoLength); + Asserts.assertEquals(natInfoLength, 2, msg); + String[] nameOrType = new String[]{"name", "type"}; + for (int i = 0; i < 2; i++) { + String infoToVerify = natInfo[i]; + String infoToRefer = castedReference[i]; + msg = String.format("Method getNameAndTypeRefInfoAt" + + " works not as expected at CP entry #%d:" + + " got %s info %s, but should be %s", + cpi, nameOrType[i], infoToVerify, infoToRefer); + Asserts.assertEquals(infoToVerify, infoToRefer, msg); + } + } + }; + + protected final Map referenceMap; + TestCase() { + this.referenceMap = new HashMap<>(); + } + abstract void testIndex(int cpi, Object reference); + public void test() { + referenceMap.forEach(this::testIndex); + } + } +} diff --git a/jdk/test/sun/reflect/constantPool/ConstantPoolTestDummy.jasm b/jdk/test/sun/reflect/constantPool/ConstantPoolTestDummy.jasm new file mode 100644 index 00000000000..cb3daaff8c9 --- /dev/null +++ b/jdk/test/sun/reflect/constantPool/ConstantPoolTestDummy.jasm @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun/reflect/constantPool; + +super public #2; //class ConstantPoolTestDummy + version 52:0 +{ + +// Actually, only first 13 constant pool entries are actually used by the class +// and its methods. All the rest are added just for the testing of getTagAt method +// and getNameAndTypeRefIndexAt method. + +const #1 = Method #3.#10; // java/lang/Object."":"()V" +const #2 = class #11; // ConstantPoolTestDummy +const #3 = class #12; // java/lang/Object +const #4 = Asciz ""; +const #5 = Asciz "()V"; +const #6 = Asciz "Code"; +const #7 = Asciz "LineNumberTable"; +const #8 = Asciz "SourceFile"; +const #9 = Asciz "ConstantPoolTestDummy.java"; +const #10 = NameAndType #4:#5; // "":"()V" +const #11 = Asciz "sun/reflect/constantPool/ConstantPoolTestDummy"; +const #12 = Asciz "java/lang/Object"; +const #13 = long 6l; +const #15 = int 1; +const #16 = InterfaceMethod #17.#18; // java/lang/Runnable.run:"()V" +const #17 = class #19; // java/lang/Runnable +const #18 = NameAndType #20:#5; // run:"()V" +const #19 = Asciz "java/lang/Runnable"; +const #20 = Asciz "run"; +const #21 = double 1.45d; +const #23 = String #24; // "Hello" +const #24 = Asciz "Hello"; +const #25 = InvokeDynamic 0:#26; // REF_invokeStatic:java/lang/invoke/LambdaMetafactory.metafactory:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;":accept:"()Ljava/util/function/Consumer;" MethodType "(Ljava/lang/Object;)V", MethodHandle REF_invokeVirtual:java/lang/Object.toString:"()Ljava/lang/String;", MethodType "(Ljava/lang/Object;)V" +const #26 = NameAndType #27:#28; // accept:"()Ljava/util/function/Consumer;" +const #27 = Asciz "accept"; +const #28 = Asciz "()Ljava/util/function/Consumer;"; +const #29 = MethodHandle 6:#32; // REF_invokeStatic:java/lang/invoke/LambdaMetafactory.metafactory:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;" +const #30 = MethodType #33; // "(Ljava/lang/Object;)V" +const #31 = MethodHandle 5:#34; // REF_invokeVirtual:java/lang/Object.toString:"()Ljava/lang/String;" +const #32 = Method #35.#36; // java/lang/invoke/LambdaMetafactory.metafactory:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;" +const #33 = Asciz "(Ljava/lang/Object;)V"; +const #34 = Method #3.#37; // java/lang/Object.toString:"()Ljava/lang/String;" +const #35 = class #38; // java/lang/invoke/LambdaMetafactory +const #36 = NameAndType #39:#40; // metafactory:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;" +const #37 = NameAndType #41:#42; // toString:"()Ljava/lang/String;" +const #38 = Asciz "java/lang/invoke/LambdaMetafactory"; +const #39 = Asciz "metafactory"; +const #40 = Asciz "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;"; +const #41 = Asciz "toString"; +const #42 = Asciz "()Ljava/lang/String;"; +const #43 = class #46; // java/lang/invoke/MethodHandles$Lookup +const #44 = Asciz "Lookup"; +const #45 = class #47; // java/lang/invoke/MethodHandles +const #46 = Asciz "java/lang/invoke/MethodHandles$Lookup"; +const #47 = Asciz "java/lang/invoke/MethodHandles"; +const #48 = Field #2.#49; // sun/reflect/constantPool/ConstantPoolTestDummy.myField:"I" +const #49 = NameAndType #50:#51; // myField:"I" +const #50 = Asciz "myField"; +const #51 = Asciz "I"; +const #52 = float 1.34f; + +public Method #4:#5 // "":"()V" + + stack 1 locals 1 +{ +3 0: aload_0; + 1: invokespecial #1; // Method java/lang/Object."":"()V"; + 4: return; +} + +public static final InnerClass #44= #43 of #45; //Lookup=class java/lang/invoke/MethodHandles$Lookup of class java/lang/invoke/MethodHandles + +BootstrapMethod #29 #30 #31 #30; + +} // end Class ConstantPoolTestDummy diff --git a/jdk/test/sun/security/jca/PreferredProviderTest.java b/jdk/test/sun/security/jca/PreferredProviderTest.java index 7120817a1b5..b7eace2d90e 100644 --- a/jdk/test/sun/security/jca/PreferredProviderTest.java +++ b/jdk/test/sun/security/jca/PreferredProviderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -23,7 +23,7 @@ /** * @test - * @bug 8076359 8133151 + * @bug 8076359 8133151 8145344 * @summary Test the value for new jdk.security.provider.preferred security property * @requires os.name == "SunOS" */ @@ -40,8 +40,9 @@ import javax.crypto.NoSuchPaddingException; public class PreferredProviderTest { private static final List SPARC_DATA = Arrays.asList( - new DataTuple("SHA-256", "SUN"), new DataTuple("SHA-384", "SUN"), - new DataTuple("SHA-512", "SUN")); + new DataTuple("SHA1", "SUN"), new DataTuple("SHA-1", "SUN"), + new DataTuple("SHA-224", "SUN"), new DataTuple("SHA-256", "SUN"), + new DataTuple("SHA-384", "SUN"), new DataTuple("SHA-512", "SUN")); private static final List X86_DATA = Arrays .asList(new DataTuple("RSA", "SunRsaSign")); @@ -52,7 +53,7 @@ public class PreferredProviderTest { String actualProvider = null; if (type.equals("sparcv9")) { if (!preferredProvider.equals( - "AES:SunJCE, SHA-256:SUN, SHA-384:SUN, SHA-512:SUN")) { + "AES:SunJCE, SHA1:SUN, SHA-224:SUN, SHA-256:SUN, SHA-384:SUN, SHA-512:SUN")) { throw new RuntimeException( "Test Failed: wrong jdk.security.provider.preferred " + "value on solaris-sparcv9"); diff --git a/jdk/test/tools/launcher/TooSmallStackSize.java b/jdk/test/tools/launcher/TooSmallStackSize.java index 9635eaee5bd..dac1c7f0325 100644 --- a/jdk/test/tools/launcher/TooSmallStackSize.java +++ b/jdk/test/tools/launcher/TooSmallStackSize.java @@ -24,7 +24,6 @@ /* * @test * @bug 6762191 - * @ignore 8146751 * @summary Setting stack size to 16K causes segmentation fault * @compile TooSmallStackSize.java * @run main TooSmallStackSize diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk index 8695cb9a393..8593b3c784f 100644 --- a/make/CompileJavaModules.gmk +++ b/make/CompileJavaModules.gmk @@ -467,18 +467,6 @@ jdk.jvmstat_COPY := aliasmap ################################################################################ -jdk.vm.ci_EXCLUDE_FILES += \ - jdk/vm/ci/options/processor/OptionProcessor.java \ - jdk/vm/ci/service/processor/ServiceProviderProcessor.java \ - # - -jdk.vm.ci_EXCLUDES += \ - META-INF/jvmci.options \ - META-INF/jvmci.providers \ - # - -################################################################################ - jdk.xml.bind_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS jdk.xml.bind_CLEAN := .properties jdk.xml.bind_COPY := .xsd JAXBContextFactory.java ZeroOneBooleanAdapter.java diff --git a/make/Init.gmk b/make/Init.gmk index b0c2d881bf4..3c7a664e6e4 100644 --- a/make/Init.gmk +++ b/make/Init.gmk @@ -168,7 +168,7 @@ ifeq ($(HAS_SPEC),) MAKE_INIT_WITH_SPEC_ARGUMENTS := ACTUAL_TOPDIR=$(topdir) \ USER_MAKE_VARS="$(USER_MAKE_VARS)" MAKE_LOG_FLAGS=$(MAKE_LOG_FLAGS) \ - LOG_LEVEL=$(LOG_LEVEL) LOG_NOFILE=$(LOG_NOFILE) \ + LOG_LEVEL=$(LOG_LEVEL) LOG_NOFILE=$(LOG_NOFILE) LOG_CMDLINES=$(LOG_CMDLINES) \ INIT_TARGETS="$(INIT_TARGETS)" \ SEQUENTIAL_TARGETS="$(SEQUENTIAL_TARGETS)" \ PARALLEL_TARGETS="$(PARALLEL_TARGETS)" diff --git a/make/InitSupport.gmk b/make/InitSupport.gmk index 2bf05d1eb29..6632a5c888b 100644 --- a/make/InitSupport.gmk +++ b/make/InitSupport.gmk @@ -121,6 +121,23 @@ ifeq ($(HAS_SPEC),) endif endef + # Look for a given option in the LOG variable, and if found, set a variable + # and remove the option from the LOG variable + # $1: The option to look for + # $2: The option to set to "true" if the option is found + define ParseLogOption + ifneq ($$(findstring $1, $$(LOG)),) + $2 := true + # COMMA is defined in spec.gmk, but that is not included yet + COMMA := , + # First try to remove ",