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

8264806: Remove the experimental JIT compiler #3421

Closed
wants to merge 12 commits into from
57 changes: 57 additions & 0 deletions make/GraalBuilderImage.gmk
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# Copyright (c) 2020, Red Hat Inc.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

# This makefile creates a jdk image overlayed with statically linked core
# libraries.

default: all

include $(SPEC)
include MakeBase.gmk

################################################################################

TARGETS :=

$(eval $(call SetupCopyFiles, COPY_JDK_IMG, \
SRC := $(JDK_IMAGE_DIR)/, \
DEST := $(GRAAL_BUILDER_IMAGE_DIR)/, \
FILES := $(call FindFiles, $(JDK_IMAGE_DIR)/), \
))
TARGETS += $(COPY_JDK_IMG)

$(eval $(call SetupCopyFiles, COPY_STATIC_LIBS, \
SRC := $(STATIC_LIBS_IMAGE_DIR)/lib, \
DEST := $(GRAAL_BUILDER_IMAGE_DIR)/lib, \
FILES := $(filter %$(STATIC_LIBRARY_SUFFIX), \
$(call FindFiles, $(STATIC_LIBS_IMAGE_DIR)/lib)), \
))
TARGETS += $(COPY_STATIC_LIBS)

################################################################################

all: $(TARGETS)

.PHONY: all
5 changes: 5 additions & 0 deletions make/Main.gmk
Original file line number Diff line number Diff line change
@@ -441,6 +441,11 @@ $(eval $(call SetupTarget, exploded-image-optimize, \
buildtools-modules, \
))

$(eval $(call SetupTarget, graal-builder-image, \
MAKEFILE := GraalBuilderImage, \
DEPS := jdk-image static-libs-image, \
))

