Skip to content

Commit a3dcece

Browse files
author
Datadog Syncup Service
committed
Merge branch 'upstream-master'
2 parents 7465ba1 + b0ac633 commit a3dcece

File tree

93 files changed

+3585
-16282
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+3585
-16282
lines changed

make/common/FileUtils.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ ifeq ($(call isTargetOs, macosx), true)
136136
$(CP) -fRP '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'; \
137137
fi
138138
if [ -n "`$(XATTR) -ls '$(call DecodeSpace, $@)'`" ]; then \
139-
$(CHMOD) u+w '$(call DecodeSpace, $@)'; \
139+
$(CHMOD) -h u+w '$(call DecodeSpace, $@)'; \
140140
$(XATTR) -cs '$(call DecodeSpace, $@)'; \
141141
fi
142142
endef

src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -758,15 +758,14 @@ void ZBarrierSetAssembler::generate_c2_store_barrier_stub(MacroAssembler* masm,
758758
__ la(c_rarg0, stub->ref_addr());
759759

760760
if (stub->is_native()) {
761-
__ la(t1, RuntimeAddress(ZBarrierSetRuntime::store_barrier_on_native_oop_field_without_healing_addr()));
761+
__ rt_call(ZBarrierSetRuntime::store_barrier_on_native_oop_field_without_healing_addr());
762762
} else if (stub->is_atomic()) {
763-
__ la(t1, RuntimeAddress(ZBarrierSetRuntime::store_barrier_on_oop_field_with_healing_addr()));
763+
__ rt_call(ZBarrierSetRuntime::store_barrier_on_oop_field_with_healing_addr());
764764
} else if (stub->is_nokeepalive()) {
765-
__ la(t1, RuntimeAddress(ZBarrierSetRuntime::no_keepalive_store_barrier_on_oop_field_without_healing_addr()));
765+
__ rt_call(ZBarrierSetRuntime::no_keepalive_store_barrier_on_oop_field_without_healing_addr());
766766
} else {
767-
__ la(t1, RuntimeAddress(ZBarrierSetRuntime::store_barrier_on_oop_field_without_healing_addr()));
767+
__ rt_call(ZBarrierSetRuntime::store_barrier_on_oop_field_without_healing_addr());
768768
}
769-
__ jalr(t1);
770769
}
771770

772771
// Stub exit

src/hotspot/cpu/riscv/macroAssembler_riscv.cpp

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -454,12 +454,7 @@ void MacroAssembler::call_VM_base(Register oop_result,
454454
ld(t0, Address(java_thread, in_bytes(Thread::pending_exception_offset())));
455455
Label ok;
456456
beqz(t0, ok);
457-
RuntimeAddress target(StubRoutines::forward_exception_entry());
458-
relocate(target.rspec(), [&] {
459-
int32_t offset;
460-
la(t1, target.target(), offset);
461-
jr(t1, offset);
462-
});
457+
j(RuntimeAddress(StubRoutines::forward_exception_entry()));
463458
bind(ok);
464459
}
465460

@@ -977,17 +972,19 @@ void MacroAssembler::j(const address dest, Register temp) {
977972
}
978973
}
979974

