8207011: Remove uses of the register storage class specifier
authormikael
Thu, 12 Jul 2018 17:29:48 -0700
changeset 51050 96ea37459ca7
parent 51049 70295a56c207
child 51051 4e98b465d706
8207011: Remove uses of the register storage class specifier Reviewed-by: kbarrett, kvn
src/hotspot/os_cpu/aix_ppc/orderAccess_aix_ppc.hpp
src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp
src/hotspot/os_cpu/linux_ppc/orderAccess_linux_ppc.hpp
src/hotspot/os_cpu/linux_s390/orderAccess_linux_s390.hpp
src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
src/hotspot/share/adlc/adlparse.cpp
src/hotspot/share/adlc/arena.cpp
src/hotspot/share/adlc/dict2.cpp
src/hotspot/share/adlc/main.cpp
src/hotspot/share/interpreter/bytecodeInterpreter.cpp
src/hotspot/share/libadt/dict.cpp
src/hotspot/share/libadt/set.cpp
src/hotspot/share/libadt/vectset.cpp
src/hotspot/share/memory/arena.cpp
src/hotspot/share/opto/mulnode.cpp
--- a/src/hotspot/os_cpu/aix_ppc/orderAccess_aix_ppc.hpp	Thu Jul 12 10:41:44 2018 -0400
+++ b/src/hotspot/os_cpu/aix_ppc/orderAccess_aix_ppc.hpp	Thu Jul 12 17:29:48 2018 -0700
@@ -82,7 +82,7 @@
 struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
 {
   template <typename T>
-  T operator()(const volatile T* p) const { register T t = Atomic::load(p); inlasm_acquire_reg(t); return t; }
+  T operator()(const volatile T* p) const { T t = Atomic::load(p); inlasm_acquire_reg(t); return t; }
 };
 
 #undef inlasm_sync
