Skip to content

Commit

Permalink
Merge branch 'master' into jvmti-table
Browse files Browse the repository at this point in the history
  • Loading branch information
stefank committed Nov 3, 2020
2 parents 9eb335e + 93ef009 commit 1c3f2e1
Show file tree
Hide file tree
Showing 79 changed files with 1,510 additions and 918 deletions.
6 changes: 4 additions & 2 deletions make/autoconf/libraries.m4
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES],
if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx; then
# No X11 support on windows or macosx
NEEDS_LIB_X11=false
elif test "x$ENABLE_HEADLESS_ONLY" = xtrue; then
# No X11 support needed when building headless only
NEEDS_LIB_X11=false
else
# All other instances need X11, even if building headless only, libawt still
# needs X11 headers.
# All other instances need X11
NEEDS_LIB_X11=true
fi
Expand Down
6 changes: 4 additions & 2 deletions make/common/JavaCompilation.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,11 @@ define SetupJavaCompilationBody
ifneq ($$($1_KEEP_DUPS), true)
# Remove duplicate source files by keeping the first found of each duplicate.
# This allows for automatic overrides with custom or platform specific versions
# source files.
# source files. Need to call DoubleDollar as we have java classes with '$' in
# their names.
$1_SRCS := $$(strip $$(foreach s, $$($1_SRCS), \
$$(eval relative_src := $$(call remove-prefixes, $$($1_SRC), $$(s))) \
$$(eval relative_src := $$(call remove-prefixes, $$($1_SRC), \
$$(call DoubleDollar, $$(s)))) \
$$(if $$($1_$$(relative_src)), \
, \
$$(eval $1_$$(relative_src) := 1) $$(s))))
Expand Down
19 changes: 5 additions & 14 deletions make/conf/jib-profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ var getJibProfilesCommon = function (input, data) {
configure_args: concat("--enable-jtreg-failure-handler",
"--with-exclude-translations=de,es,fr,it,ko,pt_BR,sv,ca,tr,cs,sk,ja_JP_A,ja_JP_HA,ja_JP_HI,ja_JP_I,zh_TW,zh_HK",
"--disable-manpages",
"--disable-jvm-feature-aot",
"--disable-jvm-feature-graal",
"--disable-jvm-feature-shenandoahgc",
versionArgs(input, common))
};
Expand Down Expand Up @@ -404,7 +406,7 @@ var getJibProfilesProfiles = function (input, common, data) {
"linux-x64": {
target_os: "linux",
target_cpu: "x64",
dependencies: ["devkit", "gtest", "graphviz", "pandoc", "graalunit_lib"],
dependencies: ["devkit", "gtest", "graphviz", "pandoc"],
configure_args: concat(common.configure_args_64bit,
"--with-zlib=system", "--disable-dtrace",
(isWsl(input) ? [ "--host=x86_64-unknown-linux-gnu",
Expand All @@ -423,7 +425,7 @@ var getJibProfilesProfiles = function (input, common, data) {
"macosx-x64": {
target_os: "macosx",
target_cpu: "x64",
dependencies: ["devkit", "gtest", "pandoc", "graalunit_lib"],
dependencies: ["devkit", "gtest", "pandoc"],
configure_args: concat(common.configure_args_64bit, "--with-zlib=system",
"--with-macosx-version-max=10.9.0",
// Use system SetFile instead of the one in the devkit as the
Expand All @@ -434,7 +436,7 @@ var getJibProfilesProfiles = function (input, common, data) {
"windows-x64": {
target_os: "windows",
target_cpu: "x64",
dependencies: ["devkit", "gtest", "pandoc", "graalunit_lib"],
dependencies: ["devkit", "gtest", "pandoc"],
configure_args: concat(common.configure_args_64bit),
},

Expand All @@ -454,8 +456,6 @@ var getJibProfilesProfiles = function (input, common, data) {
configure_args: [
"--openjdk-target=aarch64-linux-gnu",
"--disable-jvm-feature-jvmci",
"--disable-jvm-feature-graal",
"--disable-jvm-feature-aot",
],
},

Expand Down Expand Up @@ -1152,15 +1152,6 @@ var getJibProfilesDependencies = function (input, common) {
configure_args: "",
},

graalunit_lib: {
organization: common.organization,
ext: "zip",
revision: "619_Apr_12_2018",
module: "graalunit-lib",
configure_args: "--with-graalunit-lib=" + input.get("graalunit_lib", "install_path"),
environment_name: "GRAALUNIT_LIB"
},

gtest: {
organization: common.organization,
ext: "tar.gz",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@

#define __ masm->

address ShenandoahBarrierSetAssembler::_shenandoah_lrb = NULL;

void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
Register src, Register dst, Register count, RegSet saved_regs) {
if (is_oop) {
Expand Down Expand Up @@ -227,18 +225,18 @@ void ShenandoahBarrierSetAssembler::resolve_forward_pointer_not_null(MacroAssemb
}
}

void ShenandoahBarrierSetAssembler::load_reference_barrier_not_null(MacroAssembler* masm, Register dst, Address load_addr) {
void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm, Register dst, Address load_addr, bool weak) {
assert(ShenandoahLoadRefBarrier, "Should be enabled");
assert(dst != rscratch2, "need rscratch2");
assert_different_registers(load_addr.base(), load_addr.index(), rscratch1, rscratch2);

Label done;
Label heap_stable, not_cset;
__ enter();
Address gc_state(rthread, in_bytes(ShenandoahThreadLocalData::gc_state_offset()));
__ ldrb(rscratch2, gc_state);

// Check for heap stability
__ tbz(rscratch2, ShenandoahHeap::HAS_FORWARDED_BITPOS, done);
__ tbz(rscratch2, ShenandoahHeap::HAS_FORWARDED_BITPOS, heap_stable);

// use r1 for load address
Register result_dst = dst;
Expand All @@ -253,51 +251,36 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier_not_null(MacroAssembl
__ lea(r1, load_addr);
__ mov(r0, dst);

__ far_call(RuntimeAddress(CAST_FROM_FN_PTR(address, ShenandoahBarrierSetAssembler::shenandoah_lrb())));

__ mov(result_dst, r0);
__ pop(to_save, sp);

__ bind(done);
__ leave();
}

void ShenandoahBarrierSetAssembler::load_reference_barrier_weak(MacroAssembler* masm, Register dst, Address load_addr) {
if (!ShenandoahLoadRefBarrier) {
return;
// Test for in-cset
if (!weak) {
__ mov(rscratch2, ShenandoahHeap::in_cset_fast_test_addr());
__ lsr(rscratch1, r0, ShenandoahHeapRegion::region_size_bytes_shift_jint());
__ ldrb(rscratch2, Address(rscratch2, rscratch1));
__ tbz(rscratch2, 0, not_cset);
}

assert(dst != rscratch2, "need rscratch2");

Label is_null;
Label done;

__ block_comment("load_reference_barrier_weak { ");

__ cbz(dst, is_null);

__ enter();

Address gc_state(rthread, in_bytes(ShenandoahThreadLocalData::gc_state_offset()));
__ ldrb(rscratch2, gc_state);

// Check for heap in evacuation phase
__ tbz(rscratch2, ShenandoahHeap::HAS_FORWARDED_BITPOS, done);

__ mov(rscratch2, dst);
__ push_call_clobbered_registers();
__ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak));
__ lea(r1, load_addr);
__ mov(r0, rscratch2);
if (weak) {
__ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak));
} else {
if (UseCompressedOops) {
__ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_narrow));
} else {
__ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier));
}
}
__ blr(lr);
__ mov(rscratch2, r0);
__ mov(rscratch1, r0);
__ pop_call_clobbered_registers();
__ mov(dst, rscratch2);
__ mov(r0, rscratch1);

__ bind(done);
__ bind(not_cset);

__ mov(result_dst, r0);
__ pop(to_save, sp);

__ bind(heap_stable);
__ leave();
__ bind(is_null);
__ block_comment("} load_reference_barrier_weak");
}

void ShenandoahBarrierSetAssembler::storeval_barrier(MacroAssembler* masm, Register dst, Register tmp) {
Expand All @@ -308,15 +291,6 @@ void ShenandoahBarrierSetAssembler::storeval_barrier(MacroAssembler* masm, Regis
}
}

void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm, Register dst, Address load_addr) {
if (ShenandoahLoadRefBarrier) {
Label is_null;
__ cbz(dst, is_null);
load_reference_barrier_not_null(masm, dst, load_addr);
__ bind(is_null);
}
}

//
// Arguments:
//
Expand Down Expand Up @@ -352,11 +326,8 @@ void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet d

BarrierSetAssembler::load_at(masm, decorators, type, dst, src, tmp1, tmp_thread);

if (ShenandoahBarrierSet::use_load_reference_barrier_weak(decorators, type)) {
load_reference_barrier_weak(masm, dst, src);
} else {
load_reference_barrier(masm, dst, src);
}
bool weak = ShenandoahBarrierSet::use_load_reference_barrier_weak(decorators, type);
load_reference_barrier(masm, dst, src, weak);

if (dst != result_dst) {
__ mov(result_dst, dst);
Expand Down Expand Up @@ -754,67 +725,3 @@ void ShenandoahBarrierSetAssembler::generate_c1_load_reference_barrier_runtime_s
#undef __

#endif // COMPILER1

address ShenandoahBarrierSetAssembler::shenandoah_lrb() {
assert(_shenandoah_lrb != NULL, "need load reference barrier stub");
return _shenandoah_lrb;
}

#define __ cgen->assembler()->

// Shenandoah load reference barrier.
//
// Input:
// r0: OOP to evacuate. Not null.
// r1: load address
//
// Output:
// r0: Pointer to evacuated OOP.
//
// Trash rscratch1, rscratch2. Preserve everything else.
address ShenandoahBarrierSetAssembler::generate_shenandoah_lrb(StubCodeGenerator* cgen) {

__ align(6);
StubCodeMark mark(cgen, "StubRoutines", "shenandoah_lrb");
address start = __ pc();

Label slow_path;
__ mov(rscratch2, ShenandoahHeap::in_cset_fast_test_addr());
__ lsr(rscratch1, r0, ShenandoahHeapRegion::region_size_bytes_shift_jint());
__ ldrb(rscratch2, Address(rscratch2, rscratch1));
__ tbnz(rscratch2, 0, slow_path);
__ ret(lr);

__ bind(slow_path);
__ enter(); // required for proper stackwalking of RuntimeStub frame

__ push_call_clobbered_registers();

if (UseCompressedOops) {
__ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_narrow));
} else {
__ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier));
}
__ blr(lr);
__ mov(rscratch1, r0);
__ pop_call_clobbered_registers();
__ mov(r0, rscratch1);

__ leave(); // required for proper stackwalking of RuntimeStub frame
__ ret(lr);

return start;
}

