00001 /* 00002 * Sun Public License Notice 00003 * 00004 * The contents of this file are subject to the Sun Public License 00005 * Version 1.0 (the "License"); you may not use this file except 00006 * in compliance with the License. A copy of the License is available 00007 * at http://www.sun.com/ 00008 * 00009 * The Original Code is the Java Profiler module. The Initial Developers 00010 * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, 00011 * Lukas Petru and Marek Przeczek. 00012 * 00013 * Portions created by Jan Stola are Copyright (C) 2000-2001. 00014 * All Rights Reserved. 00015 * 00016 * Portions created by Pavel Vacha are Copyright (C) 2000-2001. 00017 * All Rights Reserved. 00018 * 00019 * Portions created by Michal Pise are Copyright (C) 2000-2001. 00020 * All Rights Reserved. 00021 * 00022 * Portions created by Petr Luner are Copyright (C) 2000-2001. 00023 * All Rights Reserved. 00024 * 00025 * Portions created by Lukas Petru are Copyright (C) 2000-2001. 00026 * All Rights Reserved. 00027 * 00028 * Portions created by Marek Przeczek are Copyright (C) 2000-2001. 00029 * All Rights Reserved. 00030 * 00031 * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, 00032 * Lukas Petru and Marek Przeczek. 00033 */ 00034 00035 #ifndef _ALLOC_OBJECT_H_ 00036 #define _ALLOC_OBJECT_H_ 00037 00038 #include "../main/includes.h" 00039 #include "../list/listItem.h" 00040 #include "../alloc/allocAbstractStatThreadObject.h" 00041 #include "../commun2/idObject.h" 00042 #include "../commun/binaryFormat.h" 00043 #include "../list/list.h" 00044 #include "../alloc/allocObjectMethod.h" 00045 #include "../alloc/allocThreadObject.h" 00046 #include "../alloc/allocObjectKey.h" 00047 #include "../commun/buffer.h" 00048 #include "../allocator/allocator.h" 00049 00061 class AllocObject: public LI1, 00062 public LI2, 00063 public AllocAbstractStatThreadObject, 00064 public IdObject, 00065 public InfoBinaryFormat { 00066 public: 00067 00069 Class* clss; 00070 00072 jobjectID classId; 00073 00081 jint isArray; 00082 00084 List<AllocObjectMethod,LI1> objectMethods; 00085 00087 List<AllocThreadObject,LI2> threadObjects; 00088 00089 public: 00090 00092 AllocObject() : 00093 00094 clss( NULL), 00095 classId( 0), 00096 isArray( 0) 00097 00098 {} 00099 00101 virtual ~AllocObject() {} 00102 00111 const AllocObjectKey& getKey(AllocObjectKey& key); 00112 00122 int operator==(const AllocObjectKey& key); 00123 00130 static int hashKey(const AllocObjectKey& key); 00131 00140 virtual Buffer& infoToBin( Buffer& b); 00141 00144 void deactivate(); 00145 00146 #ifdef USE_ALLOCATOR 00147 private: 00148 00150 static Allocator _allocator; 00151 00152 public: 00153 00156 void* operator new( size_t sz) { return _allocator.get( sz);} 00157 00160 void operator delete( void* unit) { _allocator.put( unit);} 00161 #endif 00162 00163 public: 00164 00169 virtual eClassIdent getClassIdent() { return ALLOC_OBJECT;} 00170 00177 virtual int isActive(); 00178 00184 virtual int isChanged() { return (activeChanged() || dataChanged());} // order dependent ! 00185 00188 virtual void setUnchanged(); 00189 }; 00190 00191 #endif // _ALLOC_OBJECT_H_