src/share/vm/utilities/globalDefinitions.hpp

Print this page
rev 516 : 6795362: 32bit server compiler leads to wrong results on solaris-x86
Summary: The C2 compiler leads to wrong results on solaris-i486 (32-bit) for a testcase given in the CR.
Reviewed-by: ??
   1 /*
   2  * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  20  * CA 95054 USA or visit www.sun.com if you need additional information or
  21  * have any questions.
  22  *


  57 const int WordAlignmentMask  = (1 << LogBytesPerWord) - 1;
  58 const int LongAlignmentMask  = (1 << LogBytesPerLong) - 1;
  59 
  60 const int WordsPerLong       = 2;       // Number of stack entries for longs
  61 
  62 const int oopSize            = sizeof(char*); // Full-width oop
  63 extern int heapOopSize;                       // Oop within a java object
  64 const int wordSize           = sizeof(char*);
  65 const int longSize           = sizeof(jlong);
  66 const int jintSize           = sizeof(jint);
  67 const int size_tSize         = sizeof(size_t);
  68 
  69 const int BytesPerOop        = BytesPerWord;  // Full-width oop
  70 
  71 extern int LogBytesPerHeapOop;                // Oop within a java object
  72 extern int LogBitsPerHeapOop;
  73 extern int BytesPerHeapOop;
  74 extern int BitsPerHeapOop;
  75 
  76 const int BitsPerJavaInteger = 32;

  77 const int BitsPerSize_t      = size_tSize * BitsPerByte;
  78 
  79 // Size of a char[] needed to represent a jint as a string in decimal.
  80 const int jintAsStringSize = 12;
  81 
  82 // In fact this should be
  83 // log2_intptr(sizeof(class JavaThread)) - log2_intptr(64);
  84 // see os::set_memory_serialize_page()
  85 #ifdef _LP64
  86 const int SerializePageShiftCount = 4;
  87 #else
  88 const int SerializePageShiftCount = 3;
  89 #endif
  90 
  91 // An opaque struct of heap-word width, so that HeapWord* can be a generic
  92 // pointer into the heap.  We require that object sizes be measured in
  93 // units of heap words, so that that
  94 //   HeapWord* hw;
  95 //   hw += oop(hw)->foo();
  96 // works, where foo is a method (like size or scavenge) that returns the


   1 /*
   2  * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  20  * CA 95054 USA or visit www.sun.com if you need additional information or
  21  * have any questions.
  22  *


  57 const int WordAlignmentMask  = (1 << LogBytesPerWord) - 1;
  58 const int LongAlignmentMask  = (1 << LogBytesPerLong) - 1;
  59 
  60 const int WordsPerLong       = 2;       // Number of stack entries for longs
  61 
  62 const int oopSize            = sizeof(char*); // Full-width oop
  63 extern int heapOopSize;                       // Oop within a java object
  64 const int wordSize           = sizeof(char*);
  65 const int longSize           = sizeof(jlong);
  66 const int jintSize           = sizeof(jint);
  67 const int size_tSize         = sizeof(size_t);
  68 
  69 const int BytesPerOop        = BytesPerWord;  // Full-width oop
  70 
  71 extern int LogBytesPerHeapOop;                // Oop within a java object
  72 extern int LogBitsPerHeapOop;
  73 extern int BytesPerHeapOop;
  74 extern int BitsPerHeapOop;
  75 
  76 const int BitsPerJavaInteger = 32;
  77 const int BitsPerJavaLong    = 64;
  78 const int BitsPerSize_t      = size_tSize * BitsPerByte;
  79 
  80 // Size of a char[] needed to represent a jint as a string in decimal.
  81 const int jintAsStringSize = 12;
  82 
  83 // In fact this should be
  84 // log2_intptr(sizeof(class JavaThread)) - log2_intptr(64);
  85 // see os::set_memory_serialize_page()
  86 #ifdef _LP64
  87 const int SerializePageShiftCount = 4;
  88 #else
  89 const int SerializePageShiftCount = 3;
  90 #endif
  91 
  92 // An opaque struct of heap-word width, so that HeapWord* can be a generic
  93 // pointer into the heap.  We require that object sizes be measured in
  94 // units of heap words, so that that
  95 //   HeapWord* hw;
  96 //   hw += oop(hw)->foo();
  97 // works, where foo is a method (like size or scavenge) that returns the