changeset 10999:16a8f1b064fd

8149488: Incorrect declaration of bitsInByte in regmask.cpp. Summary: Corrected BITS_IN_BYTE_ARRAY_SIZE value as 256 for all bitsInByte usage. Reviewed-by: dlong, mcberg, thartmann, vlivanov
author rraghavan
date Thu, 07 Apr 2016 01:56:16 -0700
parents d390372141c3
children dbe642c36804
files src/share/vm/libadt/vectset.cpp src/share/vm/libadt/vectset.hpp src/share/vm/opto/regmask.cpp
diffstat 3 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/libadt/vectset.cpp	Fri Apr 01 10:43:35 2016 +0300
+++ b/src/share/vm/libadt/vectset.cpp	Thu Apr 07 01:56:16 2016 -0700
@@ -31,7 +31,7 @@
 // BitsInByte is a lookup table which tells the number of bits that
 // are in the looked-up number.  It is very useful in VectorSet_Size.
 
-uint8_t bitsInByte[256] = {
+uint8_t bitsInByte[BITS_IN_BYTE_ARRAY_SIZE] = {
   0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
   1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
   1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
--- a/src/share/vm/libadt/vectset.hpp	Fri Apr 01 10:43:35 2016 +0300
+++ b/src/share/vm/libadt/vectset.hpp	Thu Apr 07 01:56:16 2016 -0700
@@ -27,6 +27,8 @@
 
 #include "libadt/set.hpp"
 
+#define BITS_IN_BYTE_ARRAY_SIZE 256
+
 // Vector Sets - An Abstract Data Type
 //INTERFACE
 
--- a/src/share/vm/opto/regmask.cpp	Fri Apr 01 10:43:35 2016 +0300
+++ b/src/share/vm/opto/regmask.cpp	Thu Apr 07 01:56:16 2016 -0700
@@ -389,7 +389,7 @@
 //------------------------------Size-------------------------------------------
 // Compute size of register mask in bits
 uint RegMask::Size() const {
-  extern uint8_t bitsInByte[512];
+  extern uint8_t bitsInByte[BITS_IN_BYTE_ARRAY_SIZE];
   uint sum = 0;
   for( int i = 0; i < RM_SIZE; i++ )
     sum +=