hotspot/src/share/vm/utilities/globalDefinitions.hpp
changeset 28372 ce0aad4b8c44
parent 27471 6e56277909f1
child 28650 772aaab2582f
child 29185 41cf0610fedf
equal deleted inserted replaced
28371:92e60e58ba8b 28372:ce0aad4b8c44
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   122 extern int LogBytesPerHeapOop;                // Oop within a java object
   122 extern int LogBytesPerHeapOop;                // Oop within a java object
   123 extern int LogBitsPerHeapOop;
   123 extern int LogBitsPerHeapOop;
   124 extern int BytesPerHeapOop;
   124 extern int BytesPerHeapOop;
   125 extern int BitsPerHeapOop;
   125 extern int BitsPerHeapOop;
   126 
   126 
   127 // Oop encoding heap max
       
   128 extern uint64_t OopEncodingHeapMax;
       
   129 
       
   130 const int BitsPerJavaInteger = 32;
   127 const int BitsPerJavaInteger = 32;
   131 const int BitsPerJavaLong    = 64;
   128 const int BitsPerJavaLong    = 64;
   132 const int BitsPerSize_t      = size_tSize * BitsPerByte;
   129 const int BitsPerSize_t      = size_tSize * BitsPerByte;
   133 
   130 
   134 // Size of a char[] needed to represent a jint as a string in decimal.
   131 // Size of a char[] needed to represent a jint as a string in decimal.
   192 // The minimum number of native machine words necessary to contain "byte_size"
   189 // The minimum number of native machine words necessary to contain "byte_size"
   193 // bytes.
   190 // bytes.
   194 inline size_t heap_word_size(size_t byte_size) {
   191 inline size_t heap_word_size(size_t byte_size) {
   195   return (byte_size + (HeapWordSize-1)) >> LogHeapWordSize;
   192   return (byte_size + (HeapWordSize-1)) >> LogHeapWordSize;
   196 }
   193 }
   197 
       
   198 
   194 
   199 const size_t K                  = 1024;
   195 const size_t K                  = 1024;
   200 const size_t M                  = K*K;
   196 const size_t M                  = K*K;
   201 const size_t G                  = M*K;
   197 const size_t G                  = M*K;
   202 const size_t HWperKB            = K / sizeof(HeapWord);
   198 const size_t HWperKB            = K / sizeof(HeapWord);
   395 const int LogKlassAlignmentInBytes = 3;
   391 const int LogKlassAlignmentInBytes = 3;
   396 const int LogKlassAlignment        = LogKlassAlignmentInBytes - LogHeapWordSize;
   392 const int LogKlassAlignment        = LogKlassAlignmentInBytes - LogHeapWordSize;
   397 const int KlassAlignmentInBytes    = 1 << LogKlassAlignmentInBytes;
   393 const int KlassAlignmentInBytes    = 1 << LogKlassAlignmentInBytes;
   398 const int KlassAlignment           = KlassAlignmentInBytes / HeapWordSize;
   394 const int KlassAlignment           = KlassAlignmentInBytes / HeapWordSize;
   399 
   395 
   400 // Klass encoding metaspace max size
   396 // Maximal size of heap where unscaled compression can be used. Also upper bound
   401 const uint64_t KlassEncodingMetaspaceMax = (uint64_t(max_juint) + 1) << LogKlassAlignmentInBytes;
   397 // for heap placement: 4GB.
       
   398 const  uint64_t UnscaledOopHeapMax = (uint64_t(max_juint) + 1);
       
   399 // Maximal size of heap where compressed oops can be used. Also upper bound for heap
       
   400 // placement for zero based compression algorithm: UnscaledOopHeapMax << LogMinObjAlignmentInBytes.
       
   401 extern uint64_t OopEncodingHeapMax;
       
   402 
       
   403 // Maximal size of compressed class space. Above this limit compression is not possible.
       
   404 // Also upper bound for placement of zero based class space. (Class space is further limited
       
   405 // to be < 3G, see arguments.cpp.)
       
   406 const  uint64_t KlassEncodingMetaspaceMax = (uint64_t(max_juint) + 1) << LogKlassAlignmentInBytes;
   402 
   407 
   403 // Machine dependent stuff
   408 // Machine dependent stuff
   404 
   409 
   405 #if defined(X86) && defined(COMPILER2) && !defined(JAVASE_EMBEDDED)
   410 #if defined(X86) && defined(COMPILER2) && !defined(JAVASE_EMBEDDED)
   406 // Include Restricted Transactional Memory lock eliding optimization
   411 // Include Restricted Transactional Memory lock eliding optimization