980-
void MacroAssembler::j(const Address &adr, Register temp) {
981-
switch (adr.getMode()) {
975+
void MacroAssembler::j(const Address &dest, Register temp) {
976+
switch (dest.getMode()) {
982977
case Address::literal: {
983-
relocate(adr.rspec(), [&] {
984-
j(adr.target(), temp);
978+
relocate(dest.rspec(), [&] {
979+
int32_t offset;
980+
la(temp, dest.target(), offset);
981+
jr(temp, offset);
985982
});
986983
break;
987984
}
988985
case Address::base_plus_offset: {
989-
int32_t offset = ((int32_t)adr.offset() << 20) >> 20;
990-
la(temp, Address(adr.base(), adr.offset() - offset));
986+
int32_t offset = ((int32_t)dest.offset() << 20) >> 20;
987+
la(temp, Address(dest.base(), dest.offset() - offset));
991988
jr(temp, offset);
992989
break;
993990
}
@@ -4194,8 +4191,7 @@ void MacroAssembler::reserved_stack_check() {
41944191
// We have already removed our own frame.
41954192
// throw_delayed_StackOverflowError will think that it's been
41964193
// called by our caller.
4197-
la(t1, RuntimeAddress(SharedRuntime::throw_delayed_StackOverflowError_entry()));
4198-
jr(t1);
4194+
j(RuntimeAddress(SharedRuntime::throw_delayed_StackOverflowError_entry()));
41994195
should_not_reach_here();
42004196

42014197
bind(no_reserved_zone_enabling);

src/hotspot/cpu/riscv/macroAssembler_riscv.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ class MacroAssembler: public Assembler {
663663
// For long reach uses temp register for:
664664
// la + jr
665665
void j(const address dest, Register temp = t1);
666-
void j(const Address &adr, Register temp = t1);
666+
void j(const Address &dest, Register temp = t1);
667667
void j(Label &l, Register temp = noreg);
668668

669669
// jump register: jalr x0, offset(rs)

src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,8 +1139,7 @@ static void gen_continuation_yield(MacroAssembler* masm,
11391139
Label ok;
11401140
__ beqz(t0, ok);
11411141
__ leave();
1142-
__ la(t1, RuntimeAddress(StubRoutines::forward_exception_entry()));
1143-
__ jr(t1);
1142+
__ j(RuntimeAddress(StubRoutines::forward_exception_entry()));
11441143
__ bind(ok);
11451144

11461145
__ leave();

src/hotspot/cpu/riscv/stubGenerator_riscv.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ class StubGenerator: public StubCodeGenerator {
508508
// complete return to VM
509509
assert(StubRoutines::_call_stub_return_address != nullptr,
510510
"_call_stub_return_address must have been generated before");
511-
__ j(StubRoutines::_call_stub_return_address);
511+
__ j(RuntimeAddress(StubRoutines::_call_stub_return_address));
512512

513513
return start;
514514
}
@@ -3782,8 +3782,7 @@ class StubGenerator: public StubCodeGenerator {
37823782
Label thaw_success;
37833783
// t1 contains the size of the frames to thaw, 0 if overflow or no more frames
37843784
__ bnez(t1, thaw_success);
3785-
__ la(t1, RuntimeAddress(SharedRuntime::throw_StackOverflowError_entry()));
3786-
__ jr(t1);
3785+
__ j(RuntimeAddress(SharedRuntime::throw_StackOverflowError_entry()));
37873786
__ bind(thaw_success);
37883787

37893788
// make room for the thawed frames

src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ address TemplateInterpreterGenerator::generate_exception_handler_common(
421421
c_rarg1, c_rarg2);
422422
}
423423
// throw exception
424-
__ j(address(Interpreter::throw_exception_entry()));
424+
__ j(RuntimeAddress(Interpreter::throw_exception_entry()));
425425
return entry;
426426
}
427427

src/hotspot/cpu/riscv/templateTable_riscv.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ void TemplateTable::aastore() {
10851085

10861086
// Come here on failure
10871087
// object is at TOS
1088-
__ j(Interpreter::_throw_ArrayStoreException_entry);
1088+
__ j(RuntimeAddress(Interpreter::_throw_ArrayStoreException_entry));
10891089

10901090
// Come here on success
10911091
__ bind(ok_is_subtype);
@@ -3672,7 +3672,7 @@ void TemplateTable::checkcast() {
36723672
// Come here on failure
36733673
__ push_reg(x13);
36743674
// object is at TOS
3675-
__ j(Interpreter::_throw_ClassCastException_entry);
3675+
__ j(RuntimeAddress(Interpreter::_throw_ClassCastException_entry));
36763676

36773677
// Come here on success
36783678
__ bind(ok_is_subtype);
@@ -3779,7 +3779,7 @@ void TemplateTable::_breakpoint() {
37793779
void TemplateTable::athrow() {
37803780
transition(atos, vtos);
37813781
__ null_check(x10);
3782-
__ j(Interpreter::throw_exception_entry());
3782+
__ j(RuntimeAddress(Interpreter::throw_exception_entry()));
37833783
}
37843784

37853785
//-----------------------------------------------------------------------------

src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,8 +837,9 @@ void C2_MacroAssembler::fast_unlock_lightweight(Register obj, Register reg_rax,
837837
#ifdef ASSERT
838838
// Check that unlocked label is reached with ZF set.
839839
Label zf_correct;
840+
Label zf_bad_zero;
840841
jcc(Assembler::zero, zf_correct);
841-
stop("Fast Unlock ZF != 1");
842+
jmp(zf_bad_zero);
842843
#endif
843844

844845
bind(slow_path);
@@ -847,8 +848,10 @@ void C2_MacroAssembler::fast_unlock_lightweight(Register obj, Register reg_rax,
847848
}
848849
#ifdef ASSERT
849850
// Check that stub->continuation() label is reached with ZF not set.
850-
jccb(Assembler::notZero, zf_correct);
851+
jcc(Assembler::notZero, zf_correct);
851852
stop("Fast Unlock ZF != 0");
853+
bind(zf_bad_zero);
854+
stop("Fast Unlock ZF != 1");
852855
bind(zf_correct);
853856
#endif
854857
// C2 uses the value of ZF to determine the continuation.

src/hotspot/os/windows/os_windows.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5753,7 +5753,15 @@ void PlatformEvent::park() {
57535753
// TODO: consider a brief spin here, gated on the success of recent
57545754
// spin attempts by this thread.
57555755
while (_Event < 0) {
5756+
// The following code is only here to maintain the
5757+
// characteristics/performance from when an ObjectMonitor
5758+
// "responsible" thread used to issue timed parks.
5759+
HighResolutionInterval *phri = nullptr;
5760+
if (!ForceTimeHighResolution) {
5761+
phri = new HighResolutionInterval((jlong)1);
5762+
}
57565763
DWORD rv = ::WaitForSingleObject(_ParkHandle, INFINITE);
5764+
delete phri; // if it is null, harmless
57575765
assert(rv != WAIT_FAILED, "WaitForSingleObject failed with error code: %lu", GetLastError());
57585766
assert(rv == WAIT_OBJECT_0, "WaitForSingleObject failed with return value: %lu", rv);
57595767
}

0 commit comments

Comments
 (0)