Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace JITSERVER_SUPPORT with J9VM_OPT_JITSERVER #8656

Merged
merged 2 commits into from
Feb 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019, 2019 IBM Corp. and others
# Copyright (c) 2019, 2020 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -38,8 +38,6 @@ FROM openj9:latest
ARG openj9_repo=https://github.com/eclipse/openj9.git
ARG omr_repo=https://github.com/eclipse/openj9-omr.git

ENV JITSERVER_SUPPORT=1

RUN apt-get update \
&& apt-get install -qq -y --no-install-recommends \
automake \
Expand Down Expand Up @@ -82,7 +80,7 @@ WORKDIR /root
RUN git clone https://github.com/ibmruntimes/openj9-openjdk-jdk8 \
&& cd openj9-openjdk-jdk8 \
&& bash ./get_source.sh -openj9-repo=$openj9_repo -omr-repo=$omr_repo \
&& bash ./configure --with-freemarker-jar=/root/freemarker.jar \
&& bash ./configure --with-freemarker-jar=/root/freemarker.jar --enable-jitserver\
&& make all

# Clean up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019, 2019 IBM Corp. and others
# Copyright (c) 2019, 2020 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -31,8 +31,6 @@

FROM openj9:latest

ENV JITSERVER_SUPPORT=1

RUN apt-get update \
&& apt-get install -qq -y --no-install-recommends \
automake \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@

FROM openj9:latest

ENV JITSERVER_SUPPORT=1

RUN apt-get update \
&& apt-get install -qq -y --no-install-recommends \
g++-7 \
Expand Down
2 changes: 1 addition & 1 deletion buildspecs/core.feature
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
<project id="runtime"/>
</source>
<flags>
<flag id="build_jitserver" value="false"/>
<flag id="build_stage_ottawa_vmlab" value="true"/>
<flag id="build_uma" value="true"/>
<flag id="compiler_promotion" value="true"/>
Expand Down Expand Up @@ -109,6 +108,7 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
<flag id="module_vm" value="true"/>
<flag id="opt_fragmentRamClasses" value="true"/>
<flag id="opt_inlineJsrs" value="true"/>
<flag id="opt_jitserver" value="false"/>
<flag id="opt_module" value="true"/>
<flag id="opt_newObjectHash" value="true"/>
<flag id="opt_newRomClassBuilder" value="true"/>
Expand Down
8 changes: 4 additions & 4 deletions buildspecs/j9.flags
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,6 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
<description>BuildSpec represents a Java 9x configuration.</description>
<ifRemoved></ifRemoved>
</flag>
<flag id="build_jitserver">
<description>JITServer support is enabled in the buildspec.</description>
<ifRemoved></ifRemoved>
</flag>
<flag id="build_openj9">
<description>Buildspec compiles sources with openjdk.</description>
<ifRemoved>Openj9 clone,make jobs longer run on this buildspec.</ifRemoved>
Expand Down Expand Up @@ -1773,6 +1769,10 @@ Only available on zOS</description>
<require flag="module_ifa"/>
</requires>
</flag>
<flag id="opt_jitserver">
<description>JITServer support is enabled in the buildspec.</description>
<ifRemoved></ifRemoved>
</flag>
<flag id="opt_jvmti">
<description>Support for the JVMTI interface</description>
<ifRemoved>No support for JVMTI</ifRemoved>
Expand Down
4 changes: 2 additions & 2 deletions doc/compiler/jitserver/Build.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ See https://www.eclipse.org/openj9/oj9_build.html for more detail. The only diff

## JIT

If you already have an SDK enabled with JITServer and just want to rebuild the JIT library, then **`export JITSERVER_SUPPORT=1` needs to be added to the build environment**.
If you already have an SDK enabled with JITServer and just want to rebuild the JIT library, then **`export J9VM_OPT_JITSERVER=1` needs to be added to the build environment**.

