2016-04-08 11:14:23 +00:00
|
|
|
#
|
2018-05-15 18:24:34 +00:00
|
|
|
# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
|
2016-04-08 11:14:23 +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.
|
|
|
|
#
|
|
|
|
|
2017-10-05 10:41:06 +00:00
|
|
|
$(eval $(call IncludeCustomExtension, hotspot/gensrc/GensrcJvmti.gmk))
|
2016-04-08 11:14:23 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Build tools needed for the JVMTI source code generation
|
|
|
|
|
2017-09-12 17:03:56 +00:00
|
|
|
JVMTI_TOOLS_SRCDIR := $(TOPDIR)/src/hotspot/share/prims
|
2016-04-08 11:14:23 +00:00
|
|
|
JVMTI_TOOLS_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/tools/jvmti
|
|
|
|
|
|
|
|
$(eval $(call SetupJavaCompiler, GENERATE_OLDBYTECODE, \
|
|
|
|
JAVAC := $(JAVAC), \
|
|
|
|
FLAGS := $(DISABLE_WARNINGS), \
|
|
|
|
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
|
|
|
|
SERVER_JVM := $(SJAVAC_SERVER_JAVA), \
|
|
|
|
DISABLE_SJAVAC := true, \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(eval $(call SetupJavaCompilation, BUILD_JVMTI_TOOLS, \
|
|
|
|
SETUP := GENERATE_OLDBYTECODE, \
|
|
|
|
SRC := $(JVMTI_TOOLS_SRCDIR), \
|
|
|
|
INCLUDE_FILES := jvmtiGen.java jvmtiEnvFill.java, \
|
|
|
|
BIN := $(JVMTI_TOOLS_OUTPUTDIR), \
|
|
|
|
))
|
|
|
|
|
|
|
|
TOOL_JVMTI_GEN := $(JAVA_SMALL) -cp $(JVMTI_TOOLS_OUTPUTDIR) jvmtiGen
|
|
|
|
TOOL_JVMTI_ENV_FILL := $(JAVA_SMALL) -cp $(JVMTI_TOOLS_OUTPUTDIR) jvmtiEnvFill
|
|
|
|
|
|
|
|
################################################################################
|
2018-05-15 18:24:34 +00:00
|
|
|
# Setup make rules for an xml transform for jvmti file generation.
|
2016-04-08 11:14:23 +00:00
|
|
|
#
|
|
|
|
# Parameter 1 is the name of the rule. This name is used as variable prefix,
|
|
|
|
# and the targets generated are listed in a variable by that name. This name is
|
|
|
|
# also used as the name of the output file.
|
|
|
|
#
|
|
|
|
# Remaining parameters are named arguments. These include:
|
|
|
|
# XML_FILE -- The input source file to use
|
|
|
|
# XSL_FILE -- The xsl file to use
|
|
|
|
# OUTPUT_DIR -- The directory to put the generated file in
|
|
|
|
# ARGS -- Additional arguments to the jvmtiGen tool
|
|
|
|
# DEPS -- Additional dependencies
|
|
|
|
SetupXslTransform = $(NamedParamsMacroTemplate)
|
|
|
|
define SetupXslTransformBody
|
|
|
|
$$($1_OUTPUT_DIR)/$1: $$($1_XML_FILE) $$($1_XSL_FILE) $$($1_DEPS) $$(BUILD_JVMTI_TOOLS)
|
|
|
|
$$(call LogInfo, Generating $$(@F))
|
|
|
|
$$(call MakeDir, $$(@D))
|
2016-09-22 06:57:37 +00:00
|
|
|
$$(call ExecuteWithLog, $$@, $$(TOOL_JVMTI_GEN) -IN $$($1_XML_FILE) \
|
|
|
|
-XSL $$($1_XSL_FILE) -OUT $$@ $$($1_ARGS))
|
2016-04-08 11:14:23 +00:00
|
|
|
# jvmtiGen does not return error code properly on fail.
|
|
|
|
# NOTE: We should really fix jvmtiGen.java instead.
|
|
|
|
test -f $$@
|
|
|
|
|
|
|
|
TARGETS += $$($1_OUTPUT_DIR)/$1
|
|
|
|
endef
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Create JVMTI files in gensrc/jvmtifiles
|
|
|
|
|
2017-09-12 17:03:56 +00:00
|
|
|
JVMTI_SRCDIR := $(TOPDIR)/src/hotspot/share/prims
|
2016-04-08 11:14:23 +00:00
|
|
|
JVMTI_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/gensrc/jvmtifiles
|
|
|
|
|
|
|
|
# Setup rule for generating a jvmti file
|
|
|
|
#
|
|
|
|
# $1 is generated source file name in $(JVMTI_OUTPUTDIR)
|
|
|
|
# $2 is XSL file to use in $(JVMTI_SRCDIR)
|
|
|
|
# $3 is optional extra arguments to jvmtiGen
|
|
|
|
define SetupJvmtiGeneration
|
|
|
|
$$(eval $$(call SetupXslTransform, $1, \
|
|
|
|
XML_FILE := $$(JVMTI_SRCDIR)/jvmti.xml, \
|
|
|
|
XSL_FILE := $$(JVMTI_SRCDIR)/$(strip $2), \
|
|
|
|
OUTPUT_DIR := $$(JVMTI_OUTPUTDIR), \
|
|
|
|
ARGS := $3, \
|
|
|
|
DEPS := $$(JVMTI_SRCDIR)/jvmtiLib.xsl, \
|
|
|
|
))
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call SetupJvmtiGeneration, jvmtiEnter.cpp, jvmtiEnter.xsl, \
|
|
|
|
-PARAM interface jvmti))
|
|
|
|
$(eval $(call SetupJvmtiGeneration, jvmtiEnterTrace.cpp, jvmtiEnter.xsl, \
|
|
|
|
-PARAM interface jvmti -PARAM trace Trace))
|
|
|
|
$(eval $(call SetupJvmtiGeneration, jvmtiEnv.hpp, jvmtiHpp.xsl))
|
|
|
|
$(eval $(call SetupJvmtiGeneration, jvmti.h, jvmtiH.xsl))
|
|
|
|
$(eval $(call SetupJvmtiGeneration, jvmti.html, jvmti.xsl))
|
|
|
|
|
2017-09-12 17:03:56 +00:00
|
|
|
JVMTI_BC_SRCDIR := $(TOPDIR)/src/hotspot/share/interpreter
|
2016-04-08 11:14:23 +00:00
|
|
|
|
|
|
|
$(eval $(call SetupXslTransform, bytecodeInterpreterWithChecks.cpp, \
|
|
|
|
XML_FILE := $(JVMTI_BC_SRCDIR)/bytecodeInterpreterWithChecks.xml, \
|
|
|
|
XSL_FILE := $(JVMTI_BC_SRCDIR)/bytecodeInterpreterWithChecks.xsl, \
|
|
|
|
OUTPUT_DIR := $(JVMTI_OUTPUTDIR), \
|
|
|
|
DEPS := $(JVMTI_BC_SRCDIR)/bytecodeInterpreter.cpp, \
|
|
|
|
))
|
|
|
|
|
2016-10-05 08:49:49 +00:00
|
|
|
################################################################################
|
|
|
|
# Copy jvmti.h to include dir
|
|
|
|
|
|
|
|
# The file is the same regardless of jvm variant. Only let one do the copy.
|
2016-11-02 09:43:23 +00:00
|
|
|
ifeq ($(JVM_VARIANT), $(firstword $(JVM_VARIANTS)))
|
|
|
|
$(eval $(call SetupCopyFiles, COPY_JVMTI_H, \
|
|
|
|
DEST := $(SUPPORT_OUTPUTDIR)/modules_include/java.base, \
|
|
|
|
FILES := $(JVMTI_OUTPUTDIR)/jvmti.h, \
|
|
|
|
))
|
|
|
|
|
|
|
|
TARGETS += $(COPY_JVMTI_H)
|
|
|
|
endif
|