/* additional data types ******************************************************/
-typedef void *voidptr; /* generic pointer */
typedef void (*functionptr) (void); /* generic function pointer */
typedef u1* methodptr;
*******************************************************************************/
-void patcher_add_patch_ref(jitdata *jd, functionptr patcher, voidptr ref,
- s4 disp)
+void patcher_add_patch_ref(jitdata *jd, functionptr patcher, void* ref, s4 disp)
{
codegendata *cd;
codeinfo *code;
/* src/vm/jit/patcher-common.h - architecture independent code patching stuff
- Copyright (C) 2007 R. Grafl, A. Krall, C. Kruegel,
- C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
- E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
- J. Wenninger, Institut f. Computersprachen - TU Wien
+ Copyright (C) 2007, 2008
+ CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
This file is part of CACAO.
ptrint datap; /* absolute position in data segment */
s4 disp; /* displacement of ref in the data segment */
functionptr patcher; /* patcher function to call */
- voidptr ref; /* reference passed */
+ void* ref; /* reference passed */
u8 mcode; /* machine code to be patched back in */
bool done; /* XXX preliminary: patch already applied? */
listnode_t linkage;
void patcher_list_reset(codeinfo *code);
void patcher_list_free(codeinfo *code);
-void patcher_add_patch_ref(jitdata *jd, functionptr patcher, voidptr ref,
- s4 disp);
+void patcher_add_patch_ref(jitdata *jd, functionptr patcher, void* ref, s4 disp);
void patcher_resolve(jitdata* jd);
{
u4 idx;
u4 tag;
- voidptr info;
+ void* info;
if (c->cptags && c->cpinfos) {
for (idx = 0; idx < c->cpcount; idx++) {
MFREE(c->cptags, u1, c->cpcount);
if (c->cpinfos)
- MFREE(c->cpinfos, voidptr, c->cpcount);
+ MFREE(c->cpinfos, void*, c->cpcount);
}
*******************************************************************************/
-voidptr class_getconstant(classinfo *c, u4 pos, u4 ctype)
+void* class_getconstant(classinfo *c, u4 pos, u4 ctype)
{
/* check index and type of constantpool entry */
/* (pos == 0 is caught by type comparison) */
*******************************************************************************/
-voidptr innerclass_getconstant(classinfo *c, u4 pos, u4 ctype)
+void* innerclass_getconstant(classinfo *c, u4 pos, u4 ctype)
{
/* invalid position in constantpool */
void class_showconstantpool (classinfo *c)
{
u4 i;
- voidptr e;
+ void* e;
printf ("---- dump of constant pool ----\n");
s4 cpcount; /* number of entries in constant pool */
u1 *cptags; /* constant pool tags */
- voidptr *cpinfos; /* pointer to constant pool info structures */
+ void* *cpinfos; /* pointer to constant pool info structures */
s4 classrefcount; /* number of symbolic class references */
constant_classref *classrefs; /* table of symbolic class references */
bool class_load_attributes(classbuffer *cb);
/* retrieve constantpool element */
-voidptr class_getconstant(classinfo *c, u4 pos, u4 ctype);
-voidptr innerclass_getconstant(classinfo *c, u4 pos, u4 ctype);
+void* class_getconstant(classinfo *c, u4 pos, u4 ctype);
+void* innerclass_getconstant(classinfo *c, u4 pos, u4 ctype);
/* frees all resources used by the class */
void class_free(classinfo *);
}
}
- MFREE(hashtable_classcache.ptr, voidptr, hashtable_classcache.size);
+ MFREE(hashtable_classcache.ptr, void*, hashtable_classcache.size);
hashtable_classcache.size = 0;
hashtable_classcache.entries = 0;
hashtable_classcache.ptr = NULL;
hashsize = CLASSREFHASH_INIT_SIZE;
pool->classrefhash.size = hashsize;
pool->classrefhash.entries = 0;
- pool->classrefhash.ptr = DMNEW(voidptr,hashsize);
+ pool->classrefhash.ptr = DMNEW(void*, hashsize);
for (slot=0; slot<hashsize; ++slot)
pool->classrefhash.ptr[slot] = NULL;
hashsize = DESCRIPTORHASH_INIT_SIZE;
pool->descriptorhash.size = hashsize;
pool->descriptorhash.entries = 0;
- pool->descriptorhash.ptr = DMNEW(voidptr,hashsize);
+ pool->descriptorhash.ptr = DMNEW(void*, hashsize);
for (slot=0; slot<hashsize; ++slot)
pool->descriptorhash.ptr[slot] = NULL;
}
}
else {
- while (size >= sizeof(voidptr)) {
- fprintf(file," %p\n",*((voidptr*)pos));
- pos += sizeof(voidptr);
- size -= sizeof(voidptr);
+ while (size >= sizeof(void*)) {
+ fprintf(file," %p\n",*((void**)pos));
+ pos += sizeof(void*);
+ size -= sizeof(void*);
}
}
}
u4 cpcount;
u1 *cptags;
- voidptr *cpinfos;
+ void** cpinfos;
c = cb->clazz;
/* allocate memory */
cptags = c->cptags = MNEW(u1, cpcount);
- cpinfos = c->cpinfos = MNEW(voidptr, cpcount);
+ cpinfos = c->cpinfos = MNEW(void*, cpcount);
if (cpcount < 1) {
exceptions_throw_classformaterror(c, "Illegal constant pool size");
#if defined(ENABLE_STATISTICS)
if (opt_stat)
- count_const_pool_len += (sizeof(u1) + sizeof(voidptr)) * cpcount;
+ count_const_pool_len += (sizeof(u1) + sizeof(void*)) * cpcount;
#endif
/* initialize constantpool */