940 // a transition from one state to another. These extra states makes it possible for the safepoint code to
941 // handle certain thread_states without having to suspend the thread - making the safepoint code faster.
942 //
943 // Given a state, the xxxx_trans state can always be found by adding 1.
944 //
945 enum JavaThreadState {
946 _thread_uninitialized = 0, // should never happen (missing initialization)
947 _thread_new = 2, // just starting up, i.e., in process of being initialized
948 _thread_new_trans = 3, // corresponding transition state (not used, included for completness)
949 _thread_in_native = 4, // running in native code
950 _thread_in_native_trans = 5, // corresponding transition state
951 _thread_in_vm = 6, // running in VM
952 _thread_in_vm_trans = 7, // corresponding transition state
953 _thread_in_Java = 8, // running in Java or in stub code
954 _thread_in_Java_trans = 9, // corresponding transition state (not used, included for completness)
955 _thread_blocked = 10, // blocked in vm
956 _thread_blocked_trans = 11, // corresponding transition state
957 _thread_max_state = 12 // maximum thread state+1 - used for statistics allocation
958 };
959
960 //----------------------------------------------------------------------------------------------------
961 // Special constants for debugging
962
963 const jint badInt = -3; // generic "bad int" value
964 const intptr_t badAddressVal = -2; // generic "bad address" value
965 const intptr_t badOopVal = -1; // generic "bad oop" value
966 const intptr_t badHeapOopVal = (intptr_t) CONST64(0x2BAD4B0BBAADBABE); // value used to zap heap after GC
967 const int badStackSegVal = 0xCA; // value used to zap stack segments
968 const int badHandleValue = 0xBC; // value used to zap vm handle area
969 const int badResourceValue = 0xAB; // value used to zap resource area
970 const int freeBlockPad = 0xBA; // value used to pad freed blocks.
971 const int uninitBlockPad = 0xF1; // value used to zap newly malloc'd blocks.
972 const juint uninitMetaWordVal= 0xf7f7f7f7; // value used to zap newly allocated metachunk
973 const juint badHeapWordVal = 0xBAADBABE; // value used to zap heap after GC
974 const juint badMetaWordVal = 0xBAADFADE; // value used to zap metadata heap after GC
975 const int badCodeHeapNewVal= 0xCC; // value used to zap Code heap at allocation
976 const int badCodeHeapFreeVal = 0xDD; // value used to zap Code heap at deallocation
977
978
979 // (These must be implemented as #defines because C++ compilers are
|
940 // a transition from one state to another. These extra states makes it possible for the safepoint code to
941 // handle certain thread_states without having to suspend the thread - making the safepoint code faster.
942 //
943 // Given a state, the xxxx_trans state can always be found by adding 1.
944 //
945 enum JavaThreadState {
946 _thread_uninitialized = 0, // should never happen (missing initialization)
947 _thread_new = 2, // just starting up, i.e., in process of being initialized
948 _thread_new_trans = 3, // corresponding transition state (not used, included for completness)
949 _thread_in_native = 4, // running in native code
950 _thread_in_native_trans = 5, // corresponding transition state
951 _thread_in_vm = 6, // running in VM
952 _thread_in_vm_trans = 7, // corresponding transition state
953 _thread_in_Java = 8, // running in Java or in stub code
954 _thread_in_Java_trans = 9, // corresponding transition state (not used, included for completness)
955 _thread_blocked = 10, // blocked in vm
956 _thread_blocked_trans = 11, // corresponding transition state
957 _thread_max_state = 12 // maximum thread state+1 - used for statistics allocation
958 };
959
960 enum LockingMode {
961 // Use only heavy monitors for locking
962 LM_MONITOR = 0,
963 // Legacy stack-locking, with monitors as 2nd tier
964 LM_LEGACY = 1,
965 // New lightweight locking, with monitors as 2nd tier
966 LM_LIGHTWEIGHT = 2
967 };
968
969 //----------------------------------------------------------------------------------------------------
970 // Special constants for debugging
971
972 const jint badInt = -3; // generic "bad int" value
973 const intptr_t badAddressVal = -2; // generic "bad address" value
974 const intptr_t badOopVal = -1; // generic "bad oop" value
975 const intptr_t badHeapOopVal = (intptr_t) CONST64(0x2BAD4B0BBAADBABE); // value used to zap heap after GC
976 const int badStackSegVal = 0xCA; // value used to zap stack segments
977 const int badHandleValue = 0xBC; // value used to zap vm handle area
978 const int badResourceValue = 0xAB; // value used to zap resource area
979 const int freeBlockPad = 0xBA; // value used to pad freed blocks.
980 const int uninitBlockPad = 0xF1; // value used to zap newly malloc'd blocks.
981 const juint uninitMetaWordVal= 0xf7f7f7f7; // value used to zap newly allocated metachunk
982 const juint badHeapWordVal = 0xBAADBABE; // value used to zap heap after GC
983 const juint badMetaWordVal = 0xBAADFADE; // value used to zap metadata heap after GC
984 const int badCodeHeapNewVal= 0xCC; // value used to zap Code heap at allocation
985 const int badCodeHeapFreeVal = 0xDD; // value used to zap Code heap at deallocation
986
987
988 // (These must be implemented as #defines because C++ compilers are
|