diff --git a/buildenv/docker/jdk11/x86_64/ubuntu16/Dockerfile b/buildenv/docker/jdk11/x86_64/ubuntu16/Dockerfile new file mode 100644 index 00000000000..d2e9302c671 --- /dev/null +++ b/buildenv/docker/jdk11/x86_64/ubuntu16/Dockerfile @@ -0,0 +1,99 @@ +# Copyright (c) 2018, 2018 IBM Corp. and others +# +# This program and the accompanying materials are made available under +# the terms of the Eclipse Public License 2.0 which accompanies this +# distribution and is available at https://www.eclipse.org/legal/epl-2.0/ +# or the Apache License, Version 2.0 which accompanies this distribution and +# is available at https://www.apache.org/licenses/LICENSE-2.0. +# +# This Source Code may also be made available under the following +# Secondary Licenses when the conditions for such availability set +# forth in the Eclipse Public License, v. 2.0 are satisfied: GNU +# General Public License, version 2 with the GNU Classpath +# Exception [1] and GNU General Public License, version 2 with the +# OpenJDK Assembly Exception [2]. +# +# [1] https://www.gnu.org/software/classpath/license.html +# [2] http://openjdk.java.net/legal/assembly-exception.html +# +# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception + +# To use this docker file: +# docker build -t=openj9 . +# docker run -it openj9 + +FROM ubuntu:16.04 + +# Install required OS tools +RUN apt-get update \ + && apt-get install -qq -y --no-install-recommends \ + software-properties-common \ + python-software-properties \ + && add-apt-repository ppa:ubuntu-toolchain-r/test \ + && apt-get update \ + && apt-get install -qq -y --no-install-recommends \ + gcc-7 \ + g++-7 \ + autoconf \ + ca-certificates \ + ccache \ + cmake \ + cpio \ + file \ + git \ + git-core \ + libasound2-dev \ + libcups2-dev \ + libdwarf-dev \ + libelf-dev \ + libfontconfig1-dev \ + libfreetype6-dev \ + libnuma-dev \ + libx11-dev \ + libxext-dev \ + libxrender-dev \ + libxt-dev \ + libxtst-dev \ + make \ + pkg-config \ + realpath \ + ssh \ + unzip \ + wget \ + zip \ + vim \ + && rm -rf /var/lib/apt/lists/* + +# Create links for c++,g++,cc,gcc +RUN ln -s g++ /usr/bin/c++ \ + && ln -s g++-7 /usr/bin/g++ \ + && ln -s gcc /usr/bin/cc \ + && ln -s gcc-7 /usr/bin/gcc + +# Download and setup freemarker.jar to /root/freemarker.jar +RUN cd /root \ + && wget https://sourceforge.net/projects/freemarker/files/freemarker/2.3.8/freemarker-2.3.8.tar.gz/download -O freemarker.tgz \ + && tar -xzf freemarker.tgz freemarker-2.3.8/lib/freemarker.jar --strip=2 \ + && rm -f freemarker.tgz + +# Download and install boot JDK from AdoptOpenJDK +# Currently, no JDK10 with OpenJ9 releases are available at AdoptOpenJDK. +# So, the AdoptOpenJDK API can't be used to download a boot JDK. +# A nightly JDK10 OpenJ9 build is currently used as the boot JDK. +# Once JDK10 OpenJ9 releases are available, the following link can be used +# to download the JDK10 OpenJ9 boot JDK: +# https://api.adoptopenjdk.net/openjdk10-openj9/releases/x64_linux/latest/binary +RUN cd /root \ + && wget -O bootjdk10.tar.gz https://github.com/AdoptOpenJDK/openjdk10-openj9-nightly/releases/download/jdk-10%2B46-20180509/OpenJDK10-OPENJ9_x64_Linux_20180509.tar.gz \ + && tar -xzf bootjdk10.tar.gz \ + && rm -f bootjdk10.tar.gz \ + && ls | grep -i jdk | xargs -I % sh -c 'mv % bootjdk10' + +# Set environment variable JAVA_HOME, and prepend ${JAVA_HOME}/bin to PATH +ENV JAVA_HOME="/root/bootjdk10" +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +# The below CFLAG prevents "error: inline function ${FUNCTION_NAME} declared but never defined [-Werror]" +ENV CFLAGS="-fgnu89-inline" + +WORKDIR /root diff --git a/buildenv/docker/jdk8/s390x/ubuntu16/Dockerfile b/buildenv/docker/jdk8/s390x/ubuntu16/Dockerfile index 0ed179ae718..c8a3f820917 100644 --- a/buildenv/docker/jdk8/s390x/ubuntu16/Dockerfile +++ b/buildenv/docker/jdk8/s390x/ubuntu16/Dockerfile @@ -26,10 +26,6 @@ FROM ubuntu:16.04 # This section installs the required OS tools. RUN apt-get update \ - && apt-get install -qq -y --no-install-recommends \ - software-properties-common \ - python-software-properties \ - && apt-get update \ && apt-get install -qq -y --no-install-recommends \ autoconf \ ca-certificates \ diff --git a/buildenv/jenkins/README.md b/buildenv/jenkins/README.md index 79db1de3686..ab81f7c2e78 100644 --- a/buildenv/jenkins/README.md +++ b/buildenv/jenkins/README.md @@ -33,12 +33,13 @@ This folder contains Jenkins pipeline scripts that are used in the OpenJ9 Jenkin - Linux s390x (zLinux) - Linux PPCLE (pLinux) - AIX PPC (aix) + - Windows (win) - Current supported Java verisons are Java8 and Java9 - OpenJ9 committers can request builds by commenting in a pull request - Format: `Jenkins ` - Build Types: compile,test - Levels: sanity,extended (only if Build Type is test) - - Platforms: xlinux,zlinux,plinux,aix + - Platforms: xlinux,zlinux,plinux,aix,win - Java Versions: jdk8,jdk9,jdk10 - Note: You can use keyword `all` for level, platform or version @@ -187,6 +188,30 @@ You can also request a Pull Request build from the extensions repos or openj9-om - Trigger: - This job is used in other pipelines but can be launched manually +- Build-JDK8-win_x86-64_cmprssptrs + - [![Build Status](https://ci.eclipse.org/openj9/buildStatus/icon?job=Build-JDK8-win_x86-64_cmprssptrs)](https://ci.eclipse.org/openj9/job/Build-JDK8-win_x86-64_cmprssptrs) + - Description: + - Compiles java8 on win_x86-64_cmprssptrs + - Archives the SDK and test material for use in downstream jobs + - Trigger: + - This job is used in other pipelines but can be launched manually + +- Build-JDK9-win_x86-64_cmprssptrs + - [![Build Status](https://ci.eclipse.org/openj9/buildStatus/icon?job=Build-JDK9-win_x86-64_cmprssptrs)](https://ci.eclipse.org/openj9/job/Build-JDK9-win_x86-64_cmprssptrs) + - Description: + - Compiles java9 on win_x86-64_cmprssptrs + - Archives the SDK and test material for use in downstream jobs + - Trigger: + - This job is used in other pipelines but can be launched manually + +- Build-JDK10-win_x86-64_cmprssptrs + - [![Build Status](https://ci.eclipse.org/openj9/buildStatus/icon?job=Build-JDK10-win_x86-64_cmprssptrs)](https://ci.eclipse.org/openj9/job/Build-JDK10-win_x86-64_cmprssptrs) + - Description: + - Compiles java10 on win_x86-64_cmprssptrs + - Archives the SDK and test material for use in downstream jobs + - Trigger: + - This job is used in other pipelines but can be launched manually + #### Infrastructure - Mirror-OMR-to-OpenJ9-OMR @@ -211,7 +236,7 @@ You can also request a Pull Request build from the extensions repos or openj9-om - Mirrors [github.com/eclipse/openj9-website](https://github.com/eclipse/openj9-website/tree/master) to the Eclipse.org repo - Trigger: - Poll Github repo for changes - + #### Pipelines - Pipeline-Build-Test-JDK8-aix_ppc-64_cmprssptrs @@ -327,7 +352,6 @@ You can also request a Pull Request build from the extensions repos or openj9-om - `Build-JDK8-linux_x86-64_cmprssptrs` - `Test-Sanity-JDK8-linux_x86-64_cmprssptrs` - `Test-Extended-JDK8-linux_x86-64_cmprssptrs` - - Trigger: - build periodically, @midnight @@ -339,7 +363,6 @@ You can also request a Pull Request build from the extensions repos or openj9-om - `Build-JDK9-linux_x86-64_cmprssptrs` - `Test-Sanity-JDK9-linux_x86-64_cmprssptrs` - `Test-Extended-JDK9-linux_x86-64_cmprssptrs` - - Trigger: - build periodically, @midnight @@ -351,7 +374,39 @@ You can also request a Pull Request build from the extensions repos or openj9-om - `Build-JDK10-linux_x86-64_cmprssptrs` - `Test-Sanity-JDK10-linux_x86-64_cmprssptrs` - `Test-Extended-JDK10-linux_x86-64_cmprssptrs` + - Trigger: + - build periodically, @midnight + +- Pipeline-Build-Test-JDK8-win_x86-64_cmprssptrs + - [![Build Status](https://ci.eclipse.org/openj9/buildStatus/icon?job=Pipeline-Build-Test-JDK8-win_x86-64_cmprssptrs)](https://ci.eclipse.org/openj9/job/Pipeline-Build-Test-JDK8-win_x86-64_cmprssptrs) + - Description: + - Compile and Test java8 Sanity & Extended + - Triggers + - `Build-JDK8-win_x86-64_cmprssptrs` + - `Test-Sanity-JDK8-win_x86-64_cmprssptrs` + - `Test-Extended-JDK8-win_x86-64_cmprssptrs` + - Trigger: + - build periodically, @midnight +- Pipeline-Build-Test-JDK9-win_x86-64_cmprssptrs + - [![Build Status](https://ci.eclipse.org/openj9/buildStatus/icon?job=Pipeline-Build-Test-JDK9-win_x86-64_cmprssptrs)](https://ci.eclipse.org/openj9/job/Pipeline-Build-Test-JDK9-win_x86-64_cmprssptrs) + - Description: + - Compile and Test java9 Sanity & Extended + - Triggers + - `Build-JDK9-win_x86-64_cmprssptrs` + - `Test-Sanity-JDK9-win_x86-64_cmprssptrs` + - `Test-Extended-JDK9-win_x86-64_cmprssptrs` + - Trigger: + - build periodically, @midnight + +- Pipeline-Build-Test-JDK10-win_x86-64_cmprssptrs + - [![Build Status](https://ci.eclipse.org/openj9/buildStatus/icon?job=Pipeline-Build-Test-JDK10-win_x86-64_cmprssptrs)](https://ci.eclipse.org/openj9/job/Pipeline-Build-Test-JDK10-win_x86-64_cmprssptrs) + - Description: + - Compile and Test java10 Sanity & Extended + - Triggers + - `Build-JDK10-win_x86-64_cmprssptrs` + - `Test-Sanity-JDK10-win_x86-64_cmprssptrs` + - `Test-Extended-JDK10-win_x86-64_cmprssptrs` - Trigger: - build periodically, @midnight @@ -487,6 +542,27 @@ You can also request a Pull Request build from the extensions repos or openj9-om - Trigger: - This job is used in other pipelines but can be launched manually +- Test-Extended-JDK8-win_x86-64_cmprssptrs + - [![Build Status](https://ci.eclipse.org/openj9/buildStatus/icon?job=Test-Extended-JDK8-win_x86-64_cmprssptrs)](https://ci.eclipse.org/openj9/job/Test-Extended-JDK8-win_x86-64_cmprssptrs) + - Description: + - Runs extended test suite against the SDK and test material that is passed as parameters + - Trigger: + - This job is used in other pipelines but can be launched manually + +- Test-Extended-JDK9-win_x86-64_cmprssptrs + - [![Build Status](https://ci.eclipse.org/openj9/buildStatus/icon?job=Test-Extended-JDK9-win_x86-64_cmprssptrs)](https://ci.eclipse.org/openj9/job/Test-Extended-JDK9-win_x86-64_cmprssptrs) + - Description: + - Runs extended test suite against the SDK and test material that is passed as parameters + - Trigger: + - This job is used in other pipelines but can be launched manually + +- Test-Extended-JDK10-win_x86-64_cmprssptrs + - [![Build Status](https://ci.eclipse.org/openj9/buildStatus/icon?job=Test-Extended-JDK10-win_x86-64_cmprssptrs)](https://ci.eclipse.org/openj9/job/Test-Extended-JDK10-win_x86-64_cmprssptrs) + - Description: + - Runs extended test suite against the SDK and test material that is passed as parameters + - Trigger: + - This job is used in other pipelines but can be launched manually + - Test-Sanity-JDK8-aix_ppc-64_cmprssptrs - [![Build Status](https://ci.eclipse.org/openj9/buildStatus/icon?job=Test-Sanity-JDK8-aix_ppc-64_cmprssptrs)](https://ci.eclipse.org/openj9/job/Test-Sanity-JDK8-aix_ppc-64_cmprssptrs) - Description: @@ -571,6 +647,27 @@ You can also request a Pull Request build from the extensions repos or openj9-om - Trigger: - This job is used in other pipelines but can be launched manually +- Test-Sanity-JDK8-win_x86-64_cmprssptrs + - [![Build Status](https://ci.eclipse.org/openj9/buildStatus/icon?job=Test-Sanity-JDK8-win_x86-64_cmprssptrs)](https://ci.eclipse.org/openj9/job/Test-Sanity-JDK8-win_x86-64_cmprssptrs) + - Description: + - Runs sanity test suite against the SDK and test material that is passed as parameters + - Trigger: + - This job is used in other pipelines but can be launched manually + +- Test-Sanity-JDK9-win_x86-64_cmprssptrs + - [![Build Status](https://ci.eclipse.org/openj9/buildStatus/icon?job=Test-Sanity-JDK9-win_x86-64_cmprssptrs)](https://ci.eclipse.org/openj9/job/Test-Sanity-JDK9-win_x86-64_cmprssptrs) + - Description: + - Runs sanity test suite against the SDK and test material that is passed as parameters + - Trigger: + - This job is used in other pipelines but can be launched manually + +- Test-Sanity-JDK10-win_x86-64_cmprssptrs + - [![Build Status](https://ci.eclipse.org/openj9/buildStatus/icon?job=Test-Sanity-JDK10-win_x86-64_cmprssptrs)](https://ci.eclipse.org/openj9/job/Test-Sanity-JDK10-win_x86-64_cmprssptrs) + - Description: + - Runs sanity test suite against the SDK and test material that is passed as parameters + - Trigger: + - This job is used in other pipelines but can be launched manually + ### Adding Builds - Always add pipeline style jobs so the code can be committed to the repo once it is ready - Update this readme when your build is in production use diff --git a/buildenv/jenkins/common/build b/buildenv/jenkins/common/build index de00af1a602..3647c5b0c84 100644 --- a/buildenv/jenkins/common/build +++ b/buildenv/jenkins/common/build @@ -58,7 +58,21 @@ def get_sources_with_authentication() { } def get_sources() { - checkout changelog: false, poll: false, scm: [$class: 'GitSCM', branches: [[name: "${OPENJDK_BRANCH}"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CheckoutOption', timeout: 30],[$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false, timeout: 30]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: "${USER_CREDENTIALS_ID}", url: "${OPENJDK_REPO}"]]] + checkout changelog: false, + poll: false, + scm: [$class: 'GitSCM', + branches: [[name: "${OPENJDK_BRANCH}"]], + doGenerateSubmoduleConfigurations: false, + extensions: [[$class: 'CheckoutOption', timeout: 30], + [$class: 'CloneOption', + depth: 0, + noTags: false, + reference: "${OPENJDK_REFERENCE_REPO}", + shallow: false, + timeout: 30]], + submoduleCfg: [], + userRemoteConfigs: [[credentialsId: "${USER_CREDENTIALS_ID}", + url: "${OPENJDK_REPO}"]]] // Check if this build is a PR if (params.ghprbGhRepository) { @@ -240,11 +254,14 @@ def build_all() { // Typically called by Build jobs and Compile only PRs timeout(time: 6, unit: 'HOURS') { - add_node_to_description() - get_source() - build() - archive() - git_clean() + try { + add_node_to_description() + get_source() + build() + archive() + } finally { + cleanWs() + } } } diff --git a/buildenv/jenkins/common/test b/buildenv/jenkins/common/test index d43730b7612..b05666dbf08 100644 --- a/buildenv/jenkins/common/test +++ b/buildenv/jenkins/common/test @@ -96,6 +96,10 @@ def publish() { junit allowEmptyResults: true, keepLongStdio: true, testResults: '**/junitreports/**/*.xml' step([$class: 'Publisher', reportFilenamePattern: '**/testng-results.xml']) step([$class: "TapPublisher", testResults: "**/*.tap"]) + if (currentBuild.result == 'UNSTABLE') { + sh "tar -zcf test_output${TEST_TARGET}.tar.gz $WORKSPACE/openj9/test/TestConfig/test_output_*" + archiveArtifacts artifacts: "**/test_output${TEST_TARGET}.tar.gz", fingerprint: true, allowEmptyArchive: true + } } } } diff --git a/buildenv/jenkins/common/variables-functions b/buildenv/jenkins/common/variables-functions index cb8846273db..433171bae15 100644 --- a/buildenv/jenkins/common/variables-functions +++ b/buildenv/jenkins/common/variables-functions @@ -230,6 +230,7 @@ def set_build_variables() { BOOT_JDK = get_value(VARIABLES."${SPEC}".boot_jdk, SDK_VERSION) FREEMARKER = VARIABLES."${SPEC}".freemarker EXTRA_CONFIGURE_OPTIONS = get_value(VARIABLES."${SPEC}".extra_configure_options, SDK_VERSION) + OPENJDK_REFERENCE_REPO = VARIABLES."${SPEC}".openjdk_reference_repo set_release() set_jdk_folder() diff --git a/buildenv/jenkins/jobs/pipelines/Pipeline-Build-Test-All b/buildenv/jenkins/jobs/pipelines/Pipeline-Build-Test-All index 4d94c2a9890..c90483a8e06 100644 --- a/buildenv/jenkins/jobs/pipelines/Pipeline-Build-Test-All +++ b/buildenv/jenkins/jobs/pipelines/Pipeline-Build-Test-All @@ -21,7 +21,7 @@ *******************************************************************************/ def SDK_VERSIONS = ['8', '9', '10'] -def SPECS = ['linux_ppc-64_cmprssptrs_le', 'linux_390-64_cmprssptrs', 'aix_ppc-64_cmprssptrs', 'linux_x86-64_cmprssptrs'] +def SPECS = ['linux_ppc-64_cmprssptrs_le', 'linux_390-64_cmprssptrs', 'aix_ppc-64_cmprssptrs', 'linux_x86-64_cmprssptrs', 'win_x86-64_cmprssptrs'] def OPENJDK_REPOS = ['8': 'https://github.com/ibmruntimes/openj9-openjdk-jdk8.git', '9': 'https://github.com/ibmruntimes/openj9-openjdk-jdk9.git', diff --git a/buildenv/jenkins/jobs/pull-requests/PullRequest-Compile-JDK10-win_x86-64_cmprssptrs b/buildenv/jenkins/jobs/pull-requests/PullRequest-Compile-JDK10-win_x86-64_cmprssptrs new file mode 100644 index 00000000000..17d47a712e6 --- /dev/null +++ b/buildenv/jenkins/jobs/pull-requests/PullRequest-Compile-JDK10-win_x86-64_cmprssptrs @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2018, 2018 IBM Corp. and others + * + * This program and the accompanying materials are made available under + * the terms of the Eclipse Public License 2.0 which accompanies this + * distribution and is available at https://www.eclipse.org/legal/epl-2.0/ + * or the Apache License, Version 2.0 which accompanies this distribution and + * is available at https://www.apache.org/licenses/LICENSE-2.0. + * + * This Source Code may also be made available under the following + * Secondary Licenses when the conditions for such availability set + * forth in the Eclipse Public License, v. 2.0 are satisfied: GNU + * General Public License, version 2 with the GNU Classpath + * Exception [1] and GNU General Public License, version 2 with the + * OpenJDK Assembly Exception [2]. + * + * [1] https://www.gnu.org/software/classpath/license.html + * [2] http://openjdk.java.net/legal/assembly-exception.html + * + * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception + *******************************************************************************/ + +SDK_VERSION = '10' +SPEC = 'win_x86-64_cmprssptrs' + +timeout(time: 10, unit: 'HOURS') { + node('master') { + timestamps { + checkout scm + variableFile = load 'buildenv/jenkins/common/variables-functions' + variableFile.set_job_variables('build') + buildfile = load 'buildenv/jenkins/common/build' + cleanWs() + } + } + + node("${NODE}") { + + buildfile.build_all() + } +} diff --git a/buildenv/jenkins/jobs/pull-requests/PullRequest-Compile-JDK8-win_x86-64_cmprssptrs b/buildenv/jenkins/jobs/pull-requests/PullRequest-Compile-JDK8-win_x86-64_cmprssptrs new file mode 100644 index 00000000000..34b378ebd2a --- /dev/null +++ b/buildenv/jenkins/jobs/pull-requests/PullRequest-Compile-JDK8-win_x86-64_cmprssptrs @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2018, 2018 IBM Corp. and others + * + * This program and the accompanying materials are made available under + * the terms of the Eclipse Public License 2.0 which accompanies this + * distribution and is available at https://www.eclipse.org/legal/epl-2.0/ + * or the Apache License, Version 2.0 which accompanies this distribution and + * is available at https://www.apache.org/licenses/LICENSE-2.0. + * + * This Source Code may also be made available under the following + * Secondary Licenses when the conditions for such availability set + * forth in the Eclipse Public License, v. 2.0 are satisfied: GNU + * General Public License, version 2 with the GNU Classpath + * Exception [1] and GNU General Public License, version 2 with the + * OpenJDK Assembly Exception [2]. + * + * [1] https://www.gnu.org/software/classpath/license.html + * [2] http://openjdk.java.net/legal/assembly-exception.html + * + * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception + *******************************************************************************/ + +SDK_VERSION = '8' +SPEC = 'win_x86-64_cmprssptrs' + +timeout(time: 10, unit: 'HOURS') { + node('master') { + timestamps { + checkout scm + variableFile = load 'buildenv/jenkins/common/variables-functions' + variableFile.set_job_variables('build') + buildfile = load 'buildenv/jenkins/common/build' + cleanWs() + } + } + + node("${NODE}") { + + buildfile.build_all() + } +} diff --git a/buildenv/jenkins/jobs/pull-requests/PullRequest-Compile-JDK9-win_x86-64_cmprssptrs b/buildenv/jenkins/jobs/pull-requests/PullRequest-Compile-JDK9-win_x86-64_cmprssptrs new file mode 100644 index 00000000000..36982e0bb39 --- /dev/null +++ b/buildenv/jenkins/jobs/pull-requests/PullRequest-Compile-JDK9-win_x86-64_cmprssptrs @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2018, 2018 IBM Corp. and others + * + * This program and the accompanying materials are made available under + * the terms of the Eclipse Public License 2.0 which accompanies this + * distribution and is available at https://www.eclipse.org/legal/epl-2.0/ + * or the Apache License, Version 2.0 which accompanies this distribution and + * is available at https://www.apache.org/licenses/LICENSE-2.0. + * + * This Source Code may also be made available under the following + * Secondary Licenses when the conditions for such availability set + * forth in the Eclipse Public License, v. 2.0 are satisfied: GNU + * General Public License, version 2 with the GNU Classpath + * Exception [1] and GNU General Public License, version 2 with the + * OpenJDK Assembly Exception [2]. + * + * [1] https://www.gnu.org/software/classpath/license.html + * [2] http://openjdk.java.net/legal/assembly-exception.html + * + * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception + *******************************************************************************/ + +SDK_VERSION = '9' +SPEC = 'win_x86-64_cmprssptrs' + +timeout(time: 10, unit: 'HOURS') { + node('master') { + timestamps { + checkout scm + variableFile = load 'buildenv/jenkins/common/variables-functions' + variableFile.set_job_variables('build') + buildfile = load 'buildenv/jenkins/common/build' + cleanWs() + } + } + + node("${NODE}") { + + buildfile.build_all() + } +} diff --git a/buildenv/jenkins/jobs/pull-requests/PullRequest-Extended-JDK10-win_x86-64_cmprssptrs b/buildenv/jenkins/jobs/pull-requests/PullRequest-Extended-JDK10-win_x86-64_cmprssptrs new file mode 100644 index 00000000000..a4aa73f52d0 --- /dev/null +++ b/buildenv/jenkins/jobs/pull-requests/PullRequest-Extended-JDK10-win_x86-64_cmprssptrs @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright (c) 2018, 2018 IBM Corp. and others + * + * This program and the accompanying materials are made available under + * the terms of the Eclipse Public License 2.0 which accompanies this + * distribution and is available at https://www.eclipse.org/legal/epl-2.0/ + * or the Apache License, Version 2.0 which accompanies this distribution and + * is available at https://www.apache.org/licenses/LICENSE-2.0. + * + * This Source Code may also be made available under the following + * Secondary Licenses when the conditions for such availability set + * forth in the Eclipse Public License, v. 2.0 are satisfied: GNU + * General Public License, version 2 with the GNU Classpath + * Exception [1] and GNU General Public License, version 2 with the + * OpenJDK Assembly Exception [2]. + * + * [1] https://www.gnu.org/software/classpath/license.html + * [2] http://openjdk.java.net/legal/assembly-exception.html + * + * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception + *******************************************************************************/ + +SDK_VERSION = '10' +SPEC = 'win_x86-64_cmprssptrs' +TEST_TARGET = '_extended' + +timeout(time: 10, unit: 'HOURS') { + node('master') { + + checkout scm + variableFile = load 'buildenv/jenkins/common/variables-functions' + variableFile.set_job_variables('pullRequest') + cleanWs() + } + + node("${NODE}") { + + checkout scm + buildfile = load 'buildenv/jenkins/common/build' + testfile = load 'buildenv/jenkins/common/test' + + // Build + buildfile.build_pr() + + // Test + archive_test = [:] + archive_test['Archive'] = { buildfile.archive() } + archive_test['Test'] = { testfile.test_all() } + + parallel archive_test + buildfile.git_clean() + } +} diff --git a/buildenv/jenkins/jobs/pull-requests/PullRequest-Extended-JDK8-win_x86-64_cmprssptrs b/buildenv/jenkins/jobs/pull-requests/PullRequest-Extended-JDK8-win_x86-64_cmprssptrs new file mode 100644 index 00000000000..6e32880b5c4 --- /dev/null +++ b/buildenv/jenkins/jobs/pull-requests/PullRequest-Extended-JDK8-win_x86-64_cmprssptrs @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright (c) 2018, 2018 IBM Corp. and others + * + * This program and the accompanying materials are made available under + * the terms of the Eclipse Public License 2.0 which accompanies this + * distribution and is available at https://www.eclipse.org/legal/epl-2.0/ + * or the Apache License, Version 2.0 which accompanies this distribution and + * is available at https://www.apache.org/licenses/LICENSE-2.0. + * + * This Source Code may also be made available under the following + * Secondary Licenses when the conditions for such availability set + * forth in the Eclipse Public License, v. 2.0 are satisfied: GNU + * General Public License, version 2 with the GNU Classpath + * Exception [1] and GNU General Public License, version 2 with the + * OpenJDK Assembly Exception [2]. + * + * [1] https://www.gnu.org/software/classpath/license.html + * [2] http://openjdk.java.net/legal/assembly-exception.html + * + * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception + *******************************************************************************/ + +SDK_VERSION = '8' +SPEC = 'win_x86-64_cmprssptrs' +TEST_TARGET = '_extended' + +timeout(time: 10, unit: 'HOURS') { + node('master') { + + checkout scm + variableFile = load 'buildenv/jenkins/common/variables-functions' + variableFile.set_job_variables('pullRequest') + cleanWs() + } + + node("${NODE}") { + + checkout scm + buildfile = load 'buildenv/jenkins/common/build' + testfile = load 'buildenv/jenkins/common/test' + + // Build + buildfile.build_pr() + + // Test + archive_test = [:] + archive_test['Archive'] = { buildfile.archive() } + archive_test['Test'] = { testfile.test_all() } + + parallel archive_test + buildfile.git_clean() + } +} diff --git a/buildenv/jenkins/jobs/pull-requests/PullRequest-Extended-JDK9-win_x86-64_cmprssptrs b/buildenv/jenkins/jobs/pull-requests/PullRequest-Extended-JDK9-win_x86-64_cmprssptrs new file mode 100644 index 00000000000..0da465b18d6 --- /dev/null +++ b/buildenv/jenkins/jobs/pull-requests/PullRequest-Extended-JDK9-win_x86-64_cmprssptrs @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright (c) 2018, 2018 IBM Corp. and others + * + * This program and the accompanying materials are made available under + * the terms of the Eclipse Public License 2.0 which accompanies this + * distribution and is available at https://www.eclipse.org/legal/epl-2.0/ + * or the Apache License, Version 2.0 which accompanies this distribution and + * is available at https://www.apache.org/licenses/LICENSE-2.0. + * + * This Source Code may also be made available under the following + * Secondary Licenses when the conditions for such availability set + * forth in the Eclipse Public License, v. 2.0 are satisfied: GNU + * General Public License, version 2 with the GNU Classpath + * Exception [1] and GNU General Public License, version 2 with the + * OpenJDK Assembly Exception [2]. + * + * [1] https://www.gnu.org/software/classpath/license.html + * [2] http://openjdk.java.net/legal/assembly-exception.html + * + * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception + *******************************************************************************/ + +SDK_VERSION = '9' +SPEC = 'win_x86-64_cmprssptrs' +TEST_TARGET = '_extended' + +timeout(time: 10, unit: 'HOURS') { + node('master') { + + checkout scm + variableFile = load 'buildenv/jenkins/common/variables-functions' + variableFile.set_job_variables('pullRequest') + cleanWs() + } + + node("${NODE}") { + + checkout scm + buildfile = load 'buildenv/jenkins/common/build' + testfile = load 'buildenv/jenkins/common/test' + + // Build + buildfile.build_pr() + + // Test + archive_test = [:] + archive_test['Archive'] = { buildfile.archive() } + archive_test['Test'] = { testfile.test_all() } + + parallel archive_test + buildfile.git_clean() + } +} diff --git a/buildenv/jenkins/jobs/pull-requests/PullRequest-Sanity-JDK10-win_x86-64_cmprssptrs b/buildenv/jenkins/jobs/pull-requests/PullRequest-Sanity-JDK10-win_x86-64_cmprssptrs new file mode 100644 index 00000000000..61cfd3d0c8f --- /dev/null +++ b/buildenv/jenkins/jobs/pull-requests/PullRequest-Sanity-JDK10-win_x86-64_cmprssptrs @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright (c) 2018, 2018 IBM Corp. and others + * + * This program and the accompanying materials are made available under + * the terms of the Eclipse Public License 2.0 which accompanies this + * distribution and is available at https://www.eclipse.org/legal/epl-2.0/ + * or the Apache License, Version 2.0 which accompanies this distribution and + * is available at https://www.apache.org/licenses/LICENSE-2.0. + * + * This Source Code may also be made available under the following + * Secondary Licenses when the conditions for such availability set + * forth in the Eclipse Public License, v. 2.0 are satisfied: GNU + * General Public License, version 2 with the GNU Classpath + * Exception [1] and GNU General Public License, version 2 with the + * OpenJDK Assembly Exception [2]. + * + * [1] https://www.gnu.org/software/classpath/license.html + * [2] http://openjdk.java.net/legal/assembly-exception.html + * + * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception + *******************************************************************************/ + +SDK_VERSION = '10' +SPEC = 'win_x86-64_cmprssptrs' +TEST_TARGET = '_sanity' + +timeout(time: 10, unit: 'HOURS') { + node('master') { + + checkout scm + variableFile = load 'buildenv/jenkins/common/variables-functions' + variableFile.set_job_variables('pullRequest') + cleanWs() + } + + node("${NODE}") { + + checkout scm + buildfile = load 'buildenv/jenkins/common/build' + testfile = load 'buildenv/jenkins/common/test' + + // Build + buildfile.build_pr() + + // Test + archive_test = [:] + archive_test['Archive'] = { buildfile.archive() } + archive_test['Test'] = { testfile.test_all() } + + parallel archive_test + buildfile.git_clean() + } +} diff --git a/buildenv/jenkins/jobs/pull-requests/PullRequest-Sanity-JDK8-win_x86-64_cmprssptrs b/buildenv/jenkins/jobs/pull-requests/PullRequest-Sanity-JDK8-win_x86-64_cmprssptrs new file mode 100644 index 00000000000..94e8f37f321 --- /dev/null +++ b/buildenv/jenkins/jobs/pull-requests/PullRequest-Sanity-JDK8-win_x86-64_cmprssptrs @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright (c) 2018, 2018 IBM Corp. and others + * + * This program and the accompanying materials are made available under + * the terms of the Eclipse Public License 2.0 which accompanies this + * distribution and is available at https://www.eclipse.org/legal/epl-2.0/ + * or the Apache License, Version 2.0 which accompanies this distribution and + * is available at https://www.apache.org/licenses/LICENSE-2.0. + * + * This Source Code may also be made available under the following + * Secondary Licenses when the conditions for such availability set + * forth in the Eclipse Public License, v. 2.0 are satisfied: GNU + * General Public License, version 2 with the GNU Classpath + * Exception [1] and GNU General Public License, version 2 with the + * OpenJDK Assembly Exception [2]. + * + * [1] https://www.gnu.org/software/classpath/license.html + * [2] http://openjdk.java.net/legal/assembly-exception.html + * + * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception + *******************************************************************************/ + +SDK_VERSION = '8' +SPEC = 'win_x86-64_cmprssptrs' +TEST_TARGET = '_sanity' + +timeout(time: 10, unit: 'HOURS') { + node('master') { + + checkout scm + variableFile = load 'buildenv/jenkins/common/variables-functions' + variableFile.set_job_variables('pullRequest') + cleanWs() + } + + node("${NODE}") { + + checkout scm + buildfile = load 'buildenv/jenkins/common/build' + testfile = load 'buildenv/jenkins/common/test' + + // Build + buildfile.build_pr() + + // Test + archive_test = [:] + archive_test['Archive'] = { buildfile.archive() } + archive_test['Test'] = { testfile.test_all() } + + parallel archive_test + buildfile.git_clean() + } +} diff --git a/buildenv/jenkins/jobs/pull-requests/PullRequest-Sanity-JDK9-win_x86-64_cmprssptrs b/buildenv/jenkins/jobs/pull-requests/PullRequest-Sanity-JDK9-win_x86-64_cmprssptrs new file mode 100644 index 00000000000..f32042b20ca --- /dev/null +++ b/buildenv/jenkins/jobs/pull-requests/PullRequest-Sanity-JDK9-win_x86-64_cmprssptrs @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright (c) 2018, 2018 IBM Corp. and others + * + * This program and the accompanying materials are made available under + * the terms of the Eclipse Public License 2.0 which accompanies this + * distribution and is available at https://www.eclipse.org/legal/epl-2.0/ + * or the Apache License, Version 2.0 which accompanies this distribution and + * is available at https://www.apache.org/licenses/LICENSE-2.0. + * + * This Source Code may also be made available under the following + * Secondary Licenses when the conditions for such availability set + * forth in the Eclipse Public License, v. 2.0 are satisfied: GNU + * General Public License, version 2 with the GNU Classpath + * Exception [1] and GNU General Public License, version 2 with the + * OpenJDK Assembly Exception [2]. + * + * [1] https://www.gnu.org/software/classpath/license.html + * [2] http://openjdk.java.net/legal/assembly-exception.html + * + * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception + *******************************************************************************/ + +SDK_VERSION = '9' +SPEC = 'win_x86-64_cmprssptrs' +TEST_TARGET = '_sanity' + +timeout(time: 10, unit: 'HOURS') { + node('master') { + + checkout scm + variableFile = load 'buildenv/jenkins/common/variables-functions' + variableFile.set_job_variables('pullRequest') + cleanWs() + } + + node("${NODE}") { + + checkout scm + buildfile = load 'buildenv/jenkins/common/build' + testfile = load 'buildenv/jenkins/common/test' + + // Build + buildfile.build_pr() + + // Test + archive_test = [:] + archive_test['Archive'] = { buildfile.archive() } + archive_test['Test'] = { testfile.test_all() } + + parallel archive_test + buildfile.git_clean() + } +} diff --git a/buildenv/jenkins/variables/defaults.yml b/buildenv/jenkins/variables/defaults.yml index 4eec1c7e25b..d92d5c96ac4 100644 --- a/buildenv/jenkins/variables/defaults.yml +++ b/buildenv/jenkins/variables/defaults.yml @@ -57,6 +57,7 @@ linux_ppc-64_cmprssptrs_le: 9: 'linux-ppc64le-normal-server-release' 10: 'linux-ppc64le-normal-server-release' freemarker: '/home/jenkins/freemarker.jar' + openjdk_reference_repo: '/home/jenkins/openjdk_cache' node_labels: build: 8: 'ppcle' @@ -75,6 +76,7 @@ linux_ppc-64_cmprssptrs_le_valhalla_nestmates: release: 10: 'linux-ppc64le-normal-server-release' freemarker: '/home/jenkins/freemarker.jar' + openjdk_reference_repo: '/home/jenkins/openjdk_cache' node_labels: build: 10: 'ppcle' @@ -95,6 +97,7 @@ linux_390-64_cmprssptrs: 9: 'linux-s390x-normal-server-release' 10: 'linux-s390x-normal-server-release' freemarker: '/home/jenkins/freemarker.jar' + openjdk_reference_repo: '/home/jenkins/openjdk_cache' node_labels: build: 8: '390' @@ -117,6 +120,7 @@ aix_ppc-64_cmprssptrs: 9: 'aix-ppc64-normal-server-release' 10: 'aix-ppc64-normal-server-release' freemarker: '/home/jenkins/freemarker.jar' + openjdk_reference_repo: '/home/jenkins/openjdk_cache' node_labels: build: 8: 'aix' @@ -143,6 +147,7 @@ linux_x86-64_cmprssptrs: 9: 'linux-x86_64-normal-server-release' 10: 'linux-x86_64-normal-server-release' freemarker: '/home/jenkins/freemarker.jar' + openjdk_reference_repo: '/home/jenkins/openjdk_cache' node_labels: build: 8: 'hw.arch.x86 && sw.os.ubuntu.16' @@ -152,3 +157,30 @@ linux_x86-64_cmprssptrs: 8: 'hw.arch.x86 && sw.os.ubuntu.16' 9: 'hw.arch.x86 && sw.os.ubuntu.16' 10: 'hw.arch.x86 && sw.os.ubuntu.16' +#========================================# +# Windows x86 64bits Compressed Pointers +#========================================# +win_x86-64_cmprssptrs: + boot_jdk: + 8: '/cygdrive/c/openjdk/jdk7' + 9: '/cygdrive/c/openjdk/jdk8' + 10: '/cygdrive/c/openjdk/jdk9' + release: + 8: 'windows-x86_64-normal-server-release' + 9: 'windows-x86_64-normal-server-release' + 10: 'windows-x86_64-normal-server-release' + freemarker: '/cygdrive/c/openjdk/freemarker.jar' + openjdk_reference_repo: '/cygdrive/c/openjdk/openjdk_cache' + extra_configure_options: + 8: '--with-freetype-include=/cygdrive/c/openjdk/freetype-2.5.3/include --with-freetype-lib=/cygdrive/c/openjdk/freetype-2.5.3/lib64 --disable-ccache' + 9: '--with-freetype-src=/cygdrive/c/openjdk/freetype-2.5.3 --with-toolchain-version=2013 --disable-ccache' + 10: '--with-freetype-src=/cygdrive/c/openjdk/freetype-2.5.3 --with-toolchain-version=2013 --disable-ccache' + node_labels: + build: + 8: 'hw.arch.x86 && sw.os.windows' + 9: 'hw.arch.x86 && sw.os.windows' + 10: 'hw.arch.x86 && sw.os.windows' + test: + 8: 'hw.arch.x86 && sw.os.windows' + 9: 'hw.arch.x86 && sw.os.windows' + 10: 'hw.arch.x86 && sw.os.windows' diff --git a/debugtools/DDR_VM/src/com/ibm/j9ddr/tools/ddrinteractive/DDRInteractive.java b/debugtools/DDR_VM/src/com/ibm/j9ddr/tools/ddrinteractive/DDRInteractive.java index cfe7e18cc14..5fed57d77ec 100644 --- a/debugtools/DDR_VM/src/com/ibm/j9ddr/tools/ddrinteractive/DDRInteractive.java +++ b/debugtools/DDR_VM/src/com/ibm/j9ddr/tools/ddrinteractive/DDRInteractive.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 1991, 2015 IBM Corp. and others + * Copyright (c) 1991, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -55,7 +55,6 @@ import com.ibm.j9ddr.exceptions.MissingDDRStructuresException; import com.ibm.j9ddr.logging.LoggerNames; import com.ibm.j9ddr.tools.ddrinteractive.commands.ForeachCommand; -import com.ibm.j9ddr.tools.ddrinteractive.commands.LimitCommand; import com.ibm.j9ddr.tools.ddrinteractive.commands.LookupSymbolCommand; import com.ibm.j9ddr.tools.ddrinteractive.commands.NativeLibrariesCommand; import com.ibm.j9ddr.tools.ddrinteractive.commands.NativeStacksCommand; @@ -65,7 +64,6 @@ import com.ibm.j9ddr.view.dtfj.image.J9DDRImageAddressSpace; import com.ibm.j9ddr.view.dtfj.image.J9DDRImageProcess; - public class DDRInteractive implements Runnable { private final PrintStream out; @@ -95,7 +93,6 @@ public class DDRInteractive implements Runnable localCommandList.add(new NativeStacksCommand()); localCommandList.add(new ExtractMemoryCommand()); localCommandList.add(new TimeCommand()); - localCommandList.add(new LimitCommand()); localCommandList.add(new ForeachCommand()); nonVMCommands = Collections.unmodifiableList(localCommandList); diff --git a/debugtools/DDR_VM/src/com/ibm/j9ddr/tools/ddrinteractive/commands/LimitCommand.java b/debugtools/DDR_VM/src/com/ibm/j9ddr/tools/ddrinteractive/commands/LimitCommand.java deleted file mode 100644 index f91a8abde45..00000000000 --- a/debugtools/DDR_VM/src/com/ibm/j9ddr/tools/ddrinteractive/commands/LimitCommand.java +++ /dev/null @@ -1,80 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 IBM Corp. and others - * - * This program and the accompanying materials are made available under - * the terms of the Eclipse Public License 2.0 which accompanies this - * distribution and is available at https://www.eclipse.org/legal/epl-2.0/ - * or the Apache License, Version 2.0 which accompanies this distribution and - * is available at https://www.apache.org/licenses/LICENSE-2.0. - * - * This Source Code may also be made available under the following - * Secondary Licenses when the conditions for such availability set - * forth in the Eclipse Public License, v. 2.0 are satisfied: GNU - * General Public License, version 2 with the GNU Classpath - * Exception [1] and GNU General Public License, version 2 with the - * OpenJDK Assembly Exception [2]. - * - * [1] https://www.gnu.org/software/classpath/license.html - * [2] http://openjdk.java.net/legal/assembly-exception.html - * - * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception - *******************************************************************************/ -package com.ibm.j9ddr.tools.ddrinteractive.commands; - -import java.io.PrintStream; -import java.text.ParseException; - -import com.ibm.j9ddr.command.CommandParser; -import com.ibm.j9ddr.tools.ddrinteractive.Command; -import com.ibm.j9ddr.tools.ddrinteractive.Context; -import com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException; - -public class LimitCommand extends Command { - - public LimitCommand() - { - addCommand("limit", " []", "run another command; terminate if it exceeds the timeout"); - } - - @SuppressWarnings("deprecation") - public void run(String command, final String[] args, final Context context, final PrintStream out) throws DDRInteractiveCommandException { - final String[] newArgs; - if (args.length < 2) { - out.println("The limit command requires a timeout and another command to run as an argument."); - return; - } - - long timeout = Integer.parseInt(args[0]) * 1000; - - if (args.length > 2) { - newArgs = new String[args.length - 2]; - System.arraycopy(args, 2, newArgs, 0, newArgs.length); - } else { - newArgs = new String[0]; - } - - Thread runner = new Thread("LimitCommand: " + args[1]) - { - public void run() - { - try { - CommandParser commandParser = new CommandParser(args[1], newArgs); - context.execute(commandParser, out); - } catch (ParseException e) { - e.printStackTrace(out); - } - } - }; - runner.start(); - try { - runner.join(timeout); - } catch (InterruptedException e) { - e.printStackTrace(); - } - if (runner.isAlive()) { - runner.stop(new DDRInteractiveCommandException("Timeout exceeded!")); - } - - } - -} diff --git a/debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/j9/J9VMThreadPointerUtil.java b/debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/j9/J9VMThreadPointerUtil.java index 6eb3d1fa8b9..bc389332eb5 100644 --- a/debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/j9/J9VMThreadPointerUtil.java +++ b/debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/j9/J9VMThreadPointerUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2014 IBM Corp. and others + * Copyright (c) 2001, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -277,10 +277,12 @@ public static ThreadInfo getJ9State(J9VMThreadPointer targetThread) throws Corru thrinfo.lockObject = null; vmstate = getInflatedMonitorState(j9self, j9state, thrinfo); } - - if(thrinfo.rawLock != null) { - if(thrinfo.rawLock.flags().allBitsIn(J9THREAD_MONITOR_OBJECT)) { - thrinfo.lockObject = J9ObjectPointer.cast(thrinfo.rawLock.userData()); + + if((thrinfo.lockObject == null) || thrinfo.lockObject.isNull()) { + if(!((thrinfo.rawLock == null) || thrinfo.rawLock.isNull())) { + if(thrinfo.rawLock.flags().allBitsIn(J9THREAD_MONITOR_OBJECT)) { + thrinfo.lockObject = J9ObjectPointer.cast(thrinfo.rawLock.userData()); + } } } diff --git a/jcl/src/java.base/share/classes/com/ibm/tools/attach/target/Reply.java b/jcl/src/java.base/share/classes/com/ibm/tools/attach/target/Reply.java index 442c0c163ef..22a100cbc61 100644 --- a/jcl/src/java.base/share/classes/com/ibm/tools/attach/target/Reply.java +++ b/jcl/src/java.base/share/classes/com/ibm/tools/attach/target/Reply.java @@ -1,7 +1,7 @@ /*[INCLUDE-IF Sidecar16]*/ package com.ibm.tools.attach.target; /******************************************************************************* - * Copyright (c) 2009, 2010 IBM Corp. and others + * Copyright (c) 2009, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -112,7 +112,7 @@ static Reply readReply(String path) throws IOException { String line = replyStream.readLine(); replyStream.close(); try { - rply.portNumber= new Integer(line); + rply.portNumber = Integer.valueOf(line); } catch (NumberFormatException e) { rply.portNumber = Integer.valueOf(-1); throw new IOException(e.getMessage()); diff --git a/jcl/src/jdk.management/share/classes/com/ibm/lang/management/internal/AvailableProcessorsNotificationInfoUtil.java b/jcl/src/jdk.management/share/classes/com/ibm/lang/management/internal/AvailableProcessorsNotificationInfoUtil.java index 717bc5052cd..6272fcee336 100644 --- a/jcl/src/jdk.management/share/classes/com/ibm/lang/management/internal/AvailableProcessorsNotificationInfoUtil.java +++ b/jcl/src/jdk.management/share/classes/com/ibm/lang/management/internal/AvailableProcessorsNotificationInfoUtil.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar17]*/ /******************************************************************************* - * Copyright (c) 2016, 2016 IBM Corp. and others + * Copyright (c) 2016, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -81,7 +81,7 @@ public static CompositeData toCompositeData(AvailableProcessorsNotificationInfo if (info != null) { CompositeType type = getCompositeType(); String[] names = { "newAvailableProcessors" }; //$NON-NLS-1$ - Object[] values = { new Integer(info.getNewAvailableProcessors()) }; + Object[] values = { Integer.valueOf(info.getNewAvailableProcessors()) }; try { result = new CompositeDataSupport(type, names, values); diff --git a/jcl/src/jdk.management/share/classes/com/ibm/lang/management/internal/ProcessingCapacityNotificationInfoUtil.java b/jcl/src/jdk.management/share/classes/com/ibm/lang/management/internal/ProcessingCapacityNotificationInfoUtil.java index ba2c213f5ac..575c7461282 100644 --- a/jcl/src/jdk.management/share/classes/com/ibm/lang/management/internal/ProcessingCapacityNotificationInfoUtil.java +++ b/jcl/src/jdk.management/share/classes/com/ibm/lang/management/internal/ProcessingCapacityNotificationInfoUtil.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar17]*/ /******************************************************************************* - * Copyright (c) 2016, 2016 IBM Corp. and others + * Copyright (c) 2016, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -81,7 +81,7 @@ public static CompositeData toCompositeData(ProcessingCapacityNotificationInfo i if (info != null) { CompositeType type = getCompositeType(); String[] names = { "newProcessingCapacity" }; //$NON-NLS-1$ - Object[] values = { new Integer(info.getNewProcessingCapacity()) }; + Object[] values = { Integer.valueOf(info.getNewProcessingCapacity()) }; try { result = new CompositeDataSupport(type, names, values); diff --git a/jcl/src/jdk.management/share/classes/com/ibm/lang/management/internal/TotalPhysicalMemoryNotificationInfoUtil.java b/jcl/src/jdk.management/share/classes/com/ibm/lang/management/internal/TotalPhysicalMemoryNotificationInfoUtil.java index 2c7c05fa0dd..738f7d70a51 100644 --- a/jcl/src/jdk.management/share/classes/com/ibm/lang/management/internal/TotalPhysicalMemoryNotificationInfoUtil.java +++ b/jcl/src/jdk.management/share/classes/com/ibm/lang/management/internal/TotalPhysicalMemoryNotificationInfoUtil.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar17]*/ /******************************************************************************* - * Copyright (c) 2016, 2016 IBM Corp. and others + * Copyright (c) 2016, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -73,7 +73,7 @@ public static CompositeData toCompositeData(TotalPhysicalMemoryNotificationInfo if (info != null) { CompositeType type = getCompositeType(); String[] names = { "newTotalPhysicalMemory" }; //$NON-NLS-1$ - Object[] values = { new Long(info.getNewTotalPhysicalMemory()) }; + Object[] values = { Long.valueOf(info.getNewTotalPhysicalMemory()) }; try { result = new CompositeDataSupport(type, names, values); diff --git a/jcl/src/openj9.cuda/share/classes/com/ibm/cuda/Cuda.java b/jcl/src/openj9.cuda/share/classes/com/ibm/cuda/Cuda.java index 47ca723f9bd..bbc2e438a72 100644 --- a/jcl/src/openj9.cuda/share/classes/com/ibm/cuda/Cuda.java +++ b/jcl/src/openj9.cuda/share/classes/com/ibm/cuda/Cuda.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF CUDA4J | Sidecar19-SE]*/ /******************************************************************************* - * Copyright (c) 2013, 2017 IBM Corp. and others + * Copyright (c) 2013, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -70,7 +70,7 @@ private Cleaner() { } ByteBuffer insert(ByteBuffer buffer, long address) { - inuse.put(new WeakReference<>(buffer, queue), new Long(address)); + inuse.put(new WeakReference<>(buffer, queue), Long.valueOf(address)); return buffer; } diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/addressspace/CommonAddressSpace.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/addressspace/CommonAddressSpace.java index 21e5bbe96b8..81e22425508 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/addressspace/CommonAddressSpace.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/addressspace/CommonAddressSpace.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -38,7 +38,7 @@ public abstract class CommonAddressSpace implements IAbstractAddressSpace { private static final int MEMORY_CHECK_THRESHOLD = 0x100000; private MemoryRange[] _translations; - private Integer _lastTranslationUsed = new Integer(0); + private Integer _lastTranslationUsed = Integer.valueOf(0); private boolean _isLittleEndian; private boolean _is64Bit; private int lastAsid; @@ -177,7 +177,7 @@ protected static int findWhichMemoryRange(int asid, long addr, MemoryRange[] ran } } if (-1 != retI) { - lastRange = new Integer(retI); + lastRange = Integer.valueOf(retI); } return retI; } diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/addressspace/LayeredAddressSpace.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/addressspace/LayeredAddressSpace.java index 4b0d71ed957..c3bcd39a403 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/addressspace/LayeredAddressSpace.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/addressspace/LayeredAddressSpace.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -41,7 +41,7 @@ public class LayeredAddressSpace extends CommonAddressSpace private TreeMap _moduleRanges = new TreeMap(); private IAbstractAddressSpace _base; private MemoryRange[] _moduleRangesArray = null; - private Integer _lastModuleRange = new Integer(0); + private Integer _lastModuleRange = Integer.valueOf(0); public LayeredAddressSpace(IAbstractAddressSpace base, boolean isLittleEndian, boolean is64Bit) { diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/Aix32Dump.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/Aix32Dump.java index 0978385c904..910b432333b 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/Aix32Dump.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/Aix32Dump.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 1991, 2017 IBM Corp. and others + * Copyright (c) 1991, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -57,18 +57,18 @@ protected int pointerSize() { protected Map readRegisters(long threadOffset) throws IOException { Map registers = new TreeMap(); coreSeek(threadOffset + CONTEXT_OFFSET_IN_THREAD + IAR_OFFSET_IN_CONTEXT); - registers.put("iar", new Integer(coreReadInt())); - registers.put("msr", new Integer(coreReadInt())); - registers.put("cr", new Integer(coreReadInt())); - registers.put("lr", new Integer(coreReadInt())); - registers.put("ctr", new Integer(coreReadInt())); - registers.put("xer", new Integer(coreReadInt())); - registers.put("mq", new Integer(coreReadInt())); - registers.put("tid", new Integer(coreReadInt())); - registers.put("fpscr", new Integer(coreReadInt())); + registers.put("iar", Integer.valueOf(coreReadInt())); + registers.put("msr", Integer.valueOf(coreReadInt())); + registers.put("cr", Integer.valueOf(coreReadInt())); + registers.put("lr", Integer.valueOf(coreReadInt())); + registers.put("ctr", Integer.valueOf(coreReadInt())); + registers.put("xer", Integer.valueOf(coreReadInt())); + registers.put("mq", Integer.valueOf(coreReadInt())); + registers.put("tid", Integer.valueOf(coreReadInt())); + registers.put("fpscr", Integer.valueOf(coreReadInt())); coreSeek(threadOffset + CONTEXT_OFFSET_IN_THREAD + GPR_OFFSET_IN_CONTEXT); for (int i = 0; i < GPR_COUNT; i++) - registers.put("gpr" + i, new Integer(coreReadInt())); + registers.put("gpr" + i, Integer.valueOf(coreReadInt())); return registers; } diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/Aix64Dump.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/Aix64Dump.java index 565e2ba7229..016a4554e16 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/Aix64Dump.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/Aix64Dump.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 1991, 2017 IBM Corp. and others + * Copyright (c) 1991, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -74,14 +74,14 @@ protected Map readRegisters(long threadOffset) throws IOException { coreSeek(threadOffset + sizeofThreadEntry64); Map registers = new TreeMap(); for (int i = 0; i < GPR_COUNT; i++) - registers.put("gpr" + i, new Long(coreReadLong())); - registers.put("msr", new Long(coreReadLong())); - registers.put("iar", new Long(coreReadLong())); - registers.put("lr", new Long(coreReadLong())); - registers.put("ctr", new Long(coreReadLong())); - registers.put("cr", new Integer(coreReadInt())); - registers.put("xer", new Integer(coreReadInt())); - registers.put("fpscr", new Integer(coreReadInt())); + registers.put("gpr" + i, Long.valueOf(coreReadLong())); + registers.put("msr", Long.valueOf(coreReadLong())); + registers.put("iar", Long.valueOf(coreReadLong())); + registers.put("lr", Long.valueOf(coreReadLong())); + registers.put("ctr", Long.valueOf(coreReadLong())); + registers.put("cr", Integer.valueOf(coreReadInt())); + registers.put("xer", Integer.valueOf(coreReadInt())); + registers.put("fpscr", Integer.valueOf(coreReadInt())); return registers; } diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewAixDump.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewAixDump.java index ea219904fbc..8cd6d1439e8 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewAixDump.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewAixDump.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -457,7 +457,7 @@ private Properties getEnvironmentVariables(long environmentAddress) throws IOExc } long address = coreReadAddress(); while (address != 0) { - addresses.add(new Long(address)); + addresses.add(Long.valueOf(address)); address = coreReadAddress(); } diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewElfDump.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewElfDump.java index 719652c3222..aed00c2db20 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewElfDump.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewElfDump.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -106,7 +106,7 @@ Address add(long offset) { return new Address32((int) result); } Number asNumber() { - return new Integer((int) getValue()); + return Integer.valueOf((int) getValue()); } long asAddress() { return getValue(); @@ -156,7 +156,7 @@ Address add(long offset) { return new Address64(getValue() + offset); } Number asNumber() { - return new Long(getValue()); + return Long.valueOf(getValue()); } long asAddress() { return getValue(); diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewWinDump.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewWinDump.java index d867f7da03d..be976cb5237 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewWinDump.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewWinDump.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -25,7 +25,6 @@ import java.io.IOException; import java.io.UnsupportedEncodingException; -import java.nio.ByteOrder; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -734,22 +733,22 @@ private List readIntelRegisters(MiniDump dump, Builder builder, long contextRva, // We capture segment registers, flags, integer registers and instruction pointer dump.coreSeek(contextRva + 140); List registers = new ArrayList(); - registers.add(builder.buildRegister("gs", new Integer(dump.coreReadInt()))); - registers.add(builder.buildRegister("fs", new Integer(dump.coreReadInt()))); - registers.add(builder.buildRegister("es", new Integer(dump.coreReadInt()))); - registers.add(builder.buildRegister("ds", new Integer(dump.coreReadInt()))); - registers.add(builder.buildRegister("edi", new Integer(dump.coreReadInt()))); - registers.add(builder.buildRegister("esi", new Integer(dump.coreReadInt()))); - registers.add(builder.buildRegister("ebx", new Integer(dump.coreReadInt()))); - registers.add(builder.buildRegister("edx", new Integer(dump.coreReadInt()))); - registers.add(builder.buildRegister("ecx", new Integer(dump.coreReadInt()))); - registers.add(builder.buildRegister("eax", new Integer(dump.coreReadInt()))); - registers.add(builder.buildRegister("ebp", new Integer(dump.coreReadInt()))); - registers.add(builder.buildRegister("eip", new Integer(dump.coreReadInt()))); - registers.add(builder.buildRegister("cs", new Integer(dump.coreReadInt()))); - registers.add(builder.buildRegister("flags", new Integer(dump.coreReadInt()))); - registers.add(builder.buildRegister("esp", new Integer(dump.coreReadInt()))); - registers.add(builder.buildRegister("ss", new Integer(dump.coreReadInt()))); + registers.add(builder.buildRegister("gs", Integer.valueOf(dump.coreReadInt()))); + registers.add(builder.buildRegister("fs", Integer.valueOf(dump.coreReadInt()))); + registers.add(builder.buildRegister("es", Integer.valueOf(dump.coreReadInt()))); + registers.add(builder.buildRegister("ds", Integer.valueOf(dump.coreReadInt()))); + registers.add(builder.buildRegister("edi", Integer.valueOf(dump.coreReadInt()))); + registers.add(builder.buildRegister("esi", Integer.valueOf(dump.coreReadInt()))); + registers.add(builder.buildRegister("ebx", Integer.valueOf(dump.coreReadInt()))); + registers.add(builder.buildRegister("edx", Integer.valueOf(dump.coreReadInt()))); + registers.add(builder.buildRegister("ecx", Integer.valueOf(dump.coreReadInt()))); + registers.add(builder.buildRegister("eax", Integer.valueOf(dump.coreReadInt()))); + registers.add(builder.buildRegister("ebp", Integer.valueOf(dump.coreReadInt()))); + registers.add(builder.buildRegister("eip", Integer.valueOf(dump.coreReadInt()))); + registers.add(builder.buildRegister("cs", Integer.valueOf(dump.coreReadInt()))); + registers.add(builder.buildRegister("flags", Integer.valueOf(dump.coreReadInt()))); + registers.add(builder.buildRegister("esp", Integer.valueOf(dump.coreReadInt()))); + registers.add(builder.buildRegister("ss", Integer.valueOf(dump.coreReadInt()))); return registers; } @@ -757,31 +756,31 @@ private List readAmd64Registers(MiniDump dump, Builder builder, long contextRva, // We capture segment registers, flags, integer registers and instruction pointer dump.coreSeek(contextRva + 56); List registers = new ArrayList(); - registers.add(builder.buildRegister("cs", new Short(dump.coreReadShort()))); - registers.add(builder.buildRegister("ds", new Short(dump.coreReadShort()))); - registers.add(builder.buildRegister("es", new Short(dump.coreReadShort()))); - registers.add(builder.buildRegister("fs", new Short(dump.coreReadShort()))); - registers.add(builder.buildRegister("gs", new Short(dump.coreReadShort()))); - registers.add(builder.buildRegister("ss", new Short(dump.coreReadShort()))); - registers.add(builder.buildRegister("flags", new Integer(dump.coreReadInt()))); + registers.add(builder.buildRegister("cs", Short.valueOf(dump.coreReadShort()))); + registers.add(builder.buildRegister("ds", Short.valueOf(dump.coreReadShort()))); + registers.add(builder.buildRegister("es", Short.valueOf(dump.coreReadShort()))); + registers.add(builder.buildRegister("fs", Short.valueOf(dump.coreReadShort()))); + registers.add(builder.buildRegister("gs", Short.valueOf(dump.coreReadShort()))); + registers.add(builder.buildRegister("ss", Short.valueOf(dump.coreReadShort()))); + registers.add(builder.buildRegister("flags", Integer.valueOf(dump.coreReadInt()))); dump.coreSeek(contextRva + 120); - registers.add(builder.buildRegister("eax", new Long(dump.coreReadLong()))); - registers.add(builder.buildRegister("ecx", new Long(dump.coreReadLong()))); - registers.add(builder.buildRegister("edx", new Long(dump.coreReadLong()))); - registers.add(builder.buildRegister("ebx", new Long(dump.coreReadLong()))); - registers.add(builder.buildRegister("esp", new Long(dump.coreReadLong()))); - registers.add(builder.buildRegister("ebp", new Long(dump.coreReadLong()))); - registers.add(builder.buildRegister("esi", new Long(dump.coreReadLong()))); - registers.add(builder.buildRegister("edi", new Long(dump.coreReadLong()))); - registers.add(builder.buildRegister("r8", new Long(dump.coreReadLong()))); - registers.add(builder.buildRegister("r9", new Long(dump.coreReadLong()))); - registers.add(builder.buildRegister("r10", new Long(dump.coreReadLong()))); - registers.add(builder.buildRegister("r11", new Long(dump.coreReadLong()))); - registers.add(builder.buildRegister("r12", new Long(dump.coreReadLong()))); - registers.add(builder.buildRegister("r13", new Long(dump.coreReadLong()))); - registers.add(builder.buildRegister("r14", new Long(dump.coreReadLong()))); - registers.add(builder.buildRegister("r15", new Long(dump.coreReadLong()))); - registers.add(builder.buildRegister("ip", new Long(dump.coreReadLong()))); + registers.add(builder.buildRegister("eax", Long.valueOf(dump.coreReadLong()))); + registers.add(builder.buildRegister("ecx", Long.valueOf(dump.coreReadLong()))); + registers.add(builder.buildRegister("edx", Long.valueOf(dump.coreReadLong()))); + registers.add(builder.buildRegister("ebx", Long.valueOf(dump.coreReadLong()))); + registers.add(builder.buildRegister("esp", Long.valueOf(dump.coreReadLong()))); + registers.add(builder.buildRegister("ebp", Long.valueOf(dump.coreReadLong()))); + registers.add(builder.buildRegister("esi", Long.valueOf(dump.coreReadLong()))); + registers.add(builder.buildRegister("edi", Long.valueOf(dump.coreReadLong()))); + registers.add(builder.buildRegister("r8", Long.valueOf(dump.coreReadLong()))); + registers.add(builder.buildRegister("r9", Long.valueOf(dump.coreReadLong()))); + registers.add(builder.buildRegister("r10", Long.valueOf(dump.coreReadLong()))); + registers.add(builder.buildRegister("r11", Long.valueOf(dump.coreReadLong()))); + registers.add(builder.buildRegister("r12", Long.valueOf(dump.coreReadLong()))); + registers.add(builder.buildRegister("r13", Long.valueOf(dump.coreReadLong()))); + registers.add(builder.buildRegister("r14", Long.valueOf(dump.coreReadLong()))); + registers.add(builder.buildRegister("r15", Long.valueOf(dump.coreReadLong()))); + registers.add(builder.buildRegister("ip", Long.valueOf(dump.coreReadLong()))); return registers; } } diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewZosDump.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewZosDump.java index df040191e99..4ae363853ca 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewZosDump.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewZosDump.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -199,7 +199,7 @@ private Edb[] getEdbs(AddressSpace as) { Edb edb = ca.getEdb(); // Some EDBs don't have any modules, so ignore them if (edb.getFirstDll() != null) { - edbs.put(new Long(edb.address()), edb); + edbs.put(Long.valueOf(edb.address()), edb); } } catch (CaaNotFound e) { } catch (IOException e) { @@ -271,10 +271,10 @@ private List getThreads(final Builder builder, final Object imgAdr, AddressSpace pswn = "PSW:64"; break; } - regs.add(builder.buildRegister("PSW", new Long(psw))); + regs.add(builder.buildRegister("PSW", Long.valueOf(psw))); // There isn't an easy way to get the total number of registers, so hard code it for (int i = 0; i < 16; ++i) { - regs.add(builder.buildRegister("R"+i, new Long(rs.getRegister(i)))); + regs.add(builder.buildRegister("R"+i, Long.valueOf(rs.getRegister(i)))); } Properties props = new Properties(); props.setProperty("TCB", format(caa.getTcb().address())); @@ -315,7 +315,7 @@ private List getThreads(final Builder builder, final Object imgAdr, AddressSpace for (; dsa != null; dsa = dsa.getParentFrame()) { final Object builderStackFrame = builder.buildStackFrame(imgAdr, dsa.getDsaAddress(), dsa.getEntryPoint()+dsa.getEntryOffset()); // Remember the entry point in case it is not exported from a DLL - stackSyms.put(new Long(dsa.getEntryPoint()), dsa.getEntryName()); + stackSyms.put(Long.valueOf(dsa.getEntryPoint()), dsa.getEntryName()); stackFrames.add(builderStackFrame); long dsaAddr = dsa.getDsaAddress(); @@ -785,11 +785,11 @@ protected List readTDUMP() ranges.add(range); // Search for Java spaces int asid = range.getAsid(); - if (!_javaAddressSpaces.containsKey(new Integer(asid))) { + if (!_javaAddressSpaces.containsKey(Integer.valueOf(asid))) { stream.seek(range.getFileOffset()); stream.readFully(buf); if (bufferHasJ9RASEyeCatcher(buf)) { - _javaAddressSpaces.put(new Integer(asid), new int[] {asid, 0}); + _javaAddressSpaces.put(Integer.valueOf(asid), new int[] {asid, 0}); log.fine("Found Java asid "+format(asid)+" at "+format(range.getVirtualAddress())); } } diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/Symbol.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/Symbol.java index dd9a989ef87..ba7058d9ca0 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/Symbol.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/Symbol.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -61,8 +61,7 @@ public class Symbol { static final int STT_HIOS = 12; static final int STT_LOPROC = 13; static final int STT_HIPROC = 15; - - + public Symbol(String name, long address, int extent, int type, int bind) { // check don't already have this name @@ -94,7 +93,7 @@ public Symbol(String name, long address, int extent, int type, int bind) { Comparator c = new Symbol.SymbolComparator(); symbolTree = new TreeMap(c); } - symbolTree.put(new Long(address),this); + symbolTree.put(Long.valueOf(address),this); } @@ -112,7 +111,7 @@ public static Symbol getSymbol(String name) { public static String getSymbolForAddress(long address) { String retString = null; - SortedMap head = (SortedMap) symbolTree.headMap(new Long(address)); + SortedMap head = (SortedMap) symbolTree.headMap(Long.valueOf(address)); // So now we look at bottom of tail and hopefully we might have a // symbol covering this address.... @@ -128,10 +127,7 @@ public static String getSymbolForAddress(long address) { } } } - - - - + return retString; } @@ -178,9 +174,6 @@ public int compare(Object arg0, Object arg1) { } - - - /** * @return Returns the symbolEnd. */ diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/zos/le/Caa.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/zos/le/Caa.java index 421f20a278c..6f14c3aa55b 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/zos/le/Caa.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/zos/le/Caa.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2006, 2017 IBM Corp. and others + * Copyright (c) 2006, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -124,7 +124,7 @@ public Caa(Tcb tcb) throws CaaNotFound { caaTemplate = new Caa32Template(); String s = space.getDump().getProductRelease(); if (s != null) { - int release = new Integer(s).intValue(); + int release = Integer.parseInt(s); if (release >= 11) { caaTemplate = new Caa32_11Template(); log.fine("switched to new caa format"); @@ -140,7 +140,7 @@ public Caa(Tcb tcb) throws CaaNotFound { caaTemplate = new Caa64Template(); String s = space.getDump().getProductRelease(); if (s != null) { - int release = new Integer(s).intValue(); + int release = Integer.parseInt(s); if (release >= 11) { caaTemplate = new Caa64_11Template(); log.fine("switched to new caa format"); @@ -154,7 +154,7 @@ public Caa(Tcb tcb) throws CaaNotFound { caaTemplate = new Caa32Template(); String s = space.getDump().getProductRelease(); if (s != null) { - int release = new Integer(s).intValue(); + int release = Integer.parseInt(s); if (release >= 11) { caaTemplate = new Caa32_11Template(); log.fine("switched to new caa format"); diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/zos/le/DsaStackFrame.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/zos/le/DsaStackFrame.java index 66fefa4b55f..b72c89f42f4 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/zos/le/DsaStackFrame.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/zos/le/DsaStackFrame.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2006, 2017 IBM Corp. and others + * Copyright (c) 2006, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -36,7 +36,6 @@ * * @has - - - com.ibm.dtfj.corereaders.zos.le.Function */ - public class DsaStackFrame { /** The address of this dsa */ @@ -938,7 +937,7 @@ class Ceexppaf { */ public static String getEntryPointName(AddressSpace space, long ep) throws IOException { int eyecatcher; - Long mapKey = new Long(ep); + Long mapKey = Long.valueOf(ep); String function = (String)space.getUserMap().get(mapKey); if (function != null) return function; diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/zos/util/AbstractHashMap.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/zos/util/AbstractHashMap.java index 6bea57f483d..2e8662c9640 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/zos/util/AbstractHashMap.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/zos/util/AbstractHashMap.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2006, 2017 IBM Corp. and others + * Copyright (c) 2006, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -233,7 +233,7 @@ public boolean hasMoreElements() { } public Object nextElement() { - return new Long(nextInt()); + return Long.valueOf(nextInt()); } public long nextInt() { diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/zos/util/IntegerMap.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/zos/util/IntegerMap.java index 9ee13fcc9c7..dfbb055fb6a 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/zos/util/IntegerMap.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/zos/util/IntegerMap.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2006, 2017 IBM Corp. and others + * Copyright (c) 2006, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -104,13 +104,13 @@ private void test() { } put(key, value); if (doCheck) { - check.put(new Long(key), new Long(value)); + check.put(Long.valueOf(key), Long.valueOf(value)); if (get(key) != value) { throw new Error("found " + get(key) + " expected " + value); } if (remove) { remove(key); - check.remove(new Long(key)); + check.remove(Long.valueOf(key)); } } } diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaClass.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaClass.java index 68de7e698aa..f41b6c2b0b8 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaClass.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaClass.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -172,7 +172,7 @@ public void addConstantPoolClassRef(long id) { //TODO: What does a null class in the constant pool represent? (It happens frequently) if (0L != id) { - _constantPoolClassRefs.add(new Long(id)); + _constantPoolClassRefs.add(Long.valueOf(id)); } } @@ -209,7 +209,7 @@ public JavaMethod createNewMethod(long id, String name, String signature, int mo public void createConstantPoolObjectRef(long id) { // Add the id to the list - _constantPoolObjects.add(new Long(id)); + _constantPoolObjects.add(Long.valueOf(id)); } public void createNewStaticField(String name, String sig, int modifiers, String value) diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaClassLoader.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaClassLoader.java index 07301c00c41..690ecc5e64b 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaClassLoader.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaClassLoader.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import java.util.Vector; import com.ibm.dtfj.image.j9.CorruptData; import com.ibm.dtfj.image.CorruptDataException; @@ -166,7 +165,7 @@ public long getID() public void addClassID(long id) { - _classIDs.add(new Long(id)); + _classIDs.add(Long.valueOf(id)); } public boolean equals(Object obj) diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaField.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaField.java index 7050dcc9a13..ce615201603 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaField.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaField.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -22,8 +22,6 @@ *******************************************************************************/ package com.ibm.dtfj.java.j9; -import java.util.Iterator; - import com.ibm.dtfj.image.CorruptDataException; import com.ibm.dtfj.image.MemoryAccessException; import com.ibm.dtfj.image.j9.CorruptData; @@ -32,7 +30,6 @@ /** * @author jmdisher - * */ public abstract class JavaField implements com.ibm.dtfj.java.JavaField { @@ -75,21 +72,21 @@ protected JavaField(JavaRuntime vm, String name, String signature, int modifiers public Object get(JavaObject object) throws CorruptDataException, MemoryAccessException { if (getSignature().equals(BOOLEAN_SIGNATURE)) { - return new Boolean(getBoolean(object)); + return Boolean.valueOf(getBoolean(object)); } else if (getSignature().equals(BYTE_SIGNATURE)) { - return new Byte(getByte(object)); + return Byte.valueOf(getByte(object)); } else if (getSignature().equals(CHAR_SIGNATURE)) { - return new Character(getChar(object)); + return Character.valueOf(getChar(object)); } else if (getSignature().equals(SHORT_SIGNATURE)) { - return new Short(getShort(object)); + return Short.valueOf(getShort(object)); } else if (getSignature().equals(INTEGER_SIGNATURE)) { - return new Integer(getInt(object)); + return Integer.valueOf(getInt(object)); } else if (getSignature().equals(LONG_SIGNATURE)) { - return new Long(getLong(object)); + return Long.valueOf(getLong(object)); } else if (getSignature().equals(FLOAT_SIGNATURE)) { - return new Float(getFloat(object)); + return Float.valueOf(getFloat(object)); } else if (getSignature().equals(DOUBLE_SIGNATURE)) { - return new Double(getDouble(object)); + return Double.valueOf(getDouble(object)); } else if (getSignature().startsWith(OBJECT_PREFIX_SIGNATURE) || getSignature().startsWith(ARRAY_PREFIX_SIGNATURE)) { return getReferenceType(object); } else { diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaRuntime.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaRuntime.java index 2943b67be22..f30f18aa07b 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaRuntime.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaRuntime.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -197,7 +197,7 @@ public void addClass(JavaAbstractClass theClass) return; } long id = theClass.getID().getAddress(); - _classes.put(new Long(id), theClass); + _classes.put(Long.valueOf(id), theClass); try { if (theClass.isArray()) { // Useful for component type lookups @@ -233,12 +233,12 @@ public void addClass(JavaAbstractClass theClass) public void addClassLoader(com.ibm.dtfj.java.j9.JavaClassLoader loader) { long id = loader.getID(); - _classLoaders.put(new Long(id), loader); + _classLoaders.put(Long.valueOf(id), loader); } public com.ibm.dtfj.java.JavaClass getClassForID(long classID) { - return (com.ibm.dtfj.java.JavaClass)_classes.get(new Long(classID)); + return (com.ibm.dtfj.java.JavaClass)_classes.get(Long.valueOf(classID)); } JavaClass getComponentTypeForClass(JavaClass theClass) throws CorruptDataException @@ -282,7 +282,7 @@ JavaClass getComponentTypeForClass(JavaClass theClass) throws CorruptDataExcepti public JavaClassLoader getClassLoaderForID(long loaderID) { - return (JavaClassLoader) _classLoaders.get(new Long(loaderID)); + return (JavaClassLoader) _classLoaders.get(Long.valueOf(loaderID)); } public void addMonitor(JavaMonitor monitor) @@ -491,12 +491,12 @@ public ImageThread nativeThreadForID(long nativeID) public JavaMethod methodForID(long method) { - return (JavaMethod) _methodsByID.get(new Long(method)); + return (JavaMethod) _methodsByID.get(Long.valueOf(method)); } public void addMethodForID(JavaMethod method, long id) { - _methodsByID.put(new Long(id), method); + _methodsByID.put(Long.valueOf(id), method); } public JavaVMInitArgs createJavaVMInitArgs(int version, boolean ignoreUnrecognized) @@ -605,7 +605,5 @@ public long getStartTimeNanos() throws DataUnavailable, CorruptDataException { // Not supported in legacy DTFJ (pre-DDR) throw new DataUnavailable("Dump start time is not available"); } - - } diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaThread.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaThread.java index 121299c4815..76d366a8055 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaThread.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/java/j9/JavaThread.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -36,7 +36,6 @@ import com.ibm.dtfj.image.ImageThread; import com.ibm.dtfj.image.MemoryAccessException; import com.ibm.dtfj.image.j9.CorruptData; -import com.ibm.dtfj.image.j9.corrupt.CorruptImagePointer; import com.ibm.dtfj.java.JavaClass; import com.ibm.dtfj.java.JavaObject; @@ -58,15 +57,15 @@ public class JavaThread implements com.ibm.dtfj.java.JavaThread private static final HashMap _threadStateMap = new HashMap(); static { - _threadStateMap.put("Dead", new Integer(STATE_TERMINATED)); - _threadStateMap.put("Suspended",new Integer(STATE_ALIVE | STATE_SUSPENDED)); - _threadStateMap.put("Running", new Integer(STATE_ALIVE | STATE_RUNNABLE)); - _threadStateMap.put("Blocked", new Integer(STATE_ALIVE | STATE_BLOCKED_ON_MONITOR_ENTER)); - _threadStateMap.put("Waiting", new Integer(STATE_ALIVE | STATE_WAITING | STATE_WAITING_INDEFINITELY | STATE_IN_OBJECT_WAIT)); - _threadStateMap.put("Waiting timed", new Integer(STATE_ALIVE | STATE_WAITING | STATE_WAITING_WITH_TIMEOUT | STATE_IN_OBJECT_WAIT)); - _threadStateMap.put("Sleeping", new Integer(STATE_ALIVE | STATE_WAITING | STATE_SLEEPING)); - _threadStateMap.put("Parked", new Integer(STATE_ALIVE | STATE_WAITING | STATE_WAITING_INDEFINITELY | STATE_PARKED)); - _threadStateMap.put("Parked timed", new Integer(STATE_ALIVE | STATE_WAITING | STATE_WAITING_WITH_TIMEOUT | STATE_PARKED)); + _threadStateMap.put("Dead", Integer.valueOf(STATE_TERMINATED)); + _threadStateMap.put("Suspended",Integer.valueOf(STATE_ALIVE | STATE_SUSPENDED)); + _threadStateMap.put("Running", Integer.valueOf(STATE_ALIVE | STATE_RUNNABLE)); + _threadStateMap.put("Blocked", Integer.valueOf(STATE_ALIVE | STATE_BLOCKED_ON_MONITOR_ENTER)); + _threadStateMap.put("Waiting", Integer.valueOf(STATE_ALIVE | STATE_WAITING | STATE_WAITING_INDEFINITELY | STATE_IN_OBJECT_WAIT)); + _threadStateMap.put("Waiting timed", Integer.valueOf(STATE_ALIVE | STATE_WAITING | STATE_WAITING_WITH_TIMEOUT | STATE_IN_OBJECT_WAIT)); + _threadStateMap.put("Sleeping", Integer.valueOf(STATE_ALIVE | STATE_WAITING | STATE_SLEEPING)); + _threadStateMap.put("Parked", Integer.valueOf(STATE_ALIVE | STATE_WAITING | STATE_WAITING_INDEFINITELY | STATE_PARKED)); + _threadStateMap.put("Parked timed", Integer.valueOf(STATE_ALIVE | STATE_WAITING | STATE_WAITING_WITH_TIMEOUT | STATE_PARKED)); }; public JavaThread(JavaRuntime vm, ImagePointer nativeID, ImagePointer objectID, String state, ImageThread imageThread) diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/javacore/builder/javacore/JavaRuntimeBuilder.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/javacore/builder/javacore/JavaRuntimeBuilder.java index c80450e0a3b..40cfd927a48 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/javacore/builder/javacore/JavaRuntimeBuilder.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/javacore/builder/javacore/JavaRuntimeBuilder.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2007, 2017 IBM Corp. and others + * Copyright (c) 2007, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -209,7 +209,7 @@ public JavaThread addJavaThread(ImageThread imageThread, String name, long tid, if (j9thread_t != IBuilderData.NOT_AVAILABLE && jniEnv != IBuilderData.NOT_AVAILABLE) { // Save the JNIEnv for later ImagePointer pointer = fAddressSpace.getPointer(jniEnv); - j9ThreadToJNIEnv.put(new Long(j9thread_t), pointer); + j9ThreadToJNIEnv.put(Long.valueOf(j9thread_t), pointer); } if (!fAddressSpace.isValidAddressID(tid)) { throw new JCInvalidArgumentsException("Must pass a valid thread id"); @@ -225,7 +225,7 @@ public JavaThread addJavaThread(ImageThread imageThread, String name, long tid, javaThread.setImageThread((JCImageThread)imageThread); if (jniEnv == IBuilderData.NOT_AVAILABLE) { // Retrieve the JNIEnv - ImagePointer pointer = (ImagePointer)j9ThreadToJNIEnv.get(new Long(j9thread_t)); + ImagePointer pointer = (ImagePointer)j9ThreadToJNIEnv.get(Long.valueOf(j9thread_t)); if (pointer != null) { // Set it for 1.4.2 javaThread.setJNIEnv(pointer); diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/javacore/parser/j9/section/monitor/MonitorSovSectionParserPart.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/javacore/parser/j9/section/monitor/MonitorSovSectionParserPart.java index 96abe533dba..f9b336ed113 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/javacore/parser/j9/section/monitor/MonitorSovSectionParserPart.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/javacore/parser/j9/section/monitor/MonitorSovSectionParserPart.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2007, 2017 IBM Corp. and others + * Copyright (c) 2007, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -61,7 +61,7 @@ public void computeSovRule(String sovRuleID, ILookAheadBuffer lookAheadBuffer) t long tid = results.getLongValue(MONITOR_THREAD_ID); long ee = results.getLongValue(MONITOR_THREAD_EE); // Remember the flat thread id for later - threads.put(new Integer(flatid), new Long(tid)); + threads.put(Integer.valueOf(flatid), Long.valueOf(tid)); try { fRuntimeBuilder.addJavaThread(null, name, IBuilderData.NOT_AVAILABLE, tid, IBuilderData.NOT_AVAILABLE, ee, "", IBuilderData.NOT_AVAILABLE, 0, null); } catch (BuilderFailureException e) { @@ -81,7 +81,7 @@ public void computeSovRule(String sovRuleID, ILookAheadBuffer lookAheadBuffer) t long monitorID = results.getLongValue(MONITOR_OBJECT_ADDRESS); results = processTagLineRequired(LK_FLAT_DETAILS); int flatid = results.getIntValue(MONITOR_FLAT_ID); - Object p = threads.get(new Integer(flatid)); + Object p = threads.get(Integer.valueOf(flatid)); long threadID = p instanceof Long ? ((Long)p).longValue() : IBuilderData.NOT_AVAILABLE; try { if (monitorID != IBuilderData.NOT_AVAILABLE) { diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/javacore/parser/j9/section/platform/PlatformSectionParser.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/javacore/parser/j9/section/platform/PlatformSectionParser.java index 24580877b6c..d77e10d9022 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/javacore/parser/j9/section/platform/PlatformSectionParser.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/javacore/parser/j9/section/platform/PlatformSectionParser.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2007, 2017 IBM Corp. and others + * Copyright (c) 2007, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -185,11 +185,11 @@ private void registerInfo() throws ParserException { if (val == null) { n = null; } else if (val.startsWith("0x") && val.length() <= 2+4) { - n = new Short((short)results.getIntValue(PL_REGISTER_VALUE)); + n = Short.valueOf((short)results.getIntValue(PL_REGISTER_VALUE)); } else if (val.startsWith("0x") && val.length() <= 2+8) { - n = new Integer((int)results.getLongValue(PL_REGISTER_VALUE)); + n = Integer.valueOf((int)results.getLongValue(PL_REGISTER_VALUE)); } else { - n = new Long(results.getLongValue(PL_REGISTER_VALUE)); + n = Long.valueOf(results.getLongValue(PL_REGISTER_VALUE)); } m.put(name, n); } diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/phd/parser/HeapdumpReader.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/phd/parser/HeapdumpReader.java index 9f455fd03fb..55e3284ba16 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/phd/parser/HeapdumpReader.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/phd/parser/HeapdumpReader.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2002, 2017 IBM Corp. and others + * Copyright (c) 2002, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -37,7 +37,6 @@ * (see {@link #HeapdumpReader}) passing the file name and then parse it (see {@link #parse}) * passing it an object that obeys the {@link com.ibm.dtfj.phd.parser.PortableHeapDumpListener} interface. */ - public class HeapdumpReader extends Base { private static final long MAX_UNSIGNED_INT_AS_LONG = 0xffffffffL; @@ -655,7 +654,7 @@ public int numberOfElements() { } public Object nextElement() { - return new Long(nextLong()); + return Long.valueOf(nextLong()); } public long nextLong() { diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/phd/parser/PrintHeapdump.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/phd/parser/PrintHeapdump.java index 20441add272..ab5beef0622 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/phd/parser/PrintHeapdump.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/phd/parser/PrintHeapdump.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2002, 2017 IBM Corp. and others + * Copyright (c) 2002, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -31,7 +31,6 @@ /** * This class simply prints the contents of the heap dump. */ - public class PrintHeapdump extends Base { boolean hash; @@ -201,19 +200,18 @@ class DumpClass { } static void put(long address, String name, int instanceSize) { - classes.put(new Long(address), new DumpClass(address, name, instanceSize)); + classes.put(Long.valueOf(address), new DumpClass(address, name, instanceSize)); } static void foundClass(long address) { - DumpClass cl = (DumpClass)classes.get(new Long(address)); + DumpClass cl = (DumpClass)classes.get(Long.valueOf(address)); if (cl == null) { cl = new DumpClass(address, "unknown class 0x" + Long.toHexString(address), 0); - classes.put(new Long(address), cl); + classes.put(Long.valueOf(address), cl); } } static DumpClass get(long address) { - return (DumpClass)classes.get(new Long(address)); + return (DumpClass)classes.get(Long.valueOf(address)); } } - diff --git a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/DeadlockCommand.java b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/DeadlockCommand.java index 4aec9890281..4b3cdbcf5c9 100644 --- a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/DeadlockCommand.java +++ b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/DeadlockCommand.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -107,7 +107,7 @@ public void doCommand() Exceptions.getCorruptDataExceptionString()); return; } - id = new Long(threadObject.getID().getAddress()); + id = Long.valueOf(threadObject.getID().getAddress()); } // Note: defect 133638, we used to give up here with an error if there was already @@ -154,7 +154,7 @@ public void doCommand() Exceptions.getCorruptDataExceptionString()); return; } - id = new Long(threadObject.getID().getAddress()); + id = Long.valueOf(threadObject.getID().getAddress()); monitorNodes.put(id, node); } } catch(CorruptDataException cde) { @@ -190,7 +190,7 @@ public void doCommand() return; } - id = new Long(threadObject.getID().getAddress()); + id = Long.valueOf(threadObject.getID().getAddress()); MonitorNode waiterNode = (MonitorNode)monitorNodes.get(id); if (null != waiterNode) { diff --git a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/FindCommand.java b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/FindCommand.java index 081255f7aed..e1138541b47 100644 --- a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/FindCommand.java +++ b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/FindCommand.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -172,7 +172,7 @@ private boolean scanRegion(long start, long end, ImageSection imageSection){ } } if (j >= patternLength){ - matches.add(new Long(i)); + matches.add(Long.valueOf(i)); if (matches.size() == findAtt.numMatchesToDisplay) return true; } diff --git a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/HeapdumpCommand.java b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/HeapdumpCommand.java index f659d8f5cff..5a6fdf40e70 100644 --- a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/HeapdumpCommand.java +++ b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/HeapdumpCommand.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2008, 2017 IBM Corp. and others + * Copyright (c) 2008, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -539,14 +539,14 @@ private ReferenceIterator getClassReferences(JavaClass thisJavaClass) if (cpObject instanceof JavaClass) { // Found a class reference, add it to the list JavaClass cpJavaClass = (JavaClass)cpObject; - references.add(new Long(cpJavaClass.getObject().getID().getAddress())); + references.add(Long.valueOf(cpJavaClass.getObject().getID().getAddress())); } } // Superclass references JavaClass superClass = thisJavaClass.getSuperclass(); while (null != superClass){ - references.add(new Long(superClass.getObject().getID().getAddress())); + references.add(Long.valueOf(superClass.getObject().getID().getAddress())); superClass = superClass.getSuperclass(); } @@ -556,7 +556,7 @@ private ReferenceIterator getClassReferences(JavaClass thisJavaClass) if(loader != null) { JavaObject loaderObject = loader.getObject(); if(loaderObject != null) { - references.add(new Long(loaderObject.getID().getAddress())); + references.add(Long.valueOf(loaderObject.getID().getAddress())); } else { reportError("Null loader object returned for class: " + thisJavaClass.getName() + "(" + thisJavaClass.getID() + ")",null); _numberOfErrors++; @@ -583,7 +583,7 @@ private void addProtectionDomainReference(JavaClass thisJavaClass, try { JavaObject protectionDomain = thisJavaClass.getProtectionDomain(); if(protectionDomain != null) { - references.add(new Long(protectionDomain.getID().getAddress())); + references.add(Long.valueOf(protectionDomain.getID().getAddress())); } } catch (DataUnavailable e) { //record that access to the protection domain was not possible @@ -634,9 +634,9 @@ private void addStaticReferences(JavaClass thisClass, List references) } else if (referent instanceof JavaObject) { JavaObject referredObject = (JavaObject) referent; - references.add(new Long(referredObject.getID().getAddress())); + references.add(Long.valueOf(referredObject.getID().getAddress())); } else if (referent == null) { - references.add(new Long(0)); + references.add(Long.valueOf(0)); } else if (referent instanceof Number || referent instanceof Boolean || referent instanceof Character) { //Ignore } else { @@ -748,9 +748,9 @@ private void addReferences(JavaObject object, } // the following ugliness is necessary as JavaObject and JavaClass both support getID() but do not inherit from a common parent if (target instanceof JavaObject) { - references.add(new Long(((JavaObject) target).getID().getAddress())); + references.add(Long.valueOf(((JavaObject) target).getID().getAddress())); } else if (target instanceof JavaClass) { - references.add(new Long(((JavaClass) target).getID().getAddress())); + references.add(Long.valueOf(((JavaClass) target).getID().getAddress())); } else { _numberOfErrors++; reportError("Object of unexpected type " diff --git a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/HexdumpCommand.java b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/HexdumpCommand.java index 9d9305b96f1..d17e9d3b1c9 100644 --- a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/HexdumpCommand.java +++ b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/HexdumpCommand.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -33,7 +33,6 @@ import com.ibm.java.diagnostics.utils.plugins.DTFJPlugin; import com.ibm.jvm.dtfjview.commands.helpers.Utils; - @DTFJPlugin(version="1.*", runtime=false) public class HexdumpCommand extends BaseJdmpviewCommand { @@ -101,13 +100,10 @@ public void doCommand(String[] args){ //stringBuffer.append(Long.toHexString(addressInDecimal+i)+":\t"); //stringBuffer.append(Long.toHexString(imagePointer.getAddress())+":\t"); try { - Byte byteValue = new Byte(imagePointer.getByteAt(0)); - asciiIndex = (int) byteValue.byteValue(); - if (asciiIndex < 0) { - asciiIndex += 256; - } - - String rawHexString = Integer.toHexString(byteValue.intValue()); + byte byteValue = imagePointer.getByteAt(0); + asciiIndex = byteValue & 0xFF; + + String rawHexString = Integer.toHexString(asciiIndex); String fixedHexString = fixHexStringLength(rawHexString); String hexText = fixedHexString; @@ -134,7 +130,7 @@ public void doCommand(String[] args){ if (15 == i%16 && i != 0){ ebcdicChars += "|"; stringBuffer.append(ebcdicChars); - } + } } }catch (MemoryAccessException e) { out.println("Address not in memory - 0x" @@ -162,8 +158,8 @@ public void doCommand(String[] args){ /*properties.put(Utils.CURRENT_MEM_ADDRESS, Long.toHexString(addressInDecimal+numBytesToPrint));*/ - ctx.getProperties().put(Utils.CURRENT_MEM_ADDRESS, new Long(addressInDecimal)); - ctx.getProperties().put(Utils.CURRENT_NUM_BYTES_TO_PRINT, new Integer(numBytesToPrint)); + ctx.getProperties().put(Utils.CURRENT_MEM_ADDRESS, Long.valueOf(addressInDecimal)); + ctx.getProperties().put(Utils.CURRENT_NUM_BYTES_TO_PRINT, Integer.valueOf(numBytesToPrint)); } private String padSpace(long undisplayedBytes, String asciiChars){ diff --git a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/ScrollCommand.java b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/ScrollCommand.java index db1f8b4a7d1..0c7a165da25 100644 --- a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/ScrollCommand.java +++ b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/ScrollCommand.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -55,7 +55,7 @@ public void run(String command, String[] args, IContext context, PrintStream out if(command.equals("-")) { newMemAddrss = currentMemAddress.longValue() - currentNumBytesToPrint.intValue(); } - ctx.getProperties().put(Utils.CURRENT_MEM_ADDRESS, new Long(newMemAddrss)); + ctx.getProperties().put(Utils.CURRENT_MEM_ADDRESS, Long.valueOf(newMemAddrss)); ctx.execute("hexdump", new String[]{Long.toHexString(newMemAddrss),currentNumBytesToPrint.toString()}, out); } diff --git a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/helpers/ClassOutput.java b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/helpers/ClassOutput.java index 50e848bd66c..7510b4f172a 100644 --- a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/helpers/ClassOutput.java +++ b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/helpers/ClassOutput.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -38,7 +38,6 @@ import com.ibm.dtfj.java.JavaObject; import com.ibm.dtfj.java.JavaRuntime; - public class ClassOutput { public static void printStaticFields(JavaClass jc, PrintStream out) @@ -229,23 +228,23 @@ public static void printFields(JavaObject jo, JavaClass jc, JavaRuntime jr, Prin { out.print("\t " + i + ":\t"); if (componentType.equals("boolean")) { - out.print(Utils.getVal(new Boolean(((boolean[])dst)[i]))); + out.print(Utils.getVal(Boolean.valueOf(((boolean[]) dst)[i]))); } else if (componentType.equals("byte")) { - out.print(Utils.getVal(new Byte(((byte[])dst)[i]))); + out.print(Utils.getVal(Byte.valueOf(((byte[]) dst)[i]))); } else if (componentType.equals("char")) { - out.print(Utils.getVal(new Character(((char[])dst)[i]))); + out.print(Utils.getVal(Character.valueOf(((char[]) dst)[i]))); } else if (componentType.equals("short")) { - out.print(Utils.getVal(new Short(((short[])dst)[i]))); + out.print(Utils.getVal(Short.valueOf(((short[]) dst)[i]))); } else if (componentType.equals("int")) { - out.print(Utils.getVal(new Integer(((int[])dst)[i]))); + out.print(Utils.getVal(Integer.valueOf(((int[]) dst)[i]))); } else if (componentType.equals("long")) { - out.print(Utils.getVal(new Long(((long[])dst)[i]))); + out.print(Utils.getVal(Long.valueOf(((long[]) dst)[i]))); } else if (componentType.equals("float")) { - out.print(Utils.getVal(new Float(((float[])dst)[i]))); + out.print(Utils.getVal(Float.valueOf(((float[]) dst)[i]))); } else if (componentType.equals("double")) { - out.print(Utils.getVal(new Double(((double[])dst)[i]))); + out.print(Utils.getVal(Double.valueOf(((double[]) dst)[i]))); } else { - out.print(Utils.getVal(((JavaObject[])dst)[i])); + out.print(Utils.getVal(((JavaObject[]) dst)[i])); } out.print("\n"); } diff --git a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/helpers/Utils.java b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/helpers/Utils.java index 8a339f823d8..4d897a6cd30 100644 --- a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/helpers/Utils.java +++ b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/helpers/Utils.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -271,13 +271,13 @@ public static Long longFromString(String value) value = value.substring(2); } try { - translated = new Long(Long.parseLong(value, 16)); + translated = Long.valueOf(value, 16); } catch (NumberFormatException e) { try { // parseLong does not successfully read in numbers > 2^63 e.g. "ffffffffff600000" // have another try going via a big integer BigInteger big = new BigInteger(value,16); - translated = big.longValue(); + translated = Long.valueOf(big.longValue()); } catch (NumberFormatException e2) { // whatever the problem was it was not just to do with being > 2^63 translated = null; @@ -558,39 +558,39 @@ public static String getVal(Object o, String str, JavaField jf) else { if (o instanceof Boolean) { - val += ((Boolean)o).toString(); + val += ((Boolean) o).toString(); } else if (o instanceof Byte) { - byte b = ((Byte)o).byteValue(); + byte b = ((Byte) o).byteValue(); val += String.valueOf(b); - value = new Long((new Byte(b)).longValue()); + value = Long.valueOf(b); } else if (o instanceof Character) { - char c = ((Character)o).charValue(); + char c = ((Character) o).charValue(); val += Utils.getPrintableWithQuotes(c); - value = new Long((new Integer((int)c).longValue())); + value = Long.valueOf(c); } else if (o instanceof Double) { - double d = ((Double)o).doubleValue(); + double d = ((Double) o).doubleValue(); val += String.valueOf(d); - value = new Long(Double.doubleToRawLongBits(d)); + value = Long.valueOf(Double.doubleToRawLongBits(d)); } else if (o instanceof Float) { - float f = ((Float)o).floatValue(); + float f = ((Float) o).floatValue(); val += String.valueOf(f); - value = new Long(Float.floatToRawIntBits(f)); + value = Long.valueOf(Float.floatToRawIntBits(f)); } else if (o instanceof Integer) { - int i = ((Integer)o).intValue(); + int i = ((Integer) o).intValue(); val += String.valueOf(i); - value = new Long((new Integer(i)).longValue()); + value = Long.valueOf(i); } else if (o instanceof Long) { - long l = ((Long)o).longValue(); + long l = ((Long) o).longValue(); val += String.valueOf(l); - value = new Long(l); + value = Long.valueOf(l); } else if (o instanceof Short) { - short s = ((Short)o).shortValue(); + short s = ((Short) o).shortValue(); val += String.valueOf(s); - value = new Long((new Short(s)).longValue()); + value = Long.valueOf(s); } else if (o instanceof String) { - val += (String)o; + val += (String) o; } else if (o instanceof JavaObject) { - if (Utils.isNull((JavaObject)o)) { + if (Utils.isNull((JavaObject) o)) { val += "null"; } else { object = true; diff --git a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/infocommands/InfoThreadCommand.java b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/infocommands/InfoThreadCommand.java index de6bc045134..f1b470701f6 100644 --- a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/infocommands/InfoThreadCommand.java +++ b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/infocommands/InfoThreadCommand.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -570,7 +570,7 @@ private void printJavaThreadInfo(JavaThread jt, boolean idPrinted) out.print(" Priority: "); try { - Integer pri = new Integer(jt.getPriority()); + Integer pri = Integer.valueOf(jt.getPriority()); out.print(pri.toString()); } catch (CorruptDataException e) { out.print(Exceptions.getCorruptDataExceptionString()); diff --git a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/xcommands/XCommand.java b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/xcommands/XCommand.java index 0ffc8b06d6b..423ccfec445 100644 --- a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/xcommands/XCommand.java +++ b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/commands/xcommands/XCommand.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2004, 2017 IBM Corp. and others + * Copyright (c) 2004, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -28,10 +28,10 @@ import com.ibm.java.diagnostics.utils.IContext; import com.ibm.java.diagnostics.utils.commands.CommandException; import com.ibm.jvm.dtfjview.commands.BaseJdmpviewCommand; + /** * Abstract superclass for all x/ commands */ - public abstract class XCommand extends BaseJdmpviewCommand { protected int argUnitSize = 1; protected int argUnitNumber = 1; @@ -113,10 +113,10 @@ protected void parseArgs(String arg) case 'h': case 'w': case 'g': - unitSize = new Character(currChar); + unitSize = Character.valueOf(currChar); break; default: - displayFormat = new Character(currChar); + displayFormat = Character.valueOf(currChar); break; } i++; @@ -133,7 +133,7 @@ protected void parseArgs(String arg) case 'g': if (null == unitSize) { - unitSize = new Character(currChar); + unitSize = Character.valueOf(currChar); } else { @@ -146,7 +146,7 @@ protected void parseArgs(String arg) default: if (null == displayFormat) { - displayFormat = new Character(currChar); + displayFormat = Character.valueOf(currChar); } else { @@ -186,29 +186,27 @@ protected void parseArgs(String arg) } } - Integer nUnitSize = null; + int nUnitSize = 1; char cUnitSize = unitSize.charValue(); switch (cUnitSize) { case 'b': - nUnitSize = new Integer(1); + default: + nUnitSize = 1; break; case 'h': - nUnitSize = new Integer(2); + nUnitSize = 2; break; case 'w': - nUnitSize = new Integer(4); + nUnitSize = 4; break; case 'g': - nUnitSize = new Integer(8); + nUnitSize = 8; break; } - - // we can pretty much guarantee that nUnitSize is not null here because - // unitSize has to be one of the above 4 characters if it isn't null - - argUnitSize = nUnitSize.intValue(); // add the unit size to the stack + + argUnitSize = nUnitSize; // add the unit size to the stack argUnitNumber = n; // add the number of units to print to the stack argDisplayFormat = displayFormat.toString(); // add the display format as a String @@ -218,7 +216,7 @@ private Character getDefaultUnitSize(Properties properties) { Character defaultUnitSize = (Character)properties.get("x_default_unit_size"); if (null == defaultUnitSize) - return new Character('w'); + return Character.valueOf('w'); else return defaultUnitSize; } @@ -227,7 +225,7 @@ private Character getDefaultDisplayFormat(Properties properties) { Character defaultDisplayFormat = (Character)properties.get("x_default_display_format"); if (null == defaultDisplayFormat) - return new Character('x'); + return Character.valueOf('x'); else return defaultDisplayFormat; } diff --git a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/heapdump/LongArrayReferenceIterator.java b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/heapdump/LongArrayReferenceIterator.java index 9dbf363b456..49a3034df03 100644 --- a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/heapdump/LongArrayReferenceIterator.java +++ b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/heapdump/LongArrayReferenceIterator.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2008, 2017 IBM Corp. and others + * Copyright (c) 2008, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -22,7 +22,6 @@ *******************************************************************************/ package com.ibm.jvm.dtfjview.heapdump; - public class LongArrayReferenceIterator implements ReferenceIterator { private final long _fields[]; @@ -43,7 +42,7 @@ public boolean hasNext() public Long next() { - Long toReturn = new Long(_fields[_index]); + Long toReturn = Long.valueOf(_fields[_index]); _index++; diff --git a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/heapdump/classic/ClassicHeapDumpFormatter.java b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/heapdump/classic/ClassicHeapDumpFormatter.java index 82f20bf94c7..b6304683fc7 100644 --- a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/heapdump/classic/ClassicHeapDumpFormatter.java +++ b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/heapdump/classic/ClassicHeapDumpFormatter.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2008, 2017 IBM Corp. and others + * Copyright (c) 2008, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -191,7 +191,7 @@ public Long next() return original.next(); } else { _returnedExtra = true; - return new Long(extra); + return Long.valueOf(extra); } } diff --git a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/heapdump/portable/PortableHeapDumpRecord.java b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/heapdump/portable/PortableHeapDumpRecord.java index 790b3e3c04b..e04be8b5b93 100644 --- a/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/heapdump/portable/PortableHeapDumpRecord.java +++ b/jcl/src/openj9.dtfjview/share/classes/com/ibm/jvm/dtfjview/heapdump/portable/PortableHeapDumpRecord.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2008, 2017 IBM Corp. and others + * Copyright (c) 2008, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -138,7 +138,7 @@ public Long next() return null; } else { - return new Long(getAddressDifference(toConvert.longValue(), + return Long.valueOf(getAddressDifference(toConvert.longValue(), base)); } } diff --git a/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/Format2Tprof.java b/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/Format2Tprof.java index e6321a3ee8e..c9c09f8dfba 100644 --- a/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/Format2Tprof.java +++ b/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/Format2Tprof.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corp. and others + * Copyright (c) 2000, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -23,10 +23,8 @@ package com.ibm.jvm.format; /** - * Trace Tool routine for generating profile format output - * + * Trace Tool routine for generating profile format output. */ - import java.io.*; import java.util.*; @@ -113,7 +111,7 @@ public void generateTprofOutput(PrintStream out, Collection s) { { MethodEntry e = (MethodEntry) iter.next(); float percent = (float) (e.count * 100) / totalCount; - String percentStr = (new Float(percent)).toString().substring(0,4) + "%"; + String percentStr = Float.toString(percent).substring(0, 4) + "%"; out.println(percentStr + " " + e.count + " " + e.name); } } @@ -162,6 +160,3 @@ public boolean readAndFormat(String args[], List methodTable) { return rc; } } - - - diff --git a/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/Merge.java b/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/Merge.java index 9934fa9ea08..6e4c2b3cc05 100644 --- a/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/Merge.java +++ b/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/Merge.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corp. and others + * Copyright (c) 2000, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -31,7 +31,6 @@ * * @author Tim Preece */ - final public class Merge { private Vector threads; @@ -101,7 +100,7 @@ final protected String getNextEntry() throws IOException if (numberOfRecordsProcessed%10 == 0 || numberOfRecordsProcessed == TraceFormat.expectedRecords) { - StringBuffer tempBuffer=new StringBuffer(new Integer(numberOfRecordsProcessed).toString()); + StringBuffer tempBuffer = new StringBuffer(Integer.toString(numberOfRecordsProcessed)); Util.padBuffer(tempBuffer, 6, ' ', false); // right justify - field width 6 (at least) TraceFormat.outStream.print(tempBuffer+" "); } diff --git a/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/MessageFile.java b/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/MessageFile.java index eab3811c8c0..4368efa2a7b 100644 --- a/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/MessageFile.java +++ b/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/MessageFile.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corp. and others + * Copyright (c) 2000, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -210,7 +210,7 @@ protected void addMessage(String messageLine) MessageFile.messages = new Hashtable(); } - MessageFile.messages.put(new Integer(id), message); + MessageFile.messages.put(Integer.valueOf(id), message); } } @@ -236,7 +236,7 @@ static protected Message getMessageFromID(int id) messages = new Hashtable(); } - return (Message) messages.get(new Integer(id)); + return (Message) messages.get(Integer.valueOf(id)); } /** diff --git a/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/TraceFormat.java b/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/TraceFormat.java index 5ff516547cd..87935b66ae9 100644 --- a/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/TraceFormat.java +++ b/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/TraceFormat.java @@ -555,7 +555,7 @@ private void prime() throws IOException */ traceRecord.processTraceBufferHeader(traceFile, (long)dataStart + (long)j * (long)bufferSize, bufferSize); - Long threadID = new Long(traceRecord.getThreadIDAsLong()); + Long threadID = Long.valueOf(traceRecord.getThreadIDAsLong()); if (listOfThreadBuffers.containsKey(threadID)) { TraceThread buffersForThread = (TraceThread) listOfThreadBuffers .get(threadID); @@ -676,7 +676,7 @@ private void readAndFormatNewStyle() throws IOException tracePointsFormatted++; threadID = tp.getThreadID(); - if (Util.findThreadID(new Long(threadID))) { + if (Util.findThreadID(Long.valueOf(threadID))) { String formattedTime = tp.getFormattedTime(); tempTPString.append(formattedTime); diff --git a/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/TraceRecord.java b/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/TraceRecord.java index 982e3c4510c..a9e4ac77713 100644 --- a/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/TraceRecord.java +++ b/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/TraceRecord.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corp. and others + * Copyright (c) 2000, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -221,7 +221,7 @@ protected TraceRecord(TraceFile traceFile, long start) throws IOException Util.Debug.println("Processing Record Header"); foundThreadID = false; - if ( Util.findThreadID(new Long(threadID)) == false ) { + if ( Util.findThreadID(Long.valueOf(threadID)) == false ) { return; } diff --git a/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/TraceRecordExternal.java b/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/TraceRecordExternal.java index 5ea5c33642c..dac33167817 100644 --- a/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/TraceRecordExternal.java +++ b/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/TraceRecordExternal.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corp. and others + * Copyright (c) 2000, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -145,7 +145,7 @@ protected void prime() throws IOException entry = entry - (longEntryLength + longEntryID*256); // push the real TraceID and copy in the special trace entry - longEntryTraceIDs.push(new Integer(Util.constructTraceID(buffer, entry + 1))); + longEntryTraceIDs.push(Integer.valueOf(Util.constructTraceID(buffer, entry + 1))); buffer[entry+1]=0; buffer[entry+2]=0; buffer[entry+3]=(byte)longEntryID; @@ -270,4 +270,3 @@ final protected void copySpannedEntryForNextRecord(byte[] buffer,int start,int e } } - diff --git a/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/TraceRecordInternal.java b/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/TraceRecordInternal.java index c520ce57004..8f4bdafe063 100644 --- a/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/TraceRecordInternal.java +++ b/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/format/TraceRecordInternal.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corp. and others + * Copyright (c) 2000, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -111,7 +111,7 @@ final protected void prime() throws IOException break; } entry = entry - (longEntryLength + longEntryID*256); - longEntryTraceIDs.push(new Integer(Util.constructTraceID(buffer,entry+1))); + longEntryTraceIDs.push(Integer.valueOf(Util.constructTraceID(buffer,entry+1))); buffer[entry+1] = 0; buffer[entry+2] = 0; buffer[entry+3] = (byte)longEntryID; @@ -219,4 +219,3 @@ final protected int getNextEntry() throws IOException } } - diff --git a/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/trace/format/api/Message.java b/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/trace/format/api/Message.java index 977da8496c5..f2f82825a17 100644 --- a/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/trace/format/api/Message.java +++ b/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/trace/format/api/Message.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corp. and others + * Copyright (c) 2000, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -22,7 +22,6 @@ *******************************************************************************/ package com.ibm.jvm.trace.format.api; -import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.nio.BufferUnderflowException; import java.util.ArrayList; @@ -571,7 +570,7 @@ public class PointerArg extends Arg { } Object getValue(ByteStream msg) { - return new Long(ptrSize == 4 ? msg.getUnsignedInt() : msg.getLong()); + return Long.valueOf(ptrSize == 4 ? msg.getUnsignedInt() : msg.getLong()); } void format(ByteStream msg, StringBuilder out) { diff --git a/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/trace/format/api/MessageFile.java b/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/trace/format/api/MessageFile.java index 98fab4fe99b..d73952513e8 100644 --- a/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/trace/format/api/MessageFile.java +++ b/jcl/src/openj9.traceformat/share/classes/com/ibm/jvm/trace/format/api/MessageFile.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corp. and others + * Copyright (c) 2000, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -266,7 +266,7 @@ private void addMessage_12(String messageLine) { Message message = new Message(type, msg, id, level, componentName, symbol, context); - messages.put(new Integer(id), message); + messages.put(Integer.valueOf(id), message); } /** @@ -283,7 +283,7 @@ protected Message getMessageFromID(int id) { return null; } - return (Message) messages.get(new Integer(id)); + return (Message) messages.get(Integer.valueOf(id)); } /** diff --git a/runtime/bcutil/cfreader.c b/runtime/bcutil/cfreader.c index 2a95d695fac..3f0e18b8901 100644 --- a/runtime/bcutil/cfreader.c +++ b/runtime/bcutil/cfreader.c @@ -427,7 +427,11 @@ readAttributes(J9CfrClassFile * classfile, J9CfrAttribute *** pAttributes, U_32 } result = readAnnotations(classfile, annotations->annotations, annotations->numberOfAnnotations, data, dataEnd, segment, segmentEnd, &index, &freePointer, flags); - if ((BCT_ERR_NO_ERROR != result) || (index != end)) { + + if (BCT_ERR_OUT_OF_ROM == result) { + /* Return out of memory error code to allocate larger buffer for classfile */ + return result; + } else if ((BCT_ERR_NO_ERROR != result) || (index != end)) { U_32 cursor = 0; Trc_BCU_MalformedAnnotation(address); @@ -528,7 +532,8 @@ readAttributes(J9CfrClassFile * classfile, J9CfrAttribute *** pAttributes, U_32 result = readAnnotations(classfile, parameterAnnotations->annotations, parameterAnnotations->numberOfAnnotations, data, dataEnd, segment, segmentEnd, &index, &freePointer, flags); - if (result != 0) { + + if (BCT_ERR_NO_ERROR != result) { break; } } @@ -536,7 +541,10 @@ readAttributes(J9CfrClassFile * classfile, J9CfrAttribute *** pAttributes, U_32 * num_parameters == 0 means there is no parameter for this method and naturally no annotations * for these parameters, in which case the code should treat this attribute as bad and ignore it. */ - if ((BCT_ERR_NO_ERROR != result) || (index != end) || (0 == annotations->numberOfParameters)) { + if (BCT_ERR_OUT_OF_ROM == result) { + /* Return out of memory error code to allocate larger buffer for classfile */ + return result; + } else if ((BCT_ERR_NO_ERROR != result) || (index != end) || (0 == annotations->numberOfParameters)) { U_32 cursor = 0; /* * give up parsing. @@ -628,11 +636,15 @@ readAttributes(J9CfrClassFile * classfile, J9CfrAttribute *** pAttributes, U_32 */ for (j = 0; j < annotations->numberOfAnnotations; j++, typeAnnotations++) { result = readTypeAnnotation(classfile, typeAnnotations, data, dataEnd, segment, segmentEnd, &index, &freePointer, flags); - if (result != 0) { + if (BCT_ERR_NO_ERROR != result) { break; } } - if ((BCT_ERR_NO_ERROR != result) || (index != end)) { + + if (BCT_ERR_OUT_OF_ROM == result) { + /* Return out of memory error code to allocate larger buffer for classfile */ + return result; + } else if ((BCT_ERR_NO_ERROR != result) || (index != end)) { U_32 cursor = 0; /* * give up parsing. @@ -3136,7 +3148,7 @@ readAnnotationElement(J9CfrClassFile * classfile, J9CfrAnnotationElement ** pAnn annotation = &((J9CfrAnnotationElementAnnotation *)element)->annotationValue; result = readAnnotations(classfile, annotation, 1, data, dataEnd, segment, segmentEnd, &index, &freePointer, flags); - if (result != 0) { + if (BCT_ERR_NO_ERROR != result) { return result; } diff --git a/runtime/compiler/trj9/optimizer/EscapeAnalysis.cpp b/runtime/compiler/trj9/optimizer/EscapeAnalysis.cpp index 3e7473e0a53..406c85c9f81 100644 --- a/runtime/compiler/trj9/optimizer/EscapeAnalysis.cpp +++ b/runtime/compiler/trj9/optimizer/EscapeAnalysis.cpp @@ -6182,7 +6182,10 @@ void TR_EscapeAnalysis::heapifyBeforeColdBlocks(Candidate *candidate) return; if (trace()) - printf("Found candidate allocated with cold block compensation in %s numBlocks compensated = %d\n", comp()->signature(), candidate->getColdBlockEscapeInfo()->getSize()); + { + traceMsg(comp(),"Found candidate allocated with cold block compensation in %s numBlocks compensated = %d\n", comp()->signature(), candidate->getColdBlockEscapeInfo()->getSize()); + //printf("Found candidate allocated with cold block compensation in %s numBlocks compensated = %d\n", comp()->signature(), candidate->getColdBlockEscapeInfo()->getSize()); + } TR::SymbolReference *heapSymRef = getSymRefTab()->createTemporary(comp()->getMethodSymbol(), TR::Address); @@ -7628,12 +7631,12 @@ TR_FlowSensitiveEscapeAnalysis::TR_FlowSensitiveEscapeAnalysis(TR::Compilation * if (succCandidate) { traceMsg(comp, "Flush for current allocation %d is post dominated by (and moved to) Flush for allocation %d\n", candidate->_index, succCandidate->_index); - printf("Moved flush for allocation %p in block_%d to allocation %p in succ block_%d in method %s\n", candidate->_node, blockNum, succCandidate->_node, nextSucc, comp->signature()); + //printf("Moved flush for allocation %p in block_%d to allocation %p in succ block_%d in method %s\n", candidate->_node, blockNum, succCandidate->_node, nextSucc, comp->signature()); } else { traceMsg(comp, "Flush for current allocation %d is post dominated by (and moved to) real sync for in succ %d\n", candidate->_index, nextSucc); - printf("Moved flush for allocation %p in block_%d to real sync in succ %d in method %s\n", candidate->_node, blockNum, nextSucc, comp->signature()); + //printf("Moved flush for allocation %p in block_%d to real sync in succ %d in method %s\n", candidate->_node, blockNum, nextSucc, comp->signature()); } fflush(stdout); } @@ -7725,7 +7728,7 @@ TR_FlowSensitiveEscapeAnalysis::TR_FlowSensitiveEscapeAnalysis(TR::Compilation * if (trace()) { traceMsg(comp, "For edge %d->%d adding Flush in block_%d for candidate %p index %d\n", pair->getEdge()->getFrom()->getNumber(), pair->getEdge()->getTo()->getNumber(), splitBlock->getNumber(), pair->getAllocation(), pair->getAllocation()->_index); - printf("For edge %d->%d adding Flush in block_%d for candidate %p index %d\n", pair->getEdge()->getFrom()->getNumber(), pair->getEdge()->getTo()->getNumber(), splitBlock->getNumber(), pair->getAllocation(), pair->getAllocation()->_index); + //printf("For edge %d->%d adding Flush in block_%d for candidate %p index %d\n", pair->getEdge()->getFrom()->getNumber(), pair->getEdge()->getTo()->getNumber(), splitBlock->getNumber(), pair->getAllocation(), pair->getAllocation()->_index); } } else @@ -7734,7 +7737,7 @@ TR_FlowSensitiveEscapeAnalysis::TR_FlowSensitiveEscapeAnalysis(TR::Compilation * if (trace()) { traceMsg(comp, "Splitting edge %d->%d with block_%d for candidate %p index %d\n", pair->getEdge()->getFrom()->getNumber(), pair->getEdge()->getTo()->getNumber(), splitBlock->getNumber(), pair->getAllocation(), pair->getAllocation()->_index); - printf("Splitting edge %d->%d with block_%d for candidate %p index %d\n", pair->getEdge()->getFrom()->getNumber(), pair->getEdge()->getTo()->getNumber(), splitBlock->getNumber(), pair->getAllocation(), pair->getAllocation()->_index); + //printf("Splitting edge %d->%d with block_%d for candidate %p index %d\n", pair->getEdge()->getFrom()->getNumber(), pair->getEdge()->getTo()->getNumber(), splitBlock->getNumber(), pair->getAllocation(), pair->getAllocation()->_index); } } @@ -8408,12 +8411,12 @@ bool TR_LocalFlushElimination::examineNode(TR::Node *node, TR::NodeChecklist& vi if (!nodeHasSync) { traceMsg(comp(), "Flush for current allocation %d is post dominated by (and moved to) Flush for allocation %d\n", reachingCandidate->_index, candidate->_index); - printf("Moved flush for allocation %p to allocation %p locally in method %s\n", reachingCandidate->_node, candidate->_node, comp()->signature()); + //printf("Moved flush for allocation %p to allocation %p locally in method %s\n", reachingCandidate->_node, candidate->_node, comp()->signature()); } else { traceMsg(comp(), "Flush for current allocation %d is post dominated by (and moved to) sync in the same block\n", reachingCandidate->_index); - printf("Moved flush for allocation %p to real sync node %p locally in method %s\n", reachingCandidate->_node, node, comp()->signature()); + //printf("Moved flush for allocation %p to real sync node %p locally in method %s\n", reachingCandidate->_node, node, comp()->signature()); } fflush(stdout); diff --git a/runtime/gc_glue_java/JNICriticalRegion.hpp b/runtime/gc_glue_java/JNICriticalRegion.hpp index dfcf58e8dc7..04b55d0cbb6 100644 --- a/runtime/gc_glue_java/JNICriticalRegion.hpp +++ b/runtime/gc_glue_java/JNICriticalRegion.hpp @@ -1,4 +1,3 @@ - /******************************************************************************* * Copyright (c) 1991, 2018 IBM Corp. and others * @@ -66,55 +65,55 @@ class MM_JNICriticalRegion : public MM_BaseNonVirtual Assert_MM_true(J9_VM_FUNCTION(vmThread, currentVMThread)(vmThread->javaVM) == vmThread); } - /* Expected case: swap in JNI access bits */ - UDATA const expectedFlags = hasVMAccess ? J9_PUBLIC_FLAGS_VM_ACCESS : 0; - if (expectedFlags == VM_AtomicSupport::lockCompareExchange(&vmThread->publicFlags, expectedFlags, expectedFlags | J9_PUBLIC_FLAGS_JNI_CRITICAL_REGION | J9_PUBLIC_FLAGS_JNI_CRITICAL_ACCESS)) { - /* Set the count to 1 */ - vmThread->jniCriticalDirectCount = 1; - } else if (J9_ARE_ANY_BITS_SET(vmThread->publicFlags, J9_PUBLIC_FLAGS_JNI_CRITICAL_REGION)) { - /* Nested critical region; increment the count */ - vmThread->jniCriticalDirectCount += 1; - } else { - omrthread_t const osThread = vmThread->osThread; - omrthread_monitor_t const publicFlagsMutex = vmThread->publicFlagsMutex; - omrthread_monitor_enter_using_threadId(publicFlagsMutex, osThread); - if (hasVMAccess) { - /* Entering a critical region with VM access; set the JNI_CRITICAL_REGION flag */ - VM_VMAccess::setPublicFlags(vmThread, J9_PUBLIC_FLAGS_JNI_CRITICAL_REGION | J9_PUBLIC_FLAGS_JNI_CRITICAL_ACCESS); - vmThread->jniCriticalDirectCount = 1; - - /* The current thread has VM access and just acquired JNI critical access. - * If an exclusive request is in progress and the current thread has already - * been requested to halt, then adjust the JNI response count accordingly. - */ - if (J9_ARE_ANY_BITS_SET(vmThread->publicFlags, J9_PUBLIC_FLAGS_HALT_THREAD_EXCLUSIVE)) { - J9JavaVM* const vm = vmThread->javaVM; - omrthread_monitor_t const exclusiveAccessMutex = vm->exclusiveAccessMutex; - omrthread_monitor_enter_using_threadId(exclusiveAccessMutex, osThread); - vm->jniCriticalResponseCount += 1; - omrthread_monitor_exit_using_threadId(exclusiveAccessMutex, osThread); - } - } else { - /* Entering a critical region; acquire VM access and set the JNI_CRITICAL_REGION flag */ - if (0 == VM_AtomicSupport::lockCompareExchange(&vmThread->publicFlags, 0, J9_PUBLIC_FLAGS_JNI_CRITICAL_REGION | J9_PUBLIC_FLAGS_JNI_CRITICAL_ACCESS)) { - /* Set the count to 1 */ - vmThread->jniCriticalDirectCount = 1; - } else { + /* Handle nested case first to avoid the unnecessary atomic */ + if (J9_ARE_ANY_BITS_SET(vmThread->publicFlags, J9_PUBLIC_FLAGS_JNI_CRITICAL_REGION)) { + /* Nested critical region; increment the count */ + vmThread->jniCriticalDirectCount += 1; + } else { + UDATA const criticalFlags = J9_PUBLIC_FLAGS_JNI_CRITICAL_REGION | J9_PUBLIC_FLAGS_JNI_CRITICAL_ACCESS; #if defined(J9VM_INTERP_ATOMIC_FREE_JNI) - J9_VM_FUNCTION(vmThread, internalEnterVMFromJNI)(vmThread); + UDATA const expectedFlags = J9_PUBLIC_FLAGS_VM_ACCESS; #else /* J9VM_INTERP_ATOMIC_FREE_JNI */ - J9_VM_FUNCTION(vmThread, internalAcquireVMAccessNoMutex)(vmThread); + UDATA const expectedFlags = hasVMAccess ? J9_PUBLIC_FLAGS_VM_ACCESS : 0; #endif /* J9VM_INTERP_ATOMIC_FREE_JNI */ - VM_VMAccess::setPublicFlags(vmThread, J9_PUBLIC_FLAGS_JNI_CRITICAL_REGION | J9_PUBLIC_FLAGS_JNI_CRITICAL_ACCESS); + /* Expected case: swap in JNI access bits */ + if (expectedFlags == VM_AtomicSupport::lockCompareExchange(&vmThread->publicFlags, expectedFlags, expectedFlags | criticalFlags)) { + /* First entry into a critical region */ + vmThread->jniCriticalDirectCount = 1; + } else { + omrthread_t const osThread = vmThread->osThread; + omrthread_monitor_t const publicFlagsMutex = vmThread->publicFlagsMutex; + omrthread_monitor_enter_using_threadId(publicFlagsMutex, osThread); + if (hasVMAccess) { + /* Entering the first critical region with VM access; set the critical flags */ + VM_VMAccess::setPublicFlags(vmThread, criticalFlags); vmThread->jniCriticalDirectCount = 1; -#if defined(J9VM_INTERP_ATOMIC_FREE_JNI) - J9_VM_FUNCTION(vmThread, internalExitVMToJNI)(vmThread); -#else /* J9VM_INTERP_ATOMIC_FREE_JNI */ - J9_VM_FUNCTION(vmThread, internalReleaseVMAccessNoMutex)(vmThread); -#endif /* J9VM_INTERP_ATOMIC_FREE_JNI */ + + /* The current thread has VM access and just acquired JNI critical access. + * If an exclusive request is in progress and the current thread has already + * been requested to halt, then adjust the JNI response count accordingly. + */ + if (J9_ARE_ANY_BITS_SET(vmThread->publicFlags, J9_PUBLIC_FLAGS_HALT_THREAD_EXCLUSIVE)) { + J9JavaVM* const vm = vmThread->javaVM; + omrthread_monitor_t const exclusiveAccessMutex = vm->exclusiveAccessMutex; + omrthread_monitor_enter_using_threadId(exclusiveAccessMutex, osThread); + vm->jniCriticalResponseCount += 1; + omrthread_monitor_exit_using_threadId(exclusiveAccessMutex, osThread); + } + } else { + /* Entering the first critical region; acquire VM access and set the critical flags */ + if (0 == VM_AtomicSupport::lockCompareExchange(&vmThread->publicFlags, 0, criticalFlags)) { + /* Set the count to 1 */ + vmThread->jniCriticalDirectCount = 1; + } else { + J9_VM_FUNCTION(vmThread, internalEnterVMFromJNI)(vmThread); + VM_VMAccess::setPublicFlags(vmThread, J9_PUBLIC_FLAGS_JNI_CRITICAL_REGION | J9_PUBLIC_FLAGS_JNI_CRITICAL_ACCESS); + vmThread->jniCriticalDirectCount = 1; + J9_VM_FUNCTION(vmThread, internalExitVMToJNI)(vmThread); + } } + omrthread_monitor_exit_using_threadId(publicFlagsMutex, osThread); } - omrthread_monitor_exit_using_threadId(publicFlagsMutex, osThread); } } @@ -135,17 +134,22 @@ class MM_JNICriticalRegion : public MM_BaseNonVirtual Assert_MM_mustHaveJNICriticalRegion(vmThread); if (--vmThread->jniCriticalDirectCount == 0) { - /* Expected case: JNI access, swap in 0 */ + /* Exitting last critical region, swap out critical flags */ + UDATA const criticalFlags = J9_PUBLIC_FLAGS_JNI_CRITICAL_REGION | J9_PUBLIC_FLAGS_JNI_CRITICAL_ACCESS; +#if defined(J9VM_INTERP_ATOMIC_FREE_JNI) + UDATA const finalFlags = J9_PUBLIC_FLAGS_VM_ACCESS; +#else /* J9VM_INTERP_ATOMIC_FREE_JNI */ UDATA const finalFlags = hasVMAccess ? J9_PUBLIC_FLAGS_VM_ACCESS : 0; - UDATA const jniAccess = J9_PUBLIC_FLAGS_JNI_CRITICAL_REGION | J9_PUBLIC_FLAGS_JNI_CRITICAL_ACCESS | finalFlags; +#endif /* J9VM_INTERP_ATOMIC_FREE_JNI */ + UDATA const jniAccess = criticalFlags | finalFlags; if (jniAccess != VM_AtomicSupport::lockCompareExchange(&vmThread->publicFlags, jniAccess, finalFlags)) { - /* Exiting the last critical region; clear the JNI_CRITICAL_REGION and JNI_CRITICAL_ACCESS flags. + /* Exiting the last critical region; clear the critical flags. * Cache a copy of the flags first to determine if we must respond to an exclusive access request. */ omrthread_t const osThread = vmThread->osThread; omrthread_monitor_t const publicFlagsMutex = vmThread->publicFlagsMutex; omrthread_monitor_enter_using_threadId(publicFlagsMutex, osThread); - UDATA const publicFlags = VM_VMAccess::clearPublicFlagsNoMutex(vmThread, J9_PUBLIC_FLAGS_JNI_CRITICAL_REGION | J9_PUBLIC_FLAGS_JNI_CRITICAL_ACCESS); + UDATA const publicFlags = VM_VMAccess::clearPublicFlagsNoMutex(vmThread, criticalFlags); if (J9_ARE_ALL_BITS_SET(publicFlags, J9_PUBLIC_FLAGS_JNI_CRITICAL_ACCESS | J9_PUBLIC_FLAGS_HALT_THREAD_EXCLUSIVE)) { /* If an exclusive request is pending, then respond. */ J9JavaVM* const vm = vmThread->javaVM; diff --git a/runtime/gc_glue_java/configure_includes/configure_common.mk.ftl b/runtime/gc_glue_java/configure_includes/configure_common.mk.ftl index 1be6817a1b3..a7db6319d73 100644 --- a/runtime/gc_glue_java/configure_includes/configure_common.mk.ftl +++ b/runtime/gc_glue_java/configure_includes/configure_common.mk.ftl @@ -20,12 +20,8 @@ # SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception ############################################################################### -# Detect 64-bit vs. 32-bit -ifneq (,$(findstring -64,$(SPEC))) - TEMP_TARGET_DATASIZE:=64 -else - TEMP_TARGET_DATASIZE:=32 -endif +# Detect 64-bit vs. 32-bit. +TEMP_TARGET_DATASIZE := $(if $(findstring -64,$(SPEC)),64,32) CONFIGURE_ARGS += \ <#if uma.spec.flags.opt_cuda.enabled> @@ -67,4 +63,6 @@ CONFIGURE_ARGS += 'GLOBAL_INCLUDES=$$(top_srcdir)/../include' # This flag indicates that the J9 VMFarm build runs configure on a machine # that is not capable of compiling the source code. +ifeq (yes,$(CALLED_BY_SOURCE_ZIP)) CONFIGURE_ARGS += 'OMR_CROSS_CONFIGURE=yes' +endif diff --git a/runtime/jcl/common/proxy.c b/runtime/jcl/common/proxy.c index d0f264cab15..30fdf4b86d1 100644 --- a/runtime/jcl/common/proxy.c +++ b/runtime/jcl/common/proxy.c @@ -36,10 +36,7 @@ static jclass proxyDefineClass( J9JavaVM *vm = currentThread->javaVM; J9InternalVMFunctions *vmFuncs = vm->internalVMFunctions; J9StackWalkState walkState; - J9Class * clazz; - j9object_t heapClass = NULL; - j9object_t protectionDomainDirectReference = NULL; - j9object_t classLoaderObject; + J9Class * clazz = NULL; /* Walk the stack to find the caller class loader and protection domain */ vmFuncs->internalEnterVMFromJNI(currentThread); @@ -57,12 +54,12 @@ static jclass proxyDefineClass( clazz = J9_CLASS_FROM_CP(walkState.constantPool); if (classLoader == NULL) { - classLoaderObject = J9CLASSLOADER_CLASSLOADEROBJECT(currentThread, clazz->classLoader); + j9object_t classLoaderObject = J9CLASSLOADER_CLASSLOADEROBJECT(currentThread, clazz->classLoader); classLoader = vmFuncs->j9jni_createLocalRef(env, classLoaderObject); } if (pd == NULL) { - heapClass = J9VM_J9CLASS_TO_HEAPCLASS(clazz); - protectionDomainDirectReference = J9VMJAVALANGCLASS_PROTECTIONDOMAIN(currentThread, heapClass); + j9object_t heapClass = J9VM_J9CLASS_TO_HEAPCLASS(clazz); + j9object_t protectionDomainDirectReference = J9VMJAVALANGCLASS_PROTECTIONDOMAIN(currentThread, heapClass); pd = vmFuncs->j9jni_createLocalRef(env, protectionDomainDirectReference); } diff --git a/runtime/jvmti/jvmtiExtensionMechanism.c b/runtime/jvmti/jvmtiExtensionMechanism.c index a56e1047aec..31e8d4cefa6 100644 --- a/runtime/jvmti/jvmtiExtensionMechanism.c +++ b/runtime/jvmti/jvmtiExtensionMechanism.c @@ -155,10 +155,6 @@ static const jvmtiParamInfo jvmtiGetOSThreadID_params[] = { { "threadid_ptr", JVMTI_KIND_OUT, JVMTI_TYPE_JLONG, JNI_FALSE }, }; -static const jvmtiParamInfo jvmtiAsync_params[] = { - { "thread", JVMTI_KIND_IN, JVMTI_TYPE_JTHREAD, JNI_TRUE }, -}; - /* (jvmtiEnv *jvmti_env, jint option) */ static const jvmtiParamInfo jvmtiTraceSet_params[] = { { "option", JVMTI_KIND_IN, JVMTI_TYPE_JINT, JNI_FALSE } @@ -179,11 +175,6 @@ static const jvmtiParamInfo jvmtiJlmDump_params[] = { { "jlm_dump_ptr", JVMTI_KIND_ALLOC_BUF, JVMTI_TYPE_CVOID, JNI_FALSE } }; -/* (jvmtiEnv *jvmti_env, jint option) */ -static const jvmtiParamInfo jvmtiControlSet_params[] = { - { "option", JVMTI_KIND_IN_PTR, JVMTI_TYPE_JINT, JNI_FALSE } -}; - /* (jvmtiEnv *jvmti_env, const char* option) */ static const jvmtiParamInfo jvmtiTriggerVmDump_params[] = { { "option", JVMTI_KIND_IN_BUF, JVMTI_TYPE_CCHAR, JNI_FALSE } @@ -290,13 +281,6 @@ static const jvmtiParamInfo jvmtiGetMethodAndClassNames_params[] = { { "ramMethodDataDescriptorsCount", JVMTI_KIND_IN_PTR, JVMTI_TYPE_JINT, JNI_FALSE } }; -/* (jvmtiEnv *jvmti_env, jobject object, jint buffer_size, void* options_buffer, jint* data_size_ptr) */ -static const jvmtiParamInfo jvmtiQueryVmDump_params[] = { - { "buffer_size", JVMTI_KIND_IN_BUF, JVMTI_TYPE_JINT, JNI_FALSE }, - { "options_buffer", JVMTI_KIND_OUT_BUF, JVMTI_TYPE_CVOID, JNI_FALSE }, - { "data_size_ptr", JVMTI_KIND_OUT, JVMTI_TYPE_JINT, JNI_FALSE } -}; - /* (jvmtiEnv *jvmti_env, jobject object, jint buffer_size, void* options_buffer, jint* data_size_ptr) */ static const jvmtiParamInfo jvmtiQueryVmLogOptions_params[] = { { "buffer_size", JVMTI_KIND_IN, JVMTI_TYPE_JINT, JNI_FALSE }, @@ -374,11 +358,6 @@ static const jvmtiError notAvailable_errors[] = { JVMTI_ERROR_NOT_AVAILABLE }; -static const jvmtiError nullPointer_notAvailable_errors[] = { - JVMTI_ERROR_NULL_POINTER, - JVMTI_ERROR_NOT_AVAILABLE -}; - static const jvmtiError ras_errors[] = { JVMTI_ERROR_NULL_POINTER, JVMTI_ERROR_OUT_OF_MEMORY, @@ -405,24 +384,6 @@ static const jvmtiError jlm_dump_errors[] = { JVMTI_ERROR_ILLEGAL_ARGUMENT }; -static const jvmtiError control_set_errors[] = { - JVMTI_ERROR_WRONG_PHASE, - JVMTI_ERROR_ILLEGAL_ARGUMENT, - JVMTI_ERROR_NOT_AVAILABLE -}; - -static const jvmtiError set_method_selective_errors[] = { - JVMTI_ERROR_NULL_POINTER, - JVMTI_ERROR_WRONG_PHASE, - JVMTI_ERROR_NOT_AVAILABLE -}; - -static const jvmtiError set_event_notification_errors[] = { - JVMTI_ERROR_INVALID_THREAD, - JVMTI_ERROR_THREAD_NOT_ALIVE, - JVMTI_ERROR_ILLEGAL_ARGUMENT -}; - static const jvmtiError get_os_thread_id_errors[] = { JVMTI_ERROR_WRONG_PHASE, JVMTI_ERROR_INVALID_THREAD, @@ -430,13 +391,6 @@ static const jvmtiError get_os_thread_id_errors[] = { JVMTI_ERROR_NULL_POINTER }; -static const jvmtiError jvmtiAsync_errors[] = { - JVMTI_ERROR_WRONG_PHASE, - JVMTI_ERROR_INVALID_THREAD, - JVMTI_ERROR_THREAD_NOT_ALIVE, - JVMTI_ERROR_ACCESS_DENIED -}; - static const jvmtiError jvmtiGetStack_errors[] = { JVMTI_ERROR_WRONG_PHASE, JVMTI_ERROR_INVALID_THREAD, @@ -494,12 +448,6 @@ static const jvmtiError jvmtiGetTraceMetadata_errors[] = { JVMTI_ERROR_INVALID_ENVIRONMENT }; -static const jvmtiError jvmtiGetMethodAndClassNames_errors[] = { - JVMTI_ERROR_OUT_OF_MEMORY, - JVMTI_ERROR_WRONG_PHASE, - JVMTI_ERROR_INVALID_ENVIRONMENT -}; - static const jvmtiError jvmtiGetMemoryCategories_errors[] = { JVMTI_ERROR_UNSUPPORTED_VERSION, JVMTI_ERROR_ILLEGAL_ARGUMENT, diff --git a/runtime/libffi/module.xml b/runtime/libffi/module.xml index 9d12918b970..8fb35a49adb 100644 --- a/runtime/libffi/module.xml +++ b/runtime/libffi/module.xml @@ -1,6 +1,6 @@ - - - - - - - - + core - - - - - - - - - - - - - - - - - @@ -174,6 +146,17 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti + + + + + + + + + + + diff --git a/runtime/shared_common/shrinit.h b/runtime/shared_common/shrinit.h index 3324830db41..55bbcaed50d 100644 --- a/runtime/shared_common/shrinit.h +++ b/runtime/shared_common/shrinit.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2017 IBM Corp. and others + * Copyright (c) 2001, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -267,8 +267,8 @@ typedef struct J9SharedClassesOptions { #define HELPTEXT_MPROTECTEQUALS_PARTIAL_PAGES_PRIVATE_OPTION OPTION_MPROTECT_EQUALS""SUB_OPTION_MPROTECT_PARTIAL_PAGES #define HELPTEXT_MPROTECTEQUALS_PARTIAL_PAGES_ON_STARTUP_PRIVATE_OPTION OPTION_MPROTECT_EQUALS""SUB_OPTION_MPROTECT_PARTIAL_PAGES_ON_STARTUP #else -#define HELPTEXT_MPROTECTEQUALS_PUBLIC_OPTION OPTION_MPROTECT_EQUALS"["SUB_OPTION_MPROTECT_ALL"|"SUB_OPTION_MPROTECT_ONFIND"|"SUB_OPTION_MPROTECT_PARTIAL_PAGES_ON_STARTUP"|"SUB_OPTION_MPROTECT_DEF"|"SUB_OPTION_MPROTECT_NO_PARTIAL_PAGES"|"SUB_OPTION_MPROTECT_NONE"]" -#define HELPTEXT_MPROTECTEQUALS_NO_RW_PRIVATE_OPTION OPTION_MPROTECT_EQUALS""SUB_OPTION_MPROTECT_NO_RW +#define HELPTEXT_MPROTECTEQUALS_PUBLIC_OPTION OPTION_MPROTECT_EQUALS "[" SUB_OPTION_MPROTECT_ALL "|" SUB_OPTION_MPROTECT_ONFIND "|" SUB_OPTION_MPROTECT_PARTIAL_PAGES_ON_STARTUP "|" SUB_OPTION_MPROTECT_DEF "|" SUB_OPTION_MPROTECT_NO_PARTIAL_PAGES "|" SUB_OPTION_MPROTECT_NONE "]" +#define HELPTEXT_MPROTECTEQUALS_NO_RW_PRIVATE_OPTION OPTION_MPROTECT_EQUALS "" SUB_OPTION_MPROTECT_NO_RW #endif /* defined(J9ZOS390) || defined(AIXPPC) */ #define HELPTEXT_PRINTALLSTATS_OPTION OPTION_PRINTALLSTATS"[=option[+s]]" #define HELPTEXT_PRINTSTATS_OPTION OPTION_PRINTSTATS"[=option[+s]]" diff --git a/runtime/tests/shared/CacheDirPerm.cpp b/runtime/tests/shared/CacheDirPerm.cpp index 29af8c344e3..7fe5f5ab3c1 100644 --- a/runtime/tests/shared/CacheDirPerm.cpp +++ b/runtime/tests/shared/CacheDirPerm.cpp @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2014 IBM Corp. and others + * Copyright (c) 2001, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -97,7 +97,7 @@ CacheDirPerm::getTempCacheDir(I_32 cacheType, bool useDefaultDir) IDATA CacheDirPerm::createTempCacheDir(I_32 cacheType, bool useDefaultDir) { - char actualCacheDir[J9SH_MAXPATH]; + char actualCacheDir[2*J9SH_MAXPATH]; const char *testName = "createTempCacheDir"; struct stat statbuf; IDATA rc = PASS; @@ -132,7 +132,7 @@ IDATA CacheDirPerm::getCacheDirPerm(I_32 cacheType, bool isDefaultDir) { struct stat statbuf; - char actualCacheDir[J9SH_MAXPATH]; + char actualCacheDir[2*J9SH_MAXPATH]; const char *testName = "getCacheDirPerm"; PORT_ACCESS_FROM_JAVAVM(vm); diff --git a/runtime/tests/shared/CompiledMethodTest.cpp b/runtime/tests/shared/CompiledMethodTest.cpp index c911cbba614..00e630754e6 100644 --- a/runtime/tests/shared/CompiledMethodTest.cpp +++ b/runtime/tests/shared/CompiledMethodTest.cpp @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2014 IBM Corp. and others + * Copyright (c) 2001, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -34,7 +34,7 @@ #define TEST_METHOD_NAME "testMethod" #define TEST_METHOD_SIG "()" -#define METHOD_SPEC "*."TEST_METHOD_NAME""TEST_METHOD_SIG +#define METHOD_SPEC "*." TEST_METHOD_NAME "" TEST_METHOD_SIG #define METHOD_NAME_SIZE sizeof(TEST_METHOD_NAME) + sizeof(((J9UTF8 *)0)->length) #define METHOD_SIG_SIZE sizeof(TEST_METHOD_SIG) + sizeof(((J9UTF8 *)0)->length) #define NUM_ROMMETHOD 4 diff --git a/runtime/verbose/errormessageframeworkrtv.c b/runtime/verbose/errormessageframeworkrtv.c index 26579b36bfa..13f6c03cefd 100644 --- a/runtime/verbose/errormessageframeworkrtv.c +++ b/runtime/verbose/errormessageframeworkrtv.c @@ -750,7 +750,7 @@ printReasonForFlagMismatch(MessageBuffer *msgBuf, J9BytecodeVerificationData *ve /* Check the stackmap frame for flag only if the stackmap table exists in the class file */ if (stackMapCount > 0) { - I_32 stackmapFrameIndex = -1; + I_32 stackmapFrameIndex = 0; U_8* nextStackmapFrame = NULL; if (FALSE == prepareVerificationTypeBuffer(targetFrame, methodInfo)) { @@ -759,8 +759,8 @@ printReasonForFlagMismatch(MessageBuffer *msgBuf, J9BytecodeVerificationData *ve /* Walk through the stackmap table for the specified stackmap frame */ while (stackmapFrameIndex < (I_32)stackMapCount) { - stackmapFrameIndex += 1; nextStackmapFrame = decodeStackmapFrameData(targetFrame, nextStackmapFrame, stackmapFrameIndex, methodInfo, verifyData); + stackmapFrameIndex += 1; /* Return FALSE if out-of-memory during allocating verification buffer for data types in the specified stackmape frame */ if (NULL == nextStackmapFrame) { goto exit; diff --git a/runtime/vm/BytecodeInterpreter.hpp b/runtime/vm/BytecodeInterpreter.hpp index 34418cf7f11..5ff764677c0 100644 --- a/runtime/vm/BytecodeInterpreter.hpp +++ b/runtime/vm/BytecodeInterpreter.hpp @@ -37,6 +37,7 @@ #include "ut_j9vm.h" #include "vm_internal.h" #include "jni.h" +#define FFI_BUILDING /* Needed on Windows to link libffi statically */ #include "ffi.h" #include "jitregmap.h" #include "j2sever.h" diff --git a/runtime/vm/jniinv.c b/runtime/vm/jniinv.c index 4c118d5f054..53aa6454af1 100644 --- a/runtime/vm/jniinv.c +++ b/runtime/vm/jniinv.c @@ -75,8 +75,6 @@ J9_DECLARE_CONSTANT_UTF8(j9_exit, "exit"); J9_DECLARE_CONSTANT_UTF8(j9_run, "run"); J9_DECLARE_CONSTANT_UTF8(j9_initCause, "initCause"); J9_DECLARE_CONSTANT_UTF8(j9_completeInitialization, "completeInitialization"); -J9_DECLARE_CONSTANT_UTF8(j9_cleanup, "cleanup"); -J9_DECLARE_CONSTANT_UTF8(j9_threadCleanup, "threadCleanup"); J9_DECLARE_CONSTANT_UTF8(j9_void_void, "()V"); J9_DECLARE_CONSTANT_UTF8(j9_class_void, "(Ljava/lang/Class;)V"); J9_DECLARE_CONSTANT_UTF8(j9_class_class_void, "(Ljava/lang/Class;Ljava/lang/Class;)V"); diff --git a/runtime/vm/linearswalk.c b/runtime/vm/linearswalk.c index 7c4c7ccd0e6..ddd72172bf1 100644 --- a/runtime/vm/linearswalk.c +++ b/runtime/vm/linearswalk.c @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 1991, 2014 IBM Corp. and others + * Copyright (c) 1991, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -49,19 +49,9 @@ static void lswPrintf(struct J9PortLibrary *portLibrary, const char *format, ... #ifdef LINUX static const char COL_RESET[] = "\x1b[0m"; -static const char RED[] = "\x1b[31m"; -static const char GREEN[] = "\x1b[32m"; -static const char YELLOW[] = "\x1b[33m"; -static const char BLUE[] = "\x1b[34m"; -static const char MAGENTA[] = "\x1b[35m"; static const char CYAN[] = "\x1b[36m"; #else static const char COL_RESET[] = ""; -static const char RED[] = ""; -static const char GREEN[] = ""; -static const char YELLOW[] = ""; -static const char BLUE[] = ""; -static const char MAGENTA[] = ""; static const char CYAN[] = ""; #endif diff --git a/sourcetools/com.ibm.uma/com/ibm/j9/uma/platform/PlatformOSX.java b/sourcetools/com.ibm.uma/com/ibm/j9/uma/platform/PlatformOSX.java index c3c6bc8ee35..eb99ae8054f 100644 --- a/sourcetools/com.ibm.uma/com/ibm/j9/uma/platform/PlatformOSX.java +++ b/sourcetools/com.ibm.uma/com/ibm/j9/uma/platform/PlatformOSX.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017, 2017 IBM Corp. and others + * Copyright (c) 2017, 2018 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -21,14 +21,7 @@ *******************************************************************************/ package com.ibm.j9.uma.platform; -import java.util.Vector; - import com.ibm.uma.IConfiguration; -import com.ibm.uma.UMA; -import com.ibm.uma.UMAException; -import com.ibm.uma.om.Artifact; -import com.ibm.uma.om.Export; -import com.ibm.uma.util.FileAssistant; public class PlatformOSX extends PlatformImplementation { diff --git a/sourcetools/com.ibm.uma/com/ibm/j9/uma/util/Tree.java b/sourcetools/com.ibm.uma/com/ibm/j9/uma/util/Tree.java deleted file mode 100644 index 82fd34cdc07..00000000000 --- a/sourcetools/com.ibm.uma/com/ibm/j9/uma/util/Tree.java +++ /dev/null @@ -1,109 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2017 IBM Corp. and others - * - * This program and the accompanying materials are made available under - * the terms of the Eclipse Public License 2.0 which accompanies this - * distribution and is available at https://www.eclipse.org/legal/epl-2.0/ - * or the Apache License, Version 2.0 which accompanies this distribution and - * is available at https://www.apache.org/licenses/LICENSE-2.0. - * - * This Source Code may also be made available under the following - * Secondary Licenses when the conditions for such availability set - * forth in the Eclipse Public License, v. 2.0 are satisfied: GNU - * General Public License, version 2 with the GNU Classpath - * Exception [1] and GNU General Public License, version 2 with the - * OpenJDK Assembly Exception [2]. - * - * [1] https://www.gnu.org/software/classpath/license.html - * [2] http://openjdk.java.net/legal/assembly-exception.html - * - * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception - *******************************************************************************/ -package com.ibm.j9.uma.util; - -import java.util.TreeSet; -import java.util.Vector; - -public class Tree { - - class TreeNode { - E e; - TreeNode left = null; - TreeNode right = null; - public TreeNode(E e) { - this.e = e; - } - E getElement() { return e; } - void setLeft( TreeNode left ) { - this.left = left; - } - TreeNode getLeft() { - return left; - } - void setRight( TreeNode right ) { - this.right = right; - } - TreeNode getRight() { - return right; - } - } - - - TreeNode sortAsTree(Vector sortedCollection) { - TreeNode root = null; - // Split the collection into three parts. Find the largest - // pair complete balanced subtrees, distribute the remaining - // elements starting with the left size. Return the pivot element - // and the two subtrees. - - // basic cases - if ( sortedCollection.isEmpty() ) { - // do nothing - } else if ( sortedCollection.size() == 1 ) { - root = new TreeNode(sortedCollection.get(0)); - } else if ( sortedCollection.size() == 2 ) { - root = new TreeNode(sortedCollection.get(1)); - root.setLeft(new TreeNode(sortedCollection.get(0))); - } else if ( sortedCollection.size() == 3 ) { - root = new TreeNode(sortedCollection.get(1)); - root.setLeft(new TreeNode(sortedCollection.get(0))); - root.setRight(new TreeNode(sortedCollection.get(2))); - } else { - - // Depth of the complete tree we could build - double depth = Math.floor((Math.log(sortedCollection.size()) / Math.log(2))); - // What's left - double remainder = sortedCollection.size() - ((Math.pow(2, depth))-1); - double leftIndex = Math.min(Math.pow(2, depth-1), remainder); - leftIndex += Math.pow(2, depth-1) - 1; - int left = new Double(leftIndex).intValue(); - - root = new TreeNode(sortedCollection.get(left)); - root.setLeft(sortAsTree(new Vector(sortedCollection.subList(0, left)))); - root.setRight(sortAsTree(new Vector(sortedCollection.subList(left+1, sortedCollection.size())))); - } - return root; - - } - - void copyIntoFlatTree( TreeNode node, Vector array, int index ) { - if ( node == null || node.getElement() == null ) return; - array.set(index-1, node.getElement()); - copyIntoFlatTree(node.getLeft(), array, index*2); - copyIntoFlatTree(node.getRight(), array, (index*2)+1); - } - - public Vector sortAsFlatTree( Vector vector ) { - TreeSet treeSet = new TreeSet(); - for ( T t : vector ) { - treeSet.add(t); - } - Vector sortedCollection = new Vector(vector.size()); - for( T t : treeSet ) { - sortedCollection.add(t); - } - TreeNode root = sortAsTree(sortedCollection); - copyIntoFlatTree(root, sortedCollection, 1); - return sortedCollection; - } -} diff --git a/test/functional/TestExample/playlist.xml b/test/functional/TestExample/playlist.xml index 52fc6dcae92..84da8cc7c90 100644 --- a/test/functional/TestExample/playlist.xml +++ b/test/functional/TestExample/playlist.xml @@ -34,7 +34,7 @@ -groups $(TEST_GROUP) \ -excludegroups $(DEFAULT_EXCLUDE); \ $(TEST_STATUS) - os.linux,arch.x86,bits.64 + os.linux extended diff --git a/test/functional/TestExample/src/org/openj9/test/example/MyTest.java b/test/functional/TestExample/src/org/openj9/test/example/MyTest.java index aca0572f423..97bf14cbecc 100755 --- a/test/functional/TestExample/src/org/openj9/test/example/MyTest.java +++ b/test/functional/TestExample/src/org/openj9/test/example/MyTest.java @@ -32,6 +32,6 @@ public class MyTest { public void aTestExample() { logger.info("running aTestExample: INFO and above level logging enabled"); - AssertJUnit.assertEquals(4, 2+2); + AssertJUnit.assertEquals(4, 2+3); } }