2018-11-16 22:39:51 +00:00
|
|
|
#
|
2024-05-17 17:42:46 +00:00
|
|
|
# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
|
2018-11-16 22:39:51 +00:00
|
|
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
#
|
|
|
|
# This code is free software; you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU General Public License version 2 only, as
|
|
|
|
# published by the Free Software Foundation. Oracle designates this
|
|
|
|
# particular file as subject to the "Classpath" exception as provided
|
|
|
|
# by Oracle in the LICENSE file that accompanied this code.
|
|
|
|
#
|
|
|
|
# This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
# version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
# accompanied this code).
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License version
|
|
|
|
# 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
#
|
|
|
|
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
# or visit www.oracle.com if you need additional information or have any
|
|
|
|
# questions.
|
|
|
|
#
|
|
|
|
|
|
|
|
# This must be the first rule
|
|
|
|
default: all
|
|
|
|
|
|
|
|
include $(SPEC)
|
|
|
|
include MakeBase.gmk
|
2024-04-11 14:15:34 +00:00
|
|
|
|
|
|
|
include CopyFiles.gmk
|
2018-11-16 22:39:51 +00:00
|
|
|
include JavaCompilation.gmk
|
2019-02-19 22:02:41 +00:00
|
|
|
include TestFilesCompilation.gmk
|
2018-11-16 22:39:51 +00:00
|
|
|
|
|
|
|
ifeq ($(JMH_CORE_JAR), )
|
|
|
|
$(info Error: JMH is missing. Please use configure --with-jmh.)
|
|
|
|
$(error Cannot continue)
|
|
|
|
endif
|
|
|
|
|
|
|
|
#### Variables
|
|
|
|
|
|
|
|
MICROBENCHMARK_SRC := $(TOPDIR)/test/micro
|
2019-02-19 22:02:41 +00:00
|
|
|
MICROBENCHMARK_IMAGE_DIR := $(TEST_IMAGE_DIR)/micro
|
|
|
|
MICROBENCHMARK_JAR := $(MICROBENCHMARK_IMAGE_DIR)/benchmarks.jar
|
2018-11-16 22:39:51 +00:00
|
|
|
|
|
|
|
MICROBENCHMARK_OUTPUT := $(SUPPORT_OUTPUTDIR)/test/micro
|
|
|
|
MICROBENCHMARK_CLASSES := $(MICROBENCHMARK_OUTPUT)/classes
|
|
|
|
MICROBENCHMARK_JAR_BIN := $(MICROBENCHMARK_OUTPUT)/jar
|
|
|
|
|
2019-05-23 15:57:24 +00:00
|
|
|
MICROBENCHMARK_TOOLS_CLASSES := $(MICROBENCHMARK_OUTPUT)/tools-classes
|
|
|
|
MICROBENCHMARK_INDIFY_DONE := $(MICROBENCHMARK_CLASSES)/_indify.marker
|
|
|
|
|
2018-11-16 22:39:51 +00:00
|
|
|
JMH_UNPACKED_DIR := $(MICROBENCHMARK_OUTPUT)/jmh_jars
|
|
|
|
JMH_UNPACKED_JARS_DONE := $(JMH_UNPACKED_DIR)/_unpacked.marker
|
|
|
|
|
|
|
|
# External dependencies
|
2023-12-11 14:17:38 +00:00
|
|
|
WHITEBOX_JAR := $(SUPPORT_OUTPUTDIR)/test/lib/wb.jar
|
|
|
|
JMH_COMPILE_JARS := $(JMH_CORE_JAR) $(JMH_GENERATOR_JAR) $(WHITEBOX_JAR)
|
2018-11-16 22:39:51 +00:00
|
|
|
JMH_RUNTIME_JARS := $(JMH_CORE_JAR) $(JMH_COMMONS_MATH_JAR) $(JMH_JOPT_SIMPLE_JAR)
|
|
|
|
|
2019-02-19 22:02:41 +00:00
|
|
|
# Native dependencies
|
|
|
|
MICROBENCHMARK_NATIVE_SRC_DIRS := $(MICROBENCHMARK_SRC)
|
|
|
|
MICROBENCHMARK_NATIVE_OUTPUT := $(MICROBENCHMARK_OUTPUT)/native
|
|
|
|
MICROBENCHMARK_NATIVE_EXCLUDE :=
|
|
|
|
|
2018-11-16 22:39:51 +00:00
|
|
|
###
|
|
|
|
|
|
|
|
# Need double \n to get new lines and no trailing spaces
|
|
|
|
MICROBENCHMARK_MANIFEST := Build: $(FULL_VERSION)\n\
|
|
|
|
\nJMH-Version: $(JMH_VERSION)\n\
|
|
|
|
\nName: OpenJDK Microbenchmark Suite
|
|
|
|
|
2019-05-23 15:57:24 +00:00
|
|
|
#### Compile Indify tool
|
|
|
|
|
|
|
|
$(eval $(call SetupJavaCompilation, BUILD_INDIFY, \
|
2020-04-29 06:49:17 +00:00
|
|
|
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
|
2019-05-23 15:57:24 +00:00
|
|
|
SRC := $(TOPDIR)/test/jdk/java/lang/invoke, \
|
|
|
|
INCLUDE_FILES := indify/Indify.java, \
|
2023-03-17 22:05:50 +00:00
|
|
|
DISABLED_WARNINGS := this-escape rawtypes serial options, \
|
2019-05-23 15:57:24 +00:00
|
|
|
BIN := $(MICROBENCHMARK_TOOLS_CLASSES), \
|
2020-04-29 06:49:17 +00:00
|
|
|
JAVAC_FLAGS := -XDstringConcat=inline -Xprefer:newer, \
|
2019-05-23 15:57:24 +00:00
|
|
|
))
|
2018-11-16 22:39:51 +00:00
|
|
|
|
|
|
|
#### Compile Targets
|
|
|
|
|
2020-04-29 06:49:17 +00:00
|
|
|
# Building microbenchmark requires the jdk.unsupported and java.management modules.
|
2023-10-11 00:54:54 +00:00
|
|
|
# sun.security.util is required to compile Cache benchmark.
|
|
|
|
# jmh uses annotation processors to generate the benchmark jar and thus
|
|
|
|
# requires the use of -processor option during benchmark compilation.
|
2018-11-16 22:39:51 +00:00
|
|
|
|
|
|
|
# Build microbenchmark suite for the current JDK
|
|
|
|
$(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \
|
2020-04-29 06:49:17 +00:00
|
|
|
TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \
|
|
|
|
SMALL_JAVA := false, \
|
2023-12-11 14:17:38 +00:00
|
|
|
CLASSPATH := $(JMH_COMPILE_JARS), \
|
2024-08-27 07:23:15 +00:00
|
|
|
CREATE_API_DIGEST := true, \
|
2024-05-28 15:05:54 +00:00
|
|
|
DISABLED_WARNINGS := restricted this-escape processing rawtypes removal cast \
|
2024-05-17 17:42:46 +00:00
|
|
|
serial preview dangling-doc-comments, \
|
2018-11-16 22:39:51 +00:00
|
|
|
SRC := $(MICROBENCHMARK_SRC), \
|
|
|
|
BIN := $(MICROBENCHMARK_CLASSES), \
|
2023-12-11 14:17:38 +00:00
|
|
|
JAVAC_FLAGS := \
|
2023-03-09 15:23:03 +00:00
|
|
|
--add-exports java.base/jdk.internal.classfile.impl=ALL-UNNAMED \
|
2023-09-20 12:34:08 +00:00
|
|
|
--add-exports java.base/jdk.internal.event=ALL-UNNAMED \
|
2023-10-13 19:05:47 +00:00
|
|
|
--add-exports java.base/jdk.internal.foreign=ALL-UNNAMED \
|
2023-12-11 14:17:38 +00:00
|
|
|
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
|
2024-04-24 06:44:14 +00:00
|
|
|
--add-exports java.base/jdk.internal.util=ALL-UNNAMED \
|
2023-12-11 14:17:38 +00:00
|
|
|
--add-exports java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED \
|
|
|
|
--add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
|
|
|
|
--add-exports java.base/jdk.internal.vm=ALL-UNNAMED \
|
|
|
|
--add-exports java.base/sun.invoke.util=ALL-UNNAMED \
|
|
|
|
--add-exports java.base/sun.security.util=ALL-UNNAMED \
|
2024-05-22 16:27:27 +00:00
|
|
|
--add-exports java.base/sun.security.util.math=ALL-UNNAMED \
|
|
|
|
--add-exports java.base/sun.security.util.math.intpoly=ALL-UNNAMED \
|
2023-10-11 00:54:54 +00:00
|
|
|
--enable-preview \
|
2024-01-18 15:40:39 +00:00
|
|
|
-XDsuppressNotes \
|
2023-10-11 00:54:54 +00:00
|
|
|
-processor org.openjdk.jmh.generators.BenchmarkProcessor, \
|
2023-12-11 14:17:38 +00:00
|
|
|
JAVA_FLAGS := \
|
8284161: Implementation of Virtual Threads (Preview)
Co-authored-by: Ron Pressler <rpressler@openjdk.org>
Co-authored-by: Alan Bateman <alanb@openjdk.org>
Co-authored-by: Erik Österlund <eosterlund@openjdk.org>
Co-authored-by: Andrew Haley <aph@openjdk.org>
Co-authored-by: Rickard Bäckman <rbackman@openjdk.org>
Co-authored-by: Markus Grönlund <mgronlun@openjdk.org>
Co-authored-by: Leonid Mesnik <lmesnik@openjdk.org>
Co-authored-by: Serguei Spitsyn <sspitsyn@openjdk.org>
Co-authored-by: Chris Plummer <cjplummer@openjdk.org>
Co-authored-by: Coleen Phillimore <coleenp@openjdk.org>
Co-authored-by: Robbin Ehn <rehn@openjdk.org>
Co-authored-by: Stefan Karlsson <stefank@openjdk.org>
Co-authored-by: Thomas Schatzl <tschatzl@openjdk.org>
Co-authored-by: Sergey Kuksenko <skuksenko@openjdk.org>
Reviewed-by: lancea, eosterlund, rehn, sspitsyn, stefank, tschatzl, dfuchs, lmesnik, dcubed, kevinw, amenkov, dlong, mchung, psandoz, bpb, coleenp, smarks, egahlin, mseledtsov, coffeys, darcy
2022-05-07 08:06:16 +00:00
|
|
|
--add-exports java.base/jdk.internal.vm=ALL-UNNAMED \
|
2023-12-11 14:17:38 +00:00
|
|
|
--add-modules jdk.unsupported \
|
|
|
|
--enable-preview \
|
|
|
|
--limit-modules java.management, \
|
2018-11-16 22:39:51 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
$(BUILD_JDK_MICROBENCHMARK): $(JMH_COMPILE_JARS)
|
|
|
|
|
2019-05-23 15:57:24 +00:00
|
|
|
# Run Indify
|
|
|
|
$(MICROBENCHMARK_INDIFY_DONE): $(BUILD_INDIFY) $(BUILD_JDK_MICROBENCHMARK)
|
|
|
|
$(call LogWarn, Running Indify on microbenchmark classes)
|
|
|
|
$(JAVA_SMALL) -cp $(MICROBENCHMARK_TOOLS_CLASSES) \
|
|
|
|
indify.Indify --overwrite $(MICROBENCHMARK_CLASSES) \
|
|
|
|
$(LOG_DEBUG) 2>&1
|
|
|
|
$(TOUCH) $@
|
|
|
|
|
2018-11-16 22:39:51 +00:00
|
|
|
# Unpacking dependencies for inclusion in the benchmark JARs
|
|
|
|
$(JMH_UNPACKED_JARS_DONE): $(JMH_RUNTIME_JARS)
|
|
|
|
$(RM) -r $(JMH_UNPACKED_DIR)
|
|
|
|
$(MKDIR) -p $(JMH_UNPACKED_DIR)
|
|
|
|
$(foreach jar, $(JMH_RUNTIME_JARS), \
|
|
|
|
$$($(UNZIP) -oq $(jar) -d $(JMH_UNPACKED_DIR)))
|
|
|
|
$(RM) -r $(JMH_UNPACKED_DIR)/META-INF
|
|
|
|
$(RM) $(JMH_UNPACKED_DIR)/*.xml
|
|
|
|
$(TOUCH) $@
|
|
|
|
|
|
|
|
# Create benchmarks JAR file with benchmarks for both the old and new JDK
|
|
|
|
$(eval $(call SetupJarArchive, BUILD_JDK_JAR, \
|
2019-05-23 15:57:24 +00:00
|
|
|
DEPENDENCIES := $(BUILD_JDK_MICROBENCHMARK) $(JMH_UNPACKED_JARS_DONE) \
|
|
|
|
$(MICROBENCHMARK_INDIFY_DONE), \
|
2018-11-16 22:39:51 +00:00
|
|
|
SRCS := $(MICROBENCHMARK_CLASSES) $(JMH_UNPACKED_DIR), \
|
|
|
|
BIN := $(MICROBENCHMARK_JAR_BIN), \
|
|
|
|
SUFFIXES := .*, \
|
|
|
|
EXCLUDE_FILES:= _the.BUILD_JDK_MICROBENCHMARK_batch \
|
|
|
|
_the.BUILD_JDK_MICROBENCHMARK.vardeps _unpacked.marker, \
|
|
|
|
EXTRA_MANIFEST_ATTR := $(MICROBENCHMARK_MANIFEST), \
|
|
|
|
JARMAIN := org.openjdk.jmh.Main, \
|
|
|
|
JAR := $(MICROBENCHMARK_JAR), \
|
|
|
|
))
|
|
|
|
|
2019-02-19 22:02:41 +00:00
|
|
|
# Setup compilation of native library dependencies
|
|
|
|
$(eval $(call SetupTestFilesCompilation, BUILD_MICROBENCHMARK_LIBRARIES, \
|
|
|
|
TYPE := LIBRARY, \
|
|
|
|
SOURCE_DIRS := $(MICROBENCHMARK_NATIVE_SRC_DIRS), \
|
|
|
|
OUTPUT_DIR := $(MICROBENCHMARK_NATIVE_OUTPUT), \
|
|
|
|
EXCLUDE := $(MICROBENCHMARK_NATIVE_EXCLUDE), \
|
|
|
|
))
|
|
|
|
|
|
|
|
# Setup copy of native dependencies to image output dir
|
|
|
|
$(eval $(call SetupCopyFiles, COPY_MICROBENCHMARK_NATIVE, \
|
2023-09-20 20:36:16 +00:00
|
|
|
SRC := $(MICROBENCHMARK_NATIVE_OUTPUT)/lib, \
|
2019-02-19 22:02:41 +00:00
|
|
|
DEST := $(MICROBENCHMARK_IMAGE_DIR)/native, \
|
2023-09-20 20:36:16 +00:00
|
|
|
FILES := $(filter $(MICROBENCHMARK_NATIVE_OUTPUT)/lib/%, \
|
|
|
|
$(BUILD_MICROBENCHMARK_LIBRARIES)), \
|
2019-02-19 22:02:41 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
all: $(MICROBENCHMARK_JAR) $(BUILD_MICROBENCHMARK_LIBRARIES) $(COPY_MICROBENCHMARK_NATIVE)
|
2018-11-16 22:39:51 +00:00
|
|
|
|
|
|
|
.PHONY: all
|