mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-28 15:51:02 +00:00
Merge
This commit is contained in:
commit
f50d8b036b
1
.hgtags
1
.hgtags
@ -488,3 +488,4 @@ e1e60f75cd39312a7f59d2a4f91d624e5aecc95e jdk-11+11
|
||||
3595bd343b65f8c37818ebe6a4c343ddeb1a5f88 jdk-11+14
|
||||
a11c1cb542bbd1671d25b85efe7d09b983c48525 jdk-11+15
|
||||
02934b0d661b82b7fe1052a04998d2091352e08d jdk-11+16
|
||||
64e4b1686141e57a681936a8283983341484676e jdk-11+17
|
||||
|
||||
@ -32,6 +32,36 @@ endif
|
||||
|
||||
include NativeCompilation.gmk
|
||||
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, common/JdkNativeCompilation.gmk))
|
||||
|
||||
FindSrcDirsForLib += \
|
||||
$(call uniq, $(wildcard \
|
||||
$(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/lib$(strip $2) \
|
||||
$(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/native/lib$(strip $2) \
|
||||
$(TOPDIR)/src/$(strip $1)/share/native/lib$(strip $2)))
|
||||
|
||||
FindSrcDirsForComponent += \
|
||||
$(call uniq, $(wildcard \
|
||||
$(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/$(strip $2) \
|
||||
$(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/native/$(strip $2) \
|
||||
$(TOPDIR)/src/$(strip $1)/share/native/$(strip $2)))
|
||||
|
||||
GetJavaHeaderDir = \
|
||||
$(wildcard $(SUPPORT_OUTPUTDIR)/headers/$(strip $1))
|
||||
|
||||
# Process a dir description such as "java.base:headers" into a set of proper absolute paths.
|
||||
ProcessDir = \
|
||||
$(if $(findstring :, $1), \
|
||||
$(call FindSrcDirsForComponent, $(firstword $(subst :, , $1)), $(lastword $(subst :, , $1))) \
|
||||
, \
|
||||
$(if $(filter /%, $1), \
|
||||
$1 \
|
||||
, \
|
||||
$(call FindSrcDirsForComponent, $(MODULE), $1) \
|
||||
) \
|
||||
)
|
||||
|
||||
# Setup make rules for creating a native shared library with suitable defaults
|
||||
# for the OpenJDK project.
|
||||
#
|
||||
@ -39,8 +69,16 @@ include NativeCompilation.gmk
|
||||
# and the targets generated are listed in a variable by that name.
|
||||
#
|
||||
# Remaining parameters are named arguments. These are all passed on to
|
||||
# SetupNativeCompilation, except for
|
||||
# SetupNativeCompilation, except for
|
||||
# EXTRA_RC_FLAGS -- additional RC_FLAGS to append.
|
||||
# EXTRA_HEADER_DIRS -- additional directories to look for headers in
|
||||
# EXTRA_SRC -- additional directories to look for source in
|
||||
# EXCLUDE_SRC_PATTERNS -- exclude source dirs matching these patterns from
|
||||
# appearing in SRC.
|
||||
# HEADERS_FROM_SRC -- if false, does not add source dirs automatically as
|
||||
# header include dirs. (Defaults to true.)
|
||||
# SRC -- this is passed on, but preprocessed to accept source dir designations
|
||||
# such as "java.base:headers".
|
||||
SetupJdkLibrary = $(NamedParamsMacroTemplate)
|
||||
define SetupJdkLibraryBody
|
||||
ifeq ($$($1_OUTPUT_DIR), )
|
||||
@ -51,6 +89,20 @@ define SetupJdkLibraryBody
|
||||
$1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/lib$$($1_NAME)
|
||||
endif
|
||||
|
||||
ifeq ($$($1_SRC), )
|
||||
$1_SRC := $$(call FindSrcDirsForLib, $$(MODULE), $$($1_NAME))
|
||||
else
|
||||
$1_SRC := $$(foreach dir, $$($1_SRC), $$(call ProcessDir, $$(dir)))
|
||||
endif
|
||||
ifneq ($$($1_EXTRA_SRC), )
|
||||
$1_SRC += $$(foreach dir, $$($1_EXTRA_SRC), $$(call ProcessDir, $$(dir)))
|
||||
endif
|
||||
|
||||
ifneq ($$($1_EXCLUDE_SRC_PATTERNS), )
|
||||
$1_EXCLUDE_SRC := $$(call containing, $$($1_EXCLUDE_SRC_PATTERNS), $$($1_SRC))
|
||||
$1_SRC := $$(filter-out $$($1_EXCLUDE_SRC), $$($1_SRC))
|
||||
endif
|
||||
|
||||
ifeq ($$($1_VERSIONINFO_RESOURCE), )
|
||||
$1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE)
|
||||
else ifeq ($$($1_VERSIONINFO_RESOURCE), DISABLE)
|
||||
@ -66,6 +118,25 @@ define SetupJdkLibraryBody
|
||||
$1_RC_FLAGS :=
|
||||
endif
|
||||
|
||||
ifneq ($$($1_HEADERS_FROM_SRC), false)
|
||||
$1_SRC_HEADER_FLAGS := $$(foreach dir, $$(wildcard $$($1_SRC) \
|
||||
$$(call GetJavaHeaderDir, $$(MODULE))), -I$$(dir))
|
||||
endif
|
||||
ifneq ($$($1_EXTRA_HEADER_DIRS), )
|
||||
$1_PROCESSED_EXTRA_HEADER_DIRS := $$(foreach dir, $$($1_EXTRA_HEADER_DIRS), \
|
||||
$$(call ProcessDir, $$(dir)))
|
||||
$1_EXTRA_HEADER_FLAGS := $$(addprefix -I, $$($1_PROCESSED_EXTRA_HEADER_DIRS))
|
||||
endif
|
||||
|
||||
ifneq ($$($1_CFLAGS), )
|
||||
$1_CFLAGS += $$($1_SRC_HEADER_FLAGS) $$($1_EXTRA_HEADER_FLAGS)
|
||||
endif
|
||||
ifneq ($$($1_CXXFLAGS), )
|
||||
$1_CXXFLAGS += $$($1_SRC_HEADER_FLAGS) $$($1_EXTRA_HEADER_FLAGS)
|
||||
endif
|
||||
ifeq ($$($1_CFLAGS)$$($1_CXXFLAGS), )
|
||||
$1_CFLAGS += $$($1_SRC_HEADER_FLAGS) $$($1_EXTRA_HEADER_FLAGS)
|
||||
endif
|
||||
$1_RC_FLAGS += $$($1_EXTRA_RC_FLAGS)
|
||||
|
||||
# Since we reuse the rule name ($1), all our arguments will pass through.
|
||||
@ -80,7 +151,7 @@ endef
|
||||
# and the targets generated are listed in a variable by that name.
|
||||
#
|
||||
# Remaining parameters are named arguments. These are all passed on to
|
||||
# SetupNativeCompilation, except for
|
||||
# SetupNativeCompilation, except for
|
||||
# EXTRA_RC_FLAGS -- additional RC_FLAGS to append.
|
||||
SetupJdkExecutable = $(NamedParamsMacroTemplate)
|
||||
define SetupJdkExecutableBody
|
||||
|
||||
@ -634,7 +634,7 @@ endef
|
||||
################################################################################
|
||||
# Filter out duplicate sub strings while preserving order. Keeps the first occurance.
|
||||
uniq = \
|
||||
$(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
|
||||
$(strip $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1))))
|
||||
|
||||
# Returns all whitespace-separated words in $2 where at least one of the
|
||||
# whitespace-separated words in $1 is a substring.
|
||||
|
||||
@ -233,7 +233,7 @@ var getJibProfilesCommon = function (input, data) {
|
||||
common.main_profile_names = [
|
||||
"linux-x64", "linux-x86", "macosx-x64", "solaris-x64",
|
||||
"solaris-sparcv9", "windows-x64", "windows-x86",
|
||||
"linux-aarch64", "linux-arm64", "linux-arm-vfp-hflt",
|
||||
"linux-aarch64", "linux-arm32", "linux-arm64", "linux-arm-vfp-hflt",
|
||||
"linux-arm-vfp-hflt-dyn"
|
||||
];
|
||||
|
||||
@ -452,6 +452,17 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
],
|
||||
},
|
||||
|
||||
"linux-arm32": {
|
||||
target_os: "linux",
|
||||
target_cpu: "arm",
|
||||
build_cpu: "x64",
|
||||
dependencies: ["devkit", "autoconf", "build_devkit", "cups"],
|
||||
configure_args: [
|
||||
"--openjdk-target=arm-linux-gnueabihf", "--with-freetype=bundled",
|
||||
"--with-abi-profile=arm-vfp-hflt", "--disable-warnings-as-errors"
|
||||
],
|
||||
},
|
||||
|
||||
"linux-arm-vfp-hflt": {
|
||||
target_os: "linux",
|
||||
target_cpu: "arm",
|
||||
@ -586,6 +597,9 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
"linux-aarch64": {
|
||||
platform: "linux-aarch64",
|
||||
},
|
||||
"linux-arm32": {
|
||||
platform: "linux-arm32",
|
||||
},
|
||||
"linux-arm64": {
|
||||
platform: "linux-arm64-vfp-hflt",
|
||||
},
|
||||
@ -790,7 +804,11 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
: "gcc7.3.0-Fedora27+1.0"),
|
||||
linux_arm: (input.profile != null && input.profile.indexOf("hflt") >= 0
|
||||
? "gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux+1.0"
|
||||
: "arm-linaro-4.7+1.0")
|
||||
: (input.profile.indexOf("arm32") >= 0
|
||||
? "gcc7.3.0-Fedora27+1.0"
|
||||
: "arm-linaro-4.7+1.0"
|
||||
)
|
||||
)
|
||||
};
|
||||
|
||||
var devkit_platform = (input.target_cpu == "x86"
|
||||
|
||||
@ -42,6 +42,8 @@
|
||||
# line looking like this:
|
||||
#
|
||||
# make cross_compile_target="aarch64-linux-gnu" BASE_OS=Fedora27
|
||||
# or
|
||||
# make cross_compile_target="arm-linux-gnueabihf" BASE_OS=Fedora27
|
||||
#
|
||||
# This is the makefile which iterates over all host and target platforms.
|
||||
#
|
||||
|
||||
@ -44,13 +44,23 @@ $(info HOST=$(HOST))
|
||||
$(info BUILD=$(BUILD))
|
||||
|
||||
ARCH := $(word 1,$(subst -, ,$(TARGET)))
|
||||
|
||||
ifeq ($(TARGET), arm-linux-gnueabihf)
|
||||
ARCH=armhfp
|
||||
endif
|
||||
|
||||
$(info ARCH=$(ARCH))
|
||||
|
||||
ifeq ($(BASE_OS), OEL6)
|
||||
OEL_URL := http://yum.oracle.com/repo/OracleLinux/OL6/4/base/$(ARCH)/
|
||||
LINUX_VERSION := OEL6.4
|
||||
else ifeq ($(BASE_OS), Fedora27)
|
||||
OEL_URL := https://dl.fedoraproject.org/pub/fedora-secondary/releases/27/Everything/$(ARCH)/os/Packages/
|
||||
ifeq ($(ARCH), aarch64)
|
||||
FEDORA_TYPE=fedora-secondary
|
||||
else
|
||||
FEDORA_TYPE=fedora/linux
|
||||
endif
|
||||
OEL_URL := https://dl.fedoraproject.org/pub/$(FEDORA_TYPE)/releases/27/Everything/$(ARCH)/os/Packages/
|
||||
LINUX_VERSION := Fedora 27
|
||||
else
|
||||
$(error Unknown base OS $(BASE_OS))
|
||||
@ -189,6 +199,8 @@ ifeq ($(ARCH),x86_64)
|
||||
endif
|
||||
else ifeq ($(ARCH),i686)
|
||||
RPM_ARCHS := i386 i686 noarch
|
||||
else ifeq ($(ARCH), armhfp)
|
||||
RPM_ARCHS := $(ARCH) armv7hl noarch
|
||||
else
|
||||
RPM_ARCHS := $(ARCH) noarch
|
||||
endif
|
||||
@ -410,6 +422,10 @@ ifneq (,$(findstring linux,$(TARGET)))
|
||||
$(BUILDDIR)/$(gcc_ver)/Makefile : CONFIG += --enable-__cxa_atexit
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH), armhfp)
|
||||
$(BUILDDIR)/$(gcc_ver)/Makefile : CONFIG += --with-float=hard
|
||||
endif
|
||||
|
||||
# Want:
|
||||
# c,c++
|
||||
# shared libs
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# 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,6 +32,7 @@ $(eval $(call SetupCompileProperties,COMPILE_PROPERTIES, \
|
||||
$(JAVAC_VERSION)))
|
||||
|
||||
$(eval $(call SetupParseProperties,PARSE_PROPERTIES, \
|
||||
com/sun/tools/javac/resources/compiler.properties))
|
||||
com/sun/tools/javac/resources/compiler.properties \
|
||||
com/sun/tools/javac/resources/launcher.properties))
|
||||
|
||||
all: $(COMPILE_PROPERTIES) $(PARSE_PROPERTIES)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -38,7 +38,8 @@ module.names = java.compiler \
|
||||
jdk.jshell
|
||||
|
||||
langtools.resource.includes = \
|
||||
com/sun/tools/javac/resources/compiler.properties
|
||||
com/sun/tools/javac/resources/compiler.properties \
|
||||
com/sun/tools/javac/resources/launcher.properties
|
||||
|
||||
# Version info -- override as needed
|
||||
jdk.version = 9
|
||||
|
||||
@ -27,37 +27,38 @@ $(eval $(call IncludeCustomExtension, lib/Awt2dLibraries-pre.gmk))
|
||||
|
||||
WIN_AWT_LIB := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt/awt.lib
|
||||
|
||||
LIBAWT_DEFAULT_HEADER_DIRS := \
|
||||
libawt/awt/image \
|
||||
libawt/awt/image/cvutils \
|
||||
libawt/java2d \
|
||||
libawt/java2d/loops \
|
||||
libawt/java2d/pipe \
|
||||
#
|
||||
|
||||
################################################################################
|
||||
|
||||
BUILD_LIBMLIB_SRC := $(TOPDIR)/src/java.desktop/share/native/libmlib_image \
|
||||
$(TOPDIR)/src/java.desktop/share/native/common/awt/medialib
|
||||
BUILD_LIBMLIB_CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \
|
||||
$(addprefix -I, $(BUILD_LIBMLIB_SRC)) \
|
||||
-I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libmlib_image
|
||||
# We must not include java.desktop/unix/native/libmlib_image, which is only
|
||||
# for usage by solaris-sparc in libmlib_image_v.
|
||||
BUILD_LIBMLIB_EXCLUDE_SRC_PATTERNS := unix
|
||||
|
||||
BUILD_LIBMLIB_LDLIBS :=
|
||||
|
||||
BUILD_LIBMLIB_CFLAGS += -DMLIB_NO_LIBSUNMATH
|
||||
BUILD_LIBMLIB_CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES -DMLIB_NO_LIBSUNMATH
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
|
||||
BUILD_LIBMLIB_CFLAGS += -DMLIB_OS64BIT
|
||||
endif
|
||||
|
||||
ifneq ($(OPENJDK_TARGET_OS), windows)
|
||||
BUILD_LIBMLIB_LDLIBS += $(LIBM) $(LIBDL)
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBMLIB_IMAGE, \
|
||||
NAME := mlib_image, \
|
||||
SRC := $(BUILD_LIBMLIB_SRC), \
|
||||
EXTRA_SRC := common/awt/medialib, \
|
||||
EXCLUDE_FILES := mlib_c_ImageBlendTable.c, \
|
||||
EXCLUDE_SRC_PATTERNS := $(BUILD_LIBMLIB_EXCLUDE_SRC_PATTERNS), \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(BUILD_LIBMLIB_CFLAGS), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS := $(BUILD_LIBMLIB_LDLIBS) \
|
||||
$(JDKLIB_LIBS), \
|
||||
LIBS := $(JDKLIB_LIBS), \
|
||||
LIBS_unix := $(LIBM) $(LIBDL), \
|
||||
))
|
||||
|
||||
$(BUILD_LIBMLIB_IMAGE): $(call FindLib, java.base, java)
|
||||
@ -68,14 +69,19 @@ TARGETS += $(BUILD_LIBMLIB_IMAGE)
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
|
||||
|
||||
LIBMLIB_IMAGE_V_SRC := $(TOPDIR)/src/java.desktop/share/native/libmlib_image \
|
||||
$(TOPDIR)/src/java.desktop/unix/native/libmlib_image \
|
||||
$(TOPDIR)/src/java.desktop/share/native/common/awt/medialib \
|
||||
$(TOPDIR)/src/java.desktop/unix/native/common/awt/medialib \
|
||||
#
|
||||
LIBMLIB_IMAGE_V_CFLAGS := $(TOPDIR)/src/java.desktop/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il \
|
||||
$(addprefix -I, $(LIBMLIB_IMAGE_V_SRC)) \
|
||||
#
|
||||
# libmlib_image_v is basically built from mlib_image sources, with some additions
|
||||
# and some exclusions.
|
||||
LIBMLIB_IMAGE_V_SRC := \
|
||||
libmlib_image \
|
||||
common/awt/medialib \
|
||||
#
|
||||
|
||||
LIBMLIB_IMAGE_V_CFLAGS := -xarch=sparcvis -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \
|
||||
$(TOPDIR)/src/$(MODULE)/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
|
||||
LIBMLIB_IMAGE_V_CFLAGS += -DMLIB_OS64BIT
|
||||
endif
|
||||
|
||||
BUILD_LIBMLIB_IMAGE_V_EXFILES := \
|
||||
awt_ImagingLib.c \
|
||||
@ -95,19 +101,16 @@ ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
|
||||
mlib_c_ImageLookUp_f.c \
|
||||
#
|
||||
|
||||
LIBMLIB_IMAGE_V_CFLAGS += $(filter-out -DMLIB_NO_LIBSUNMATH, $(BUILD_LIBMLIB_CFLAGS))
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBMLIB_IMAGE_V, \
|
||||
NAME := mlib_image_v, \
|
||||
SRC := $(LIBMLIB_IMAGE_V_SRC), \
|
||||
EXCLUDE_FILES := $(BUILD_LIBMLIB_IMAGE_V_EXFILES), \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := -xarch=sparcvis \
|
||||
$(LIBMLIB_IMAGE_V_CFLAGS) \
|
||||
$(CFLAGS_JDKLIB), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(LIBMLIB_IMAGE_V_CFLAGS), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS := -ljava -ljvm $(BUILD_LIBMLIB_LDLIBS), \
|
||||
LIBS := -ljava -ljvm $(LIBM) $(LIBDL), \
|
||||
))
|
||||
|
||||
$(BUILD_LIBMLIB_IMAGE_V): $(call FindLib, java.base, java)
|
||||
@ -118,18 +121,22 @@ endif
|
||||
|
||||
################################################################################
|
||||
|
||||
LIBAWT_DIRS := $(TOPDIR)/src/java.desktop/share/native/libawt \
|
||||
$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt \
|
||||
$(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
|
||||
$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
LIBAWT_EXTRA_SRC := \
|
||||
common/awt/debug \
|
||||
$(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
#
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), aix)
|
||||
LIBAWT_DIRS += $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/libawt
|
||||
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
|
||||
LIBAWT_EXTRA_SRC += $(TOPDIR)/src/$(MODULE)/share/native/common/awt/medialib
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
LIBAWT_DIRS += $(TOPDIR)/src/java.desktop/share/native/common/awt/utility
|
||||
LIBAWT_EXTRA_SRC += \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/awt/utility \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/font \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/java2d/opengl \
|
||||
$(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt/systemscale \
|
||||
#
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(OPENJDK_TARGET_OS), solaris linux macosx aix), )
|
||||
@ -140,33 +147,45 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
LIBAWT_EXFILES += initIDs.c awt/image/cvutils/img_colors.c
|
||||
endif
|
||||
|
||||
LIBAWT_CFLAGS += -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
|
||||
$(addprefix -I, $(shell find $(LIBAWT_DIRS) -type d)) \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
$(addprefix -I, $(BUILD_LIBMLIB_IMAGE_SRC)) \
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
LIBAWT_EXFILES += \
|
||||
java2d/d3d/D3DShaderGen.c \
|
||||
awt/image/cvutils/img_colors.c \
|
||||
#
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-sparcv9)
|
||||
LIBAWT_EXFILES += java2d/loops/MapAccelFunc.c
|
||||
else
|
||||
LIBAWT_EXCLUDES += \
|
||||
$(TOPDIR)/src/$(MODULE)/unix/native/libawt/awt/medialib \
|
||||
$(TOPDIR)/src/$(MODULE)/unix/native/libawt/java2d/loops \
|
||||
$(TOPDIR)/src/$(MODULE)/unix/native/common/awt/medialib \
|
||||
#
|
||||
endif
|
||||
|
||||
LIBAWT_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
$(call GetJavaHeaderDir, java.base) \
|
||||
libawt/awt/medialib \
|
||||
libawt/java2d/d3d \
|
||||
libawt/java2d/opengl \
|
||||
libawt/java2d/windows \
|
||||
libawt/windows \
|
||||
common/awt/medialib \
|
||||
libmlib_image \
|
||||
include \
|
||||
java.base:libjava \
|
||||
java.base:include \
|
||||
#
|
||||
|
||||
LIBAWT_CFLAGS += -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES $(X_CFLAGS)
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
|
||||
LIBAWT_CFLAGS += -DMLIB_ADD_SUFF
|
||||
LIBAWT_CFLAGS += -xarch=sparcvis
|
||||
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-sparcv9)
|
||||
LIBAWT_CFLAGS += -xarch=sparcvis -DMLIB_ADD_SUFF \
|
||||
$(TOPDIR)/src/$(MODULE)/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il
|
||||
|
||||
LIBAWT_CFLAGS += $(TOPDIR)/src/java.desktop/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il
|
||||
LIBAWT_DIRS += $(TOPDIR)/src/java.desktop/share/native/common/awt/medialib
|
||||
LIBAWT_EXFILES += java2d/loops/MapAccelFunc.c
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
|
||||
LIBAWT_ASFLAGS = -P -xarch=v9a
|
||||
else
|
||||
LIBAWT_ASFLAGS = -P -xarch=v8plusa
|
||||
endif
|
||||
else
|
||||
LIBAWT_EXCLUDES += \
|
||||
$(TOPDIR)/src/java.desktop/unix/native/libawt/awt/medialib \
|
||||
$(TOPDIR)/src/java.desktop/unix/native/libawt/java2d/loops \
|
||||
$(TOPDIR)/src/java.desktop/unix/native/common/awt/medialib \
|
||||
#
|
||||
LIBAWT_ASFLAGS = -P -xarch=v9a
|
||||
endif
|
||||
|
||||
ifneq ($(OPENJDK_TARGET_OS), solaris)
|
||||
@ -174,29 +193,13 @@ ifneq ($(OPENJDK_TARGET_OS), solaris)
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
LIBAWT_DIRS += $(TOPDIR)/src/java.desktop/share/native/common/font \
|
||||
$(TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
|
||||
$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt/systemscale \
|
||||
# Why does libawt need java.base headers?
|
||||
LIBAWT_CFLAGS += -I$(TOPDIR)/src/java.desktop/share/native/common/font \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
|
||||
-I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
|
||||
-I$(TOPDIR)/src/java.desktop/windows/native/include \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/include \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.base \
|
||||
#
|
||||
LIBAWT_EXFILES += \
|
||||
java2d/d3d/D3DShaderGen.c \
|
||||
awt/image/cvutils/img_colors.c \
|
||||
#
|
||||
|
||||
LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE
|
||||
ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
|
||||
LIBAWT_CFLAGS += -DMLIB_OS64BIT
|
||||
endif
|
||||
|
||||
LIBAWT_RC_FLAGS ?= -I $(TOPDIR)/src/java.base/windows/native/launcher/icons
|
||||
LIBAWT_VERSIONINFO_RESOURCE := $(TOPDIR)/src/java.desktop/windows/native/libawt/windows/awt.rc
|
||||
LIBAWT_VERSIONINFO_RESOURCE := $(TOPDIR)/src/$(MODULE)/windows/native/libawt/windows/awt.rc
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), linux)
|
||||
@ -215,11 +218,12 @@ endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
|
||||
NAME := awt, \
|
||||
SRC := $(LIBAWT_DIRS), \
|
||||
EXTRA_SRC := $(LIBAWT_EXTRA_SRC), \
|
||||
EXCLUDES := $(LIBAWT_EXCLUDES), \
|
||||
EXCLUDE_FILES := $(LIBAWT_EXFILES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_EXTRA_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_gcc := sign-compare unused-result maybe-uninitialized \
|
||||
format-nonliteral parentheses, \
|
||||
DISABLED_WARNINGS_clang := logical-op-parentheses extern-initializer, \
|
||||
@ -265,39 +269,26 @@ TARGETS += $(BUILD_LIBAWT)
|
||||
|
||||
################################################################################
|
||||
|
||||
ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
|
||||
ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx), )
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
|
||||
LIBAWT_XAWT_DIRS := \
|
||||
$(wildcard $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/libawt_xawt) \
|
||||
$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt_xawt \
|
||||
$(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
|
||||
$(TOPDIR)/src/java.desktop/share/native/common/awt/utility \
|
||||
$(TOPDIR)/src/java.desktop/share/native/common/font \
|
||||
$(TOPDIR)/src/java.desktop/share/native/common/java2d \
|
||||
$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d \
|
||||
$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
LIBAWT_XAWT_EXTRA_SRC := \
|
||||
common/awt \
|
||||
common/java2d \
|
||||
common/font \
|
||||
#
|
||||
|
||||
ifneq ($(filter $(OPENJDK_TARGET_OS),linux solaris aix), )
|
||||
LIBAWT_XAWT_DIRS += $(TOPDIR)/src/java.desktop/unix/native/common/awt/systemscale
|
||||
endif
|
||||
|
||||
LIBAWT_XAWT_EXCLUDES := medialib
|
||||
|
||||
LIBAWT_XAWT_CFLAGS := $(addprefix -I, $(shell $(FIND) $(LIBAWT_XAWT_DIRS) -type d)) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/include \
|
||||
-I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/include \
|
||||
-I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/include \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d \
|
||||
-I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
|
||||
-I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/font \
|
||||
$(LIBJAVA_HEADER_FLAGS)
|
||||
LIBAWT_XAWT_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
libawt_xawt/awt \
|
||||
include \
|
||||
common/awt/debug \
|
||||
common/awt/systemscale \
|
||||
common/font \
|
||||
common/java2d/opengl \
|
||||
common/java2d/x11 \
|
||||
#
|
||||
|
||||
LIBAWT_XAWT_CFLAGS += -DXAWT -DXAWT_HACK \
|
||||
@ -334,7 +325,8 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT_XAWT, \
|
||||
NAME := awt_xawt, \
|
||||
SRC := $(LIBAWT_XAWT_DIRS), \
|
||||
EXTRA_SRC := $(LIBAWT_XAWT_EXTRA_SRC), \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_XAWT_EXTRA_HEADER_DIRS), \
|
||||
EXCLUDES := $(LIBAWT_XAWT_EXCLUDES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
|
||||
@ -350,10 +342,6 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN) \
|
||||
-L$(INSTALL_LIBRARIES_HERE), \
|
||||
LIBS := $(X_LIBS) $(LIBAWT_XAWT_LIBS), \
|
||||
RC_FLAGS := $(RC_FLAGS) \
|
||||
-D "JDK_FNAME=xawt.dll" \
|
||||
-D "JDK_INTERNAL_NAME=xawt" \
|
||||
-D "JDK_FTYPE=0x2L", \
|
||||
))
|
||||
|
||||
$(BUILD_LIBAWT_XAWT): $(call FindLib, java.base, java)
|
||||
@ -367,36 +355,34 @@ endif
|
||||
|
||||
################################################################################
|
||||
|
||||
LIBLCMS_SRC := $(TOPDIR)/src/java.desktop/share/native/liblcms
|
||||
LIBLCMS_CPPFLAGS += -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
#
|
||||
# The fast floor code loses precision.
|
||||
LCMS_CFLAGS=-DCMS_DONT_USE_FAST_FLOOR
|
||||
|
||||
LCMS_CFLAGS_JDKLIB := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB))
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LCMS), true)
|
||||
# If we're using an external library, we'll just need the wrapper part.
|
||||
# By including it explicitly, all other files will be excluded.
|
||||
BUILD_LIBLCMS_INCLUDE_FILES := LCMS.c
|
||||
# If we're using an external library, we can't include our own SRC path
|
||||
# as includes, instead the system headers should be used.
|
||||
LIBLCMS_HEADERS_FROM_SRC := false
|
||||
else
|
||||
BUILD_LIBLCMS_INCLUDE_FILES :=
|
||||
# If we're using the bundled library, we'll need to include it in the
|
||||
# include path explicitly. Otherwise the system headers will be used.
|
||||
LIBLCMS_CPPFLAGS += $(addprefix -I, $(LIBLCMS_SRC))
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBLCMS, \
|
||||
NAME := lcms, \
|
||||
SRC := $(LIBLCMS_SRC), \
|
||||
INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \
|
||||
$(LIBLCMS_CPPFLAGS) \
|
||||
CFLAGS := $(LCMS_CFLAGS_JDKLIB) \
|
||||
$(LCMS_CFLAGS), \
|
||||
CFLAGS_solaris := -xc99=no_lib, \
|
||||
CFLAGS_windows := -DCMS_IS_WINDOWS_, \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
common/awt/debug \
|
||||
libawt/java2d, \
|
||||
HEADERS_FROM_SRC := $(LIBLCMS_HEADERS_FROM_SRC), \
|
||||
DISABLED_WARNINGS_gcc := format-nonliteral type-limits misleading-indentation, \
|
||||
DISABLED_WARNINGS_clang := tautological-compare, \
|
||||
DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
|
||||
@ -414,8 +400,6 @@ $(BUILD_LIBLCMS): $(BUILD_LIBAWT)
|
||||
|
||||
################################################################################
|
||||
|
||||
LIBJAVAJPEG_SRC += $(TOPDIR)/src/java.desktop/share/native/libjavajpeg
|
||||
|
||||
# "DISABLED_WARNINGS_gcc := clobbered" rationale:
|
||||
# Suppress gcc warnings like "variable might be clobbered by 'longjmp'
|
||||
# or 'vfork'": this warning indicates that some variable is placed to
|
||||
@ -429,21 +413,20 @@ ifeq ($(USE_EXTERNAL_LIBJPEG), true)
|
||||
BUILD_LIBJAVAJPEG_INCLUDE_FILES := \
|
||||
imageioJPEG.c \
|
||||
jpegdecoder.c
|
||||
BUILD_LIBJAVAJPEG_HEADERS :=
|
||||
# If we're using an external library, we can't include our own SRC path
|
||||
# as includes, instead the system headers should be used.
|
||||
LIBJPEG_HEADERS_FROM_SRC := false
|
||||
else
|
||||
LIBJPEG_LIBS :=
|
||||
BUILD_LIBJAVAJPEG_INCLUDE_FILES :=
|
||||
BUILD_LIBJAVAJPEG_HEADERS := $(addprefix -I, $(LIBJAVAJPEG_SRC))
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJAVAJPEG, \
|
||||
NAME := javajpeg, \
|
||||
SRC := $(LIBJAVAJPEG_SRC), \
|
||||
INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBJAVAJPEG_HEADERS) \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
HEADERS_FROM_SRC := $(LIBJPEG_HEADERS_FROM_SRC), \
|
||||
DISABLED_WARNINGS_gcc := clobbered implicit-fallthrough shift-negative-value, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
@ -460,42 +443,32 @@ TARGETS += $(BUILD_LIBJAVAJPEG)
|
||||
# Mac and Windows only use the native AWT lib, do not build libawt_headless
|
||||
ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
|
||||
|
||||
LIBAWT_HEADLESS_DIRS := $(TOPDIR)/src/java.desktop/unix/native/libawt_headless/awt \
|
||||
$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d \
|
||||
$(TOPDIR)/src/java.desktop/share/native/common/java2d \
|
||||
$(TOPDIR)/src/java.desktop/share/native/common/font \
|
||||
LIBAWT_HEADLESS_EXTRA_SRC := \
|
||||
common/font \
|
||||
common/java2d \
|
||||
$(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
#
|
||||
|
||||
LIBAWT_HEADLESS_EXCLUDES := medialib
|
||||
LIBAWT_HEADLESS_CFLAGS := -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
|
||||
$(addprefix -I, $(LIBAWT_HEADLESS_DIRS)) \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d \
|
||||
-I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/common/font \
|
||||
-I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/font \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
|
||||
-I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
|
||||
LIBAWT_HEADLESS_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
common/awt/debug \
|
||||
common/font \
|
||||
common/java2d/opengl \
|
||||
#
|
||||
|
||||
LIBAWT_HEADLESS_CFLAGS := $(CUPS_CFLAGS) $(FONTCONFIG_CFLAGS) $(X_CFLAGS) \
|
||||
-DHEADLESS=true -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT_HEADLESS, \
|
||||
NAME := awt_headless, \
|
||||
SRC := $(LIBAWT_HEADLESS_DIRS), \
|
||||
EXTRA_SRC := $(LIBAWT_HEADLESS_EXTRA_SRC), \
|
||||
EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
-DHEADLESS=true \
|
||||
-DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
|
||||
$(CUPS_CFLAGS) \
|
||||
$(FONTCONFIG_CFLAGS) \
|
||||
$(X_CFLAGS) \
|
||||
$(LIBAWT_HEADLESS_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_HEADLESS_EXTRA_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_xlc := 1506-356, \
|
||||
DISABLED_WARNINGS_solstudio := E_EMPTY_TRANSLATION_UNIT, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
@ -519,12 +492,15 @@ endif
|
||||
################################################################################
|
||||
|
||||
ifeq ($(FREETYPE_TO_USE), system)
|
||||
# For use by libfontmanager:
|
||||
LIBFREETYPE_CFLAGS := $(FREETYPE_CFLAGS)
|
||||
LIBFREETYPE_LIBS := $(FREETYPE_LIBS)
|
||||
else
|
||||
LIBFREETYPE_SRC := $(TOPDIR)/src/java.desktop/share/native/libfreetype
|
||||
BUILD_LIBFREETYPE_HEADERS := $(addprefix -I, $(LIBFREETYPE_SRC)/include)
|
||||
LIBFREETYPE_CFLAGS := $(BUILD_LIBFREETYPE_HEADERS)
|
||||
BUILD_LIBFREETYPE_HEADER_DIRS := $(TOPDIR)/src/$(MODULE)/share/native/libfreetype/include
|
||||
BUILD_LIBFREETYPE_CFLAGS := -DFT2_BUILD_LIBRARY $(EXPORT_ALL_SYMBOLS)
|
||||
|
||||
# For use by libfontmanager:
|
||||
LIBFREETYPE_CFLAGS := -I$(BUILD_LIBFREETYPE_HEADER_DIRS)
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
LIBFREETYPE_LIBS := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfreetype/freetype.lib
|
||||
else
|
||||
@ -533,10 +509,10 @@ else
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBFREETYPE, \
|
||||
NAME := freetype, \
|
||||
SRC := $(LIBFREETYPE_SRC)/src, \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBFREETYPE_HEADERS) \
|
||||
-DFT2_BUILD_LIBRARY $(EXPORT_ALL_SYMBOLS), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(BUILD_LIBFREETYPE_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := $(BUILD_LIBFREETYPE_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_solstudio := \
|
||||
E_STATEMENT_NOT_REACHED \
|
||||
E_END_OF_LOOP_CODE_NOT_REACHED, \
|
||||
@ -551,19 +527,6 @@ endif
|
||||
|
||||
###########################################################################
|
||||
|
||||
LIBFONTMANAGER_SRC := $(TOPDIR)/src/java.desktop/share/native/libfontmanager \
|
||||
$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libfontmanager
|
||||
LIBFONTMANAGER_CFLAGS := \
|
||||
$(addprefix -I, $(shell $(FIND) \
|
||||
$(LIBFONTMANAGER_SRC) \
|
||||
$(TOPDIR)/src/java.desktop/share/native/libawt \
|
||||
$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt \
|
||||
$(TOPDIR)/src/java.desktop/share/native/common \
|
||||
$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common -type d)) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
#
|
||||
|
||||
#### Begin harfbuzz configuration
|
||||
|
||||
HARFBUZZ_CFLAGS := -DHAVE_OT -DHAVE_FALLBACK -DHAVE_UCDN
|
||||
@ -591,6 +554,16 @@ LIBFONTMANAGER_CFLAGS += $(HARFBUZZ_CFLAGS)
|
||||
|
||||
#### End harfbuzz configuration
|
||||
|
||||
LIBFONTMANAGER_EXTRA_HEADER_DIRS := \
|
||||
libfontmanager/harfbuzz \
|
||||
libfontmanager/harfbuzz/hb-ucdn \
|
||||
common/awt \
|
||||
common/font \
|
||||
libawt/java2d \
|
||||
libawt/java2d/pipe \
|
||||
libawt/java2d/loops \
|
||||
#
|
||||
|
||||
LIBFONTMANAGER_CFLAGS += $(LIBFREETYPE_CFLAGS)
|
||||
BUILD_LIBFONTMANAGER_FONTLIB += $(LIBFREETYPE_LIBS)
|
||||
|
||||
@ -600,7 +573,6 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
|
||||
X11TextRenderer.c
|
||||
LIBFONTMANAGER_OPTIMIZATION := HIGHEST
|
||||
LIBFONTMANAGER_CFLAGS += -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/windows
|
||||
else ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
|
||||
X11TextRenderer.c \
|
||||
@ -611,7 +583,7 @@ else
|
||||
lcdglyph.c
|
||||
endif
|
||||
|
||||
LIBFONTMANAGER_CFLAGS += $(FONT_HEADERS) $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS
|
||||
LIBFONTMANAGER_CFLAGS += $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS
|
||||
|
||||
ifeq ($(TOOLCHAIN_TYPE), gcc)
|
||||
# Turn off all warnings for sunFont.c. This is needed because the specific warning
|
||||
@ -627,7 +599,6 @@ endif
|
||||
# libawt_xawt). See JDK-8196516 for details.
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
|
||||
NAME := fontmanager, \
|
||||
SRC := $(LIBFONTMANAGER_SRC), \
|
||||
EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
|
||||
AccelGlyphCache.c, \
|
||||
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||
@ -635,6 +606,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
|
||||
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
|
||||
OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
|
||||
CFLAGS_windows = -DCC_NOEX, \
|
||||
EXTRA_HEADER_DIRS := $(LIBFONTMANAGER_EXTRA_HEADER_DIRS), \
|
||||
WARNINGS_AS_ERRORS_xlc := false, \
|
||||
DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast \
|
||||
type-limits missing-field-initializers implicit-fallthrough, \
|
||||
@ -666,7 +638,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
|
||||
$(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
$(BUILD_LIBFONTMANAGER): $(call FindLib, java.desktop, awt_lwawt)
|
||||
$(BUILD_LIBFONTMANAGER): $(call FindLib, $(MODULE), awt_lwawt)
|
||||
endif
|
||||
|
||||
ifeq ($(FREETYPE_TO_USE), bundled)
|
||||
@ -678,29 +650,30 @@ TARGETS += $(BUILD_LIBFONTMANAGER)
|
||||
################################################################################
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
LIBJAWT_SRC := $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libjawt
|
||||
LIBJAWT_CFLAGS := -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/windows \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
|
||||
-I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d/windows \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
|
||||
-I$(TOPDIR)/src/java.desktop/windows/native/include \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/include \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
|
||||
LIBJAWT_CFLAGS := -EHsc -DUNICODE -D_UNICODE
|
||||
|
||||
LIBJAWT_EXTRA_HEADER_DIRS := \
|
||||
include \
|
||||
common/awt/debug \
|
||||
libawt/awt/image/cvutils \
|
||||
libawt/java2d \
|
||||
libawt/java2d/windows \
|
||||
libawt/windows \
|
||||
java.base:include \
|
||||
java.base:libjava \
|
||||
#
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_CPU), x86)
|
||||
KERNEL32_LIB := kernel32.lib
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJAWT, \
|
||||
NAME := jawt, \
|
||||
SRC := $(LIBJAWT_SRC), \
|
||||
INCLUDE_FILES := $(LIBJAWT_INCLUDE_FILES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CXXFLAGS_JDKLIB) \
|
||||
-EHsc -DUNICODE -D_UNICODE \
|
||||
$(LIBJAWT_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := $(LIBJAWT_EXTRA_HEADER_DIRS), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
|
||||
LIBS := $(JDKLIB_LIBS) $(KERNEL32_LIB) advapi32.lib $(WIN_AWT_LIB), \
|
||||
))
|
||||
@ -719,17 +692,9 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
else # OPENJDK_TARGET_OS not windows
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
LIBJAWT_SRC := $(TOPDIR)/src/java.desktop/macosx/native/libjawt
|
||||
else
|
||||
LIBJAWT_SRC := $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libjawt
|
||||
# libjawt on macosx do not use the unix code
|
||||
LIBJAWT_EXCLUDE_SRC_PATTERNS := unix
|
||||
endif
|
||||
LIBJAWT_CFLAGS := \
|
||||
-I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
-I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/include \
|
||||
-I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/include \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/include \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
#
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
JAWT_LIBS := -lawt_lwawt
|
||||
@ -742,19 +707,22 @@ else # OPENJDK_TARGET_OS not windows
|
||||
JAWT_LIBS += -lawt_xawt
|
||||
else
|
||||
JAWT_LIBS += -lawt_headless
|
||||
HEADLESS_CFLAG += -DHEADLESS
|
||||
ifeq ($(OPENJDK_TARGET_OS), linux)
|
||||
JAWT_CFLAGS += -DHEADLESS
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJAWT, \
|
||||
NAME := jawt, \
|
||||
SRC := $(LIBJAWT_SRC), \
|
||||
EXCLUDE_SRC_PATTERNS := $(LIBJAWT_EXCLUDE_SRC_PATTERNS), \
|
||||
INCLUDE_FILES := $(JAWT_FILES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(LIBJAWT_CFLAGS), \
|
||||
CFLAGS_linux := $(HEADLESS_CFLAG), \
|
||||
CFLAGS_macosx := $(LIBJAWT_CFLAGS_macosx), \
|
||||
$(JAWT_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
include \
|
||||
common/awt, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
|
||||
@ -782,52 +750,56 @@ TARGETS += $(BUILD_LIBJAWT)
|
||||
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
|
||||
LIBSPLASHSCREEN_DIRS := \
|
||||
$(TOPDIR)/src/java.desktop/share/native/libjavajpeg \
|
||||
$(TOPDIR)/src/java.desktop/share/native/libsplashscreen \
|
||||
LIBSPLASHSCREEN_EXTRA_SRC := \
|
||||
common/awt/systemscale \
|
||||
#
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBGIF), true)
|
||||
GIFLIB_LIBS := -lgif
|
||||
LIBSPLASHSCREEN_EXCLUDES := giflib
|
||||
ifeq ($(USE_EXTERNAL_LIBGIF), false)
|
||||
LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/giflib
|
||||
else
|
||||
LIBSPLASHSCREEN_CFLAGS += -I$(TOPDIR)/src/java.desktop/share/native/libsplashscreen/giflib
|
||||
LIBSPLASHSCREEN_EXCLUDES := giflib
|
||||
GIFLIB_LIBS := -lgif
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBJPEG), true)
|
||||
LIBJPEG_LIBS := -ljpeg
|
||||
ifeq ($(USE_EXTERNAL_LIBJPEG), false)
|
||||
# While the following ought to work, it will currently pull in the closed
|
||||
# additions to this library, and this was not done previously in the build.
|
||||
# LIBSPLASHSCREEN_EXTRA_SRC += libjavajpeg
|
||||
LIBSPLASHSCREEN_EXTRA_SRC += $(TOPDIR)/src/java.desktop/share/native/libjavajpeg
|
||||
else
|
||||
LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/share/native/libjavajpeg
|
||||
LIBJPEG_CFLAGS := -I$(TOPDIR)/src/java.desktop/share/native/libjavajpeg
|
||||
LIBJPEG_LIBS := -ljpeg
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBPNG), false)
|
||||
LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/share/native/libsplashscreen/libpng
|
||||
LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/libpng
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
ifeq ($(USE_EXTERNAL_LIBZ), true)
|
||||
# When building our own libpng and using an external libz, we need to
|
||||
# inject our own libz.h to tweak the exported ZLIB_VERNUM macro. See
|
||||
# $(TOPDIR)/src/java.desktop/macosx/native/libsplashscreen/libpng/zlibwrapper/zlib.h
|
||||
# for details. This must be specified with -iquote, not -I to avoid a
|
||||
# circular include.
|
||||
LIBSPLASHSCREEN_CFLAGS += -iquote $(TOPDIR)/src/$(MODULE)/macosx/native/libsplashscreen/libpng/zlibwrapper
|
||||
endif
|
||||
endif
|
||||
else
|
||||
LIBSPLASHSCREEN_EXCLUDES += libpng
|
||||
endif
|
||||
|
||||
ifneq ($(OPENJDK_TARGET_OS), macosx)
|
||||
LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsplashscreen
|
||||
else
|
||||
LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/macosx/native/libsplashscreen
|
||||
ifeq ($(USE_EXTERNAL_LIBZ), false)
|
||||
LIBSPLASHSCREEN_EXTRA_SRC += java.base:libzip/zlib
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(OPENJDK_TARGET_OS),linux solaris aix), )
|
||||
LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/unix/native/common/awt/systemscale
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
# libsplashscreen on macosx do not use the unix code
|
||||
LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS := unix
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/windows/native/common/awt/systemscale
|
||||
endif
|
||||
LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0 \
|
||||
$(addprefix -I, $(LIBSPLASHSCREEN_DIRS)) \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
#
|
||||
LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
|
||||
LIBSPLASHSCREEN_CFLAGS += -I$(TOPDIR)/src/java.desktop/macosx/native/libosxapp
|
||||
|
||||
BUILD_LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0
|
||||
BUILD_LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0
|
||||
@ -845,20 +817,6 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
|
||||
LIBSPLASHSCREEN_LIBS :=
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBZ), false)
|
||||
LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.base/share/native/libzip/zlib
|
||||
else
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
ifeq ($(USE_EXTERNAL_LIBPNG), false)
|
||||
# When building our own libpng and using an external libz, we need to
|
||||
# inject our own libz.h to tweak the exported ZLIB_VERNUM macro. See
|
||||
# $(TOPDIR)/src/java.desktop/macosx/native/libsplashscreen/libpng/zlib.h
|
||||
# for details.
|
||||
LIBSPLASHSCREEN_CFLAGS += -iquote $(TOPDIR)/src/java.desktop/macosx/native/libsplashscreen/libpng
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
LIBSPLASHSCREEN_LIBS += \
|
||||
$(LIBM) -lpthread -liconv -losxapp \
|
||||
@ -872,14 +830,22 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
LIBSPLASHSCREEN_LIBS += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread -ldl
|
||||
endif
|
||||
|
||||
LIBSPLASHSCREEN_HEADER_DIRS += \
|
||||
libosxapp \
|
||||
java.base:include \
|
||||
java.base:libjava \
|
||||
#
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBSPLASHSCREEN, \
|
||||
NAME := splashscreen, \
|
||||
SRC := $(LIBSPLASHSCREEN_DIRS), \
|
||||
EXTRA_SRC := $(LIBSPLASHSCREEN_EXTRA_SRC), \
|
||||
EXCLUDE_SRC_PATTERNS := $(LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS), \
|
||||
EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
|
||||
EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBSPLASHSCREEN_CFLAGS) \
|
||||
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := $(LIBSPLASHSCREEN_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result \
|
||||
maybe-uninitialized shift-negative-value implicit-fallthrough, \
|
||||
DISABLED_WARNINGS_clang := incompatible-pointer-types, \
|
||||
@ -898,7 +864,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
TARGETS += $(BUILD_LIBSPLASHSCREEN)
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
$(BUILD_LIBSPLASHSCREEN): $(call FindLib, java.desktop, osxapp)
|
||||
$(BUILD_LIBSPLASHSCREEN): $(call FindLib, $(MODULE), osxapp)
|
||||
endif
|
||||
|
||||
endif
|
||||
@ -907,49 +873,38 @@ endif
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
|
||||
LIBAWT_LWAWT_DIRS := \
|
||||
$(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt \
|
||||
$(TOPDIR)/src/java.desktop/unix/native/common/awt \
|
||||
$(TOPDIR)/src/java.desktop/share/native/common/font \
|
||||
$(TOPDIR)/src/java.desktop/share/native/common/java2d \
|
||||
LIBAWT_LWAWT_EXTRA_SRC := \
|
||||
$(TOPDIR)/src/$(MODULE)/unix/native/common/awt \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/font \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/java2d \
|
||||
#
|
||||
|
||||
LIBAWT_LWAWT_CFLAGS := \
|
||||
$(addprefix -I, $(LIBAWT_LWAWT_DIRS)) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
|
||||
-I$(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/awt \
|
||||
-I$(TOPDIR)/src/java.desktop/unix/native/libawt_xawt/awt \
|
||||
-I$(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/font \
|
||||
-I$(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
|
||||
-I$(TOPDIR)/src/java.desktop/macosx/native/include \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/include \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d \
|
||||
-I$(TOPDIR)/src/java.desktop/unix/native/libawt/java2d \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libmlib_image/ \
|
||||
-I$(TOPDIR)/src/java.desktop/macosx/native/libosxapp \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
LIBAWT_LWAWT_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
libawt_lwawt/awt \
|
||||
libawt_lwawt/font \
|
||||
libawt_lwawt/java2d/opengl \
|
||||
include \
|
||||
common/awt/debug \
|
||||
common/java2d/opengl \
|
||||
libosxapp \
|
||||
#
|
||||
|
||||
LIBAWT_LWAWT_CFLAGS := $(X_CFLAGS) $(X_LIBS)
|
||||
|
||||
LIBAWT_LWAWT_EXFILES := fontpath.c awt_Font.c X11Color.c
|
||||
LIBAWT_LWAWT_EXCLUDES := $(TOPDIR)/src/java.desktop/unix/native/common/awt/medialib
|
||||
LIBAWT_LWAWT_EXCLUDES := $(TOPDIR)/src/$(MODULE)/unix/native/common/awt/medialib
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT_LWAWT, \
|
||||
NAME := awt_lwawt, \
|
||||
SRC := $(LIBAWT_LWAWT_DIRS), \
|
||||
EXTRA_SRC := $(LIBAWT_LWAWT_EXTRA_SRC), \
|
||||
INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \
|
||||
EXCLUDE_FILES := $(LIBAWT_LWAWT_EXFILES), \
|
||||
EXCLUDES := $(LIBAWT_LWAWT_EXCLUDES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(X_CFLAGS) \
|
||||
$(X_LIBS) \
|
||||
$(LIBAWT_LWAWT_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_LWAWT_EXTRA_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_clang := incomplete-implementation enum-conversion \
|
||||
deprecated-declarations objc-method-access bitwise-op-parentheses \
|
||||
incompatible-pointer-types parentheses-equality extra-tokens, \
|
||||
@ -976,7 +931,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
|
||||
$(BUILD_LIBAWT_LWAWT): $(BUILD_LIBMLIB_IMAGE)
|
||||
|
||||
$(BUILD_LIBAWT_LWAWT): $(call FindLib, java.desktop, osxapp)
|
||||
$(BUILD_LIBAWT_LWAWT): $(call FindLib, $(MODULE), osxapp)
|
||||
|
||||
$(BUILD_LIBAWT_LWAWT): $(call FindLib, java.base, java)
|
||||
|
||||
@ -988,15 +943,11 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXUI, \
|
||||
NAME := osxui, \
|
||||
SRC := $(TOPDIR)/src/java.desktop/macosx/native/libosxui, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
-I$(TOPDIR)/src/java.desktop/macosx/native/libosxui \
|
||||
-I$(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/awt \
|
||||
-I$(TOPDIR)/src/java.desktop/macosx/native/libosxapp \
|
||||
-I$(TOPDIR)/src/java.base/share/native/libjava \
|
||||
-I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
libawt_lwawt/awt \
|
||||
libosxapp, \
|
||||
DISABLED_WARNINGS_clang := deprecated-declarations, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN) \
|
||||
@ -1015,7 +966,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
|
||||
$(BUILD_LIBOSXUI): $(BUILD_LIBAWT)
|
||||
|
||||
$(BUILD_LIBOSXUI): $(call FindLib, java.desktop, osxapp)
|
||||
$(BUILD_LIBOSXUI): $(call FindLib, $(MODULE), osxapp)
|
||||
|
||||
$(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT)
|
||||
|
||||
|
||||
@ -104,7 +104,6 @@ endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBVERIFY, \
|
||||
NAME := verify, \
|
||||
SRC := $(TOPDIR)/src/java.base/share/native/libverify, \
|
||||
OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
DISABLED_WARNINGS_gcc := implicit-fallthrough, \
|
||||
@ -119,13 +118,7 @@ TARGETS += $(BUILD_LIBVERIFY)
|
||||
|
||||
##########################################################################################
|
||||
|
||||
# Allow a custom makefile to add extra src dirs
|
||||
LIBJAVA_SRC_DIRS += $(call FindSrcDirsForLib, java.base, java)
|
||||
|
||||
LIBJAVA_CFLAGS := $(addprefix -I, $(LIBJAVA_SRC_DIRS)) \
|
||||
-I$(TOPDIR)/src/java.base/share/native/libfdlibm \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.base \
|
||||
-DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"'
|
||||
LIBJAVA_CFLAGS := -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"'
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
BUILD_LIBJAVA_java_props_md.c_CFLAGS := -x objective-c
|
||||
@ -134,12 +127,12 @@ endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJAVA, \
|
||||
NAME := java, \
|
||||
SRC := $(LIBJAVA_SRC_DIRS), \
|
||||
OPTIMIZATION := HIGH, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(LIBJAVA_CFLAGS), \
|
||||
System.c_CFLAGS := $(VERSION_CFLAGS), \
|
||||
jdk_util.c_CFLAGS := $(VERSION_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := libfdlibm, \
|
||||
WARNINGS_AS_ERRORS_xlc := false, \
|
||||
DISABLED_WARNINGS_gcc := unused-result, \
|
||||
DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
|
||||
@ -180,13 +173,9 @@ endif
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBZIP, \
|
||||
NAME := zip, \
|
||||
OPTIMIZATION := LOW, \
|
||||
SRC := $(TOPDIR)/src/java.base/share/native/libzip, \
|
||||
EXCLUDES := $(LIBZIP_EXCLUDES), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(LIBZ_CFLAGS) \
|
||||
-I$(TOPDIR)/src/java.base/share/native/libjava \
|
||||
-I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.base, \
|
||||
$(LIBZ_CFLAGS), \
|
||||
CFLAGS_unix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
@ -200,22 +189,12 @@ TARGETS += $(BUILD_LIBZIP)
|
||||
|
||||
##########################################################################################
|
||||
|
||||
JIMAGELIB_CPPFLAGS := \
|
||||
-I$(TOPDIR)/src/java.base/share/native/libjava \
|
||||
-I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
|
||||
-I$(TOPDIR)/src/java.base/share/native/libjimage \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.base \
|
||||
#
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJIMAGE, \
|
||||
NAME := jimage, \
|
||||
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||
OPTIMIZATION := LOW, \
|
||||
SRC := $(TOPDIR)/src/java.base/share/native/libjimage \
|
||||
$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjimage, \
|
||||
EXCLUDES := $(LIBJIMAGE_EXCLUDES), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(JIMAGELIB_CPPFLAGS), \
|
||||
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(JIMAGELIB_CPPFLAGS), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
CXXFLAGS := $(CXXFLAGS_JDKLIB), \
|
||||
DISABLED_WARNINGS_gcc := implicit-fallthrough, \
|
||||
CFLAGS_unix := -UDEBUG, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
|
||||
@ -231,10 +210,6 @@ TARGETS += $(BUILD_LIBJIMAGE)
|
||||
|
||||
##########################################################################################
|
||||
|
||||
LIBJLI_SRC_DIRS := $(call FindSrcDirsForLib, java.base, jli)
|
||||
|
||||
LIBJLI_CFLAGS := $(CFLAGS_JDKLIB)
|
||||
|
||||
ifeq ($(call check-jvm-variant, zero), true)
|
||||
ERGO_FAMILY := zero
|
||||
else
|
||||
@ -263,7 +238,7 @@ endif
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
# Staticically link with c runtime on windows.
|
||||
LIBJLI_CFLAGS := $(filter-out -MD, $(LIBJLI_CFLAGS))
|
||||
LIBJLI_CFLAGS_JDKLIB := $(filter-out -MD, $(CFLAGS_JDKLIB))
|
||||
LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)
|
||||
# Supply the name of the C runtime lib.
|
||||
LIBJLI_CFLAGS += -DMSVCR_DLL_NAME='"$(notdir $(MSVCR_DLL))"'
|
||||
@ -271,11 +246,10 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
LIBJLI_CFLAGS += -DMSVCP_DLL_NAME='"$(notdir $(MSVCP_DLL))"'
|
||||
endif
|
||||
else
|
||||
LIBJLI_CFLAGS_JDKLIB := $(CFLAGS_JDKLIB)
|
||||
LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)/jli
|
||||
endif
|
||||
|
||||
LIBJLI_CFLAGS += $(addprefix -I, $(LIBJLI_SRC_DIRS))
|
||||
|
||||
LIBJLI_CFLAGS += $(LIBZ_CFLAGS)
|
||||
|
||||
ifneq ($(USE_EXTERNAL_LIBZ), true)
|
||||
@ -293,12 +267,10 @@ endif
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJLI, \
|
||||
NAME := jli, \
|
||||
OUTPUT_DIR := $(LIBJLI_OUTPUT_DIR), \
|
||||
SRC := $(LIBJLI_SRC_DIRS), \
|
||||
EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
|
||||
EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
|
||||
OPTIMIZATION := HIGH, \
|
||||
CFLAGS := $(LIBJLI_CFLAGS), \
|
||||
DISABLED_WARNINGS_gcc := maybe-uninitialized, \
|
||||
CFLAGS := $(LIBJLI_CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
|
||||
DISABLED_WARNINGS_solstudio := \
|
||||
E_ASM_DISABLES_OPTIMIZATION \
|
||||
E_STATEMENT_NOT_REACHED, \
|
||||
@ -316,6 +288,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJLI, \
|
||||
|
||||
TARGETS += $(BUILD_LIBJLI)
|
||||
|
||||
LIBJLI_SRC_DIRS := $(call FindSrcDirsForComponent, java.base, libjli)
|
||||
|
||||
# On windows, the static library has the same suffix as the import library created by
|
||||
# with the shared library, so the static library is given a different name. No harm
|
||||
# in doing it for all platform to reduce complexity.
|
||||
@ -328,7 +302,8 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
|
||||
EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
|
||||
OPTIMIZATION := HIGH, \
|
||||
CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \
|
||||
CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS_JDKLIB) $(LIBJLI_CFLAGS) \
|
||||
$(addprefix -I, $(LIBJLI_SRC_DIRS)), \
|
||||
ARFLAGS := $(ARFLAGS), \
|
||||
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
|
||||
))
|
||||
@ -347,7 +322,8 @@ else ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
|
||||
EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
|
||||
OPTIMIZATION := HIGH, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
|
||||
CFLAGS := $(LIBJLI_CFLAGS_JDKLIB) $(LIBJLI_CFLAGS) \
|
||||
$(addprefix -I, $(LIBJLI_SRC_DIRS)), \
|
||||
LDFLAGS := -nostdlib $(ARFLAGS), \
|
||||
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
|
||||
))
|
||||
@ -371,7 +347,7 @@ else ifeq ($(OPENJDK_TARGET_OS), aix)
|
||||
EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
|
||||
EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
|
||||
OPTIMIZATION := HIGH, \
|
||||
CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \
|
||||
CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
|
||||
ARFLAGS := $(ARFLAGS), \
|
||||
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static))
|
||||
|
||||
|
||||
@ -29,9 +29,7 @@ include LibCommon.gmk
|
||||
$(eval $(call IncludeCustomExtension, lib/Lib-java.base.gmk))
|
||||
|
||||
# Prepare the find cache.
|
||||
LIB_java.base_SRC_DIRS += $(TOPDIR)/src/java.base/*/native
|
||||
|
||||
$(eval $(call FillCacheFind, $(wildcard $(LIB_java.base_SRC_DIRS))))
|
||||
$(eval $(call FillCacheFind, $(wildcard $(TOPDIR)/src/java.base/*/native)))
|
||||
|
||||
################################################################################
|
||||
# Create all the core libraries
|
||||
@ -41,14 +39,10 @@ include CoreLibraries.gmk
|
||||
################################################################################
|
||||
# Create the network library
|
||||
|
||||
LIBNET_SRC_DIRS := $(call FindSrcDirsForLib, java.base, net)
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBNET, \
|
||||
NAME := net, \
|
||||
SRC := $(LIBNET_SRC_DIRS), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
|
||||
$(LIBJAVA_HEADER_FLAGS) $(addprefix -I, $(LIBNET_SRC_DIRS)), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
DISABLED_WARNINGS_gcc := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang := parentheses-equality constant-logical-operand, \
|
||||
DISABLED_WARNINGS_microsoft := 4244 4047 4133 4996, \
|
||||
@ -72,31 +66,15 @@ TARGETS += $(BUILD_LIBNET)
|
||||
################################################################################
|
||||
# Create the nio library
|
||||
|
||||
BUILD_LIBNIO_SRC := \
|
||||
$(TOPDIR)/src/java.base/share/native/libnio \
|
||||
$(TOPDIR)/src/java.base/share/native/libnio/ch \
|
||||
$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio \
|
||||
$(sort $(wildcard \
|
||||
$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/ch \
|
||||
$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/fs \
|
||||
$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/ch \
|
||||
$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/fs)) \
|
||||
#
|
||||
|
||||
BUILD_LIBNIO_CFLAGS := \
|
||||
$(addprefix -I, $(BUILD_LIBNIO_SRC)) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.base \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
$(addprefix -I, $(BUILD_LIBNET_SRC))
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBNIO, \
|
||||
NAME := nio, \
|
||||
SRC := $(BUILD_LIBNIO_SRC), \
|
||||
EXCLUDE_FILES := $(BUILD_LIBNIO_EXFILES), \
|
||||
OPTIMIZATION := HIGH, \
|
||||
WARNINGS_AS_ERRORS_xlc := false, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(BUILD_LIBNIO_CFLAGS), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
libnio/ch \
|
||||
libnio/fs \
|
||||
libnet, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS_unix := -ljava -lnet, \
|
||||
@ -122,17 +100,10 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
# JavaNativeFoundation framework not supported in static builds
|
||||
ifneq ($(STATIC_BUILD), true)
|
||||
|
||||
LIBOSXSECURITY_DIRS := $(TOPDIR)/src/java.base/macosx/native/libosxsecurity
|
||||
LIBOSXSECURITY_CFLAGS := -I$(LIBOSXSECURITY_DIRS) \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.base \
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXSECURITY, \
|
||||
NAME := osxsecurity, \
|
||||
SRC := $(LIBOSXSECURITY_DIRS), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(LIBOSXSECURITY_CFLAGS), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
DISABLED_WARNINGS_clang := deprecated-declarations, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
-L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base \
|
||||
@ -158,7 +129,6 @@ endif
|
||||
ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
|
||||
ifeq ($(STATIC_BUILD), false)
|
||||
|
||||
LIBJSIG_SRC_DIR := $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjsig
|
||||
LIBJSIG_MAPFILE := $(wildcard $(TOPDIR)/make/mapfiles/libjsig/mapfile-vers-$(OPENJDK_TARGET_OS))
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), linux)
|
||||
@ -168,7 +138,6 @@ ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJSIG, \
|
||||
NAME := jsig, \
|
||||
SRC := $(LIBJSIG_SRC_DIR), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBJSIG_CFLAGS), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
|
||||
@ -29,9 +29,7 @@ include LibCommon.gmk
|
||||
$(eval $(call IncludeCustomExtension, lib/Lib-java.desktop.gmk))
|
||||
|
||||
# Prepare the find cache.
|
||||
LIB_java.desktop_SRC_DIRS += $(TOPDIR)/src/java.desktop/*/native
|
||||
|
||||
$(eval $(call FillCacheFind, $(wildcard $(LIB_java.desktop_SRC_DIRS))))
|
||||
$(eval $(call FillCacheFind, $(wildcard $(TOPDIR)/src/java.desktop/*/native)))
|
||||
|
||||
################################################################################
|
||||
# Create the AWT/2D libraries
|
||||
@ -43,16 +41,8 @@ include Awt2dLibraries.gmk
|
||||
|
||||
ifneq ($(OPENJDK_TARGET_OS), aix)
|
||||
|
||||
LIBJSOUND_SRC_DIRS := $(wildcard \
|
||||
$(TOPDIR)/src/java.desktop/share/native/libjsound \
|
||||
$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/libjsound \
|
||||
)
|
||||
|
||||
LIBJSOUND_CFLAGS := \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
|
||||
$(ALSA_CFLAGS) \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
$(foreach dir, $(LIBJSOUND_SRC_DIRS), -I$(dir)) \
|
||||
-DX_PLATFORM=X_$(OPENJDK_TARGET_OS_UPPERCASE) \
|
||||
-DUSE_PORTS=TRUE \
|
||||
-DUSE_DAUDIO=TRUE \
|
||||
@ -71,7 +61,6 @@ ifneq ($(OPENJDK_TARGET_OS), aix)
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJSOUND, \
|
||||
NAME := jsound, \
|
||||
SRC := $(LIBJSOUND_SRC_DIRS), \
|
||||
TOOLCHAIN := $(LIBJSOUND_TOOLCHAIN), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
@ -97,15 +86,11 @@ endif
|
||||
# Create the macosx specific osxapp and osx libraries
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
LIBOSXAPP_SRC := $(TOPDIR)/src/java.desktop/macosx/native/libosxapp
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXAPP, \
|
||||
NAME := osxapp, \
|
||||
SRC := $(LIBOSXAPP_SRC), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(addprefix -I, $(LIBOSXAPP_SRC)) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
DISABLED_WARNINGS_clang := objc-method-access objc-root-class \
|
||||
deprecated-declarations, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
@ -129,19 +114,11 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
|
||||
##############################################################################
|
||||
|
||||
LIBOSX_DIRS := $(TOPDIR)/src/java.desktop/macosx/native/libosx
|
||||
LIBOSX_CFLAGS := -I$(LIBOSX_DIRS) \
|
||||
-I$(TOPDIR)/src/java.desktop/macosx/native/libosxapp \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
|
||||
#
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBOSX, \
|
||||
NAME := osx, \
|
||||
SRC := $(LIBOSX_DIRS), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(LIBOSX_CFLAGS), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
EXTRA_HEADER_DIRS := libosxapp, \
|
||||
DISABLED_WARNINGS_clang := deprecated-declarations, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
-L$(SUPPORT_OUTPUTDIR)/modules_libs/java.desktop \
|
||||
|
||||
@ -30,32 +30,24 @@ $(eval $(call IncludeCustomExtension, lib/Lib-java.instrument.gmk))
|
||||
|
||||
################################################################################
|
||||
|
||||
LIBINSTRUMENT_SRC := $(TOPDIR)/src/java.instrument/share/native/libinstrument \
|
||||
$(TOPDIR)/src/java.instrument/$(OPENJDK_TARGET_OS_TYPE)/native/libinstrument \
|
||||
#
|
||||
LIBINSTRUMENT_CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(addprefix -I, $(LIBINSTRUMENT_SRC)) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.instrument \
|
||||
-I$(TOPDIR)/src/java.base/share/native/libjli \
|
||||
-I$(TOPDIR)/src/java.base/share/native/libjava \
|
||||
#
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
# Statically link the C runtime so that there are not dependencies on modules
|
||||
# not on the search patch when invoked from the Windows system directory
|
||||
# (or elsewhere).
|
||||
LIBINSTRUMENT_CFLAGS := $(filter-out -MD, $(LIBINSTRUMENT_CFLAGS))
|
||||
LIBINSTRUMENT_CFLAGS_JDKLIB := $(filter-out -MD, $(CFLAGS_JDKLIB))
|
||||
# equivalent of strcasecmp is stricmp on Windows
|
||||
LIBINSTRUMENT_CFLAGS += -Dstrcasecmp=stricmp
|
||||
LIBINSTRUMENT_CFLAGS := -Dstrcasecmp=stricmp
|
||||
else
|
||||
LIBINSTRUMENT_CFLAGS_JDKLIB := $(CFLAGS_JDKLIB)
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \
|
||||
NAME := instrument, \
|
||||
SRC := $(LIBINSTRUMENT_SRC), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(LIBINSTRUMENT_CFLAGS), \
|
||||
CFLAGS := $(LIBINSTRUMENT_CFLAGS_JDKLIB) $(LIBINSTRUMENT_CFLAGS), \
|
||||
CFLAGS_debug := -DJPLIS_LOGGING, \
|
||||
CFLAGS_release := -DNO_JPLIS_LOGGING, \
|
||||
EXTRA_HEADER_DIRS := java.base:libjli, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN) \
|
||||
$(LIBINSTRUMENT_LDFLAGS), \
|
||||
|
||||
@ -30,13 +30,6 @@ $(eval $(call IncludeCustomExtension, lib/Lib-java.management.gmk))
|
||||
|
||||
################################################################################
|
||||
|
||||
LIBMANAGEMENT_SRC += $(TOPDIR)/src/java.management/share/native/libmanagement
|
||||
LIBMANAGEMENT_CFLAGS := -I$(TOPDIR)/src/hotspot/share/include \
|
||||
$(addprefix -I,$(LIBMANAGEMENT_SRC)) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.management \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
#
|
||||
|
||||
LIBMANAGEMENT_OPTIMIZATION := HIGH
|
||||
ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
|
||||
ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true)
|
||||
@ -46,9 +39,8 @@ endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT, \
|
||||
NAME := management, \
|
||||
SRC := $(LIBMANAGEMENT_SRC), \
|
||||
OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBMANAGEMENT_CFLAGS), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS := $(JDKLIB_LIBS), \
|
||||
|
||||
@ -27,18 +27,16 @@ include LibCommon.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
# libprefs on macosx do not use the unix code
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
LIBPREF_SRC_DIRS := $(TOPDIR)/src/java.prefs/macosx/native/libprefs
|
||||
else
|
||||
LIBPREF_SRC_DIRS := $(TOPDIR)/src/java.prefs/$(OPENJDK_TARGET_OS_TYPE)/native/libprefs
|
||||
LIBPREFS_EXCLUDE_SRC_PATTERNS := unix
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBPREFS, \
|
||||
NAME := prefs, \
|
||||
SRC := $(LIBPREF_SRC_DIRS), \
|
||||
EXCLUDE_SRC_PATTERNS := $(LIBPREFS_EXCLUDE_SRC_PATTERNS), \
|
||||
OPTIMIZATION := HIGH, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBPREF_SRC_DIRS)) \
|
||||
$(LIBJAVA_HEADER_FLAGS), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS_unix := -ljvm, \
|
||||
|
||||
@ -29,9 +29,8 @@ include LibCommon.gmk
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBRMI, \
|
||||
NAME := rmi, \
|
||||
SRC := $(TOPDIR)/src/java.rmi/share/native/librmi, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/java.rmi, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS_unix := -ljvm, \
|
||||
|
||||
@ -27,16 +27,10 @@ include LibCommon.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
LIBJ2GSS_SRC := $(TOPDIR)/src/java.security.jgss/share/native/libj2gss \
|
||||
#
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJ2GSS, \
|
||||
NAME := j2gss, \
|
||||
SRC := $(LIBJ2GSS_SRC), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBJ2GSS_SRC)) \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.security.jgss, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS := $(LIBDL), \
|
||||
@ -49,15 +43,10 @@ TARGETS += $(BUILD_LIBJ2GSS)
|
||||
ifneq ($(BUILD_CRYPTO), false)
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
BUILD_LIBW2K_LSA_AUTH_SRC := $(call FindSrcDirsForLib, $(MODULE), w2k_lsa_auth)
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBW2K_LSA_AUTH, \
|
||||
NAME := w2k_lsa_auth, \
|
||||
SRC := $(BUILD_LIBW2K_LSA_AUTH_SRC), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(addprefix -I, $(BUILD_LIBW2K_LSA_AUTH_SRC)) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.security.jgss, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS := advapi32.lib Secur32.lib netapi32.lib kernel32.lib user32.lib \
|
||||
@ -69,17 +58,12 @@ ifneq ($(BUILD_CRYPTO), false)
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
BUILD_LIBOSXKRB5_SRC := $(call FindSrcDirsForLib, $(MODULE), osxkrb5)
|
||||
|
||||
# libosxkrb5 needs to call deprecated krb5 APIs so that java
|
||||
# can use the native credentials cache.
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXKRB5, \
|
||||
NAME := osxkrb5, \
|
||||
SRC := $(BUILD_LIBOSXKRB5_SRC), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(addprefix -I, $(BUILD_LIBOSXKRB5_SRC)) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.security.jgss, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
DISABLED_WARNINGS_clang := deprecated-declarations, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
|
||||
@ -27,18 +27,12 @@ include LibCommon.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
LIBJ2PCSC_SRC := $(TOPDIR)/src/java.smartcardio/share/native/libj2pcsc \
|
||||
$(TOPDIR)/src/java.smartcardio/$(OPENJDK_TARGET_OS_TYPE)/native/libj2pcsc
|
||||
LIBJ2PCSC_CPPFLAGS := $(addprefix -I,$(LIBJ2PCSC_SRC)) \
|
||||
-I$(TOPDIR)/src/java.smartcardio/$(OPENJDK_TARGET_OS_TYPE)/native/libj2pcsc/MUSCLE \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.smartcardio
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJ2PCSC, \
|
||||
NAME := j2pcsc, \
|
||||
SRC := $(LIBJ2PCSC_SRC), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
CFLAGS_unix := -D__sun_jdk, \
|
||||
EXTRA_HEADER_DIRS := libj2pcsc/MUSCLE, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBJ2PCSC_CPPFLAGS), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS_unix := $(LIBDL), \
|
||||
|
||||
@ -30,12 +30,6 @@ include LibCommon.gmk
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
|
||||
ROOT_SRCDIR := $(TOPDIR)/src/jdk.accessibility/windows/native
|
||||
JAVA_AB_SRCDIR := $(ROOT_SRCDIR)/libjavaaccessbridge $(ROOT_SRCDIR)/common
|
||||
WIN_AB_SRCDIR := $(ROOT_SRCDIR)/libwindowsaccessbridge $(ROOT_SRCDIR)/common
|
||||
SYSINFO_SRCDIR := $(ROOT_SRCDIR)/libjabsysinfo
|
||||
ACCESSBRIDGE_CFLAGS := -I$(SUPPORT_OUTPUTDIR)/headers/jdk.accessibility \
|
||||
-I$(TOPDIR)/src/java.desktop/windows/native/include \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/include
|
||||
|
||||
define SetupJavaDLL
|
||||
# Parameter 1 Suffix
|
||||
@ -43,13 +37,16 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
|
||||
$(call SetupJdkLibrary, BUILD_JAVAACCESSBRIDGE$1, \
|
||||
NAME := javaaccessbridge$1, \
|
||||
SRC := $(JAVA_AB_SRCDIR), \
|
||||
SRC := libjavaaccessbridge, \
|
||||
EXTRA_SRC := common, \
|
||||
OPTIMIZATION := LOW, \
|
||||
DISABLED_WARNINGS_microsoft := 4311 4302 4312, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(ACCESSBRIDGE_CFLAGS) \
|
||||
$(addprefix -I,$(JAVA_AB_SRCDIR)) \
|
||||
-I$(ROOT_SRCDIR)/include/bridge \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
-DACCESSBRIDGE_ARCH_$2, \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
include/bridge \
|
||||
java.base:include \
|
||||
java.desktop:include, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB), \
|
||||
LIBS := kernel32.lib user32.lib gdi32.lib \
|
||||
winspool.lib comdlg32.lib advapi32.lib shell32.lib \
|
||||
@ -68,13 +65,15 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
# Parameter 2 ACCESSBRIDGE_ARCH_ suffix
|
||||
$(call SetupJdkLibrary, BUILD_WINDOWSACCESSBRIDGE$1, \
|
||||
NAME := windowsaccessbridge$1, \
|
||||
SRC := $(WIN_AB_SRCDIR), \
|
||||
SRC := libwindowsaccessbridge, \
|
||||
EXTRA_SRC := common, \
|
||||
OPTIMIZATION := LOW, \
|
||||
DISABLED_WARNINGS_microsoft := 4311 4302 4312, \
|
||||
CFLAGS := $(filter-out -MD, $(CFLAGS_JDKLIB)) -MT $(ACCESSBRIDGE_CFLAGS) \
|
||||
$(addprefix -I,$(WIN_AB_SRCDIR)) \
|
||||
-I$(ROOT_SRCDIR)/include/bridge \
|
||||
CFLAGS := $(filter-out -MD, $(CFLAGS_JDKLIB)) -MT \
|
||||
-DACCESSBRIDGE_ARCH_$2, \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
include/bridge \
|
||||
java.base:include, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
-def:$(ROOT_SRCDIR)/libwindowsaccessbridge/WinAccessBridge.DEF, \
|
||||
LIBS := kernel32.lib user32.lib gdi32.lib \
|
||||
@ -91,9 +90,8 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
|
||||
$(call SetupJdkLibrary, BUILD_ACCESSBRIDGESYSINFO, \
|
||||
NAME := jabsysinfo, \
|
||||
SRC := $(SYSINFO_SRCDIR), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(ACCESSBRIDGE_CFLAGS), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB), \
|
||||
VERSIONINFO_RESOURCE := $(ROOT_SRCDIR)/common/AccessBridgeStatusWindow.rc, \
|
||||
)
|
||||
|
||||
@ -36,11 +36,8 @@ endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBATTACH, \
|
||||
NAME := attach, \
|
||||
SRC := $(call FindSrcDirsForLib, jdk.attach, attach), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/jdk.attach \
|
||||
$(LIBJAVA_HEADER_FLAGS) $(LIBATTACH_CFLAGS), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBATTACH_CFLAGS), \
|
||||
CFLAGS_windows := /Gy, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
|
||||
@ -27,16 +27,10 @@ include LibCommon.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
LIBJ2PKCS11_SRC := $(TOPDIR)/src/jdk.crypto.cryptoki/share/native/libj2pkcs11 \
|
||||
$(TOPDIR)/src/jdk.crypto.cryptoki/$(OPENJDK_TARGET_OS_TYPE)/native/libj2pkcs11
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJ2PKCS11, \
|
||||
NAME := j2pkcs11, \
|
||||
SRC := $(LIBJ2PKCS11_SRC), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBJ2PKCS11_SRC)) \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/jdk.crypto.cryptoki, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS_unix := $(LIBDL), \
|
||||
|
||||
@ -28,31 +28,23 @@ include LibCommon.gmk
|
||||
################################################################################
|
||||
|
||||
ifeq ($(ENABLE_INTREE_EC), true)
|
||||
|
||||
LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec
|
||||
BUILD_LIBSUNEC_FLAGS := $(addprefix -I, $(SUNEC_SRC))
|
||||
|
||||
#
|
||||
# On sol-sparc...all libraries are compiled with -xregs=no%appl
|
||||
# (set in CFLAGS_REQUIRED_sparc)
|
||||
#
|
||||
# except!!! libsunec.so
|
||||
#
|
||||
ECC_JNI_SOLSPARC_FILTER :=
|
||||
# (set in CFLAGS_REQUIRED_sparc) except libsunec.so
|
||||
ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
|
||||
ECC_JNI_SOLSPARC_FILTER := -xregs=no%appl
|
||||
BUILD_LIBSUNEC_CFLAGS_JDKLIB := $(filter-out -xregs=no%appl, $(CFLAGS_JDKLIB))
|
||||
BUILD_LIBSUNEC_CXXFLAGS_JDKLIB := $(filter-out -xregs=no%appl, $(CXXFLAGS_JDKLIB))
|
||||
else
|
||||
BUILD_LIBSUNEC_CFLAGS_JDKLIB := $(CFLAGS_JDKLIB)
|
||||
BUILD_LIBSUNEC_CXXFLAGS_JDKLIB := $(CXXFLAGS_JDKLIB)
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBSUNEC, \
|
||||
NAME := sunec, \
|
||||
SRC := $(LIBSUNEC_SRC), \
|
||||
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CFLAGS_JDKLIB)) \
|
||||
$(BUILD_LIBSUNEC_FLAGS) \
|
||||
CFLAGS := $(BUILD_LIBSUNEC_CFLAGS_JDKLIB) \
|
||||
-DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B, \
|
||||
CXXFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CXXFLAGS_JDKLIB)) \
|
||||
$(BUILD_LIBSUNEC_FLAGS), \
|
||||
CXXFLAGS := $(BUILD_LIBSUNEC_CXXFLAGS_JDKLIB), \
|
||||
DISABLED_WARNINGS_gcc := sign-compare implicit-fallthrough, \
|
||||
DISABLED_WARNINGS_microsoft := 4101 4244 4146 4018, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
|
||||
|
||||
@ -29,14 +29,10 @@ include LibCommon.gmk
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
|
||||
LIBSUNMSCAPI_SRC := $(TOPDIR)/src/jdk.crypto.mscapi/$(OPENJDK_TARGET_OS_TYPE)/native/libsunmscapi
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBSUNMSCAPI, \
|
||||
NAME := sunmscapi, \
|
||||
SRC := $(LIBSUNMSCAPI_SRC), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
-I$(LIBSUNMSCAPI_SRC), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS := crypt32.lib advapi32.lib, \
|
||||
|
||||
@ -29,14 +29,10 @@ include LibCommon.gmk
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
|
||||
LIBJ2UCRYPTO_SRC := $(TOPDIR)/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJ2UCRYPTO, \
|
||||
NAME := j2ucrypto, \
|
||||
SRC := $(LIBJ2UCRYPTO_SRC), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(addprefix -I, $(LIBJ2UCRYPTO_SRC)), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB), \
|
||||
LIBS := $(LIBDL), \
|
||||
))
|
||||
|
||||
@ -29,19 +29,6 @@ $(eval $(call IncludeCustomExtension, hotspot/lib/Lib-jdk.hotspot.agent.gmk))
|
||||
|
||||
################################################################################
|
||||
|
||||
SA_TOPDIR := $(TOPDIR)/src/jdk.hotspot.agent
|
||||
|
||||
SA_SRC += \
|
||||
$(SA_TOPDIR)/share/native/libsaproc \
|
||||
$(SA_TOPDIR)/$(OPENJDK_TARGET_OS)/native/libsaproc \
|
||||
#
|
||||
|
||||
SA_INCLUDES := \
|
||||
$(addprefix -I, $(SA_SRC)) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/jdk.hotspot.agent \
|
||||
-I$(TOPDIR)/src/hotspot/os/$(OPENJDK_TARGET_OS) \
|
||||
#
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), linux)
|
||||
SA_CFLAGS := -D_FILE_OFFSET_BITS=64
|
||||
|
||||
@ -68,9 +55,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBSA, \
|
||||
DISABLED_WARNINGS_microsoft := 4267, \
|
||||
DISABLED_WARNINGS_gcc := sign-compare, \
|
||||
DISABLED_WARNINGS_CXX_solstudio := truncwarn unknownpragma, \
|
||||
SRC := $(SA_SRC), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(SA_INCLUDES) $(SA_CFLAGS) $(SA_CUSTOM_CFLAGS), \
|
||||
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(SA_INCLUDES) $(SA_CFLAGS) $(SA_CXXFLAGS), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(SA_CFLAGS), \
|
||||
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(SA_CFLAGS) $(SA_CXXFLAGS), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) $(SA_LDFLAGS), \
|
||||
LIBS_linux := -lthread_db $(LIBDL), \
|
||||
LIBS_solaris := -ldl -ldemangle -lthread -lproc, \
|
||||
|
||||
@ -29,19 +29,10 @@ include LibCommon.gmk
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
|
||||
LIBLE_SRC := $(TOPDIR)/src/jdk.internal.le/$(OPENJDK_TARGET_OS_TYPE)/native/lible \
|
||||
#
|
||||
LIBLE_CPPFLAGS := \
|
||||
$(addprefix -I, $(LIBLE_SRC)) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/jdk.internal.le \
|
||||
#
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBLE, \
|
||||
NAME := le, \
|
||||
SRC := $(LIBLE_SRC), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBJAVA_HEADER_FLAGS)\
|
||||
$(LIBLE_CPPFLAGS), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB), \
|
||||
LIBS := $(JDKLIB_LIBS) user32.lib, \
|
||||
))
|
||||
|
||||
@ -29,22 +29,13 @@ include LibCommon.gmk
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
|
||||
LIBDT_SHMEM_SRC := $(TOPDIR)/src/jdk.jdi/share/native/libdt_shmem \
|
||||
$(TOPDIR)/src/jdk.jdi/$(OPENJDK_TARGET_OS_TYPE)/native/libdt_shmem \
|
||||
#
|
||||
LIBDT_SHMEM_CPPFLAGS := -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(OPENJDK_TARGET_OS) \
|
||||
$(addprefix -I, $(LIBDT_SHMEM_SRC)) \
|
||||
-I$(TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp/export \
|
||||
-I$(TOPDIR)/src/jdk.jdwp.agent/share/native/include \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/jdk.jdi \
|
||||
#
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBDT_SHMEM, \
|
||||
NAME := dt_shmem, \
|
||||
SRC := $(LIBDT_SHMEM_SRC), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \
|
||||
$(LIBDT_SHMEM_CPPFLAGS), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP, \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
jdk.jdwp.agent:include \
|
||||
jdk.jdwp.agent:libjdwp/export, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB), \
|
||||
LIBS := $(JDKLIB_LIBS), \
|
||||
))
|
||||
|
||||
@ -27,21 +27,14 @@ include LibCommon.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
LIBDT_SOCKET_SRC := $(TOPDIR)/src/jdk.jdwp.agent/share/native/libdt_socket \
|
||||
$(TOPDIR)/src/jdk.jdwp.agent/$(OPENJDK_TARGET_OS_TYPE)/native/libdt_socket
|
||||
LIBDT_SOCKET_CPPFLAGS := \
|
||||
$(addprefix -I, $(LIBDT_SOCKET_SRC)) \
|
||||
-I$(TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp/export \
|
||||
-I$(TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp \
|
||||
-I$(TOPDIR)/src/jdk.jdwp.agent/share/native/include \
|
||||
#
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBDT_SOCKET, \
|
||||
NAME := dt_socket, \
|
||||
SRC := $(LIBDT_SOCKET_SRC), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \
|
||||
$(LIBDT_SOCKET_CPPFLAGS), \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
include \
|
||||
libjdwp/export, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS_linux := -lpthread, \
|
||||
@ -56,21 +49,14 @@ TARGETS += $(BUILD_LIBDT_SOCKET)
|
||||
|
||||
################################################################################
|
||||
|
||||
LIBJDWP_SRC := $(TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp \
|
||||
$(TOPDIR)/src/jdk.jdwp.agent/$(OPENJDK_TARGET_OS_TYPE)/native/libjdwp
|
||||
LIBJDWP_CPPFLAGS := \
|
||||
-I$(TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp/export \
|
||||
-I$(TOPDIR)/src/jdk.jdwp.agent/share/native/include \
|
||||
$(addprefix -I, $(LIBJDWP_SRC))
|
||||
|
||||
# JDWP_LOGGING causes log messages to be compiled into the library.
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJDWP, \
|
||||
NAME := jdwp, \
|
||||
SRC := $(LIBJDWP_SRC), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) -DJDWP_LOGGING \
|
||||
$(LIBJDWP_CPPFLAGS) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) -DJDWP_LOGGING, \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
include \
|
||||
libjdwp/export, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS := $(JDKLIB_LIBS), \
|
||||
|
||||
@ -27,17 +27,10 @@ include LibCommon.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
LIBMANAGEMENT_AGENT_SRC += $(TOPDIR)/src/jdk.management.agent/$(OPENJDK_TARGET_OS_TYPE)/native/libmanagement_agent
|
||||
LIBMANAGEMENT_AGENT_CFLAGS := $(addprefix -I,$(LIBMANAGEMENT_AGENT_SRC)) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/jdk.management.agent \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
#
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT_AGENT, \
|
||||
NAME := management_agent, \
|
||||
SRC := $(LIBMANAGEMENT_AGENT_SRC), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBMANAGEMENT_AGENT_CFLAGS), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS := $(JDKLIB_LIBS), \
|
||||
|
||||
@ -30,15 +30,6 @@ $(eval $(call IncludeCustomExtension, lib/Lib-jdk.management.gmk))
|
||||
|
||||
################################################################################
|
||||
|
||||
LIBMANAGEMENT_EXT_SRC += $(TOPDIR)/src/jdk.management/share/native/libmanagement_ext \
|
||||
$(TOPDIR)/src/jdk.management/$(OPENJDK_TARGET_OS_TYPE)/native/libmanagement_ext \
|
||||
$(TOPDIR)/src/jdk.management/$(OPENJDK_TARGET_OS)/native/libmanagement_ext
|
||||
LIBMANAGEMENT_EXT_CFLAGS := -I$(TOPDIR)/src/java.management/share/native/include \
|
||||
$(addprefix -I,$(LIBMANAGEMENT_EXT_SRC)) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/jdk.management \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
#
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
# In (at least) VS2013 and later, -DPSAPI_VERSION=1 is needed to generate
|
||||
# a binary that is compatible with windows versions older than 7/2008R2.
|
||||
@ -55,8 +46,6 @@ endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT_EXT, \
|
||||
NAME := management_ext, \
|
||||
SRC := $(LIBMANAGEMENT_EXT_SRC), \
|
||||
LANG := C, \
|
||||
OPTIMIZATION := $(LIBMANAGEMENT_EXT_OPTIMIZATION), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBMANAGEMENT_EXT_CFLAGS), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
|
||||
@ -31,9 +31,8 @@ ifneq ($(filter $(OPENJDK_TARGET_OS), solaris linux macosx), )
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBEXTNET, \
|
||||
NAME := extnet, \
|
||||
SRC := $(TOPDIR)/src/jdk.net/$(OPENJDK_TARGET_OS)/native/libextnet, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/jdk.net, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS := -ljava, \
|
||||
|
||||
@ -29,16 +29,13 @@ include LibCommon.gmk
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBUNPACK, \
|
||||
NAME := unpack, \
|
||||
SRC := $(TOPDIR)/src/jdk.pack/share/native/libunpack \
|
||||
$(TOPDIR)/src/jdk.pack/share/native/common-unpack, \
|
||||
EXTRA_SRC := common-unpack, \
|
||||
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CXXFLAGS_JDKLIB) \
|
||||
-DNO_ZLIB -DUNPACK_JNI -DFULL \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.base \
|
||||
-I$(TOPDIR)/src/jdk.pack/share/native/common-unpack \
|
||||
$(LIBJAVA_HEADER_FLAGS), \
|
||||
-DNO_ZLIB -DUNPACK_JNI -DFULL, \
|
||||
CFLAGS_release := -DPRODUCT, \
|
||||
EXTRA_HEADER_DIRS := $(call GetJavaHeaderDir, java.base), \
|
||||
DISABLED_WARNINGS_gcc := implicit-fallthrough, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
|
||||
@ -29,18 +29,15 @@ include LibCommon.gmk
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
|
||||
|
||||
ifeq (, $(filter $(OPENJDK_TARGET_OS), macosx aix))
|
||||
ifeq ($(filter $(OPENJDK_TARGET_OS), macosx aix), )
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBSCTP, \
|
||||
NAME := sctp, \
|
||||
SRC := $(TOPDIR)/src/jdk.sctp/$(OPENJDK_TARGET_OS_TYPE)/native/libsctp, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
-I $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/ch \
|
||||
-I $(TOPDIR)/src/java.base/share/native/libnio/ch \
|
||||
$(addprefix -I, $(call FindSrcDirsForLib, java.base, net)) \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/jdk.sctp \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.base, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
$(call GetJavaHeaderDir, java.base) \
|
||||
java.base:libnet \
|
||||
java.base:libnio/ch, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS_unix := -lnio -lnet -ljava -ljvm, \
|
||||
|
||||
@ -29,9 +29,8 @@ include LibCommon.gmk
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJAAS, \
|
||||
NAME := jaas, \
|
||||
SRC := $(call FindSrcDirsForLib, jdk.security.auth, jaas), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/jdk.security.auth, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS_windows := netapi32.lib user32.lib mpr.lib advapi32.lib $(JDKLIB_LIBS), \
|
||||
|
||||
@ -25,9 +25,6 @@
|
||||
|
||||
include JdkNativeCompilation.gmk
|
||||
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, lib/LibCommon.gmk))
|
||||
|
||||
################################################################################
|
||||
|
||||
GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/version.rc
|
||||
@ -66,16 +63,6 @@ else ifeq ($(TOOLCHAIN_TYPE), xlc)
|
||||
endif
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Find the default set of src dirs for a native library.
|
||||
# Param 1 - module name
|
||||
# Param 2 - library name
|
||||
FindSrcDirsForLib += \
|
||||
$(call uniq, $(wildcard \
|
||||
$(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/lib$(strip $2) \
|
||||
$(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/native/lib$(strip $2) \
|
||||
$(TOPDIR)/src/$(strip $1)/share/native/lib$(strip $2)))
|
||||
|
||||
################################################################################
|
||||
# Find a library
|
||||
# Param 1 - module name
|
||||
@ -94,10 +81,6 @@ FindStaticLib = \
|
||||
$(addprefix $(SUPPORT_OUTPUTDIR)/native/, \
|
||||
$(strip $1)$(strip $3)/$(LIBRARY_PREFIX)$(strip $2)$(STATIC_LIBRARY_SUFFIX))
|
||||
|
||||
################################################################################
|
||||
# Define the header include flags needed to compile against it.
|
||||
LIBJAVA_HEADER_FLAGS := $(addprefix -I, $(call FindSrcDirsForLib, java.base, java))
|
||||
|
||||
# Put the libraries here.
|
||||
INSTALL_LIBRARIES_HERE := $(call FindLibDirForModule, $(MODULE))
|
||||
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
#include "compiler/disassembler.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "nativeInst_aarch64.hpp"
|
||||
#include "oops/accessDecorators.hpp"
|
||||
#include "oops/compressedOops.inline.hpp"
|
||||
#include "oops/klass.inline.hpp"
|
||||
#include "oops/oop.hpp"
|
||||
@ -2127,7 +2128,7 @@ void MacroAssembler::resolve_jobject(Register value, Register thread, Register t
|
||||
|
||||
bind(not_weak);
|
||||
// Resolve (untagged) jobject.
|
||||
bs->load_at(this, IN_ROOT | IN_CONCURRENT_ROOT, T_OBJECT,
|
||||
bs->load_at(this, IN_CONCURRENT_ROOT, T_OBJECT,
|
||||
value, Address(value, 0), tmp, thread);
|
||||
verify_oop(value);
|
||||
bind(done);
|
||||
@ -3664,7 +3665,7 @@ void MacroAssembler::load_klass(Register dst, Register src) {
|
||||
void MacroAssembler::resolve_oop_handle(Register result, Register tmp) {
|
||||
// OopHandle::resolve is an indirection.
|
||||
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bs->load_at(this, IN_ROOT | IN_CONCURRENT_ROOT, T_OBJECT,
|
||||
bs->load_at(this, IN_CONCURRENT_ROOT, T_OBJECT,
|
||||
result, Address(result, 0), tmp, rthread);
|
||||
}
|
||||
|
||||
@ -3983,6 +3984,7 @@ void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
|
||||
Register dst, Address src,
|
||||
Register tmp1, Register thread_tmp) {
|
||||
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
decorators = AccessInternal::decorator_fixup(decorators);
|
||||
bool as_raw = (decorators & AS_RAW) != 0;
|
||||
if (as_raw) {
|
||||
bs->BarrierSetAssembler::load_at(this, decorators, type, dst, src, tmp1, thread_tmp);
|
||||
@ -3995,6 +3997,7 @@ void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators,
|
||||
Address dst, Register src,
|
||||
Register tmp1, Register thread_tmp) {
|
||||
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
decorators = AccessInternal::decorator_fixup(decorators);
|
||||
bool as_raw = (decorators & AS_RAW) != 0;
|
||||
if (as_raw) {
|
||||
bs->BarrierSetAssembler::store_at(this, decorators, type, dst, src, tmp1, thread_tmp);
|
||||
|
||||
@ -813,7 +813,7 @@ void TemplateTable::aaload()
|
||||
do_oop_load(_masm,
|
||||
Address(r1, arrayOopDesc::base_offset_in_bytes(T_OBJECT)),
|
||||
r0,
|
||||
IN_HEAP | IN_HEAP_ARRAY);
|
||||
IN_HEAP_ARRAY);
|
||||
}
|
||||
|
||||
void TemplateTable::baload()
|
||||
@ -1141,7 +1141,7 @@ void TemplateTable::aastore() {
|
||||
// Get the value we will store
|
||||
__ ldr(r0, at_tos());
|
||||
// Now store using the appropriate barrier
|
||||
do_oop_store(_masm, element_address, r0, IN_HEAP | IN_HEAP_ARRAY);
|
||||
do_oop_store(_masm, element_address, r0, IN_HEAP_ARRAY);
|
||||
__ b(done);
|
||||
|
||||
// Have a NULL in r0, r3=array, r2=index. Store NULL at ary[idx]
|
||||
@ -1149,7 +1149,7 @@ void TemplateTable::aastore() {
|
||||
__ profile_null_seen(r2);
|
||||
|
||||
// Store a NULL
|
||||
do_oop_store(_masm, element_address, noreg, IN_HEAP | IN_HEAP_ARRAY);
|
||||
do_oop_store(_masm, element_address, noreg, IN_HEAP_ARRAY);
|
||||
|
||||
// Pop stack arguments
|
||||
__ bind(done);
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
#include "gc/shared/collectedHeap.inline.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "oops/accessDecorators.hpp"
|
||||
#include "oops/klass.inline.hpp"
|
||||
#include "prims/methodHandles.hpp"
|
||||
#include "runtime/biasedLocking.hpp"
|
||||
@ -2133,7 +2134,7 @@ void MacroAssembler::resolve_jobject(Register value,
|
||||
b(done);
|
||||
bind(not_weak);
|
||||
// Resolve (untagged) jobject.
|
||||
access_load_at(T_OBJECT, IN_ROOT | IN_CONCURRENT_ROOT,
|
||||
access_load_at(T_OBJECT, IN_CONCURRENT_ROOT,
|
||||
Address(value, 0), value, tmp1, tmp2, noreg);
|
||||
verify_oop(value);
|
||||
bind(done);
|
||||
@ -2700,6 +2701,7 @@ void MacroAssembler::store_heap_oop_null(Address obj, Register new_val, Register
|
||||
void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
|
||||
Address src, Register dst, Register tmp1, Register tmp2, Register tmp3) {
|
||||
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
decorators = AccessInternal::decorator_fixup(decorators);
|
||||
bool as_raw = (decorators & AS_RAW) != 0;
|
||||
if (as_raw) {
|
||||
bs->BarrierSetAssembler::load_at(this, decorators, type, dst, src, tmp1, tmp2, tmp3);
|
||||
@ -2711,6 +2713,7 @@ void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
|
||||
void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators,
|
||||
Address obj, Register new_val, Register tmp1, Register tmp2, Register tmp3, bool is_null) {
|
||||
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
decorators = AccessInternal::decorator_fixup(decorators);
|
||||
bool as_raw = (decorators & AS_RAW) != 0;
|
||||
if (as_raw) {
|
||||
bs->BarrierSetAssembler::store_at(this, decorators, type, obj, new_val, tmp1, tmp2, tmp3, is_null);
|
||||
|
||||
@ -486,7 +486,7 @@ int Assembler::add_const_optimized(Register d, Register s, long x, Register tmp,
|
||||
// Case 2: Can use addis.
|
||||
if (xd == 0) {
|
||||
short xc = rem & 0xFFFF; // 2nd 16-bit chunk.
|
||||
rem = (rem >> 16) + ((unsigned short)xd >> 15);
|
||||
rem = (rem >> 16) + ((unsigned short)xc >> 15);
|
||||
if (rem == 0) {
|
||||
addis(d, s, xc);
|
||||
return 0;
|
||||
|
||||
@ -214,11 +214,9 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, Decorato
|
||||
assert(sizeof(*ct->card_table()->byte_map_base()) == sizeof(jbyte), "adjust this code");
|
||||
|
||||
// Does store cross heap regions?
|
||||
if (G1RSBarrierRegionFilter) {
|
||||
__ xorr(tmp1, store_addr, new_val);
|
||||
__ srdi_(tmp1, tmp1, HeapRegion::LogOfHRGrainBytes);
|
||||
__ beq(CCR0, filtered);
|
||||
}
|
||||
__ xorr(tmp1, store_addr, new_val);
|
||||
__ srdi_(tmp1, tmp1, HeapRegion::LogOfHRGrainBytes);
|
||||
__ beq(CCR0, filtered);
|
||||
|
||||
// Crosses regions, storing NULL?
|
||||
if (not_null) {
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
#include "code/codeCache.hpp"
|
||||
#include "gc/shared/barrierSet.hpp"
|
||||
#include "gc/shared/barrierSetAssembler.hpp"
|
||||
#include "oops/accessDecorators.hpp"
|
||||
#include "runtime/safepointMechanism.hpp"
|
||||
|
||||
inline bool MacroAssembler::is_ld_largeoffset(address a) {
|
||||
@ -332,6 +333,7 @@ inline void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorat
|
||||
ON_UNKNOWN_OOP_REF)) == 0, "unsupported decorator");
|
||||
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bool as_raw = (decorators & AS_RAW) != 0;
|
||||
decorators = AccessInternal::decorator_fixup(decorators);
|
||||
if (as_raw) {
|
||||
bs->BarrierSetAssembler::store_at(this, decorators, type,
|
||||
base, ind_or_offs, val,
|
||||
@ -349,6 +351,7 @@ inline void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorato
|
||||
assert((decorators & ~(AS_RAW | IN_HEAP | IN_HEAP_ARRAY | IN_ROOT | OOP_NOT_NULL |
|
||||
ON_PHANTOM_OOP_REF | ON_WEAK_OOP_REF)) == 0, "unsupported decorator");
|
||||
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
decorators = AccessInternal::decorator_fixup(decorators);
|
||||
bool as_raw = (decorators & AS_RAW) != 0;
|
||||
if (as_raw) {
|
||||
bs->BarrierSetAssembler::load_at(this, decorators, type,
|
||||
|
||||
@ -688,7 +688,7 @@ void TemplateTable::aaload() {
|
||||
Rtemp2 = R31;
|
||||
__ index_check(Rarray, R17_tos /* index */, UseCompressedOops ? 2 : LogBytesPerWord, Rtemp, Rload_addr);
|
||||
do_oop_load(_masm, Rload_addr, arrayOopDesc::base_offset_in_bytes(T_OBJECT), R17_tos, Rtemp, Rtemp2,
|
||||
IN_HEAP | IN_HEAP_ARRAY);
|
||||
IN_HEAP_ARRAY);
|
||||
__ verify_oop(R17_tos);
|
||||
//__ dcbt(R17_tos); // prefetch
|
||||
}
|
||||
@ -1015,14 +1015,14 @@ void TemplateTable::aastore() {
|
||||
|
||||
__ bind(Lis_null);
|
||||
do_oop_store(_masm, Rstore_addr, arrayOopDesc::base_offset_in_bytes(T_OBJECT), noreg /* 0 */,
|
||||
Rscratch, Rscratch2, Rscratch3, IN_HEAP | IN_HEAP_ARRAY);
|
||||
Rscratch, Rscratch2, Rscratch3, IN_HEAP_ARRAY);
|
||||
__ profile_null_seen(Rscratch, Rscratch2);
|
||||
__ b(Ldone);
|
||||
|
||||
// Store is OK.
|
||||
__ bind(Lstore_ok);
|
||||
do_oop_store(_masm, Rstore_addr, arrayOopDesc::base_offset_in_bytes(T_OBJECT), R17_tos /* value */,
|
||||
Rscratch, Rscratch2, Rscratch3, IN_HEAP | IN_HEAP_ARRAY | OOP_NOT_NULL);
|
||||
Rscratch, Rscratch2, Rscratch3, IN_HEAP_ARRAY | OOP_NOT_NULL);
|
||||
|
||||
__ bind(Ldone);
|
||||
// Adjust sp (pops array, index and value).
|
||||
|
||||
@ -273,16 +273,14 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, Decorato
|
||||
|
||||
// Does store cross heap regions?
|
||||
// It does if the two addresses specify different grain addresses.
|
||||
if (G1RSBarrierRegionFilter) {
|
||||
if (VM_Version::has_DistinctOpnds()) {
|
||||
__ z_xgrk(Rtmp1, Rstore_addr, Rnew_val);
|
||||
} else {
|
||||
__ z_lgr(Rtmp1, Rstore_addr);
|
||||
__ z_xgr(Rtmp1, Rnew_val);
|
||||
}
|
||||
__ z_srag(Rtmp1, Rtmp1, HeapRegion::LogOfHRGrainBytes);
|
||||
__ z_bre(filtered);
|
||||
if (VM_Version::has_DistinctOpnds()) {
|
||||
__ z_xgrk(Rtmp1, Rstore_addr, Rnew_val);
|
||||
} else {
|
||||
__ z_lgr(Rtmp1, Rstore_addr);
|
||||
__ z_xgr(Rtmp1, Rnew_val);
|
||||
}
|
||||
__ z_srag(Rtmp1, Rtmp1, HeapRegion::LogOfHRGrainBytes);
|
||||
__ z_bre(filtered);
|
||||
|
||||
// Crosses regions, storing NULL?
|
||||
if (not_null) {
|
||||
|
||||
@ -34,6 +34,7 @@
|
||||
#include "gc/shared/cardTableBarrierSet.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "memory/universe.hpp"
|
||||
#include "oops/accessDecorators.hpp"
|
||||
#include "oops/compressedOops.inline.hpp"
|
||||
#include "oops/klass.inline.hpp"
|
||||
#include "opto/compile.hpp"
|
||||
@ -4053,6 +4054,7 @@ void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators,
|
||||
assert((decorators & ~(AS_RAW | IN_HEAP | IN_HEAP_ARRAY | IN_ROOT | OOP_NOT_NULL |
|
||||
ON_UNKNOWN_OOP_REF)) == 0, "unsupported decorator");
|
||||
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
decorators = AccessInternal::decorator_fixup(decorators);
|
||||
bool as_raw = (decorators & AS_RAW) != 0;
|
||||
if (as_raw) {
|
||||
bs->BarrierSetAssembler::store_at(this, decorators, type,
|
||||
@ -4071,6 +4073,7 @@ void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
|
||||
assert((decorators & ~(AS_RAW | IN_HEAP | IN_HEAP_ARRAY | IN_ROOT | OOP_NOT_NULL |
|
||||
ON_PHANTOM_OOP_REF | ON_WEAK_OOP_REF)) == 0, "unsupported decorator");
|
||||
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
decorators = AccessInternal::decorator_fixup(decorators);
|
||||
bool as_raw = (decorators & AS_RAW) != 0;
|
||||
if (as_raw) {
|
||||
bs->BarrierSetAssembler::load_at(this, decorators, type,
|
||||
|
||||
@ -853,7 +853,7 @@ void TemplateTable::aaload() {
|
||||
index_check(Z_tmp_1, index, shift);
|
||||
// Now load array element.
|
||||
do_oop_load(_masm, Address(Z_tmp_1, index, arrayOopDesc::base_offset_in_bytes(T_OBJECT)), Z_tos,
|
||||
Z_tmp_2, Z_tmp_3, IN_HEAP | IN_HEAP_ARRAY);
|
||||
Z_tmp_2, Z_tmp_3, IN_HEAP_ARRAY);
|
||||
__ verify_oop(Z_tos);
|
||||
}
|
||||
|
||||
@ -1197,7 +1197,7 @@ void TemplateTable::aastore() {
|
||||
|
||||
// Store a NULL.
|
||||
do_oop_store(_masm, Address(Rstore_addr, (intptr_t)0), noreg,
|
||||
tmp3, tmp2, tmp1, IN_HEAP | IN_HEAP_ARRAY);
|
||||
tmp3, tmp2, tmp1, IN_HEAP_ARRAY);
|
||||
__ z_bru(done);
|
||||
|
||||
// Come here on success.
|
||||
@ -1205,7 +1205,7 @@ void TemplateTable::aastore() {
|
||||
|
||||
// Now store using the appropriate barrier.
|
||||
do_oop_store(_masm, Address(Rstore_addr, (intptr_t)0), Rvalue,
|
||||
tmp3, tmp2, tmp1, IN_HEAP | IN_HEAP_ARRAY | OOP_NOT_NULL);
|
||||
tmp3, tmp2, tmp1, IN_HEAP_ARRAY | OOP_NOT_NULL);
|
||||
|
||||
// Pop stack arguments.
|
||||
__ bind(done);
|
||||
|
||||
@ -369,12 +369,10 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, Register
|
||||
|
||||
G1BarrierSet* bs = barrier_set_cast<G1BarrierSet>(BarrierSet::barrier_set());
|
||||
|
||||
if (G1RSBarrierRegionFilter) {
|
||||
__ xor3(store_addr, new_val, tmp);
|
||||
__ srlx(tmp, HeapRegion::LogOfHRGrainBytes, tmp);
|
||||
__ xor3(store_addr, new_val, tmp);
|
||||
__ srlx(tmp, HeapRegion::LogOfHRGrainBytes, tmp);
|
||||
|
||||
__ cmp_and_brx_short(tmp, G0, Assembler::equal, Assembler::pt, filtered);
|
||||
}
|
||||
__ cmp_and_brx_short(tmp, G0, Assembler::equal, Assembler::pt, filtered);
|
||||
|
||||
// If the "store_addr" register is an "in" or "local" register, move it to
|
||||
// a scratch reg so we can pass it as an argument.
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "memory/universe.hpp"
|
||||
#include "oops/accessDecorators.hpp"
|
||||
#include "oops/klass.inline.hpp"
|
||||
#include "prims/methodHandles.hpp"
|
||||
#include "runtime/biasedLocking.hpp"
|
||||
@ -181,7 +182,7 @@ void MacroAssembler::resolve_jobject(Register value, Register tmp) {
|
||||
br (Assembler::always, true, Assembler::pt, done);
|
||||
delayed()->nop();
|
||||
bind(not_weak);
|
||||
access_load_at(T_OBJECT, IN_ROOT | IN_CONCURRENT_ROOT,
|
||||
access_load_at(T_OBJECT, IN_CONCURRENT_ROOT,
|
||||
Address(value, 0), value, tmp);
|
||||
verify_oop(value);
|
||||
bind(done);
|
||||
@ -3401,7 +3402,7 @@ void MacroAssembler::reserved_stack_check() {
|
||||
// ((OopHandle)result).resolve();
|
||||
void MacroAssembler::resolve_oop_handle(Register result, Register tmp) {
|
||||
// OopHandle::resolve is an indirection.
|
||||
access_load_at(T_OBJECT, IN_ROOT | IN_CONCURRENT_ROOT,
|
||||
access_load_at(T_OBJECT, IN_CONCURRENT_ROOT,
|
||||
Address(result, 0), result, tmp);
|
||||
}
|
||||
|
||||
@ -3446,6 +3447,7 @@ void MacroAssembler::store_klass_gap(Register s, Register d) {
|
||||
void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators,
|
||||
Register src, Address dst, Register tmp) {
|
||||
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
decorators = AccessInternal::decorator_fixup(decorators);
|
||||
bool as_raw = (decorators & AS_RAW) != 0;
|
||||
if (as_raw) {
|
||||
bs->BarrierSetAssembler::store_at(this, decorators, type, src, dst, tmp);
|
||||
@ -3457,6 +3459,7 @@ void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators,
|
||||
void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
|
||||
Address src, Register dst, Register tmp) {
|
||||
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
decorators = AccessInternal::decorator_fixup(decorators);
|
||||
bool as_raw = (decorators & AS_RAW) != 0;
|
||||
if (as_raw) {
|
||||
bs->BarrierSetAssembler::load_at(this, decorators, type, src, dst, tmp);
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "memory/universe.hpp"
|
||||
#include "oops/access.hpp"
|
||||
#include "oops/accessDecorators.hpp"
|
||||
#include "oops/klass.inline.hpp"
|
||||
#include "prims/methodHandles.hpp"
|
||||
#include "runtime/biasedLocking.hpp"
|
||||
@ -5259,7 +5259,7 @@ void MacroAssembler::resolve_jobject(Register value,
|
||||
jmp(done);
|
||||
bind(not_weak);
|
||||
// Resolve (untagged) jobject.
|
||||
access_load_at(T_OBJECT, IN_ROOT | IN_CONCURRENT_ROOT,
|
||||
access_load_at(T_OBJECT, IN_CONCURRENT_ROOT,
|
||||
value, Address(value, 0), tmp, thread);
|
||||
verify_oop(value);
|
||||
bind(done);
|
||||
@ -6281,7 +6281,7 @@ void MacroAssembler::resolve_oop_handle(Register result, Register tmp) {
|
||||
// Only 64 bit platforms support GCs that require a tmp register
|
||||
// Only IN_HEAP loads require a thread_tmp register
|
||||
// OopHandle::resolve is an indirection like jobject.
|
||||
access_load_at(T_OBJECT, IN_ROOT | IN_CONCURRENT_ROOT,
|
||||
access_load_at(T_OBJECT, IN_CONCURRENT_ROOT,
|
||||
result, Address(result, 0), tmp, /*tmp_thread*/noreg);
|
||||
}
|
||||
|
||||
@ -6323,6 +6323,7 @@ void MacroAssembler::store_klass(Register dst, Register src) {
|
||||
void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators, Register dst, Address src,
|
||||
Register tmp1, Register thread_tmp) {
|
||||
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
decorators = AccessInternal::decorator_fixup(decorators);
|
||||
bool as_raw = (decorators & AS_RAW) != 0;
|
||||
if (as_raw) {
|
||||
bs->BarrierSetAssembler::load_at(this, decorators, type, dst, src, tmp1, thread_tmp);
|
||||
@ -6334,6 +6335,7 @@ void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators, Reg
|
||||
void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators, Address dst, Register src,
|
||||
Register tmp1, Register tmp2) {
|
||||
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
decorators = AccessInternal::decorator_fixup(decorators);
|
||||
bool as_raw = (decorators & AS_RAW) != 0;
|
||||
if (as_raw) {
|
||||
bs->BarrierSetAssembler::store_at(this, decorators, type, dst, src, tmp1, tmp2);
|
||||
|
||||
@ -11607,16 +11607,6 @@ instruct testUL_reg(rFlagsRegU cr, rRegL src, immL0 zero)
|
||||
ins_pipe(ialu_cr_reg_imm);
|
||||
%}
|
||||
|
||||
instruct compUB_mem_imm(rFlagsReg cr, memory mem, immU8 imm)
|
||||
%{
|
||||
match(Set cr (CmpI (LoadUB mem) imm));
|
||||
|
||||
ins_cost(125);
|
||||
format %{ "cmpb $mem, $imm" %}
|
||||
ins_encode %{ __ cmpb($mem$$Address, $imm$$constant); %}
|
||||
ins_pipe(ialu_cr_reg_mem);
|
||||
%}
|
||||
|
||||
instruct compB_mem_imm(rFlagsReg cr, memory mem, immI8 imm)
|
||||
%{
|
||||
match(Set cr (CmpI (LoadB mem) imm));
|
||||
@ -11627,16 +11617,6 @@ instruct compB_mem_imm(rFlagsReg cr, memory mem, immI8 imm)
|
||||
ins_pipe(ialu_cr_reg_mem);
|
||||
%}
|
||||
|
||||
instruct testUB_mem_imm(rFlagsReg cr, memory mem, immU8 imm, immI0 zero)
|
||||
%{
|
||||
match(Set cr (CmpI (AndI (LoadUB mem) imm) zero));
|
||||
|
||||
ins_cost(125);
|
||||
format %{ "testb $mem, $imm" %}
|
||||
ins_encode %{ __ testb($mem$$Address, $imm$$constant); %}
|
||||
ins_pipe(ialu_cr_reg_mem);
|
||||
%}
|
||||
|
||||
instruct testB_mem_imm(rFlagsReg cr, memory mem, immI8 imm, immI0 zero)
|
||||
%{
|
||||
match(Set cr (CmpI (AndI (LoadB mem) imm) zero));
|
||||
|
||||
456
src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp
Normal file
456
src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp
Normal file
@ -0,0 +1,456 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
|
||||
#include "classfile/classLoaderData.inline.hpp"
|
||||
#include "classfile/classLoaderHierarchyDCmd.hpp"
|
||||
#include "memory/allocation.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "runtime/safepoint.hpp"
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
#include "utilities/ostream.hpp"
|
||||
|
||||
|
||||
ClassLoaderHierarchyDCmd::ClassLoaderHierarchyDCmd(outputStream* output, bool heap)
|
||||
: DCmdWithParser(output, heap)
|
||||
, _show_classes("show-classes", "Print loaded classes.", "BOOLEAN", false, "false")
|
||||
, _verbose("verbose", "Print detailed information.", "BOOLEAN", false, "false") {
|
||||
_dcmdparser.add_dcmd_option(&_show_classes);
|
||||
_dcmdparser.add_dcmd_option(&_verbose);
|
||||
}
|
||||
|
||||
|
||||
int ClassLoaderHierarchyDCmd::num_arguments() {
|
||||
ResourceMark rm;
|
||||
ClassLoaderHierarchyDCmd* dcmd = new ClassLoaderHierarchyDCmd(NULL, false);
|
||||
if (dcmd != NULL) {
|
||||
DCmdMark mark(dcmd);
|
||||
return dcmd->_dcmdparser.num_arguments();
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Helper class for drawing the branches to the left of a node.
|
||||
class BranchTracker : public StackObj {
|
||||
// "<x>"
|
||||
// " |---<y>"
|
||||
// " | |
|
||||
// " | <z>"
|
||||
// " | |---<z1>
|
||||
// " | |---<z2>
|
||||
// ^^^^^^^ ^^^
|
||||
// A B
|
||||
|
||||
// Some terms for the graphics:
|
||||
// - branch: vertical connection between a node's ancestor to a later sibling.
|
||||
// - branchwork: (A) the string to print as a prefix at the start of each line, contains all branches.
|
||||
// - twig (B): Length of the dashed line connecting a node to its branch.
|
||||
// - branch spacing: how many spaces between branches are printed.
|
||||
|
||||
public:
|
||||
|
||||
enum { max_depth = 64, twig_len = 2, branch_spacing = 5 };
|
||||
|
||||
private:
|
||||
|
||||
char _branches[max_depth];
|
||||
int _pos;
|
||||
|
||||
public:
|
||||
BranchTracker()
|
||||
: _pos(0) {}
|
||||
|
||||
void push(bool has_branch) {
|
||||
if (_pos < max_depth) {
|
||||
_branches[_pos] = has_branch ? '|' : ' ';
|
||||
}
|
||||
_pos ++; // beyond max depth, omit branch drawing but do count on.
|
||||
}
|
||||
|
||||
void pop() {
|
||||
assert(_pos > 0, "must be");
|
||||
_pos --;
|
||||
}
|
||||
|
||||
void print(outputStream* st) {
|
||||
for (int i = 0; i < _pos; i ++) {
|
||||
st->print("%c%.*s", _branches[i], branch_spacing, " ");
|
||||
}
|
||||
}
|
||||
|
||||
class Mark {
|
||||
BranchTracker& _tr;
|
||||
public:
|
||||
Mark(BranchTracker& tr, bool has_branch_here)
|
||||
: _tr(tr) { _tr.push(has_branch_here); }
|
||||
~Mark() { _tr.pop(); }
|
||||
};
|
||||
|
||||
}; // end: BranchTracker
|
||||
|
||||
struct LoadedClassInfo : public ResourceObj {
|
||||
public:
|
||||
LoadedClassInfo* _next;
|
||||
Klass* const _klass;
|
||||
const ClassLoaderData* const _cld;
|
||||
|
||||
LoadedClassInfo(Klass* klass, const ClassLoaderData* cld)
|
||||
: _klass(klass), _cld(cld) {}
|
||||
|
||||
};
|
||||
|
||||
class LoaderTreeNode : public ResourceObj {
|
||||
|
||||
// We walk the CLDG and, for each CLD which is non-anonymous, add
|
||||
// a tree node. To add a node we need its parent node; if it itself
|
||||
// does not exist yet, we add a preliminary node for it. This preliminary
|
||||
// node just contains its loader oop; later, when encountering its CLD in
|
||||
// our CLDG walk, we complete the missing information in this node.
|
||||
|
||||
const oop _loader_oop;
|
||||
const ClassLoaderData* _cld;
|
||||
|
||||
LoaderTreeNode* _child;
|
||||
LoaderTreeNode* _next;
|
||||
|
||||
LoadedClassInfo* _classes;
|
||||
int _num_classes;
|
||||
|
||||
LoadedClassInfo* _anon_classes;
|
||||
int _num_anon_classes;
|
||||
|
||||
void print_with_childs(outputStream* st, BranchTracker& branchtracker,
|
||||
bool print_classes, bool verbose) const {
|
||||
|
||||
ResourceMark rm;
|
||||
|
||||
if (_cld == NULL) {
|
||||
// Not sure how this could happen: we added a preliminary node for a parent but then never encountered
|
||||
// its CLD?
|
||||
return;
|
||||
}
|
||||
|
||||
// Retrieve information.
|
||||
const Klass* const loader_klass = _cld->class_loader_klass();
|
||||
const Symbol* const loader_name = _cld->class_loader_name();
|
||||
|
||||
branchtracker.print(st);
|
||||
|
||||
// e.g. "+--- jdk.internal.reflect.DelegatingClassLoader"
|
||||
st->print("+%.*s", BranchTracker::twig_len, "----------");
|
||||
if (_cld->is_the_null_class_loader_data()) {
|
||||
st->print(" <bootstrap>");
|
||||
} else {
|
||||
if (loader_name != NULL) {
|
||||
st->print(" \"%s\",", loader_name->as_C_string());
|
||||
}
|
||||
st->print(" %s", loader_klass != NULL ? loader_klass->external_name() : "??");
|
||||
st->print(" {" PTR_FORMAT "}", p2i(_loader_oop));
|
||||
}
|
||||
st->cr();
|
||||
|
||||
// Output following this node (node details and child nodes) - up to the next sibling node
|
||||
// needs to be prefixed with "|" if there is a follow up sibling.
|
||||
const bool have_sibling = _next != NULL;
|
||||
BranchTracker::Mark trm(branchtracker, have_sibling);
|
||||
|
||||
{
|
||||
// optional node details following this node needs to be prefixed with "|"
|
||||
// if there are follow up child nodes.
|
||||
const bool have_child = _child != NULL;
|
||||
BranchTracker::Mark trm(branchtracker, have_child);
|
||||
|
||||
// Empty line
|
||||
branchtracker.print(st);
|
||||
st->cr();
|
||||
|
||||
const int indentation = 18;
|
||||
|
||||
if (verbose) {
|
||||
branchtracker.print(st);
|
||||
st->print_cr("%*s " PTR_FORMAT, indentation, "Loader Data:", p2i(_cld));
|
||||
branchtracker.print(st);
|
||||
st->print_cr("%*s " PTR_FORMAT, indentation, "Loader Klass:", p2i(loader_klass));
|
||||
|
||||
// Empty line
|
||||
branchtracker.print(st);
|
||||
st->cr();
|
||||
}
|
||||
|
||||
if (print_classes) {
|
||||
|
||||
if (_classes != NULL) {
|
||||
for (LoadedClassInfo* lci = _classes; lci; lci = lci->_next) {
|
||||
branchtracker.print(st);
|
||||
if (lci == _classes) { // first iteration
|
||||
st->print("%*s ", indentation, "Classes:");
|
||||
} else {
|
||||
st->print("%*s ", indentation, "");
|
||||
}
|
||||
st->print("%s", lci->_klass->external_name());
|
||||
st->cr();
|
||||
// Non-anonymous classes should live in the primary CLD of its loader
|
||||
assert(lci->_cld == _cld, "must be");
|
||||
}
|
||||
branchtracker.print(st);
|
||||
st->print("%*s ", indentation, "");
|
||||
st->print_cr("(%u class%s)", _num_classes, (_num_classes == 1) ? "" : "es");
|
||||
|
||||
// Empty line
|
||||
branchtracker.print(st);
|
||||
st->cr();
|
||||
}
|
||||
|
||||
if (_anon_classes != NULL) {
|
||||
for (LoadedClassInfo* lci = _anon_classes; lci; lci = lci->_next) {
|
||||
branchtracker.print(st);
|
||||
if (lci == _anon_classes) { // first iteration
|
||||
st->print("%*s ", indentation, "Anonymous Classes:");
|
||||
} else {
|
||||
st->print("%*s ", indentation, "");
|
||||
}
|
||||
st->print("%s", lci->_klass->external_name());
|
||||
// For anonymous classes, also print CLD if verbose. Should be a different one than the primary CLD.
|
||||
assert(lci->_cld != _cld, "must be");
|
||||
if (verbose) {
|
||||
st->print(" (CLD: " PTR_FORMAT ")", p2i(lci->_cld));
|
||||
}
|
||||
st->cr();
|
||||
}
|
||||
branchtracker.print(st);
|
||||
st->print("%*s ", indentation, "");
|
||||
st->print_cr("(%u anonymous class%s)", _num_anon_classes, (_num_anon_classes == 1) ? "" : "es");
|
||||
|
||||
// Empty line
|
||||
branchtracker.print(st);
|
||||
st->cr();
|
||||
}
|
||||
|
||||
} // end: print_classes
|
||||
|
||||
} // Pop branchtracker mark
|
||||
|
||||
// Print children, recursively
|
||||
LoaderTreeNode* c = _child;
|
||||
while (c != NULL) {
|
||||
c->print_with_childs(st, branchtracker, print_classes, verbose);
|
||||
c = c->_next;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
LoaderTreeNode(const oop loader_oop)
|
||||
: _loader_oop(loader_oop), _cld(NULL)
|
||||
, _child(NULL), _next(NULL)
|
||||
, _classes(NULL), _anon_classes(NULL)
|
||||
, _num_classes(0), _num_anon_classes(0) {}
|
||||
|
||||
void set_cld(const ClassLoaderData* cld) {
|
||||
_cld = cld;
|
||||
}
|
||||
|
||||
void add_child(LoaderTreeNode* info) {
|
||||
info->_next = _child;
|
||||
_child = info;
|
||||
}
|
||||
|
||||
void add_sibling(LoaderTreeNode* info) {
|
||||
assert(info->_next == NULL, "must be");
|
||||
info->_next = _next;
|
||||
_next = info;
|
||||
}
|
||||
|
||||
void add_classes(LoadedClassInfo* first_class, int num_classes, bool anonymous) {
|
||||
LoadedClassInfo** p_list_to_add_to = anonymous ? &_anon_classes : &_classes;
|
||||
// Search tail.
|
||||
while ((*p_list_to_add_to) != NULL) {
|
||||
p_list_to_add_to = &(*p_list_to_add_to)->_next;
|
||||
}
|
||||
*p_list_to_add_to = first_class;
|
||||
if (anonymous) {
|
||||
_num_anon_classes += num_classes;
|
||||
} else {
|
||||
_num_classes += num_classes;
|
||||
}
|
||||
}
|
||||
|
||||
const ClassLoaderData* cld() const {
|
||||
return _cld;
|
||||
}
|
||||
|
||||
const oop loader_oop() const {
|
||||
return _loader_oop;
|
||||
}
|
||||
|
||||
LoaderTreeNode* find(const oop loader_oop) {
|
||||
LoaderTreeNode* result = NULL;
|
||||
if (_loader_oop == loader_oop) {
|
||||
result = this;
|
||||
} else {
|
||||
LoaderTreeNode* c = _child;
|
||||
while (c != NULL && result == NULL) {
|
||||
result = c->find(loader_oop);
|
||||
c = c->_next;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void print_with_childs(outputStream* st, bool print_classes, bool print_add_info) const {
|
||||
BranchTracker bwt;
|
||||
print_with_childs(st, bwt, print_classes, print_add_info);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class LoadedClassCollectClosure : public KlassClosure {
|
||||
public:
|
||||
LoadedClassInfo* _list;
|
||||
const ClassLoaderData* _cld;
|
||||
int _num_classes;
|
||||
LoadedClassCollectClosure(const ClassLoaderData* cld)
|
||||
: _list(NULL), _cld(cld), _num_classes(0) {}
|
||||
void do_klass(Klass* k) {
|
||||
LoadedClassInfo* lki = new LoadedClassInfo(k, _cld);
|
||||
lki->_next = _list;
|
||||
_list = lki;
|
||||
_num_classes ++;
|
||||
}
|
||||
};
|
||||
|
||||
class LoaderInfoScanClosure : public CLDClosure {
|
||||
|
||||
const bool _print_classes;
|
||||
const bool _verbose;
|
||||
LoaderTreeNode* _root;
|
||||
|
||||
static void fill_in_classes(LoaderTreeNode* info, const ClassLoaderData* cld) {
|
||||
assert(info != NULL && cld != NULL, "must be");
|
||||
LoadedClassCollectClosure lccc(cld);
|
||||
const_cast<ClassLoaderData*>(cld)->classes_do(&lccc);
|
||||
if (lccc._num_classes > 0) {
|
||||
info->add_classes(lccc._list, lccc._num_classes, cld->is_anonymous());
|
||||
}
|
||||
}
|
||||
|
||||
LoaderTreeNode* find_node_or_add_empty_node(oop loader_oop) {
|
||||
|
||||
assert(_root != NULL, "root node must exist");
|
||||
|
||||
if (loader_oop == NULL) {
|
||||
return _root;
|
||||
}
|
||||
|
||||
// Check if a node for this oop already exists.
|
||||
LoaderTreeNode* info = _root->find(loader_oop);
|
||||
|
||||
if (info == NULL) {
|
||||
// It does not. Create a node.
|
||||
info = new LoaderTreeNode(loader_oop);
|
||||
|
||||
// Add it to tree.
|
||||
LoaderTreeNode* parent_info = NULL;
|
||||
|
||||
// Recursively add parent nodes if needed.
|
||||
const oop parent_oop = java_lang_ClassLoader::parent(loader_oop);
|
||||
if (parent_oop == NULL) {
|
||||
parent_info = _root;
|
||||
} else {
|
||||
parent_info = find_node_or_add_empty_node(parent_oop);
|
||||
}
|
||||
assert(parent_info != NULL, "must be");
|
||||
|
||||
parent_info->add_child(info);
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
LoaderInfoScanClosure(bool print_classes, bool verbose)
|
||||
: _print_classes(print_classes), _verbose(verbose), _root(NULL) {
|
||||
_root = new LoaderTreeNode(NULL);
|
||||
}
|
||||
|
||||
void print_results(outputStream* st) const {
|
||||
_root->print_with_childs(st, _print_classes, _verbose);
|
||||
}
|
||||
|
||||
void do_cld (ClassLoaderData* cld) {
|
||||
|
||||
// We do not display unloading loaders, for now.
|
||||
if (cld->is_unloading()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const oop loader_oop = cld->class_loader();
|
||||
|
||||
LoaderTreeNode* info = find_node_or_add_empty_node(loader_oop);
|
||||
assert(info != NULL, "must be");
|
||||
|
||||
// Update CLD in node, but only if this is the primary CLD for this loader.
|
||||
if (cld->is_anonymous() == false) {
|
||||
assert(info->cld() == NULL, "there should be only one primary CLD per loader");
|
||||
info->set_cld(cld);
|
||||
}
|
||||
|
||||
// Add classes.
|
||||
fill_in_classes(info, cld);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
class ClassLoaderHierarchyVMOperation : public VM_Operation {
|
||||
outputStream* const _out;
|
||||
const bool _show_classes;
|
||||
const bool _verbose;
|
||||
public:
|
||||
ClassLoaderHierarchyVMOperation(outputStream* out, bool show_classes, bool verbose) :
|
||||
_out(out), _show_classes(show_classes), _verbose(verbose)
|
||||
{}
|
||||
|
||||
VMOp_Type type() const {
|
||||
return VMOp_ClassLoaderHierarchyOperation;
|
||||
}
|
||||
|
||||
void doit() {
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "must be a safepoint");
|
||||
ResourceMark rm;
|
||||
LoaderInfoScanClosure cl (_show_classes, _verbose);
|
||||
ClassLoaderDataGraph::cld_do(&cl);
|
||||
cl.print_results(_out);
|
||||
}
|
||||
};
|
||||
|
||||
// This command needs to be executed at a safepoint.
|
||||
void ClassLoaderHierarchyDCmd::execute(DCmdSource source, TRAPS) {
|
||||
ClassLoaderHierarchyVMOperation op(output(), _show_classes.value(), _verbose.value());
|
||||
VMThread::execute(&op);
|
||||
}
|
||||
58
src/hotspot/share/classfile/classLoaderHierarchyDCmd.hpp
Normal file
58
src/hotspot/share/classfile/classLoaderHierarchyDCmd.hpp
Normal file
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HOTSPOT_SHARE_CLASSFILE_CLASSLOADERHIERARCHYDCMD_HPP_
|
||||
#define HOTSPOT_SHARE_CLASSFILE_CLASSLOADERHIERARCHYDCMD_HPP_
|
||||
|
||||
#include "services/diagnosticCommand.hpp"
|
||||
|
||||
class ClassLoaderHierarchyDCmd: public DCmdWithParser {
|
||||
DCmdArgument<bool> _show_classes;
|
||||
DCmdArgument<bool> _verbose;
|
||||
public:
|
||||
|
||||
ClassLoaderHierarchyDCmd(outputStream* output, bool heap);
|
||||
|
||||
static const char* name() {
|
||||
return "VM.classloaders";
|
||||
}
|
||||
|
||||
static const char* description() {
|
||||
return "Prints classloader hierarchy.";
|
||||
}
|
||||
static const char* impact() {
|
||||
return "Medium: Depends on number of class loaders and classes loaded.";
|
||||
}
|
||||
static const JavaPermission permission() {
|
||||
JavaPermission p = {"java.lang.management.ManagementPermission",
|
||||
"monitor", NULL};
|
||||
return p;
|
||||
}
|
||||
static int num_arguments();
|
||||
virtual void execute(DCmdSource source, TRAPS);
|
||||
|
||||
};
|
||||
|
||||
#endif /* HOTSPOT_SHARE_CLASSFILE_CLASSLOADERHIERARCHYDCMD_HPP_ */
|
||||
File diff suppressed because it is too large
Load Diff
@ -25,109 +25,111 @@
|
||||
#ifndef SHARE_VM_CLASSFILE_STRINGTABLE_HPP
|
||||
#define SHARE_VM_CLASSFILE_STRINGTABLE_HPP
|
||||
|
||||
#include "utilities/hashtable.hpp"
|
||||
#include "gc/shared/oopStorage.hpp"
|
||||
#include "gc/shared/oopStorageParState.hpp"
|
||||
#include "memory/allocation.hpp"
|
||||
#include "memory/padded.hpp"
|
||||
#include "oops/oop.hpp"
|
||||
#include "oops/weakHandle.hpp"
|
||||
#include "utilities/concurrentHashTable.hpp"
|
||||
|
||||
template <class T, class N> class CompactHashtable;
|
||||
class CompactStringTableWriter;
|
||||
class FileMapInfo;
|
||||
class SerializeClosure;
|
||||
|
||||
class StringTable : public RehashableHashtable<oop, mtSymbol> {
|
||||
class StringTable;
|
||||
class StringTableConfig;
|
||||
typedef ConcurrentHashTable<WeakHandle<vm_string_table_data>,
|
||||
StringTableConfig, mtSymbol> StringTableHash;
|
||||
|
||||
class StringTableCreateEntry;
|
||||
|
||||
class StringTable : public CHeapObj<mtSymbol>{
|
||||
friend class VMStructs;
|
||||
friend class Symbol;
|
||||
friend class StringTableConfig;
|
||||
friend class StringTableCreateEntry;
|
||||
|
||||
private:
|
||||
void grow(JavaThread* jt);
|
||||
void clean_dead_entries(JavaThread* jt);
|
||||
|
||||
// The string table
|
||||
static StringTable* _the_table;
|
||||
|
||||
// Shared string table
|
||||
static CompactHashtable<oop, char> _shared_table;
|
||||
static bool _shared_string_mapped;
|
||||
static bool _alt_hash;
|
||||
private:
|
||||
|
||||
// Set if one bucket is out of balance due to hash algorithm deficiency
|
||||
static bool _needs_rehashing;
|
||||
// Set if one bucket is out of balance due to hash algorithm deficiency
|
||||
StringTableHash* _local_table;
|
||||
size_t _current_size;
|
||||
volatile bool _has_work;
|
||||
volatile bool _needs_rehashing;
|
||||
|
||||
// Claimed high water mark for parallel chunked scanning
|
||||
static volatile int _parallel_claimed_idx;
|
||||
OopStorage* _weak_handles;
|
||||
|
||||
static oop intern(Handle string_or_null, jchar* chars, int length, TRAPS);
|
||||
oop basic_add(int index, Handle string_or_null, jchar* name, int len,
|
||||
unsigned int hashValue, TRAPS);
|
||||
volatile size_t _items;
|
||||
DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile size_t));
|
||||
volatile size_t _uncleaned_items;
|
||||
DEFINE_PAD_MINUS_SIZE(2, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile size_t));
|
||||
|
||||
oop lookup_in_main_table(int index, jchar* chars, int length, unsigned int hashValue);
|
||||
static oop lookup_shared(jchar* name, int len, unsigned int hash);
|
||||
double get_load_factor();
|
||||
double get_dead_factor();
|
||||
|
||||
// Apply the give oop closure to the entries to the buckets
|
||||
// in the range [start_idx, end_idx).
|
||||
static void buckets_oops_do(OopClosure* f, int start_idx, int end_idx);
|
||||
void check_concurrent_work();
|
||||
void trigger_concurrent_work();
|
||||
|
||||
typedef StringTable::BucketUnlinkContext BucketUnlinkContext;
|
||||
// Unlink or apply the give oop closure to the entries to the buckets
|
||||
// in the range [start_idx, end_idx). Unlinked bucket entries are collected in the given
|
||||
// context to be freed later.
|
||||
// This allows multiple threads to work on the table at once.
|
||||
static void buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, BucketUnlinkContext* context);
|
||||
static uintx item_added();
|
||||
static void item_removed();
|
||||
static size_t items_to_clean(size_t ncl);
|
||||
|
||||
// Hashing algorithm, used as the hash value used by the
|
||||
// StringTable for bucket selection and comparison (stored in the
|
||||
// HashtableEntry structures). This is used in the String.intern() method.
|
||||
static unsigned int hash_string(const jchar* s, int len);
|
||||
static unsigned int hash_string(oop string);
|
||||
static unsigned int alt_hash_string(const jchar* s, int len);
|
||||
StringTable();
|
||||
|
||||
// Accessors for the string roots in the hashtable entries.
|
||||
// Use string_object_no_keepalive() only when the value is not returned
|
||||
// outside of a scope where a thread transition is possible.
|
||||
static oop string_object(HashtableEntry<oop, mtSymbol>* entry);
|
||||
static oop string_object_no_keepalive(HashtableEntry<oop, mtSymbol>* entry);
|
||||
static void set_string_object(HashtableEntry<oop, mtSymbol>* entry, oop string);
|
||||
static oop intern(Handle string_or_null_h, jchar* name, int len, TRAPS);
|
||||
oop do_intern(Handle string_or_null, jchar* name, int len, uintx hash, TRAPS);
|
||||
oop do_lookup(jchar* name, int len, uintx hash);
|
||||
|
||||
StringTable() : RehashableHashtable<oop, mtSymbol>((int)StringTableSize,
|
||||
sizeof (HashtableEntry<oop, mtSymbol>)) {}
|
||||
void concurrent_work(JavaThread* jt);
|
||||
void print_table_statistics(outputStream* st, const char* table_name);
|
||||
|
||||
StringTable(HashtableBucket<mtSymbol>* t, int number_of_entries)
|
||||
: RehashableHashtable<oop, mtSymbol>((int)StringTableSize, sizeof (HashtableEntry<oop, mtSymbol>), t,
|
||||
number_of_entries) {}
|
||||
public:
|
||||
void try_rehash_table();
|
||||
bool do_rehash();
|
||||
|
||||
public:
|
||||
// The string table
|
||||
static StringTable* the_table() { return _the_table; }
|
||||
size_t table_size(Thread* thread = NULL);
|
||||
|
||||
// Size of one bucket in the string table. Used when checking for rollover.
|
||||
static uint bucket_size() { return sizeof(HashtableBucket<mtSymbol>); }
|
||||
static OopStorage* weak_storage() { return the_table()->_weak_handles; }
|
||||
|
||||
static void create_table() {
|
||||
assert(_the_table == NULL, "One string table allowed.");
|
||||
_the_table = new StringTable();
|
||||
}
|
||||
|
||||
static void do_concurrent_work(JavaThread* jt);
|
||||
static bool has_work() { return the_table()->_has_work; }
|
||||
|
||||
// GC support
|
||||
// Delete pointers to otherwise-unreachable objects.
|
||||
static void unlink_or_oops_do(BoolObjectClosure* cl, OopClosure* f) {
|
||||
int processed = 0;
|
||||
int removed = 0;
|
||||
unlink_or_oops_do(cl, f, &processed, &removed);
|
||||
}
|
||||
static void unlink(BoolObjectClosure* cl) {
|
||||
int processed = 0;
|
||||
int removed = 0;
|
||||
unlink_or_oops_do(cl, NULL, &processed, &removed);
|
||||
}
|
||||
static void unlink_or_oops_do(BoolObjectClosure* cl, OopClosure* f, int* processed, int* removed);
|
||||
static void unlink(BoolObjectClosure* cl, int* processed, int* removed) {
|
||||
unlink_or_oops_do(cl, NULL, processed, removed);
|
||||
unlink_or_oops_do(cl);
|
||||
}
|
||||
static void unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f = NULL,
|
||||
int* processed = NULL, int* removed = NULL);
|
||||
|
||||
// Serially invoke "f->do_oop" on the locations of all oops in the table.
|
||||
static void oops_do(OopClosure* f);
|
||||
|
||||
// Possibly parallel versions of the above
|
||||
static void possibly_parallel_unlink_or_oops_do(BoolObjectClosure* cl, OopClosure* f, int* processed, int* removed);
|
||||
static void possibly_parallel_unlink(BoolObjectClosure* cl, int* processed, int* removed) {
|
||||
possibly_parallel_unlink_or_oops_do(cl, NULL, processed, removed);
|
||||
}
|
||||
static void possibly_parallel_oops_do(OopClosure* f);
|
||||
|
||||
// Internal test.
|
||||
static void test_alt_hash() PRODUCT_RETURN;
|
||||
static void possibly_parallel_unlink(
|
||||
OopStorage::ParState<false /* concurrent */, false /* const*/>* par_state_string,
|
||||
BoolObjectClosure* cl, int* processed, int* removed);
|
||||
static void possibly_parallel_oops_do(
|
||||
OopStorage::ParState<false /* concurrent */, false /* const*/>* par_state_string,
|
||||
OopClosure* f);
|
||||
|
||||
// Probing
|
||||
static oop lookup(Symbol* symbol);
|
||||
@ -138,46 +140,28 @@ public:
|
||||
static oop intern(oop string, TRAPS);
|
||||
static oop intern(const char *utf8_string, TRAPS);
|
||||
|
||||
// Debugging
|
||||
static void verify();
|
||||
static void dump(outputStream* st, bool verbose=false);
|
||||
|
||||
enum VerifyMesgModes {
|
||||
_verify_quietly = 0,
|
||||
_verify_with_mesgs = 1
|
||||
};
|
||||
|
||||
enum VerifyRetTypes {
|
||||
_verify_pass = 0,
|
||||
_verify_fail_continue = 1,
|
||||
_verify_fail_done = 2
|
||||
};
|
||||
|
||||
static VerifyRetTypes compare_entries(int bkt1, int e_cnt1,
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr1,
|
||||
int bkt2, int e_cnt2,
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr2);
|
||||
static VerifyRetTypes verify_entry(int bkt, int e_cnt,
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr,
|
||||
VerifyMesgModes mesg_mode);
|
||||
static int verify_and_compare_entries();
|
||||
// Rehash the string table if it gets out of balance
|
||||
static void rehash_table();
|
||||
static bool needs_rehashing()
|
||||
{ return StringTable::the_table()->_needs_rehashing; }
|
||||
|
||||
// Sharing
|
||||
private:
|
||||
oop lookup_shared(jchar* name, int len, unsigned int hash) NOT_CDS_JAVA_HEAP_RETURN_(NULL);
|
||||
static void copy_shared_string_table(CompactStringTableWriter* ch_table) NOT_CDS_JAVA_HEAP_RETURN;
|
||||
public:
|
||||
static oop create_archived_string(oop s, Thread* THREAD);
|
||||
static void set_shared_string_mapped() { _shared_string_mapped = true; }
|
||||
static bool shared_string_mapped() { return _shared_string_mapped; }
|
||||
static void shared_oops_do(OopClosure* f) NOT_CDS_JAVA_HEAP_RETURN;
|
||||
static bool copy_shared_string(GrowableArray<MemRegion> *string_space,
|
||||
CompactStringTableWriter* ch_table) NOT_CDS_JAVA_HEAP_RETURN_(false);
|
||||
static oop create_archived_string(oop s, Thread* THREAD) NOT_CDS_JAVA_HEAP_RETURN_(NULL);
|
||||
static void write_to_archive(GrowableArray<MemRegion> *string_space) NOT_CDS_JAVA_HEAP_RETURN;
|
||||
static void write_to_archive() NOT_CDS_JAVA_HEAP_RETURN;
|
||||
static void serialize(SerializeClosure* soc) NOT_CDS_JAVA_HEAP_RETURN;
|
||||
|
||||
// Rehash the symbol table if it gets out of balance
|
||||
static void rehash_table();
|
||||
static bool needs_rehashing() { return _needs_rehashing; }
|
||||
|
||||
// Parallel chunked scanning
|
||||
static void clear_parallel_claimed_index() { _parallel_claimed_idx = 0; }
|
||||
static int parallel_claimed_index() { return _parallel_claimed_idx; }
|
||||
// Jcmd
|
||||
static void dump(outputStream* st, bool verbose=false);
|
||||
// Debugging
|
||||
static size_t verify_and_compare_entries();
|
||||
static void verify();
|
||||
};
|
||||
|
||||
#endif // SHARE_VM_CLASSFILE_STRINGTABLE_HPP
|
||||
|
||||
@ -220,13 +220,14 @@ void CMSHeap::cms_process_roots(StrongRootsScope* scope,
|
||||
ScanningOption so,
|
||||
bool only_strong_roots,
|
||||
OopsInGenClosure* root_closure,
|
||||
CLDClosure* cld_closure) {
|
||||
CLDClosure* cld_closure,
|
||||
OopStorage::ParState<false, false>* par_state_string) {
|
||||
MarkingCodeBlobClosure mark_code_closure(root_closure, !CodeBlobToOopClosure::FixRelocations);
|
||||
CLDClosure* weak_cld_closure = only_strong_roots ? NULL : cld_closure;
|
||||
|
||||
process_roots(scope, so, root_closure, cld_closure, weak_cld_closure, &mark_code_closure);
|
||||
if (!only_strong_roots) {
|
||||
process_string_table_roots(scope, root_closure);
|
||||
process_string_table_roots(scope, root_closure, par_state_string);
|
||||
}
|
||||
|
||||
if (young_gen_as_roots &&
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
#include "gc/shared/collectedHeap.hpp"
|
||||
#include "gc/shared/gcCause.hpp"
|
||||
#include "gc/shared/genCollectedHeap.hpp"
|
||||
#include "gc/shared/oopStorageParState.hpp"
|
||||
#include "utilities/growableArray.hpp"
|
||||
|
||||
class CLDClosure;
|
||||
@ -90,7 +91,8 @@ public:
|
||||
ScanningOption so,
|
||||
bool only_strong_roots,
|
||||
OopsInGenClosure* root_closure,
|
||||
CLDClosure* cld_closure);
|
||||
CLDClosure* cld_closure,
|
||||
OopStorage::ParState<false, false>* par_state_string = NULL);
|
||||
|
||||
GCMemoryManager* old_manager() const { return _old_manager; }
|
||||
|
||||
|
||||
@ -54,6 +54,7 @@
|
||||
#include "gc/shared/genCollectedHeap.hpp"
|
||||
#include "gc/shared/genOopClosures.inline.hpp"
|
||||
#include "gc/shared/isGCActiveMark.hpp"
|
||||
#include "gc/shared/oopStorageParState.hpp"
|
||||
#include "gc/shared/referencePolicy.hpp"
|
||||
#include "gc/shared/space.inline.hpp"
|
||||
#include "gc/shared/strongRootsScope.hpp"
|
||||
@ -2769,10 +2770,12 @@ class CMSParMarkTask : public AbstractGangTask {
|
||||
protected:
|
||||
CMSCollector* _collector;
|
||||
uint _n_workers;
|
||||
OopStorage::ParState<false, false> _par_state_string;
|
||||
CMSParMarkTask(const char* name, CMSCollector* collector, uint n_workers) :
|
||||
AbstractGangTask(name),
|
||||
_collector(collector),
|
||||
_n_workers(n_workers) {}
|
||||
_n_workers(n_workers),
|
||||
_par_state_string(StringTable::weak_storage()) {}
|
||||
// Work method in support of parallel rescan ... of young gen spaces
|
||||
void do_young_space_rescan(OopsInGenClosure* cl,
|
||||
ContiguousSpace* space,
|
||||
@ -4274,7 +4277,9 @@ void CMSParInitialMarkTask::work(uint worker_id) {
|
||||
GenCollectedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
|
||||
_collector->should_unload_classes(),
|
||||
&par_mri_cl,
|
||||
&cld_closure);
|
||||
&cld_closure,
|
||||
&_par_state_string);
|
||||
|
||||
assert(_collector->should_unload_classes()
|
||||
|| (_collector->CMSCollector::roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache),
|
||||
"if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops");
|
||||
@ -4403,7 +4408,8 @@ void CMSParRemarkTask::work(uint worker_id) {
|
||||
GenCollectedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
|
||||
_collector->should_unload_classes(),
|
||||
&par_mrias_cl,
|
||||
NULL); // The dirty klasses will be handled below
|
||||
NULL, // The dirty klasses will be handled below
|
||||
&_par_state_string);
|
||||
|
||||
assert(_collector->should_unload_classes()
|
||||
|| (_collector->CMSCollector::roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache),
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "classfile/stringTable.hpp"
|
||||
#include "gc/cms/cmsHeap.inline.hpp"
|
||||
#include "gc/cms/compactibleFreeListSpace.hpp"
|
||||
#include "gc/cms/concurrentMarkSweepGeneration.hpp"
|
||||
@ -589,7 +590,8 @@ ParNewGenTask::ParNewGenTask(ParNewGeneration* young_gen,
|
||||
_young_gen(young_gen), _old_gen(old_gen),
|
||||
_young_old_boundary(young_old_boundary),
|
||||
_state_set(state_set),
|
||||
_strong_roots_scope(strong_roots_scope)
|
||||
_strong_roots_scope(strong_roots_scope),
|
||||
_par_state_string(StringTable::weak_storage())
|
||||
{}
|
||||
|
||||
void ParNewGenTask::work(uint worker_id) {
|
||||
@ -611,7 +613,8 @@ void ParNewGenTask::work(uint worker_id) {
|
||||
heap->young_process_roots(_strong_roots_scope,
|
||||
&par_scan_state.to_space_root_closure(),
|
||||
&par_scan_state.older_gen_closure(),
|
||||
&cld_scan_closure);
|
||||
&cld_scan_closure,
|
||||
&_par_state_string);
|
||||
|
||||
par_scan_state.end_strong_roots();
|
||||
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
#include "gc/serial/defNewGeneration.hpp"
|
||||
#include "gc/shared/copyFailedInfo.hpp"
|
||||
#include "gc/shared/gcTrace.hpp"
|
||||
#include "gc/shared/oopStorageParState.hpp"
|
||||
#include "gc/shared/plab.hpp"
|
||||
#include "gc/shared/preservedMarks.hpp"
|
||||
#include "gc/shared/taskqueue.hpp"
|
||||
@ -236,6 +237,7 @@ class ParNewGenTask: public AbstractGangTask {
|
||||
HeapWord* _young_old_boundary;
|
||||
class ParScanThreadStateSet* _state_set;
|
||||
StrongRootsScope* _strong_roots_scope;
|
||||
OopStorage::ParState<false, false> _par_state_string;
|
||||
|
||||
public:
|
||||
ParNewGenTask(ParNewGeneration* young_gen,
|
||||
|
||||
@ -147,7 +147,7 @@ void CollectionSetChooser::sort_regions() {
|
||||
void CollectionSetChooser::add_region(HeapRegion* hr) {
|
||||
assert(!hr->is_pinned(),
|
||||
"Pinned region shouldn't be added to the collection set (index %u)", hr->hrm_index());
|
||||
assert(!hr->is_young(), "should not be young!");
|
||||
assert(hr->is_old(), "should be old but is %s", hr->get_type_str());
|
||||
assert(hr->rem_set()->is_complete(),
|
||||
"Trying to add region %u to the collection set with incomplete remembered set", hr->hrm_index());
|
||||
_regions.append(hr);
|
||||
@ -185,7 +185,7 @@ uint CollectionSetChooser::claim_array_chunk(uint chunk_size) {
|
||||
|
||||
void CollectionSetChooser::set_region(uint index, HeapRegion* hr) {
|
||||
assert(regions_at(index) == NULL, "precondition");
|
||||
assert(!hr->is_young(), "should not be young!");
|
||||
assert(hr->is_old(), "should be old but is %s", hr->get_type_str());
|
||||
regions_at_put(index, hr);
|
||||
hr->calc_gc_efficiency();
|
||||
}
|
||||
@ -233,18 +233,19 @@ public:
|
||||
_cset_updater(hrSorted, true /* parallel */, chunk_size) { }
|
||||
|
||||
bool do_heap_region(HeapRegion* r) {
|
||||
// Do we have any marking information for this region?
|
||||
if (r->is_marked()) {
|
||||
// We will skip any region that's currently used as an old GC
|
||||
// alloc region (we should not consider those for collection
|
||||
// before we fill them up).
|
||||
if (_cset_updater.should_add(r) && !_g1h->is_old_gc_alloc_region(r)) {
|
||||
_cset_updater.add_region(r);
|
||||
} else if (r->is_old()) {
|
||||
// Can clean out the remembered sets of all regions that we did not choose but
|
||||
// we created the remembered set for.
|
||||
r->rem_set()->clear(true);
|
||||
}
|
||||
// We will skip any region that's currently used as an old GC
|
||||
// alloc region (we should not consider those for collection
|
||||
// before we fill them up).
|
||||
if (_cset_updater.should_add(r) && !_g1h->is_old_gc_alloc_region(r)) {
|
||||
_cset_updater.add_region(r);
|
||||
} else if (r->is_old()) {
|
||||
// Keep remembered sets for humongous regions, otherwise clean out remembered
|
||||
// sets for old regions.
|
||||
r->rem_set()->clear(true /* only_cardset */);
|
||||
} else {
|
||||
assert(!r->is_old() || !r->rem_set()->is_tracked(),
|
||||
"Missed to clear unused remembered set of region %u (%s) that is %s",
|
||||
r->hrm_index(), r->get_type_str(), r->rem_set()->get_state_str());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -280,11 +281,10 @@ bool CollectionSetChooser::region_occupancy_low_enough_for_evac(size_t live_byte
|
||||
}
|
||||
|
||||
bool CollectionSetChooser::should_add(HeapRegion* hr) const {
|
||||
assert(hr->is_marked(), "pre-condition");
|
||||
assert(!hr->is_young(), "should never consider young regions");
|
||||
return !hr->is_pinned() &&
|
||||
region_occupancy_low_enough_for_evac(hr->live_bytes()) &&
|
||||
hr->rem_set()->is_complete();
|
||||
return !hr->is_young() &&
|
||||
!hr->is_pinned() &&
|
||||
region_occupancy_low_enough_for_evac(hr->live_bytes()) &&
|
||||
hr->rem_set()->is_complete();
|
||||
}
|
||||
|
||||
void CollectionSetChooser::rebuild(WorkGang* workers, uint n_regions) {
|
||||
|
||||
@ -69,6 +69,7 @@
|
||||
#include "gc/shared/gcTraceTime.inline.hpp"
|
||||
#include "gc/shared/generationSpec.hpp"
|
||||
#include "gc/shared/isGCActiveMark.hpp"
|
||||
#include "gc/shared/oopStorageParState.hpp"
|
||||
#include "gc/shared/preservedMarks.inline.hpp"
|
||||
#include "gc/shared/suspendibleThreadSet.hpp"
|
||||
#include "gc/shared/referenceProcessor.inline.hpp"
|
||||
@ -3218,6 +3219,7 @@ class G1StringAndSymbolCleaningTask : public AbstractGangTask {
|
||||
private:
|
||||
BoolObjectClosure* _is_alive;
|
||||
G1StringDedupUnlinkOrOopsDoClosure _dedup_closure;
|
||||
OopStorage::ParState<false /* concurrent */, false /* const */> _par_state_string;
|
||||
|
||||
int _initial_string_table_size;
|
||||
int _initial_symbol_table_size;
|
||||
@ -3237,24 +3239,19 @@ public:
|
||||
AbstractGangTask("String/Symbol Unlinking"),
|
||||
_is_alive(is_alive),
|
||||
_dedup_closure(is_alive, NULL, false),
|
||||
_par_state_string(StringTable::weak_storage()),
|
||||
_process_strings(process_strings), _strings_processed(0), _strings_removed(0),
|
||||
_process_symbols(process_symbols), _symbols_processed(0), _symbols_removed(0),
|
||||
_process_string_dedup(process_string_dedup) {
|
||||
|
||||
_initial_string_table_size = StringTable::the_table()->table_size();
|
||||
_initial_string_table_size = (int) StringTable::the_table()->table_size();
|
||||
_initial_symbol_table_size = SymbolTable::the_table()->table_size();
|
||||
if (process_strings) {
|
||||
StringTable::clear_parallel_claimed_index();
|
||||
}
|
||||
if (process_symbols) {
|
||||
SymbolTable::clear_parallel_claimed_index();
|
||||
}
|
||||
}
|
||||
|
||||
~G1StringAndSymbolCleaningTask() {
|
||||
guarantee(!_process_strings || StringTable::parallel_claimed_index() >= _initial_string_table_size,
|
||||
"claim value %d after unlink less than initial string table size %d",
|
||||
StringTable::parallel_claimed_index(), _initial_string_table_size);
|
||||
guarantee(!_process_symbols || SymbolTable::parallel_claimed_index() >= _initial_symbol_table_size,
|
||||
"claim value %d after unlink less than initial symbol table size %d",
|
||||
SymbolTable::parallel_claimed_index(), _initial_symbol_table_size);
|
||||
@ -3273,7 +3270,7 @@ public:
|
||||
int symbols_processed = 0;
|
||||
int symbols_removed = 0;
|
||||
if (_process_strings) {
|
||||
StringTable::possibly_parallel_unlink(_is_alive, &strings_processed, &strings_removed);
|
||||
StringTable::possibly_parallel_unlink(&_par_state_string, _is_alive, &strings_processed, &strings_removed);
|
||||
Atomic::add(strings_processed, &_strings_processed);
|
||||
Atomic::add(strings_removed, &_strings_removed);
|
||||
}
|
||||
|
||||
@ -1651,7 +1651,11 @@ void G1ConcurrentMark::weak_refs_work(bool clear_all_soft_refs) {
|
||||
}
|
||||
|
||||
if (has_overflown()) {
|
||||
// We can not trust g1_is_alive if the marking stack overflowed
|
||||
// We can not trust g1_is_alive and the contents of the heap if the marking stack
|
||||
// overflowed while processing references. Exit the VM.
|
||||
fatal("Overflow during reference processing, can not continue. Please "
|
||||
"increase MarkStackSizeMax (current value: " SIZE_FORMAT ") and "
|
||||
"restart.", MarkStackSizeMax);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -468,15 +468,24 @@ G1EvacPhaseWithTrimTimeTracker::G1EvacPhaseWithTrimTimeTracker(G1ParScanThreadSt
|
||||
_pss(pss),
|
||||
_start(Ticks::now()),
|
||||
_total_time(total_time),
|
||||
_trim_time(trim_time) {
|
||||
_trim_time(trim_time),
|
||||
_stopped(false) {
|
||||
|
||||
assert(_pss->trim_ticks().value() == 0, "Possibly remaining trim ticks left over from previous use");
|
||||
}
|
||||
|
||||
G1EvacPhaseWithTrimTimeTracker::~G1EvacPhaseWithTrimTimeTracker() {
|
||||
if (!_stopped) {
|
||||
stop();
|
||||
}
|
||||
}
|
||||
|
||||
void G1EvacPhaseWithTrimTimeTracker::stop() {
|
||||
assert(!_stopped, "Should only be called once");
|
||||
_total_time += (Ticks::now() - _start) - _pss->trim_ticks();
|
||||
_trim_time += _pss->trim_ticks();
|
||||
_pss->reset_trim_ticks();
|
||||
_stopped = true;
|
||||
}
|
||||
|
||||
G1GCParPhaseTimesTracker::G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id) :
|
||||
@ -504,6 +513,8 @@ G1EvacPhaseTimesTracker::G1EvacPhaseTimesTracker(G1GCPhaseTimes* phase_times,
|
||||
|
||||
G1EvacPhaseTimesTracker::~G1EvacPhaseTimesTracker() {
|
||||
if (_phase_times != NULL) {
|
||||
// Explicitly stop the trim tracker since it's not yet destructed.
|
||||
_trim_tracker.stop();
|
||||
// Exclude trim time by increasing the start time.
|
||||
_start_time += _trim_time;
|
||||
_phase_times->record_or_add_objcopy_time_secs(_worker_id, _trim_time.seconds());
|
||||
|
||||
@ -373,9 +373,13 @@ class G1EvacPhaseWithTrimTimeTracker : public StackObj {
|
||||
|
||||
Tickspan& _total_time;
|
||||
Tickspan& _trim_time;
|
||||
|
||||
bool _stopped;
|
||||
public:
|
||||
G1EvacPhaseWithTrimTimeTracker(G1ParScanThreadState* pss, Tickspan& total_time, Tickspan& trim_time);
|
||||
~G1EvacPhaseWithTrimTimeTracker();
|
||||
|
||||
void stop();
|
||||
};
|
||||
|
||||
class G1GCParPhaseTimesTracker : public CHeapObj<mtGC> {
|
||||
|
||||
@ -825,10 +825,10 @@ double G1Policy::predict_base_elapsed_time_ms(size_t pending_cards) const {
|
||||
|
||||
size_t G1Policy::predict_bytes_to_copy(HeapRegion* hr) const {
|
||||
size_t bytes_to_copy;
|
||||
if (hr->is_marked())
|
||||
if (!hr->is_young()) {
|
||||
bytes_to_copy = hr->max_live_bytes();
|
||||
else {
|
||||
assert(hr->is_young() && hr->age_in_surv_rate_group() != -1, "invariant");
|
||||
} else {
|
||||
assert(hr->age_in_surv_rate_group() != -1, "invariant");
|
||||
int age = hr->age_in_surv_rate_group();
|
||||
double yg_surv_rate = predict_yg_surv_rate(age, hr->surv_rate_group());
|
||||
bytes_to_copy = (size_t) (hr->used() * yg_surv_rate);
|
||||
|
||||
@ -38,6 +38,7 @@
|
||||
#include "gc/g1/g1RootClosures.hpp"
|
||||
#include "gc/g1/g1RootProcessor.hpp"
|
||||
#include "gc/g1/heapRegion.inline.hpp"
|
||||
#include "gc/shared/oopStorageParState.hpp"
|
||||
#include "gc/shared/referenceProcessor.hpp"
|
||||
#include "gc/shared/weakProcessor.hpp"
|
||||
#include "memory/allocation.inline.hpp"
|
||||
@ -72,6 +73,7 @@ G1RootProcessor::G1RootProcessor(G1CollectedHeap* g1h, uint n_workers) :
|
||||
_process_strong_tasks(G1RP_PS_NumElements),
|
||||
_srs(n_workers),
|
||||
_lock(Mutex::leaf, "G1 Root Scanning barrier lock", false, Monitor::_safepoint_check_never),
|
||||
_par_state_string(StringTable::weak_storage()),
|
||||
_n_workers_discovered_strong_classes(0) {}
|
||||
|
||||
void G1RootProcessor::evacuate_roots(G1ParScanThreadState* pss, uint worker_i) {
|
||||
@ -301,7 +303,7 @@ void G1RootProcessor::process_string_table_roots(G1RootClosures* closures,
|
||||
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::StringTableRoots, worker_i);
|
||||
// All threads execute the following. A specific chunk of buckets
|
||||
// from the StringTable are the individual tasks.
|
||||
StringTable::possibly_parallel_oops_do(closures->weak_oops());
|
||||
StringTable::possibly_parallel_oops_do(&_par_state_string, closures->weak_oops());
|
||||
}
|
||||
|
||||
void G1RootProcessor::process_code_cache_roots(CodeBlobClosure* code_closure,
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
#ifndef SHARE_VM_GC_G1_G1ROOTPROCESSOR_HPP
|
||||
#define SHARE_VM_GC_G1_G1ROOTPROCESSOR_HPP
|
||||
|
||||
#include "gc/shared/oopStorageParState.hpp"
|
||||
#include "gc/shared/strongRootsScope.hpp"
|
||||
#include "memory/allocation.hpp"
|
||||
#include "runtime/mutex.hpp"
|
||||
@ -49,6 +50,7 @@ class G1RootProcessor : public StackObj {
|
||||
G1CollectedHeap* _g1h;
|
||||
SubTasksDone _process_strong_tasks;
|
||||
StrongRootsScope _srs;
|
||||
OopStorage::ParState<false, false> _par_state_string;
|
||||
|
||||
// Used to implement the Thread work barrier.
|
||||
Monitor _lock;
|
||||
|
||||
@ -108,9 +108,6 @@
|
||||
"When expanding, % of uncommitted space to claim.") \
|
||||
range(0, 100) \
|
||||
\
|
||||
develop(bool, G1RSBarrierRegionFilter, true, \
|
||||
"If true, generate region filtering code in RS barrier") \
|
||||
\
|
||||
product(size_t, G1UpdateBufferSize, 256, \
|
||||
"Size of an update buffer") \
|
||||
range(1, NOT_LP64(32*M) LP64_ONLY(1*G)) \
|
||||
|
||||
@ -541,10 +541,6 @@ class HeapRegion: public G1ContiguousSpace {
|
||||
// objects during evac failure handling.
|
||||
void note_self_forwarding_removal_end(size_t marked_bytes);
|
||||
|
||||
// Returns "false" iff no object in the region was allocated when the
|
||||
// last mark phase ended.
|
||||
bool is_marked() { return _prev_top_at_mark_start != bottom(); }
|
||||
|
||||
void reset_during_compaction() {
|
||||
assert(is_humongous(),
|
||||
"should only be called for humongous regions");
|
||||
|
||||
@ -373,7 +373,8 @@ HeapWord* CollectedHeap::obj_allocate_raw(Klass* klass, size_t size,
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return Universe::heap()->mem_allocate(size, gc_overhead_limit_was_exceeded);
|
||||
|
||||
return allocate_outside_tlab(klass, size, gc_overhead_limit_was_exceeded, THREAD);
|
||||
}
|
||||
|
||||
HeapWord* CollectedHeap::allocate_from_tlab_slow(Klass* klass, size_t size, TRAPS) {
|
||||
|
||||
@ -144,6 +144,9 @@ class CollectedHeap : public CHeapObj<mtInternal> {
|
||||
inline static HeapWord* allocate_from_tlab(Klass* klass, size_t size, TRAPS);
|
||||
static HeapWord* allocate_from_tlab_slow(Klass* klass, size_t size, TRAPS);
|
||||
|
||||
inline static HeapWord* allocate_outside_tlab(Klass* klass, size_t size,
|
||||
bool* gc_overhead_limit_was_exceeded, TRAPS);
|
||||
|
||||
// Raw memory allocation facilities
|
||||
// The obj and array allocate methods are covers for these methods.
|
||||
// mem_allocate() should never be
|
||||
|
||||
@ -142,14 +142,6 @@ HeapWord* CollectedHeap::common_mem_allocate_noinit(Klass* klass, size_t size, T
|
||||
HeapWord* result = heap->obj_allocate_raw(klass, size, &gc_overhead_limit_was_exceeded, THREAD);
|
||||
|
||||
if (result != NULL) {
|
||||
NOT_PRODUCT(Universe::heap()->
|
||||
check_for_non_bad_heap_word_value(result, size));
|
||||
assert(!HAS_PENDING_EXCEPTION,
|
||||
"Unexpected exception, will result in uninitialized storage");
|
||||
THREAD->incr_allocated_bytes(size * HeapWordSize);
|
||||
|
||||
AllocTracer::send_allocation_outside_tlab(klass, result, size * HeapWordSize, THREAD);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -198,6 +190,22 @@ HeapWord* CollectedHeap::allocate_from_tlab(Klass* klass, size_t size, TRAPS) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
HeapWord* CollectedHeap::allocate_outside_tlab(Klass* klass, size_t size,
|
||||
bool* gc_overhead_limit_was_exceeded, TRAPS) {
|
||||
HeapWord* result = Universe::heap()->mem_allocate(size, gc_overhead_limit_was_exceeded);
|
||||
if (result == NULL) {
|
||||
return result;
|
||||
}
|
||||
|
||||
NOT_PRODUCT(Universe::heap()->check_for_non_bad_heap_word_value(result, size));
|
||||
assert(!HAS_PENDING_EXCEPTION,
|
||||
"Unexpected exception, will result in uninitialized storage");
|
||||
THREAD->incr_allocated_bytes(size * HeapWordSize);
|
||||
|
||||
AllocTracer::send_allocation_outside_tlab(klass, result, size * HeapWordSize, THREAD);
|
||||
return result;
|
||||
}
|
||||
|
||||
void CollectedHeap::init_obj(HeapWord* obj, size_t size) {
|
||||
assert(obj != NULL, "cannot initialize NULL object");
|
||||
const size_t hs = oopDesc::header_size();
|
||||
|
||||
@ -44,6 +44,7 @@
|
||||
#include "gc/shared/genCollectedHeap.hpp"
|
||||
#include "gc/shared/genOopClosures.inline.hpp"
|
||||
#include "gc/shared/generationSpec.hpp"
|
||||
#include "gc/shared/oopStorageParState.inline.hpp"
|
||||
#include "gc/shared/space.hpp"
|
||||
#include "gc/shared/strongRootsScope.hpp"
|
||||
#include "gc/shared/vmGCOperations.hpp"
|
||||
@ -851,12 +852,17 @@ void GenCollectedHeap::process_roots(StrongRootsScope* scope,
|
||||
}
|
||||
|
||||
void GenCollectedHeap::process_string_table_roots(StrongRootsScope* scope,
|
||||
OopClosure* root_closure) {
|
||||
OopClosure* root_closure,
|
||||
OopStorage::ParState<false, false>* par_state_string) {
|
||||
assert(root_closure != NULL, "Must be set");
|
||||
// All threads execute the following. A specific chunk of buckets
|
||||
// from the StringTable are the individual tasks.
|
||||
|
||||
// Either we should be single threaded or have a ParState
|
||||
assert((scope->n_threads() <= 1) || par_state_string != NULL, "Parallel but no ParState");
|
||||
|
||||
if (scope->n_threads() > 1) {
|
||||
StringTable::possibly_parallel_oops_do(root_closure);
|
||||
StringTable::possibly_parallel_oops_do(par_state_string, root_closure);
|
||||
} else {
|
||||
StringTable::oops_do(root_closure);
|
||||
}
|
||||
@ -865,12 +871,13 @@ void GenCollectedHeap::process_string_table_roots(StrongRootsScope* scope,
|
||||
void GenCollectedHeap::young_process_roots(StrongRootsScope* scope,
|
||||
OopsInGenClosure* root_closure,
|
||||
OopsInGenClosure* old_gen_closure,
|
||||
CLDClosure* cld_closure) {
|
||||
CLDClosure* cld_closure,
|
||||
OopStorage::ParState<false, false>* par_state_string) {
|
||||
MarkingCodeBlobClosure mark_code_closure(root_closure, CodeBlobToOopClosure::FixRelocations);
|
||||
|
||||
process_roots(scope, SO_ScavengeCodeCache, root_closure,
|
||||
cld_closure, cld_closure, &mark_code_closure);
|
||||
process_string_table_roots(scope, root_closure);
|
||||
process_string_table_roots(scope, root_closure, par_state_string);
|
||||
|
||||
if (!_process_strong_tasks->is_task_claimed(GCH_PS_younger_gens)) {
|
||||
root_closure->reset_generation();
|
||||
@ -890,7 +897,8 @@ void GenCollectedHeap::full_process_roots(StrongRootsScope* scope,
|
||||
ScanningOption so,
|
||||
bool only_strong_roots,
|
||||
OopsInGenClosure* root_closure,
|
||||
CLDClosure* cld_closure) {
|
||||
CLDClosure* cld_closure,
|
||||
OopStorage::ParState<false, false>* par_state_string) {
|
||||
MarkingCodeBlobClosure mark_code_closure(root_closure, is_adjust_phase);
|
||||
CLDClosure* weak_cld_closure = only_strong_roots ? NULL : cld_closure;
|
||||
|
||||
@ -899,7 +907,7 @@ void GenCollectedHeap::full_process_roots(StrongRootsScope* scope,
|
||||
// We never treat the string table as roots during marking
|
||||
// for the full gc, so we only need to process it during
|
||||
// the adjust phase.
|
||||
process_string_table_roots(scope, root_closure);
|
||||
process_string_table_roots(scope, root_closure, par_state_string);
|
||||
}
|
||||
|
||||
_process_strong_tasks->all_tasks_completed(scope->n_threads());
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
#include "gc/shared/collectedHeap.hpp"
|
||||
#include "gc/shared/collectorPolicy.hpp"
|
||||
#include "gc/shared/generation.hpp"
|
||||
#include "gc/shared/oopStorageParState.hpp"
|
||||
#include "gc/shared/softRefGenPolicy.hpp"
|
||||
|
||||
class AdaptiveSizePolicy;
|
||||
@ -401,7 +402,8 @@ public:
|
||||
CodeBlobToOopClosure* code_roots);
|
||||
|
||||
void process_string_table_roots(StrongRootsScope* scope,
|
||||
OopClosure* root_closure);
|
||||
OopClosure* root_closure,
|
||||
OopStorage::ParState<false, false>* par_state_string);
|
||||
|
||||
// Accessor for memory state verification support
|
||||
NOT_PRODUCT(
|
||||
@ -415,14 +417,16 @@ public:
|
||||
void young_process_roots(StrongRootsScope* scope,
|
||||
OopsInGenClosure* root_closure,
|
||||
OopsInGenClosure* old_gen_closure,
|
||||
CLDClosure* cld_closure);
|
||||
CLDClosure* cld_closure,
|
||||
OopStorage::ParState<false, false>* par_state_string = NULL);
|
||||
|
||||
void full_process_roots(StrongRootsScope* scope,
|
||||
bool is_adjust_phase,
|
||||
ScanningOption so,
|
||||
bool only_strong_roots,
|
||||
OopsInGenClosure* root_closure,
|
||||
CLDClosure* cld_closure);
|
||||
CLDClosure* cld_closure,
|
||||
OopStorage::ParState<false, false>* par_state_string = NULL);
|
||||
|
||||
// Apply "root_closure" to all the weak roots of the system.
|
||||
// These include JNI weak roots, string table,
|
||||
|
||||
@ -38,8 +38,6 @@ MarkScope::~MarkScope() {
|
||||
|
||||
StrongRootsScope::StrongRootsScope(uint n_threads) : _n_threads(n_threads) {
|
||||
Threads::change_thread_claim_parity();
|
||||
// Zero the claimed high water mark in the StringTable
|
||||
StringTable::clear_parallel_claimed_index();
|
||||
}
|
||||
|
||||
StrongRootsScope::~StrongRootsScope() {
|
||||
|
||||
@ -1841,7 +1841,7 @@ void MetaspaceShared::dump_closed_archive_heap_objects(
|
||||
G1CollectedHeap::heap()->begin_archive_alloc_range();
|
||||
|
||||
// Archive interned string objects
|
||||
StringTable::write_to_archive(closed_archive);
|
||||
StringTable::write_to_archive();
|
||||
|
||||
G1CollectedHeap::heap()->end_archive_alloc_range(closed_archive,
|
||||
os::vm_allocation_granularity());
|
||||
|
||||
@ -247,14 +247,14 @@ RawAccessBarrier<ds>::atomic_cmpxchg_maybe_locked(T new_value, void* addr, T com
|
||||
}
|
||||
|
||||
class RawAccessBarrierArrayCopy: public AllStatic {
|
||||
template<typename T> struct IsHeapWordSized: public IntegralConstant<bool, sizeof(T) == HeapWordSize> { };
|
||||
public:
|
||||
template <DecoratorSet decorators, typename T>
|
||||
static inline typename EnableIf<
|
||||
HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value>::type
|
||||
HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value>::type
|
||||
arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
|
||||
arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
|
||||
size_t length) {
|
||||
|
||||
src_raw = arrayOopDesc::obj_offset_to_raw(src_obj, src_offset_in_bytes, src_raw);
|
||||
dst_raw = arrayOopDesc::obj_offset_to_raw(dst_obj, dst_offset_in_bytes, dst_raw);
|
||||
|
||||
@ -270,48 +270,68 @@ public:
|
||||
|
||||
template <DecoratorSet decorators, typename T>
|
||||
static inline typename EnableIf<
|
||||
!HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value>::type
|
||||
arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, const T* src_raw, arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw, size_t length) {
|
||||
|
||||
!HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value &&
|
||||
HasDecorator<decorators, ARRAYCOPY_ARRAYOF>::value>::type
|
||||
arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
|
||||
arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
|
||||
size_t length) {
|
||||
src_raw = arrayOopDesc::obj_offset_to_raw(src_obj, src_offset_in_bytes, src_raw);
|
||||
dst_raw = arrayOopDesc::obj_offset_to_raw(dst_obj, dst_offset_in_bytes, dst_raw);
|
||||
|
||||
if (HasDecorator<decorators, ARRAYCOPY_ARRAYOF>::value) {
|
||||
AccessInternal::arraycopy_arrayof_conjoint(const_cast<T*>(src_raw), dst_raw, length);
|
||||
} else if (HasDecorator<decorators, ARRAYCOPY_DISJOINT>::value && sizeof(T) == HeapWordSize) {
|
||||
// There is only a disjoint optimization for word granularity copying
|
||||
if (HasDecorator<decorators, ARRAYCOPY_ATOMIC>::value) {
|
||||
AccessInternal::arraycopy_disjoint_words_atomic(const_cast<T*>(src_raw), dst_raw, length);
|
||||
} else {
|
||||
AccessInternal::arraycopy_disjoint_words(const_cast<T*>(src_raw), dst_raw, length);
|
||||
}
|
||||
AccessInternal::arraycopy_arrayof_conjoint(src_raw, dst_raw, length);
|
||||
}
|
||||
|
||||
template <DecoratorSet decorators, typename T>
|
||||
static inline typename EnableIf<
|
||||
!HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value &&
|
||||
HasDecorator<decorators, ARRAYCOPY_DISJOINT>::value && IsHeapWordSized<T>::value>::type
|
||||
arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
|
||||
arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
|
||||
size_t length) {
|
||||
src_raw = arrayOopDesc::obj_offset_to_raw(src_obj, src_offset_in_bytes, src_raw);
|
||||
dst_raw = arrayOopDesc::obj_offset_to_raw(dst_obj, dst_offset_in_bytes, dst_raw);
|
||||
|
||||
// There is only a disjoint optimization for word granularity copying
|
||||
if (HasDecorator<decorators, ARRAYCOPY_ATOMIC>::value) {
|
||||
AccessInternal::arraycopy_disjoint_words_atomic(src_raw, dst_raw, length);
|
||||
} else {
|
||||
if (HasDecorator<decorators, ARRAYCOPY_ATOMIC>::value) {
|
||||
AccessInternal::arraycopy_conjoint_atomic(const_cast<T*>(src_raw), dst_raw, length);
|
||||
} else {
|
||||
AccessInternal::arraycopy_conjoint(const_cast<T*>(src_raw), dst_raw, length);
|
||||
}
|
||||
AccessInternal::arraycopy_disjoint_words(src_raw, dst_raw, length);
|
||||
}
|
||||
}
|
||||
|
||||
template <DecoratorSet decorators>
|
||||
template <DecoratorSet decorators, typename T>
|
||||
static inline typename EnableIf<
|
||||
!HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value>::type
|
||||
arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, const void* src_raw,
|
||||
arrayOop dst_obj, size_t dst_offset_in_bytes, void* dst_raw,
|
||||
!HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value &&
|
||||
!(HasDecorator<decorators, ARRAYCOPY_DISJOINT>::value && IsHeapWordSized<T>::value) &&
|
||||
!HasDecorator<decorators, ARRAYCOPY_ARRAYOF>::value &&
|
||||
!HasDecorator<decorators, ARRAYCOPY_ATOMIC>::value>::type
|
||||
arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
|
||||
arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
|
||||
size_t length) {
|
||||
|
||||
src_raw = arrayOopDesc::obj_offset_to_raw(src_obj, src_offset_in_bytes, src_raw);
|
||||
dst_raw = arrayOopDesc::obj_offset_to_raw(dst_obj, dst_offset_in_bytes, dst_raw);
|
||||
|
||||
if (HasDecorator<decorators, ARRAYCOPY_ATOMIC>::value) {
|
||||
AccessInternal::arraycopy_conjoint_atomic(const_cast<void*>(src_raw), dst_raw, length);
|
||||
} else {
|
||||
AccessInternal::arraycopy_conjoint(const_cast<void*>(src_raw), dst_raw, length);
|
||||
}
|
||||
AccessInternal::arraycopy_conjoint(src_raw, dst_raw, length);
|
||||
}
|
||||
|
||||
template <DecoratorSet decorators, typename T>
|
||||
static inline typename EnableIf<
|
||||
!HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value &&
|
||||
!(HasDecorator<decorators, ARRAYCOPY_DISJOINT>::value && IsHeapWordSized<T>::value) &&
|
||||
!HasDecorator<decorators, ARRAYCOPY_ARRAYOF>::value &&
|
||||
HasDecorator<decorators, ARRAYCOPY_ATOMIC>::value>::type
|
||||
arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
|
||||
arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
|
||||
size_t length) {
|
||||
src_raw = arrayOopDesc::obj_offset_to_raw(src_obj, src_offset_in_bytes, src_raw);
|
||||
dst_raw = arrayOopDesc::obj_offset_to_raw(dst_obj, dst_offset_in_bytes, dst_raw);
|
||||
|
||||
AccessInternal::arraycopy_conjoint_atomic(src_raw, dst_raw, length);
|
||||
}
|
||||
};
|
||||
|
||||
template<> struct RawAccessBarrierArrayCopy::IsHeapWordSized<void>: public IntegralConstant<bool, false> { };
|
||||
|
||||
template <DecoratorSet decorators>
|
||||
template <typename T>
|
||||
inline bool RawAccessBarrier<decorators>::arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
|
||||
|
||||
@ -53,13 +53,20 @@ void InstanceRefKlass::do_discovered(oop obj, OopClosureType* closure, Contains&
|
||||
}
|
||||
}
|
||||
|
||||
static inline oop load_referent(oop obj, ReferenceType type) {
|
||||
if (type == REF_PHANTOM) {
|
||||
return HeapAccess<ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE>::oop_load(java_lang_ref_Reference::referent_addr_raw(obj));
|
||||
} else {
|
||||
return HeapAccess<ON_WEAK_OOP_REF | AS_NO_KEEPALIVE>::oop_load(java_lang_ref_Reference::referent_addr_raw(obj));
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T, class OopClosureType>
|
||||
bool InstanceRefKlass::try_discover(oop obj, ReferenceType type, OopClosureType* closure) {
|
||||
ReferenceDiscoverer* rd = closure->ref_discoverer();
|
||||
if (rd != NULL) {
|
||||
T referent_oop = RawAccess<>::oop_load((T*)java_lang_ref_Reference::referent_addr_raw(obj));
|
||||
if (!CompressedOops::is_null(referent_oop)) {
|
||||
oop referent = CompressedOops::decode_not_null(referent_oop);
|
||||
oop referent = load_referent(obj, type);
|
||||
if (referent != NULL) {
|
||||
if (!referent->is_gc_marked()) {
|
||||
// Only try to discover if not yet marked.
|
||||
return rd->discover_reference(obj, type);
|
||||
@ -179,9 +186,9 @@ void InstanceRefKlass::trace_reference_gc(const char *s, oop obj) {
|
||||
|
||||
log_develop_trace(gc, ref)("InstanceRefKlass %s for obj " PTR_FORMAT, s, p2i(obj));
|
||||
log_develop_trace(gc, ref)(" referent_addr/* " PTR_FORMAT " / " PTR_FORMAT,
|
||||
p2i(referent_addr), p2i(referent_addr ? RawAccess<>::oop_load(referent_addr) : (oop)NULL));
|
||||
p2i(referent_addr), p2i((oop)HeapAccess<ON_UNKNOWN_OOP_REF | AS_NO_KEEPALIVE>::oop_load_at(obj, java_lang_ref_Reference::referent_offset)));
|
||||
log_develop_trace(gc, ref)(" discovered_addr/* " PTR_FORMAT " / " PTR_FORMAT,
|
||||
p2i(discovered_addr), p2i(discovered_addr ? RawAccess<>::oop_load(discovered_addr) : (oop)NULL));
|
||||
p2i(discovered_addr), p2i((oop)HeapAccess<AS_NO_KEEPALIVE>::oop_load(discovered_addr)));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
#include "classfile/stringTable.hpp"
|
||||
#include "gc/shared/oopStorage.hpp"
|
||||
#include "oops/access.inline.hpp"
|
||||
#include "oops/oop.hpp"
|
||||
@ -35,6 +36,10 @@ template <> OopStorage* WeakHandle<vm_class_loader_data>::get_storage() {
|
||||
return SystemDictionary::vm_weak_oop_storage();
|
||||
}
|
||||
|
||||
template <> OopStorage* WeakHandle<vm_string_table_data>::get_storage() {
|
||||
return StringTable::weak_storage();
|
||||
}
|
||||
|
||||
template <WeakHandleType T>
|
||||
WeakHandle<T> WeakHandle<T>::create(Handle obj) {
|
||||
assert(obj() != NULL, "no need to create weak null oop");
|
||||
@ -68,4 +73,5 @@ void WeakHandle<T>::print_on(outputStream* st) const {
|
||||
|
||||
// Provide instantiation.
|
||||
template class WeakHandle<vm_class_loader_data>;
|
||||
template class WeakHandle<vm_string_table_data>;
|
||||
|
||||
|
||||
@ -39,12 +39,11 @@ class OopStorage;
|
||||
// This is the vm version of jweak but has different GC lifetimes and policies,
|
||||
// depending on the type.
|
||||
|
||||
enum WeakHandleType { vm_class_loader_data, vm_string };
|
||||
enum WeakHandleType { vm_class_loader_data, vm_string, vm_string_table_data };
|
||||
|
||||
template <WeakHandleType T>
|
||||
class WeakHandle {
|
||||
public:
|
||||
|
||||
private:
|
||||
oop* _obj;
|
||||
|
||||
@ -59,6 +58,8 @@ class WeakHandle {
|
||||
void release() const;
|
||||
bool is_null() const { return _obj == NULL; }
|
||||
|
||||
void replace(oop with_obj);
|
||||
|
||||
void print() const;
|
||||
void print_on(outputStream* st) const;
|
||||
};
|
||||
|
||||
@ -40,4 +40,10 @@ oop WeakHandle<T>::peek() const {
|
||||
return RootAccess<ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE>::oop_load(_obj);
|
||||
}
|
||||
|
||||
template <WeakHandleType T>
|
||||
void WeakHandle<T>::replace(oop with_obj) {
|
||||
RootAccess<ON_PHANTOM_OOP_REF>::oop_store(_obj, with_obj);
|
||||
}
|
||||
|
||||
#endif // SHARE_VM_OOPS_WEAKHANDLE_INLINE_HPP
|
||||
|
||||
|
||||
@ -53,6 +53,9 @@
|
||||
diagnostic(bool, StressGCM, false, \
|
||||
"Randomize instruction scheduling in GCM") \
|
||||
\
|
||||
develop(bool, StressMethodHandleLinkerInlining, false, \
|
||||
"Stress inlining through method handle linkers") \
|
||||
\
|
||||
develop(intx, OptoPrologueNops, 0, \
|
||||
"Insert this many extra nop instructions " \
|
||||
"in the prologue of every nmethod") \
|
||||
|
||||
@ -932,7 +932,7 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod*
|
||||
speculative_receiver_type = (receiver_type != NULL) ? receiver_type->speculative_type() : NULL;
|
||||
}
|
||||
CallGenerator* cg = C->call_generator(target, vtable_index, call_does_dispatch, jvms,
|
||||
true /* allow_inline */,
|
||||
!StressMethodHandleLinkerInlining /* allow_inline */,
|
||||
PROB_ALWAYS,
|
||||
speculative_receiver_type);
|
||||
return cg;
|
||||
|
||||
@ -2641,6 +2641,9 @@ void PhaseIdealLoop::build_and_optimize(bool do_split_ifs, bool skip_loop_opts)
|
||||
int old_progress = C->major_progress();
|
||||
uint orig_worklist_size = _igvn._worklist.size();
|
||||
|
||||
// Reset major-progress flag for the driver's heuristics
|
||||
C->clear_major_progress();
|
||||
|
||||
#ifndef PRODUCT
|
||||
// Capture for later assert
|
||||
uint unique = C->unique();
|
||||
@ -2711,16 +2714,11 @@ void PhaseIdealLoop::build_and_optimize(bool do_split_ifs, bool skip_loop_opts)
|
||||
if( !_verify_me && !_verify_only && _ltree_root->_child ) {
|
||||
C->print_method(PHASE_BEFORE_BEAUTIFY_LOOPS, 3);
|
||||
if( _ltree_root->_child->beautify_loops( this ) ) {
|
||||
// IdealLoopTree::split_outer_loop may produce phi-nodes with a single in edge.
|
||||
// Transform them away.
|
||||
_igvn.optimize();
|
||||
|
||||
// Re-build loop tree!
|
||||
_ltree_root->_child = NULL;
|
||||
_nodes.clear();
|
||||
reallocate_preorders();
|
||||
build_loop_tree();
|
||||
|
||||
// Check for bailout, and return
|
||||
if (C->failing()) {
|
||||
return;
|
||||
@ -2732,9 +2730,6 @@ void PhaseIdealLoop::build_and_optimize(bool do_split_ifs, bool skip_loop_opts)
|
||||
}
|
||||
}
|
||||
|
||||
// Reset major-progress flag for the driver's heuristics
|
||||
C->clear_major_progress();
|
||||
|
||||
// Build Dominators for elision of NULL checks & loop finding.
|
||||
// Since nodes do not have a slot for immediate dominator, make
|
||||
// a persistent side array for that info indexed on node->_idx.
|
||||
|
||||
@ -1115,7 +1115,7 @@ JVM_ENTRY(jobjectArray, JVM_GetClassSigners(JNIEnv *env, jclass cls))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
objArrayOop signers = java_lang_Class::signers(JNIHandles::resolve_non_null(cls));
|
||||
objArrayHandle signers(THREAD, java_lang_Class::signers(JNIHandles::resolve_non_null(cls)));
|
||||
|
||||
// If there are no signers set in the class, or if the class
|
||||
// is an array, return NULL.
|
||||
|
||||
@ -4447,6 +4447,18 @@ void Arguments::PropertyList_unique_add(SystemProperty** plist, const char* k, c
|
||||
PropertyList_add(plist, k, v, writeable == WriteableProperty, internal == InternalProperty);
|
||||
}
|
||||
|
||||
// Update existing property with new value.
|
||||
void Arguments::PropertyList_update_value(SystemProperty* plist, const char* k, const char* v) {
|
||||
SystemProperty* prop;
|
||||
for (prop = plist; prop != NULL; prop = prop->next()) {
|
||||
if (strcmp(k, prop->key()) == 0) {
|
||||
prop->set_value(v);
|
||||
return;
|
||||
}
|
||||
}
|
||||
assert(false, "invalid property");
|
||||
}
|
||||
|
||||
// Copies src into buf, replacing "%%" with "%" and "%p" with pid
|
||||
// Returns true if all of the source pointed by src has been copied over to
|
||||
// the destination buffer pointed by buf. Otherwise, returns false.
|
||||
|
||||
@ -651,6 +651,7 @@ class Arguments : AllStatic {
|
||||
static void PropertyList_unique_add(SystemProperty** plist, const char* k, const char* v,
|
||||
PropertyAppendable append, PropertyWriteable writeable,
|
||||
PropertyInternal internal);
|
||||
static void PropertyList_update_value(SystemProperty* plist, const char* k, const char* v);
|
||||
static const char* PropertyList_get_value(SystemProperty* plist, const char* key);
|
||||
static const char* PropertyList_get_readable_value(SystemProperty* plist, const char* key);
|
||||
static int PropertyList_count(SystemProperty* pl);
|
||||
|
||||
@ -2542,8 +2542,9 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G);
|
||||
"Relax the access control checks in the verifier") \
|
||||
\
|
||||
product(uintx, StringTableSize, defaultStringTableSize, \
|
||||
"Number of buckets in the interned String table") \
|
||||
range(minimumStringTableSize, 111*defaultStringTableSize) \
|
||||
"Number of buckets in the interned String table " \
|
||||
"(will be rounded to nearest higher power of 2)") \
|
||||
range(minimumStringTableSize, 16777216ul) \
|
||||
\
|
||||
experimental(uintx, SymbolTableSize, defaultSymbolTableSize, \
|
||||
"Number of buckets in the JVM internal Symbol table") \
|
||||
|
||||
@ -524,14 +524,9 @@ void before_exit(JavaThread* thread) {
|
||||
}
|
||||
|
||||
if (VerifyStringTableAtExit) {
|
||||
int fail_cnt = 0;
|
||||
{
|
||||
MutexLocker ml(StringTable_lock);
|
||||
fail_cnt = StringTable::verify_and_compare_entries();
|
||||
}
|
||||
|
||||
size_t fail_cnt = StringTable::verify_and_compare_entries();
|
||||
if (fail_cnt != 0) {
|
||||
tty->print_cr("ERROR: fail_cnt=%d", fail_cnt);
|
||||
tty->print_cr("ERROR: fail_cnt=" SIZE_FORMAT, fail_cnt);
|
||||
guarantee(fail_cnt == 0, "unexpected StringTable verification failures");
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,6 +48,8 @@ Mutex* JNIGlobalAlloc_lock = NULL;
|
||||
Mutex* JNIGlobalActive_lock = NULL;
|
||||
Mutex* JNIWeakAlloc_lock = NULL;
|
||||
Mutex* JNIWeakActive_lock = NULL;
|
||||
Mutex* StringTableWeakAlloc_lock = NULL;
|
||||
Mutex* StringTableWeakActive_lock = NULL;
|
||||
Mutex* JNIHandleBlockFreeList_lock = NULL;
|
||||
Mutex* VMWeakAlloc_lock = NULL;
|
||||
Mutex* VMWeakActive_lock = NULL;
|
||||
@ -186,6 +188,9 @@ void mutex_init() {
|
||||
def(VMWeakAlloc_lock , PaddedMutex , vmweak, true, Monitor::_safepoint_check_never);
|
||||
def(VMWeakActive_lock , PaddedMutex , vmweak-1, true, Monitor::_safepoint_check_never);
|
||||
|
||||
def(StringTableWeakAlloc_lock , PaddedMutex , vmweak, true, Monitor::_safepoint_check_never);
|
||||
def(StringTableWeakActive_lock , PaddedMutex , vmweak-1, true, Monitor::_safepoint_check_never);
|
||||
|
||||
if (UseConcMarkSweepGC || UseG1GC) {
|
||||
def(FullGCCount_lock , PaddedMonitor, leaf, true, Monitor::_safepoint_check_never); // in support of ExplicitGCInvokesConcurrent
|
||||
}
|
||||
|
||||
@ -42,6 +42,8 @@ extern Mutex* JNIGlobalAlloc_lock; // JNI global storage allocate
|
||||
extern Mutex* JNIGlobalActive_lock; // JNI global storage active list lock
|
||||
extern Mutex* JNIWeakAlloc_lock; // JNI weak storage allocate list lock
|
||||
extern Mutex* JNIWeakActive_lock; // JNI weak storage active list lock
|
||||
extern Mutex* StringTableWeakAlloc_lock; // StringTable weak storage allocate list lock
|
||||
extern Mutex* StringTableWeakActive_lock; // STringTable weak storage active list lock
|
||||
extern Mutex* JNIHandleBlockFreeList_lock; // a lock on the JNI handle block free list
|
||||
extern Mutex* VMWeakAlloc_lock; // VM Weak Handles storage allocate list lock
|
||||
extern Mutex* VMWeakActive_lock; // VM Weak Handles storage active list lock
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "classfile/stringTable.hpp"
|
||||
#include "runtime/interfaceSupport.inline.hpp"
|
||||
#include "runtime/javaCalls.hpp"
|
||||
#include "runtime/serviceThread.hpp"
|
||||
@ -82,6 +83,7 @@ void ServiceThread::service_thread_entry(JavaThread* jt, TRAPS) {
|
||||
bool has_gc_notification_event = false;
|
||||
bool has_dcmd_notification_event = false;
|
||||
bool acs_notify = false;
|
||||
bool stringtable_work = false;
|
||||
JvmtiDeferredEvent jvmti_event;
|
||||
{
|
||||
// Need state transition ThreadBlockInVM so that this thread
|
||||
@ -98,7 +100,8 @@ void ServiceThread::service_thread_entry(JavaThread* jt, TRAPS) {
|
||||
while (!(sensors_changed = LowMemoryDetector::has_pending_requests()) &&
|
||||
!(has_jvmti_events = JvmtiDeferredEventQueue::has_events()) &&
|
||||
!(has_gc_notification_event = GCNotifier::has_event()) &&
|
||||
!(has_dcmd_notification_event = DCmdFactory::has_pending_jmx_notification())) {
|
||||
!(has_dcmd_notification_event = DCmdFactory::has_pending_jmx_notification()) &&
|
||||
!(stringtable_work = StringTable::has_work())) {
|
||||
// wait until one of the sensors has pending requests, or there is a
|
||||
// pending JVMTI event or JMX GC notification to post
|
||||
Service_lock->wait(Mutex::_no_safepoint_check_flag);
|
||||
@ -109,6 +112,10 @@ void ServiceThread::service_thread_entry(JavaThread* jt, TRAPS) {
|
||||
}
|
||||
}
|
||||
|
||||
if (stringtable_work) {
|
||||
StringTable::do_concurrent_work(jt);
|
||||
}
|
||||
|
||||
if (has_jvmti_events) {
|
||||
jvmti_event.post();
|
||||
}
|
||||
|
||||
@ -1082,6 +1082,7 @@ Handle SharedRuntime::find_callee_info_helper(JavaThread* thread,
|
||||
|
||||
Bytecode_invoke bytecode(caller, bci);
|
||||
int bytecode_index = bytecode.index();
|
||||
bc = bytecode.invoke_code();
|
||||
|
||||
methodHandle attached_method = extract_attached_method(vfst);
|
||||
if (attached_method.not_null()) {
|
||||
@ -1095,6 +1096,11 @@ Handle SharedRuntime::find_callee_info_helper(JavaThread* thread,
|
||||
|
||||
// Adjust invocation mode according to the attached method.
|
||||
switch (bc) {
|
||||
case Bytecodes::_invokevirtual:
|
||||
if (attached_method->method_holder()->is_interface()) {
|
||||
bc = Bytecodes::_invokeinterface;
|
||||
}
|
||||
break;
|
||||
case Bytecodes::_invokeinterface:
|
||||
if (!attached_method->method_holder()->is_interface()) {
|
||||
bc = Bytecodes::_invokevirtual;
|
||||
@ -1110,10 +1116,10 @@ Handle SharedRuntime::find_callee_info_helper(JavaThread* thread,
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
bc = bytecode.invoke_code();
|
||||
}
|
||||
|
||||
assert(bc != Bytecodes::_illegal, "not initialized");
|
||||
|
||||
bool has_receiver = bc != Bytecodes::_invokestatic &&
|
||||
bc != Bytecodes::_invokedynamic &&
|
||||
bc != Bytecodes::_invokehandle;
|
||||
|
||||
@ -1132,6 +1132,9 @@ static void reset_vm_info_property(TRAPS) {
|
||||
ResourceMark rm(THREAD);
|
||||
const char *vm_info = VM_Version::vm_info_string();
|
||||
|
||||
// update the native system property first
|
||||
Arguments::PropertyList_update_value(Arguments::system_properties(), "java.vm.info", vm_info);
|
||||
|
||||
// java.lang.System class
|
||||
Klass* klass = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
|
||||
|
||||
@ -3779,9 +3782,10 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
|
||||
|
||||
initialize_java_lang_classes(main_thread, CHECK_JNI_ERR);
|
||||
|
||||
// We need this for ClassDataSharing - the initial vm.info property is set
|
||||
// with the default value of CDS "sharing" which may be reset through
|
||||
// command line options.
|
||||
// We need this to update the java.vm.info property in case any flags used
|
||||
// to initially define it have been changed. This is needed for both CDS and
|
||||
// AOT, since UseSharedSpaces and UseAOT may be changed after java.vm.info
|
||||
// is initially computed. See Abstract_VM_Version::vm_info_string().
|
||||
reset_vm_info_property(CHECK_JNI_ERR);
|
||||
|
||||
quicken_jni_functions();
|
||||
|
||||
@ -164,7 +164,6 @@ typedef HashtableEntry<intptr_t, mtInternal> IntptrHashtableEntry;
|
||||
typedef Hashtable<intptr_t, mtInternal> IntptrHashtable;
|
||||
typedef Hashtable<Symbol*, mtSymbol> SymbolHashtable;
|
||||
typedef HashtableEntry<Symbol*, mtClass> SymbolHashtableEntry;
|
||||
typedef Hashtable<oop, mtSymbol> StringHashtable;
|
||||
typedef Hashtable<InstanceKlass*, mtClass> KlassHashtable;
|
||||
typedef HashtableEntry<InstanceKlass*, mtClass> KlassHashtableEntry;
|
||||
typedef CompactHashtable<Symbol*, char> SymbolCompactHashTable;
|
||||
@ -476,12 +475,6 @@ typedef PaddedEnd<ObjectMonitor> PaddedObjectMonitor;
|
||||
static_field(SymbolTable, _shared_table, SymbolCompactHashTable) \
|
||||
static_field(RehashableSymbolHashtable, _seed, juint) \
|
||||
\
|
||||
/***************/ \
|
||||
/* StringTable */ \
|
||||
/***************/ \
|
||||
\
|
||||
static_field(StringTable, _the_table, StringTable*) \
|
||||
\
|
||||
/********************/ \
|
||||
/* CompactHashTable */ \
|
||||
/********************/ \
|
||||
@ -1365,7 +1358,6 @@ typedef PaddedEnd<ObjectMonitor> PaddedObjectMonitor;
|
||||
declare_toplevel_type(BasicHashtable<mtSymbol>) \
|
||||
declare_type(RehashableSymbolHashtable, BasicHashtable<mtSymbol>) \
|
||||
declare_type(SymbolTable, SymbolHashtable) \
|
||||
declare_type(StringTable, StringHashtable) \
|
||||
declare_type(Dictionary, KlassHashtable) \
|
||||
declare_toplevel_type(BasicHashtableEntry<mtInternal>) \
|
||||
declare_type(IntptrHashtableEntry, BasicHashtableEntry<mtInternal>) \
|
||||
|
||||
@ -103,6 +103,7 @@
|
||||
template(RotateGCLog) \
|
||||
template(WhiteBoxOperation) \
|
||||
template(ClassLoaderStatsOperation) \
|
||||
template(ClassLoaderHierarchyOperation) \
|
||||
template(DumpHashtable) \
|
||||
template(DumpTouchedMethods) \
|
||||
template(MarkActiveNMethods) \
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "jvm.h"
|
||||
#include "classfile/classLoaderHierarchyDCmd.hpp"
|
||||
#include "classfile/classLoaderStats.hpp"
|
||||
#include "classfile/compactHashtable.hpp"
|
||||
#include "compiler/compileBroker.hpp"
|
||||
@ -101,6 +102,7 @@ void DCmdRegistrant::register_dcmds(){
|
||||
#endif // INCLUDE_JVMTI
|
||||
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpDCmd>(full_export, true, false));
|
||||
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassLoaderStatsDCmd>(full_export, true, false));
|
||||
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassLoaderHierarchyDCmd>(full_export, true, false));
|
||||
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompileQueueDCmd>(full_export, true, false));
|
||||
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeListDCmd>(full_export, true, false));
|
||||
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeCacheDCmd>(full_export, true, false));
|
||||
|
||||
@ -484,6 +484,9 @@ class ConcurrentHashTable : public CHeapObj<F> {
|
||||
void statistics_to(Thread* thread, VALUE_SIZE_FUNC& vs_f, outputStream* st,
|
||||
const char* table_name);
|
||||
|
||||
// Moves all nodes from this table to to_cht
|
||||
bool try_move_nodes_to(Thread* thread, ConcurrentHashTable<VALUE, CONFIG, F>* to_cht);
|
||||
|
||||
// This is a Curiously Recurring Template Pattern (CRPT) interface for the
|
||||
// specialization.
|
||||
struct BaseConfig {
|
||||
|
||||
@ -293,7 +293,7 @@ template <typename VALUE, typename CONFIG, MEMFLAGS F>
|
||||
inline void ConcurrentHashTable<VALUE, CONFIG, F>::
|
||||
write_synchonize_on_visible_epoch(Thread* thread)
|
||||
{
|
||||
assert(_resize_lock->owned_by_self(), "Re-size lock not held");
|
||||
assert(_resize_lock_owner == thread, "Re-size lock not held");
|
||||
OrderAccess::fence(); // Prevent below load from floating up.
|
||||
// If no reader saw this version we can skip write_synchronize.
|
||||
if (OrderAccess::load_acquire(&_invisible_epoch) == thread) {
|
||||
@ -488,7 +488,7 @@ inline void ConcurrentHashTable<VALUE, CONFIG, F>::
|
||||
{
|
||||
// Here we have resize lock so table is SMR safe, and there is no new
|
||||
// table. Can do this in parallel if we want.
|
||||
assert(_resize_lock->owned_by_self(), "Re-size lock not held");
|
||||
assert(_resize_lock_owner == thread, "Re-size lock not held");
|
||||
Node* ndel[BULK_DELETE_LIMIT];
|
||||
InternalTable* table = get_table();
|
||||
assert(start_idx < stop_idx, "Must be");
|
||||
@ -500,9 +500,9 @@ inline void ConcurrentHashTable<VALUE, CONFIG, F>::
|
||||
// own read-side.
|
||||
GlobalCounter::critical_section_begin(thread);
|
||||
for (size_t bucket_it = start_idx; bucket_it < stop_idx; bucket_it++) {
|
||||
Bucket* bucket = _table->get_bucket(bucket_it);
|
||||
Bucket* bucket = table->get_bucket(bucket_it);
|
||||
Bucket* prefetch_bucket = (bucket_it+1) < stop_idx ?
|
||||
_table->get_bucket(bucket_it+1) : NULL;
|
||||
table->get_bucket(bucket_it+1) : NULL;
|
||||
|
||||
if (!HaveDeletables<IsPointer<VALUE>::value, EVALUATE_FUNC>::
|
||||
have_deletable(bucket, eval_f, prefetch_bucket)) {
|
||||
@ -695,17 +695,13 @@ inline bool ConcurrentHashTable<VALUE, CONFIG, F>::
|
||||
if (!try_resize_lock(thread)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
assert(_resize_lock->owned_by_self(), "Re-size lock not held");
|
||||
|
||||
assert(_resize_lock_owner == thread, "Re-size lock not held");
|
||||
if (_table->_log2_size == _log2_start_size ||
|
||||
_table->_log2_size <= log2_size) {
|
||||
unlock_resize_lock(thread);
|
||||
return false;
|
||||
}
|
||||
|
||||
_new_table = new InternalTable(_table->_log2_size - 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -713,8 +709,7 @@ template <typename VALUE, typename CONFIG, MEMFLAGS F>
|
||||
inline void ConcurrentHashTable<VALUE, CONFIG, F>::
|
||||
internal_shrink_epilog(Thread* thread)
|
||||
{
|
||||
assert(_resize_lock->owned_by_self(), "Re-size lock not held");
|
||||
assert(_resize_lock_owner, "Should be locked");
|
||||
assert(_resize_lock_owner == thread, "Re-size lock not held");
|
||||
|
||||
InternalTable* old_table = set_table_from_new();
|
||||
_size_limit_reached = false;
|
||||
@ -771,14 +766,13 @@ inline bool ConcurrentHashTable<VALUE, CONFIG, F>::
|
||||
internal_shrink(Thread* thread, size_t log2_size)
|
||||
{
|
||||
if (!internal_shrink_prolog(thread, log2_size)) {
|
||||
assert(!_resize_lock->owned_by_self(), "Re-size lock held");
|
||||
assert(_resize_lock_owner != thread, "Re-size lock held");
|
||||
return false;
|
||||
}
|
||||
assert(_resize_lock->owned_by_self(), "Re-size lock not held");
|
||||
assert(_resize_lock_owner == thread, "Should be locked by me");
|
||||
internal_shrink_range(thread, 0, _new_table->_size);
|
||||
internal_shrink_epilog(thread);
|
||||
assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
|
||||
assert(_resize_lock_owner != thread, "Re-size lock held");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -815,8 +809,7 @@ template <typename VALUE, typename CONFIG, MEMFLAGS F>
|
||||
inline void ConcurrentHashTable<VALUE, CONFIG, F>::
|
||||
internal_grow_epilog(Thread* thread)
|
||||
{
|
||||
assert(_resize_lock->owned_by_self(), "Re-size lock not held");
|
||||
assert(_resize_lock_owner, "Should be locked");
|
||||
assert(_resize_lock_owner == thread, "Should be locked");
|
||||
|
||||
InternalTable* old_table = set_table_from_new();
|
||||
unlock_resize_lock(thread);
|
||||
@ -835,14 +828,13 @@ inline bool ConcurrentHashTable<VALUE, CONFIG, F>::
|
||||
internal_grow(Thread* thread, size_t log2_size)
|
||||
{
|
||||
if (!internal_grow_prolog(thread, log2_size)) {
|
||||
assert(!_resize_lock->owned_by_self(), "Re-size lock held");
|
||||
assert(_resize_lock_owner != thread, "Re-size lock held");
|
||||
return false;
|
||||
}
|
||||
assert(_resize_lock->owned_by_self(), "Re-size lock not held");
|
||||
assert(_resize_lock_owner == thread, "Should be locked by me");
|
||||
internal_grow_range(thread, 0, _table->_size);
|
||||
internal_grow_epilog(thread);
|
||||
assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
|
||||
assert(_resize_lock_owner != thread, "Re-size lock held");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -955,15 +947,13 @@ template <typename FUNC>
|
||||
inline void ConcurrentHashTable<VALUE, CONFIG, F>::
|
||||
do_scan_locked(Thread* thread, FUNC& scan_f)
|
||||
{
|
||||
assert(_resize_lock->owned_by_self() ||
|
||||
(thread->is_VM_thread() && SafepointSynchronize::is_at_safepoint()),
|
||||
"Re-size lock not held or not VMThread at safepoint");
|
||||
assert(_resize_lock_owner == thread, "Re-size lock not held");
|
||||
// We can do a critical section over the entire loop but that would block
|
||||
// updates for a long time. Instead we choose to block resizes.
|
||||
InternalTable* table = get_table();
|
||||
for (size_t bucket_it = 0; bucket_it < _table->_size; bucket_it++) {
|
||||
for (size_t bucket_it = 0; bucket_it < table->_size; bucket_it++) {
|
||||
ScopedCS cs(thread, this);
|
||||
if (!visit_nodes(_table->get_bucket(bucket_it), scan_f)) {
|
||||
if (!visit_nodes(table->get_bucket(bucket_it), scan_f)) {
|
||||
break; /* ends critical section */
|
||||
}
|
||||
} /* ends critical section */
|
||||
@ -1094,17 +1084,11 @@ template <typename SCAN_FUNC>
|
||||
inline bool ConcurrentHashTable<VALUE, CONFIG, F>::
|
||||
try_scan(Thread* thread, SCAN_FUNC& scan_f)
|
||||
{
|
||||
assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
|
||||
bool vm_and_safepoint = thread->is_VM_thread() &&
|
||||
SafepointSynchronize::is_at_safepoint();
|
||||
if (!vm_and_safepoint && !try_resize_lock(thread)) {
|
||||
if (!try_resize_lock(thread)) {
|
||||
return false;
|
||||
}
|
||||
do_scan_locked(thread, scan_f);
|
||||
if (!vm_and_safepoint) {
|
||||
unlock_resize_lock(thread);
|
||||
}
|
||||
assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
|
||||
unlock_resize_lock(thread);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1113,11 +1097,11 @@ template <typename SCAN_FUNC>
|
||||
inline void ConcurrentHashTable<VALUE, CONFIG, F>::
|
||||
do_scan(Thread* thread, SCAN_FUNC& scan_f)
|
||||
{
|
||||
assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
|
||||
assert(_resize_lock_owner != thread, "Re-size lock held");
|
||||
lock_resize_lock(thread);
|
||||
do_scan_locked(thread, scan_f);
|
||||
unlock_resize_lock(thread);
|
||||
assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
|
||||
assert(_resize_lock_owner != thread, "Re-size lock held");
|
||||
}
|
||||
|
||||
template <typename VALUE, typename CONFIG, MEMFLAGS F>
|
||||
@ -1126,12 +1110,11 @@ inline bool ConcurrentHashTable<VALUE, CONFIG, F>::
|
||||
try_bulk_delete(Thread* thread, EVALUATE_FUNC& eval_f, DELETE_FUNC& del_f)
|
||||
{
|
||||
if (!try_resize_lock(thread)) {
|
||||
assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
|
||||
return false;
|
||||
}
|
||||
do_bulk_delete_locked(thread, eval_f, del_f);
|
||||
unlock_resize_lock(thread);
|
||||
assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
|
||||
assert(_resize_lock_owner != thread, "Re-size lock held");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1140,11 +1123,9 @@ template <typename EVALUATE_FUNC, typename DELETE_FUNC>
|
||||
inline void ConcurrentHashTable<VALUE, CONFIG, F>::
|
||||
bulk_delete(Thread* thread, EVALUATE_FUNC& eval_f, DELETE_FUNC& del_f)
|
||||
{
|
||||
assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
|
||||
lock_resize_lock(thread);
|
||||
do_bulk_delete_locked(thread, eval_f, del_f);
|
||||
unlock_resize_lock(thread);
|
||||
assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
|
||||
}
|
||||
|
||||
template <typename VALUE, typename CONFIG, MEMFLAGS F>
|
||||
@ -1155,17 +1136,16 @@ inline void ConcurrentHashTable<VALUE, CONFIG, F>::
|
||||
{
|
||||
NumberSeq summary;
|
||||
size_t literal_bytes = 0;
|
||||
if ((thread->is_VM_thread() && !SafepointSynchronize::is_at_safepoint()) ||
|
||||
(!thread->is_VM_thread() && !try_resize_lock(thread))) {
|
||||
if (!try_resize_lock(thread)) {
|
||||
st->print_cr("statistics unavailable at this moment");
|
||||
return;
|
||||
}
|
||||
|
||||
InternalTable* table = get_table();
|
||||
for (size_t bucket_it = 0; bucket_it < _table->_size; bucket_it++) {
|
||||
for (size_t bucket_it = 0; bucket_it < table->_size; bucket_it++) {
|
||||
ScopedCS cs(thread, this);
|
||||
size_t count = 0;
|
||||
Bucket* bucket = _table->get_bucket(bucket_it);
|
||||
Bucket* bucket = table->get_bucket(bucket_it);
|
||||
if (bucket->have_redirect() || bucket->is_locked()) {
|
||||
continue;
|
||||
}
|
||||
@ -1208,9 +1188,37 @@ inline void ConcurrentHashTable<VALUE, CONFIG, F>::
|
||||
st->print_cr("Std. dev. of bucket size: %9.3f", summary.sd());
|
||||
st->print_cr("Maximum bucket size : %9" PRIuPTR,
|
||||
(size_t)summary.maximum());
|
||||
if (!thread->is_VM_thread()) {
|
||||
unlock_resize_lock(thread);
|
||||
unlock_resize_lock(thread);
|
||||
}
|
||||
|
||||
template <typename VALUE, typename CONFIG, MEMFLAGS F>
|
||||
inline bool ConcurrentHashTable<VALUE, CONFIG, F>::
|
||||
try_move_nodes_to(Thread* thread, ConcurrentHashTable<VALUE, CONFIG, F>* to_cht)
|
||||
{
|
||||
if (!try_resize_lock(thread)) {
|
||||
return false;
|
||||
}
|
||||
assert(_new_table == NULL, "Must be NULL");
|
||||
for (size_t bucket_it = 0; bucket_it < _table->_size; bucket_it++) {
|
||||
Bucket* bucket = _table->get_bucket(bucket_it);
|
||||
assert(!bucket->have_redirect() && !bucket->is_locked(), "Table must be uncontended");
|
||||
while (bucket->first() != NULL) {
|
||||
Node* move_node = bucket->first();
|
||||
bool ok = bucket->cas_first(move_node->next(), move_node);
|
||||
assert(ok, "Uncontended cas must work");
|
||||
bool dead_hash = false;
|
||||
size_t insert_hash = CONFIG::get_hash(*move_node->value(), &dead_hash);
|
||||
if (!dead_hash) {
|
||||
Bucket* insert_bucket = to_cht->get_bucket(insert_hash);
|
||||
assert(!bucket->have_redirect() && !bucket->is_locked(), "Not bit should be present");
|
||||
move_node->set_next(insert_bucket->first());
|
||||
ok = insert_bucket->cas_first(move_node, insert_bucket->first());
|
||||
assert(ok, "Uncontended cas must work");
|
||||
}
|
||||
}
|
||||
}
|
||||
unlock_resize_lock(thread);
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
#ifndef SHARE_UTILITIES_CONCURRENT_HASH_TABLE_TASKS_INLINE_HPP
|
||||
#define SHARE_UTILITIES_CONCURRENT_HASH_TABLE_TASKS_INLINE_HPP
|
||||
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
#include "utilities/concurrentHashTable.inline.hpp"
|
||||
|
||||
// This inline file contains BulkDeleteTask and GrowTasks which are both bucket
|
||||
@ -63,6 +64,7 @@ class ConcurrentHashTable<VALUE, CONFIG, F>::BucketsOperation {
|
||||
// Calculate starting values.
|
||||
void setup() {
|
||||
_size_log2 = _cht->_table->_log2_size;
|
||||
_task_size_log2 = MIN2(_task_size_log2, _size_log2);
|
||||
size_t tmp = _size_log2 > _task_size_log2 ?
|
||||
_size_log2 - _task_size_log2 : 0;
|
||||
_stop_task = (((size_t)1) << tmp);
|
||||
|
||||
@ -424,8 +424,8 @@ const int max_method_code_size = 64*K - 1; // JVM spec, 2nd ed. section 4.8.1 (
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Default and minimum StringTableSize values
|
||||
|
||||
const int defaultStringTableSize = NOT_LP64(1009) LP64_ONLY(60013);
|
||||
const int minimumStringTableSize = 1009;
|
||||
const int defaultStringTableSize = NOT_LP64(1024) LP64_ONLY(65536);
|
||||
const int minimumStringTableSize = 128;
|
||||
|
||||
const int defaultSymbolTableSize = 20011;
|
||||
const int minimumSymbolTableSize = 1009;
|
||||
|
||||
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