mirror of
https://github.com/openjdk/jdk.git
synced 2026-06-06 18:53:37 +00:00
8382582: Remove the experimental JVMCI feature
Co-authored-by: Tobias Hartmann <thartmann@openjdk.org> Co-authored-by: Mikael Vidstedt <mikael@openjdk.org> Reviewed-by: kvn, thartmann, liach, stefank, coleenp, erikj, vlivanov, cjplummer, alanb
This commit is contained in:
parent
5ccfb150d4
commit
2acf0dc98a
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -311,7 +311,7 @@ jobs:
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
# Upload static libs bundles separately to avoid interference with normal linux-x64 bundle.
|
||||
# This bundle is not used by testing jobs, but downstreams use it to check that
|
||||
# dependent projects, e.g. libgraal, builds fine.
|
||||
# dependent projects build fine.
|
||||
bundle-suffix: "-static-libs"
|
||||
if: needs.prepare.outputs.linux-x64-variants == 'true'
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -410,27 +410,6 @@ endif
|
||||
|
||||
################################################################################
|
||||
|
||||
ifneq ($(filter static-libs-graal-bundles, $(MAKECMDGOALS)), )
|
||||
STATIC_LIBS_GRAAL_BUNDLE_FILES := $(call FindFiles, $(STATIC_LIBS_GRAAL_IMAGE_DIR))
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS)-$(DEBUG_LEVEL), macosx-release)
|
||||
STATIC_LIBS_GRAAL_BUNDLE_SUBDIR := $(JDK_MACOSX_CONTENTS_SUBDIR)/Home
|
||||
else
|
||||
STATIC_LIBS_GRAAL_BUNDLE_SUBDIR := $(JDK_BUNDLE_SUBDIR)
|
||||
endif
|
||||
|
||||
$(eval $(call SetupBundleFile, BUILD_STATIC_LIBS_GRAAL_BUNDLE, \
|
||||
BUNDLE_NAME := $(STATIC_LIBS_GRAAL_BUNDLE_NAME), \
|
||||
FILES := $(STATIC_LIBS_GRAAL_BUNDLE_FILES), \
|
||||
BASE_DIRS := $(STATIC_LIBS_GRAAL_IMAGE_DIR), \
|
||||
SUBDIR := $(STATIC_LIBS_GRAAL_BUNDLE_SUBDIR), \
|
||||
))
|
||||
|
||||
STATIC_LIBS_GRAAL_TARGETS += $(BUILD_STATIC_LIBS_GRAAL_BUNDLE)
|
||||
endif
|
||||
|
||||
#################################################################################
|
||||
|
||||
ifneq ($(filter static-jdk-bundles, $(MAKECMDGOALS)), )
|
||||
STATIC_JDK_BUNDLE_FILES := $(call FindFiles, $(STATIC_JDK_IMAGE_DIR))
|
||||
|
||||
@ -453,13 +432,12 @@ docs-jdk-bundles: $(DOCS_JDK_TARGETS)
|
||||
docs-javase-bundles: $(DOCS_JAVASE_TARGETS)
|
||||
docs-reference-bundles: $(DOCS_REFERENCE_TARGETS)
|
||||
static-libs-bundles: $(STATIC_LIBS_TARGETS)
|
||||
static-libs-graal-bundles: $(STATIC_LIBS_GRAAL_TARGETS)
|
||||
static-jdk-bundles: $(STATIC_JDK_TARGETS)
|
||||
jcov-bundles: $(JCOV_TARGETS)
|
||||
|
||||
.PHONY: product-bundles test-bundles \
|
||||
docs-jdk-bundles docs-javase-bundles docs-reference-bundles \
|
||||
static-libs-bundles static-libs-graal-bundles static-jdk-bundles jcov-bundles
|
||||
static-libs-bundles static-jdk-bundles jcov-bundles
|
||||
|
||||
################################################################################
|
||||
|
||||
|
||||
@ -1,52 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, Red Hat Inc.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
# This makefile creates a jdk image overlaid with statically linked core
|
||||
# libraries.
|
||||
################################################################################
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
$(eval $(call SetupCopyFiles, COPY_JDK_IMG, \
|
||||
SRC := $(JDK_IMAGE_DIR)/, \
|
||||
DEST := $(GRAAL_BUILDER_IMAGE_DIR)/, \
|
||||
FILES := $(call FindFiles, $(JDK_IMAGE_DIR)/), \
|
||||
))
|
||||
TARGETS += $(COPY_JDK_IMG)
|
||||
|
||||
$(eval $(call SetupCopyFiles, COPY_STATIC_LIBS, \
|
||||
SRC := $(STATIC_LIBS_GRAAL_IMAGE_DIR)/lib, \
|
||||
DEST := $(GRAAL_BUILDER_IMAGE_DIR)/lib, \
|
||||
FILES := $(filter %$(STATIC_LIBRARY_SUFFIX), \
|
||||
$(call FindFiles, $(STATIC_LIBS_GRAAL_IMAGE_DIR)/lib)), \
|
||||
))
|
||||
TARGETS += $(COPY_STATIC_LIBS)
|
||||
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -478,11 +478,6 @@ $(eval $(call SetupTarget, static-libs-image, \
|
||||
TARGET := static-libs-image, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, static-libs-graal-image, \
|
||||
MAKEFILE := StaticLibsImage, \
|
||||
TARGET := static-libs-graal-image, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, mac-jdk-bundle, \
|
||||
MAKEFILE := MacBundles, \
|
||||
TARGET := jdk-bundle, \
|
||||
@ -506,11 +501,6 @@ $(eval $(call SetupTarget, exploded-image-optimize, \
|
||||
buildtools-modules, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, graal-builder-image, \
|
||||
MAKEFILE := GraalBuilderImage, \
|
||||
DEPS := jdk-image static-libs-graal-image, \
|
||||
))
|
||||
|
||||
ifeq ($(JCOV_ENABLED), true)
|
||||
$(eval $(call SetupTarget, jcov-image, \
|
||||
MAKEFILE := Coverage, \
|
||||
@ -877,12 +867,6 @@ $(eval $(call SetupTarget, static-libs-bundles, \
|
||||
DEPS := static-libs-image, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, static-libs-graal-bundles, \
|
||||
MAKEFILE := Bundles, \
|
||||
TARGET := static-libs-graal-bundles, \
|
||||
DEPS := static-libs-graal-image, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, static-jdk-bundles, \
|
||||
MAKEFILE := Bundles, \
|
||||
TARGET := static-jdk-bundles, \
|
||||
@ -1124,8 +1108,6 @@ else
|
||||
|
||||
static-libs-image: hotspot-static-libs static-libs
|
||||
|
||||
static-libs-graal-image: static-libs
|
||||
|
||||
bootcycle-images: jdk-image
|
||||
|
||||
docs-jdk-api-javadoc: $(GENSRC_TARGETS)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2019, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -39,8 +39,6 @@ ALL_MODULES = $(call FindAllModules)
|
||||
|
||||
ifneq ($(filter static-libs-image, $(MAKECMDGOALS)), )
|
||||
IMAGE_DEST_DIR = $(STATIC_LIBS_IMAGE_DIR)/lib
|
||||
else ifneq ($(filter static-libs-graal-image, $(MAKECMDGOALS)), )
|
||||
IMAGE_DEST_DIR = $(STATIC_LIBS_GRAAL_IMAGE_DIR)/lib
|
||||
endif
|
||||
|
||||
# Copy JDK static libs to the image.
|
||||
@ -70,7 +68,6 @@ ifneq ($(filter static-libs-image, $(MAKECMDGOALS)), )
|
||||
endif
|
||||
|
||||
static-libs-image: $(HOTSPOT_VARIANT_STATIC_LIBS_TARGETS) $(STATIC_LIBS_TARGETS)
|
||||
static-libs-graal-image: $(STATIC_LIBS_TARGETS)
|
||||
|
||||
################################################################################
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -45,7 +45,7 @@ m4_define(jvm_features_valid, m4_normalize( \
|
||||
ifdef([custom_jvm_features_valid], custom_jvm_features_valid) \
|
||||
\
|
||||
cds compiler1 compiler2 dtrace epsilongc g1gc jfr jni-check \
|
||||
jvmci jvmti link-time-opt management minimal opt-size parallelgc \
|
||||
jvmti link-time-opt management minimal opt-size parallelgc \
|
||||
serialgc services shenandoahgc vm-structs zero zgc \
|
||||
))
|
||||
|
||||
@ -62,7 +62,6 @@ m4_define(jvm_feature_desc_epsilongc, [include the epsilon (no-op) garbage colle
|
||||
m4_define(jvm_feature_desc_g1gc, [include the G1 garbage collector])
|
||||
m4_define(jvm_feature_desc_jfr, [enable JDK Flight Recorder (JFR)])
|
||||
m4_define(jvm_feature_desc_jni_check, [enable -Xcheck:jni support])
|
||||
m4_define(jvm_feature_desc_jvmci, [enable JVM Compiler Interface (JVMCI)])
|
||||
m4_define(jvm_feature_desc_jvmti, [enable Java Virtual Machine Tool Interface (JVM TI)])
|
||||
m4_define(jvm_feature_desc_link_time_opt, [enable link time optimization])
|
||||
m4_define(jvm_feature_desc_management, [enable java.lang.management API support])
|
||||
@ -269,26 +268,6 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_DTRACE],
|
||||
])
|
||||
])
|
||||
|
||||
################################################################################
|
||||
# Check if the feature 'jvmci' is available on this platform.
|
||||
#
|
||||
AC_DEFUN_ONCE([JVM_FEATURES_CHECK_JVMCI],
|
||||
[
|
||||
JVM_FEATURES_CHECK_AVAILABILITY(jvmci, [
|
||||
AC_MSG_CHECKING([if platform is supported by JVMCI])
|
||||
if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
elif test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
elif test "x$OPENJDK_TARGET_CPU" = "xriscv64"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no, $OPENJDK_TARGET_CPU])
|
||||
AVAILABLE=false
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
||||
################################################################################
|
||||
# Check if the feature 'shenandoahgc' is available on this platform.
|
||||
#
|
||||
@ -376,7 +355,6 @@ AC_DEFUN_ONCE([JVM_FEATURES_PREPARE_PLATFORM],
|
||||
|
||||
JVM_FEATURES_CHECK_CDS
|
||||
JVM_FEATURES_CHECK_DTRACE
|
||||
JVM_FEATURES_CHECK_JVMCI
|
||||
JVM_FEATURES_CHECK_SHENANDOAHGC
|
||||
JVM_FEATURES_CHECK_ZGC
|
||||
|
||||
@ -401,17 +379,17 @@ AC_DEFUN([JVM_FEATURES_PREPARE_VARIANT],
|
||||
JVM_FEATURES_VARIANT_UNAVAILABLE="cds minimal zero"
|
||||
elif test "x$variant" = "xzero"; then
|
||||
JVM_FEATURES_VARIANT_UNAVAILABLE="compiler1 compiler2 \
|
||||
jvmci minimal zgc"
|
||||
minimal zgc"
|
||||
else
|
||||
JVM_FEATURES_VARIANT_UNAVAILABLE="minimal zero"
|
||||
fi
|
||||
|
||||
# Check which features should be off by default for this JVM variant.
|
||||
if test "x$variant" = "xclient"; then
|
||||
JVM_FEATURES_VARIANT_FILTER="compiler2 jvmci link-time-opt opt-size"
|
||||
JVM_FEATURES_VARIANT_FILTER="compiler2 link-time-opt opt-size"
|
||||
elif test "x$variant" = "xminimal"; then
|
||||
JVM_FEATURES_VARIANT_FILTER="cds compiler2 dtrace epsilongc g1gc \
|
||||
jfr jni-check jvmci jvmti management parallelgc services \
|
||||
jfr jni-check jvmti management parallelgc services \
|
||||
shenandoahgc vm-structs zgc"
|
||||
if test "x$OPENJDK_TARGET_CPU" = xarm ; then
|
||||
JVM_FEATURES_VARIANT_FILTER="$JVM_FEATURES_VARIANT_FILTER opt-size"
|
||||
@ -421,7 +399,7 @@ AC_DEFUN([JVM_FEATURES_PREPARE_VARIANT],
|
||||
link-time-opt"
|
||||
fi
|
||||
elif test "x$variant" = "xcore"; then
|
||||
JVM_FEATURES_VARIANT_FILTER="compiler1 compiler2 jvmci \
|
||||
JVM_FEATURES_VARIANT_FILTER="compiler1 compiler2 \
|
||||
link-time-opt opt-size"
|
||||
elif test "x$variant" = "xzero"; then
|
||||
JVM_FEATURES_VARIANT_FILTER="jfr link-time-opt opt-size"
|
||||
@ -517,11 +495,6 @@ AC_DEFUN([JVM_FEATURES_VERIFY],
|
||||
AC_MSG_ERROR([Specified JVM feature 'jfr' requires feature 'services' for variant '$variant'])
|
||||
fi
|
||||
|
||||
if JVM_FEATURES_IS_ACTIVE(jvmci) && ! (JVM_FEATURES_IS_ACTIVE(compiler1) || \
|
||||
JVM_FEATURES_IS_ACTIVE(compiler2)); then
|
||||
AC_MSG_ERROR([Specified JVM feature 'jvmci' requires feature 'compiler2' or 'compiler1' for variant '$variant'])
|
||||
fi
|
||||
|
||||
if JVM_FEATURES_IS_ACTIVE(jvmti) && ! JVM_FEATURES_IS_ACTIVE(services); then
|
||||
AC_MSG_ERROR([Specified JVM feature 'jvmti' requires feature 'services' for variant '$variant'])
|
||||
fi
|
||||
@ -531,9 +504,6 @@ AC_DEFUN([JVM_FEATURES_VERIFY],
|
||||
if ! JVM_FEATURES_IS_ACTIVE(cds); then
|
||||
ENABLE_CDS="false"
|
||||
fi
|
||||
if ! JVM_FEATURES_IS_ACTIVE(jvmci); then
|
||||
INCLUDE_JVMCI="false"
|
||||
fi
|
||||
if JVM_FEATURES_IS_ACTIVE(compiler2); then
|
||||
INCLUDE_COMPILER2="true"
|
||||
fi
|
||||
@ -559,7 +529,6 @@ AC_DEFUN_ONCE([JVM_FEATURES_SETUP],
|
||||
# and disable them in JVM_FEATURES_VERIFY if a variant is found that are
|
||||
# missing any of them.
|
||||
ENABLE_CDS="true"
|
||||
INCLUDE_JVMCI="true"
|
||||
INCLUDE_COMPILER2="false"
|
||||
|
||||
for variant in $JVM_VARIANTS; do
|
||||
@ -599,7 +568,6 @@ AC_DEFUN_ONCE([JVM_FEATURES_SETUP],
|
||||
AC_SUBST(JVM_FEATURES_zero)
|
||||
AC_SUBST(JVM_FEATURES_custom)
|
||||
|
||||
AC_SUBST(INCLUDE_JVMCI)
|
||||
AC_SUBST(INCLUDE_COMPILER2)
|
||||
|
||||
])
|
||||
|
||||
@ -844,7 +844,6 @@ PNG_CFLAGS := @PNG_CFLAGS@
|
||||
|
||||
# Misc
|
||||
INCLUDE_SA := @INCLUDE_SA@
|
||||
INCLUDE_JVMCI := @INCLUDE_JVMCI@
|
||||
INCLUDE_COMPILER2 := @INCLUDE_COMPILER2@
|
||||
|
||||
OS_VERSION_MAJOR := @OS_VERSION_MAJOR@
|
||||
@ -892,14 +891,6 @@ DOCS_OUTPUTDIR := $(DOCS_JDK_IMAGE_DIR)
|
||||
STATIC_LIBS_IMAGE_SUBDIR := static-libs
|
||||
STATIC_LIBS_IMAGE_DIR := $(IMAGES_OUTPUTDIR)/$(STATIC_LIBS_IMAGE_SUBDIR)
|
||||
|
||||
# Graal static libs image
|
||||
STATIC_LIBS_GRAAL_IMAGE_SUBDIR := static-libs-graal
|
||||
STATIC_LIBS_GRAAL_IMAGE_DIR := $(IMAGES_OUTPUTDIR)/$(STATIC_LIBS_GRAAL_IMAGE_SUBDIR)
|
||||
|
||||
# Graal builder image
|
||||
GRAAL_BUILDER_IMAGE_SUBDIR := graal-builder-jdk
|
||||
GRAAL_BUILDER_IMAGE_DIR := $(IMAGES_OUTPUTDIR)/$(GRAAL_BUILDER_IMAGE_SUBDIR)
|
||||
|
||||
# Macosx bundles directory definitions
|
||||
JDK_MACOSX_BUNDLE_SUBDIR := jdk-bundle
|
||||
JRE_MACOSX_BUNDLE_SUBDIR := jre-bundle
|
||||
@ -944,7 +935,6 @@ DOCS_JDK_BUNDLE_NAME := jdk-$(BASE_NAME)_doc-api-spec$(DEBUG_PART).tar.gz
|
||||
DOCS_JAVASE_BUNDLE_NAME := javase-$(BASE_NAME)_doc-api-spec$(DEBUG_PART).tar.gz
|
||||
DOCS_REFERENCE_BUNDLE_NAME := jdk-reference-$(BASE_NAME)_doc-api-spec$(DEBUG_PART).tar.gz
|
||||
STATIC_LIBS_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-static-libs$(DEBUG_PART).tar.gz
|
||||
STATIC_LIBS_GRAAL_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-static-libs-graal$(DEBUG_PART).tar.gz
|
||||
STATIC_JDK_BUNDLE_NAME := static-jdk-$(BASE_NAME)_bin$(DEBUG_PART).$(JDK_BUNDLE_EXTENSION)
|
||||
JCOV_BUNDLE_NAME := jdk-jcov-$(BASE_NAME)_bin$(DEBUG_PART).$(JDK_BUNDLE_EXTENSION)
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -54,13 +54,6 @@ ifeq ($(INCLUDE_SA), false)
|
||||
MODULES_FILTER += jdk.hotspot.agent
|
||||
endif
|
||||
|
||||
# Filter out jvmci specific modules if jvmci is disabled
|
||||
ifeq ($(INCLUDE_JVMCI), false)
|
||||
MODULES_FILTER += jdk.internal.vm.ci
|
||||
MODULES_FILTER += jdk.graal.compiler
|
||||
MODULES_FILTER += jdk.graal.compiler.management
|
||||
endif
|
||||
|
||||
# jpackage is only on windows, macosx, and linux
|
||||
ifeq ($(call isTargetOs, windows macosx linux), false)
|
||||
MODULES_FILTER += jdk.jpackage
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -45,5 +45,4 @@ LANGTOOLS_MODULES= \
|
||||
# These models require buildtools-hotspot to process for gensrc
|
||||
HOTSPOT_MODULES= \
|
||||
jdk.hotspot.agent \
|
||||
jdk.internal.vm.ci \
|
||||
#
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -44,7 +44,6 @@ BOOT_MODULES= \
|
||||
java.security.sasl \
|
||||
java.xml \
|
||||
jdk.incubator.vector \
|
||||
jdk.internal.vm.ci \
|
||||
jdk.jfr \
|
||||
jdk.management \
|
||||
jdk.management.jfr \
|
||||
@ -60,8 +59,6 @@ BOOT_MODULES= \
|
||||
# should carefully be considered if it should be upgradeable or not.
|
||||
UPGRADEABLE_PLATFORM_MODULES= \
|
||||
java.compiler \
|
||||
jdk.graal.compiler \
|
||||
jdk.graal.compiler.management \
|
||||
#
|
||||
|
||||
PLATFORM_MODULES= \
|
||||
@ -107,7 +104,6 @@ NATIVE_ACCESS_MODULES= \
|
||||
jdk.crypto.mscapi \
|
||||
jdk.hotspot.agent \
|
||||
jdk.internal.le \
|
||||
jdk.internal.vm.ci \
|
||||
jdk.jdi \
|
||||
jdk.jfr \
|
||||
jdk.jpackage \
|
||||
|
||||
@ -204,7 +204,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
|
||||
DISABLED_WARNINGS_gcc_jfrChunkWriter.cpp := unused-const-variable, \
|
||||
DISABLED_WARNINGS_gcc_jfrMemorySizer.cpp := unused-const-variable, \
|
||||
DISABLED_WARNINGS_gcc_jfrTraceIdKlassQueue.cpp := unused-const-variable, \
|
||||
DISABLED_WARNINGS_gcc_jvmciCodeInstaller.cpp := stringop-overflow, \
|
||||
DISABLED_WARNINGS_gcc_jvmFlag.cpp := unused-const-variable, \
|
||||
DISABLED_WARNINGS_gcc_jvmtiTagMap.cpp := stringop-overflow, \
|
||||
DISABLED_WARNINGS_gcc_macroAssembler_ppc_sha.cpp := unused-const-variable, \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -96,12 +96,6 @@ ifneq ($(call check-jvm-feature, jvmti), true)
|
||||
jvmtiAgentList.cpp jfrJvmtiAgent.cpp
|
||||
endif
|
||||
|
||||
ifneq ($(call check-jvm-feature, jvmci), true)
|
||||
JVM_CFLAGS_FEATURES += -DINCLUDE_JVMCI=0
|
||||
JVM_EXCLUDES += jvmci
|
||||
JVM_EXCLUDE_FILES += jvmciCodeInstaller_$(HOTSPOT_TARGET_CPU_ARCH).cpp
|
||||
endif
|
||||
|
||||
ifneq ($(call check-jvm-feature, vm-structs), true)
|
||||
JVM_CFLAGS_FEATURES += -DINCLUDE_VM_STRUCTS=0
|
||||
JVM_EXCLUDE_FILES += vmStructs.cpp
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -33,8 +33,6 @@ ifeq ($(INCLUDE), true)
|
||||
|
||||
ifeq ($(TOOLCHAIN_TYPE), gcc)
|
||||
BUILD_LIBJVM_vmStructs.cpp_CXXFLAGS := -fno-var-tracking-assignments
|
||||
BUILD_LIBJVM_jvmciCompilerToVM.cpp_CXXFLAGS := -fno-var-tracking-assignments
|
||||
BUILD_LIBJVM_jvmciCompilerToVMInit.cpp_CXXFLAGS := -fno-var-tracking-assignments
|
||||
ifeq ($(DEBUG_LEVEL), release)
|
||||
# Need extra inlining to collapse shared marking code into the hot marking loop
|
||||
BUILD_LIBJVM_shenandoahMark.cpp_CXXFLAGS := --param inline-unit-growth=1000
|
||||
@ -104,7 +102,6 @@ else ifeq ($(call isTargetOs, macosx), true)
|
||||
sharedRuntimeTrig.cpp \
|
||||
sharedRuntimeTrans.cpp \
|
||||
loopTransform.cpp \
|
||||
jvmciCompilerToVM.cpp \
|
||||
$(OPT_SPEED_SRC) \
|
||||
#
|
||||
endif
|
||||
@ -140,13 +137,9 @@ else ifeq ($(call isTargetOs, windows), true)
|
||||
os_windows.cpp \
|
||||
os_windows_x86.cpp \
|
||||
osThread_windows.cpp \
|
||||
jvmciCompilerToVMInit.cpp \
|
||||
$(OPT_SPEED_SRC) \
|
||||
#
|
||||
|
||||
# Workaround for jvmciCompilerToVM.cpp long compilation time
|
||||
BUILD_LIBJVM_jvmciCompilerToVMInit.cpp_OPTIMIZATION := NONE
|
||||
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -111,7 +111,6 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
-hidePath .hg \
|
||||
-hidePath .jcheck \
|
||||
-hidePath jdk.hotspot.agent \
|
||||
-hidePath jdk.internal.vm.ci \
|
||||
-hidePath jdk.jfr \
|
||||
-compiler VC10 \
|
||||
-jdkTargetRoot $(call FixPath, $(JDK_OUTPUTDIR)) \
|
||||
|
||||
@ -1,38 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
|
||||
DISABLED_WARNINGS_java += dangling-doc-comments this-escape
|
||||
|
||||
# -parameters provides method's parameters information in class file,
|
||||
# JVMCI compilers make use of that information for various sanity checks.
|
||||
# Don't use Indy strings concatenation to have good JVMCI startup performance.
|
||||
|
||||
JAVAC_FLAGS += -parameters -XDstringConcat=inline
|
||||
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK)
|
||||
|
||||
################################################################################
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -464,11 +464,11 @@ frame frame::sender_for_interpreter_frame(RegisterMap* map) const {
|
||||
intptr_t* unextended_sp = interpreter_frame_sender_sp();
|
||||
intptr_t* sender_fp = link();
|
||||
|
||||
#if defined(COMPILER1) || COMPILER2_OR_JVMCI
|
||||
#if COMPILER1_OR_COMPILER2
|
||||
if (map->update_map()) {
|
||||
update_map_with_saved_link(map, (intptr_t**) addr_at(link_offset));
|
||||
}
|
||||
#endif // defined(COMPILER1) || COMPILER1_OR_COMPILER2
|
||||
#endif // COMPILER1_OR_COMPILER2
|
||||
|
||||
// For ROP protection, Interpreter will have signed the sender_pc,
|
||||
// but there is no requirement to authenticate it here.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -36,9 +36,6 @@
|
||||
#include "utilities/align.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
#include "utilities/formatBuffer.hpp"
|
||||
#if INCLUDE_JVMCI
|
||||
#include "jvmci/jvmciRuntime.hpp"
|
||||
#endif
|
||||
|
||||
static int slow_path_size(nmethod* nm) {
|
||||
// The slow path code is out of line with C2
|
||||
@ -81,34 +78,21 @@ class NativeNMethodBarrier {
|
||||
|
||||
public:
|
||||
NativeNMethodBarrier(nmethod* nm): _nm(nm) {
|
||||
#if INCLUDE_JVMCI
|
||||
if (nm->is_compiled_by_jvmci()) {
|
||||
address pc = nm->code_begin() + nm->jvmci_nmethod_data()->nmethod_entry_patch_offset();
|
||||
RelocIterator iter(nm, pc, pc + 4);
|
||||
guarantee(iter.next(), "missing relocs");
|
||||
guarantee(iter.type() == relocInfo::section_word_type, "unexpected reloc");
|
||||
|
||||
_guard_addr = (int*) iter.section_word_reloc()->target();
|
||||
_instruction_address = pc;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
_instruction_address = nm->code_begin() + nm->frame_complete_offset() + entry_barrier_offset(nm);
|
||||
if (nm->is_compiled_by_c2()) {
|
||||
// With c2 compiled code, the guard is out-of-line in a stub
|
||||
// We find it using the RelocIterator.
|
||||
RelocIterator iter(nm);
|
||||
while (iter.next()) {
|
||||
if (iter.type() == relocInfo::entry_guard_type) {
|
||||
entry_guard_Relocation* const reloc = iter.entry_guard_reloc();
|
||||
_guard_addr = reinterpret_cast<int*>(reloc->addr());
|
||||
return;
|
||||
}
|
||||
_instruction_address = nm->code_begin() + nm->frame_complete_offset() + entry_barrier_offset(nm);
|
||||
if (nm->is_compiled_by_c2()) {
|
||||
// With c2 compiled code, the guard is out-of-line in a stub
|
||||
// We find it using the RelocIterator.
|
||||
RelocIterator iter(nm);
|
||||
while (iter.next()) {
|
||||
if (iter.type() == relocInfo::entry_guard_type) {
|
||||
entry_guard_Relocation* const reloc = iter.entry_guard_reloc();
|
||||
_guard_addr = reinterpret_cast<int*>(reloc->addr());
|
||||
return;
|
||||
}
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
_guard_addr = reinterpret_cast<int*>(instruction_address() + local_guard_offset(nm));
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
_guard_addr = reinterpret_cast<int*>(instruction_address() + local_guard_offset(nm));
|
||||
}
|
||||
|
||||
int get_value() {
|
||||
@ -225,10 +209,3 @@ int BarrierSetNMethod::guard_value(nmethod* nm) {
|
||||
NativeNMethodBarrier barrier(nm);
|
||||
return barrier.get_value();
|
||||
}
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
bool BarrierSetNMethod::verify_barrier(nmethod* nm, err_msg& msg) {
|
||||
NativeNMethodBarrier barrier(nm);
|
||||
return barrier.check_barrier(msg);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -36,7 +36,7 @@ define_pd_global(bool, ImplicitNullChecks, true); // Generate code for im
|
||||
define_pd_global(bool, TrapBasedNullChecks, false);
|
||||
define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap nulls past to check cast
|
||||
|
||||
define_pd_global(bool, DelayCompilerStubsGeneration, COMPILER2_OR_JVMCI);
|
||||
define_pd_global(bool, DelayCompilerStubsGeneration, COMPILER2_PRESENT(true) NOT_COMPILER2(false));
|
||||
|
||||
define_pd_global(size_t, CodeCacheSegmentSize, 64);
|
||||
define_pd_global(uint, CodeEntryAlignment, 64);
|
||||
|
||||
@ -1,217 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
#include "asm/macroAssembler.hpp"
|
||||
#include "jvmci/jvmci.hpp"
|
||||
#include "jvmci/jvmciCodeInstaller.hpp"
|
||||
#include "jvmci/jvmciRuntime.hpp"
|
||||
#include "jvmci/jvmciCompilerToVM.hpp"
|
||||
#include "jvmci/jvmciJavaClasses.hpp"
|
||||
#include "oops/compressedKlass.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/jniHandles.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "vmreg_aarch64.inline.hpp"
|
||||
#if INCLUDE_ZGC
|
||||
#include "gc/z/zBarrierSetAssembler.hpp"
|
||||
#endif
|
||||
|
||||
jint CodeInstaller::pd_next_offset(NativeInstruction* inst, jint pc_offset, JVMCI_TRAPS) {
|
||||
if (inst->is_call() || inst->is_jump() || inst->is_blr()) {
|
||||
return pc_offset + NativeCall::instruction_size;
|
||||
} else if (inst->is_general_jump()) {
|
||||
return pc_offset + NativeGeneralJump::instruction_size;
|
||||
} else if (NativeInstruction::is_adrp_at((address)inst)) {
|
||||
// adrp; add; blr
|
||||
return pc_offset + 3 * NativeInstruction::instruction_size;
|
||||
} else {
|
||||
JVMCI_ERROR_0("unsupported type of instruction for call site");
|
||||
}
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_patch_OopConstant(int pc_offset, Handle& obj, bool compressed, JVMCI_TRAPS) {
|
||||
address pc = _instructions->start() + pc_offset;
|
||||
#ifdef ASSERT
|
||||
{
|
||||
NativeInstruction *insn = nativeInstruction_at(pc);
|
||||
if (compressed) {
|
||||
// Mov narrow constant: movz n << 16, movk
|
||||
assert(Instruction_aarch64::extract(insn->encoding(), 31, 21) == 0b11010010101 &&
|
||||
nativeInstruction_at(pc+4)->is_movk(), "wrong insn in patch");
|
||||
} else {
|
||||
// Move wide constant: movz n, movk, movk.
|
||||
assert(nativeInstruction_at(pc+4)->is_movk()
|
||||
&& nativeInstruction_at(pc+8)->is_movk(), "wrong insn in patch");
|
||||
}
|
||||
}
|
||||
#endif // ASSERT
|
||||
jobject value = JNIHandles::make_local(obj());
|
||||
MacroAssembler::patch_oop(pc, cast_from_oop<address>(obj()));
|
||||
int oop_index = _oop_recorder->find_index(value);
|
||||
RelocationHolder rspec = oop_Relocation::spec(oop_index);
|
||||
_instructions->relocate(pc, rspec);
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_patch_MetaspaceConstant(int pc_offset, HotSpotCompiledCodeStream* stream, u1 tag, JVMCI_TRAPS) {
|
||||
address pc = _instructions->start() + pc_offset;
|
||||
if (tag == PATCH_NARROW_KLASS) {
|
||||
narrowKlass narrowOop = record_narrow_metadata_reference(_instructions, pc, stream, tag, JVMCI_CHECK);
|
||||
MacroAssembler::patch_narrow_klass(pc, narrowOop);
|
||||
JVMCI_event_3("relocating (narrow metaspace constant) at " PTR_FORMAT "/0x%x", p2i(pc), narrowOop);
|
||||
} else {
|
||||
NativeMovConstReg* move = nativeMovConstReg_at(pc);
|
||||
void* reference = record_metadata_reference(_instructions, pc, stream, tag, JVMCI_CHECK);
|
||||
move->set_data((intptr_t) reference);
|
||||
JVMCI_event_3("relocating (metaspace constant) at " PTR_FORMAT "/" PTR_FORMAT, p2i(pc), p2i(reference));
|
||||
}
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_patch_DataSectionReference(int pc_offset, int data_offset, JVMCI_TRAPS) {
|
||||
address pc = _instructions->start() + pc_offset;
|
||||
NativeInstruction* inst = nativeInstruction_at(pc);
|
||||
if (inst->is_adr_aligned() || inst->is_ldr_literal()
|
||||
|| (NativeInstruction::maybe_cpool_ref(pc))) {
|
||||
address dest = _constants->start() + data_offset;
|
||||
_instructions->relocate(pc, section_word_Relocation::spec((address) dest, CodeBuffer::SECT_CONSTS));
|
||||
JVMCI_event_3("relocating at " PTR_FORMAT " (+%d) with destination at %d", p2i(pc), pc_offset, data_offset);
|
||||
} else {
|
||||
JVMCI_ERROR("unknown load or move instruction at " PTR_FORMAT, p2i(pc));
|
||||
}
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_relocate_ForeignCall(NativeInstruction* inst, jlong foreign_call_destination, JVMCI_TRAPS) {
|
||||
address pc = (address) inst;
|
||||
if (inst->is_call()) {
|
||||
NativeCall* call = nativeCall_at(pc);
|
||||
call->set_destination((address) foreign_call_destination);
|
||||
_instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec());
|
||||
} else if (inst->is_jump()) {
|
||||
NativeJump* jump = nativeJump_at(pc);
|
||||
jump->set_jump_destination((address) foreign_call_destination);
|
||||
_instructions->relocate(jump->instruction_address(), runtime_call_Relocation::spec());
|
||||
} else if (inst->is_general_jump()) {
|
||||
NativeGeneralJump* jump = nativeGeneralJump_at(pc);
|
||||
jump->set_jump_destination((address) foreign_call_destination);
|
||||
_instructions->relocate(jump->instruction_address(), runtime_call_Relocation::spec());
|
||||
} else if (NativeInstruction::is_adrp_at((address)inst)) {
|
||||
// adrp; add; blr
|
||||
MacroAssembler::pd_patch_instruction_size((address)inst,
|
||||
(address)foreign_call_destination);
|
||||
} else {
|
||||
JVMCI_ERROR("unknown call or jump instruction at " PTR_FORMAT, p2i(pc));
|
||||
}
|
||||
JVMCI_event_3("relocating (foreign call) at " PTR_FORMAT, p2i(inst));
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_relocate_JavaMethod(CodeBuffer &cbuf, methodHandle& method, jint pc_offset, JVMCI_TRAPS) {
|
||||
NativeCall* call = nullptr;
|
||||
switch (_next_call_type) {
|
||||
case INLINE_INVOKE:
|
||||
return;
|
||||
case INVOKEVIRTUAL:
|
||||
case INVOKEINTERFACE: {
|
||||
assert(!method->is_static(), "cannot call static method with invokeinterface");
|
||||
call = nativeCall_at(_instructions->start() + pc_offset);
|
||||
_instructions->relocate(call->instruction_address(), virtual_call_Relocation::spec(_invoke_mark_pc));
|
||||
call->trampoline_jump(cbuf, SharedRuntime::get_resolve_virtual_call_stub(), JVMCI_CHECK);
|
||||
break;
|
||||
}
|
||||
case INVOKESTATIC: {
|
||||
assert(method->is_static(), "cannot call non-static method with invokestatic");
|
||||
call = nativeCall_at(_instructions->start() + pc_offset);
|
||||
_instructions->relocate(call->instruction_address(), relocInfo::static_call_type);
|
||||
call->trampoline_jump(cbuf, SharedRuntime::get_resolve_static_call_stub(), JVMCI_CHECK);
|
||||
break;
|
||||
}
|
||||
case INVOKESPECIAL: {
|
||||
assert(!method->is_static(), "cannot call static method with invokespecial");
|
||||
call = nativeCall_at(_instructions->start() + pc_offset);
|
||||
_instructions->relocate(call->instruction_address(), relocInfo::opt_virtual_call_type);
|
||||
call->trampoline_jump(cbuf, SharedRuntime::get_resolve_opt_virtual_call_stub(), JVMCI_CHECK);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
JVMCI_ERROR("invalid _next_call_type value");
|
||||
break;
|
||||
}
|
||||
if (Continuations::enabled()) {
|
||||
// Check for proper post_call_nop
|
||||
NativePostCallNop* nop = nativePostCallNop_at(call->next_instruction_address());
|
||||
if (nop == nullptr) {
|
||||
JVMCI_ERROR("missing post call nop at offset %d", pc_offset);
|
||||
} else {
|
||||
_instructions->relocate(call->next_instruction_address(), relocInfo::post_call_nop_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool CodeInstaller::pd_relocate(address pc, jint mark) {
|
||||
switch (mark) {
|
||||
case POLL_NEAR:
|
||||
// This is unhandled and will be reported by the caller
|
||||
return false;
|
||||
case POLL_FAR:
|
||||
_instructions->relocate(pc, relocInfo::poll_type);
|
||||
return true;
|
||||
case POLL_RETURN_NEAR:
|
||||
// This is unhandled and will be reported by the caller
|
||||
return false;
|
||||
case POLL_RETURN_FAR:
|
||||
_instructions->relocate(pc, relocInfo::poll_return_type);
|
||||
return true;
|
||||
#if INCLUDE_ZGC
|
||||
case Z_BARRIER_RELOCATION_FORMAT_LOAD_GOOD_BEFORE_TB_X:
|
||||
_instructions->relocate(pc, barrier_Relocation::spec(), ZBarrierRelocationFormatLoadGoodBeforeTbX);
|
||||
return true;
|
||||
case Z_BARRIER_RELOCATION_FORMAT_MARK_BAD_BEFORE_MOV:
|
||||
_instructions->relocate(pc, barrier_Relocation::spec(), ZBarrierRelocationFormatMarkBadBeforeMov);
|
||||
return true;
|
||||
case Z_BARRIER_RELOCATION_FORMAT_STORE_GOOD_BEFORE_MOV:
|
||||
_instructions->relocate(pc, barrier_Relocation::spec(), ZBarrierRelocationFormatStoreGoodBeforeMov);
|
||||
return true;
|
||||
case Z_BARRIER_RELOCATION_FORMAT_STORE_BAD_BEFORE_MOV:
|
||||
_instructions->relocate(pc, barrier_Relocation::spec(), ZBarrierRelocationFormatStoreBadBeforeMov);
|
||||
return true;
|
||||
#endif
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// convert JVMCI register indices (as used in oop maps) to HotSpot registers
|
||||
VMReg CodeInstaller::get_hotspot_reg(jint jvmci_reg, JVMCI_TRAPS) {
|
||||
if (jvmci_reg < Register::number_of_registers) {
|
||||
return as_Register(jvmci_reg)->as_VMReg();
|
||||
} else {
|
||||
jint floatRegisterNumber = jvmci_reg - Register::number_of_declared_registers;
|
||||
if (floatRegisterNumber >= 0 && floatRegisterNumber < FloatRegister::number_of_registers) {
|
||||
return as_FloatRegister(floatRegisterNumber)->as_VMReg();
|
||||
}
|
||||
JVMCI_ERROR_NULL("invalid register number: %d", jvmci_reg);
|
||||
}
|
||||
}
|
||||
|
||||
bool CodeInstaller::is_general_purpose_reg(VMReg hotspotRegister) {
|
||||
return !hotspotRegister->is_FloatRegister();
|
||||
}
|
||||
@ -505,21 +505,6 @@ int MacroAssembler::patch_oop(address insn_addr, address o) {
|
||||
return instructions * NativeInstruction::instruction_size;
|
||||
}
|
||||
|
||||
int MacroAssembler::patch_narrow_klass(address insn_addr, narrowKlass n) {
|
||||
// Metadata pointers are either narrow (32 bits) or wide (48 bits).
|
||||
// We encode narrow ones by setting the upper 16 bits in the first
|
||||
// instruction.
|
||||
NativeInstruction *insn = nativeInstruction_at(insn_addr);
|
||||
assert(Instruction_aarch64::extract(insn->encoding(), 31, 21) == 0b11010010101 &&
|
||||
nativeInstruction_at(insn_addr+4)->is_movk(), "wrong insns in patch");
|
||||
|
||||
MACOS_AARCH64_ONLY(os::thread_wx_enable_write());
|
||||
|
||||
Instruction_aarch64::patch(insn_addr, 20, 5, n >> 16);
|
||||
Instruction_aarch64::patch(insn_addr+4, 20, 5, n & 0xffff);
|
||||
return 2 * NativeInstruction::instruction_size;
|
||||
}
|
||||
|
||||
void MacroAssembler::safepoint_poll(Label& slow_path, bool at_return, bool in_nmethod, Register tmp) {
|
||||
ldr(tmp, Address(rthread, JavaThread::polling_word_offset()));
|
||||
if (at_return) {
|
||||
|
||||
@ -693,7 +693,6 @@ public:
|
||||
#endif
|
||||
|
||||
static int patch_oop(address insn_addr, address o);
|
||||
static int patch_narrow_klass(address insn_addr, narrowKlass n);
|
||||
|
||||
// Return whether code is emitted to a scratch blob.
|
||||
virtual bool in_scratch_emit_size() {
|
||||
|
||||
@ -37,9 +37,6 @@
|
||||
#ifdef COMPILER1
|
||||
#include "c1/c1_Runtime1.hpp"
|
||||
#endif
|
||||
#if INCLUDE_JVMCI
|
||||
#include "jvmci/jvmciEnv.hpp"
|
||||
#endif
|
||||
|
||||
void NativeCall::verify() {
|
||||
assert(NativeCall::is_call_at((address)this), "unexpected code at call site");
|
||||
@ -363,30 +360,6 @@ void NativeCallTrampolineStub::set_destination(address new_destination) {
|
||||
OrderAccess::release();
|
||||
}
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
// Generate a trampoline for a branch to dest. If there's no need for a
|
||||
// trampoline, simply patch the call directly to dest.
|
||||
void NativeCall::trampoline_jump(CodeBuffer &cbuf, address dest, JVMCI_TRAPS) {
|
||||
MacroAssembler a(&cbuf);
|
||||
|
||||
if (!a.far_branches()) {
|
||||
// If not using far branches, patch this call directly to dest.
|
||||
set_destination(dest);
|
||||
} else if (!is_NativeCallTrampolineStub_at(instruction_address() + displacement())) {
|
||||
// If we want far branches and there isn't a trampoline stub, emit one.
|
||||
address stub = a.emit_trampoline_stub(instruction_address() - cbuf.insts()->start(), dest);
|
||||
if (stub == nullptr) {
|
||||
JVMCI_ERROR("could not emit trampoline stub - code cache is full");
|
||||
}
|
||||
// The relocation created while emitting the stub will ensure this
|
||||
// call instruction is subsequently patched to call the stub.
|
||||
} else {
|
||||
// Not sure how this can be happen but be defensive
|
||||
JVMCI_ERROR("single-use stub should not exist");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void NativePostCallNop::make_deopt() {
|
||||
NativeDeoptInstruction::insert(addr_at(0));
|
||||
}
|
||||
|
||||
@ -30,9 +30,6 @@
|
||||
#include "runtime/icache.hpp"
|
||||
#include "runtime/os.hpp"
|
||||
#include "runtime/os.hpp"
|
||||
#if INCLUDE_JVMCI
|
||||
#include "jvmci/jvmciExceptions.hpp"
|
||||
#endif
|
||||
|
||||
|
||||
// We have interfaces for the following instructions:
|
||||
@ -215,9 +212,6 @@ public:
|
||||
void set_destination_mt_safe(address dest);
|
||||
|
||||
address get_trampoline();
|
||||
#if INCLUDE_JVMCI
|
||||
void trampoline_jump(CodeBuffer &cbuf, address dest, JVMCI_TRAPS);
|
||||
#endif
|
||||
};
|
||||
|
||||
inline NativeCall* nativeCall_at(address address) {
|
||||
|
||||
@ -61,9 +61,6 @@
|
||||
#include "adfiles/ad_aarch64.hpp"
|
||||
#include "opto/runtime.hpp"
|
||||
#endif
|
||||
#if INCLUDE_JVMCI
|
||||
#include "jvmci/jvmciJavaClasses.hpp"
|
||||
#endif
|
||||
|
||||
#define __ masm->
|
||||
|
||||
@ -120,17 +117,14 @@ int RegisterSaver::reg_offset_in_bytes(Register r) {
|
||||
|
||||
int slots_per_vect = FloatRegister::save_slots_per_register;
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
if (_save_vectors) {
|
||||
slots_per_vect = FloatRegister::slots_per_neon_register;
|
||||
|
||||
#ifdef COMPILER2
|
||||
if (Matcher::supports_scalable_vector()) {
|
||||
slots_per_vect = Matcher::scalable_vector_reg_size(T_FLOAT);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#endif // COMPILER2
|
||||
|
||||
int r0_offset = v0_offset_in_bytes() + (slots_per_vect * FloatRegister::number_of_registers) * BytesPerInt;
|
||||
return r0_offset + r->encoding() * wordSize;
|
||||
@ -170,7 +164,7 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_
|
||||
}
|
||||
#endif
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
if (_save_vectors) {
|
||||
int extra_save_slots_per_register = 0;
|
||||
// Save upper half of vector registers
|
||||
@ -185,8 +179,8 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_
|
||||
additional_frame_words += ((extra_vector_bytes + total_predicate_in_bytes) / wordSize);
|
||||
}
|
||||
#else
|
||||
assert(!_save_vectors, "vectors are generated only by C2 and JVMCI");
|
||||
#endif
|
||||
assert(!_save_vectors, "vectors are generated only by C2");
|
||||
#endif // COMPILER2
|
||||
|
||||
int frame_size_in_bytes = align_up(additional_frame_words * wordSize +
|
||||
reg_save_size * BytesPerInt, 16);
|
||||
@ -241,9 +235,7 @@ void RegisterSaver::restore_live_registers(MacroAssembler* masm) {
|
||||
__ pop_CPU_state(_save_vectors, Matcher::supports_scalable_vector(),
|
||||
Matcher::scalable_vector_reg_size(T_BYTE), total_sve_predicate_in_bytes());
|
||||
#else
|
||||
#if !INCLUDE_JVMCI
|
||||
assert(!_save_vectors, "vectors are generated only by C2 and JVMCI");
|
||||
#endif
|
||||
assert(!_save_vectors, "vectors are generated only by C2");
|
||||
__ pop_CPU_state(_save_vectors);
|
||||
#endif
|
||||
__ ldp(rfp, lr, Address(__ post(sp, 2 * wordSize)));
|
||||
@ -569,18 +561,6 @@ void SharedRuntime::gen_i2c_adapter(MacroAssembler *masm,
|
||||
// Pre-load the register-jump target early, to schedule it better.
|
||||
__ ldr(rscratch1, Address(rmethod, in_bytes(Method::from_compiled_offset())));
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
if (EnableJVMCI) {
|
||||
// check if this call should be routed towards a specific entry point
|
||||
__ ldr(rscratch2, Address(rthread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())));
|
||||
Label no_alternative_target;
|
||||
__ cbz(rscratch2, no_alternative_target);
|
||||
__ mov(rscratch1, rscratch2);
|
||||
__ str(zr, Address(rthread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())));
|
||||
__ bind(no_alternative_target);
|
||||
}
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
// Now generate the shuffle code.
|
||||
for (int i = 0; i < total_args_passed; i++) {
|
||||
if (sig_bt[i] == T_VOID) {
|
||||
@ -2076,11 +2056,6 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
ResourceMark rm;
|
||||
// Setup code generation tools
|
||||
int pad = 0;
|
||||
#if INCLUDE_JVMCI
|
||||
if (EnableJVMCI) {
|
||||
pad += 512; // Increase the buffer size when compiling for JVMCI
|
||||
}
|
||||
#endif
|
||||
const char* name = SharedRuntime::stub_name(StubId::shared_deopt_id);
|
||||
CodeBlob* blob = AOTCodeCache::load_code_blob(AOTCodeEntry::SharedBlob, BlobId::shared_deopt_id);
|
||||
if (blob != nullptr) {
|
||||
@ -2093,7 +2068,7 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
int frame_size_in_words;
|
||||
OopMap* map = nullptr;
|
||||
OopMapSet *oop_maps = new OopMapSet();
|
||||
RegisterSaver reg_save(COMPILER2_OR_JVMCI != 0);
|
||||
RegisterSaver reg_save(COMPILER2_PRESENT(true) NOT_COMPILER2(false));
|
||||
|
||||
// -------------
|
||||
// This code enters when returning to a de-optimized nmethod. A return
|
||||
@ -2138,13 +2113,6 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
__ b(cont);
|
||||
|
||||
int reexecute_offset = __ pc() - start;
|
||||
#if INCLUDE_JVMCI && !defined(COMPILER1)
|
||||
if (UseJVMCICompiler) {
|
||||
// JVMCI does not use this kind of deoptimization
|
||||
__ should_not_reach_here();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Reexecute case
|
||||
// return address is the pc describes what bci to do re-execute at
|
||||
|
||||
@ -2154,45 +2122,6 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
__ movw(rcpool, Deoptimization::Unpack_reexecute); // callee-saved
|
||||
__ b(cont);
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
Label after_fetch_unroll_info_call;
|
||||
int implicit_exception_uncommon_trap_offset = 0;
|
||||
int uncommon_trap_offset = 0;
|
||||
|
||||
if (EnableJVMCI) {
|
||||
implicit_exception_uncommon_trap_offset = __ pc() - start;
|
||||
|
||||
__ ldr(lr, Address(rthread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())));
|
||||
__ str(zr, Address(rthread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())));
|
||||
|
||||
uncommon_trap_offset = __ pc() - start;
|
||||
|
||||
// Save everything in sight.
|
||||
reg_save.save_live_registers(masm, 0, &frame_size_in_words);
|
||||
// fetch_unroll_info needs to call last_java_frame()
|
||||
Label retaddr;
|
||||
__ set_last_Java_frame(sp, noreg, retaddr, rscratch1);
|
||||
|
||||
__ ldrw(c_rarg1, Address(rthread, in_bytes(JavaThread::pending_deoptimization_offset())));
|
||||
__ movw(rscratch1, -1);
|
||||
__ strw(rscratch1, Address(rthread, in_bytes(JavaThread::pending_deoptimization_offset())));
|
||||
|
||||
__ movw(rcpool, (int32_t)Deoptimization::Unpack_reexecute);
|
||||
__ mov(c_rarg0, rthread);
|
||||
__ movw(c_rarg2, rcpool); // exec mode
|
||||
__ lea(rscratch1,
|
||||
RuntimeAddress(CAST_FROM_FN_PTR(address,
|
||||
Deoptimization::uncommon_trap)));
|
||||
__ blr(rscratch1);
|
||||
__ bind(retaddr);
|
||||
oop_maps->add_gc_map( __ pc()-start, map->deep_copy());
|
||||
|
||||
__ reset_last_Java_frame(false);
|
||||
|
||||
__ b(after_fetch_unroll_info_call);
|
||||
} // EnableJVMCI
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
int exception_offset = __ pc() - start;
|
||||
|
||||
// Prolog for exception case
|
||||
@ -2283,12 +2212,6 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
|
||||
__ reset_last_Java_frame(false);
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
if (EnableJVMCI) {
|
||||
__ bind(after_fetch_unroll_info_call);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Load UnrollBlock* into r5
|
||||
__ mov(r5, r0);
|
||||
|
||||
@ -2445,12 +2368,6 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
|
||||
_deopt_blob = DeoptimizationBlob::create(&buffer, oop_maps, 0, exception_offset, reexecute_offset, frame_size_in_words);
|
||||
_deopt_blob->set_unpack_with_exception_in_tls_offset(exception_in_tls_offset);
|
||||
#if INCLUDE_JVMCI
|
||||
if (EnableJVMCI) {
|
||||
_deopt_blob->set_uncommon_trap_offset(uncommon_trap_offset);
|
||||
_deopt_blob->set_implicit_exception_uncommon_trap_offset(implicit_exception_uncommon_trap_offset);
|
||||
}
|
||||
#endif
|
||||
|
||||
AOTCodeCache::store_code_blob(*_deopt_blob, AOTCodeEntry::SharedBlob, BlobId::shared_deopt_id);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2025, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -12636,7 +12636,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
}
|
||||
|
||||
void generate_compiler_stubs() {
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
|
||||
if (UseSVE == 0) {
|
||||
generate_iota_indices(StubId::stubgen_vector_iota_indices_id);
|
||||
@ -12664,7 +12664,6 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
generate_string_indexof_stubs();
|
||||
|
||||
#ifdef COMPILER2
|
||||
if (UseMultiplyToLenIntrinsic) {
|
||||
StubRoutines::_multiplyToLen = generate_multiplyToLen();
|
||||
}
|
||||
@ -12712,8 +12711,6 @@ class StubGenerator: public StubCodeGenerator {
|
||||
StubRoutines::_montgomerySquare = start;
|
||||
}
|
||||
|
||||
#endif // COMPILER2
|
||||
|
||||
if (UseChaCha20Intrinsics) {
|
||||
StubRoutines::_chacha20Block = generate_chacha20Block_blockpar();
|
||||
}
|
||||
@ -12795,7 +12792,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
StubRoutines::_updateBytesAdler32 = generate_updateBytesAdler32();
|
||||
}
|
||||
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -48,9 +48,6 @@ enum platform_dependent_constants {
|
||||
class aarch64 {
|
||||
friend class StubGenerator;
|
||||
friend class StubRoutines;
|
||||
#if INCLUDE_JVMCI
|
||||
friend class JVMCIVMStructs;
|
||||
#endif
|
||||
|
||||
// declare fields for arch-specific entries
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -524,30 +524,6 @@ address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state,
|
||||
// null last_sp until next java call
|
||||
__ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
// Check if we need to take lock at entry of synchronized method. This can
|
||||
// only occur on method entry so emit it only for vtos with step 0.
|
||||
if (EnableJVMCI && state == vtos && step == 0) {
|
||||
Label L;
|
||||
__ ldrb(rscratch1, Address(rthread, JavaThread::pending_monitorenter_offset()));
|
||||
__ cbz(rscratch1, L);
|
||||
// Clear flag.
|
||||
__ strb(zr, Address(rthread, JavaThread::pending_monitorenter_offset()));
|
||||
// Take lock.
|
||||
lock_method();
|
||||
__ bind(L);
|
||||
} else {
|
||||
#ifdef ASSERT
|
||||
if (EnableJVMCI) {
|
||||
Label L;
|
||||
__ ldrb(rscratch1, Address(rthread, JavaThread::pending_monitorenter_offset()));
|
||||
__ cbz(rscratch1, L);
|
||||
__ stop("unexpected pending monitor in deopt entry");
|
||||
__ bind(L);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
// handle exceptions
|
||||
{
|
||||
Label L;
|
||||
|
||||
@ -2622,7 +2622,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
|
||||
// membar it's possible for a simple Dekker test to fail if loads
|
||||
// use LDR;DMB but stores use STLR. This can happen if C2 compiles
|
||||
// the stores in one method and we interpret the loads in another.
|
||||
if (!CompilerConfig::is_c1_or_interpreter_only_no_jvmci()){
|
||||
if (!CompilerConfig::is_c1_or_interpreter_only()){
|
||||
Label notVolatile;
|
||||
__ tbz(flags, ResolvedFieldEntry::is_volatile_shift, notVolatile);
|
||||
__ membar(MacroAssembler::AnyAny);
|
||||
@ -3200,7 +3200,7 @@ void TemplateTable::fast_accessfield(TosState state)
|
||||
// membar it's possible for a simple Dekker test to fail if loads
|
||||
// use LDR;DMB but stores use STLR. This can happen if C2 compiles
|
||||
// the stores in one method and we interpret the loads in another.
|
||||
if (!CompilerConfig::is_c1_or_interpreter_only_no_jvmci()) {
|
||||
if (!CompilerConfig::is_c1_or_interpreter_only()) {
|
||||
Label notVolatile;
|
||||
__ tbz(r3, ResolvedFieldEntry::is_volatile_shift, notVolatile);
|
||||
__ membar(MacroAssembler::AnyAny);
|
||||
@ -3263,7 +3263,7 @@ void TemplateTable::fast_xaccess(TosState state)
|
||||
// membar it's possible for a simple Dekker test to fail if loads
|
||||
// use LDR;DMB but stores use STLR. This can happen if C2 compiles
|
||||
// the stores in one method and we interpret the loads in another.
|
||||
if (!CompilerConfig::is_c1_or_interpreter_only_no_jvmci()) {
|
||||
if (!CompilerConfig::is_c1_or_interpreter_only()) {
|
||||
Label notVolatile;
|
||||
__ load_unsigned_byte(r3, Address(r2, in_bytes(ResolvedFieldEntry::flags_offset())));
|
||||
__ tbz(r3, ResolvedFieldEntry::is_volatile_shift, notVolatile);
|
||||
|
||||
@ -38,7 +38,6 @@ class stringStream;
|
||||
|
||||
class VM_Version : public Abstract_VM_Version {
|
||||
friend class VMStructs;
|
||||
friend class JVMCIVMStructs;
|
||||
|
||||
protected:
|
||||
static int _cpu;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -32,7 +32,7 @@
|
||||
#include "runtime/safepoint.hpp"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
#define __ masm->
|
||||
// emit call stub, compiled java to interpreter
|
||||
address CompiledDirectCall::emit_to_interp_stub(MacroAssembler *masm, address mark) {
|
||||
@ -86,7 +86,7 @@ address CompiledDirectCall::emit_to_interp_stub(MacroAssembler *masm, address ma
|
||||
int CompiledDirectCall::reloc_to_interp_stub() {
|
||||
return 10; // 4 in emit_to_interp_stub + 1 in Java_Static_Call
|
||||
}
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
|
||||
int CompiledDirectCall::to_trampoline_stub_size() {
|
||||
// ARM doesn't use trampolines.
|
||||
|
||||
@ -1,70 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "jvmci/jvmciCodeInstaller.hpp"
|
||||
#include "jvmci/jvmciRuntime.hpp"
|
||||
#include "jvmci/jvmciCompilerToVM.hpp"
|
||||
#include "jvmci/jvmciJavaClasses.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "vmreg_arm.inline.hpp"
|
||||
|
||||
jint CodeInstaller::pd_next_offset(NativeInstruction* inst, jint pc_offset, Handle method, TRAPS) {
|
||||
Unimplemented();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_patch_OopConstant(int pc_offset, Handle constant, TRAPS) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_patch_MetaspaceConstant(int pc_offset, Handle constant, TRAPS) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_patch_DataSectionReference(int pc_offset, int data_offset, TRAPS) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_relocate_ForeignCall(NativeInstruction* inst, jlong foreign_call_destination, TRAPS) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_relocate_JavaMethod(CodeBuffer &cbuf, Handle hotspot_method, jint pc_offset, TRAPS) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_relocate_poll(address pc, jint mark, TRAPS) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
// convert JVMCI register indices (as used in oop maps) to HotSpot registers
|
||||
VMReg CodeInstaller::get_hotspot_reg(jint jvmci_reg, TRAPS) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool CodeInstaller::is_general_purpose_reg(VMReg hotspotRegister) {
|
||||
return false;
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -29,8 +29,6 @@
|
||||
#include "runtime/globals_extension.hpp"
|
||||
|
||||
class VM_Version: public Abstract_VM_Version {
|
||||
friend class JVMCIVMStructs;
|
||||
|
||||
static bool _has_simd;
|
||||
static bool _has_mp_ext;
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ define_pd_global(bool, ImplicitNullChecks, true); // Generate code for impli
|
||||
define_pd_global(bool, TrapBasedNullChecks, true);
|
||||
define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap nulls passed to check cast.
|
||||
|
||||
define_pd_global(bool, DelayCompilerStubsGeneration, COMPILER2_OR_JVMCI);
|
||||
define_pd_global(bool, DelayCompilerStubsGeneration, COMPILER2_PRESENT(true) NOT_COMPILER2(false));
|
||||
|
||||
#define DEFAULT_STACK_YELLOW_PAGES (2)
|
||||
#define DEFAULT_STACK_RED_PAGES (1)
|
||||
|
||||
@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
#include "jvmci/jvmciCodeInstaller.hpp"
|
||||
#include "jvmci/jvmciRuntime.hpp"
|
||||
#include "jvmci/jvmciCompilerToVM.hpp"
|
||||
#include "jvmci/jvmciJavaClasses.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "vmreg_ppc.inline.hpp"
|
||||
|
||||
jint CodeInstaller::pd_next_offset(NativeInstruction* inst, jint pc_offset, Handle method, TRAPS) {
|
||||
Unimplemented();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_patch_OopConstant(int pc_offset, Handle constant, TRAPS) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_patch_MetaspaceConstant(int pc_offset, Handle constant, TRAPS) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_patch_DataSectionReference(int pc_offset, int data_offset, TRAPS) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_relocate_ForeignCall(NativeInstruction* inst, jlong foreign_call_destination, TRAPS) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_relocate_JavaMethod(Handle hotspot_method, jint pc_offset, TRAPS) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_relocate_poll(address pc, jint mark, TRAPS) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
// convert JVMCI register indices (as used in oop maps) to HotSpot registers
|
||||
VMReg CodeInstaller::get_hotspot_reg(jint jvmci_reg, TRAPS) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool CodeInstaller::is_general_purpose_reg(VMReg hotspotRegister) {
|
||||
return false;
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -5038,9 +5038,8 @@ void generate_lookup_secondary_supers_table_stub() {
|
||||
}
|
||||
|
||||
void generate_compiler_stubs() {
|
||||
#if COMPILER2_OR_JVMCI
|
||||
|
||||
#ifdef COMPILER2
|
||||
|
||||
if (UseMultiplyToLenIntrinsic) {
|
||||
StubRoutines::_multiplyToLen = generate_multiplyToLen();
|
||||
}
|
||||
@ -5058,7 +5057,6 @@ void generate_lookup_secondary_supers_table_stub() {
|
||||
StubRoutines::_montgomerySquare
|
||||
= CAST_FROM_FN_PTR(address, SharedRuntime::montgomery_square);
|
||||
}
|
||||
#endif
|
||||
|
||||
// data cache line writeback
|
||||
if (VM_Version::supports_data_cache_line_flush()) {
|
||||
@ -5091,7 +5089,7 @@ void generate_lookup_secondary_supers_table_stub() {
|
||||
StubRoutines::_base64_encodeBlock = generate_base64_encodeBlock();
|
||||
}
|
||||
#endif
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
@ -35,9 +35,6 @@
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "utilities/align.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
#if INCLUDE_JVMCI
|
||||
#include "jvmci/jvmciRuntime.hpp"
|
||||
#endif
|
||||
|
||||
static int slow_path_size(nmethod* nm) {
|
||||
// The slow path code is out of line with C2.
|
||||
@ -74,38 +71,26 @@ class NativeNMethodBarrier {
|
||||
|
||||
public:
|
||||
NativeNMethodBarrier(nmethod* nm): _nm(nm) {
|
||||
#if INCLUDE_JVMCI
|
||||
if (nm->is_compiled_by_jvmci()) {
|
||||
address pc = nm->code_begin() + nm->jvmci_nmethod_data()->nmethod_entry_patch_offset();
|
||||
RelocIterator iter(nm, pc, pc + 4);
|
||||
guarantee(iter.next(), "missing relocs");
|
||||
guarantee(iter.type() == relocInfo::section_word_type, "unexpected reloc");
|
||||
|
||||
_guard_addr = (int*) iter.section_word_reloc()->target();
|
||||
_instruction_address = pc;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
_instruction_address = nm->code_begin() + nm->frame_complete_offset() + entry_barrier_offset(nm);
|
||||
if (nm->is_compiled_by_c2()) {
|
||||
// With c2 compiled code, the guard is out-of-line in a stub
|
||||
// We find it using the RelocIterator.
|
||||
RelocIterator iter(nm);
|
||||
while (iter.next()) {
|
||||
if (iter.type() == relocInfo::entry_guard_type) {
|
||||
entry_guard_Relocation* const reloc = iter.entry_guard_reloc();
|
||||
_guard_addr = reinterpret_cast<int*>(reloc->addr());
|
||||
return;
|
||||
}
|
||||
}
|
||||
ShouldNotReachHere();
|
||||
_instruction_address = nm->code_begin() + nm->frame_complete_offset() + entry_barrier_offset(nm);
|
||||
if (nm->is_compiled_by_c2()) {
|
||||
// With c2 compiled code, the guard is out-of-line in a stub
|
||||
// We find it using the RelocIterator.
|
||||
RelocIterator iter(nm);
|
||||
while (iter.next()) {
|
||||
if (iter.type() == relocInfo::entry_guard_type) {
|
||||
entry_guard_Relocation* const reloc = iter.entry_guard_reloc();
|
||||
_guard_addr = reinterpret_cast<int*>(reloc->addr());
|
||||
return;
|
||||
}
|
||||
_guard_addr = reinterpret_cast<int*>(instruction_address() + local_guard_offset(nm));
|
||||
}
|
||||
|
||||
// Perform the checking as verification.
|
||||
err_msg msg("%s", "");
|
||||
assert(check_barrier(msg), "%s", msg.buffer());
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
_guard_addr = reinterpret_cast<int*>(instruction_address() + local_guard_offset(nm));
|
||||
|
||||
// Perform the checking as verification.
|
||||
err_msg msg("%s", "");
|
||||
assert(check_barrier(msg), "%s", msg.buffer());
|
||||
}
|
||||
|
||||
int get_value() {
|
||||
@ -234,10 +219,3 @@ int BarrierSetNMethod::guard_value(nmethod* nm) {
|
||||
NativeNMethodBarrier barrier(nm);
|
||||
return barrier.get_value();
|
||||
}
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
bool BarrierSetNMethod::verify_barrier(nmethod* nm, err_msg& msg) {
|
||||
NativeNMethodBarrier barrier(nm);
|
||||
return barrier.check_barrier(msg);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -36,7 +36,7 @@ define_pd_global(bool, ImplicitNullChecks, true); // Generate code for im
|
||||
define_pd_global(bool, TrapBasedNullChecks, false);
|
||||
define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap nulls past to check cast
|
||||
|
||||
define_pd_global(bool, DelayCompilerStubsGeneration, COMPILER2_OR_JVMCI);
|
||||
define_pd_global(bool, DelayCompilerStubsGeneration, COMPILER2_PRESENT(true) NOT_COMPILER2(false));
|
||||
|
||||
define_pd_global(size_t, CodeCacheSegmentSize, 64 COMPILER1_AND_COMPILER2_PRESENT(+64)); // Tiered compilation has large code-entry alignment.
|
||||
define_pd_global(uint, CodeEntryAlignment, 64);
|
||||
|
||||
@ -1,127 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "asm/macroAssembler.hpp"
|
||||
#include "jvmci/jvmci.hpp"
|
||||
#include "jvmci/jvmciCodeInstaller.hpp"
|
||||
#include "jvmci/jvmciRuntime.hpp"
|
||||
#include "jvmci/jvmciCompilerToVM.hpp"
|
||||
#include "jvmci/jvmciJavaClasses.hpp"
|
||||
#include "oops/compressedKlass.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/jniHandles.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "vmreg_riscv.inline.hpp"
|
||||
|
||||
jint CodeInstaller::pd_next_offset(NativeInstruction* inst, jint pc_offset, JVMCI_TRAPS) {
|
||||
address pc = (address) inst;
|
||||
if (inst->is_call()) {
|
||||
return pc_offset + NativeCall::byte_size();
|
||||
} else if (inst->is_jump()) {
|
||||
return pc_offset + NativeJump::instruction_size;
|
||||
} else if (inst->is_movptr1()) {
|
||||
return pc_offset + NativeMovConstReg::movptr1_instruction_size;
|
||||
} else if (inst->is_movptr2()) {
|
||||
return pc_offset + NativeMovConstReg::movptr2_instruction_size;
|
||||
} else {
|
||||
JVMCI_ERROR_0("unsupported type of instruction for call site");
|
||||
}
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_patch_OopConstant(int pc_offset, Handle& obj, bool compressed, JVMCI_TRAPS) {
|
||||
address pc = _instructions->start() + pc_offset;
|
||||
jobject value = JNIHandles::make_local(obj());
|
||||
MacroAssembler::patch_oop(pc, cast_from_oop<address>(obj()));
|
||||
int oop_index = _oop_recorder->find_index(value);
|
||||
RelocationHolder rspec = oop_Relocation::spec(oop_index);
|
||||
_instructions->relocate(pc, rspec);
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_patch_MetaspaceConstant(int pc_offset, HotSpotCompiledCodeStream* stream, u1 tag, JVMCI_TRAPS) {
|
||||
address pc = _instructions->start() + pc_offset;
|
||||
if (tag == PATCH_NARROW_KLASS) {
|
||||
narrowKlass narrowOop = record_narrow_metadata_reference(_instructions, pc, stream, tag, JVMCI_CHECK);
|
||||
MacroAssembler::pd_patch_instruction_size(pc, (address) (long) narrowOop);
|
||||
JVMCI_event_3("relocating (narrow metaspace constant) at " PTR_FORMAT "/0x%x", p2i(pc), narrowOop);
|
||||
} else {
|
||||
NativeMovConstReg* move = nativeMovConstReg_at(pc);
|
||||
void* reference = record_metadata_reference(_instructions, pc, stream, tag, JVMCI_CHECK);
|
||||
move->set_data((intptr_t) reference);
|
||||
JVMCI_event_3("relocating (metaspace constant) at " PTR_FORMAT "/" PTR_FORMAT, p2i(pc), p2i(reference));
|
||||
}
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_patch_DataSectionReference(int pc_offset, int data_offset, JVMCI_TRAPS) {
|
||||
address pc = _instructions->start() + pc_offset;
|
||||
address dest = _constants->start() + data_offset;
|
||||
_instructions->relocate(pc, section_word_Relocation::spec((address) dest, CodeBuffer::SECT_CONSTS));
|
||||
JVMCI_event_3("relocating at " PTR_FORMAT " (+%d) with destination at %d", p2i(pc), pc_offset, data_offset);
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_relocate_ForeignCall(NativeInstruction* inst, jlong foreign_call_destination, JVMCI_TRAPS) {
|
||||
address pc = (address) inst;
|
||||
if (inst->is_jal()) {
|
||||
NativeCall* call = nativeCall_at(pc);
|
||||
call->set_destination((address) foreign_call_destination);
|
||||
_instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec());
|
||||
} else if (inst->is_jump()) {
|
||||
NativeJump* jump = nativeJump_at(pc);
|
||||
jump->set_jump_destination((address) foreign_call_destination);
|
||||
_instructions->relocate(jump->instruction_address(), runtime_call_Relocation::spec());
|
||||
} else if (inst->is_movptr()) {
|
||||
NativeMovConstReg* movptr = nativeMovConstReg_at(pc);
|
||||
movptr->set_data((intptr_t) foreign_call_destination);
|
||||
_instructions->relocate(movptr->instruction_address(), runtime_call_Relocation::spec());
|
||||
} else {
|
||||
JVMCI_ERROR("unknown call or jump instruction at " PTR_FORMAT, p2i(pc));
|
||||
}
|
||||
JVMCI_event_3("relocating (foreign call) at " PTR_FORMAT, p2i(inst));
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_relocate_JavaMethod(CodeBuffer &cbuf, methodHandle& method, jint pc_offset, JVMCI_TRAPS) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
bool CodeInstaller::pd_relocate(address pc, jint mark) {
|
||||
Unimplemented();
|
||||
return false;
|
||||
}
|
||||
|
||||
// convert JVMCI register indices (as used in oop maps) to HotSpot registers
|
||||
VMReg CodeInstaller::get_hotspot_reg(jint jvmci_reg, JVMCI_TRAPS) {
|
||||
if (jvmci_reg < Register::number_of_registers) {
|
||||
return as_Register(jvmci_reg)->as_VMReg();
|
||||
} else {
|
||||
jint floatRegisterNumber = jvmci_reg - Register::number_of_registers;
|
||||
if (floatRegisterNumber >= 0 && floatRegisterNumber < FloatRegister::number_of_registers) {
|
||||
return as_FloatRegister(floatRegisterNumber)->as_VMReg();
|
||||
}
|
||||
JVMCI_ERROR_NULL("invalid register number: %d", jvmci_reg);
|
||||
}
|
||||
}
|
||||
|
||||
bool CodeInstaller::is_general_purpose_reg(VMReg hotspotRegister) {
|
||||
return !(hotspotRegister->is_FloatRegister() || hotspotRegister->is_VectorRegister());
|
||||
}
|
||||
@ -59,9 +59,6 @@
|
||||
#include "adfiles/ad_riscv.hpp"
|
||||
#include "opto/runtime.hpp"
|
||||
#endif
|
||||
#if INCLUDE_JVMCI
|
||||
#include "jvmci/jvmciJavaClasses.hpp"
|
||||
#endif
|
||||
|
||||
#define __ masm->
|
||||
|
||||
@ -202,11 +199,9 @@ void RegisterSaver::restore_live_registers(MacroAssembler* masm) {
|
||||
#ifdef COMPILER2
|
||||
__ pop_CPU_state(_save_vectors, Matcher::scalable_vector_reg_size(T_BYTE));
|
||||
#else
|
||||
#if !INCLUDE_JVMCI
|
||||
assert(!_save_vectors, "vectors are generated only by C2 and JVMCI");
|
||||
#endif
|
||||
assert(!_save_vectors, "vectors are generated only by C2");
|
||||
__ pop_CPU_state(_save_vectors);
|
||||
#endif
|
||||
#endif // COMPILER2
|
||||
__ leave();
|
||||
}
|
||||
|
||||
@ -492,18 +487,6 @@ void SharedRuntime::gen_i2c_adapter(MacroAssembler *masm,
|
||||
// Pre-load the register-jump target early, to schedule it better.
|
||||
__ ld(t1, Address(xmethod, in_bytes(Method::from_compiled_offset())));
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
if (EnableJVMCI) {
|
||||
// check if this call should be routed towards a specific entry point
|
||||
__ ld(t0, Address(xthread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())));
|
||||
Label no_alternative_target;
|
||||
__ beqz(t0, no_alternative_target);
|
||||
__ mv(t1, t0);
|
||||
__ sd(zr, Address(xthread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())));
|
||||
__ bind(no_alternative_target);
|
||||
}
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
// Now generate the shuffle code.
|
||||
for (int i = 0; i < total_args_passed; i++) {
|
||||
if (sig_bt[i] == T_VOID) {
|
||||
@ -1995,11 +1978,6 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
ResourceMark rm;
|
||||
// Setup code generation tools
|
||||
int pad = 0;
|
||||
#if INCLUDE_JVMCI
|
||||
if (EnableJVMCI) {
|
||||
pad += 512; // Increase the buffer size when compiling for JVMCI
|
||||
}
|
||||
#endif
|
||||
const char* name = SharedRuntime::stub_name(StubId::shared_deopt_id);
|
||||
CodeBuffer buffer(name, 2048 + pad, 1024);
|
||||
MacroAssembler* masm = new MacroAssembler(&buffer);
|
||||
@ -2007,7 +1985,7 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
OopMap* map = nullptr;
|
||||
OopMapSet *oop_maps = new OopMapSet();
|
||||
assert_cond(masm != nullptr && oop_maps != nullptr);
|
||||
RegisterSaver reg_saver(COMPILER2_OR_JVMCI != 0);
|
||||
RegisterSaver reg_saver(COMPILER2_PRESENT(true) NOT_COMPILER2(false));
|
||||
|
||||
// -------------
|
||||
// This code enters when returning to a de-optimized nmethod. A return
|
||||
@ -2052,13 +2030,6 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
__ j(cont);
|
||||
|
||||
int reexecute_offset = __ pc() - start;
|
||||
#if INCLUDE_JVMCI && !defined(COMPILER1)
|
||||
if (UseJVMCICompiler) {
|
||||
// JVMCI does not use this kind of deoptimization
|
||||
__ should_not_reach_here();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Reexecute case
|
||||
// return address is the pc describes what bci to do re-execute at
|
||||
|
||||
@ -2068,42 +2039,6 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
__ mv(xcpool, Deoptimization::Unpack_reexecute); // callee-saved
|
||||
__ j(cont);
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
Label after_fetch_unroll_info_call;
|
||||
int implicit_exception_uncommon_trap_offset = 0;
|
||||
int uncommon_trap_offset = 0;
|
||||
|
||||
if (EnableJVMCI) {
|
||||
implicit_exception_uncommon_trap_offset = __ pc() - start;
|
||||
|
||||
__ ld(ra, Address(xthread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())));
|
||||
__ sd(zr, Address(xthread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())));
|
||||
|
||||
uncommon_trap_offset = __ pc() - start;
|
||||
|
||||
// Save everything in sight.
|
||||
reg_saver.save_live_registers(masm, 0, &frame_size_in_words);
|
||||
// fetch_unroll_info needs to call last_java_frame()
|
||||
Label retaddr;
|
||||
__ set_last_Java_frame(sp, noreg, retaddr, t0);
|
||||
|
||||
__ lw(c_rarg1, Address(xthread, in_bytes(JavaThread::pending_deoptimization_offset())));
|
||||
__ mv(t0, -1);
|
||||
__ sw(t0, Address(xthread, in_bytes(JavaThread::pending_deoptimization_offset())));
|
||||
|
||||
__ mv(xcpool, Deoptimization::Unpack_reexecute);
|
||||
__ mv(c_rarg0, xthread);
|
||||
__ orrw(c_rarg2, zr, xcpool); // exec mode
|
||||
__ rt_call(CAST_FROM_FN_PTR(address, Deoptimization::uncommon_trap));
|
||||
__ bind(retaddr);
|
||||
oop_maps->add_gc_map( __ pc()-start, map->deep_copy());
|
||||
|
||||
__ reset_last_Java_frame(false);
|
||||
|
||||
__ j(after_fetch_unroll_info_call);
|
||||
} // EnableJVMCI
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
int exception_offset = __ pc() - start;
|
||||
|
||||
// Prolog for exception case
|
||||
@ -2195,12 +2130,6 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
|
||||
__ reset_last_Java_frame(false);
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
if (EnableJVMCI) {
|
||||
__ bind(after_fetch_unroll_info_call);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Load UnrollBlock* into x15
|
||||
__ mv(x15, x10);
|
||||
|
||||
@ -2354,12 +2283,6 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
_deopt_blob = DeoptimizationBlob::create(&buffer, oop_maps, 0, exception_offset, reexecute_offset, frame_size_in_words);
|
||||
assert(_deopt_blob != nullptr, "create deoptimization blob fail!");
|
||||
_deopt_blob->set_unpack_with_exception_in_tls_offset(exception_in_tls_offset);
|
||||
#if INCLUDE_JVMCI
|
||||
if (EnableJVMCI) {
|
||||
_deopt_blob->set_uncommon_trap_offset(uncommon_trap_offset);
|
||||
_deopt_blob->set_implicit_exception_uncommon_trap_offset(implicit_exception_uncommon_trap_offset);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Number of stack slots between incoming argument block and the start of
|
||||
|
||||
@ -4754,7 +4754,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
return start;
|
||||
}
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
|
||||
#undef __
|
||||
#define __ this->
|
||||
@ -6782,7 +6782,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
return start;
|
||||
}
|
||||
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
|
||||
// x10 = input (float16)
|
||||
// f10 = result (float)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
@ -49,9 +49,6 @@ enum platform_dependent_constants {
|
||||
class riscv {
|
||||
friend class StubGenerator;
|
||||
friend class StubRoutines;
|
||||
#if INCLUDE_JVMCI
|
||||
friend class JVMCIVMStructs;
|
||||
#endif
|
||||
|
||||
// declare fields for arch-specific entries
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ define_pd_global(bool, ImplicitNullChecks, true); // Generate code fo
|
||||
define_pd_global(bool, TrapBasedNullChecks, true);
|
||||
define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap nulls passed to check cast.
|
||||
|
||||
define_pd_global(bool, DelayCompilerStubsGeneration, COMPILER2_OR_JVMCI);
|
||||
define_pd_global(bool, DelayCompilerStubsGeneration, COMPILER2_PRESENT(true) NOT_COMPILER2(false));
|
||||
|
||||
define_pd_global(size_t, CodeCacheSegmentSize, 256);
|
||||
// This shall be at least 32 for proper branch target alignment.
|
||||
|
||||
@ -1,87 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
// JVMCI (JEP 243):
|
||||
// So far, the JVMCI is not supported/implemented on SAP platforms.
|
||||
// This file just serves as a placeholder which may be filled with life
|
||||
// should the JVMCI ever be implemented.
|
||||
#if INCLUDE_JVMCI
|
||||
|
||||
#include "jvmci/jvmciCodeInstaller.hpp"
|
||||
#include "jvmci/jvmciRuntime.hpp"
|
||||
#include "jvmci/jvmciCompilerToVM.hpp"
|
||||
#include "jvmci/jvmciJavaClasses.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "vmreg_s390.inline.hpp"
|
||||
|
||||
jint CodeInstaller::pd_next_offset(NativeInstruction* inst, jint pc_offset, oop method) {
|
||||
Unimplemented();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_patch_OopConstant(int pc_offset, Handle& constant) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_patch_MetaspaceConstant(int pc_offset, Handle& constant) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_patch_DataSectionReference(int pc_offset, int data_offset) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_patch_DataSectionReference(int pc_offset, int data_offset) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_relocate_CodeBlob(CodeBlob* cb, NativeInstruction* inst) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_relocate_ForeignCall(NativeInstruction* inst, jlong foreign_call_destination) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_relocate_JavaMethod(oop hotspot_method, jint pc_offset) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_relocate_poll(address pc, jint mark) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
// Convert JVMCI register indices (as used in oop maps) to HotSpot registers.
|
||||
VMReg CodeInstaller::get_hotspot_reg(jint jvmci_reg) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool CodeInstaller::is_general_purpose_reg(VMReg hotspotRegister) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // INLCUDE_JVMCI
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2024 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -3361,7 +3361,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
StubRoutines::zarch::_partial_subtype_check = generate_partial_subtype_check();
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
// Generate AES intrinsics code.
|
||||
if (UseAESIntrinsics) {
|
||||
if (VM_Version::has_Crypto_AES()) {
|
||||
@ -3405,7 +3405,6 @@ class StubGenerator: public StubCodeGenerator {
|
||||
StubRoutines::_sha512_implCompressMB = generate_SHA512_stub(StubId::stubgen_sha512_implCompressMB_id);
|
||||
}
|
||||
|
||||
#ifdef COMPILER2
|
||||
if (UseMultiplyToLenIntrinsic) {
|
||||
StubRoutines::_multiplyToLen = generate_multiplyToLen();
|
||||
}
|
||||
@ -3417,8 +3416,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
StubRoutines::_montgomerySquare
|
||||
= CAST_FROM_FN_PTR(address, SharedRuntime::montgomery_square);
|
||||
}
|
||||
#endif
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -453,11 +453,11 @@ frame frame::sender_for_interpreter_frame(RegisterMap* map) const {
|
||||
intptr_t* unextended_sp = interpreter_frame_sender_sp();
|
||||
intptr_t* sender_fp = link();
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
if (map->update_map()) {
|
||||
update_map_with_saved_link(map, (intptr_t**) addr_at(link_offset));
|
||||
}
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
|
||||
address sender_pc = this->sender_pc();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -33,9 +33,6 @@
|
||||
#include "utilities/debug.hpp"
|
||||
#include "utilities/formatBuffer.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
#if INCLUDE_JVMCI
|
||||
#include "jvmci/jvmciRuntime.hpp"
|
||||
#endif
|
||||
|
||||
class NativeNMethodCmpBarrier: public NativeInstruction {
|
||||
public:
|
||||
@ -167,16 +164,7 @@ static int entry_barrier_offset(nmethod* nm) {
|
||||
}
|
||||
|
||||
static NativeNMethodCmpBarrier* native_nmethod_barrier(nmethod* nm) {
|
||||
address barrier_address;
|
||||
#if INCLUDE_JVMCI
|
||||
if (nm->is_compiled_by_jvmci()) {
|
||||
barrier_address = nm->code_begin() + nm->jvmci_nmethod_data()->nmethod_entry_patch_offset();
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
barrier_address = nm->code_begin() + nm->frame_complete_offset() + entry_barrier_offset(nm);
|
||||
}
|
||||
|
||||
address barrier_address = nm->code_begin() + nm->frame_complete_offset() + entry_barrier_offset(nm);
|
||||
NativeNMethodCmpBarrier* barrier = reinterpret_cast<NativeNMethodCmpBarrier*>(barrier_address);
|
||||
barrier->verify();
|
||||
return barrier;
|
||||
@ -199,11 +187,3 @@ int BarrierSetNMethod::guard_value(nmethod* nm) {
|
||||
NativeNMethodCmpBarrier* cmp = native_nmethod_barrier(nm);
|
||||
return cmp->get_immediate();
|
||||
}
|
||||
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
bool BarrierSetNMethod::verify_barrier(nmethod* nm, err_msg& msg) {
|
||||
NativeNMethodCmpBarrier* barrier = native_nmethod_barrier(nm);
|
||||
return barrier->check_barrier(msg);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -35,7 +35,7 @@ define_pd_global(bool, ImplicitNullChecks, true); // Generate code for im
|
||||
define_pd_global(bool, TrapBasedNullChecks, false); // Not needed on x86.
|
||||
define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap nulls passed to check cast
|
||||
|
||||
define_pd_global(bool, DelayCompilerStubsGeneration, COMPILER2_OR_JVMCI);
|
||||
define_pd_global(bool, DelayCompilerStubsGeneration, COMPILER2_PRESENT(true) NOT_COMPILER2(false));
|
||||
|
||||
define_pd_global(size_t, CodeCacheSegmentSize, 64 COMPILER1_AND_COMPILER2_PRESENT(+64)); // Tiered compilation has large code-entry alignment.
|
||||
// See 4827828 for this change. There is no globals_core_i486.hpp. I can't
|
||||
@ -45,11 +45,11 @@ define_pd_global(size_t, CodeCacheSegmentSize, 64 COMPILER1_AND_COMPILER2_PRES
|
||||
// the vep is aligned at CodeEntryAlignment whereas c2 only aligns
|
||||
// the uep and the vep doesn't get real alignment but just slops on by
|
||||
// only assured that the entry instruction meets the 5 byte size requirement.
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
define_pd_global(uint, CodeEntryAlignment, 32);
|
||||
#else
|
||||
define_pd_global(uint, CodeEntryAlignment, 16);
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
define_pd_global(intx, OptoLoopAlignment, 16);
|
||||
define_pd_global(intx, InlineSmallCode, 1000);
|
||||
|
||||
|
||||
@ -1,257 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
#include "compiler/disassembler.hpp"
|
||||
#include "oops/compressedKlass.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/javaCalls.hpp"
|
||||
#include "runtime/jniHandles.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "jvmci/jvmci.hpp"
|
||||
#include "jvmci/jvmciEnv.hpp"
|
||||
#include "jvmci/jvmciCodeInstaller.hpp"
|
||||
#include "jvmci/jvmciJavaClasses.hpp"
|
||||
#include "jvmci/jvmciCompilerToVM.hpp"
|
||||
#include "jvmci/jvmciRuntime.hpp"
|
||||
#include "asm/register.hpp"
|
||||
#include "classfile/vmSymbols.hpp"
|
||||
#include "code/vmreg.hpp"
|
||||
#include "vmreg_x86.inline.hpp"
|
||||
#if INCLUDE_ZGC
|
||||
#include "gc/z/zBarrierSetAssembler.hpp"
|
||||
#endif
|
||||
|
||||
jint CodeInstaller::pd_next_offset(NativeInstruction* inst, jint pc_offset, JVMCI_TRAPS) {
|
||||
if (inst->is_call() || inst->is_jump()) {
|
||||
assert(NativeCall::instruction_size == (int)NativeJump::instruction_size, "unexpected size");
|
||||
return (pc_offset + NativeCall::instruction_size);
|
||||
} else if (inst->is_mov_literal64()) {
|
||||
// mov+call instruction pair
|
||||
jint offset = pc_offset + ((NativeMovConstReg*)inst)->instruction_size();
|
||||
u_char* call = (u_char*) (_instructions->start() + offset);
|
||||
if (call[0] == Assembler::REX_B) {
|
||||
offset += 1; /* prefix byte for extended register R8-R15 */
|
||||
call++;
|
||||
}
|
||||
if (call[0] == Assembler::REX2) {
|
||||
offset += 2; /* prefix byte for APX extended GPR register R16-R31 */
|
||||
call+=2;
|
||||
}
|
||||
// Register indirect call.
|
||||
assert(call[0] == 0xFF, "expected call");
|
||||
offset += 2; /* opcode byte + modrm byte */
|
||||
return (offset);
|
||||
} else if (inst->is_call_reg()) {
|
||||
// the inlined vtable stub contains a "call register" instruction
|
||||
return (pc_offset + ((NativeCallReg *) inst)->next_instruction_offset());
|
||||
} else if (inst->is_cond_jump()) {
|
||||
address pc = (address) (inst);
|
||||
return pc_offset + (jint) (Assembler::locate_next_instruction(pc) - pc);
|
||||
} else {
|
||||
JVMCI_ERROR_0("unsupported type of instruction for call site");
|
||||
}
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_patch_OopConstant(int pc_offset, Handle& obj, bool compressed, JVMCI_TRAPS) {
|
||||
address pc = _instructions->start() + pc_offset;
|
||||
jobject value = JNIHandles::make_local(obj());
|
||||
if (compressed) {
|
||||
address operand = Assembler::locate_operand(pc, Assembler::narrow_oop_operand);
|
||||
int oop_index = _oop_recorder->find_index(value);
|
||||
_instructions->relocate(pc, oop_Relocation::spec(oop_index), Assembler::narrow_oop_operand);
|
||||
JVMCI_event_3("relocating (narrow oop constant) at " PTR_FORMAT "/" PTR_FORMAT, p2i(pc), p2i(operand));
|
||||
} else {
|
||||
address operand = Assembler::locate_operand(pc, Assembler::imm_operand);
|
||||
*((jobject*) operand) = value;
|
||||
_instructions->relocate(pc, oop_Relocation::spec_for_immediate(), Assembler::imm_operand);
|
||||
JVMCI_event_3("relocating (oop constant) at " PTR_FORMAT "/" PTR_FORMAT, p2i(pc), p2i(operand));
|
||||
}
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_patch_MetaspaceConstant(int pc_offset, HotSpotCompiledCodeStream* stream, u1 tag, JVMCI_TRAPS) {
|
||||
address pc = _instructions->start() + pc_offset;
|
||||
if (tag == PATCH_NARROW_KLASS) {
|
||||
address operand = Assembler::locate_operand(pc, Assembler::narrow_oop_operand);
|
||||
*((narrowKlass*) operand) = record_narrow_metadata_reference(_instructions, operand, stream, tag, JVMCI_CHECK);
|
||||
JVMCI_event_3("relocating (narrow metaspace constant) at " PTR_FORMAT "/" PTR_FORMAT, p2i(pc), p2i(operand));
|
||||
} else {
|
||||
address operand = Assembler::locate_operand(pc, Assembler::imm_operand);
|
||||
*((void**) operand) = record_metadata_reference(_instructions, operand, stream, tag, JVMCI_CHECK);
|
||||
JVMCI_event_3("relocating (metaspace constant) at " PTR_FORMAT "/" PTR_FORMAT, p2i(pc), p2i(operand));
|
||||
}
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_patch_DataSectionReference(int pc_offset, int data_offset, JVMCI_TRAPS) {
|
||||
address pc = _instructions->start() + pc_offset;
|
||||
|
||||
address operand = Assembler::locate_operand(pc, Assembler::disp32_operand);
|
||||
address next_instruction = Assembler::locate_next_instruction(pc);
|
||||
address dest = _constants->start() + data_offset;
|
||||
|
||||
long disp = dest - next_instruction;
|
||||
assert(disp == (jint) disp, "disp doesn't fit in 32 bits");
|
||||
*((jint*) operand) = (jint) disp;
|
||||
|
||||
_instructions->relocate(pc, section_word_Relocation::spec((address) dest, CodeBuffer::SECT_CONSTS), Assembler::disp32_operand);
|
||||
JVMCI_event_3("relocating at " PTR_FORMAT "/" PTR_FORMAT " with destination at " PTR_FORMAT " (%d)", p2i(pc), p2i(operand), p2i(dest), data_offset);
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_relocate_ForeignCall(NativeInstruction* inst, jlong foreign_call_destination, JVMCI_TRAPS) {
|
||||
address pc = (address) inst;
|
||||
if (inst->is_call()) {
|
||||
// NOTE: for call without a mov, the offset must fit a 32-bit immediate
|
||||
// see also CompilerToVM.getMaxCallTargetOffset()
|
||||
NativeCall* call = nativeCall_at(pc);
|
||||
call->set_destination((address) foreign_call_destination);
|
||||
_instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
|
||||
} else if (inst->is_mov_literal64()) {
|
||||
NativeMovConstReg* mov = nativeMovConstReg_at(pc);
|
||||
mov->set_data((intptr_t) foreign_call_destination);
|
||||
_instructions->relocate(mov->instruction_address(), runtime_call_Relocation::spec(), Assembler::imm_operand);
|
||||
} else if (inst->is_jump()) {
|
||||
NativeJump* jump = nativeJump_at(pc);
|
||||
jump->set_jump_destination((address) foreign_call_destination);
|
||||
_instructions->relocate(jump->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
|
||||
} else if (inst->is_cond_jump()) {
|
||||
address old_dest = nativeGeneralJump_at(pc)->jump_destination();
|
||||
address disp = Assembler::locate_operand(pc, Assembler::call32_operand);
|
||||
*(jint*) disp += ((address) foreign_call_destination) - old_dest;
|
||||
_instructions->relocate(pc, runtime_call_Relocation::spec(), Assembler::call32_operand);
|
||||
} else {
|
||||
JVMCI_ERROR("unsupported relocation for foreign call");
|
||||
}
|
||||
|
||||
JVMCI_event_3("relocating (foreign call) at " PTR_FORMAT, p2i(inst));
|
||||
}
|
||||
|
||||
void CodeInstaller::pd_relocate_JavaMethod(CodeBuffer &, methodHandle& method, jint pc_offset, JVMCI_TRAPS) {
|
||||
NativeCall* call = nullptr;
|
||||
switch (_next_call_type) {
|
||||
case INLINE_INVOKE:
|
||||
return;
|
||||
case INVOKEVIRTUAL:
|
||||
case INVOKEINTERFACE: {
|
||||
assert(!method->is_static(), "cannot call static method with invokeinterface");
|
||||
|
||||
call = nativeCall_at(_instructions->start() + pc_offset);
|
||||
call->set_destination(SharedRuntime::get_resolve_virtual_call_stub());
|
||||
_instructions->relocate(call->instruction_address(),
|
||||
virtual_call_Relocation::spec(_invoke_mark_pc),
|
||||
Assembler::call32_operand);
|
||||
break;
|
||||
}
|
||||
case INVOKESTATIC: {
|
||||
assert(method->is_static(), "cannot call non-static method with invokestatic");
|
||||
|
||||
call = nativeCall_at(_instructions->start() + pc_offset);
|
||||
call->set_destination(SharedRuntime::get_resolve_static_call_stub());
|
||||
_instructions->relocate(call->instruction_address(),
|
||||
relocInfo::static_call_type, Assembler::call32_operand);
|
||||
break;
|
||||
}
|
||||
case INVOKESPECIAL: {
|
||||
assert(!method->is_static(), "cannot call static method with invokespecial");
|
||||
call = nativeCall_at(_instructions->start() + pc_offset);
|
||||
call->set_destination(SharedRuntime::get_resolve_opt_virtual_call_stub());
|
||||
_instructions->relocate(call->instruction_address(),
|
||||
relocInfo::opt_virtual_call_type, Assembler::call32_operand);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
JVMCI_ERROR("invalid _next_call_type value: %d", _next_call_type);
|
||||
return;
|
||||
}
|
||||
if (!call->is_displacement_aligned()) {
|
||||
JVMCI_ERROR("unaligned displacement for call at offset %d", pc_offset);
|
||||
}
|
||||
if (Continuations::enabled()) {
|
||||
// Check for proper post_call_nop
|
||||
NativePostCallNop* nop = nativePostCallNop_at(call->next_instruction_address());
|
||||
if (nop == nullptr) {
|
||||
JVMCI_ERROR("missing post call nop at offset %d", pc_offset);
|
||||
} else {
|
||||
_instructions->relocate(call->next_instruction_address(), relocInfo::post_call_nop_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool CodeInstaller::pd_relocate(address pc, jint mark) {
|
||||
switch (mark) {
|
||||
case POLL_NEAR:
|
||||
case POLL_FAR:
|
||||
// This is a load from a register so there is no relocatable operand.
|
||||
// We just have to ensure that the format is not disp32_operand
|
||||
// so that poll_Relocation::fix_relocation_after_move does the right
|
||||
// thing (i.e. ignores this relocation record)
|
||||
_instructions->relocate(pc, relocInfo::poll_type, Assembler::imm_operand);
|
||||
return true;
|
||||
case POLL_RETURN_NEAR:
|
||||
case POLL_RETURN_FAR:
|
||||
// see comment above for POLL_FAR
|
||||
_instructions->relocate(pc, relocInfo::poll_return_type, Assembler::imm_operand);
|
||||
return true;
|
||||
#if INCLUDE_ZGC
|
||||
case Z_BARRIER_RELOCATION_FORMAT_LOAD_GOOD_BEFORE_SHL:
|
||||
_instructions->relocate(pc, barrier_Relocation::spec(), ZBarrierRelocationFormatLoadGoodBeforeShl);
|
||||
return true;
|
||||
case Z_BARRIER_RELOCATION_FORMAT_LOAD_BAD_AFTER_TEST:
|
||||
_instructions->relocate(pc, barrier_Relocation::spec(), ZBarrierRelocationFormatLoadBadAfterTest);
|
||||
return true;
|
||||
case Z_BARRIER_RELOCATION_FORMAT_MARK_BAD_AFTER_TEST:
|
||||
_instructions->relocate(pc, barrier_Relocation::spec(), ZBarrierRelocationFormatMarkBadAfterTest);
|
||||
return true;
|
||||
case Z_BARRIER_RELOCATION_FORMAT_STORE_GOOD_AFTER_CMP:
|
||||
_instructions->relocate(pc, barrier_Relocation::spec(), ZBarrierRelocationFormatStoreGoodAfterCmp);
|
||||
return true;
|
||||
case Z_BARRIER_RELOCATION_FORMAT_STORE_BAD_AFTER_TEST:
|
||||
_instructions->relocate(pc, barrier_Relocation::spec(), ZBarrierRelocationFormatStoreBadAfterTest);
|
||||
return true;
|
||||
case Z_BARRIER_RELOCATION_FORMAT_STORE_GOOD_AFTER_OR:
|
||||
_instructions->relocate(pc, barrier_Relocation::spec(), ZBarrierRelocationFormatStoreGoodAfterOr);
|
||||
return true;
|
||||
case Z_BARRIER_RELOCATION_FORMAT_STORE_GOOD_AFTER_MOV:
|
||||
_instructions->relocate(pc, barrier_Relocation::spec(), ZBarrierRelocationFormatStoreGoodAfterMov);
|
||||
return true;
|
||||
#endif
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// convert JVMCI register indices (as used in oop maps) to HotSpot registers
|
||||
VMReg CodeInstaller::get_hotspot_reg(jint jvmci_reg, JVMCI_TRAPS) {
|
||||
if (jvmci_reg < Register::number_of_registers) {
|
||||
return as_Register(jvmci_reg)->as_VMReg();
|
||||
} else {
|
||||
jint floatRegisterNumber = jvmci_reg - Register::number_of_registers;
|
||||
if (floatRegisterNumber < XMMRegister::number_of_registers) {
|
||||
return as_XMMRegister(floatRegisterNumber)->as_VMReg();
|
||||
}
|
||||
JVMCI_ERROR_NULL("invalid register number: %d", jvmci_reg);
|
||||
}
|
||||
}
|
||||
|
||||
bool CodeInstaller::is_general_purpose_reg(VMReg hotspotRegister) {
|
||||
return !(hotspotRegister->is_FloatRegister() || hotspotRegister->is_XMMRegister());
|
||||
}
|
||||
@ -5848,7 +5848,7 @@ void MacroAssembler::reinit_heapbase() {
|
||||
}
|
||||
}
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
|
||||
// clear memory of size 'cnt' qwords, starting at 'base' using XMM/YMM/ZMM registers
|
||||
void MacroAssembler::xmm_clear_mem(Register base, Register cnt, Register rtmp, XMMRegister xtmp, KRegister mask) {
|
||||
@ -6052,7 +6052,7 @@ void MacroAssembler::clear_mem(Register base, Register cnt, Register tmp, XMMReg
|
||||
BIND(DONE);
|
||||
}
|
||||
|
||||
#endif //COMPILER2_OR_JVMCI
|
||||
#endif //COMPILER2
|
||||
|
||||
|
||||
void MacroAssembler::generate_fill(BasicType t, bool aligned,
|
||||
@ -9444,7 +9444,7 @@ void MacroAssembler::vpternlogq(XMMRegister dst, int imm8, XMMRegister src2, Add
|
||||
}
|
||||
}
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
|
||||
void MacroAssembler::fill_masked(BasicType bt, Address dst, XMMRegister xmm, KRegister mask,
|
||||
Register length, Register temp, int vec_enc) {
|
||||
@ -9679,7 +9679,7 @@ void MacroAssembler::generate_fill_avx3(BasicType type, Register to, Register va
|
||||
}
|
||||
bind(L_exit);
|
||||
}
|
||||
#endif //COMPILER2_OR_JVMCI
|
||||
#endif //COMPILER2
|
||||
|
||||
|
||||
void MacroAssembler::convert_f2i(Register dst, XMMRegister src) {
|
||||
|
||||
@ -2071,10 +2071,10 @@ public:
|
||||
void cache_wb(Address line);
|
||||
void cache_wbsync(bool is_pre);
|
||||
|
||||
#ifdef COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
void generate_fill_avx3(BasicType type, Register to, Register value,
|
||||
Register count, Register rtmp, XMMRegister xtmp);
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
|
||||
void vallones(XMMRegister dst, int vector_len);
|
||||
|
||||
|
||||
@ -65,9 +65,6 @@
|
||||
#ifdef COMPILER2
|
||||
#include "opto/runtime.hpp"
|
||||
#endif
|
||||
#if INCLUDE_JVMCI
|
||||
#include "jvmci/jvmciJavaClasses.hpp"
|
||||
#endif
|
||||
|
||||
#define __ masm->
|
||||
|
||||
@ -182,14 +179,14 @@ class RegisterSaver {
|
||||
OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_frame_words, int* total_frame_words, bool save_wide_vectors) {
|
||||
int off = 0;
|
||||
int num_xmm_regs = XMMRegister::available_xmm_registers();
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
if (save_wide_vectors && UseAVX == 0) {
|
||||
save_wide_vectors = false; // vectors larger than 16 byte long are supported only with AVX
|
||||
}
|
||||
assert(!save_wide_vectors || MaxVectorSize <= 64, "Only up to 64 byte long vectors are supported");
|
||||
#else
|
||||
save_wide_vectors = false; // vectors are generated only by C2 and JVMCI
|
||||
#endif
|
||||
save_wide_vectors = false; // vectors are generated only by C2
|
||||
#endif // COMPILER2
|
||||
|
||||
// Always make the frame size 16-byte aligned, both vector and non vector stacks are always allocated
|
||||
int frame_size_in_bytes = align_up(reg_save_size*BytesPerInt, num_xmm_regs);
|
||||
@ -234,13 +231,13 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_
|
||||
for (int n = 16; n < num_xmm_regs; n++) {
|
||||
__ evmovdqul(Address(rsp, base_addr+(off++*64)), as_XMMRegister(n), vector_len);
|
||||
}
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
base_addr = XSAVE_AREA_OPMASK_BEGIN;
|
||||
off = 0;
|
||||
for(int n = 0; n < KRegister::number_of_registers; n++) {
|
||||
__ kmov(Address(rsp, base_addr+(off++*8)), as_KRegister(n));
|
||||
}
|
||||
#endif
|
||||
#endif // COMPILER2
|
||||
}
|
||||
} else {
|
||||
if (VM_Version::supports_evex()) {
|
||||
@ -251,17 +248,17 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_
|
||||
for (int n = 16; n < num_xmm_regs; n++) {
|
||||
__ evmovdqul(Address(rsp, base_addr+(off++*64)), as_XMMRegister(n), vector_len);
|
||||
}
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
base_addr = XSAVE_AREA_OPMASK_BEGIN;
|
||||
off = 0;
|
||||
for(int n = 0; n < KRegister::number_of_registers; n++) {
|
||||
__ kmov(Address(rsp, base_addr+(off++*8)), as_KRegister(n));
|
||||
}
|
||||
#endif
|
||||
#endif // COMPILER2
|
||||
}
|
||||
}
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
if (UseAPX) {
|
||||
int base_addr = XSAVE_AREA_EGPRS;
|
||||
off = 0;
|
||||
@ -269,7 +266,7 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_
|
||||
__ movq(Address(rsp, base_addr+(off++*8)), as_Register(n));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif // COMPILER2
|
||||
|
||||
__ vzeroupper();
|
||||
if (frame::arg_reg_save_area_bytes != 0) {
|
||||
@ -342,7 +339,7 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_
|
||||
}
|
||||
}
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
if (save_wide_vectors) {
|
||||
// Save upper half of YMM registers(0..15)
|
||||
off = ymm0_off;
|
||||
@ -363,7 +360,7 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
|
||||
// %%% These should all be a waste but we'll keep things as they were for now
|
||||
if (true) {
|
||||
@ -431,14 +428,14 @@ void RegisterSaver::restore_live_registers(MacroAssembler* masm, bool restore_wi
|
||||
__ addptr(rsp, frame::arg_reg_save_area_bytes);
|
||||
}
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
if (restore_wide_vectors) {
|
||||
assert(UseAVX > 0, "Vectors larger than 16 byte long are supported only with AVX");
|
||||
assert(MaxVectorSize <= 64, "Only up to 64 byte long vectors are supported");
|
||||
}
|
||||
#else
|
||||
assert(!restore_wide_vectors, "vectors are generated only by C2");
|
||||
#endif
|
||||
#endif // COMPILER2
|
||||
|
||||
__ vzeroupper();
|
||||
|
||||
@ -462,13 +459,13 @@ void RegisterSaver::restore_live_registers(MacroAssembler* masm, bool restore_wi
|
||||
for (int n = 16; n < num_xmm_regs; n++) {
|
||||
__ evmovdqul(as_XMMRegister(n), Address(rsp, base_addr+(off++*64)), vector_len);
|
||||
}
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
base_addr = XSAVE_AREA_OPMASK_BEGIN;
|
||||
off = 0;
|
||||
for (int n = 0; n < KRegister::number_of_registers; n++) {
|
||||
__ kmov(as_KRegister(n), Address(rsp, base_addr+(off++*8)));
|
||||
}
|
||||
#endif
|
||||
#endif // COMPILER2
|
||||
}
|
||||
} else {
|
||||
if (VM_Version::supports_evex()) {
|
||||
@ -479,17 +476,17 @@ void RegisterSaver::restore_live_registers(MacroAssembler* masm, bool restore_wi
|
||||
for (int n = 16; n < num_xmm_regs; n++) {
|
||||
__ evmovdqul(as_XMMRegister(n), Address(rsp, base_addr+(off++*64)), vector_len);
|
||||
}
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
base_addr = XSAVE_AREA_OPMASK_BEGIN;
|
||||
off = 0;
|
||||
for (int n = 0; n < KRegister::number_of_registers; n++) {
|
||||
__ kmov(as_KRegister(n), Address(rsp, base_addr+(off++*8)));
|
||||
}
|
||||
#endif
|
||||
#endif // COMPILER2
|
||||
}
|
||||
}
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
if (UseAPX) {
|
||||
int base_addr = XSAVE_AREA_EGPRS;
|
||||
int off = 0;
|
||||
@ -497,7 +494,7 @@ void RegisterSaver::restore_live_registers(MacroAssembler* masm, bool restore_wi
|
||||
__ movq(as_Register(n), Address(rsp, base_addr+(off++*8)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif // COMPILER2
|
||||
|
||||
// Recover CPU state
|
||||
__ pop_FPU_state();
|
||||
@ -887,18 +884,6 @@ void SharedRuntime::gen_i2c_adapter(MacroAssembler *masm,
|
||||
// Pre-load the register-jump target early, to schedule it better.
|
||||
__ movptr(r11, Address(rbx, in_bytes(Method::from_compiled_offset())));
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
if (EnableJVMCI) {
|
||||
// check if this call should be routed towards a specific entry point
|
||||
__ cmpptr(Address(r15_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())), 0);
|
||||
Label no_alternative_target;
|
||||
__ jcc(Assembler::equal, no_alternative_target);
|
||||
__ movptr(r11, Address(r15_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())));
|
||||
__ movptr(Address(r15_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())), 0);
|
||||
__ bind(no_alternative_target);
|
||||
}
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
// Now generate the shuffle code. Pick up all register args and move the
|
||||
// rest through the floating point stack top.
|
||||
for (int i = 0; i < total_args_passed; i++) {
|
||||
@ -2492,11 +2477,6 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
if (UseAPX) {
|
||||
pad += 1024;
|
||||
}
|
||||
#if INCLUDE_JVMCI
|
||||
if (EnableJVMCI) {
|
||||
pad += 512; // Increase the buffer size when compiling for JVMCI
|
||||
}
|
||||
#endif
|
||||
const char* name = SharedRuntime::stub_name(StubId::shared_deopt_id);
|
||||
CodeBlob* blob = AOTCodeCache::load_code_blob(AOTCodeEntry::SharedBlob, BlobId::shared_deopt_id);
|
||||
if (blob != nullptr) {
|
||||
@ -2553,13 +2533,6 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
__ jmp(cont);
|
||||
|
||||
int reexecute_offset = __ pc() - start;
|
||||
#if INCLUDE_JVMCI && !defined(COMPILER1)
|
||||
if (UseJVMCICompiler) {
|
||||
// JVMCI does not use this kind of deoptimization
|
||||
__ should_not_reach_here();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Reexecute case
|
||||
// return address is the pc describes what bci to do re-execute at
|
||||
|
||||
@ -2569,39 +2542,6 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
__ movl(r14, Deoptimization::Unpack_reexecute); // callee-saved
|
||||
__ jmp(cont);
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
Label after_fetch_unroll_info_call;
|
||||
int implicit_exception_uncommon_trap_offset = 0;
|
||||
int uncommon_trap_offset = 0;
|
||||
|
||||
if (EnableJVMCI) {
|
||||
implicit_exception_uncommon_trap_offset = __ pc() - start;
|
||||
|
||||
__ pushptr(Address(r15_thread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())));
|
||||
__ movptr(Address(r15_thread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())), NULL_WORD);
|
||||
|
||||
uncommon_trap_offset = __ pc() - start;
|
||||
|
||||
// Save everything in sight.
|
||||
RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words, /*save_wide_vectors*/ true);
|
||||
// fetch_unroll_info needs to call last_java_frame()
|
||||
__ set_last_Java_frame(noreg, noreg, nullptr, rscratch1);
|
||||
|
||||
__ movl(c_rarg1, Address(r15_thread, in_bytes(JavaThread::pending_deoptimization_offset())));
|
||||
__ movl(Address(r15_thread, in_bytes(JavaThread::pending_deoptimization_offset())), -1);
|
||||
|
||||
__ movl(r14, Deoptimization::Unpack_reexecute);
|
||||
__ mov(c_rarg0, r15_thread);
|
||||
__ movl(c_rarg2, r14); // exec mode
|
||||
__ call(RuntimeAddress(CAST_FROM_FN_PTR(address, Deoptimization::uncommon_trap)));
|
||||
oop_maps->add_gc_map( __ pc()-start, map->deep_copy());
|
||||
|
||||
__ reset_last_Java_frame(false);
|
||||
|
||||
__ jmp(after_fetch_unroll_info_call);
|
||||
} // EnableJVMCI
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
int exception_offset = __ pc() - start;
|
||||
|
||||
// Prolog for exception case
|
||||
@ -2686,12 +2626,6 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
|
||||
__ reset_last_Java_frame(false);
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
if (EnableJVMCI) {
|
||||
__ bind(after_fetch_unroll_info_call);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Load UnrollBlock* into rdi
|
||||
__ mov(rdi, rax);
|
||||
|
||||
@ -2849,12 +2783,6 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
|
||||
_deopt_blob = DeoptimizationBlob::create(&buffer, oop_maps, 0, exception_offset, reexecute_offset, frame_size_in_words);
|
||||
_deopt_blob->set_unpack_with_exception_in_tls_offset(exception_in_tls_offset);
|
||||
#if INCLUDE_JVMCI
|
||||
if (EnableJVMCI) {
|
||||
_deopt_blob->set_uncommon_trap_offset(uncommon_trap_offset);
|
||||
_deopt_blob->set_implicit_exception_uncommon_trap_offset(implicit_exception_uncommon_trap_offset);
|
||||
}
|
||||
#endif
|
||||
|
||||
AOTCodeCache::store_code_blob(*_deopt_blob, AOTCodeEntry::SharedBlob, BlobId::shared_deopt_id);
|
||||
}
|
||||
|
||||
@ -43,9 +43,6 @@
|
||||
#include "opto/runtime.hpp"
|
||||
#include "opto/c2_globals.hpp"
|
||||
#endif
|
||||
#if INCLUDE_JVMCI
|
||||
#include "jvmci/jvmci_globals.hpp"
|
||||
#endif
|
||||
|
||||
// For a more detailed description of the stub routine structure
|
||||
// see the comment in stubRoutines.hpp
|
||||
@ -4832,7 +4829,7 @@ void StubGenerator::generate_final_stubs() {
|
||||
}
|
||||
|
||||
void StubGenerator::generate_compiler_stubs() {
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
|
||||
// Entry points that are C2 compiler specific.
|
||||
|
||||
@ -4890,11 +4887,9 @@ void StubGenerator::generate_compiler_stubs() {
|
||||
StubRoutines::_data_cache_writeback = generate_data_cache_writeback();
|
||||
StubRoutines::_data_cache_writeback_sync = generate_data_cache_writeback_sync();
|
||||
|
||||
#ifdef COMPILER2
|
||||
if ((UseAVX == 2) && EnableX86ECoreOpts && UseCountTrailingZerosInstruction) {
|
||||
generate_string_indexof(StubRoutines::_string_indexof_array);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (UseAdler32Intrinsics) {
|
||||
StubRoutines::_updateBytesAdler32 = generate_updateBytesAdler32();
|
||||
@ -4973,7 +4968,6 @@ void StubGenerator::generate_compiler_stubs() {
|
||||
StubRoutines::_base64_decodeBlock = generate_base64_decodeBlock();
|
||||
}
|
||||
|
||||
#ifdef COMPILER2
|
||||
if (UseMultiplyToLenIntrinsic) {
|
||||
StubRoutines::_multiplyToLen = generate_multiplyToLen();
|
||||
}
|
||||
@ -5018,7 +5012,6 @@ void StubGenerator::generate_compiler_stubs() {
|
||||
}
|
||||
|
||||
#endif // COMPILER2
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
}
|
||||
|
||||
StubGenerator::StubGenerator(CodeBuffer* code, BlobId blob_id, AOTStubData* stub_data) : StubCodeGenerator(code, blob_id, stub_data) {
|
||||
|
||||
@ -161,7 +161,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
void restore_argument_regs(BasicType type);
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
// Following rules apply to AVX3 optimized arraycopy stubs:
|
||||
// - If target supports AVX3 features (BW+VL+F) then implementation uses 32 byte vectors (YMMs)
|
||||
// for both special cases (various small block sizes) and aligned copy loop. This is the
|
||||
@ -216,7 +216,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
void copy32_masked_avx(Register dst, Register src, XMMRegister xmm,
|
||||
KRegister mask, Register length, Register index,
|
||||
Register temp, int shift = Address::times_1, int offset = 0);
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
|
||||
address generate_disjoint_byte_copy(address* entry);
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -32,9 +32,6 @@
|
||||
#ifdef COMPILER2
|
||||
#include "opto/c2_globals.hpp"
|
||||
#endif
|
||||
#if INCLUDE_JVMCI
|
||||
#include "jvmci/jvmci_globals.hpp"
|
||||
#endif
|
||||
|
||||
#define __ _masm->
|
||||
|
||||
@ -59,7 +56,7 @@ static void inc_counter_np(MacroAssembler* _masm, uint& counter, Register rscrat
|
||||
__ incrementl(ExternalAddress((address)&counter), rscratch);
|
||||
}
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
static uint& get_profile_ctr(int shift) {
|
||||
if (shift == 0) {
|
||||
return SharedRuntime::_jbyte_array_copy_ctr;
|
||||
@ -72,7 +69,7 @@ static uint& get_profile_ctr(int shift) {
|
||||
return SharedRuntime::_jlong_array_copy_ctr;
|
||||
}
|
||||
}
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
#endif // !PRODUCT
|
||||
|
||||
void StubGenerator::generate_arraycopy_stubs() {
|
||||
@ -505,7 +502,7 @@ void StubGenerator::copy_bytes_backward(Register from, Register dest,
|
||||
__ jcc(Assembler::greater, L_copy_8_bytes); // Copy trailing qwords
|
||||
}
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
|
||||
// Note: Following rules apply to AVX3 optimized arraycopy stubs:-
|
||||
// - If target supports AVX3 features (BW+VL+F) then implementation uses 32 byte vectors (YMMs)
|
||||
@ -1459,7 +1456,7 @@ void StubGenerator::copy64_avx(Register dst, Register src, Register index, XMMRe
|
||||
}
|
||||
}
|
||||
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
|
||||
|
||||
// Arguments:
|
||||
@ -1483,11 +1480,11 @@ address StubGenerator::generate_disjoint_byte_copy(address* entry) {
|
||||
StubId stub_id = StubId::stubgen_jbyte_disjoint_arraycopy_id;
|
||||
// aligned is always false -- x86_64 always uses the unaligned code
|
||||
const bool aligned = false;
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
if (VM_Version::supports_avx512vlbw() && VM_Version::supports_bmi2() && MaxVectorSize >= 32) {
|
||||
return generate_disjoint_copy_avx3_masked(stub_id, entry);
|
||||
}
|
||||
#endif
|
||||
#endif // COMPILER2
|
||||
GrowableArray<address> entries;
|
||||
GrowableArray<address> extras;
|
||||
int expected_entry_count = (entry != nullptr ? 2 : 1);
|
||||
@ -1633,11 +1630,11 @@ address StubGenerator::generate_conjoint_byte_copy(address nooverlap_target, add
|
||||
StubId stub_id = StubId::stubgen_jbyte_arraycopy_id;
|
||||
// aligned is always false -- x86_64 always uses the unaligned code
|
||||
const bool aligned = false;
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
if (VM_Version::supports_avx512vlbw() && VM_Version::supports_bmi2() && MaxVectorSize >= 32) {
|
||||
return generate_conjoint_copy_avx3_masked(stub_id, entry, nooverlap_target);
|
||||
}
|
||||
#endif
|
||||
#endif // COMPILER2
|
||||
GrowableArray<address> entries;
|
||||
GrowableArray<address> extras;
|
||||
int expected_entry_count = (entry != nullptr ? 2 : 1);
|
||||
@ -1777,11 +1774,11 @@ address StubGenerator::generate_disjoint_short_copy(address *entry) {
|
||||
StubId stub_id = StubId::stubgen_jshort_disjoint_arraycopy_id;
|
||||
// aligned is always false -- x86_64 always uses the unaligned code
|
||||
const bool aligned = false;
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
if (VM_Version::supports_avx512vlbw() && VM_Version::supports_bmi2() && MaxVectorSize >= 32) {
|
||||
return generate_disjoint_copy_avx3_masked(stub_id, entry);
|
||||
}
|
||||
#endif
|
||||
#endif // COMPILER2
|
||||
GrowableArray<address> entries;
|
||||
GrowableArray<address> extras;
|
||||
int expected_entry_count = (entry != nullptr ? 2 : 1);
|
||||
@ -2004,11 +2001,11 @@ address StubGenerator::generate_conjoint_short_copy(address nooverlap_target, ad
|
||||
StubId stub_id = StubId::stubgen_jshort_arraycopy_id;
|
||||
// aligned is always false -- x86_64 always uses the unaligned code
|
||||
const bool aligned = false;
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
if (VM_Version::supports_avx512vlbw() && VM_Version::supports_bmi2() && MaxVectorSize >= 32) {
|
||||
return generate_conjoint_copy_avx3_masked(stub_id, entry, nooverlap_target);
|
||||
}
|
||||
#endif
|
||||
#endif // COMPILER2
|
||||
GrowableArray<address> entries;
|
||||
GrowableArray<address> extras;
|
||||
int expected_entry_count = (entry != nullptr ? 2 : 1);
|
||||
@ -2162,11 +2159,11 @@ address StubGenerator::generate_disjoint_int_oop_copy(StubId stub_id, address* e
|
||||
}
|
||||
|
||||
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
if ((!is_oop || bs->supports_avx3_masked_arraycopy()) && VM_Version::supports_avx512vlbw() && VM_Version::supports_bmi2() && MaxVectorSize >= 32) {
|
||||
return generate_disjoint_copy_avx3_masked(stub_id, entry);
|
||||
}
|
||||
#endif
|
||||
#endif // COMPILER2
|
||||
GrowableArray<address> entries;
|
||||
GrowableArray<address> extras;
|
||||
bool add_handlers = !is_oop && !aligned;
|
||||
@ -2344,11 +2341,11 @@ address StubGenerator::generate_conjoint_int_oop_copy(StubId stub_id, address no
|
||||
}
|
||||
|
||||
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
if ((!is_oop || bs->supports_avx3_masked_arraycopy()) && VM_Version::supports_avx512vlbw() && VM_Version::supports_bmi2() && MaxVectorSize >= 32) {
|
||||
return generate_conjoint_copy_avx3_masked(stub_id, entry, nooverlap_target);
|
||||
}
|
||||
#endif
|
||||
#endif // COMPILER2
|
||||
bool add_handlers = !is_oop && !aligned;
|
||||
bool add_relocs = UseZGC && is_oop;
|
||||
bool add_extras = add_handlers || add_relocs;
|
||||
@ -2527,11 +2524,11 @@ address StubGenerator::generate_disjoint_long_oop_copy(StubId stub_id, address *
|
||||
}
|
||||
|
||||
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
if ((!is_oop || bs->supports_avx3_masked_arraycopy()) && VM_Version::supports_avx512vlbw() && VM_Version::supports_bmi2() && MaxVectorSize >= 32) {
|
||||
return generate_disjoint_copy_avx3_masked(stub_id, entry);
|
||||
}
|
||||
#endif
|
||||
#endif // COMPILER2
|
||||
bool add_handlers = !is_oop && !aligned;
|
||||
bool add_relocs = UseZGC && is_oop;
|
||||
bool add_extras = add_handlers || add_relocs;
|
||||
@ -2710,11 +2707,11 @@ address StubGenerator::generate_conjoint_long_oop_copy(StubId stub_id, address n
|
||||
}
|
||||
|
||||
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
if ((!is_oop || bs->supports_avx3_masked_arraycopy()) && VM_Version::supports_avx512vlbw() && VM_Version::supports_bmi2() && MaxVectorSize >= 32) {
|
||||
return generate_conjoint_copy_avx3_masked(stub_id, entry, nooverlap_target);
|
||||
}
|
||||
#endif
|
||||
#endif // COMPILER2
|
||||
bool add_handlers = !is_oop && !aligned;
|
||||
bool add_relocs = UseZGC && is_oop;
|
||||
bool add_extras = add_handlers || add_relocs;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -63,7 +63,7 @@
|
||||
// if too small.
|
||||
// Run with +PrintInterpreter to get the VM to print out the size.
|
||||
// Max size with JVMTI
|
||||
int TemplateInterpreter::InterpreterCodeSize = JVMCI_ONLY(268) NOT_JVMCI(256) * 1024;
|
||||
int TemplateInterpreter::InterpreterCodeSize = 256 * 1024;
|
||||
|
||||
// Global Register Names
|
||||
static const Register rbcp = r13;
|
||||
@ -224,32 +224,6 @@ address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state, i
|
||||
__ restore_bcp();
|
||||
__ restore_locals();
|
||||
const Register thread = r15_thread;
|
||||
#if INCLUDE_JVMCI
|
||||
// Check if we need to take lock at entry of synchronized method. This can
|
||||
// only occur on method entry so emit it only for vtos with step 0.
|
||||
if (EnableJVMCI && state == vtos && step == 0) {
|
||||
Label L;
|
||||
__ cmpb(Address(thread, JavaThread::pending_monitorenter_offset()), 0);
|
||||
__ jcc(Assembler::zero, L);
|
||||
// Clear flag.
|
||||
__ movb(Address(thread, JavaThread::pending_monitorenter_offset()), 0);
|
||||
// Satisfy calling convention for lock_method().
|
||||
__ get_method(rbx);
|
||||
// Take lock.
|
||||
lock_method();
|
||||
__ bind(L);
|
||||
} else {
|
||||
#ifdef ASSERT
|
||||
if (EnableJVMCI) {
|
||||
Label L;
|
||||
__ cmpb(Address(r15_thread, JavaThread::pending_monitorenter_offset()), 0);
|
||||
__ jcc(Assembler::zero, L);
|
||||
__ stop("unexpected pending monitor in deopt entry");
|
||||
__ bind(L);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
// handle exceptions
|
||||
{
|
||||
Label L;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -32,8 +32,7 @@
|
||||
#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \
|
||||
volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) \
|
||||
static_field(VM_Version, _features, VM_Version::VM_Features) \
|
||||
nonstatic_field(VM_Version::VM_Features, _features_bitmap[0], uint64_t) \
|
||||
static_field(VM_Version::VM_Features, _features_bitmap_size, int)
|
||||
nonstatic_field(VM_Version::VM_Features, _features_bitmap[0], uint64_t)
|
||||
|
||||
#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) \
|
||||
declare_toplevel_type(VM_Version::VM_Features)
|
||||
|
||||
@ -65,8 +65,6 @@ address VM_Version::_cpuinfo_cont_addr_apx = nullptr;
|
||||
static BufferBlob* stub_blob;
|
||||
static const int stub_size = 2550;
|
||||
|
||||
int VM_Version::VM_Features::_features_bitmap_size = sizeof(VM_Version::VM_Features::_features_bitmap) / BytesPerLong;
|
||||
|
||||
VM_Version::VM_Features VM_Version::_features;
|
||||
VM_Version::VM_Features VM_Version::_cpu_features;
|
||||
|
||||
@ -1336,7 +1334,7 @@ void VM_Version::get_processor_features() {
|
||||
FLAG_SET_DEFAULT(UseSHA3Intrinsics, false);
|
||||
}
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
int max_vector_size = 0;
|
||||
if (UseAVX == 0 || !os_supports_avx_vectors()) {
|
||||
// 16 byte vectors (in XMM) are supported with SSE2+
|
||||
@ -1369,7 +1367,7 @@ void VM_Version::get_processor_features() {
|
||||
FLAG_SET_DEFAULT(MaxVectorSize, max_vector_size);
|
||||
}
|
||||
|
||||
#if defined(COMPILER2) && defined(ASSERT)
|
||||
#ifdef ASSERT
|
||||
if (MaxVectorSize > 0) {
|
||||
if (supports_avx() && PrintMiscellaneous && Verbose && TraceNewVectors) {
|
||||
tty->print_cr("State of YMM registers after signal handle:");
|
||||
@ -1384,7 +1382,7 @@ void VM_Version::get_processor_features() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // COMPILER2 && ASSERT
|
||||
#endif // ASSERT
|
||||
|
||||
if ((supports_avx512ifma() && supports_avx512vlbw()) || supports_avxifma()) {
|
||||
if (FLAG_IS_DEFAULT(UsePoly1305Intrinsics)) {
|
||||
@ -1423,7 +1421,7 @@ void VM_Version::get_processor_features() {
|
||||
if (FLAG_IS_DEFAULT(UseMontgomerySquareIntrinsic)) {
|
||||
UseMontgomerySquareIntrinsic = true;
|
||||
}
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
|
||||
// On new cpus instructions which update whole XMM register should be used
|
||||
// to prevent partial register stall due to dependencies on high half.
|
||||
|
||||
@ -34,7 +34,6 @@ class stringStream;
|
||||
|
||||
class VM_Version : public Abstract_VM_Version {
|
||||
friend class VMStructs;
|
||||
friend class JVMCIVMStructs;
|
||||
|
||||
public:
|
||||
// cpuid result register layouts. These are all unions of a uint32_t
|
||||
@ -373,7 +372,6 @@ protected:
|
||||
/*
|
||||
* Update following files when declaring new flags:
|
||||
* test/lib-test/jdk/test/whitebox/CPUInfoTest.java
|
||||
* src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/amd64/AMD64.java
|
||||
*/
|
||||
enum Feature_Flag {
|
||||
#define CPU_FEATURE_FLAGS(decl) \
|
||||
@ -449,7 +447,6 @@ protected:
|
||||
|
||||
class VM_Features {
|
||||
friend class VMStructs;
|
||||
friend class JVMCIVMStructs;
|
||||
|
||||
private:
|
||||
uint64_t _features_bitmap[(MAX_CPU_FEATURES / BitsPerLong) + 1];
|
||||
@ -479,7 +476,6 @@ protected:
|
||||
return (1ULL << (feature & features_bitmap_element_mask()));
|
||||
}
|
||||
|
||||
static int _features_bitmap_size; // for JVMCI purposes
|
||||
public:
|
||||
VM_Features() {
|
||||
for (int i = 0; i < features_bitmap_element_count(); i++) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
@ -72,8 +72,8 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
|
||||
|
||||
frame ret_frame(ret_sp, ret_fp, addr);
|
||||
if (!ret_frame.safe_for_sender(this)) {
|
||||
#if COMPILER2_OR_JVMCI
|
||||
// C2 and JVMCI use ebp as a general register see if null fp helps
|
||||
#ifdef COMPILER2
|
||||
// C2 uses ebp as a general register see if null fp helps
|
||||
frame ret_frame2(ret_sp, nullptr, addr);
|
||||
if (!ret_frame2.safe_for_sender(this)) {
|
||||
// nothing else to try if the frame isn't good
|
||||
@ -83,7 +83,7 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
|
||||
#else
|
||||
// nothing else to try if the frame isn't good
|
||||
return false;
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
}
|
||||
*fr_addr = ret_frame;
|
||||
return true;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -67,8 +67,8 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
|
||||
|
||||
frame ret_frame(ret_sp, ret_fp, addr);
|
||||
if (!ret_frame.safe_for_sender(this)) {
|
||||
#if COMPILER2_OR_JVMCI
|
||||
// C2 and JVMCI use ebp as a general register see if null fp helps
|
||||
#ifdef COMPILER2
|
||||
// C2 uses ebp as a general register see if null fp helps
|
||||
frame ret_frame2(ret_sp, nullptr, addr);
|
||||
if (!ret_frame2.safe_for_sender(this)) {
|
||||
// nothing else to try if the frame isn't good
|
||||
@ -78,7 +78,7 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
|
||||
#else
|
||||
// nothing else to try if the frame isn't good
|
||||
return false;
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
}
|
||||
*fr_addr = ret_frame;
|
||||
return true;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -68,8 +68,8 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
|
||||
|
||||
frame ret_frame(ret_sp, ret_fp, addr);
|
||||
if (!ret_frame.safe_for_sender(this)) {
|
||||
#if COMPILER2_OR_JVMCI
|
||||
// C2 and JVMCI use ebp as a general register see if null fp helps
|
||||
#ifdef COMPILER2
|
||||
// C2 uses ebp as a general register see if null fp helps
|
||||
frame ret_frame2(ret_sp, nullptr, addr);
|
||||
if (!ret_frame2.safe_for_sender(this)) {
|
||||
// nothing else to try if the frame isn't good
|
||||
@ -79,7 +79,7 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
|
||||
#else
|
||||
// nothing else to try if the frame isn't good
|
||||
return false;
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
}
|
||||
*fr_addr = ret_frame;
|
||||
return true;
|
||||
|
||||
@ -72,8 +72,8 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
|
||||
}
|
||||
|
||||
if (!ret_frame.safe_for_sender(this)) {
|
||||
#if COMPILER2_OR_JVMCI
|
||||
// C2 and JVMCI use ebp as a general register see if null fp helps
|
||||
#ifdef COMPILER2
|
||||
// C2 uses ebp as a general register see if null fp helps
|
||||
frame ret_frame2(ret_frame.sp(), nullptr, ret_frame.pc());
|
||||
if (!ret_frame2.safe_for_sender(this)) {
|
||||
// nothing else to try if the frame isn't good
|
||||
@ -83,7 +83,7 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
|
||||
#else
|
||||
// nothing else to try if the frame isn't good
|
||||
return false;
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
}
|
||||
*fr_addr = ret_frame;
|
||||
return true;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -63,8 +63,8 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
|
||||
}
|
||||
|
||||
if (!ret_frame.safe_for_sender(this)) {
|
||||
#if COMPILER2_OR_JVMCI
|
||||
// C2 and JVMCI use ebp as a general register see if null fp helps
|
||||
#ifdef COMPILER2
|
||||
// C2 uses ebp as a general register see if null fp helps
|
||||
frame ret_frame2(ret_frame.sp(), nullptr, ret_frame.pc());
|
||||
if (!ret_frame2.safe_for_sender(this)) {
|
||||
// nothing else to try if the frame isn't good
|
||||
@ -74,7 +74,7 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
|
||||
#else
|
||||
// nothing else to try if the frame isn't good
|
||||
return false;
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
}
|
||||
*fr_addr = ret_frame;
|
||||
return true;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -256,7 +256,7 @@ class Compilation: public StackObj {
|
||||
// will compilation make optimistic assumptions that might lead to
|
||||
// deoptimization and that the runtime will account for?
|
||||
bool is_optimistic() {
|
||||
return CompilerConfig::is_c1_only_no_jvmci() && !is_profiling() &&
|
||||
return CompilerConfig::is_c1_only() && !is_profiling() &&
|
||||
(RangeCheckElimination || UseLoopInvariantCodeMotion) &&
|
||||
method()->method_data()->trap_count(Deoptimization::Reason_none) == 0;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -478,7 +478,7 @@ void LIRGenerator::klass2reg_with_patching(LIR_Opr r, ciMetadata* obj, CodeEmitI
|
||||
/* C2 relies on constant pool entries being resolved (ciTypeFlow), so if tiered compilation
|
||||
* is active and the class hasn't yet been resolved we need to emit a patch that resolves
|
||||
* the class. */
|
||||
if ((!CompilerConfig::is_c1_only_no_jvmci() && need_resolve) || !obj->is_loaded() || PatchALot) {
|
||||
if ((!CompilerConfig::is_c1_only() && need_resolve) || !obj->is_loaded() || PatchALot) {
|
||||
assert(info != nullptr, "info must be set if class is not loaded");
|
||||
__ klass2reg_patch(nullptr, r, info);
|
||||
} else {
|
||||
@ -644,7 +644,7 @@ void LIRGenerator::monitor_exit(LIR_Opr object, LIR_Opr lock, LIR_Opr new_hdr, L
|
||||
void LIRGenerator::print_if_not_loaded(const NewInstance* new_instance) {
|
||||
if (PrintNotLoaded && !new_instance->klass()->is_loaded()) {
|
||||
tty->print_cr(" ###class not loaded at new bci %d", new_instance->printable_bci());
|
||||
} else if (PrintNotLoaded && (!CompilerConfig::is_c1_only_no_jvmci() && new_instance->is_unresolved())) {
|
||||
} else if (PrintNotLoaded && (!CompilerConfig::is_c1_only() && new_instance->is_unresolved())) {
|
||||
tty->print_cr(" ###class not resolved at new bci %d", new_instance->printable_bci());
|
||||
}
|
||||
}
|
||||
|
||||
@ -230,7 +230,6 @@ void FileMapHeader::populate(FileMapInfo *info, size_t core_region_alignment,
|
||||
_narrow_klass_shift = ArchiveBuilder::precomputed_narrow_klass_shift();
|
||||
|
||||
// Which JIT compier is used
|
||||
_compiler_type = (u1)CompilerConfig::compiler_type();
|
||||
_type_profile_level = TypeProfileLevel;
|
||||
_type_profile_args_limit = TypeProfileArgsLimit;
|
||||
_type_profile_parms_limit = TypeProfileParmsLimit;
|
||||
@ -1819,23 +1818,6 @@ bool FileMapHeader::validate() {
|
||||
CompactStrings ? "enabled" : "disabled");
|
||||
return false;
|
||||
}
|
||||
bool jvmci_compiler_is_enabled = CompilerConfig::is_jvmci_compiler_enabled();
|
||||
CompilerType compiler_type = CompilerConfig::compiler_type();
|
||||
CompilerType archive_compiler_type = CompilerType(_compiler_type);
|
||||
// JVMCI compiler does different type profiling settigns and generate
|
||||
// different code. We can't use archive which was produced
|
||||
// without it and reverse.
|
||||
// Only allow mix when JIT compilation is disabled.
|
||||
// Interpreter is used by default when dumping archive.
|
||||
bool intepreter_is_used = (archive_compiler_type == CompilerType::compiler_none) ||
|
||||
(compiler_type == CompilerType::compiler_none);
|
||||
if (!intepreter_is_used &&
|
||||
jvmci_compiler_is_enabled != (archive_compiler_type == CompilerType::compiler_jvmci)) {
|
||||
AOTMetaspace::report_loading_error("The %s's JIT compiler setting (%s)"
|
||||
" does not equal the current setting (%s).", file_type,
|
||||
compilertype2name(archive_compiler_type), compilertype2name(compiler_type));
|
||||
return false;
|
||||
}
|
||||
if (TrainingData::have_data()) {
|
||||
if (_type_profile_level != TypeProfileLevel) {
|
||||
AOTMetaspace::report_loading_error("The %s's TypeProfileLevel setting (%d)"
|
||||
|
||||
@ -151,7 +151,6 @@ private:
|
||||
AOTStreamedHeapHeader _streamed_heap_header;
|
||||
|
||||
// The following are parameters that affect MethodData layout.
|
||||
u1 _compiler_type;
|
||||
uint _type_profile_level;
|
||||
int _type_profile_args_limit;
|
||||
int _type_profile_parms_limit;
|
||||
|
||||
@ -1476,20 +1476,6 @@ void ClassLoader::set_preview_mode(bool enable_preview) {
|
||||
Preview_mode = enable_preview ? PREVIEW_MODE_ENABLE_PREVIEW : PREVIEW_MODE_DEFAULT;
|
||||
}
|
||||
|
||||
bool ClassLoader::is_module_observable(const char* module_name) {
|
||||
assert(JImageOpen != nullptr, "jimage library should have been opened");
|
||||
if (!jimage_is_open()) {
|
||||
struct stat st;
|
||||
const char *path = get_exploded_module_path(module_name, true);
|
||||
bool res = os::stat(path, &st) == 0;
|
||||
FREE_C_HEAP_ARRAY(path);
|
||||
return res;
|
||||
}
|
||||
// We don't expect preview mode (i.e. --enable-preview) to affect module visibility.
|
||||
jlong size;
|
||||
return jimage_find_resource(module_name, "module-info.class", /* is_preview */ false, &size) != 0;
|
||||
}
|
||||
|
||||
jlong ClassLoader::classloader_time_ms() {
|
||||
return UsePerfData ?
|
||||
Management::ticks_to_ms(_perf_accumulated_time->get_value()) : -1;
|
||||
|
||||
@ -366,10 +366,6 @@ class ClassLoader: AllStatic {
|
||||
// JImage resource lookups or access will fail.
|
||||
static void set_preview_mode(bool enable_preview);
|
||||
|
||||
// Determines if the named module is present in the
|
||||
// modules jimage file or in the exploded modules directory.
|
||||
static bool is_module_observable(const char* module_name);
|
||||
|
||||
static void trace_class_path(const char* msg, const char* name = nullptr);
|
||||
|
||||
// VM monitoring and management support
|
||||
|
||||
@ -89,9 +89,6 @@
|
||||
#include "utilities/growableArray.hpp"
|
||||
#include "utilities/preserveException.hpp"
|
||||
#include "utilities/utf8.hpp"
|
||||
#if INCLUDE_JVMCI
|
||||
#include "jvmci/jvmciJavaClasses.hpp"
|
||||
#endif
|
||||
|
||||
#define DECLARE_INJECTED_FIELD(klass, name, signature, may_be_java) \
|
||||
{ VM_CLASS_ID(klass), VM_SYMBOL_ENUM_NAME(name##_name), VM_SYMBOL_ENUM_NAME(signature), may_be_java },
|
||||
@ -3154,23 +3151,6 @@ void java_lang_StackTraceElement::decode_file_and_line(Handle java_class,
|
||||
line_number = Backtrace::get_line_number(method(), bci);
|
||||
}
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
void java_lang_StackTraceElement::decode(const methodHandle& method, int bci,
|
||||
Symbol*& filename, int& line_number, TRAPS) {
|
||||
ResourceMark rm(THREAD);
|
||||
HandleMark hm(THREAD);
|
||||
|
||||
filename = nullptr;
|
||||
line_number = -1;
|
||||
|
||||
oop source_file;
|
||||
int version = method->constants()->version();
|
||||
InstanceKlass* holder = method->method_holder();
|
||||
Handle java_class(THREAD, holder->java_mirror());
|
||||
decode_file_and_line(java_class, holder, version, method, bci, filename, source_file, line_number, CHECK);
|
||||
}
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
// java_lang_ClassFrameInfo
|
||||
|
||||
int java_lang_ClassFrameInfo::_classOrMemberName_offset;
|
||||
@ -5102,12 +5082,6 @@ void java_lang_Integer_IntegerCache::serialize_offsets(SerializeClosure* f) {
|
||||
#endif
|
||||
#undef INTEGER_CACHE_FIELDS_DO
|
||||
|
||||
jint java_lang_Integer::value(oop obj) {
|
||||
jvalue v;
|
||||
java_lang_boxing_object::get_value(obj, &v);
|
||||
return v.i;
|
||||
}
|
||||
|
||||
#define LONG_CACHE_FIELDS_DO(macro) \
|
||||
macro(_static_cache_offset, k, "cache", java_lang_Long_array_signature, true)
|
||||
|
||||
@ -5132,12 +5106,6 @@ void java_lang_Long_LongCache::serialize_offsets(SerializeClosure* f) {
|
||||
#endif
|
||||
#undef LONG_CACHE_FIELDS_DO
|
||||
|
||||
jlong java_lang_Long::value(oop obj) {
|
||||
jvalue v;
|
||||
java_lang_boxing_object::get_value(obj, &v);
|
||||
return v.j;
|
||||
}
|
||||
|
||||
#define CHARACTER_CACHE_FIELDS_DO(macro) \
|
||||
macro(_static_cache_offset, k, "cache", java_lang_Character_array_signature, true)
|
||||
|
||||
@ -5162,12 +5130,6 @@ void java_lang_Character_CharacterCache::serialize_offsets(SerializeClosure* f)
|
||||
#endif
|
||||
#undef CHARACTER_CACHE_FIELDS_DO
|
||||
|
||||
jchar java_lang_Character::value(oop obj) {
|
||||
jvalue v;
|
||||
java_lang_boxing_object::get_value(obj, &v);
|
||||
return v.c;
|
||||
}
|
||||
|
||||
#define SHORT_CACHE_FIELDS_DO(macro) \
|
||||
macro(_static_cache_offset, k, "cache", java_lang_Short_array_signature, true)
|
||||
|
||||
@ -5192,12 +5154,6 @@ void java_lang_Short_ShortCache::serialize_offsets(SerializeClosure* f) {
|
||||
#endif
|
||||
#undef SHORT_CACHE_FIELDS_DO
|
||||
|
||||
jshort java_lang_Short::value(oop obj) {
|
||||
jvalue v;
|
||||
java_lang_boxing_object::get_value(obj, &v);
|
||||
return v.s;
|
||||
}
|
||||
|
||||
#define BYTE_CACHE_FIELDS_DO(macro) \
|
||||
macro(_static_cache_offset, k, "cache", java_lang_Byte_array_signature, true)
|
||||
|
||||
@ -5222,12 +5178,6 @@ void java_lang_Byte_ByteCache::serialize_offsets(SerializeClosure* f) {
|
||||
#endif
|
||||
#undef BYTE_CACHE_FIELDS_DO
|
||||
|
||||
jbyte java_lang_Byte::value(oop obj) {
|
||||
jvalue v;
|
||||
java_lang_boxing_object::get_value(obj, &v);
|
||||
return v.b;
|
||||
}
|
||||
|
||||
int java_lang_Boolean::_static_TRUE_offset;
|
||||
int java_lang_Boolean::_static_FALSE_offset;
|
||||
|
||||
@ -5241,16 +5191,6 @@ void java_lang_Boolean::compute_offsets(InstanceKlass *k) {
|
||||
BOOLEAN_FIELDS_DO(FIELD_COMPUTE_OFFSET);
|
||||
}
|
||||
|
||||
oop java_lang_Boolean::get_TRUE(InstanceKlass *ik) {
|
||||
oop base = ik->static_field_base_raw();
|
||||
return base->obj_field(_static_TRUE_offset);
|
||||
}
|
||||
|
||||
oop java_lang_Boolean::get_FALSE(InstanceKlass *ik) {
|
||||
oop base = ik->static_field_base_raw();
|
||||
return base->obj_field(_static_FALSE_offset);
|
||||
}
|
||||
|
||||
Symbol* java_lang_Boolean::symbol() {
|
||||
return vmSymbols::java_lang_Boolean();
|
||||
}
|
||||
@ -5262,12 +5202,6 @@ void java_lang_Boolean::serialize_offsets(SerializeClosure* f) {
|
||||
#endif
|
||||
#undef BOOLEAN_CACHE_FIELDS_DO
|
||||
|
||||
jboolean java_lang_Boolean::value(oop obj) {
|
||||
jvalue v;
|
||||
java_lang_boxing_object::get_value(obj, &v);
|
||||
return v.z;
|
||||
}
|
||||
|
||||
// java_lang_reflect_RecordComponent
|
||||
|
||||
int java_lang_reflect_RecordComponent::_clazz_offset;
|
||||
|
||||
@ -233,7 +233,6 @@ class java_lang_String : AllStatic {
|
||||
|
||||
class java_lang_Class : AllStatic {
|
||||
friend class VMStructs;
|
||||
friend class JVMCIVMStructs;
|
||||
friend class HeapShared;
|
||||
|
||||
private:
|
||||
@ -381,7 +380,6 @@ class java_lang_Class : AllStatic {
|
||||
|
||||
class java_lang_Thread : AllStatic {
|
||||
friend class java_lang_VirtualThread;
|
||||
friend class JVMCIVMStructs;
|
||||
private:
|
||||
// Note that for this class the layout changed between JDK1.2 and JDK1.3,
|
||||
// so we compute the offsets at startup rather than hard-wiring them.
|
||||
@ -1573,10 +1571,6 @@ class java_lang_StackTraceElement: AllStatic {
|
||||
static void compute_offsets();
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
static void decode(const methodHandle& method, int bci, Symbol*& fileName, int& lineNumber, TRAPS);
|
||||
#endif
|
||||
|
||||
// Debugging
|
||||
friend class JavaClasses;
|
||||
};
|
||||
@ -1770,31 +1764,6 @@ class vector_VectorPayload : AllStatic {
|
||||
static bool is_instance(oop obj);
|
||||
};
|
||||
|
||||
class java_lang_Integer : AllStatic {
|
||||
public:
|
||||
static jint value(oop obj);
|
||||
};
|
||||
|
||||
class java_lang_Long : AllStatic {
|
||||
public:
|
||||
static jlong value(oop obj);
|
||||
};
|
||||
|
||||
class java_lang_Character : AllStatic {
|
||||
public:
|
||||
static jchar value(oop obj);
|
||||
};
|
||||
|
||||
class java_lang_Short : AllStatic {
|
||||
public:
|
||||
static jshort value(oop obj);
|
||||
};
|
||||
|
||||
class java_lang_Byte : AllStatic {
|
||||
public:
|
||||
static jbyte value(oop obj);
|
||||
};
|
||||
|
||||
class java_lang_Boolean : AllStatic {
|
||||
private:
|
||||
static int _static_TRUE_offset;
|
||||
@ -1802,10 +1771,7 @@ class java_lang_Boolean : AllStatic {
|
||||
public:
|
||||
static Symbol* symbol();
|
||||
static void compute_offsets(InstanceKlass* k);
|
||||
static oop get_TRUE(InstanceKlass *k);
|
||||
static oop get_FALSE(InstanceKlass *k);
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static jboolean value(oop obj);
|
||||
};
|
||||
|
||||
class java_lang_Integer_IntegerCache : AllStatic {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -31,9 +31,6 @@
|
||||
#include "runtime/synchronizer.hpp"
|
||||
#include "services/threadService.hpp"
|
||||
#include "utilities/chunkedList.hpp"
|
||||
#if INCLUDE_JVMCI
|
||||
#include "jvmci/jvmci.hpp"
|
||||
#endif
|
||||
|
||||
MetadataOnStackBuffer* MetadataOnStackMark::_used_buffers = nullptr;
|
||||
MetadataOnStackBuffer* MetadataOnStackMark::_free_buffers = nullptr;
|
||||
@ -70,9 +67,6 @@ MetadataOnStackMark::MetadataOnStackMark(bool walk_all_metadata, bool redefiniti
|
||||
}
|
||||
CompileBroker::mark_on_stack();
|
||||
ThreadService::metadata_do(Metadata::mark_on_stack);
|
||||
#if INCLUDE_JVMCI
|
||||
JVMCI::metadata_do(Metadata::mark_on_stack);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -453,7 +453,7 @@ void Modules::define_module(Handle module, jboolean is_open, jstring version,
|
||||
ClassLoader::add_to_exploded_build_list(THREAD, module_symbol);
|
||||
}
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
#ifdef COMPILER2
|
||||
// Special handling of jdk.incubator.vector
|
||||
if (strcmp(module_name, "jdk.incubator.vector") == 0) {
|
||||
if (FLAG_IS_DEFAULT(EnableVectorSupport)) {
|
||||
@ -469,7 +469,7 @@ void Modules::define_module(Handle module, jboolean is_open, jstring version,
|
||||
log_info(compilation)("EnableVectorReboxing=%s", (EnableVectorReboxing ? "true" : "false"));
|
||||
log_info(compilation)("EnableVectorAggressiveReboxing=%s", (EnableVectorAggressiveReboxing ? "true" : "false"));
|
||||
}
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
}
|
||||
|
||||
#if INCLUDE_CDS_JAVA_HEAP
|
||||
|
||||
@ -26,7 +26,6 @@
|
||||
#define SHARE_CLASSFILE_VMSYMBOLS_HPP
|
||||
|
||||
#include "classfile/vmIntrinsics.hpp"
|
||||
#include "jvmci/vmSymbols_jvmci.hpp"
|
||||
#include "memory/iterator.hpp"
|
||||
#include "oops/symbol.hpp"
|
||||
#include "utilities/enumIterator.hpp"
|
||||
@ -356,9 +355,6 @@ class SerializeClosure;
|
||||
\
|
||||
template(jdk_internal_foreign_NativeMemorySegmentImpl, "jdk/internal/foreign/NativeMemorySegmentImpl") \
|
||||
\
|
||||
/* Support for JVMCI */ \
|
||||
JVMCI_VM_SYMBOLS_DO(template, do_alias) \
|
||||
\
|
||||
template(java_lang_ClassFrameInfo, "java/lang/ClassFrameInfo") \
|
||||
template(java_lang_StackWalker, "java/lang/StackWalker") \
|
||||
template(java_lang_StackFrameInfo, "java/lang/StackFrameInfo") \
|
||||
@ -704,12 +700,6 @@ class SerializeClosure;
|
||||
template(serializePropertiesToByteArray_name, "serializePropertiesToByteArray") \
|
||||
template(serializeSecurityPropertiesToByteArray_name, "serializeSecurityPropertiesToByteArray") \
|
||||
template(serializeAgentPropertiesToByteArray_name, "serializeAgentPropertiesToByteArray") \
|
||||
template(encodeThrowable_name, "encodeThrowable") \
|
||||
template(encodeThrowable_signature, "(Ljava/lang/Throwable;JI)I") \
|
||||
template(decodeAndThrowThrowable_name, "decodeAndThrowThrowable") \
|
||||
template(encodeAnnotations_name, "encodeAnnotations") \
|
||||
template(encodeAnnotations_signature, "([BLjava/lang/Class;Ljdk/internal/reflect/ConstantPool;Z[Ljava/lang/Class;)[B")\
|
||||
template(decodeAndThrowThrowable_signature, "(IJZZ)V") \
|
||||
template(classRedefinedCount_name, "classRedefinedCount") \
|
||||
template(classLoader_name, "classLoader") \
|
||||
template(componentType_name, "componentType") \
|
||||
@ -784,7 +774,6 @@ ENUMERATOR_RANGE(vmSymbolID, vmSymbolID::FIRST_SID, vmSymbolID::LAST_SID)
|
||||
class vmSymbols: AllStatic {
|
||||
friend class vmIntrinsics;
|
||||
friend class VMStructs;
|
||||
friend class JVMCIVMStructs;
|
||||
|
||||
static const int NO_SID = static_cast<int>(vmSymbolID::NO_SID); // exclusive lower limit
|
||||
static const int FIRST_SID = static_cast<int>(vmSymbolID::FIRST_SID); // inclusive lower limit
|
||||
|
||||
@ -1576,10 +1576,6 @@ void AOTCodeCache::publish_stub_addresses(CodeBlob &code_blob, BlobId blob_id, A
|
||||
addresses.append(deopt_blob->unpack_with_exception());
|
||||
addresses.append(deopt_blob->unpack_with_reexecution());
|
||||
addresses.append(deopt_blob->unpack_with_exception_in_tls());
|
||||
#if INCLUDE_JVMCI
|
||||
addresses.append(deopt_blob->uncommon_trap());
|
||||
addresses.append(deopt_blob->implicit_exception_uncommon_trap());
|
||||
#endif // INCLUDE_JVMCI
|
||||
cache()->add_stub_entries(stub_id, start, &addresses, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -320,14 +320,6 @@ public:
|
||||
#define AOTCODECACHE_CONFIGS_COMPILER2_DO(do_var, do_fun)
|
||||
#endif
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
#define AOTCODECACHE_CONFIGS_JVMCI_DO(do_var, do_fun) \
|
||||
do_var(bool, EnableJVMCI) /* adapters and nmethods */ \
|
||||
// END
|
||||
#else
|
||||
#define AOTCODECACHE_CONFIGS_JVMCI_DO(do_var, do_fun)
|
||||
#endif
|
||||
|
||||
#if defined(AARCH64) && !defined(ZERO)
|
||||
#define AOTCODECACHE_CONFIGS_AARCH64_DO(do_var, do_fun) \
|
||||
do_var(intx, BlockZeroingLowLimit) /* array fill stubs */ \
|
||||
@ -359,7 +351,6 @@ public:
|
||||
#define AOTCODECACHE_CONFIGS_DO(do_var, do_fun) \
|
||||
AOTCODECACHE_CONFIGS_GENERIC_DO(do_var, do_fun) \
|
||||
AOTCODECACHE_CONFIGS_COMPILER2_DO(do_var, do_fun) \
|
||||
AOTCODECACHE_CONFIGS_JVMCI_DO(do_var, do_fun) \
|
||||
AOTCODECACHE_CONFIGS_AARCH64_DO(do_var, do_fun) \
|
||||
AOTCODECACHE_CONFIGS_X86_DO(do_var, do_fun) \
|
||||
// END
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -109,7 +109,6 @@ class UncommonTrapBlob;
|
||||
|
||||
class CodeBlob {
|
||||
friend class VMStructs;
|
||||
friend class JVMCIVMStructs;
|
||||
|
||||
protected:
|
||||
// order fields from large to small to minimize padding between fields
|
||||
@ -578,7 +577,7 @@ class SingletonBlob: public RuntimeBlob {
|
||||
|
||||
class DeoptimizationBlob: public SingletonBlob {
|
||||
friend class VMStructs;
|
||||
friend class JVMCIVMStructs;
|
||||
|
||||
private:
|
||||
int _unpack_offset;
|
||||
int _unpack_with_exception;
|
||||
@ -586,12 +585,6 @@ class DeoptimizationBlob: public SingletonBlob {
|
||||
|
||||
int _unpack_with_exception_in_tls;
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
// Offsets when JVMCI calls uncommon_trap.
|
||||
int _uncommon_trap_offset;
|
||||
int _implicit_exception_uncommon_trap_offset;
|
||||
#endif
|
||||
|
||||
// Creation support
|
||||
DeoptimizationBlob(
|
||||
CodeBuffer* cb,
|
||||
@ -604,7 +597,7 @@ class DeoptimizationBlob: public SingletonBlob {
|
||||
);
|
||||
|
||||
public:
|
||||
static const int ENTRY_COUNT = 4 JVMCI_ONLY(+ 2);
|
||||
static const int ENTRY_COUNT = 4;
|
||||
// Creation
|
||||
static DeoptimizationBlob* create(
|
||||
CodeBuffer* cb,
|
||||
@ -630,21 +623,6 @@ class DeoptimizationBlob: public SingletonBlob {
|
||||
}
|
||||
address unpack_with_exception_in_tls() const { return code_begin() + _unpack_with_exception_in_tls; }
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
// Offsets when JVMCI calls uncommon_trap.
|
||||
void set_uncommon_trap_offset(int offset) {
|
||||
_uncommon_trap_offset = offset;
|
||||
assert(contains(code_begin() + _uncommon_trap_offset), "must be PC inside codeblob");
|
||||
}
|
||||
address uncommon_trap() const { return (EnableJVMCI ? code_begin() + _uncommon_trap_offset : nullptr); }
|
||||
|
||||
void set_implicit_exception_uncommon_trap_offset(int offset) {
|
||||
_implicit_exception_uncommon_trap_offset = offset;
|
||||
assert(contains(code_begin() + _implicit_exception_uncommon_trap_offset), "must be PC inside codeblob");
|
||||
}
|
||||
address implicit_exception_uncommon_trap() const { return (EnableJVMCI ? code_begin() + _implicit_exception_uncommon_trap_offset : nullptr); }
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
void post_restore_impl() {
|
||||
trace_new_stub(this, "DeoptimizationBlob");
|
||||
}
|
||||
|
||||
@ -1916,13 +1916,8 @@ void CodeCache::print_codelist(outputStream* st) {
|
||||
nmethod* nm = iter.method();
|
||||
ResourceMark rm;
|
||||
char* method_name = nm->method()->name_and_sig_as_C_string();
|
||||
const char* jvmci_name = nullptr;
|
||||
#if INCLUDE_JVMCI
|
||||
jvmci_name = nm->jvmci_name();
|
||||
#endif
|
||||
st->print_cr("%d %d %d %s%s%s [" INTPTR_FORMAT ", " INTPTR_FORMAT " - " INTPTR_FORMAT "]",
|
||||
nm->compile_id(), nm->comp_level(), nm->get_state(),
|
||||
method_name, jvmci_name ? " jvmci_name=" : "", jvmci_name ? jvmci_name : "",
|
||||
st->print_cr("%d %d %d %s [" INTPTR_FORMAT ", " INTPTR_FORMAT " - " INTPTR_FORMAT "]",
|
||||
nm->compile_id(), nm->comp_level(), nm->get_state(), method_name,
|
||||
(intptr_t)nm->header_begin(), (intptr_t)nm->code_begin(), (intptr_t)nm->code_end());
|
||||
}
|
||||
}
|
||||
@ -1965,19 +1960,14 @@ void CodeCache::write_perf_map(const char* filename, outputStream* st) {
|
||||
CodeBlob *cb = iter.method();
|
||||
ResourceMark rm;
|
||||
const char* method_name = nullptr;
|
||||
const char* jvmci_name = nullptr;
|
||||
if (cb->is_nmethod()) {
|
||||
nmethod* nm = cb->as_nmethod();
|
||||
method_name = nm->method()->external_name();
|
||||
#if INCLUDE_JVMCI
|
||||
jvmci_name = nm->jvmci_name();
|
||||
#endif
|
||||
} else {
|
||||
method_name = cb->name();
|
||||
}
|
||||
fs.print_cr(INTPTR_FORMAT " " INTPTR_FORMAT " %s%s%s",
|
||||
(intptr_t)cb->code_begin(), (intptr_t)cb->code_size(),
|
||||
method_name, jvmci_name ? " jvmci_name=" : "", jvmci_name ? jvmci_name : "");
|
||||
fs.print_cr(INTPTR_FORMAT " " INTPTR_FORMAT " %s",
|
||||
(intptr_t)cb->code_begin(), (intptr_t)cb->code_size(), method_name);
|
||||
}
|
||||
}
|
||||
#endif // LINUX
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -87,7 +87,6 @@ class ReservedSpace;
|
||||
|
||||
class CodeCache : AllStatic {
|
||||
friend class VMStructs;
|
||||
friend class JVMCIVMStructs;
|
||||
template <class T, class Filter, bool is_relaxed> friend class CodeBlobIterator;
|
||||
friend class WhiteBox;
|
||||
friend class ShenandoahParallelCodeHeapIterator;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2019 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -226,7 +226,7 @@ const char* blobTypeName[] = {"noType"
|
||||
, "buffer blob"
|
||||
, "lastType"
|
||||
};
|
||||
const char* compTypeName[] = { "none", "c1", "c2", "jvmci" };
|
||||
const char* compTypeName[] = { "none", "c1", "c2" };
|
||||
|
||||
// Be prepared for ten different CodeHeap segments. Should be enough for a few years.
|
||||
const unsigned int nSizeDistElements = 31; // logarithmic range growth, max size: 2**32
|
||||
@ -734,16 +734,6 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
|
||||
} else {
|
||||
blob_name = os::strdup(cb->name());
|
||||
}
|
||||
#if INCLUDE_JVMCI
|
||||
const char* jvmci_name = nm->jvmci_name();
|
||||
if (jvmci_name != nullptr) {
|
||||
size_t size = ::strlen(blob_name) + ::strlen(" jvmci_name=") + ::strlen(jvmci_name) + 1;
|
||||
char* new_blob_name = (char*)os::malloc(size, mtInternal);
|
||||
os::snprintf_checked(new_blob_name, size, "%s jvmci_name=%s", blob_name, jvmci_name);
|
||||
os::free((void*)blob_name);
|
||||
blob_name = new_blob_name;
|
||||
}
|
||||
#endif
|
||||
nm_size = nm->total_size();
|
||||
compile_id = nm->compile_id();
|
||||
comp_lvl = (CompLevel)(nm->comp_level());
|
||||
@ -753,9 +743,6 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
|
||||
if (nm->is_compiled_by_c2()) {
|
||||
cType = c2;
|
||||
}
|
||||
if (nm->is_compiled_by_jvmci()) {
|
||||
cType = jvmci;
|
||||
}
|
||||
switch (cbType) {
|
||||
case nMethod_inuse: { // only for executable methods!!!
|
||||
// space for these cbs is accounted for later.
|
||||
@ -2192,12 +2179,6 @@ void CodeHeapState::print_names(outputStream* out, CodeHeap* heap) {
|
||||
ast->print("%s.", classNameS);
|
||||
ast->print("%s", methNameS);
|
||||
ast->print("%s", methSigS);
|
||||
#if INCLUDE_JVMCI
|
||||
const char* jvmci_name = nm->jvmci_name();
|
||||
if (jvmci_name != nullptr) {
|
||||
ast->print(" jvmci_name=%s", jvmci_name);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
ast->print("%s", blob_name);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2019 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -38,7 +38,6 @@ class CodeHeapState : public CHeapObj<mtCode> {
|
||||
noComp = 0, // must be! due to initialization by memset to zero
|
||||
c1,
|
||||
c2,
|
||||
jvmci,
|
||||
lastComp
|
||||
};
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -61,7 +61,6 @@ public:
|
||||
|
||||
class CompiledICData : public CHeapObj<mtCode> {
|
||||
friend class VMStructs;
|
||||
friend class JVMCIVMStructs;
|
||||
|
||||
Method* volatile _speculated_method;
|
||||
uintptr_t volatile _speculated_klass;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -345,9 +345,7 @@ void ConstantDoubleValue::print_on(outputStream* st) const {
|
||||
void ConstantOopWriteValue::write_on(DebugInfoWriteStream* stream) {
|
||||
#ifdef ASSERT
|
||||
{
|
||||
// cannot use ThreadInVMfromNative here since in case of JVMCI compiler,
|
||||
// thread is already in VM state.
|
||||
ThreadInVMfromUnknown tiv;
|
||||
ThreadInVMfromNative tiv(JavaThread::current());
|
||||
assert(JNIHandles::resolve(value()) == nullptr ||
|
||||
Universe::heap()->is_in(JNIHandles::resolve(value())),
|
||||
"Should be in heap");
|
||||
@ -358,9 +356,7 @@ void ConstantOopWriteValue::write_on(DebugInfoWriteStream* stream) {
|
||||
}
|
||||
|
||||
void ConstantOopWriteValue::print_on(outputStream* st) const {
|
||||
// using ThreadInVMfromUnknown here since in case of JVMCI compiler,
|
||||
// thread is already in VM state.
|
||||
ThreadInVMfromUnknown tiv;
|
||||
ThreadInVMfromNative tiv(JavaThread::current());
|
||||
JNIHandles::resolve(value())->print_value_on(st);
|
||||
}
|
||||
|
||||
|
||||
@ -65,9 +65,6 @@ void Dependencies::initialize(ciEnv* env) {
|
||||
_oop_recorder = env->oop_recorder();
|
||||
_log = env->log();
|
||||
_dep_seen = new(arena) GrowableArray<int>(arena, 500, 0, 0);
|
||||
#if INCLUDE_JVMCI
|
||||
_using_dep_values = false;
|
||||
#endif
|
||||
DEBUG_ONLY(_deps[end_marker] = nullptr);
|
||||
for (int i = (int)FIRST_TYPE; i < (int)TYPE_LIMIT; i++) {
|
||||
_deps[i] = new(arena) GrowableArray<ciBaseObject*>(arena, 10, 0, nullptr);
|
||||
@ -129,74 +126,6 @@ void Dependencies::assert_call_site_target_value(ciCallSite* call_site, ciMethod
|
||||
assert_common_2(call_site_target_value, call_site, method_handle);
|
||||
}
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
|
||||
Dependencies::Dependencies(Arena* arena, OopRecorder* oop_recorder, CompileLog* log) {
|
||||
_oop_recorder = oop_recorder;
|
||||
_log = log;
|
||||
_dep_seen = new(arena) GrowableArray<int>(arena, 500, 0, 0);
|
||||
_using_dep_values = true;
|
||||
DEBUG_ONLY(_dep_values[end_marker] = nullptr);
|
||||
for (int i = (int)FIRST_TYPE; i < (int)TYPE_LIMIT; i++) {
|
||||
_dep_values[i] = new(arena) GrowableArray<DepValue>(arena, 10, 0, DepValue());
|
||||
}
|
||||
_content_bytes = nullptr;
|
||||
_size_in_bytes = (size_t)-1;
|
||||
|
||||
assert(TYPE_LIMIT <= (1<<LG2_TYPE_LIMIT), "sanity");
|
||||
}
|
||||
|
||||
void Dependencies::assert_evol_method(Method* m) {
|
||||
assert_common_1(evol_method, DepValue(_oop_recorder, m));
|
||||
}
|
||||
|
||||
void Dependencies::assert_has_no_finalizable_subclasses(Klass* ctxk) {
|
||||
check_ctxk(ctxk);
|
||||
assert_common_1(no_finalizable_subclasses, DepValue(_oop_recorder, ctxk));
|
||||
}
|
||||
|
||||
void Dependencies::assert_leaf_type(Klass* ctxk) {
|
||||
if (ctxk->is_array_klass()) {
|
||||
// As a special case, support this assertion on an array type,
|
||||
// which reduces to an assertion on its element type.
|
||||
// Note that this cannot be done with assertions that
|
||||
// relate to concreteness or abstractness.
|
||||
BasicType elemt = ArrayKlass::cast(ctxk)->element_type();
|
||||
if (is_java_primitive(elemt)) return; // Ex: int[][]
|
||||
ctxk = ObjArrayKlass::cast(ctxk)->bottom_klass();
|
||||
//if (ctxk->is_final()) return; // Ex: String[][]
|
||||
}
|
||||
check_ctxk(ctxk);
|
||||
assert_common_1(leaf_type, DepValue(_oop_recorder, ctxk));
|
||||
}
|
||||
|
||||
void Dependencies::assert_abstract_with_unique_concrete_subtype(Klass* ctxk, Klass* conck) {
|
||||
check_ctxk_abstract(ctxk);
|
||||
DepValue ctxk_dv(_oop_recorder, ctxk);
|
||||
DepValue conck_dv(_oop_recorder, conck, &ctxk_dv);
|
||||
assert_common_2(abstract_with_unique_concrete_subtype, ctxk_dv, conck_dv);
|
||||
}
|
||||
|
||||
void Dependencies::assert_unique_implementor(InstanceKlass* ctxk, InstanceKlass* uniqk) {
|
||||
check_ctxk(ctxk);
|
||||
assert(ctxk->is_interface(), "not an interface");
|
||||
assert(ctxk->implementor() == uniqk, "not a unique implementor");
|
||||
assert_common_2(unique_implementor, DepValue(_oop_recorder, ctxk), DepValue(_oop_recorder, uniqk));
|
||||
}
|
||||
|
||||
void Dependencies::assert_unique_concrete_method(Klass* ctxk, Method* uniqm) {
|
||||
check_ctxk(ctxk);
|
||||
check_unique_method(ctxk, uniqm);
|
||||
assert_common_2(unique_concrete_method_2, DepValue(_oop_recorder, ctxk), DepValue(_oop_recorder, uniqm));
|
||||
}
|
||||
|
||||
void Dependencies::assert_call_site_target_value(oop call_site, oop method_handle) {
|
||||
assert_common_2(call_site_target_value, DepValue(_oop_recorder, JNIHandles::make_local(call_site)), DepValue(_oop_recorder, JNIHandles::make_local(method_handle)));
|
||||
}
|
||||
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
|
||||
// Helper function. If we are adding a new dep. under ctxk2,
|
||||
// try to find an old dep. under a broader* ctxk1. If there is
|
||||
//
|
||||
@ -303,79 +232,6 @@ void Dependencies::assert_common_4(DepType dept,
|
||||
deps->append(x3);
|
||||
}
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
bool Dependencies::maybe_merge_ctxk(GrowableArray<DepValue>* deps,
|
||||
int ctxk_i, DepValue ctxk2_dv) {
|
||||
Klass* ctxk1 = deps->at(ctxk_i).as_klass(_oop_recorder);
|
||||
Klass* ctxk2 = ctxk2_dv.as_klass(_oop_recorder);
|
||||
if (ctxk2->is_subtype_of(ctxk1)) {
|
||||
return true; // success, and no need to change
|
||||
} else if (ctxk1->is_subtype_of(ctxk2)) {
|
||||
// new context class fully subsumes previous one
|
||||
deps->at_put(ctxk_i, ctxk2_dv);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void Dependencies::assert_common_1(DepType dept, DepValue x) {
|
||||
assert(dep_args(dept) == 1, "sanity");
|
||||
//log_dependency(dept, x);
|
||||
GrowableArray<DepValue>* deps = _dep_values[dept];
|
||||
|
||||
// see if the same (or a similar) dep is already recorded
|
||||
if (note_dep_seen(dept, x)) {
|
||||
assert(deps->find(x) >= 0, "sanity");
|
||||
} else {
|
||||
deps->append(x);
|
||||
}
|
||||
}
|
||||
|
||||
void Dependencies::assert_common_2(DepType dept,
|
||||
DepValue x0, DepValue x1) {
|
||||
assert(dep_args(dept) == 2, "sanity");
|
||||
//log_dependency(dept, x0, x1);
|
||||
GrowableArray<DepValue>* deps = _dep_values[dept];
|
||||
|
||||
// see if the same (or a similar) dep is already recorded
|
||||
bool has_ctxk = has_explicit_context_arg(dept);
|
||||
if (has_ctxk) {
|
||||
assert(dep_context_arg(dept) == 0, "sanity");
|
||||
if (note_dep_seen(dept, x1)) {
|
||||
// look in this bucket for redundant assertions
|
||||
const int stride = 2;
|
||||
for (int i = deps->length(); (i -= stride) >= 0; ) {
|
||||
DepValue y1 = deps->at(i+1);
|
||||
if (x1 == y1) { // same subject; check the context
|
||||
if (maybe_merge_ctxk(deps, i+0, x0)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
bool dep_seen_x0 = note_dep_seen(dept, x0); // records x0 for future queries
|
||||
bool dep_seen_x1 = note_dep_seen(dept, x1); // records x1 for future queries
|
||||
if (dep_seen_x0 && dep_seen_x1) {
|
||||
// look in this bucket for redundant assertions
|
||||
const int stride = 2;
|
||||
for (int i = deps->length(); (i -= stride) >= 0; ) {
|
||||
DepValue y0 = deps->at(i+0);
|
||||
DepValue y1 = deps->at(i+1);
|
||||
if (x0 == y0 && x1 == y1) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// append the assertion in the correct bucket:
|
||||
deps->append(x0);
|
||||
deps->append(x1);
|
||||
}
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
/// Support for encoding dependencies into an nmethod:
|
||||
|
||||
void Dependencies::copy_to(nmethod* nm) {
|
||||
@ -402,40 +258,7 @@ static int sort_dep_arg_3(ciBaseObject** p1, ciBaseObject** p2)
|
||||
static int sort_dep_arg_4(ciBaseObject** p1, ciBaseObject** p2)
|
||||
{ return sort_dep(p1, p2, 4); }
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
// metadata deps are sorted before object deps
|
||||
static int sort_dep_value(Dependencies::DepValue* p1, Dependencies::DepValue* p2, int narg) {
|
||||
for (int i = 0; i < narg; i++) {
|
||||
int diff = p1[i].sort_key() - p2[i].sort_key();
|
||||
if (diff != 0) return diff;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
static int sort_dep_value_arg_1(Dependencies::DepValue* p1, Dependencies::DepValue* p2)
|
||||
{ return sort_dep_value(p1, p2, 1); }
|
||||
static int sort_dep_value_arg_2(Dependencies::DepValue* p1, Dependencies::DepValue* p2)
|
||||
{ return sort_dep_value(p1, p2, 2); }
|
||||
static int sort_dep_value_arg_3(Dependencies::DepValue* p1, Dependencies::DepValue* p2)
|
||||
{ return sort_dep_value(p1, p2, 3); }
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
void Dependencies::sort_all_deps() {
|
||||
#if INCLUDE_JVMCI
|
||||
if (_using_dep_values) {
|
||||
for (int deptv = (int)FIRST_TYPE; deptv < (int)TYPE_LIMIT; deptv++) {
|
||||
DepType dept = (DepType)deptv;
|
||||
GrowableArray<DepValue>* deps = _dep_values[dept];
|
||||
if (deps->length() <= 1) continue;
|
||||
switch (dep_args(dept)) {
|
||||
case 1: deps->sort(sort_dep_value_arg_1, 1); break;
|
||||
case 2: deps->sort(sort_dep_value_arg_2, 2); break;
|
||||
case 3: deps->sort(sort_dep_value_arg_3, 3); break;
|
||||
default: ShouldNotReachHere(); break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif // INCLUDE_JVMCI
|
||||
for (int deptv = (int)FIRST_TYPE; deptv < (int)TYPE_LIMIT; deptv++) {
|
||||
DepType dept = (DepType)deptv;
|
||||
GrowableArray<ciBaseObject*>* deps = _deps[dept];
|
||||
@ -452,16 +275,6 @@ void Dependencies::sort_all_deps() {
|
||||
|
||||
size_t Dependencies::estimate_size_in_bytes() {
|
||||
size_t est_size = 100;
|
||||
#if INCLUDE_JVMCI
|
||||
if (_using_dep_values) {
|
||||
for (int deptv = (int)FIRST_TYPE; deptv < (int)TYPE_LIMIT; deptv++) {
|
||||
DepType dept = (DepType)deptv;
|
||||
GrowableArray<DepValue>* deps = _dep_values[dept];
|
||||
est_size += deps->length() * 2; // tags and argument(s)
|
||||
}
|
||||
return est_size;
|
||||
}
|
||||
#endif // INCLUDE_JVMCI
|
||||
for (int deptv = (int)FIRST_TYPE; deptv < (int)TYPE_LIMIT; deptv++) {
|
||||
DepType dept = (DepType)deptv;
|
||||
GrowableArray<ciBaseObject*>* deps = _deps[dept];
|
||||
@ -498,37 +311,6 @@ void Dependencies::encode_content_bytes() {
|
||||
// cast is safe, no deps can overflow INT_MAX
|
||||
CompressedWriteStream bytes((int)estimate_size_in_bytes());
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
if (_using_dep_values) {
|
||||
for (int deptv = (int)FIRST_TYPE; deptv < (int)TYPE_LIMIT; deptv++) {
|
||||
DepType dept = (DepType)deptv;
|
||||
GrowableArray<DepValue>* deps = _dep_values[dept];
|
||||
if (deps->length() == 0) continue;
|
||||
int stride = dep_args(dept);
|
||||
int ctxkj = dep_context_arg(dept); // -1 if no context arg
|
||||
assert(stride > 0, "sanity");
|
||||
for (int i = 0; i < deps->length(); i += stride) {
|
||||
jbyte code_byte = (jbyte)dept;
|
||||
int skipj = -1;
|
||||
if (ctxkj >= 0 && ctxkj+1 < stride) {
|
||||
Klass* ctxk = deps->at(i+ctxkj+0).as_klass(_oop_recorder);
|
||||
DepValue x = deps->at(i+ctxkj+1); // following argument
|
||||
if (ctxk == ctxk_encoded_as_null(dept, x.as_metadata(_oop_recorder))) {
|
||||
skipj = ctxkj; // we win: maybe one less oop to keep track of
|
||||
code_byte |= default_context_type_bit;
|
||||
}
|
||||
}
|
||||
bytes.write_byte(code_byte);
|
||||
for (int j = 0; j < stride; j++) {
|
||||
if (j == skipj) continue;
|
||||
DepValue v = deps->at(i+j);
|
||||
int idx = v.index();
|
||||
bytes.write_int(idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
#endif // INCLUDE_JVMCI
|
||||
for (int deptv = (int)FIRST_TYPE; deptv < (int)TYPE_LIMIT; deptv++) {
|
||||
DepType dept = (DepType)deptv;
|
||||
GrowableArray<ciBaseObject*>* deps = _deps[dept];
|
||||
@ -562,9 +344,6 @@ void Dependencies::encode_content_bytes() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#if INCLUDE_JVMCI
|
||||
}
|
||||
#endif
|
||||
|
||||
// write a sentinel byte to mark the end
|
||||
bytes.write_byte(end_marker);
|
||||
|
||||
@ -195,69 +195,10 @@ class Dependencies: public ResourceObj {
|
||||
|
||||
static void check_valid_dependency_type(DepType dept);
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
// A Metadata* or object value recorded in an OopRecorder
|
||||
class DepValue {
|
||||
private:
|
||||
// Unique identifier of the value within the associated OopRecorder that
|
||||
// encodes both the category of the value (0: invalid, positive: metadata, negative: object)
|
||||
// and the index within a category specific array (metadata: index + 1, object: -(index + 1))
|
||||
int _id;
|
||||
|
||||
public:
|
||||
DepValue() : _id(0) {}
|
||||
DepValue(OopRecorder* rec, Metadata* metadata, DepValue* candidate = nullptr) {
|
||||
assert(candidate == nullptr || candidate->is_metadata(), "oops");
|
||||
if (candidate != nullptr && candidate->as_metadata(rec) == metadata) {
|
||||
_id = candidate->_id;
|
||||
} else {
|
||||
_id = rec->find_index(metadata) + 1;
|
||||
}
|
||||
}
|
||||
DepValue(OopRecorder* rec, jobject obj, DepValue* candidate = nullptr) {
|
||||
assert(candidate == nullptr || candidate->is_object(), "oops");
|
||||
if (candidate != nullptr && candidate->as_object(rec) == obj) {
|
||||
_id = candidate->_id;
|
||||
} else {
|
||||
_id = -(rec->find_index(obj) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Used to sort values in ascending order of index() with metadata values preceding object values
|
||||
int sort_key() const { return -_id; }
|
||||
|
||||
bool operator == (const DepValue& other) const { return other._id == _id; }
|
||||
|
||||
bool is_valid() const { return _id != 0; }
|
||||
int index() const { assert(is_valid(), "oops"); return _id < 0 ? -(_id + 1) : _id - 1; }
|
||||
bool is_metadata() const { assert(is_valid(), "oops"); return _id > 0; }
|
||||
bool is_object() const { assert(is_valid(), "oops"); return _id < 0; }
|
||||
|
||||
Metadata* as_metadata(OopRecorder* rec) const { assert(is_metadata(), "oops"); return rec->metadata_at(index()); }
|
||||
Klass* as_klass(OopRecorder* rec) const {
|
||||
Metadata* m = as_metadata(rec);
|
||||
assert(m != nullptr, "as_metadata returned nullptr");
|
||||
assert(m->is_klass(), "oops");
|
||||
return (Klass*) m;
|
||||
}
|
||||
Method* as_method(OopRecorder* rec) const {
|
||||
Metadata* m = as_metadata(rec);
|
||||
assert(m != nullptr, "as_metadata returned nullptr");
|
||||
assert(m->is_method(), "oops");
|
||||
return (Method*) m;
|
||||
}
|
||||
jobject as_object(OopRecorder* rec) const { assert(is_object(), "oops"); return rec->oop_at(index()); }
|
||||
};
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
private:
|
||||
// State for writing a new set of dependencies:
|
||||
GrowableArray<int>* _dep_seen; // (seen[h->ident] & (1<<dept))
|
||||
GrowableArray<ciBaseObject*>* _deps[TYPE_LIMIT];
|
||||
#if INCLUDE_JVMCI
|
||||
bool _using_dep_values;
|
||||
GrowableArray<DepValue>* _dep_values[TYPE_LIMIT];
|
||||
#endif
|
||||
|
||||
static const char* _dep_name[TYPE_LIMIT];
|
||||
static int _dep_args[TYPE_LIMIT];
|
||||
@ -276,25 +217,8 @@ class Dependencies: public ResourceObj {
|
||||
return (seen & (1<<dept)) != 0;
|
||||
}
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
bool note_dep_seen(int dept, DepValue x) {
|
||||
assert(dept < BitsPerInt, "oops");
|
||||
// place metadata deps at even indexes, object deps at odd indexes
|
||||
int x_id = x.is_metadata() ? x.index() * 2 : (x.index() * 2) + 1;
|
||||
assert(_dep_seen != nullptr, "deps must be writable");
|
||||
int seen = _dep_seen->at_grow(x_id, 0);
|
||||
_dep_seen->at_put(x_id, seen | (1<<dept));
|
||||
// return true if we've already seen dept/x
|
||||
return (seen & (1<<dept)) != 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool maybe_merge_ctxk(GrowableArray<ciBaseObject*>* deps,
|
||||
int ctxk_i, ciKlass* ctxk);
|
||||
#if INCLUDE_JVMCI
|
||||
bool maybe_merge_ctxk(GrowableArray<DepValue>* deps,
|
||||
int ctxk_i, DepValue ctxk);
|
||||
#endif
|
||||
|
||||
void sort_all_deps();
|
||||
size_t estimate_size_in_bytes();
|
||||
@ -316,9 +240,6 @@ class Dependencies: public ResourceObj {
|
||||
Dependencies(ciEnv* env) {
|
||||
initialize(env);
|
||||
}
|
||||
#if INCLUDE_JVMCI
|
||||
Dependencies(Arena* arena, OopRecorder* oop_recorder, CompileLog* log);
|
||||
#endif
|
||||
|
||||
private:
|
||||
// Check for a valid context type.
|
||||
@ -354,31 +275,6 @@ class Dependencies: public ResourceObj {
|
||||
void assert_unique_implementor(ciInstanceKlass* ctxk, ciInstanceKlass* uniqk);
|
||||
void assert_has_no_finalizable_subclasses(ciKlass* ctxk);
|
||||
void assert_call_site_target_value(ciCallSite* call_site, ciMethodHandle* method_handle);
|
||||
#if INCLUDE_JVMCI
|
||||
private:
|
||||
static void check_ctxk(Klass* ctxk) {
|
||||
assert(ctxk->is_instance_klass(), "java types only");
|
||||
}
|
||||
static void check_ctxk_abstract(Klass* ctxk) {
|
||||
check_ctxk(ctxk);
|
||||
assert(ctxk->is_abstract(), "must be abstract");
|
||||
}
|
||||
static void check_unique_method(Klass* ctxk, Method* m) {
|
||||
assert(!m->can_be_statically_bound(InstanceKlass::cast(ctxk)), "redundant");
|
||||
}
|
||||
|
||||
void assert_common_1(DepType dept, DepValue x);
|
||||
void assert_common_2(DepType dept, DepValue x0, DepValue x1);
|
||||
|
||||
public:
|
||||
void assert_evol_method(Method* m);
|
||||
void assert_has_no_finalizable_subclasses(Klass* ctxk);
|
||||
void assert_leaf_type(Klass* ctxk);
|
||||
void assert_unique_implementor(InstanceKlass* ctxk, InstanceKlass* uniqk);
|
||||
void assert_unique_concrete_method(Klass* ctxk, Method* uniqm);
|
||||
void assert_abstract_with_unique_concrete_subtype(Klass* ctxk, Klass* conck);
|
||||
void assert_call_site_target_value(oop callSite, oop methodHandle);
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
// Define whether a given method or type is concrete.
|
||||
// These methods define the term "concrete" as used in this module.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -155,13 +155,6 @@ public:
|
||||
void set_size( uint size );
|
||||
void append( uint exec_off, uint cont_off );
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
void add_deoptimize(uint exec_off) {
|
||||
// Use the same offset as a marker value for deoptimization
|
||||
append(exec_off, exec_off);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Returns the offset to continue execution at. If the returned
|
||||
// value equals exec_off then the dispatch is expected to be a
|
||||
// deoptimization instead.
|
||||
|
||||
@ -86,9 +86,6 @@
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
#include "utilities/hashTable.hpp"
|
||||
#include "utilities/xmlstream.hpp"
|
||||
#if INCLUDE_JVMCI
|
||||
#include "jvmci/jvmciRuntime.hpp"
|
||||
#endif
|
||||
|
||||
#ifdef DTRACE_ENABLED
|
||||
|
||||
@ -144,10 +141,6 @@ struct java_nmethod_stats_struct {
|
||||
uint handler_table_size;
|
||||
uint scopes_pcs_size;
|
||||
uint scopes_data_size;
|
||||
#if INCLUDE_JVMCI
|
||||
uint speculations_size;
|
||||
uint jvmci_data_size;
|
||||
#endif
|
||||
|
||||
void note_nmethod(nmethod* nm) {
|
||||
nmethod_count += 1;
|
||||
@ -165,10 +158,6 @@ struct java_nmethod_stats_struct {
|
||||
dependencies_size += nm->dependencies_size();
|
||||
handler_table_size += nm->handler_table_size();
|
||||
nul_chk_table_size += nm->nul_chk_table_size();
|
||||
#if INCLUDE_JVMCI
|
||||
speculations_size += nm->speculations_size();
|
||||
jvmci_data_size += nm->jvmci_data_size();
|
||||
#endif
|
||||
}
|
||||
void print_nmethod_stats(const char* name) {
|
||||
if (nmethod_count == 0) return;
|
||||
@ -203,11 +192,6 @@ struct java_nmethod_stats_struct {
|
||||
if (metadata_size != 0) {
|
||||
tty->print_cr(" metadata = %u (%f%%)", metadata_size, (metadata_size * 100.0f)/total_mut_size);
|
||||
}
|
||||
#if INCLUDE_JVMCI
|
||||
if (jvmci_data_size != 0) {
|
||||
tty->print_cr(" JVMCI data = %u (%f%%)", jvmci_data_size, (jvmci_data_size * 100.0f)/total_mut_size);
|
||||
}
|
||||
#endif
|
||||
if (total_immut_size != 0) {
|
||||
tty->print_cr(" immutable data = %u (%f%%)", total_immut_size, (total_immut_size * 100.0f)/total_size);
|
||||
}
|
||||
@ -226,11 +210,6 @@ struct java_nmethod_stats_struct {
|
||||
if (scopes_data_size != 0) {
|
||||
tty->print_cr(" scopes data = %u (%f%%)", scopes_data_size, (scopes_data_size * 100.0f)/total_immut_size);
|
||||
}
|
||||
#if INCLUDE_JVMCI
|
||||
if (speculations_size != 0) {
|
||||
tty->print_cr(" speculations = %u (%f%%)", speculations_size, (speculations_size * 100.0f)/total_immut_size);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
@ -289,9 +268,6 @@ static java_nmethod_stats_struct c1_java_nmethod_stats;
|
||||
#ifdef COMPILER2
|
||||
static java_nmethod_stats_struct c2_java_nmethod_stats;
|
||||
#endif
|
||||
#if INCLUDE_JVMCI
|
||||
static java_nmethod_stats_struct jvmci_java_nmethod_stats;
|
||||
#endif
|
||||
static java_nmethod_stats_struct unknown_java_nmethod_stats;
|
||||
|
||||
static native_nmethod_stats_struct native_nmethod_stats;
|
||||
@ -307,11 +283,6 @@ static void note_java_nmethod(nmethod* nm) {
|
||||
if (nm->is_compiled_by_c2()) {
|
||||
c2_java_nmethod_stats.note_nmethod(nm);
|
||||
} else
|
||||
#endif
|
||||
#if INCLUDE_JVMCI
|
||||
if (nm->is_compiled_by_jvmci()) {
|
||||
jvmci_java_nmethod_stats.note_nmethod(nm);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
unknown_java_nmethod_stats.note_nmethod(nm);
|
||||
@ -926,7 +897,7 @@ void nmethod::cleanup_inline_caches_impl(bool unloading_occurred, bool clean_all
|
||||
}
|
||||
}
|
||||
|
||||
address nmethod::continuation_for_implicit_exception(address pc, bool for_div0_check) {
|
||||
address nmethod::continuation_for_implicit_exception(address pc) {
|
||||
// Exception happened outside inline-cache check code => we are inside
|
||||
// an active nmethod => use cpc to determine a return address
|
||||
int exception_offset = int(pc - code_begin());
|
||||
@ -953,18 +924,7 @@ address nmethod::continuation_for_implicit_exception(address pc, bool for_div0_c
|
||||
// Let the normal error handling report the exception
|
||||
return nullptr;
|
||||
}
|
||||
if (cont_offset == exception_offset) {
|
||||
#if INCLUDE_JVMCI
|
||||
Deoptimization::DeoptReason deopt_reason = for_div0_check ? Deoptimization::Reason_div0_check : Deoptimization::Reason_null_check;
|
||||
JavaThread *thread = JavaThread::current();
|
||||
thread->set_jvmci_implicit_exception_pc(pc);
|
||||
thread->set_pending_deoptimization(Deoptimization::make_trap_request(deopt_reason,
|
||||
Deoptimization::Action_reinterpret));
|
||||
return (SharedRuntime::deopt_blob()->implicit_exception_uncommon_trap());
|
||||
#else
|
||||
ShouldNotReachHere();
|
||||
#endif
|
||||
}
|
||||
guarantee(cont_offset != exception_offset, "continuation offset and exception offset must be different");
|
||||
return code_begin() + cont_offset;
|
||||
}
|
||||
|
||||
@ -1062,11 +1022,9 @@ static void assert_no_oops_or_metadata(nmethod* nm) {
|
||||
}
|
||||
#endif
|
||||
|
||||
static int required_mutable_data_size(CodeBuffer* code_buffer,
|
||||
int jvmci_data_size = 0) {
|
||||
static int required_mutable_data_size(CodeBuffer* code_buffer) {
|
||||
return align_up(code_buffer->total_relocation_size(), oopSize) +
|
||||
align_up(code_buffer->total_metadata_size(), oopSize) +
|
||||
align_up(jvmci_data_size, oopSize);
|
||||
align_up(code_buffer->total_metadata_size(), oopSize);
|
||||
}
|
||||
|
||||
nmethod* nmethod::new_native_nmethod(const methodHandle& method,
|
||||
@ -1131,13 +1089,7 @@ nmethod* nmethod::new_nmethod(const methodHandle& method,
|
||||
ImplicitExceptionTable* nul_chk_table,
|
||||
AbstractCompiler* compiler,
|
||||
CompLevel comp_level,
|
||||
Flags flags
|
||||
#if INCLUDE_JVMCI
|
||||
, char* speculations,
|
||||
int speculations_len,
|
||||
JVMCINMethodData* jvmci_data
|
||||
#endif
|
||||
)
|
||||
Flags flags)
|
||||
{
|
||||
assert(debug_info->oop_recorder() == code_buffer->oop_recorder(), "shared OR");
|
||||
code_buffer->finalize_oop_references(method);
|
||||
@ -1150,9 +1102,6 @@ nmethod* nmethod::new_nmethod(const methodHandle& method,
|
||||
+ align_up((int)dependencies->size_in_bytes(), oopSize)
|
||||
+ align_up(handler_table->size_in_bytes() , oopSize)
|
||||
+ align_up(nul_chk_table->size_in_bytes() , oopSize)
|
||||
#if INCLUDE_JVMCI
|
||||
+ align_up(speculations_len , oopSize)
|
||||
#endif
|
||||
+ align_up(debug_info->data_size() , oopSize);
|
||||
|
||||
// First, allocate space for immutable data in C heap.
|
||||
@ -1166,8 +1115,7 @@ nmethod* nmethod::new_nmethod(const methodHandle& method,
|
||||
}
|
||||
}
|
||||
|
||||
int mutable_data_size = required_mutable_data_size(code_buffer
|
||||
JVMCI_ONLY(COMMA (compiler->is_jvmci() ? jvmci_data->size() : 0)));
|
||||
int mutable_data_size = required_mutable_data_size(code_buffer);
|
||||
|
||||
{
|
||||
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
|
||||
@ -1176,14 +1124,7 @@ nmethod* nmethod::new_nmethod(const methodHandle& method,
|
||||
nmethod(method(), compiler->type(), nmethod_size, immutable_data_size, mutable_data_size,
|
||||
compile_id, entry_bci, immutable_data, offsets, orig_pc_offset,
|
||||
debug_info, dependencies, code_buffer, frame_size, oop_maps,
|
||||
handler_table, nul_chk_table, compiler, comp_level,
|
||||
flags
|
||||
#if INCLUDE_JVMCI
|
||||
, speculations,
|
||||
speculations_len,
|
||||
jvmci_data
|
||||
#endif
|
||||
);
|
||||
handler_table, nul_chk_table, compiler, comp_level, flags);
|
||||
|
||||
if (nm != nullptr) {
|
||||
// To make dependency checking during class loading fast, record
|
||||
@ -1317,7 +1258,6 @@ nmethod::nmethod(
|
||||
_unwind_handler_offset = 0;
|
||||
|
||||
int metadata_size = align_up(code_buffer->total_metadata_size(), wordSize);
|
||||
JVMCI_ONLY( _metadata_size = metadata_size; )
|
||||
assert(_mutable_data_size == _relocation_size + metadata_size,
|
||||
"wrong mutable data size: %d != %d + %d",
|
||||
_mutable_data_size, _relocation_size, metadata_size);
|
||||
@ -1329,9 +1269,6 @@ nmethod::nmethod(
|
||||
_handler_table_offset = 0;
|
||||
_scopes_pcs_offset = 0;
|
||||
_scopes_data_offset = 0;
|
||||
#if INCLUDE_JVMCI
|
||||
_speculations_offset = 0;
|
||||
#endif
|
||||
_immutable_data_ref_count_offset = 0;
|
||||
|
||||
code_buffer->copy_code_and_locs_to(this);
|
||||
@ -1455,16 +1392,10 @@ nmethod::nmethod(const nmethod &nm) : CodeBlob(nm._name, nm._kind, nm._size, nm.
|
||||
_deopt_handler_entry_offset = nm._deopt_handler_entry_offset;
|
||||
_unwind_handler_offset = nm._unwind_handler_offset;
|
||||
_num_stack_arg_slots = nm._num_stack_arg_slots;
|
||||
#if INCLUDE_JVMCI
|
||||
_metadata_size = nm._metadata_size;
|
||||
#endif
|
||||
_nul_chk_table_offset = nm._nul_chk_table_offset;
|
||||
_handler_table_offset = nm._handler_table_offset;
|
||||
_scopes_pcs_offset = nm._scopes_pcs_offset;
|
||||
_scopes_data_offset = nm._scopes_data_offset;
|
||||
#if INCLUDE_JVMCI
|
||||
_speculations_offset = nm._speculations_offset;
|
||||
#endif
|
||||
_immutable_data_ref_count_offset = nm._immutable_data_ref_count_offset;
|
||||
|
||||
// Increment number of references to immutable data to share it between nmethods
|
||||
@ -1626,12 +1557,6 @@ bool nmethod::is_relocatable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
if (jvmci_nmethod_data() != nullptr && jvmci_nmethod_data()->has_mirror()) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (is_unloading()) {
|
||||
return false;
|
||||
}
|
||||
@ -1680,13 +1605,7 @@ nmethod::nmethod(
|
||||
ImplicitExceptionTable* nul_chk_table,
|
||||
AbstractCompiler* compiler,
|
||||
CompLevel comp_level,
|
||||
Flags flags
|
||||
#if INCLUDE_JVMCI
|
||||
, char* speculations,
|
||||
int speculations_len,
|
||||
JVMCINMethodData* jvmci_data
|
||||
#endif
|
||||
)
|
||||
Flags flags)
|
||||
: CodeBlob("nmethod", CodeBlobKind::Nmethod, code_buffer, nmethod_size, sizeof(nmethod),
|
||||
offsets->value(CodeOffsets::Frame_Complete), frame_size, oop_maps, false, mutable_data_size),
|
||||
_deoptimization_generation(0),
|
||||
@ -1713,36 +1632,20 @@ nmethod::nmethod(
|
||||
|
||||
set_ctable_begin(header_begin() + content_offset());
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
if (compiler->is_jvmci()) {
|
||||
// JVMCI might not produce any stub sections
|
||||
if (offsets->value(CodeOffsets::Exceptions) != -1) {
|
||||
_exception_offset = code_offset() + offsets->value(CodeOffsets::Exceptions);
|
||||
} else {
|
||||
_exception_offset = -1;
|
||||
}
|
||||
if (offsets->value(CodeOffsets::Deopt) != -1) {
|
||||
_deopt_handler_entry_offset = code_offset() + offsets->value(CodeOffsets::Deopt);
|
||||
} else {
|
||||
_deopt_handler_entry_offset = -1;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
// Exception handler and deopt handler are in the stub section
|
||||
assert(offsets->value(CodeOffsets::Deopt ) != -1, "must be set");
|
||||
// Exception handler and deopt handler are in the stub section
|
||||
assert(offsets->value(CodeOffsets::Deopt ) != -1, "must be set");
|
||||
|
||||
bool has_exception_handler = (offsets->value(CodeOffsets::Exceptions) != -1);
|
||||
assert(has_exception_handler == (compiler->type() != compiler_c2),
|
||||
"C2 compiler doesn't provide exception handler stub code.");
|
||||
if (has_exception_handler) {
|
||||
_exception_offset = _stub_offset + offsets->value(CodeOffsets::Exceptions);
|
||||
} else {
|
||||
_exception_offset = -1;
|
||||
}
|
||||
|
||||
_deopt_handler_entry_offset = _stub_offset + offsets->value(CodeOffsets::Deopt);
|
||||
bool has_exception_handler = (offsets->value(CodeOffsets::Exceptions) != -1);
|
||||
assert(has_exception_handler == (compiler->type() != compiler_c2),
|
||||
"C2 compiler doesn't provide exception handler stub code.");
|
||||
if (has_exception_handler) {
|
||||
_exception_offset = _stub_offset + offsets->value(CodeOffsets::Exceptions);
|
||||
} else {
|
||||
_exception_offset = -1;
|
||||
}
|
||||
|
||||
_deopt_handler_entry_offset = _stub_offset + offsets->value(CodeOffsets::Deopt);
|
||||
|
||||
if (offsets->value(CodeOffsets::UnwindHandler) != -1) {
|
||||
// C1 generates UnwindHandler at the end of instructions section.
|
||||
// Calculate positive offset as distance between the start of stubs section
|
||||
@ -1754,11 +1657,9 @@ nmethod::nmethod(
|
||||
}
|
||||
|
||||
int metadata_size = align_up(code_buffer->total_metadata_size(), wordSize);
|
||||
JVMCI_ONLY( _metadata_size = metadata_size; )
|
||||
int jvmci_data_size = 0 JVMCI_ONLY( + align_up(compiler->is_jvmci() ? jvmci_data->size() : 0, oopSize));
|
||||
assert(_mutable_data_size == _relocation_size + metadata_size + jvmci_data_size,
|
||||
"wrong mutable data size: %d != %d + %d + %d",
|
||||
_mutable_data_size, _relocation_size, metadata_size, jvmci_data_size);
|
||||
assert(_mutable_data_size == _relocation_size + metadata_size,
|
||||
"wrong mutable data size: %d != %d + %d",
|
||||
_mutable_data_size, _relocation_size, metadata_size);
|
||||
assert(nmethod_size == data_end() - header_begin(), "wrong nmethod size: %d != %d",
|
||||
nmethod_size, (int)(code_end() - header_begin()));
|
||||
|
||||
@ -1775,12 +1676,7 @@ nmethod::nmethod(
|
||||
_scopes_pcs_offset = _handler_table_offset + align_up(handler_table->size_in_bytes(), oopSize);
|
||||
_scopes_data_offset = _scopes_pcs_offset + adjust_pcs_size(debug_info->pcs_size());
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
_speculations_offset = _scopes_data_offset + align_up(debug_info->data_size(), oopSize);
|
||||
_immutable_data_ref_count_offset = _speculations_offset + align_up(speculations_len, oopSize);
|
||||
#else
|
||||
_immutable_data_ref_count_offset = _scopes_data_offset + align_up(debug_info->data_size(), oopSize);
|
||||
#endif
|
||||
DEBUG_ONLY( int immutable_data_end_offset = _immutable_data_ref_count_offset + ImmutableDataRefCountSize; )
|
||||
assert(immutable_data_end_offset <= immutable_data_size, "wrong read-only data size: %d > %d",
|
||||
immutable_data_end_offset, immutable_data_size);
|
||||
@ -1796,30 +1692,17 @@ nmethod::nmethod(
|
||||
// Create cache after PcDesc data is copied - it will be used to initialize cache
|
||||
_pc_desc_container = new PcDescContainer(scopes_pcs_begin());
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
if (compiler->is_jvmci()) {
|
||||
// Initialize the JVMCINMethodData object inlined into nm
|
||||
jvmci_nmethod_data()->copy(jvmci_data);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Copy contents of ExceptionHandlerTable to nmethod
|
||||
handler_table->copy_to(this);
|
||||
nul_chk_table->copy_to(this);
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
// Copy speculations to nmethod
|
||||
if (speculations_size() != 0) {
|
||||
memcpy(speculations_begin(), speculations, speculations_len);
|
||||
}
|
||||
#endif
|
||||
init_immutable_data_ref_count();
|
||||
|
||||
post_init();
|
||||
|
||||
// we use the information of entry points to find out if a method is
|
||||
// static or non static
|
||||
assert(compiler->is_c2() || compiler->is_jvmci() ||
|
||||
assert(compiler->is_c2() ||
|
||||
_method->is_static() == (entry_point() == verified_entry_point()),
|
||||
" entry points must be same for static methods and vice versa");
|
||||
}
|
||||
@ -1835,16 +1718,6 @@ void nmethod::log_identity(xmlStream* log) const {
|
||||
if (TieredCompilation) {
|
||||
log->print(" level='%d'", comp_level());
|
||||
}
|
||||
#if INCLUDE_JVMCI
|
||||
if (jvmci_nmethod_data() != nullptr) {
|
||||
const char* jvmci_name = jvmci_nmethod_data()->name();
|
||||
if (jvmci_name != nullptr) {
|
||||
log->print(" jvmci_mirror_name='");
|
||||
log->text("%s", jvmci_name);
|
||||
log->print("'");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -1953,10 +1826,6 @@ void nmethod::print_nmethod(bool printmethod) {
|
||||
tty->cr();
|
||||
tty->print_cr("============================= C1-compiled nmethod ==============================");
|
||||
}
|
||||
if (is_compiled_by_jvmci()) {
|
||||
tty->cr();
|
||||
tty->print_cr("=========================== JVMCI-compiled nmethod =============================");
|
||||
}
|
||||
tty->print_cr("----------------------------------- Assembly -----------------------------------");
|
||||
decode2(tty);
|
||||
#if defined(SUPPORT_DATA_STRUCTS)
|
||||
@ -2248,13 +2117,10 @@ bool nmethod::is_maybe_on_stack() {
|
||||
}
|
||||
|
||||
void nmethod::inc_decompile_count() {
|
||||
if (!is_compiled_by_c2() && !is_compiled_by_jvmci()) return;
|
||||
// Could be gated by ProfileTraps, but do not bother...
|
||||
#if INCLUDE_JVMCI
|
||||
if (jvmci_skip_profile_deopt()) {
|
||||
if (!is_compiled_by_c2()) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
// Could be gated by ProfileTraps, but do not bother...
|
||||
Method* m = method();
|
||||
if (m == nullptr) return;
|
||||
MethodData* mdo = m->method_data();
|
||||
@ -2378,14 +2244,6 @@ bool nmethod::make_not_entrant(InvalidationReason invalidation_reason) {
|
||||
|
||||
} // leave critical region under NMethodState_lock
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
// Invalidate can't occur while holding the NMethodState_lock
|
||||
JVMCINMethodData* nmethod_data = jvmci_nmethod_data();
|
||||
if (nmethod_data != nullptr) {
|
||||
nmethod_data->invalidate_nmethod_mirror(this, invalidation_reason);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ASSERT
|
||||
if (is_osr_method() && method() != nullptr) {
|
||||
// Make sure osr nmethod is invalidated, i.e. not on the list
|
||||
@ -2416,16 +2274,6 @@ void nmethod::unlink() {
|
||||
invalidate_osr_method();
|
||||
}
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
// Clear the link between this nmethod and a HotSpotNmethod mirror
|
||||
JVMCINMethodData* nmethod_data = jvmci_nmethod_data();
|
||||
if (nmethod_data != nullptr) {
|
||||
nmethod_data->invalidate_nmethod_mirror(this, is_cold() ?
|
||||
nmethod::InvalidationReason::UNLOADING_COLD :
|
||||
nmethod::InvalidationReason::UNLOADING);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Post before flushing as jmethodID is being used
|
||||
post_compiled_method_unload();
|
||||
|
||||
@ -2488,7 +2336,6 @@ void nmethod::purge(bool unregister_nmethod) {
|
||||
|
||||
CodeCache::unregister_old_nmethod(this);
|
||||
|
||||
JVMCI_ONLY( _metadata_size = 0; )
|
||||
CodeBlob::purge();
|
||||
}
|
||||
|
||||
@ -3305,30 +3152,6 @@ void nmethod::verify() {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
#if INCLUDE_JVMCI
|
||||
{
|
||||
// Verify that implicit exceptions that deoptimize have a PcDesc and OopMap
|
||||
ImmutableOopMapSet* oms = oop_maps();
|
||||
ImplicitExceptionTable implicit_table(this);
|
||||
for (uint i = 0; i < implicit_table.len(); i++) {
|
||||
int exec_offset = (int) implicit_table.get_exec_offset(i);
|
||||
if (implicit_table.get_exec_offset(i) == implicit_table.get_cont_offset(i)) {
|
||||
assert(pc_desc_at(code_begin() + exec_offset) != nullptr, "missing PcDesc");
|
||||
bool found = false;
|
||||
for (int i = 0, imax = oms->count(); i < imax; i++) {
|
||||
if (oms->pair_at(i)->pc_offset() == exec_offset) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
assert(found, "missing oopmap");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
VerifyOopsClosure voc(this);
|
||||
oops_do(&voc);
|
||||
assert(voc.ok(), "embedded oops must be OK");
|
||||
@ -3422,8 +3245,6 @@ void nmethod::print_on_impl(outputStream* st) const {
|
||||
st->print("(c1) ");
|
||||
} else if (is_compiled_by_c2()) {
|
||||
st->print("(c2) ");
|
||||
} else if (is_compiled_by_jvmci()) {
|
||||
st->print("(JVMCI) ");
|
||||
} else {
|
||||
st->print("(n/a) ");
|
||||
}
|
||||
@ -3469,12 +3290,6 @@ void nmethod::print_on_impl(outputStream* st) const {
|
||||
p2i(metadata_begin()),
|
||||
p2i(metadata_end()),
|
||||
metadata_size());
|
||||
#if INCLUDE_JVMCI
|
||||
if (jvmci_data_size () > 0) st->print_cr(" JVMCI data [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
|
||||
p2i(jvmci_data_begin()),
|
||||
p2i(jvmci_data_end()),
|
||||
jvmci_data_size());
|
||||
#endif
|
||||
if (immutable_data_size() > 0) st->print_cr(" immutable data [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
|
||||
p2i(immutable_data_begin()),
|
||||
p2i(immutable_data_end()),
|
||||
@ -3499,12 +3314,6 @@ void nmethod::print_on_impl(outputStream* st) const {
|
||||
p2i(scopes_data_begin()),
|
||||
p2i(scopes_data_end()),
|
||||
scopes_data_size());
|
||||
#if INCLUDE_JVMCI
|
||||
if (speculations_size () > 0) st->print_cr(" speculations [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
|
||||
p2i(speculations_begin()),
|
||||
p2i(speculations_end()),
|
||||
speculations_size());
|
||||
#endif
|
||||
}
|
||||
|
||||
void nmethod::print_code() {
|
||||
@ -4077,8 +3886,8 @@ const char* nmethod::nmethod_section_label(address pos) const {
|
||||
if (pos == consts_begin() && pos != insts_begin()) label = "[Constants]";
|
||||
// Check stub_code before checking exception_handler or deopt_handler.
|
||||
if (pos == this->stub_begin()) label = "[Stub Code]";
|
||||
if (JVMCI_ONLY(_exception_offset >= 0 &&) pos == exception_begin()) label = "[Exception Handler]";
|
||||
if (JVMCI_ONLY(_deopt_handler_entry_offset != -1 &&) pos == deopt_handler_entry()) label = "[Deopt Handler Entry Point]";
|
||||
if (pos == exception_begin()) label = "[Exception Handler]";
|
||||
if (pos == deopt_handler_entry()) label = "[Deopt Handler Entry Point]";
|
||||
return label;
|
||||
}
|
||||
|
||||
@ -4229,12 +4038,7 @@ void nmethod::print_code_comment_on(outputStream* st, int column, address begin,
|
||||
const ImmutableOopMap* om = pair->get_from(oms);
|
||||
address pc = base + pair->pc_offset();
|
||||
if (pc >= begin) {
|
||||
#if INCLUDE_JVMCI
|
||||
bool is_implicit_deopt = implicit_table.continuation_offset(pair->pc_offset()) == (uint) pair->pc_offset();
|
||||
#else
|
||||
bool is_implicit_deopt = false;
|
||||
#endif
|
||||
if (is_implicit_deopt ? pc == begin : pc > begin && pc <= end) {
|
||||
if (pc > begin && pc <= end) {
|
||||
st->move_to(column, 6, 0);
|
||||
st->print("; ");
|
||||
om->print_on(st);
|
||||
@ -4428,9 +4232,6 @@ void nmethod::print_statistics() {
|
||||
#endif
|
||||
#ifdef COMPILER2
|
||||
c2_java_nmethod_stats.print_nmethod_stats("C2");
|
||||
#endif
|
||||
#if INCLUDE_JVMCI
|
||||
jvmci_java_nmethod_stats.print_nmethod_stats("JVMCI");
|
||||
#endif
|
||||
unknown_java_nmethod_stats.print_nmethod_stats("Unknown");
|
||||
DebugInformationRecorder::print_statistics();
|
||||
@ -4441,25 +4242,3 @@ void nmethod::print_statistics() {
|
||||
}
|
||||
|
||||
#endif // !PRODUCT
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
void nmethod::update_speculation(JavaThread* thread) {
|
||||
jlong speculation = thread->pending_failed_speculation();
|
||||
if (speculation != 0) {
|
||||
guarantee(jvmci_nmethod_data() != nullptr, "failed speculation in nmethod without failed speculation list");
|
||||
jvmci_nmethod_data()->add_failed_speculation(this, speculation);
|
||||
thread->set_pending_failed_speculation(0);
|
||||
}
|
||||
}
|
||||
|
||||
const char* nmethod::jvmci_name() {
|
||||
if (jvmci_nmethod_data() != nullptr) {
|
||||
return jvmci_nmethod_data()->name();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool nmethod::jvmci_skip_profile_deopt() const {
|
||||
return jvmci_nmethod_data() != nullptr && !jvmci_nmethod_data()->profile_deopt();
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -146,7 +146,6 @@ public:
|
||||
// As a CodeBlob, an nmethod references [mutable data] allocated on the C heap:
|
||||
// - CodeBlob relocation data
|
||||
// - Metainfo
|
||||
// - JVMCI data
|
||||
//
|
||||
// An nmethod references [immutable data] allocated on C heap:
|
||||
// - Dependency assertions data
|
||||
@ -155,19 +154,11 @@ public:
|
||||
// - Debugging information:
|
||||
// - Scopes data array
|
||||
// - Scopes pcs array
|
||||
// - JVMCI speculations array
|
||||
// - Nmethod reference counter
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
class FailedSpeculation;
|
||||
class JVMCINMethodData;
|
||||
#endif
|
||||
|
||||
class nmethod : public CodeBlob {
|
||||
friend class VMStructs;
|
||||
friend class JVMCIVMStructs;
|
||||
friend class CodeCache; // scavengable oops
|
||||
friend class JVMCINMethodData;
|
||||
friend class DeoptimizationScope;
|
||||
|
||||
#define ImmutableDataRefCountSize ((int)sizeof(int))
|
||||
@ -236,21 +227,12 @@ class nmethod : public CodeBlob {
|
||||
// Number of arguments passed on the stack
|
||||
uint16_t _num_stack_arg_slots;
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
// _metadata_size is not specific to JVMCI. In the non-JVMCI case, it can be derived as:
|
||||
// _metadata_size = mutable_data_size - relocation_size
|
||||
int _metadata_size;
|
||||
#endif
|
||||
|
||||
// Offset in immutable data section
|
||||
// _dependencies_offset == 0
|
||||
uint16_t _nul_chk_table_offset;
|
||||
uint16_t _handler_table_offset; // This table could be big in C1 code
|
||||
int _scopes_pcs_offset;
|
||||
int _scopes_data_offset;
|
||||
#if INCLUDE_JVMCI
|
||||
int _speculations_offset;
|
||||
#endif
|
||||
int _immutable_data_ref_count_offset;
|
||||
|
||||
// location in frame (offset for sp) that deopt can store the original
|
||||
@ -364,13 +346,7 @@ private:
|
||||
ImplicitExceptionTable* nul_chk_table,
|
||||
AbstractCompiler* compiler,
|
||||
CompLevel comp_level,
|
||||
Flags flags
|
||||
#if INCLUDE_JVMCI
|
||||
, char* speculations = nullptr,
|
||||
int speculations_len = 0,
|
||||
JVMCINMethodData* jvmci_data = nullptr
|
||||
#endif
|
||||
);
|
||||
Flags flags);
|
||||
|
||||
nmethod(const nmethod &nm);
|
||||
|
||||
@ -511,8 +487,6 @@ private:
|
||||
void oops_do_set_strong_done(nmethod* old_head);
|
||||
|
||||
public:
|
||||
// If you change anything in this enum please patch
|
||||
// vmStructs_jvmci.cpp accordingly.
|
||||
enum class InvalidationReason : s1 {
|
||||
NOT_INVALIDATED = -1,
|
||||
C1_CODEPATCH,
|
||||
@ -522,10 +496,6 @@ public:
|
||||
CI_REPLAY,
|
||||
UNLOADING,
|
||||
UNLOADING_COLD,
|
||||
JVMCI_INVALIDATE,
|
||||
JVMCI_MATERIALIZE_VIRTUAL_OBJECT,
|
||||
JVMCI_REPLACED_WITH_NEW_CODE,
|
||||
JVMCI_REPROFILE,
|
||||
MARKED_FOR_DEOPTIMIZATION,
|
||||
MISSING_EXCEPTION_HANDLER,
|
||||
NOT_USED,
|
||||
@ -553,14 +523,6 @@ public:
|
||||
return "C1 predicate failed trap";
|
||||
case InvalidationReason::CI_REPLAY:
|
||||
return "CI replay";
|
||||
case InvalidationReason::JVMCI_INVALIDATE:
|
||||
return "JVMCI invalidate";
|
||||
case InvalidationReason::JVMCI_MATERIALIZE_VIRTUAL_OBJECT:
|
||||
return "JVMCI materialize virtual object";
|
||||
case InvalidationReason::JVMCI_REPLACED_WITH_NEW_CODE:
|
||||
return "JVMCI replaced with new code";
|
||||
case InvalidationReason::JVMCI_REPROFILE:
|
||||
return "JVMCI reprofile";
|
||||
case InvalidationReason::MARKED_FOR_DEOPTIMIZATION:
|
||||
return "marked for deoptimization";
|
||||
case InvalidationReason::MISSING_EXCEPTION_HANDLER:
|
||||
@ -605,13 +567,7 @@ public:
|
||||
ImplicitExceptionTable* nul_chk_table,
|
||||
AbstractCompiler* compiler,
|
||||
CompLevel comp_level,
|
||||
Flags flags
|
||||
#if INCLUDE_JVMCI
|
||||
, char* speculations = nullptr,
|
||||
int speculations_len = 0,
|
||||
JVMCINMethodData* jvmci_data = nullptr
|
||||
#endif
|
||||
);
|
||||
Flags flags);
|
||||
|
||||
// Relocate the nmethod to the code heap identified by code_blob_type.
|
||||
// Returns nullptr if the code heap does not have enough space, the
|
||||
@ -646,7 +602,6 @@ public:
|
||||
|
||||
inline bool is_compiled_by_c1 () const { return _compiler_type == compiler_c1; }
|
||||
inline bool is_compiled_by_c2 () const { return _compiler_type == compiler_c2; }
|
||||
inline bool is_compiled_by_jvmci() const { return _compiler_type == compiler_jvmci; }
|
||||
CompilerType compiler_type () const { return _compiler_type; }
|
||||
const char* compiler_name () const;
|
||||
|
||||
@ -665,13 +620,7 @@ public:
|
||||
|
||||
// mutable data
|
||||
Metadata** metadata_begin () const { return (Metadata**) (mutable_data_begin() + _relocation_size); }
|
||||
#if INCLUDE_JVMCI
|
||||
Metadata** metadata_end () const { return (Metadata**) (mutable_data_begin() + _relocation_size + _metadata_size); }
|
||||
address jvmci_data_begin () const { return mutable_data_begin() + _relocation_size + _metadata_size; }
|
||||
address jvmci_data_end () const { return mutable_data_end(); }
|
||||
#else
|
||||
Metadata** metadata_end () const { return (Metadata**) mutable_data_end(); }
|
||||
#endif
|
||||
|
||||
// immutable data
|
||||
address immutable_data_begin () const { return _immutable_data; }
|
||||
@ -686,13 +635,7 @@ public:
|
||||
PcDesc* scopes_pcs_end () const { return (PcDesc*)(_immutable_data + _scopes_data_offset) ; }
|
||||
address scopes_data_begin () const { return _immutable_data + _scopes_data_offset ; }
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
address scopes_data_end () const { return _immutable_data + _speculations_offset ; }
|
||||
address speculations_begin () const { return _immutable_data + _speculations_offset ; }
|
||||
address speculations_end () const { return _immutable_data + _immutable_data_ref_count_offset ; }
|
||||
#else
|
||||
address scopes_data_end () const { return _immutable_data + _immutable_data_ref_count_offset ; }
|
||||
#endif
|
||||
address immutable_data_ref_count_begin () const { return _immutable_data + _immutable_data_ref_count_offset ; }
|
||||
|
||||
// Sizes
|
||||
@ -707,10 +650,6 @@ public:
|
||||
int dependencies_size () const { return int( dependencies_end () - dependencies_begin ()); }
|
||||
int handler_table_size () const { return int( handler_table_end() - handler_table_begin()); }
|
||||
int nul_chk_table_size () const { return int( nul_chk_table_end() - nul_chk_table_begin()); }
|
||||
#if INCLUDE_JVMCI
|
||||
int speculations_size () const { return int( speculations_end () - speculations_begin ()); }
|
||||
int jvmci_data_size () const { return int( jvmci_data_end () - jvmci_data_begin ()); }
|
||||
#endif
|
||||
|
||||
int oops_count() const { assert(oops_size() % oopSize == 0, ""); return (oops_size() / oopSize) + 1; }
|
||||
int metadata_count() const { assert(metadata_size() % wordSize == 0, ""); return (metadata_size() / wordSize) + 1; }
|
||||
@ -879,15 +818,12 @@ public:
|
||||
void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f);
|
||||
|
||||
// implicit exceptions support
|
||||
address continuation_for_implicit_div0_exception(address pc) { return continuation_for_implicit_exception(pc, true); }
|
||||
address continuation_for_implicit_null_exception(address pc) { return continuation_for_implicit_exception(pc, false); }
|
||||
address continuation_for_implicit_exception(address pc);
|
||||
|
||||
// Inline cache support for class unloading and nmethod unloading
|
||||
private:
|
||||
void cleanup_inline_caches_impl(bool unloading_occurred, bool clean_all);
|
||||
|
||||
address continuation_for_implicit_exception(address pc, bool for_div0_check);
|
||||
|
||||
public:
|
||||
// Serial version used by whitebox test
|
||||
void cleanup_inline_caches_whitebox();
|
||||
@ -938,26 +874,6 @@ public:
|
||||
// Evolution support. We make old (discarded) compiled methods point to new Method*s.
|
||||
void set_method(Method* method) { _method = method; }
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
// Gets the JVMCI name of this nmethod.
|
||||
const char* jvmci_name();
|
||||
|
||||
// Records the pending failed speculation in the
|
||||
// JVMCI speculation log associated with this nmethod.
|
||||
void update_speculation(JavaThread* thread);
|
||||
|
||||
// Gets the data specific to a JVMCI compiled method.
|
||||
// This returns a non-nullptr value iff this nmethod was
|
||||
// compiled by the JVMCI compiler.
|
||||
JVMCINMethodData* jvmci_nmethod_data() const {
|
||||
return jvmci_data_size() == 0 ? nullptr : (JVMCINMethodData*) jvmci_data_begin();
|
||||
}
|
||||
|
||||
// Returns true if the runtime should NOT collect deoptimization profile for a JVMCI
|
||||
// compiled method
|
||||
bool jvmci_skip_profile_deopt() const;
|
||||
#endif
|
||||
|
||||
void oops_do(OopClosure* f);
|
||||
|
||||
// All-in-one claiming of nmethods: returns true if the caller successfully claimed that
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -263,8 +263,8 @@ void ScopeDesc::print_on(outputStream* st, PcDesc* pd) const {
|
||||
}
|
||||
}
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
if (NOT_JVMCI(DoEscapeAnalysis &&) is_top() && _objects != nullptr) {
|
||||
#ifdef COMPILER2
|
||||
if (DoEscapeAnalysis && is_top() && _objects != nullptr) {
|
||||
st->print_cr(" Objects");
|
||||
for (int i = 0; i < _objects->length(); i++) {
|
||||
ObjectValue* sv = (ObjectValue*) _objects->at(i);
|
||||
@ -278,7 +278,7 @@ void ScopeDesc::print_on(outputStream* st, PcDesc* pd) const {
|
||||
st->cr();
|
||||
}
|
||||
}
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
#endif // COMPILER2
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -146,12 +146,8 @@ class AbstractCompiler : public CHeapObj<mtCompiler> {
|
||||
// Compiler type queries.
|
||||
bool is_c1() const { return _type == compiler_c1; }
|
||||
bool is_c2() const { return _type == compiler_c2; }
|
||||
bool is_jvmci() const { return _type == compiler_jvmci; }
|
||||
CompilerType type() const { return _type; }
|
||||
|
||||
// Compiler threads are hidden by default.
|
||||
virtual bool is_hidden_from_external_view() const { return true; }
|
||||
|
||||
// Customization
|
||||
virtual void initialize () = 0;
|
||||
|
||||
@ -168,18 +164,6 @@ class AbstractCompiler : public CHeapObj<mtCompiler> {
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
|
||||
// Notifies this compiler that the current thread (`current`) is about to stop.
|
||||
// The current thread currently holds the CompileThread_lock.
|
||||
virtual void stopping_compiler_thread(CompilerThread* current) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
// Notifies this compiler that queue is empty just prior to waiting on
|
||||
// MethodCompileQueue_lock which is held by the current thread (`thread`).
|
||||
virtual void on_empty_queue(CompileQueue* queue, CompilerThread* thread) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
// Print compilation timers and statistics
|
||||
virtual void print_timers() {
|
||||
ShouldNotReachHere();
|
||||
|
||||
@ -48,9 +48,6 @@
|
||||
#ifdef COMPILER2
|
||||
#include "opto/c2compiler.hpp"
|
||||
#endif
|
||||
#if INCLUDE_JVMCI
|
||||
#include "jvmci/jvmci.hpp"
|
||||
#endif
|
||||
|
||||
int64_t CompilationPolicy::_start_time = 0;
|
||||
int CompilationPolicy::_c1_count = 0;
|
||||
@ -194,7 +191,7 @@ static inline CompLevel adjust_level_for_compilability_query(CompLevel comp_leve
|
||||
if (comp_level == CompLevel_any) {
|
||||
if (CompilerConfig::is_c1_only()) {
|
||||
comp_level = CompLevel_simple;
|
||||
} else if (CompilerConfig::is_c2_or_jvmci_compiler_only()) {
|
||||
} else if (CompilerConfig::is_c2_only()) {
|
||||
comp_level = CompLevel_full_optimization;
|
||||
}
|
||||
}
|
||||
@ -240,34 +237,6 @@ bool CompilationPolicy::is_compilation_enabled() {
|
||||
return CompileBroker::should_compile_new_jobs();
|
||||
}
|
||||
|
||||
CompileTask* CompilationPolicy::select_task_helper(CompileQueue* compile_queue) {
|
||||
// Remove unloaded methods from the queue
|
||||
for (CompileTask* task = compile_queue->first(); task != nullptr; ) {
|
||||
CompileTask* next = task->next();
|
||||
if (task->is_unloaded()) {
|
||||
compile_queue->remove_and_mark_stale(task);
|
||||
}
|
||||
task = next;
|
||||
}
|
||||
#if INCLUDE_JVMCI
|
||||
if (UseJVMCICompiler && !BackgroundCompilation) {
|
||||
/*
|
||||
* In blocking compilation mode, the CompileBroker will make
|
||||
* compilations submitted by a JVMCI compiler thread non-blocking. These
|
||||
* compilations should be scheduled after all blocking compilations
|
||||
* to service non-compiler related compilations sooner and reduce the
|
||||
* chance of such compilations timing out.
|
||||
*/
|
||||
for (CompileTask* task = compile_queue->first(); task != nullptr; task = task->next()) {
|
||||
if (task->is_blocking()) {
|
||||
return task;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return compile_queue->first();
|
||||
}
|
||||
|
||||
// Simple methods are as good being compiled with C1 as C2.
|
||||
// Determine if a given method is such a case.
|
||||
bool CompilationPolicy::is_trivial(const methodHandle& method) {
|
||||
@ -278,20 +247,6 @@ bool CompilationPolicy::is_trivial(const methodHandle& method) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CompilationPolicy::force_comp_at_level_simple(const methodHandle& method) {
|
||||
if (CompilationModeFlag::quick_internal()) {
|
||||
#if INCLUDE_JVMCI
|
||||
if (UseJVMCICompiler) {
|
||||
AbstractCompiler* comp = CompileBroker::compiler(CompLevel_full_optimization);
|
||||
if (comp != nullptr && comp->is_jvmci() && ((JVMCICompiler*) comp)->force_comp_at_level_simple(method)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
CompLevel CompilationPolicy::comp_level(Method* method) {
|
||||
nmethod *nm = method->code();
|
||||
if (nm != nullptr && nm->is_in_use()) {
|
||||
@ -559,7 +514,7 @@ void CompilationPolicy::initialize() {
|
||||
if (!CompilerConfig::is_interpreter_only()) {
|
||||
int count = CICompilerCount;
|
||||
bool c1_only = CompilerConfig::is_c1_only();
|
||||
bool c2_only = CompilerConfig::is_c2_or_jvmci_compiler_only();
|
||||
bool c2_only = CompilerConfig::is_c2_only();
|
||||
int min_count = (c1_only || c2_only) ? 1 : 2;
|
||||
|
||||
#ifdef _LP64
|
||||
@ -617,18 +572,8 @@ void CompilationPolicy::initialize() {
|
||||
// No C1 compiler threads are needed
|
||||
set_c2_count(count);
|
||||
} else {
|
||||
#if INCLUDE_JVMCI
|
||||
if (UseJVMCICompiler && UseJVMCINativeLibrary) {
|
||||
int libjvmci_count = MAX2((int) (count * JVMCINativeLibraryThreadFraction), 1);
|
||||
int c1_count = MAX2(count - libjvmci_count, 1);
|
||||
set_c2_count(libjvmci_count);
|
||||
set_c1_count(c1_count);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
set_c1_count(MAX2(count / 3, 1));
|
||||
set_c2_count(MAX2(count - c1_count(), 1));
|
||||
}
|
||||
set_c1_count(MAX2(count / 3, 1));
|
||||
set_c2_count(MAX2(count - c1_count(), 1));
|
||||
}
|
||||
assert(count == c1_count() + c2_count(), "inconsistent compiler thread count");
|
||||
set_increase_threshold_at_ratio();
|
||||
@ -649,7 +594,7 @@ bool CompilationPolicy::verify_level(CompLevel level) {
|
||||
if (!CompilerConfig::is_c1_enabled() && is_c1_compile(level)) {
|
||||
return false;
|
||||
}
|
||||
if (!CompilerConfig::is_c2_or_jvmci_compiler_enabled() && is_c2_compile(level)) {
|
||||
if (!CompilerConfig::is_c2_enabled() && is_c2_compile(level)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -663,8 +608,6 @@ bool CompilationPolicy::verify_level(CompLevel level) {
|
||||
return level == CompLevel_simple;
|
||||
} else if (CompilationModeFlag::high_only()) {
|
||||
return level == CompLevel_full_optimization;
|
||||
} else if (CompilationModeFlag::high_only_quick_internal()) {
|
||||
return level == CompLevel_full_optimization || level == CompLevel_simple;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -675,7 +618,7 @@ CompLevel CompilationPolicy::highest_compile_level() {
|
||||
CompLevel level = CompLevel_none;
|
||||
// Setup the maximum level available for the current compiler configuration.
|
||||
if (!CompilerConfig::is_interpreter_only()) {
|
||||
if (CompilerConfig::is_c2_or_jvmci_compiler_enabled()) {
|
||||
if (CompilerConfig::is_c2_enabled()) {
|
||||
level = CompLevel_full_optimization;
|
||||
} else if (CompilerConfig::is_c1_enabled()) {
|
||||
if (CompilerConfig::is_c1_simple_only()) {
|
||||
@ -696,7 +639,6 @@ CompLevel CompilationPolicy::highest_compile_level() {
|
||||
if (!CompilationModeFlag::normal()) {
|
||||
// a) quick_only - levels 2,3,4 are invalid; levels -1,0,1 are valid;
|
||||
// b) high_only - levels 1,2,3 are invalid; levels -1,0,4 are valid;
|
||||
// c) high_only_quick_internal - levels 2,3 are invalid; levels -1,0,1,4 are valid.
|
||||
if (CompilationModeFlag::quick_only()) {
|
||||
if (level == CompLevel_limited_profile || level == CompLevel_full_profile || level == CompLevel_full_optimization) {
|
||||
level = CompLevel_simple;
|
||||
@ -705,10 +647,6 @@ CompLevel CompilationPolicy::highest_compile_level() {
|
||||
if (level == CompLevel_simple || level == CompLevel_limited_profile || level == CompLevel_full_profile) {
|
||||
level = CompLevel_none;
|
||||
}
|
||||
} else if (CompilationModeFlag::high_only_quick_internal()) {
|
||||
if (level == CompLevel_limited_profile || level == CompLevel_full_profile) {
|
||||
level = CompLevel_simple;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -730,12 +668,6 @@ CompLevel CompilationPolicy::initial_compile_level(const methodHandle& method) {
|
||||
level = CompLevel_simple;
|
||||
} else if (CompilationModeFlag::high_only()) {
|
||||
level = CompLevel_full_optimization;
|
||||
} else if (CompilationModeFlag::high_only_quick_internal()) {
|
||||
if (force_comp_at_level_simple(method)) {
|
||||
level = CompLevel_simple;
|
||||
} else {
|
||||
level = CompLevel_full_optimization;
|
||||
}
|
||||
}
|
||||
assert(level != CompLevel_any, "Unhandled compilation mode");
|
||||
return limit_level(level);
|
||||
@ -805,11 +737,6 @@ CompileTask* CompilationPolicy::select_task(CompileQueue* compile_queue, JavaThr
|
||||
}
|
||||
|
||||
if (max_blocking_task != nullptr) {
|
||||
// In blocking compilation mode, the CompileBroker will make
|
||||
// compilations submitted by a JVMCI compiler thread non-blocking. These
|
||||
// compilations should be scheduled after all blocking compilations
|
||||
// to service non-compiler related compilations sooner and reduce the
|
||||
// chance of such compilations timing out.
|
||||
max_task = max_blocking_task;
|
||||
max_method = max_task->method();
|
||||
}
|
||||
@ -1075,7 +1002,7 @@ bool CompilationPolicy::is_mature(MethodData* mdo) {
|
||||
// start profiling without waiting for the compiled method to arrive.
|
||||
// We also take the load on compilers into the account.
|
||||
bool CompilationPolicy::should_create_mdo(const methodHandle& method, CompLevel cur_level) {
|
||||
if (cur_level != CompLevel_none || force_comp_at_level_simple(method) || CompilationModeFlag::quick_only() || !ProfileInterpreter) {
|
||||
if (cur_level != CompLevel_none || CompilationModeFlag::quick_only() || !ProfileInterpreter) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1258,9 +1185,6 @@ CompLevel CompilationPolicy::trained_transition(const methodHandle& method, Comp
|
||||
}
|
||||
|
||||
// We don't have any special strategies for the C2-only compilation modes, so just fix up the levels for now.
|
||||
if (CompilationModeFlag::high_only_quick_internal() && CompLevel_simple < next_level && next_level < CompLevel_full_optimization) {
|
||||
return CompLevel_none;
|
||||
}
|
||||
if (CompilationModeFlag::high_only() && next_level < CompLevel_full_optimization) {
|
||||
return CompLevel_none;
|
||||
}
|
||||
@ -1273,7 +1197,7 @@ CompLevel CompilationPolicy::trained_transition(const methodHandle& method, Comp
|
||||
* 1 - pure C1 (CompLevel_simple)
|
||||
* 2 - C1 with invocation and backedge counting (CompLevel_limited_profile)
|
||||
* 3 - C1 with full profiling (CompLevel_full_profile)
|
||||
* 4 - C2 or Graal (CompLevel_full_optimization)
|
||||
* 4 - C2 (CompLevel_full_optimization)
|
||||
*
|
||||
* Common state transition patterns:
|
||||
* a. 0 -> 3 -> 4.
|
||||
@ -1310,9 +1234,7 @@ template<typename Predicate>
|
||||
CompLevel CompilationPolicy::common(const methodHandle& method, CompLevel cur_level, JavaThread* THREAD, bool disable_feedback) {
|
||||
CompLevel next_level = cur_level;
|
||||
|
||||
if (force_comp_at_level_simple(method)) {
|
||||
next_level = CompLevel_simple;
|
||||
} else if (is_trivial(method) || method->is_native()) {
|
||||
if (is_trivial(method) || method->is_native()) {
|
||||
// We do not care if there is profiling data for these methods, throw them to compiler.
|
||||
next_level = CompilationModeFlag::disable_intermediate() ? CompLevel_full_optimization : CompLevel_simple;
|
||||
} else if (MethodTrainingData::have_data()) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2010, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -322,8 +322,6 @@ class CompilationPolicy : AllStatic {
|
||||
// Simple methods are as good being compiled with C1 as C2.
|
||||
// This function tells if it's such a function.
|
||||
inline static bool is_trivial(const methodHandle& method);
|
||||
// Force method to be compiled at CompLevel_simple?
|
||||
inline static bool force_comp_at_level_simple(const methodHandle& method);
|
||||
|
||||
// Get a compilation level for a given method.
|
||||
static CompLevel comp_level(Method* method);
|
||||
@ -358,7 +356,6 @@ class CompilationPolicy : AllStatic {
|
||||
static bool can_be_osr_compiled(const methodHandle& m, int comp_level = CompLevel_any);
|
||||
static bool is_compilation_enabled();
|
||||
|
||||
static CompileTask* select_task_helper(CompileQueue* compile_queue);
|
||||
// Return initial compile level to use with Xcomp (depends on compilation mode).
|
||||
static void reprofile(ScopeDesc* trap_scope, bool is_osr);
|
||||
static nmethod* event(const methodHandle& method, const methodHandle& inlinee,
|
||||
|
||||
@ -81,10 +81,6 @@
|
||||
#ifdef COMPILER2
|
||||
#include "opto/c2compiler.hpp"
|
||||
#endif
|
||||
#if INCLUDE_JVMCI
|
||||
#include "jvmci/jvmciEnv.hpp"
|
||||
#include "jvmci/jvmciRuntime.hpp"
|
||||
#endif
|
||||
|
||||
#ifdef DTRACE_ENABLED
|
||||
|
||||
@ -238,15 +234,6 @@ CompileTaskWrapper::~CompileTaskWrapper() {
|
||||
{
|
||||
MutexLocker notifier(thread, CompileTaskWait_lock);
|
||||
task->mark_complete();
|
||||
#if INCLUDE_JVMCI
|
||||
if (CompileBroker::compiler(task->comp_level())->is_jvmci()) {
|
||||
if (!task->has_waiter()) {
|
||||
// The waiting thread timed out and thus did not delete the task.
|
||||
free_task = true;
|
||||
}
|
||||
task->set_blocking_jvmci_compile_state(nullptr);
|
||||
}
|
||||
#endif
|
||||
if (!free_task) {
|
||||
// Notify the waiting thread that the compilation has completed
|
||||
// so that it can free the task.
|
||||
@ -283,18 +270,6 @@ bool CompileBroker::can_remove(CompilerThread *ct, bool do_it) {
|
||||
// Keep thread alive for at least some time.
|
||||
if (ct->idle_time_millis() < (c1 ? 500 : 100)) return false;
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
if (compiler->is_jvmci() && !UseJVMCINativeLibrary) {
|
||||
// Handles for JVMCI thread objects may get released concurrently.
|
||||
if (do_it) {
|
||||
assert(CompileThread_lock->owner() == ct, "must be holding lock");
|
||||
} else {
|
||||
// Skip check if it's the last thread and let caller check again.
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// We only allow the last compiler thread of each type to get removed.
|
||||
jobject last_compiler = c1 ? compiler1_object(compiler_count - 1)
|
||||
: compiler2_object(compiler_count - 1);
|
||||
@ -302,13 +277,6 @@ bool CompileBroker::can_remove(CompilerThread *ct, bool do_it) {
|
||||
if (do_it) {
|
||||
assert_locked_or_safepoint(CompileThread_lock); // Update must be consistent.
|
||||
compiler->set_num_compiler_threads(compiler_count - 1);
|
||||
#if INCLUDE_JVMCI
|
||||
if (compiler->is_jvmci() && !UseJVMCINativeLibrary) {
|
||||
// Old j.l.Thread object can die when no longer referenced elsewhere.
|
||||
JNIHandles::destroy_global(compiler2_object(compiler_count - 1));
|
||||
_compiler2_objects[compiler_count - 1] = nullptr;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -424,15 +392,6 @@ CompileTask* CompileQueue::get(CompilerThread* thread) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AbstractCompiler* compiler = thread->compiler();
|
||||
guarantee(compiler != nullptr, "Compiler object must exist");
|
||||
compiler->on_empty_queue(this, thread);
|
||||
if (_first != nullptr) {
|
||||
// The call to on_empty_queue may have temporarily unlocked the MCQ lock
|
||||
// so check again whether any tasks were added to the queue.
|
||||
break;
|
||||
}
|
||||
|
||||
// If there are no compilation tasks and we can compile new jobs
|
||||
// (i.e., there is enough free space in the code cache) there is
|
||||
// no need to invoke the GC.
|
||||
@ -600,31 +559,21 @@ CompilerCounters::CompilerCounters() {
|
||||
_compile_type = CompileBroker::no_compile;
|
||||
}
|
||||
|
||||
#if INCLUDE_JFR && COMPILER2_OR_JVMCI
|
||||
#if INCLUDE_JFR && defined(COMPILER2)
|
||||
// It appends new compiler phase names to growable array phase_names(a new CompilerPhaseType mapping
|
||||
// in compiler/compilerEvent.cpp) and registers it with its serializer.
|
||||
//
|
||||
// c2 uses explicit CompilerPhaseType idToPhase mapping in opto/phasetype.hpp,
|
||||
// so if c2 is used, it should be always registered first.
|
||||
// This function is called during vm initialization.
|
||||
static void register_jfr_phasetype_serializer(CompilerType compiler_type) {
|
||||
static void register_jfr_phasetype_serializer() {
|
||||
ResourceMark rm;
|
||||
static bool first_registration = true;
|
||||
if (compiler_type == compiler_jvmci) {
|
||||
CompilerEvent::PhaseEvent::get_phase_id("NOT_A_PHASE_NAME", false, false, false);
|
||||
first_registration = false;
|
||||
#ifdef COMPILER2
|
||||
} else if (compiler_type == compiler_c2) {
|
||||
assert(first_registration, "invariant"); // c2 must be registered first.
|
||||
for (int i = 0; i < PHASE_NUM_TYPES; i++) {
|
||||
const char* phase_name = CompilerPhaseTypeHelper::to_description((CompilerPhaseType) i);
|
||||
CompilerEvent::PhaseEvent::get_phase_id(phase_name, false, false, false);
|
||||
}
|
||||
first_registration = false;
|
||||
#endif // COMPILER2
|
||||
for (int i = 0; i < PHASE_NUM_TYPES; i++) {
|
||||
const char* phase_name = CompilerPhaseTypeHelper::to_description((CompilerPhaseType) i);
|
||||
CompilerEvent::PhaseEvent::get_phase_id(phase_name, false, false, false);
|
||||
}
|
||||
}
|
||||
#endif // INCLUDE_JFR && COMPILER2_OR_JVMCI
|
||||
#endif // INCLUDE_JFR && defined(COMPILER2)
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// CompileBroker::compilation_init
|
||||
@ -639,31 +588,6 @@ void CompileBroker::compilation_init(JavaThread* THREAD) {
|
||||
_c1_count = CompilationPolicy::c1_count();
|
||||
_c2_count = CompilationPolicy::c2_count();
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
if (EnableJVMCI) {
|
||||
// This is creating a JVMCICompiler singleton.
|
||||
JVMCICompiler* jvmci = new JVMCICompiler();
|
||||
|
||||
if (UseJVMCICompiler) {
|
||||
_compilers[1] = jvmci;
|
||||
if (FLAG_IS_DEFAULT(JVMCIThreads)) {
|
||||
if (BootstrapJVMCI) {
|
||||
// JVMCI will bootstrap so give it more threads
|
||||
_c2_count = MIN2(32, os::active_processor_count());
|
||||
}
|
||||
} else {
|
||||
_c2_count = JVMCIThreads;
|
||||
}
|
||||
if (FLAG_IS_DEFAULT(JVMCIHostThreads)) {
|
||||
} else {
|
||||
#ifdef COMPILER1
|
||||
_c1_count = JVMCIHostThreads;
|
||||
#endif // COMPILER1
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
#ifdef COMPILER1
|
||||
if (_c1_count > 0) {
|
||||
_compilers[0] = new Compiler();
|
||||
@ -671,24 +595,14 @@ void CompileBroker::compilation_init(JavaThread* THREAD) {
|
||||
#endif // COMPILER1
|
||||
|
||||
#ifdef COMPILER2
|
||||
if (true JVMCI_ONLY( && !UseJVMCICompiler)) {
|
||||
if (_c2_count > 0) {
|
||||
_compilers[1] = new C2Compiler();
|
||||
// Register c2 first as c2 CompilerPhaseType idToPhase mapping is explicit.
|
||||
// idToPhase mapping for c2 is in opto/phasetype.hpp
|
||||
JFR_ONLY(register_jfr_phasetype_serializer(compiler_c2);)
|
||||
}
|
||||
if (_c2_count > 0) {
|
||||
_compilers[1] = new C2Compiler();
|
||||
// Register c2 as c2 CompilerPhaseType idToPhase mapping is explicit.
|
||||
// idToPhase mapping for c2 is in opto/phasetype.hpp
|
||||
JFR_ONLY(register_jfr_phasetype_serializer();)
|
||||
}
|
||||
#endif // COMPILER2
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
// Register after c2 registration.
|
||||
// JVMCI CompilerPhaseType idToPhase mapping is dynamic.
|
||||
if (EnableJVMCI) {
|
||||
JFR_ONLY(register_jfr_phasetype_serializer(compiler_jvmci);)
|
||||
}
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
if (CompilerOracle::should_collect_memstat()) {
|
||||
CompilationMemoryStatistic::initialize();
|
||||
}
|
||||
@ -801,7 +715,7 @@ void TrainingReplayThread::training_replay_thread_entry(JavaThread* thread, TRAP
|
||||
CompilationPolicy::replay_training_at_init_loop(thread);
|
||||
}
|
||||
|
||||
#if defined(ASSERT) && COMPILER2_OR_JVMCI
|
||||
#if defined(ASSERT) && defined(COMPILER2)
|
||||
// Entry for DeoptimizeObjectsALotThread. The threads are started in
|
||||
// CompileBroker::init_compiler_threads() iff DeoptimizeObjectsALot is enabled
|
||||
void DeoptimizeObjectsALotThread::deopt_objs_alot_thread_entry(JavaThread* thread, TRAPS) {
|
||||
@ -852,7 +766,7 @@ void DeoptimizeObjectsALotThread::deoptimize_objects_alot_loop_all() {
|
||||
sleep(DeoptimizeObjectsALotInterval);
|
||||
}
|
||||
}
|
||||
#endif // defined(ASSERT) && COMPILER2_OR_JVMCI
|
||||
#endif // defined(ASSERT) && defined(COMPILER2)
|
||||
|
||||
|
||||
JavaThread* CompileBroker::make_thread(ThreadType type, jobject thread_handle, CompileQueue* queue, AbstractCompiler* comp, JavaThread* THREAD) {
|
||||
@ -873,11 +787,11 @@ JavaThread* CompileBroker::make_thread(ThreadType type, jobject thread_handle, C
|
||||
new_thread = new CompilerThread(queue, counters);
|
||||
}
|
||||
break;
|
||||
#if defined(ASSERT) && COMPILER2_OR_JVMCI
|
||||
#if defined(ASSERT) && defined(COMPILER2)
|
||||
case deoptimizer_t:
|
||||
new_thread = new DeoptimizeObjectsALotThread();
|
||||
break;
|
||||
#endif // ASSERT
|
||||
#endif // defined(ASSERT) && defined(COMPILER2)
|
||||
case training_replay_t:
|
||||
new_thread = new TrainingReplayThread();
|
||||
break;
|
||||
@ -968,7 +882,7 @@ void CompileBroker::init_compiler_threads() {
|
||||
#endif // !ZERO
|
||||
// Initialize the compilation queue
|
||||
if (_c2_count > 0) {
|
||||
const char* name = JVMCI_ONLY(UseJVMCICompiler ? "JVMCI compile queue" :) "C2 compile queue";
|
||||
const char* name = "C2 compile queue";
|
||||
_c2_compile_queue = new CompileQueue(name);
|
||||
_compiler2_objects = NEW_C_HEAP_ARRAY(jobject, _c2_count, mtCompiler);
|
||||
_compiler2_logs = NEW_C_HEAP_ARRAY(CompileLog*, _c2_count, mtCompiler);
|
||||
@ -1025,7 +939,7 @@ void CompileBroker::init_compiler_threads() {
|
||||
PerfDataManager::create_constant(SUN_CI, "threads", PerfData::U_Bytes, _c1_count + _c2_count, CHECK);
|
||||
}
|
||||
|
||||
#if defined(ASSERT) && COMPILER2_OR_JVMCI
|
||||
#if defined(ASSERT) && defined(COMPILER2)
|
||||
if (DeoptimizeObjectsALot) {
|
||||
// Initialize and start the object deoptimizer threads
|
||||
const int total_count = DeoptimizeObjectsALotThreadCountSingle + DeoptimizeObjectsALotThreadCountAll;
|
||||
@ -1035,7 +949,7 @@ void CompileBroker::init_compiler_threads() {
|
||||
make_thread(deoptimizer_t, thread_handle, nullptr, nullptr, THREAD);
|
||||
}
|
||||
}
|
||||
#endif // defined(ASSERT) && COMPILER2_OR_JVMCI
|
||||
#endif // defined(ASSERT) && defined(COMPILER2)
|
||||
}
|
||||
|
||||
void CompileBroker::init_training_replay() {
|
||||
@ -1084,43 +998,6 @@ void CompileBroker::possibly_add_compiler_threads(JavaThread* THREAD) {
|
||||
(int)(available_cc_np / (128*K)));
|
||||
|
||||
for (int i = old_c2_count; i < new_c2_count; i++) {
|
||||
#if INCLUDE_JVMCI
|
||||
if (UseJVMCICompiler && !UseJVMCINativeLibrary && _compiler2_objects[i] == nullptr) {
|
||||
// Native compiler threads as used in C1/C2 can reuse the j.l.Thread objects as their
|
||||
// existence is completely hidden from the rest of the VM (and those compiler threads can't
|
||||
// call Java code to do the creation anyway).
|
||||
//
|
||||
// For pure Java JVMCI we have to create new j.l.Thread objects as they are visible and we
|
||||
// can see unexpected thread lifecycle transitions if we bind them to new JavaThreads. For
|
||||
// native library JVMCI it's preferred to use the C1/C2 strategy as this avoids unnecessary
|
||||
// coupling with Java.
|
||||
if (!THREAD->can_call_java()) break;
|
||||
char name_buffer[256];
|
||||
os::snprintf_checked(name_buffer, sizeof(name_buffer), "%s CompilerThread%d", _compilers[1]->name(), i);
|
||||
Handle thread_oop;
|
||||
{
|
||||
// We have to give up the lock temporarily for the Java calls.
|
||||
MutexUnlocker mu(CompileThread_lock);
|
||||
thread_oop = JavaThread::create_system_thread_object(name_buffer, THREAD);
|
||||
}
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
if (trace_compiler_threads()) {
|
||||
ResourceMark rm;
|
||||
stringStream msg;
|
||||
msg.print_cr("JVMCI compiler thread creation failed:");
|
||||
PENDING_EXCEPTION->print_on(&msg);
|
||||
print_compiler_threads(msg);
|
||||
}
|
||||
CLEAR_PENDING_EXCEPTION;
|
||||
break;
|
||||
}
|
||||
// Check if another thread has beaten us during the Java calls.
|
||||
if (get_c2_thread_count() != i) break;
|
||||
jobject thread_handle = JNIHandles::make_global(thread_oop);
|
||||
assert(compiler2_object(i) == nullptr, "Old one must be released!");
|
||||
_compiler2_objects[i] = thread_handle;
|
||||
}
|
||||
#endif
|
||||
guarantee(compiler2_object(i) != nullptr, "Thread oop must exist");
|
||||
JavaThread *ct = make_thread(compiler_t, compiler2_object(i), _c2_compile_queue, _compilers[1], THREAD);
|
||||
if (ct == nullptr) break;
|
||||
@ -1276,42 +1153,6 @@ void CompileBroker::compile_method_base(const methodHandle& method,
|
||||
return;
|
||||
}
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
if (UseJVMCICompiler && blocking) {
|
||||
// Don't allow blocking compiles for requests triggered by JVMCI.
|
||||
if (thread->is_Compiler_thread()) {
|
||||
blocking = false;
|
||||
}
|
||||
|
||||
// In libjvmci, JVMCI initialization should not deadlock with other threads
|
||||
if (!UseJVMCINativeLibrary) {
|
||||
// Don't allow blocking compiles if inside a class initializer or while performing class loading
|
||||
vframeStream vfst(JavaThread::cast(thread));
|
||||
for (; !vfst.at_end(); vfst.next()) {
|
||||
if (vfst.method()->is_static_initializer() ||
|
||||
(vfst.method()->method_holder()->is_subclass_of(vmClasses::ClassLoader_klass()) &&
|
||||
vfst.method()->name() == vmSymbols::loadClass_name())) {
|
||||
blocking = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Don't allow blocking compilation requests to JVMCI
|
||||
// if JVMCI itself is not yet initialized
|
||||
if (!JVMCI::is_compiler_initialized() && compiler(comp_level)->is_jvmci()) {
|
||||
blocking = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Don't allow blocking compilation requests if we are in JVMCIRuntime::shutdown
|
||||
// to avoid deadlock between compiler thread(s) and threads run at shutdown
|
||||
// such as the DestroyJavaVM thread.
|
||||
if (JVMCI::in_shutdown()) {
|
||||
blocking = false;
|
||||
}
|
||||
}
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
// We will enter the compilation in the queue.
|
||||
// 14012000: Note that this sets the queued_for_compile bits in
|
||||
// the target method. We can now reason that a method cannot be
|
||||
@ -1375,13 +1216,6 @@ nmethod* CompileBroker::compile_method(const methodHandle& method, int osr_bci,
|
||||
AbstractCompiler *comp = CompileBroker::compiler(comp_level);
|
||||
assert(comp != nullptr, "Ensure we have a compiler");
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
if (comp->is_jvmci() && !JVMCI::can_initialize_JVMCI()) {
|
||||
// JVMCI compilation is not yet initializable.
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
CompilerDirectiveMatcher matcher(method, comp_level);
|
||||
// CompileBroker::compile_method can trap and can have pending async exception.
|
||||
nmethod* nm = CompileBroker::compile_method(method, osr_bci, comp_level, hot_count, compile_reason, matcher.directive_set(), THREAD);
|
||||
@ -1430,7 +1264,7 @@ nmethod* CompileBroker::compile_method(const methodHandle& method, int osr_bci,
|
||||
|
||||
assert(!HAS_PENDING_EXCEPTION, "No exception should be present");
|
||||
// some prerequisites that are compiler specific
|
||||
if (comp->is_c2() || comp->is_jvmci()) {
|
||||
if (comp->is_c2()) {
|
||||
InternalOOMEMark iom(THREAD);
|
||||
method->constants()->resolve_string_constants(CHECK_AND_CLEAR_NONASYNC_NULL);
|
||||
// Resolve all classes seen in the signature of the method
|
||||
@ -1642,68 +1476,6 @@ CompileTask* CompileBroker::create_compile_task(CompileQueue* queue,
|
||||
return new_task;
|
||||
}
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
// The number of milliseconds to wait before checking if
|
||||
// JVMCI compilation has made progress.
|
||||
static const long JVMCI_COMPILATION_PROGRESS_WAIT_TIMESLICE = 1000;
|
||||
|
||||
// The number of JVMCI compilation progress checks that must fail
|
||||
// before unblocking a thread waiting for a blocking compilation.
|
||||
static const int JVMCI_COMPILATION_PROGRESS_WAIT_ATTEMPTS = 10;
|
||||
|
||||
/**
|
||||
* Waits for a JVMCI compiler to complete a given task. This thread
|
||||
* waits until either the task completes or it sees no JVMCI compilation
|
||||
* progress for N consecutive milliseconds where N is
|
||||
* JVMCI_COMPILATION_PROGRESS_WAIT_TIMESLICE *
|
||||
* JVMCI_COMPILATION_PROGRESS_WAIT_ATTEMPTS.
|
||||
*
|
||||
* @return true if this thread needs to delete the task
|
||||
*/
|
||||
bool CompileBroker::wait_for_jvmci_completion(JVMCICompiler* jvmci, CompileTask* task, JavaThread* thread) {
|
||||
assert(UseJVMCICompiler, "sanity");
|
||||
MonitorLocker ml(thread, CompileTaskWait_lock);
|
||||
int progress_wait_attempts = 0;
|
||||
jint thread_jvmci_compilation_ticks = 0;
|
||||
jint global_jvmci_compilation_ticks = jvmci->global_compilation_ticks();
|
||||
while (!task->is_complete() && !is_compilation_disabled_forever() &&
|
||||
ml.wait(JVMCI_COMPILATION_PROGRESS_WAIT_TIMESLICE)) {
|
||||
JVMCICompileState* jvmci_compile_state = task->blocking_jvmci_compile_state();
|
||||
|
||||
bool progress;
|
||||
if (jvmci_compile_state != nullptr) {
|
||||
jint ticks = jvmci_compile_state->compilation_ticks();
|
||||
progress = (ticks - thread_jvmci_compilation_ticks) != 0;
|
||||
JVMCI_event_1("waiting on compilation %d [ticks=%d]", task->compile_id(), ticks);
|
||||
thread_jvmci_compilation_ticks = ticks;
|
||||
} else {
|
||||
// Still waiting on JVMCI compiler queue. This thread may be holding a lock
|
||||
// that all JVMCI compiler threads are blocked on. We use the global JVMCI
|
||||
// compilation ticks to determine whether JVMCI compilation
|
||||
// is still making progress through the JVMCI compiler queue.
|
||||
jint ticks = jvmci->global_compilation_ticks();
|
||||
progress = (ticks - global_jvmci_compilation_ticks) != 0;
|
||||
JVMCI_event_1("waiting on compilation %d to be queued [ticks=%d]", task->compile_id(), ticks);
|
||||
global_jvmci_compilation_ticks = ticks;
|
||||
}
|
||||
|
||||
if (!progress) {
|
||||
if (++progress_wait_attempts == JVMCI_COMPILATION_PROGRESS_WAIT_ATTEMPTS) {
|
||||
if (PrintCompilation) {
|
||||
task->print(tty, "wait for blocking compilation timed out");
|
||||
}
|
||||
JVMCI_event_1("waiting on compilation %d timed out", task->compile_id());
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
progress_wait_attempts = 0;
|
||||
}
|
||||
}
|
||||
task->clear_waiter();
|
||||
return task->is_complete();
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Wait for the compilation task to complete.
|
||||
*/
|
||||
@ -1718,19 +1490,8 @@ void CompileBroker::wait_for_completion(CompileTask* task) {
|
||||
JavaThread* thread = JavaThread::current();
|
||||
|
||||
methodHandle method(thread, task->method());
|
||||
bool free_task;
|
||||
#if INCLUDE_JVMCI
|
||||
AbstractCompiler* comp = compiler(task->comp_level());
|
||||
if (!UseJVMCINativeLibrary && comp->is_jvmci() && !task->should_wait_for_compilation()) {
|
||||
// It may return before compilation is completed.
|
||||
// Note that libjvmci should not pre-emptively unblock
|
||||
// a thread waiting for a compilation as it does not call
|
||||
// Java code and so is not deadlock prone like jarjvmci.
|
||||
free_task = wait_for_jvmci_completion((JVMCICompiler*) comp, task, thread);
|
||||
} else
|
||||
#endif
|
||||
bool free_task = true;
|
||||
{
|
||||
free_task = true;
|
||||
// Wait until the task is complete or compilation is shut down.
|
||||
MonitorLocker ml(thread, CompileTaskWait_lock);
|
||||
while (!task->is_complete() && !is_compilation_disabled_forever()) {
|
||||
@ -1968,9 +1729,6 @@ void CompileBroker::compiler_thread_loop() {
|
||||
print_compiler_threads(msg);
|
||||
}
|
||||
|
||||
// Notify compiler that the compiler thread is about to stop
|
||||
thread->compiler()->stopping_compiler_thread(thread);
|
||||
|
||||
free_buffer_blob_if_allocated(thread);
|
||||
return; // Stop this thread.
|
||||
}
|
||||
@ -2244,69 +2002,6 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
|
||||
bool failure_reason_on_C_heap = false;
|
||||
const char* retry_message = nullptr;
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
if (UseJVMCICompiler && comp != nullptr && comp->is_jvmci()) {
|
||||
JVMCICompiler* jvmci = (JVMCICompiler*) comp;
|
||||
|
||||
TraceTime t1("compilation", &time);
|
||||
EventCompilation event;
|
||||
JVMCICompileState compile_state(task, jvmci);
|
||||
JVMCIRuntime *runtime = nullptr;
|
||||
|
||||
if (JVMCI::in_shutdown()) {
|
||||
failure_reason = "in JVMCI shutdown";
|
||||
retry_message = "not retryable";
|
||||
compilable = ciEnv::MethodCompilable_never;
|
||||
} else if (compile_state.target_method_is_old()) {
|
||||
// Skip redefined methods
|
||||
failure_reason = "redefined method";
|
||||
retry_message = "not retryable";
|
||||
compilable = ciEnv::MethodCompilable_never;
|
||||
} else {
|
||||
JVMCIEnv env(thread, &compile_state, __FILE__, __LINE__);
|
||||
if (env.init_error() != JNI_OK) {
|
||||
const char* msg = env.init_error_msg();
|
||||
failure_reason = os::strdup(err_msg("Error attaching to libjvmci (err: %d, %s)",
|
||||
env.init_error(), msg == nullptr ? "unknown" : msg), mtJVMCI);
|
||||
bool reason_on_C_heap = true;
|
||||
// In case of JNI_ENOMEM, there's a good chance a subsequent attempt to create libjvmci or attach to it
|
||||
// might succeed. Other errors most likely indicate a non-recoverable error in the JVMCI runtime.
|
||||
bool retryable = env.init_error() == JNI_ENOMEM;
|
||||
compile_state.set_failure(retryable, failure_reason, reason_on_C_heap);
|
||||
}
|
||||
if (failure_reason == nullptr) {
|
||||
if (WhiteBoxAPI && WhiteBox::compilation_locked) {
|
||||
// Must switch to native to block
|
||||
ThreadToNativeFromVM ttn(thread);
|
||||
whitebox_lock_compilation();
|
||||
}
|
||||
methodHandle method(thread, target_handle);
|
||||
runtime = env.runtime();
|
||||
runtime->compile_method(&env, jvmci, method, osr_bci);
|
||||
|
||||
failure_reason = compile_state.failure_reason();
|
||||
failure_reason_on_C_heap = compile_state.failure_reason_on_C_heap();
|
||||
if (!compile_state.retryable()) {
|
||||
retry_message = "not retryable";
|
||||
compilable = ciEnv::MethodCompilable_not_at_tier;
|
||||
}
|
||||
if (!task->is_success()) {
|
||||
assert(failure_reason != nullptr, "must specify failure_reason");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!task->is_success() && !JVMCI::in_shutdown()) {
|
||||
handle_compile_error(thread, task, nullptr, compilable, failure_reason);
|
||||
}
|
||||
if (event.should_commit()) {
|
||||
post_compilation_event(event, task);
|
||||
}
|
||||
|
||||
if (runtime != nullptr) {
|
||||
runtime->post_compile(thread);
|
||||
}
|
||||
} else
|
||||
#endif // INCLUDE_JVMCI
|
||||
{
|
||||
NoHandleMark nhm;
|
||||
ThreadToNativeFromVM ttn(thread);
|
||||
@ -2767,15 +2462,6 @@ void CompileBroker::print_times(bool per_compiler, bool aggregate) {
|
||||
tty->cr();
|
||||
comp->print_timers();
|
||||
}
|
||||
#if INCLUDE_JVMCI
|
||||
if (EnableJVMCI) {
|
||||
JVMCICompiler *jvmci_comp = JVMCICompiler::instance(false, JavaThread::current_or_null());
|
||||
if (jvmci_comp != nullptr && jvmci_comp != comp) {
|
||||
tty->cr();
|
||||
jvmci_comp->print_timers();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
tty->cr();
|
||||
tty->print_cr(" Total compiled methods : %8u methods", total_compile_count);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -33,13 +33,10 @@
|
||||
#include "runtime/atomicAccess.hpp"
|
||||
#include "runtime/perfDataTypes.hpp"
|
||||
#include "utilities/stack.hpp"
|
||||
#if INCLUDE_JVMCI
|
||||
#include "jvmci/jvmciCompiler.hpp"
|
||||
#endif
|
||||
|
||||
class nmethod;
|
||||
|
||||
#if defined(ASSERT) && COMPILER2_OR_JVMCI
|
||||
#if defined(ASSERT) && defined(COMPILER2)
|
||||
// Stress testing. Dedicated threads revert optimizations based on escape analysis concurrently to
|
||||
// the running java application. Configured with vm options DeoptimizeObjectsALot*.
|
||||
class DeoptimizeObjectsALotThread : public JavaThread {
|
||||
@ -53,7 +50,7 @@ public:
|
||||
|
||||
bool is_hidden_from_external_view() const { return true; }
|
||||
};
|
||||
#endif
|
||||
#endif // defined(ASSERT) && defined(COMPILER2)
|
||||
|
||||
// CompilerCounters
|
||||
//
|
||||
@ -273,10 +270,6 @@ class CompileBroker: AllStatic {
|
||||
CompileTask::CompileReason compile_reason,
|
||||
bool blocking);
|
||||
static void wait_for_completion(CompileTask* task);
|
||||
#if INCLUDE_JVMCI
|
||||
static bool wait_for_jvmci_completion(JVMCICompiler* comp, CompileTask* task, JavaThread* thread);
|
||||
#endif
|
||||
|
||||
static void free_buffer_blob_if_allocated(CompilerThread* thread);
|
||||
|
||||
static void invoke_compiler_on_method(CompileTask* task);
|
||||
|
||||
@ -58,8 +58,6 @@ CompileTask::CompileTask(int compile_id,
|
||||
_comp_level(comp_level),
|
||||
_compiler(CompileBroker::compiler(comp_level)),
|
||||
_comp_directive_matcher(method, static_cast<CompLevel>(comp_level)),
|
||||
JVMCI_ONLY(_has_waiter(_compiler->is_jvmci()) COMMA)
|
||||
JVMCI_ONLY(_blocking_jvmci_compile_state(nullptr) COMMA)
|
||||
_num_inlined_bytecodes(0),
|
||||
_next(nullptr),
|
||||
_prev(nullptr),
|
||||
|
||||
@ -35,8 +35,6 @@
|
||||
|
||||
class CompileTrainingData;
|
||||
|
||||
JVMCI_ONLY(class JVMCICompileState;)
|
||||
|
||||
enum class InliningResult { SUCCESS, FAILURE };
|
||||
|
||||
inline InliningResult inlining_result_of(bool success) {
|
||||
@ -50,7 +48,6 @@ inline InliningResult inlining_result_of(bool success) {
|
||||
|
||||
class CompileTask : public CHeapObj<mtCompiler> {
|
||||
friend class VMStructs;
|
||||
friend class JVMCIVMStructs;
|
||||
|
||||
public:
|
||||
// Different reasons for a compilation
|
||||
@ -63,7 +60,6 @@ class CompileTask : public CHeapObj<mtCompiler> {
|
||||
Reason_Replay, // ciReplay
|
||||
Reason_Whitebox, // Whitebox API
|
||||
Reason_MustBeCompiled, // Used for -Xcomp or AlwaysCompileLoopMethods (see CompilationPolicy::must_be_compiled())
|
||||
Reason_Bootstrap, // JVMCI bootstrap
|
||||
Reason_Count
|
||||
};
|
||||
|
||||
@ -96,11 +92,6 @@ class CompileTask : public CHeapObj<mtCompiler> {
|
||||
int _comp_level;
|
||||
AbstractCompiler* _compiler;
|
||||
CompilerDirectiveMatcher _comp_directive_matcher;
|
||||
#if INCLUDE_JVMCI
|
||||
bool _has_waiter;
|
||||
// Compilation state for a blocking JVMCI compilation
|
||||
JVMCICompileState* _blocking_jvmci_compile_state;
|
||||
#endif
|
||||
int _num_inlined_bytecodes;
|
||||
CompileTask* _next;
|
||||
CompileTask* _prev;
|
||||
@ -149,26 +140,6 @@ class CompileTask : public CHeapObj<mtCompiler> {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#if INCLUDE_JVMCI
|
||||
bool should_wait_for_compilation() const {
|
||||
// Wait for blocking compilation to finish.
|
||||
switch (_compile_reason) {
|
||||
case Reason_Replay:
|
||||
case Reason_Whitebox:
|
||||
case Reason_Bootstrap:
|
||||
return _is_blocking;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool has_waiter() const { return _has_waiter; }
|
||||
void clear_waiter() { _has_waiter = false; }
|
||||
JVMCICompileState* blocking_jvmci_compile_state() const { return _blocking_jvmci_compile_state; }
|
||||
void set_blocking_jvmci_compile_state(JVMCICompileState* state) {
|
||||
_blocking_jvmci_compile_state = state;
|
||||
}
|
||||
#endif
|
||||
|
||||
void mark_complete() { _is_complete = true; }
|
||||
void mark_success() { _is_success = true; }
|
||||
|
||||
@ -39,8 +39,7 @@
|
||||
const char* compilertype2name_tab[compiler_number_of_types] = {
|
||||
"",
|
||||
"c1",
|
||||
"c2",
|
||||
"jvmci"
|
||||
"c2"
|
||||
};
|
||||
|
||||
CompilationModeFlag::Mode CompilationModeFlag::_mode = CompilationModeFlag::Mode::NORMAL;
|
||||
@ -63,17 +62,11 @@ bool CompilationModeFlag::initialize() {
|
||||
_mode = Mode::QUICK_ONLY;
|
||||
}
|
||||
} else if (strcmp(CompilationMode, "high-only") == 0) {
|
||||
if (!CompilerConfig::has_c2() && !CompilerConfig::is_jvmci_compiler()) {
|
||||
print_mode_unavailable("high-only", "there is no c2 or jvmci compiler present");
|
||||
if (!CompilerConfig::has_c2()) {
|
||||
print_mode_unavailable("high-only", "there is no c2 compiler present");
|
||||
} else {
|
||||
_mode = Mode::HIGH_ONLY;
|
||||
}
|
||||
} else if (strcmp(CompilationMode, "high-only-quick-internal") == 0) {
|
||||
if (!CompilerConfig::has_c1() || !CompilerConfig::is_jvmci_compiler()) {
|
||||
print_mode_unavailable("high-only-quick-internal", "there is no c1 and jvmci compiler present");
|
||||
} else {
|
||||
_mode = Mode::HIGH_ONLY_QUICK_INTERNAL;
|
||||
}
|
||||
} else {
|
||||
print_error();
|
||||
return false;
|
||||
@ -84,12 +77,8 @@ bool CompilationModeFlag::initialize() {
|
||||
if (normal()) {
|
||||
if (CompilerConfig::is_c1_simple_only()) {
|
||||
_mode = Mode::QUICK_ONLY;
|
||||
} else if (CompilerConfig::is_c2_or_jvmci_compiler_only()) {
|
||||
} else if (CompilerConfig::is_c2_only()) {
|
||||
_mode = Mode::HIGH_ONLY;
|
||||
} else if (CompilerConfig::is_jvmci_compiler_enabled() && CompilerConfig::is_c1_enabled() && !TieredCompilation) {
|
||||
warning("Disabling tiered compilation with non-native JVMCI compiler is not recommended, "
|
||||
"disabling intermediate compilation levels instead. ");
|
||||
_mode = Mode::HIGH_ONLY_QUICK_INTERNAL;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@ -102,14 +91,10 @@ void CompilationModeFlag::print_error() {
|
||||
jio_fprintf(defaultStream::error_stream(), "%s quick-only", comma ? "," : "");
|
||||
comma = true;
|
||||
}
|
||||
if (CompilerConfig::has_c2() || CompilerConfig::has_jvmci()) {
|
||||
if (CompilerConfig::has_c2()) {
|
||||
jio_fprintf(defaultStream::error_stream(), "%s high-only", comma ? "," : "");
|
||||
comma = true;
|
||||
}
|
||||
if (CompilerConfig::has_c1() && CompilerConfig::has_jvmci()) {
|
||||
jio_fprintf(defaultStream::error_stream(), "%s high-only-quick-internal", comma ? "," : "");
|
||||
comma = true;
|
||||
}
|
||||
jio_fprintf(defaultStream::error_stream(), "\n");
|
||||
}
|
||||
|
||||
@ -206,7 +191,7 @@ void CompilerConfig::set_legacy_emulation_flags() {
|
||||
if (!FLAG_IS_DEFAULT(CompileThreshold) ||
|
||||
!FLAG_IS_DEFAULT(OnStackReplacePercentage) ||
|
||||
!FLAG_IS_DEFAULT(InterpreterProfilePercentage)) {
|
||||
if (CompilerConfig::is_c1_only() || CompilerConfig::is_c2_or_jvmci_compiler_only()) {
|
||||
if (CompilerConfig::is_c1_only() || CompilerConfig::is_c2_only()) {
|
||||
// This function is called before these flags are validated. In order to not confuse the user with extraneous
|
||||
// error messages, we check the validity of these flags here and bail out if any of them are invalid.
|
||||
if (!check_legacy_flags()) {
|
||||
@ -238,7 +223,7 @@ void CompilerConfig::set_legacy_emulation_flags() {
|
||||
FLAG_SET_ERGO(Tier3MinInvocationThreshold, threshold);
|
||||
FLAG_SET_ERGO(Tier3CompileThreshold, threshold);
|
||||
FLAG_SET_ERGO(Tier3BackEdgeThreshold, osr_threshold);
|
||||
if (CompilerConfig::is_c2_or_jvmci_compiler_only()) {
|
||||
if (CompilerConfig::is_c2_only()) {
|
||||
FLAG_SET_ERGO(Tier4InvocationThreshold, threshold);
|
||||
FLAG_SET_ERGO(Tier4MinInvocationThreshold, threshold);
|
||||
FLAG_SET_ERGO(Tier4CompileThreshold, threshold);
|
||||
@ -401,54 +386,6 @@ void CompilerConfig::set_compilation_policy_flags() {
|
||||
|
||||
}
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
void CompilerConfig::set_jvmci_specific_flags() {
|
||||
if (UseJVMCICompiler) {
|
||||
if (FLAG_IS_DEFAULT(TypeProfileWidth)) {
|
||||
FLAG_SET_DEFAULT(TypeProfileWidth, 8);
|
||||
}
|
||||
if (FLAG_IS_DEFAULT(TypeProfileLevel)) {
|
||||
FLAG_SET_DEFAULT(TypeProfileLevel, 0);
|
||||
}
|
||||
|
||||
if (UseJVMCINativeLibrary) {
|
||||
// SVM compiled code requires more stack space
|
||||
if (FLAG_IS_DEFAULT(CompilerThreadStackSize)) {
|
||||
// Duplicate logic in the implementations of os::create_thread
|
||||
// so that we can then double the computed stack size. Once
|
||||
// the stack size requirements of SVM are better understood,
|
||||
// this logic can be pushed down into os::create_thread.
|
||||
int stack_size = CompilerThreadStackSize;
|
||||
if (stack_size == 0) {
|
||||
stack_size = VMThreadStackSize;
|
||||
}
|
||||
if (stack_size != 0) {
|
||||
FLAG_SET_DEFAULT(CompilerThreadStackSize, stack_size * 2);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// JVMCI needs values not less than defaults
|
||||
if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
|
||||
FLAG_SET_DEFAULT(ReservedCodeCacheSize, MAX2(64*M, ReservedCodeCacheSize));
|
||||
}
|
||||
if (FLAG_IS_DEFAULT(InitialCodeCacheSize)) {
|
||||
FLAG_SET_DEFAULT(InitialCodeCacheSize, MAX2(16*M, InitialCodeCacheSize));
|
||||
}
|
||||
if (FLAG_IS_DEFAULT(Tier3DelayOn)) {
|
||||
// This effectively prevents the compile broker scheduling tier 2
|
||||
// (i.e., limited C1 profiling) compilations instead of tier 3
|
||||
// (i.e., full C1 profiling) compilations when the tier 4 queue
|
||||
// backs up (which is quite likely when using a non-AOT compiled JVMCI
|
||||
// compiler). The observation based on jargraal is that the downside
|
||||
// of skipping full profiling is much worse for performance than the
|
||||
// queue backing up.
|
||||
FLAG_SET_DEFAULT(Tier3DelayOn, 100000);
|
||||
}
|
||||
} // !UseJVMCINativeLibrary
|
||||
} // UseJVMCICompiler
|
||||
}
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
bool CompilerConfig::check_args_consistency(bool status) {
|
||||
// Check lower bounds of the code cache
|
||||
// Template Interpreter code is approximately 3X larger in debug builds.
|
||||
@ -512,19 +449,6 @@ bool CompilerConfig::check_args_consistency(bool status) {
|
||||
warning("SegmentedCodeCache has no meaningful effect with -Xint");
|
||||
FLAG_SET_DEFAULT(SegmentedCodeCache, false);
|
||||
}
|
||||
#if INCLUDE_JVMCI
|
||||
if (EnableJVMCI || UseJVMCICompiler) {
|
||||
if (!FLAG_IS_DEFAULT(EnableJVMCI) || !FLAG_IS_DEFAULT(UseJVMCICompiler)) {
|
||||
warning("JVMCI Compiler disabled due to -Xint.");
|
||||
}
|
||||
FLAG_SET_CMDLINE(EnableJVMCI, false);
|
||||
FLAG_SET_CMDLINE(UseJVMCICompiler, false);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
#if INCLUDE_JVMCI
|
||||
status = status && JVMCIGlobals::check_jvmci_flags_are_consistent();
|
||||
#endif
|
||||
}
|
||||
|
||||
return status;
|
||||
@ -538,15 +462,6 @@ void CompilerConfig::ergo_initialize() {
|
||||
set_legacy_emulation_flags();
|
||||
set_compilation_policy_flags();
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
// Check that JVMCI supports selected GC.
|
||||
// Should be done after GCConfig::initialize() was called.
|
||||
JVMCIGlobals::check_jvmci_supported_gc();
|
||||
|
||||
// Do JVMCI specific settings
|
||||
set_jvmci_specific_flags();
|
||||
#endif
|
||||
|
||||
if (UseOnStackReplacement && !UseLoopCounter) {
|
||||
warning("On-stack-replacement requires loop counters; enabling loop counters");
|
||||
FLAG_SET_DEFAULT(UseLoopCounter, true);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -33,7 +33,6 @@ enum CompilerType : u1 {
|
||||
compiler_none,
|
||||
compiler_c1,
|
||||
compiler_c2,
|
||||
compiler_jvmci,
|
||||
compiler_number_of_types
|
||||
};
|
||||
|
||||
@ -59,7 +58,7 @@ enum CompLevel : s1 {
|
||||
CompLevel_simple = 1, // C1
|
||||
CompLevel_limited_profile = 2, // C1, invocation & backedge counters
|
||||
CompLevel_full_profile = 3, // C1, invocation & backedge counters + mdo
|
||||
CompLevel_full_optimization = 4, // C2 or JVMCI
|
||||
CompLevel_full_optimization = 4, // C2
|
||||
CompLevel_count = 5
|
||||
};
|
||||
|
||||
@ -67,24 +66,17 @@ class CompilationModeFlag : AllStatic {
|
||||
enum class Mode {
|
||||
NORMAL,
|
||||
QUICK_ONLY,
|
||||
HIGH_ONLY,
|
||||
HIGH_ONLY_QUICK_INTERNAL
|
||||
HIGH_ONLY
|
||||
};
|
||||
static Mode _mode;
|
||||
static void print_error();
|
||||
public:
|
||||
static bool initialize();
|
||||
static bool normal() { return _mode == Mode::NORMAL; }
|
||||
static bool quick_only() { return _mode == Mode::QUICK_ONLY; }
|
||||
static bool high_only() { return _mode == Mode::HIGH_ONLY; }
|
||||
static bool high_only_quick_internal() { return _mode == Mode::HIGH_ONLY_QUICK_INTERNAL; }
|
||||
static bool normal() { return _mode == Mode::NORMAL; }
|
||||
static bool quick_only() { return _mode == Mode::QUICK_ONLY; }
|
||||
static bool high_only() { return _mode == Mode::HIGH_ONLY; }
|
||||
|
||||
static bool disable_intermediate() { return high_only() || high_only_quick_internal(); }
|
||||
static bool quick_internal() { return !high_only(); }
|
||||
|
||||
static void set_high_only_quick_internal() { _mode = Mode::HIGH_ONLY_QUICK_INTERNAL; }
|
||||
static void set_quick_only() { _mode = Mode::QUICK_ONLY; }
|
||||
static void set_high_only() { _mode = Mode::HIGH_ONLY; }
|
||||
static bool disable_intermediate() { return high_only(); }
|
||||
};
|
||||
|
||||
inline bool is_c1_compile(int comp_level) {
|
||||
@ -119,41 +111,27 @@ public:
|
||||
// Which compilers are baked in?
|
||||
constexpr static bool has_c1() { return COMPILER1_PRESENT(true) NOT_COMPILER1(false); }
|
||||
constexpr static bool has_c2() { return COMPILER2_PRESENT(true) NOT_COMPILER2(false); }
|
||||
constexpr static bool has_jvmci() { return JVMCI_ONLY(true) NOT_JVMCI(false); }
|
||||
constexpr static bool has_tiered() { return has_c1() && (has_c2() || has_jvmci()); }
|
||||
constexpr static bool has_tiered() { return has_c1() && has_c2(); }
|
||||
|
||||
inline static bool is_jvmci_compiler();
|
||||
inline static bool is_jvmci();
|
||||
inline static bool is_interpreter_only();
|
||||
|
||||
// is_*_only() functions describe situations in which the JVM is in one way or another
|
||||
// forced to use a particular compiler or their combination. The constraint functions
|
||||
// deliberately ignore the fact that there may also be methods installed
|
||||
// through JVMCI (where the JVMCI compiler was invoked not through the broker). Be sure
|
||||
// to check for those (using is_jvmci()) in situations where it matters.
|
||||
// forced to use a particular compiler or their combination.
|
||||
|
||||
inline static bool is_tiered();
|
||||
|
||||
inline static bool is_c1_enabled();
|
||||
inline static bool is_c1_only();
|
||||
inline static bool is_c1_simple_only();
|
||||
inline static bool is_c1_or_interpreter_only_no_jvmci();
|
||||
inline static bool is_c1_only_no_jvmci();
|
||||
inline static bool is_c1_or_interpreter_only();
|
||||
inline static bool is_c1_profiling();
|
||||
|
||||
inline static bool is_jvmci_compiler_enabled();
|
||||
inline static bool is_jvmci_compiler_only();
|
||||
|
||||
inline static bool is_c2_only();
|
||||
inline static bool is_c2_enabled();
|
||||
inline static bool is_c2_or_jvmci_compiler_only();
|
||||
inline static bool is_c2_or_jvmci_compiler_enabled();
|
||||
|
||||
inline static CompilerType compiler_type();
|
||||
|
||||
private:
|
||||
static void set_compilation_policy_flags();
|
||||
static void set_jvmci_specific_flags();
|
||||
static void set_legacy_emulation_flags();
|
||||
};
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -35,20 +35,13 @@ inline bool CompilerConfig::is_interpreter_only() {
|
||||
return Arguments::is_interpreter_only() || TieredStopAtLevel == CompLevel_none;
|
||||
}
|
||||
|
||||
inline bool CompilerConfig::is_jvmci_compiler() { return JVMCI_ONLY(has_jvmci() && UseJVMCICompiler) NOT_JVMCI(false); }
|
||||
inline bool CompilerConfig::is_jvmci() { return JVMCI_ONLY(has_jvmci() && EnableJVMCI ) NOT_JVMCI(false); }
|
||||
|
||||
// is_*_only() functions describe situations in which the JVM is in one way or another
|
||||
// forced to use a particular compiler or their combination. The constraint functions
|
||||
// deliberately ignore the fact that there may also be methods installed
|
||||
// through JVMCI (where the JVMCI compiler was invoked not through the broker). Be sure
|
||||
// to check for those (using is_jvmci()) in situations where it matters.
|
||||
//
|
||||
// forced to use a particular compiler or their combination.
|
||||
|
||||
// Is the JVM in a configuration that permits only c1-compiled methods (level 1,2,3)?
|
||||
inline bool CompilerConfig::is_c1_only() {
|
||||
if (!is_interpreter_only() && has_c1()) {
|
||||
const bool c1_only = !has_c2() && !is_jvmci_compiler();
|
||||
const bool c1_only = !has_c2();
|
||||
const bool tiered_degraded_to_c1_only = TieredCompilation && TieredStopAtLevel >= CompLevel_simple && TieredStopAtLevel < CompLevel_full_optimization;
|
||||
const bool c1_only_compilation_mode = CompilationModeFlag::quick_only();
|
||||
return c1_only || tiered_degraded_to_c1_only || c1_only_compilation_mode;
|
||||
@ -56,13 +49,8 @@ inline bool CompilerConfig::is_c1_only() {
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool CompilerConfig::is_c1_or_interpreter_only_no_jvmci() {
|
||||
assert(!is_jvmci_compiler() || is_jvmci(), "JVMCI compiler implies enabled JVMCI");
|
||||
return !is_jvmci() && (is_interpreter_only() || is_c1_only());
|
||||
}
|
||||
|
||||
inline bool CompilerConfig::is_c1_only_no_jvmci() {
|
||||
return is_c1_only() && !is_jvmci();
|
||||
inline bool CompilerConfig::is_c1_or_interpreter_only() {
|
||||
return is_interpreter_only() || is_c1_only();
|
||||
}
|
||||
|
||||
// Is the JVM in a configuration that permits only c1-compiled methods at level 1?
|
||||
@ -77,18 +65,14 @@ inline bool CompilerConfig::is_c1_simple_only() {
|
||||
}
|
||||
|
||||
inline bool CompilerConfig::is_c2_enabled() {
|
||||
return has_c2() && !is_interpreter_only() && !is_c1_only() && !is_jvmci_compiler();
|
||||
return has_c2() && !is_interpreter_only() && !is_c1_only();
|
||||
}
|
||||
|
||||
inline bool CompilerConfig::is_jvmci_compiler_enabled() {
|
||||
return is_jvmci_compiler() && !is_interpreter_only() && !is_c1_only();
|
||||
}
|
||||
// Is the JVM in a configuration that permits only c2-compiled methods?
|
||||
inline bool CompilerConfig::is_c2_only() {
|
||||
if (is_c2_enabled()) {
|
||||
const bool c2_only = !has_c1();
|
||||
// There is no JVMCI compiler to replace C2 in the broker, and the user (or ergonomics)
|
||||
// is forcing C1 off.
|
||||
// The user (or ergonomics) is forcing C1 off.
|
||||
const bool c2_only_compilation_mode = CompilationModeFlag::high_only();
|
||||
const bool tiered_off = !TieredCompilation;
|
||||
return c2_only || c2_only_compilation_mode || tiered_off;
|
||||
@ -96,30 +80,14 @@ inline bool CompilerConfig::is_c2_only() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Is the JVM in a configuration that permits only jvmci-compiled methods?
|
||||
inline bool CompilerConfig::is_jvmci_compiler_only() {
|
||||
if (is_jvmci_compiler_enabled()) {
|
||||
const bool jvmci_compiler_only = !has_c1();
|
||||
// JVMCI compiler replaced C2 and the user (or ergonomics) is forcing C1 off.
|
||||
const bool jvmci_only_compilation_mode = CompilationModeFlag::high_only();
|
||||
const bool tiered_off = !TieredCompilation;
|
||||
return jvmci_compiler_only || jvmci_only_compilation_mode || tiered_off;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool CompilerConfig::is_c2_or_jvmci_compiler_only() {
|
||||
return is_c2_only() || is_jvmci_compiler_only();
|
||||
}
|
||||
|
||||
// Tiered is basically C1 & (C2 | JVMCI) minus all the odd cases with restrictions.
|
||||
// Tiered is basically C1 & C2 minus all the odd cases with restrictions.
|
||||
inline bool CompilerConfig::is_tiered() {
|
||||
assert(!is_c1_simple_only() || is_c1_only(), "c1 simple mode must imply c1-only mode");
|
||||
return has_tiered() && !is_interpreter_only() && !is_c1_only() && !is_c2_or_jvmci_compiler_only();
|
||||
return has_tiered() && !is_interpreter_only() && !is_c1_only() && !is_c2_only();
|
||||
}
|
||||
|
||||
inline bool CompilerConfig::is_c1_enabled() {
|
||||
return has_c1() && !is_interpreter_only() && !is_c2_or_jvmci_compiler_only();
|
||||
return has_c1() && !is_interpreter_only() && !is_c2_only();
|
||||
}
|
||||
|
||||
inline bool CompilerConfig::is_c1_profiling() {
|
||||
@ -128,21 +96,4 @@ inline bool CompilerConfig::is_c1_profiling() {
|
||||
return c1_only_profiling || tiered;
|
||||
}
|
||||
|
||||
inline bool CompilerConfig::is_c2_or_jvmci_compiler_enabled() {
|
||||
return is_c2_enabled() || is_jvmci_compiler_enabled();
|
||||
}
|
||||
|
||||
// Return type of most optimizing compiler which is used
|
||||
inline CompilerType CompilerConfig::compiler_type() {
|
||||
CompilerType compiler_type = CompilerType::compiler_none; // Interpreter only
|
||||
if (CompilerConfig::is_c2_enabled()) {
|
||||
compiler_type = CompilerType::compiler_c2;
|
||||
} else if (CompilerConfig::is_jvmci_compiler_enabled()) {
|
||||
compiler_type = CompilerType::compiler_jvmci;
|
||||
} else if (CompilerConfig::is_c1_enabled()) {
|
||||
compiler_type = CompilerType::compiler_c1;
|
||||
}
|
||||
return compiler_type;
|
||||
}
|
||||
|
||||
#endif // SHARE_COMPILER_COMPILERDEFINITIONS_INLINE_HPP
|
||||
|
||||
@ -191,7 +191,7 @@ DirectiveSet* CompilerDirectives::get_for(AbstractCompiler *comp) {
|
||||
return _c2_store;
|
||||
} else {
|
||||
// use c1_store as default
|
||||
assert(comp->is_c1() || comp->is_jvmci(), "");
|
||||
assert(comp->is_c1(), "");
|
||||
return _c1_store;
|
||||
}
|
||||
}
|
||||
@ -671,9 +671,9 @@ void DirectivesStack::init() {
|
||||
char str[] = "*.*";
|
||||
const char* error_msg = nullptr;
|
||||
_default_directives->add_match(str, error_msg);
|
||||
#if defined(COMPILER1) || INCLUDE_JVMCI
|
||||
#ifdef COMPILER1
|
||||
_default_directives->_c1_store->EnableOption = true;
|
||||
#endif
|
||||
#endif // COMPILER1
|
||||
#ifdef COMPILER2
|
||||
if (CompilerConfig::is_c2_enabled()) {
|
||||
_default_directives->_c2_store->EnableOption = true;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user