1054 LM_LIGHTWEIGHT = 2
1055 };
1056
1057 //----------------------------------------------------------------------------------------------------
1058 // Special constants for debugging
1059
1060 const jint badInt = -3; // generic "bad int" value
1061 const intptr_t badAddressVal = -2; // generic "bad address" value
1062 const intptr_t badOopVal = -1; // generic "bad oop" value
1063 const intptr_t badHeapOopVal = (intptr_t) CONST64(0x2BAD4B0BBAADBABE); // value used to zap heap after GC
1064 const int badStackSegVal = 0xCA; // value used to zap stack segments
1065 const int badHandleValue = 0xBC; // value used to zap vm handle area
1066 const int badResourceValue = 0xAB; // value used to zap resource area
1067 const int freeBlockPad = 0xBA; // value used to pad freed blocks.
1068 const int uninitBlockPad = 0xF1; // value used to zap newly malloc'd blocks.
1069 const juint uninitMetaWordVal= 0xf7f7f7f7; // value used to zap newly allocated metachunk
1070 const juint badHeapWordVal = 0xBAADBABE; // value used to zap heap after GC
1071 const juint badMetaWordVal = 0xBAADFADE; // value used to zap metadata heap after GC
1072 const int badCodeHeapNewVal= 0xCC; // value used to zap Code heap at allocation
1073 const int badCodeHeapFreeVal = 0xDD; // value used to zap Code heap at deallocation
1074
1075
1076 // (These must be implemented as #defines because C++ compilers are
1077 // not obligated to inline non-integral constants!)
1078 #define badAddress ((address)::badAddressVal)
1079 #define badHeapWord (::badHeapWordVal)
1080
1081 // Default TaskQueue size is 16K (32-bit) or 128K (64-bit)
1082 #define TASKQUEUE_SIZE (NOT_LP64(1<<14) LP64_ONLY(1<<17))
1083
1084 //----------------------------------------------------------------------------------------------------
1085 // Utility functions for bitfield manipulations
1086
1087 const intptr_t AllBits = ~0; // all bits set in a word
1088 const intptr_t NoBits = 0; // no bits set in a word
1089 const jlong NoLongBits = 0; // no bits set in a long
1090 const intptr_t OneBit = 1; // only right_most bit set in a word
1091
1092 // get a word with the n.th or the right-most or left-most n bits set
1093 // (note: #define used only so that they can be used in enum constant definitions)
1094 #define nth_bit(n) (((n) >= BitsPerWord) ? 0 : (OneBit << (n)))
|
1054 LM_LIGHTWEIGHT = 2
1055 };
1056
1057 //----------------------------------------------------------------------------------------------------
1058 // Special constants for debugging
1059
1060 const jint badInt = -3; // generic "bad int" value
1061 const intptr_t badAddressVal = -2; // generic "bad address" value
1062 const intptr_t badOopVal = -1; // generic "bad oop" value
1063 const intptr_t badHeapOopVal = (intptr_t) CONST64(0x2BAD4B0BBAADBABE); // value used to zap heap after GC
1064 const int badStackSegVal = 0xCA; // value used to zap stack segments
1065 const int badHandleValue = 0xBC; // value used to zap vm handle area
1066 const int badResourceValue = 0xAB; // value used to zap resource area
1067 const int freeBlockPad = 0xBA; // value used to pad freed blocks.
1068 const int uninitBlockPad = 0xF1; // value used to zap newly malloc'd blocks.
1069 const juint uninitMetaWordVal= 0xf7f7f7f7; // value used to zap newly allocated metachunk
1070 const juint badHeapWordVal = 0xBAADBABE; // value used to zap heap after GC
1071 const juint badMetaWordVal = 0xBAADFADE; // value used to zap metadata heap after GC
1072 const int badCodeHeapNewVal= 0xCC; // value used to zap Code heap at allocation
1073 const int badCodeHeapFreeVal = 0xDD; // value used to zap Code heap at deallocation
1074 const intptr_t badDispHeaderDeopt = 0xDE0BD000; // value to fill unused displaced header during deoptimization
1075 const intptr_t badDispHeaderOSR = 0xDEAD05A0; // value to fill unused displaced header during OSR
1076
1077 // (These must be implemented as #defines because C++ compilers are
1078 // not obligated to inline non-integral constants!)
1079 #define badAddress ((address)::badAddressVal)
1080 #define badHeapWord (::badHeapWordVal)
1081
1082 // Default TaskQueue size is 16K (32-bit) or 128K (64-bit)
1083 #define TASKQUEUE_SIZE (NOT_LP64(1<<14) LP64_ONLY(1<<17))
1084
1085 //----------------------------------------------------------------------------------------------------
1086 // Utility functions for bitfield manipulations
1087
1088 const intptr_t AllBits = ~0; // all bits set in a word
1089 const intptr_t NoBits = 0; // no bits set in a word
1090 const jlong NoLongBits = 0; // no bits set in a long
1091 const intptr_t OneBit = 1; // only right_most bit set in a word
1092
1093 // get a word with the n.th or the right-most or left-most n bits set
1094 // (note: #define used only so that they can be used in enum constant definitions)
1095 #define nth_bit(n) (((n) >= BitsPerWord) ? 0 : (OneBit << (n)))
|