ifeq ($(JCOV_ENABLED), true)
$(eval $(call SetupTarget, jcov-image, \
MAKEFILE := Coverage, \
4 changes: 4 additions & 0 deletions make/autoconf/spec.gmk.in
Original file line number Diff line number Diff line change
@@ -890,6 +890,10 @@ DOCS_OUTPUTDIR := $(DOCS_JDK_IMAGE_DIR)
STATIC_LIBS_IMAGE_SUBDIR := static-libs
STATIC_LIBS_IMAGE_DIR := $(IMAGES_OUTPUTDIR)/$(STATIC_LIBS_IMAGE_SUBDIR)

# Graal builder image
GRAAL_BUILDER_IMAGE_SUBDIR := graal-builder-jdk
GRAAL_BUILDER_IMAGE_DIR := $(IMAGES_OUTPUTDIR)/$(GRAAL_BUILDER_IMAGE_SUBDIR)

# Macosx bundles directory definitions
JDK_MACOSX_BUNDLE_SUBDIR=jdk-bundle
JRE_MACOSX_BUNDLE_SUBDIR=jre-bundle
2 changes: 1 addition & 1 deletion src/hotspot/cpu/x86/compiledIC_x86.cpp
Original file line number Diff line number Diff line change
@@ -131,7 +131,7 @@ void CompiledDirectStaticCall::verify() {

#ifdef ASSERT
CodeBlob *cb = CodeCache::find_blob_unsafe((address) _call);
assert(cb, "sanity");
assert(cb != NULL, "sanity");
#endif

// Verify stub.
2 changes: 1 addition & 1 deletion src/hotspot/cpu/x86/globalDefinitions_x86.hpp
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ const bool CCallingConventionRequiresIntsAsLongs = false;
#endif

#if INCLUDE_JVMCI
#define COMPRESSED_CLASS_POINTERS_DEPENDS_ON_COMPRESSED_OOPS (EnableJVMCI)
#define COMPRESSED_CLASS_POINTERS_DEPENDS_ON_COMPRESSED_OOPS EnableJVMCI
#else
#define COMPRESSED_CLASS_POINTERS_DEPENDS_ON_COMPRESSED_OOPS false
#endif
2 changes: 0 additions & 2 deletions src/hotspot/share/code/compiledIC.cpp
Original file line number Diff line number Diff line change
@@ -711,8 +711,6 @@ void CompiledDirectStaticCall::print() {
tty->print("compiled");
} else if (is_call_to_interpreted()) {
tty->print("interpreted");
} else {
tty->print("unknown");
}
tty->cr();
}
18 changes: 3 additions & 15 deletions src/hotspot/share/jvmci/jvmciCodeInstaller.cpp
Original file line number Diff line number Diff line change
@@ -1132,10 +1132,6 @@ void CodeInstaller::site_Call(CodeBuffer& buffer, jint pc_offset, JVMCIObject si

if (foreign_call.is_non_null()) {
jlong foreign_call_destination = jvmci_env()->get_HotSpotForeignCallTarget_address(foreign_call);
if (_immutable_pic_compilation) {
// Use fake short distance during PIC compilation.
foreign_call_destination = (jlong)(_instructions->start() + pc_offset);
}
CodeInstaller::pd_relocate_ForeignCall(inst, foreign_call_destination, JVMCI_CHECK);
} else { // method != NULL
if (debug_info.is_null()) {
@@ -1171,19 +1167,11 @@ void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, JVMCIObje
const char* to_string = JVMCIENV->as_utf8_string(string);
JVMCI_THROW_MSG(IllegalArgumentException, err_msg("Direct object constant reached the backend: %s", to_string));
}
if (!_immutable_pic_compilation) {
// Do not patch during PIC compilation.
pd_patch_OopConstant(pc_offset, constant, JVMCI_CHECK);
}
pd_patch_OopConstant(pc_offset, constant, JVMCI_CHECK);
} else if (jvmci_env()->isa_IndirectHotSpotObjectConstantImpl(constant)) {
if (!_immutable_pic_compilation) {
// Do not patch during PIC compilation.
pd_patch_OopConstant(pc_offset, constant, JVMCI_CHECK);
}
pd_patch_OopConstant(pc_offset, constant, JVMCI_CHECK);
} else if (jvmci_env()->isa_HotSpotMetaspaceConstantImpl(constant)) {
if (!_immutable_pic_compilation) {
pd_patch_MetaspaceConstant(pc_offset, constant, JVMCI_CHECK);
}
pd_patch_MetaspaceConstant(pc_offset, constant, JVMCI_CHECK);
} else {
JVMCI_ERROR("unknown constant type in data patch: %s", jvmci_env()->klass_name(constant));
}
7 changes: 2 additions & 5 deletions src/hotspot/share/jvmci/jvmciCodeInstaller.hpp
Original file line number Diff line number Diff line change
@@ -151,8 +151,6 @@ class CodeInstaller : public StackObj {
ImplicitExceptionTable _implicit_exception_table;
bool _has_auto_box;

bool _immutable_pic_compilation; // Installer is called for Immutable PIC compilation.

static ConstantOopWriteValue* _oop_null_scope_value;
static ConstantIntValue* _int_m1_scope_value;
static ConstantIntValue* _int_0_scope_value;
@@ -180,11 +178,10 @@ class CodeInstaller : public StackObj {

public:

CodeInstaller(JVMCIEnv* jvmci_env, bool immutable_pic_compilation) :
CodeInstaller(JVMCIEnv* jvmci_env) :
_arena(mtJVMCI),
_jvmci_env(jvmci_env),
_has_auto_box(false),
_immutable_pic_compilation(immutable_pic_compilation) {}
_has_auto_box(false) {}

JVMCI::CodeInstallResult install(JVMCICompiler* compiler,
JVMCIObject target,
3 changes: 1 addition & 2 deletions src/hotspot/share/jvmci/jvmciCompilerToVM.cpp
Original file line number Diff line number Diff line change
@@ -843,9 +843,8 @@ C2V_VMENTRY_0(jint, installCode, (JNIEnv *env, jobject, jobject target, jobject
JVMCICompiler* compiler = JVMCICompiler::instance(true, CHECK_JNI_ERR);

TraceTime install_time("installCode", JVMCICompiler::codeInstallTimer(!thread->is_Compiler_thread()));
bool is_immutable_PIC = JVMCIENV->get_HotSpotCompiledCode_isImmutablePIC(compiled_code_handle) > 0;

CodeInstaller installer(JVMCIENV, is_immutable_PIC);
CodeInstaller installer(JVMCIENV);
JVMCI::CodeInstallResult result = installer.install(compiler,
target_handle,
compiled_code_handle,
3 changes: 1 addition & 2 deletions src/hotspot/share/memory/heap.hpp
Original file line number Diff line number Diff line change
@@ -171,8 +171,7 @@ class CodeHeap : public CHeapObj<mtCode> {
// Containment means "contained in committed space".
bool contains(const void* p) const { return low() <= p && p < high(); }
bool contains_blob(const CodeBlob* blob) const {
const void* start = (void*)blob;
return contains(start);
return contains((void*)blob);
}

virtual void* find_start(void* p) const; // returns the block containing p or NULL
5 changes: 0 additions & 5 deletions src/hotspot/share/oops/methodCounters.cpp
Original file line number Diff line number Diff line change
@@ -23,7 +23,6 @@
*/
#include "precompiled.hpp"
#include "compiler/compiler_globals.hpp"
#include "memory/metaspaceClosure.hpp"
#include "oops/method.hpp"
#include "oops/methodCounters.hpp"
#include "runtime/handles.inline.hpp"
@@ -74,10 +73,6 @@ void MethodCounters::clear_counters() {
set_highest_osr_comp_level(0);
}

void MethodCounters::metaspace_pointers_do(MetaspaceClosure* it) {
log_trace(cds)("Iter(MethodCounters): %p", this);
}

void MethodCounters::print_value_on(outputStream* st) const {
assert(is_methodCounters(), "must be methodCounters");
st->print("method counters");
3 changes: 0 additions & 3 deletions src/hotspot/share/oops/methodCounters.hpp
Original file line number Diff line number Diff line change
@@ -37,8 +37,6 @@ class MethodCounters : public Metadata {
private:
InvocationCounter _invocation_counter; // Incremented before each activation of the method - used to trigger frequency-based optimizations
InvocationCounter _backedge_counter; // Incremented before each backedge taken - used to trigger frequency-based optimizations
// If you add a new field that points to any metaspace object, you
// must add this field to MethodCounters::metaspace_pointers_do().
jlong _prev_time; // Previous time the rate was acquired
float _rate; // Events (invocation and backedge counter increments) per millisecond
int _nmethod_age;
@@ -77,7 +75,6 @@ class MethodCounters : public Metadata {
virtual int size() const {
return method_counters_size();
}
void metaspace_pointers_do(MetaspaceClosure* it);
MetaspaceObj::Type type() const { return MethodCountersType; }
void clear_counters();