Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c1f4cb7

Browse files
author
kuenking111
committedFeb 16, 2022
I4TXX8: Fix code consistency after upgrade 8u322
1 parent 93c4148 commit c1f4cb7

File tree

36 files changed

+377
-191
lines changed

36 files changed

+377
-191
lines changed
 

‎hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -3307,6 +3307,77 @@ class StubGenerator: public StubCodeGenerator {
33073307
return start;
33083308
}
33093309

3310+
address load_BLAS_library() {
3311+
// Try to load BLAS library.
3312+
const char library_name[] = "openblas";
3313+
char err_buf[1024] = {0};
3314+
char path[JVM_MAXPATHLEN] = {0};
3315+
os::jvm_path(path, sizeof(path));
3316+
int jvm_offset = -1;
3317+
3318+
// Match "jvm[^/]*" in jvm_path.
3319+
const char* last_name = strrchr(path, '/');
3320+
last_name = last_name ? last_name : path;
3321+
const char* last_lib_name = strstr(last_name, "jvm");
3322+
if (last_lib_name != NULL) {
3323+
jvm_offset = last_lib_name - path;
3324+
}
3325+
3326+
address library = NULL;
3327+
// Find the BLAS shared library.
3328+
// Search path: <home>/jre/lib/<arch>/<vm>/libopenblas.so
3329+
if (jvm_offset >= 0) {
3330+
if (jvm_offset + strlen(library_name) + strlen(os::dll_file_extension()) < JVM_MAXPATHLEN) {
3331+
strncpy(&path[jvm_offset], library_name, strlen(library_name));
3332+
strncat(&path[jvm_offset], os::dll_file_extension(), strlen(os::dll_file_extension()));
3333+
library = (address)os::dll_load(path, err_buf, sizeof(err_buf));
3334+
}
3335+
}
3336+
return library;
3337+
}
3338+
3339+
address get_BLAS_func_entry(address library, const char* func_name) {
3340+
if (library == NULL) {
3341+
return NULL;
3342+
}
3343+
3344+
// Try to find BLAS function entry.
3345+
return (address)os::dll_lookup((void*)library, func_name);
3346+
}
3347+
3348+
/**
3349+
* Arguments:
3350+
*
3351+
* Inputs:
3352+
* c_rarg0 - int n
3353+
* c_rarg1 - double[] dx
3354+
* c_rarg2 - int incx
3355+
* c_rarg3 - double[] dy
3356+
* c_rarg4 - int incy
3357+
*
3358+
* Output:
3359+
* d0 - ddot result
3360+
*
3361+
*/
3362+
address generate_ddotF2jBLAS() {
3363+
__ align(CodeEntryAlignment);
3364+
StubCodeMark mark(this, "StubRoutines", "f2jblas_ddot");
3365+
3366+
address start = __ pc();
3367+
3368+
const Register n = c_rarg0;
3369+
const Register dx = c_rarg1;
3370+
const Register incx = c_rarg2;
3371+
const Register dy = c_rarg3;
3372+
const Register incy = c_rarg4;
3373+
3374+
BLOCK_COMMENT("Entry:");
3375+
3376+
__ f2j_ddot(n, dx, incx, dy, incy, rscratch2);
3377+
3378+
return start;
3379+
}
3380+
33103381
// Parameter conversion from JVM to native BLAS
33113382
//
33123383
// Register:
@@ -3519,77 +3590,6 @@ class StubGenerator: public StubCodeGenerator {
35193590

35203591

35213592

3522-
/**
3523-
* Arguments:
3524-
*
3525-
* Inputs:
3526-
* c_rarg0 - int n
3527-
* c_rarg1 - double[] dx
3528-
* c_rarg2 - int incx
3529-
* c_rarg3 - double[] dy
3530-
* c_rarg4 - int incy
3531-
*
3532-
* Output:
3533-
* d0 - ddot result
3534-
*
3535-
*/
3536-
address generate_ddotF2jBLAS() {
3537-
__ align(CodeEntryAlignment);
3538-
StubCodeMark mark(this, "StubRoutines", "f2jblas_ddot");
3539-
3540-
address start = __ pc();
3541-
3542-
const Register n = c_rarg0;
3543-
const Register dx = c_rarg1;
3544-
const Register incx = c_rarg2;
3545-
const Register dy = c_rarg3;
3546-
const Register incy = c_rarg4;
3547-
3548-
BLOCK_COMMENT("Entry:");
3549-
3550-
__ f2j_ddot(n, dx, incx, dy, incy, rscratch2);
3551-
3552-
return start;
3553-
}
3554-
3555-
address load_BLAS_library() {
3556-
// Try to load BLAS library.
3557-
const char library_name[] = "openblas";
3558-
char err_buf[1024] = {0};
3559-
char path[JVM_MAXPATHLEN] = {0};
3560-
os::jvm_path(path, sizeof(path));
3561-
int jvm_offset = -1;
3562-
3563-
// Match "jvm[^/]*" in jvm_path.
3564-
const char* last_name = strrchr(path, '/');
3565-
last_name = last_name ? last_name : path;
3566-
const char* last_lib_name = strstr(last_name, "jvm");
3567-
if (last_lib_name != NULL) {
3568-
jvm_offset = last_lib_name - path;
3569-
}
3570-
3571-
address library = NULL;
3572-
// Find the BLAS shared library.
3573-
// Search path: <home>/jre/lib/<arch>/<vm>/libopenblas.so
3574-
if (jvm_offset >= 0) {
3575-
if (jvm_offset + strlen(library_name) + strlen(os::dll_file_extension()) < JVM_MAXPATHLEN) {
3576-
strncpy(&path[jvm_offset], library_name, strlen(library_name));
3577-
strncat(&path[jvm_offset], os::dll_file_extension(), strlen(os::dll_file_extension()));
3578-
library = (address)os::dll_load(path, err_buf, sizeof(err_buf));
3579-
}
3580-
}
3581-
return library;
3582-
}
3583-
3584-
address get_BLAS_func_entry(address library, const char* func_name) {
3585-
if (library == NULL) {
3586-
return NULL;
3587-
}
3588-
3589-
// Try to find BLAS function entry.
3590-
return (address)os::dll_lookup((void*)library, func_name);
3591-
}
3592-
35933593
/**
35943594
* Arguments:
35953595
*

‎hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,11 @@ PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
280280

281281
address os::current_stack_pointer() {
282282
#if defined(__clang__) || defined(__llvm__)
283-
register void *esp;
283+
void *esp;
284284
__asm__("mov %%" SPELL_REG_SP ", %0":"=r"(esp));
285285
return (address) esp;
286286
#elif defined(SPARC_WORKS)
287-
register void *esp;
287+
void *esp;
288288
__asm__("mov %%" SPELL_REG_SP ", %0":"=r"(esp));
289289
return (address) ((char*)esp + sizeof(long)*2);
290290
#else
@@ -367,7 +367,7 @@ frame os::get_sender_for_C_frame(frame* fr) {
367367

368368
intptr_t* _get_previous_fp() {
369369
#if defined(SPARC_WORKS) || defined(__clang__) || defined(__llvm__)
370-
register intptr_t **ebp;
370+
intptr_t **ebp;
371371
__asm__("mov %%" SPELL_REG_FP ", %0":"=r"(ebp));
372372
#else
373373
register intptr_t **ebp __asm__ (SPELL_REG_FP);

‎hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
9292

9393
address os::current_stack_pointer() {
9494
#ifdef SPARC_WORKS
95-
register void *esp;
95+
void *esp;
9696
__asm__("mov %%"SPELL_REG_SP", %0":"=r"(esp));
9797
return (address) ((char*)esp + sizeof(long)*2);
9898
#elif defined(__clang__)
99-
intptr_t* esp;
99+
void* esp;
100100
__asm__ __volatile__ ("mov %%"SPELL_REG_SP", %0":"=r"(esp):);
101101
return (address) esp;
102102
#else
@@ -179,7 +179,7 @@ frame os::get_sender_for_C_frame(frame* fr) {
179179

180180
intptr_t* _get_previous_fp() {
181181
#ifdef SPARC_WORKS
182-
register intptr_t **ebp;
182+
intptr_t **ebp;
183183
__asm__("mov %%"SPELL_REG_FP", %0":"=r"(ebp));
184184
#elif defined(__clang__)
185185
intptr_t **ebp;

‎hotspot/src/share/vm/c1/c1_Runtime1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
542542
exception->print_value_string(), p2i((address)exception()), nm->method()->print_value_string(), p2i(pc), p2i(thread));
543543
}
544544
// for AbortVMOnException flag
545-
NOT_PRODUCT(Exceptions::debug_check_abort(exception));
545+
Exceptions::debug_check_abort(exception);
546546

547547
// Clear out the exception oop and pc since looking up an
548548
// exception handler can cause class loading, which might throw an

‎hotspot/src/share/vm/code/nmethod.cpp

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,24 +1656,28 @@ bool nmethod::can_unload(BoolObjectClosure* is_alive, oop* root, bool unloading_
16561656
// Transfer information from compilation to jvmti
16571657
void nmethod::post_compiled_method_load_event() {
16581658

1659-
Method* moop = method();
1659+
// This is a bad time for a safepoint. We don't want
1660+
// this nmethod to get unloaded while we're queueing the event.
1661+
No_Safepoint_Verifier nsv;
1662+
1663+
Method* m = method();
16601664
#ifndef USDT2
16611665
HS_DTRACE_PROBE8(hotspot, compiled__method__load,
1662-
moop->klass_name()->bytes(),
1663-
moop->klass_name()->utf8_length(),
1664-
moop->name()->bytes(),
1665-
moop->name()->utf8_length(),
1666-
moop->signature()->bytes(),
1667-
moop->signature()->utf8_length(),
1666+
m->klass_name()->bytes(),
1667+
m->klass_name()->utf8_length(),
1668+
m->name()->bytes(),
1669+
m->name()->utf8_length(),
1670+
m->signature()->bytes(),
1671+
m->signature()->utf8_length(),
16681672
insts_begin(), insts_size());
16691673
#else /* USDT2 */
16701674
HOTSPOT_COMPILED_METHOD_LOAD(
1671-
(char *) moop->klass_name()->bytes(),
1672-
moop->klass_name()->utf8_length(),
1673-
(char *) moop->name()->bytes(),
1674-
moop->name()->utf8_length(),
1675-
(char *) moop->signature()->bytes(),
1676-
moop->signature()->utf8_length(),
1675+
(char *) m->klass_name()->bytes(),
1676+
m->klass_name()->utf8_length(),
1677+
(char *) m->name()->bytes(),
1678+
m->name()->utf8_length(),
1679+
(char *) m->signature()->bytes(),
1680+
m->signature()->utf8_length(),
16771681
insts_begin(), insts_size());
16781682
#endif /* USDT2 */
16791683

‎hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -508,13 +508,13 @@ BytecodeInterpreter::run(interpreterState istate) {
508508
interpreterState orig = istate;
509509
#endif
510510

511-
register intptr_t* topOfStack = (intptr_t *)istate->stack(); /* access with STACK macros */
512-
register address pc = istate->bcp();
513-
register jubyte opcode;
514-
register intptr_t* locals = istate->locals();
515-
register ConstantPoolCache* cp = istate->constants(); // method()->constants()->cache()
511+
intptr_t* topOfStack = (intptr_t *)istate->stack(); /* access with STACK macros */
512+
address pc = istate->bcp();
513+
jubyte opcode;
514+
intptr_t* locals = istate->locals();
515+
ConstantPoolCache* cp = istate->constants(); // method()->constants()->cache()
516516
#ifdef LOTS_OF_REGS
517-
register JavaThread* THREAD = istate->thread();
517+
JavaThread* THREAD = istate->thread();
518518
#else
519519
#undef THREAD
520520
#define THREAD istate->thread()
@@ -603,7 +603,7 @@ BytecodeInterpreter::run(interpreterState istate) {
603603
/* 0xF8 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default,
604604
/* 0xFC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default
605605
};
606-
register uintptr_t *dispatch_table = (uintptr_t*)&opclabels_data[0];
606+
uintptr_t *dispatch_table = (uintptr_t*)&opclabels_data[0];
607607
#endif /* USELABELS */
608608

609609
#ifdef ASSERT
@@ -2861,7 +2861,7 @@ BytecodeInterpreter::run(interpreterState istate) {
28612861
(int)continuation_bci, p2i(THREAD));
28622862
}
28632863
// for AbortVMOnException flag
2864-
NOT_PRODUCT(Exceptions::debug_check_abort(except_oop));
2864+
Exceptions::debug_check_abort(except_oop);
28652865

28662866
// Update profiling data.
28672867
BI_PROFILE_ALIGN_TO_CURRENT_BCI();
@@ -2877,7 +2877,8 @@ BytecodeInterpreter::run(interpreterState istate) {
28772877
p2i(THREAD));
28782878
}
28792879
// for AbortVMOnException flag
2880-
NOT_PRODUCT(Exceptions::debug_check_abort(except_oop));
2880+
Exceptions::debug_check_abort(except_oop);
2881+
28812882
// No handler in this activation, unwind and try again
28822883
THREAD->set_pending_exception(except_oop(), NULL, 0);
28832884
goto handle_return;

‎hotspot/src/share/vm/interpreter/interpreterRuntime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ IRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea
472472
// // warning("performance bug: should not call runtime if method has no exception handlers");
473473
// }
474474
// for AbortVMOnException flag
475-
NOT_PRODUCT(Exceptions::debug_check_abort(h_exception));
475+
Exceptions::debug_check_abort(h_exception);
476476

477477
// exception handler lookup
478478
KlassHandle h_klass(THREAD, h_exception->klass());

‎hotspot/src/share/vm/libadt/dict.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,9 @@ void Dict::print() {
319319
// limited to MAXID characters in length. Experimental evidence on 150K of
320320
// C text shows excellent spreading of values for any size hash table.
321321
int hashstr(const void *t) {
322-
register char c, k = 0;
323-
register int32 sum = 0;
324-
register const char *s = (const char *)t;
322+
char c, k = 0;
323+
int32 sum = 0;
324+
const char *s = (const char *)t;
325325

326326
while( ((c = *s++) != '\0') && (k < MAXID-1) ) { // Get characters till null or MAXID-1
327327
c = (c<<1)+1; // Characters are always odd!

‎hotspot/src/share/vm/libadt/set.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ char *Set::setstr() const
7373
uint len = 128; // Total string space
7474
char *buf = NEW_C_HEAP_ARRAY(char,len, mtCompiler);// Some initial string space
7575

76-
register char *s = buf; // Current working string pointer
76+
char *s = buf; // Current working string pointer
7777
*s++ = '{';
7878
*s = '\0';
7979

@@ -125,8 +125,8 @@ void Set::print() const
125125
// Set. Return the amount of text parsed in "len", or zero in "len".
126126
int Set::parse(const char *s)
127127
{
128-
register char c; // Parse character
129-
register const char *t = s; // Save the starting position of s.
128+
char c; // Parse character
129+
const char *t = s; // Save the starting position of s.
130130
do c = *s++; // Skip characters
131131
while( c && (c <= ' ') ); // Till no more whitespace or EOS
132132
if( c != '{' ) return 0; // Oops, not a Set openner

0 commit comments

Comments
 (0)
Please sign in to comment.