Skip to content

Commit 8db9dcb

Browse files
committed
Pull/2200 (openjdk#5)
1 parent 2472a78 commit 8db9dcb

File tree

3 files changed

+15
-50
lines changed

3 files changed

+15
-50
lines changed

src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
774774
return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry, c2i_no_clinit_check_entry);
775775
}
776776

777-
int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
777+
static int c_calling_convention_priv(const BasicType *sig_bt,
778778
VMRegPair *regs,
779779
VMRegPair *regs2,
780780
int total_args_passed) {
@@ -863,6 +863,16 @@ int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
863863
return stk_args;
864864
}
865865

866+
int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
867+
VMRegPair *regs,
868+
VMRegPair *regs2,
869+
int total_args_passed)
870+
{
871+
int result = c_calling_convention_priv(sig_bt, regs, regs2, total_args_passed);
872+
guarantee(result >= 0, "Unsupported arguments configuration");
873+
return result;
874+
}
875+
866876
// On 64 bit we will store integer like items to the stack as
867877
// 64 bits items (Aarch64 abi) even though java would only store
868878
// 32bits for a parameter. On 32bit it will simply be 32 bits
@@ -1368,7 +1378,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
13681378
// Now figure out where the args must be stored and how much stack space
13691379
// they require.
13701380
int out_arg_slots;
1371-
out_arg_slots = c_calling_convention(out_sig_bt, out_regs, NULL, total_c_args);
1381+
out_arg_slots = c_calling_convention_priv(out_sig_bt, out_regs, NULL, total_c_args);
13721382

13731383
if (out_arg_slots < 0) {
13741384
return NULL;

src/hotspot/os_cpu/bsd_aarch64/atomic_bsd_aarch64.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ inline T Atomic::PlatformXchg<byte_size>::operator()(T volatile* dest,
5757
return res;
5858
}
5959

60-
// __attribute__((unused)) on dest is to get rid of spurious GCC warnings.
6160
template<size_t byte_size>
6261
template<typename T>
63-
inline T Atomic::PlatformCmpxchg<byte_size>::operator()(T volatile* dest __attribute__((unused)),
62+
inline T Atomic::PlatformCmpxchg<byte_size>::operator()(T volatile* dest,
6463
T compare_value,
6564
T exchange_value,
6665
atomic_memory_order order) const {

src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
# include <stdio.h>
6868
# include <unistd.h>
6969
# include <sys/resource.h>
70-
# include <pthread.h>
7170
# include <sys/stat.h>
7271
# include <sys/time.h>
7372
# include <sys/utsname.h>
@@ -83,27 +82,14 @@
8382
# include <pthread_np.h>
8483
#endif
8584

86-
// needed by current_stack_region() workaround for Mavericks
87-
#if defined(__APPLE__)
88-
# include <errno.h>
89-
# include <sys/types.h>
90-
# include <sys/sysctl.h>
91-
# define DEFAULT_MAIN_THREAD_STACK_PAGES 2048
92-
# define OS_X_10_9_0_KERNEL_MAJOR_VERSION 13
93-
#endif
94-
9585
#define SPELL_REG_SP "sp"
9686
#define SPELL_REG_FP "fp"
9787

9888
#ifdef __APPLE__
9989
// see darwin-xnu/osfmk/mach/arm/_structs.h
10090

101-
# if __DARWIN_UNIX03 && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
102-
// 10.5 UNIX03 member name prefixes
103-
#define DU3_PREFIX(s, m) __ ## s.__ ## m
104-
# else
105-
#define DU3_PREFIX(s, m) s ## . ## m
106-
# endif
91+
// 10.5 UNIX03 member name prefixes
92+
#define DU3_PREFIX(s, m) __ ## s.__ ## m
10793
#endif
10894

10995
#define context_x uc_mcontext->DU3_PREFIX(ss,x)
@@ -213,15 +199,6 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
213199
// point of execution.
214200
ThreadWXEnable wx(WXWrite, thread);
215201

216-
/*
217-
NOTE: does not seem to work on bsd.
218-
if (info == NULL || info->si_code <= 0 || info->si_code == SI_NOINFO) {
219-
// can't decode this kind of signal
220-
info = NULL;
221-
} else {
222-
assert(sig == info->si_signo, "bad siginfo");
223-
}
224-
*/
225202
// decide if this trap can be handled by a stub
226203
address stub = NULL;
227204

@@ -379,27 +356,6 @@ static void current_stack_region(address * bottom, size_t * size) {
379356
pthread_t self = pthread_self();
380357
void *stacktop = pthread_get_stackaddr_np(self);
381358
*size = pthread_get_stacksize_np(self);
382-
// workaround for OS X 10.9.0 (Mavericks)
383-
// pthread_get_stacksize_np returns 128 pages even though the actual size is 2048 pages
384-
if (pthread_main_np() == 1) {
385-
// At least on Mac OS 10.12 we have observed stack sizes not aligned
386-
// to pages boundaries. This can be provoked by e.g. setrlimit() (ulimit -s xxxx in the
387-
// shell). Apparently Mac OS actually rounds upwards to next multiple of page size,
388-
// however, we round downwards here to be on the safe side.
389-
*size = align_down(*size, getpagesize());
390-
391-
if ((*size) < (DEFAULT_MAIN_THREAD_STACK_PAGES * (size_t)getpagesize())) {
392-
char kern_osrelease[256];
393-
size_t kern_osrelease_size = sizeof(kern_osrelease);
394-
int ret = sysctlbyname("kern.osrelease", kern_osrelease, &kern_osrelease_size, NULL, 0);
395-
if (ret == 0) {
396-
// get the major number, atoi will ignore the minor amd micro portions of the version string
397-
if (atoi(kern_osrelease) >= OS_X_10_9_0_KERNEL_MAJOR_VERSION) {
398-
*size = (DEFAULT_MAIN_THREAD_STACK_PAGES*getpagesize());
399-
}
400-
}
401-
}
402-
}
403359
*bottom = (address) stacktop - *size;
404360
#elif defined(__OpenBSD__)
405361
stack_t ss;

0 commit comments

Comments
 (0)