--- a/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp	Thu Jul 12 10:41:44 2018 -0400
+++ b/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp	Thu Jul 12 17:29:48 2018 -0700
@@ -279,11 +279,11 @@
 
 address os::current_stack_pointer() {
 #if defined(__clang__) || defined(__llvm__)
-  register void *esp;
+  void *esp;
   __asm__("mov %%" SPELL_REG_SP ", %0":"=r"(esp));
   return (address) esp;
 #elif defined(SPARC_WORKS)
-  register void *esp;
+  void *esp;
   __asm__("mov %%" SPELL_REG_SP ", %0":"=r"(esp));
   return (address) ((char*)esp + sizeof(long)*2);
 #else
@@ -415,7 +415,7 @@
 
 intptr_t* _get_previous_fp() {
 #if defined(SPARC_WORKS) || defined(__clang__) || defined(__llvm__)
-  register intptr_t **ebp;
+  intptr_t **ebp;
   __asm__("mov %%" SPELL_REG_FP ", %0":"=r"(ebp));
 #else
   register intptr_t **ebp __asm__ (SPELL_REG_FP);
--- a/src/hotspot/os_cpu/linux_ppc/orderAccess_linux_ppc.hpp	Thu Jul 12 10:41:44 2018 -0400
+++ b/src/hotspot/os_cpu/linux_ppc/orderAccess_linux_ppc.hpp	Thu Jul 12 17:29:48 2018 -0700
@@ -85,7 +85,7 @@
 struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
 {
   template <typename T>
-  T operator()(const volatile T* p) const { register T t = Atomic::load(p); inlasm_acquire_reg(t); return t; }
+  T operator()(const volatile T* p) const { T t = Atomic::load(p); inlasm_acquire_reg(t); return t; }
 };
 
 #undef inlasm_sync
--- a/src/hotspot/os_cpu/linux_s390/orderAccess_linux_s390.hpp	Thu Jul 12 10:41:44 2018 -0400
+++ b/src/hotspot/os_cpu/linux_s390/orderAccess_linux_s390.hpp	Thu Jul 12 17:29:48 2018 -0700
@@ -79,7 +79,7 @@
 struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
 {
   template <typename T>
-  T operator()(const volatile T* p) const { register T t = *p; inlasm_zarch_acquire(); return t; }
+  T operator()(const volatile T* p) const { T t = *p; inlasm_zarch_acquire(); return t; }
 };
 
 #undef inlasm_compiler_barrier
--- a/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp	Thu Jul 12 10:41:44 2018 -0400
+++ b/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp	Thu Jul 12 17:29:48 2018 -0700
@@ -95,11 +95,11 @@
 
 address os::current_stack_pointer() {
 #ifdef SPARC_WORKS
-  register void *esp;
+  void *esp;
   __asm__("mov %%" SPELL_REG_SP ", %0":"=r"(esp));
   return (address) ((char*)esp + sizeof(long)*2);
 #elif defined(__clang__)
-  intptr_t* esp;
+  void* esp;
   __asm__ __volatile__ ("mov %%" SPELL_REG_SP ", %0":"=r"(esp):);
   return (address) esp;
 #else
@@ -233,7 +233,7 @@
 
 intptr_t* _get_previous_fp() {
 #ifdef SPARC_WORKS
-  register intptr_t **ebp;
+  intptr_t **ebp;
   __asm__("mov %%" SPELL_REG_FP ", %0":"=r"(ebp));
 #elif defined(__clang__)
   intptr_t **ebp;
--- a/src/hotspot/share/adlc/adlparse.cpp	Thu Jul 12 10:41:44 2018 -0400
+++ b/src/hotspot/share/adlc/adlparse.cpp	Thu Jul 12 17:29:48 2018 -0700
@@ -4564,7 +4564,7 @@
 // string(still inside the file buffer).  Returns a pointer to the string or
 // NULL if some other token is found instead.
 char *ADLParser::get_ident_common(bool do_preproc) {
-  register char c;
+  char c;
   char *start;                    // Pointer to start of token
   char *end;                      // Pointer to end of token
 
@@ -4762,7 +4762,7 @@
 // invokes a parse_err if the next token is not an integer.
 // This routine does not leave the integer null-terminated.
 int ADLParser::get_int(void) {
-  register char c;
+  char          c;
   char         *start;            // Pointer to start of token
   char         *end;              // Pointer to end of token
   int           result;           // Storage for integer result
--- a/src/hotspot/share/adlc/arena.cpp	Thu Jul 12 10:41:44 2018 -0400
+++ b/src/hotspot/share/adlc/arena.cpp	Thu Jul 12 17:29:48 2018 -0700
@@ -79,7 +79,7 @@
 // Total of all Chunks in arena
 size_t Arena::used() const {
   size_t sum = _chunk->_len - (_max-_hwm); // Size leftover in this Chunk
-  register Chunk *k = _first;
+  Chunk *k = _first;
   while( k != _chunk) {         // Whilst have Chunks in a row
     sum += k->_len;             // Total size of this Chunk
     k = k->_next;               // Bump along to next Chunk
@@ -93,7 +93,7 @@
   // Get minimal required size.  Either real big, or even bigger for giant objs
   size_t len = max(x, Chunk::size);
 
-  register Chunk *k = _chunk;   // Get filled-up chunk address
+  Chunk *k = _chunk;            // Get filled-up chunk address
   _chunk = new (len) Chunk(len);
 
   if( k ) k->_next = _chunk;    // Append new chunk to end of linked list
--- a/src/hotspot/share/adlc/dict2.cpp	Thu Jul 12 10:41:44 2018 -0400
+++ b/src/hotspot/share/adlc/dict2.cpp	Thu Jul 12 17:29:48 2018 -0700
@@ -283,9 +283,9 @@
 // limited to MAXID characters in length.  Experimental evidence on 150K of
 // C text shows excellent spreading of values for any size hash table.
 int hashstr(const void *t) {
-  register char c, k = 0;
-  register int sum = 0;
-  register const char *s = (const char *)t;
+  char c, k = 0;
+  int sum = 0;
+  const char *s = (const char *)t;
 
   while (((c = s[k]) != '\0') && (k < MAXID-1)) { // Get characters till nul
     c = (char) ((c << 1) + 1);    // Characters are always odd!
--- a/src/hotspot/share/adlc/main.cpp	Thu Jul 12 10:41:44 2018 -0400
+++ b/src/hotspot/share/adlc/main.cpp	Thu Jul 12 17:29:48 2018 -0700
@@ -58,7 +58,7 @@
 
   // Read command line arguments and file names
   for( int i = 1; i < argc; i++ ) { // For all arguments
-    register char *s = argv[i]; // Get option/filename
+    char *s = argv[i];          // Get option/filename
 
     if( *s++ == '-' ) {         // It's a flag? (not a filename)
       if( !*s ) {               // Stand-alone `-' means stdin
--- a/src/hotspot/share/interpreter/bytecodeInterpreter.cpp	Thu Jul 12 10:41:44 2018 -0400
+++ b/src/hotspot/share/interpreter/bytecodeInterpreter.cpp	Thu Jul 12 17:29:48 2018 -0700
@@ -494,13 +494,13 @@
   interpreterState orig = istate;
 #endif
 
-  register intptr_t*        topOfStack = (intptr_t *)istate->stack(); /* access with STACK macros */
-  register address          pc = istate->bcp();
-  register jubyte opcode;
-  register intptr_t*        locals = istate->locals();
-  register ConstantPoolCache*    cp = istate->constants(); // method()->constants()->cache()
+  intptr_t*        topOfStack = (intptr_t *)istate->stack(); /* access with STACK macros */
+  address          pc = istate->bcp();
+  jubyte opcode;
+  intptr_t*        locals = istate->locals();
+  ConstantPoolCache*    cp = istate->constants(); // method()->constants()->cache()
 #ifdef LOTS_OF_REGS
-  register JavaThread*      THREAD = istate->thread();
+  JavaThread*      THREAD = istate->thread();
 #else
 #undef THREAD
 #define THREAD istate->thread()
@@ -589,7 +589,7 @@
 /* 0xF8 */ &&opc_default,     &&opc_default,        &&opc_default,      &&opc_default,
 /* 0xFC */ &&opc_default,     &&opc_default,        &&opc_default,      &&opc_default
   };
-  register uintptr_t *dispatch_table = (uintptr_t*)&opclabels_data[0];
+  uintptr_t *dispatch_table = (uintptr_t*)&opclabels_data[0];
 #endif /* USELABELS */
 
 #ifdef ASSERT
--- a/src/hotspot/share/libadt/dict.cpp	Thu Jul 12 10:41:44 2018 -0400
+++ b/src/hotspot/share/libadt/dict.cpp	Thu Jul 12 17:29:48 2018 -0700
@@ -305,9 +305,9 @@
 // limited to MAXID characters in length.  Experimental evidence on 150K of
 // C text shows excellent spreading of values for any size hash table.
 int hashstr(const void *t) {
-  register char c, k = 0;
-  register int32_t sum = 0;
-  register const char *s = (const char *)t;
+  char c, k = 0;
+  int32_t sum = 0;
+  const char *s = (const char *)t;
 
   while( ((c = *s++) != '\0') && (k < MAXID-1) ) { // Get characters till null or MAXID-1
     c = (c<<1)+1;               // Characters are always odd!
--- a/src/hotspot/share/libadt/set.cpp	Thu Jul 12 10:41:44 2018 -0400
+++ b/src/hotspot/share/libadt/set.cpp	Thu Jul 12 17:29:48 2018 -0700
@@ -64,7 +64,7 @@
   uint len = 128;               // Total string space
   char *buf = NEW_C_HEAP_ARRAY(char,len, mtCompiler);// Some initial string space
 
-  register char *s = buf;       // Current working string pointer
+  char *s = buf;                // Current working string pointer
   *s++ = '{';
   *s = '\0';
 
@@ -116,8 +116,8 @@
 // Set.  Return the amount of text parsed in "len", or zero in "len".
 int Set::parse(const char *s)
 {
-  register char c;              // Parse character
-  register const char *t = s;   // Save the starting position of s.
+  char c;                       // Parse character
+  const char *t = s;            // Save the starting position of s.
   do c = *s++;                  // Skip characters
   while( c && (c <= ' ') );     // Till no more whitespace or EOS
   if( c != '{' ) return 0;      // Oops, not a Set openner
--- a/src/hotspot/share/libadt/vectset.cpp	Thu Jul 12 10:41:44 2018 -0400
+++ b/src/hotspot/share/libadt/vectset.cpp	Thu Jul 12 17:29:48 2018 -0700
@@ -101,8 +101,8 @@
 // Insert a member into an existing Set.
 Set &VectorSet::operator <<= (uint elem)
 {
-  register uint word = elem >> 5;            // Get the longword offset
-  register uint32_t mask = 1L << (elem & 31);  // Get bit mask
+  uint word = elem >> 5;            // Get the longword offset
+  uint32_t mask = 1L << (elem & 31);  // Get bit mask
 
   if( word >= size )            // Need to grow set?
     grow(elem+1);               // Then grow it
@@ -114,10 +114,10 @@
 // Delete a member from an existing Set.
 Set &VectorSet::operator >>= (uint elem)
 {
-  register uint word = elem >> 5; // Get the longword offset
+  uint word = elem >> 5;          // Get the longword offset
   if( word >= size )              // Beyond the last?
     return *this;                 // Then it's clear & return clear
-  register uint32_t mask = 1L << (elem & 31);     // Get bit mask
+  uint32_t mask = 1L << (elem & 31);     // Get bit mask
   data[word] &= ~mask;            // Clear bit
   return *this;
 }
@@ -128,8 +128,8 @@
 {
   // NOTE: The intersection is never any larger than the smallest set.
   if( s.size < size ) size = s.size; // Get smaller size
-  register uint32_t *u1 = data;   // Pointer to the destination data
-  register uint32_t *u2 = s.data; // Pointer to the source data
+  uint32_t *u1 = data;          // Pointer to the destination data
+  uint32_t *u2 = s.data;        // Pointer to the source data
   for( uint i=0; i<size; i++)   // For data in set
     *u1++ &= *u2++;             // Copy and AND longwords
   return *this;                 // Return set
@@ -147,9 +147,9 @@
 VectorSet &VectorSet::operator |= (const VectorSet &s)
 {
   // This many words must be unioned
-  register uint cnt = ((size<s.size)?size:s.size);
-  register uint32_t *u1 = data;   // Pointer to the destination data
-  register uint32_t *u2 = s.data; // Pointer to the source data
+  uint cnt = ((size<s.size)?size:s.size);
+  uint32_t *u1 = data;          // Pointer to the destination data
+  uint32_t *u2 = s.data;        // Pointer to the source data
   for( uint i=0; i<cnt; i++)    // Copy and OR the two sets
     *u1++ |= *u2++;
   if( size < s.size ) {         // Is set 2 larger than set 1?
@@ -172,9 +172,9 @@
 VectorSet &VectorSet::operator -= (const VectorSet &s)
 {
   // This many words must be unioned
-  register uint cnt = ((size<s.size)?size:s.size);
-  register uint32_t *u1 = data;   // Pointer to the destination data
-  register uint32_t *u2 = s.data; // Pointer to the source data
+  uint cnt = ((size<s.size)?size:s.size);
+  uint32_t *u1 = data;          // Pointer to the destination data
+  uint32_t *u2 = s.data;        // Pointer to the source data
   for( uint i=0; i<cnt; i++ )   // For data in set
     *u1++ &= ~(*u2++);          // A <-- A & ~B  with longwords
   return *this;                 // Return new set
@@ -195,17 +195,17 @@
 //        1X --  B is a subset of A
 int VectorSet::compare (const VectorSet &s) const
 {
-  register uint32_t *u1 = data;   // Pointer to the destination data
-  register uint32_t *u2 = s.data; // Pointer to the source data
-  register uint32_t AnotB = 0, BnotA = 0;
+  uint32_t *u1 = data;          // Pointer to the destination data
+  uint32_t *u2 = s.data;        // Pointer to the source data
+  uint32_t AnotB = 0, BnotA = 0;
   // This many words must be unioned
-  register uint cnt = ((size<s.size)?size:s.size);
+  uint cnt = ((size<s.size)?size:s.size);
 
   // Get bits for both sets
   uint i;                       // Exit value of loop
   for( i=0; i<cnt; i++ ) {      // For data in BOTH sets
-    register uint32_t A = *u1++;  // Data from one guy
-    register uint32_t B = *u2++;  // Data from other guy
+    uint32_t A = *u1++;         // Data from one guy
+    uint32_t B = *u2++;         // Data from other guy
     AnotB |= (A & ~B);          // Compute bits in A not B
     BnotA |= (B & ~A);          // Compute bits in B not A
   }
@@ -245,9 +245,9 @@
   const VectorSet &s = *(set.asVectorSet());
 
   // NOTE: The intersection is never any larger than the smallest set.
-  register uint small_size = ((size<s.size)?size:s.size);
-  register uint32_t *u1 = data;        // Pointer to the destination data
-  register uint32_t *u2 = s.data;      // Pointer to the source data
+  uint small_size = ((size<s.size)?size:s.size);
+  uint32_t *u1 = data;               // Pointer to the destination data
+  uint32_t *u2 = s.data;             // Pointer to the source data
   for( uint i=0; i<small_size; i++)  // For data in set
     if( *u1++ & *u2++ )              // If any elements in common
       return 0;                      // Then not disjoint
@@ -286,11 +286,11 @@
 // Test for membership.  A Zero/Non-Zero value is returned!
 int VectorSet::operator[](uint elem) const
 {
-  register uint word = elem >> 5; // Get the longword offset
-  if( word >= size )              // Beyond the last?
-    return 0;                     // Then it's clear
-  register uint32_t mask = 1L << (elem & 31);  // Get bit mask
-  return ((data[word] & mask))!=0;           // Return the sense of the bit
+  uint word = elem >> 5;              // Get the longword offset
+  if( word >= size )                  // Beyond the last?
+    return 0;                         // Then it's clear
+  uint32_t mask = 1L << (elem & 31);  // Get bit mask
+  return ((data[word] & mask))!=0;    // Return the sense of the bit
 }
 
 //------------------------------getelem----------------------------------------
--- a/src/hotspot/share/memory/arena.cpp	Thu Jul 12 10:41:44 2018 -0400
+++ b/src/hotspot/share/memory/arena.cpp	Thu Jul 12 17:29:48 2018 -0700
@@ -335,7 +335,7 @@
 // Total of all Chunks in arena
 size_t Arena::used() const {
   size_t sum = _chunk->length() - (_max-_hwm); // Size leftover in this Chunk
-  register Chunk *k = _first;
+  Chunk *k = _first;
   while( k != _chunk) {         // Whilst have Chunks in a row
     sum += k->length();         // Total size of this Chunk
     k = k->next();              // Bump along to next Chunk
--- a/src/hotspot/share/opto/mulnode.cpp	Thu Jul 12 10:41:44 2018 -0400
+++ b/src/hotspot/share/opto/mulnode.cpp	Thu Jul 12 17:29:48 2018 -0700
@@ -47,7 +47,7 @@
 //------------------------------Identity---------------------------------------
 // Multiplying a one preserves the other argument
 Node* MulNode::Identity(PhaseGVN* phase) {
-  register const Type *one = mul_id();  // The multiplicative identity
+  const Type *one = mul_id();  // The multiplicative identity
   if( phase->type( in(1) )->higher_equal( one ) ) return in(2);
   if( phase->type( in(2) )->higher_equal( one ) ) return in(1);