#undef __

void ShenandoahBarrierSetAssembler::barrier_stubs_init() {
if (ShenandoahLoadRefBarrier) {
int stub_code_size = 2048;
ResourceMark rm;
BufferBlob* bb = BufferBlob::create("shenandoah_barrier_stubs", stub_code_size);
CodeBuffer buf(bb);
StubCodeGenerator cgen(&buf);
_shenandoah_lrb = generate_shenandoah_lrb(&cgen);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ class StubCodeGenerator;
class ShenandoahBarrierSetAssembler: public BarrierSetAssembler {
private:

static address _shenandoah_lrb;

void satb_write_barrier_pre(MacroAssembler* masm,
Register obj,
Register pre_val,
Expand All @@ -57,14 +55,9 @@ class ShenandoahBarrierSetAssembler: public BarrierSetAssembler {

void resolve_forward_pointer(MacroAssembler* masm, Register dst, Register tmp = noreg);
void resolve_forward_pointer_not_null(MacroAssembler* masm, Register dst, Register tmp = noreg);
void load_reference_barrier(MacroAssembler* masm, Register dst, Address load_addr);
void load_reference_barrier_not_null(MacroAssembler* masm, Register dst, Address load_addr);
void load_reference_barrier_weak(MacroAssembler* masm, Register dst, Address load_addr);

address generate_shenandoah_lrb(StubCodeGenerator* cgen);
void load_reference_barrier(MacroAssembler* masm, Register dst, Address load_addr, bool weak);

public:
static address shenandoah_lrb();

void storeval_barrier(MacroAssembler* masm, Register dst, Register tmp);

Expand All @@ -85,8 +78,6 @@ class ShenandoahBarrierSetAssembler: public BarrierSetAssembler {
Register obj, Register tmp, Label& slowpath);
void cmpxchg_oop(MacroAssembler* masm, Register addr, Register expected, Register new_val,
bool acquire, bool release, bool is_cae, Register result);

virtual void barrier_stubs_init();
};

#endif // CPU_AARCH64_GC_SHENANDOAH_SHENANDOAHBARRIERSETASSEMBLER_AARCH64_HPP
3 changes: 1 addition & 2 deletions src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1498,8 +1498,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,

// Generate stack overflow check
if (UseStackBanging) {
assert(StackOverflow::stack_shadow_zone_size() == (int)StackOverflow::stack_shadow_zone_size(), "must be same");
__ bang_stack_with_offset((int)StackOverflow::stack_shadow_zone_size());
__ bang_stack_with_offset(checked_cast<int>(StackOverflow::stack_shadow_zone_size()));
} else {
Unimplemented();
}
Expand Down
Loading

0 comments on commit 1c3f2e1

Please sign in to comment.