public class Object {
- private int cachedCode; //first field has to be a primitive
- private boolean cachedHash;
-
/* DO NOT USE ANY OF THESE - THEY ARE FOR IMPLEMENTING TAGS */
private Object tags;
public class Object {
- public int cachedCode; //first field has to be a primitive
- public boolean cachedHash;
public Object nextobject; /* Oid */
public Object localcopy;
public class Object {
- public int cachedCode; //first field has to be a primitive
- public boolean cachedHash;
-
public native int hashCode();
/* DON'T USE THIS METHOD UNLESS NECESSARY */
public class Object {
- public int cachedCode; //first field has to be a primitive
- public boolean cachedHash;
public Object nextobject; /* Oid */
public Object localcopy;
- public native int nativehashCode();
-
- public int hashCode() {
- if (!cachedHash) {
- cachedCode=nativehashCode();
- cachedHash=true;
- }
- return cachedCode;
- }
+ public native int hashCode();
/* DON'T USE THIS METHOD UNLESS NECESSARY */
/* WE WILL DEPRECATE IT AS SOON AS INSTANCEOF WORKS */
public class Object {
- public int cachedCode; //first field has to be a primitive
- public boolean cachedHash;
public native int nativehashCode();
private int objstatus;
private Object objlocation;
public class Object {
- public int cachedCode; //first field has to be a primitive
- public boolean cachedHash;
-
public native int hashCode();
/* DON'T USE THIS METHOD UNLESS NECESSARY */
public class Object {
- public int cachedCode; //first field has to be a primitive
- public boolean cachedHash;
-
// temporary extra unused int filed to align objects for Java
//int wkhqwemnbmwnb;
#endif
-#ifdef D___Object______nativehashCode____
-int CALL01(___Object______nativehashCode____, struct ___Object___ * ___this___) {
- return (int)((INTPTR) VAR(___this___));
-}
-#endif
-
#ifdef D___Object______hashCode____
int CALL01(___Object______hashCode____, struct ___Object___ * ___this___) {
- if (!VAR(___this___)->___cachedHash___) {
- VAR(___this___)->___cachedHash___=1;
- VAR(___this___)->___cachedCode___=(int)((INTPTR)VAR(___this___));
- }
- return VAR(___this___)->___cachedCode___;
+ return VAR(___this___)->hashcode;
}
#endif
__attribute__((malloc)) void * allocate_newglobal(int type) {
struct ___Object___ * v=(struct ___Object___ *) transCreateObj(classsize[type]);
v->type=type;
+ v->hashcode=(int)(INTPTR)v;
//printf("DEBUG %s(), type= %x\n", __func__, type);
#ifdef THREADS
v->tid=0;
return NULL;
}
v->type=type;
+ v->hashcode=(int)(INTPTR)v;
v->___length___=length;
#ifdef THREADS
v->tid=0;
#endif
ASSIGNUID(v);
v->type=type;
+ v->hashcode=(int)(INTPTR)v;
v->___objlocation___=v;
return v;
}
}
v->___objlocation___=(struct ___Object___*)v;
v->type=type;
+ v->hashcode=(int)(INTPTR)v;
v->___length___=length;
return v;
}
tmp->version = 1;
v->___objlocation___=v;
v->type = type;
+ v->hashcode=(int)(INTPTR)v;
return v;
}
tmp->version=1;
ASSIGNUID(v);
v->type=type;
+ v->hashcode=(int)(INTPTR)v;
if (length<0) {
printf("ERROR: negative array %d\n", length);
return NULL;
#endif
struct ___Object___ * v=(struct ___Object___ *) mygcmalloc((struct garbagelist *) ptr, classsize[type]);
v->type=type;
+ v->hashcode=(int)(INTPTR)v;
#ifdef THREADS
v->tid=0;
#endif
#endif
struct ArrayObject * v=mygcmalloc((struct garbagelist *) ptr, sizeof(struct ArrayObject)+length*classsize[type]);
v->type=type;
+ v->hashcode=(int)(INTPTR)v;
if (length<0) {
printf("ERROR: negative array\n");
return NULL;
__attribute__((malloc)) void * allocate_new(int type) {
struct ___Object___ * v=FREEMALLOC(classsize[type]);
v->type=type;
+ v->hashcode=(int)(INTPTR)v;
#ifdef OPTIONAL
v->fses=0;
#endif
__attribute__((malloc)) struct ArrayObject * allocate_newarray(int type, int length) {
__attribute__((malloc)) struct ArrayObject * v=FREEMALLOC(sizeof(struct ArrayObject)+length*classsize[type]);
v->type=type;
+ v->hashcode=(int)(INTPTR)v;
v->___length___=length;
#ifdef OPTIONAL
v->fses=0;