```
export JAVA_HOME=/your/sdk
export J9SRC="$JAVA_HOME"/jre/lib/amd64/compressedrefs
export JIT_SRCBASE=/your/openj9/runtime
export OMR_SRCBASE=/your/omr

export JITSERVER_SUPPORT=1
export J9VM_OPT_JITSERVER=1

ln -s "$OMR_SRCBASE" "$JIT_SRCBASE"/omr
cp "$J9SRC"/compiler/env/ut_j9jit.* "$JIT_SRCBASE"/compiler/env/
Expand Down
5 changes: 1 addition & 4 deletions runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ include(cmake/omr_config.cmake)
if(OPENJ9_BUILD)
add_definitions(-DOPENJ9_BUILD)
endif()
if (JITSERVER_SUPPORT)
add_definitions(-DJITSERVER_SUPPORT)
endif()

# clean up the variables we used
set(versionStr)
Expand Down Expand Up @@ -590,6 +587,6 @@ endif()
# NOTE this is not conditional in the UMA module.xml
add_subdirectory(tests)

if (JITSERVER_SUPPORT)
if (J9VM_OPT_JITSERVER)
add_subdirectory(jitserver_launcher)
endif()
1 change: 1 addition & 0 deletions runtime/cmake/caches/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ set(J9VM_OPT_DYNAMIC_LOAD_SUPPORT ON CACHE BOOL "")
set(J9VM_OPT_FRAGMENT_RAM_CLASSES ON CACHE BOOL "")
set(J9VM_OPT_INLINE_JSRS ON CACHE BOOL "")
set(J9VM_OPT_INVARIANT_INTERNING ON CACHE BOOL "")
set(J9VM_OPT_JITSERVER OFF CACHE BOOL "Enable JITServer")
set(J9VM_OPT_JVMTI ON CACHE BOOL "")
set(J9VM_OPT_JXE_LOAD_SUPPORT ON CACHE BOOL "")
set(J9VM_OPT_MEMORY_CHECK_SUPPORT ON CACHE BOOL "")
Expand Down
15 changes: 7 additions & 8 deletions runtime/compiler/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
################################################################################
# Copyright (c) 2017, 2019 IBM Corp. and others
# Copyright (c) 2017, 2020 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -80,10 +80,9 @@ add_custom_command(
)
add_custom_target(j9jit_tracegen DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/env/ut_j9jit.h)

# JITSERVER_SUPPORT and protobuf
if(JITSERVER_SUPPORT)
# J9VM_OPT_JITSERVER and protobuf
if(J9VM_OPT_JITSERVER)
message(STATUS "JITServer is supported")
add_definitions(-DJITSERVER_SUPPORT)

include(FindProtobuf)
set(Protobuf_USE_STATIC_LIBS ON)
Expand Down Expand Up @@ -171,7 +170,7 @@ add_subdirectory(optimizer)
add_subdirectory(ras)
add_subdirectory(runtime)

if(JITSERVER_SUPPORT)
if(J9VM_OPT_JITSERVER)
j9jit_files(${CMAKE_CURRENT_SOURCE_DIR}/net/gen/compile.pb.cpp)
add_subdirectory(net)
endif()
Expand Down Expand Up @@ -288,7 +287,7 @@ if(OMR_OS_LINUX OR OMR_OS_OSX)
-fno-threadsafe-statics
-Wno-invalid-offsetof
)
if(NOT JITSERVER_SUPPORT)
if(NOT J9VM_OPT_JITSERVER)
set(J9_CXXFLAGS
${J9_CXXFLAGS}
-fno-rtti
Expand Down Expand Up @@ -346,7 +345,7 @@ add_dependencies(j9jit
j9jit_generate
)

if(JITSERVER_SUPPORT)
if(J9VM_OPT_JITSERVER)
add_dependencies(j9jit j9jit_proto)
endif()

Expand All @@ -366,7 +365,7 @@ target_link_libraries(j9jit
${CMAKE_DL_LIBS}
)

if(JITSERVER_SUPPORT)
if(J9VM_OPT_JITSERVER)
target_link_libraries(j9jit PRIVATE ${PROTOBUF_LIBRARY})
endif()

Expand Down
6 changes: 3 additions & 3 deletions runtime/compiler/build/files/common.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2000, 2019 IBM Corp. and others
# Copyright (c) 2000, 2020 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -383,7 +383,7 @@ JIT_PRODUCT_SOURCE_FILES+=\
omr/compiler/runtime/OMRCodeCacheMemorySegment.cpp \
omr/compiler/runtime/OMRRuntimeAssumptions.cpp

ifneq ($(JITSERVER_SUPPORT),)
ifneq ($(J9VM_OPT_JITSERVER),)
JIT_PRODUCT_SOURCE_FILES+=\
compiler/control/JITClientCompilationThread.cpp \
compiler/control/JITServerCompilationThread.cpp \
Expand All @@ -409,6 +409,6 @@ include $(JIT_MAKE_DIR)/files/host/$(HOST_ARCH).mk
include $(JIT_MAKE_DIR)/files/target/$(TARGET_ARCH).mk
-include $(JIT_MAKE_DIR)/files/host/$(HOST_ARCH)-extra.mk
-include $(JIT_MAKE_DIR)/files/target/$(TARGET_ARCH)-extra.mk
ifneq ($(JITSERVER_SUPPORT),)
ifneq ($(J9VM_OPT_JITSERVER),)
include $(JIT_MAKE_DIR)/files/net.mk
endif
6 changes: 3 additions & 3 deletions runtime/compiler/build/rules/common.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2000, 2019 IBM Corp. and others
# Copyright (c) 2000, 2020 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand All @@ -24,7 +24,7 @@ clean: jit_cleanobjs jit_cleandeps jit_cleandll
cleanobjs: jit_cleanobjs
cleandeps: jit_cleandeps
cleandll: jit_cleandll
ifneq ($(JITSERVER_SUPPORT),)
ifneq ($(J9VM_OPT_JITSERVER),)
proto: protoc
endif
#
Expand All @@ -37,7 +37,7 @@ jit_createdirs::
jit_cleanobjs::
jit_cleandeps::
jit_cleandll::
ifneq ($(JITSERVER_SUPPORT),)
ifneq ($(J9VM_OPT_JITSERVER),)
protoc:
endif

Expand Down
6 changes: 3 additions & 3 deletions runtime/compiler/build/rules/gnu/common.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2000, 2019 IBM Corp. and others
# Copyright (c) 2000, 2020 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -47,7 +47,7 @@ endif
jit: $(JIT_PRODUCT_SONAME)

$(JIT_PRODUCT_SONAME): $(JIT_PRODUCT_OBJECTS) | jit_createdirs
ifneq ($(JITSERVER_SUPPORT),)
ifneq ($(J9VM_OPT_JITSERVER),)
$(SOLINK_CMD) -shared $(SOLINK_FLAGS) $(patsubst %,-L%,$(SOLINK_LIBPATH)) -o $@ $(SOLINK_PRE_OBJECTS) $(JIT_PRODUCT_OBJECTS) $(SOLINK_POST_OBJECTS) $(LINK_GROUP_START) $(patsubst %,-l%,$(SOLINK_SLINK)) $(SOLINK_SLINK_STATIC) $(LINK_GROUP_END) $(SOLINK_EXTRA_ARGS)
else
$(SOLINK_CMD) -shared $(SOLINK_FLAGS) $(patsubst %,-L%,$(SOLINK_LIBPATH)) -o $@ $(SOLINK_PRE_OBJECTS) $(JIT_PRODUCT_OBJECTS) $(SOLINK_POST_OBJECTS) $(LINK_GROUP_START) $(patsubst %,-l%,$(SOLINK_SLINK)) $(LINK_GROUP_END) $(SOLINK_EXTRA_ARGS)
Expand All @@ -69,7 +69,7 @@ JIT_DIR_LIST+=$(dir $(JIT_PRODUCT_BUILDNAME_SRC))
jit_cleanobjs::
rm -f $(JIT_PRODUCT_BUILDNAME_SRC)

ifneq ($(JITSERVER_SUPPORT),)
ifneq ($(J9VM_OPT_JITSERVER),)
protoc: $(PROTO_GEN_DIR)/compile.pb.h
$(call RULE.proto,$(PROTO_GEN_DIR)/compile,$(PROTO_DIR)/compile.proto)
endif
Expand Down
4 changes: 2 additions & 2 deletions runtime/compiler/build/rules/gnu/filetypes.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2000, 2019 IBM Corp. and others
# Copyright (c) 2000, 2020 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand All @@ -22,7 +22,7 @@
# These are the rules to compile files of type ".x" into object files
# as well as to generate clean and cleandeps rules
#
ifneq ($(JITSERVER_SUPPORT),)
ifneq ($(J9VM_OPT_JITSERVER),)
#
# Compile .proto files to .cpp files
#
Expand Down
4 changes: 2 additions & 2 deletions runtime/compiler/build/toolcfg/common.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2000, 2019 IBM Corp. and others
# Copyright (c) 2000, 2020 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -78,7 +78,7 @@ PRODUCT_SLINK=$(J9LIBS) $(J9LIBS)
# Optional project-specific settings
-include $(JIT_MAKE_DIR)/toolcfg/common-extra.mk

ifneq ($(JITSERVER_SUPPORT),)
ifneq ($(J9VM_OPT_JITSERVER),)
#
# Networking
#
Expand Down
20 changes: 4 additions & 16 deletions runtime/compiler/build/toolcfg/gnu/common.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2000, 2019 IBM Corp. and others
# Copyright (c) 2000, 2020 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -105,7 +105,7 @@ CX_FLAGS+=\
-fno-strict-aliasing \
-fstack-protector

ifneq ($(JITSERVER_SUPPORT),)
ifneq ($(J9VM_OPT_JITSERVER),)
CXX_FLAGS+=\
-std=c++11
else
Expand Down Expand Up @@ -138,10 +138,6 @@ ifeq ($(HOST_ARCH),x)
CX_DEFINES+=J9HAMMER
CX_FLAGS+=-m64 -fPIC
endif

ifneq ($(JITSERVER_SUPPORT),)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need these defines? Are the definitions added in some other place?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is for defining the macro JITSERVER_SUPPORT. We should instead use J9VM_OPT_JITSERVER which gets defined in j9cfg.h (when using UMA build system) or by CMakeLists.txt in VM and JIT.
Normally j9cfg.h gets included via j9.h and any code using J9VM_OPT_JITSERVER should now include j9.h.
Before this PR, JIT files didn't include j9.h if there isn't any dependency on it, but with this PR if the JIT files need to see J9VM_OPT_JITSERVER, then j9.h needs to be included.
A case in point is https://github.com/eclipse/openj9/pull/8656/files#diff-65a548d2a6dcefcbcdd234568cac76ab where I have to explicitly include j9.h.

CX_DEFINES+=JITSERVER_SUPPORT
endif
endif

ifeq ($(HOST_ARCH),p)
Expand All @@ -163,10 +159,6 @@ ifeq ($(HOST_ARCH),p)
CX_DEFINES+=ENABLE_SPMD_SIMD
CX_FLAGS+=-qaltivec -qarch=pwr7 -qtune=pwr7
endif

ifneq ($(JITSERVER_SUPPORT),)
CX_DEFINES+=JITSERVER_SUPPORT
endif
endif

ifeq ($(HOST_ARCH),z)
Expand All @@ -181,10 +173,6 @@ ifeq ($(HOST_ARCH),z)
endif

CX_FLAGS_DEBUG+=-gdwarf-2

ifneq ($(JITSERVER_SUPPORT),)
CX_DEFINES+=JITSERVER_SUPPORT
endif
endif

ifeq ($(HOST_ARCH),arm)
Expand Down Expand Up @@ -519,7 +507,7 @@ endif

SOLINK_FLAGS+=$(SOLINK_FLAGS_EXTRA)

ifneq ($(JITSERVER_SUPPORT),)
ifneq ($(J9VM_OPT_JITSERVER),)
#
# Setup protobuf
#
Expand All @@ -543,4 +531,4 @@ ifneq ($(JITSERVER_SUPPORT),)
C_INCLUDES+=$(OPENSSL_DIR)
CXX_INCLUDES+=$(OPENSSL_DIR)
endif
endif # JITSERVER_SUPPORT
endif # J9VM_OPT_JITSERVER
Loading