/* src/vm/descriptor.c - checking and parsing of field / method descriptors
- Copyright (C) 1996-2005 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) 1996-2005, 2006 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
This file is part of CACAO.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA.
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
- Contact: cacao@complang.tuwien.ac.at
+ Contact: cacao@cacaojvm.org
Authors: Edwin Steiner
Changes: Christian Thalinger
Christian Ullrich
- $Id: descriptor.c 3826 2005-12-01 18:52:50Z edwin $
+ $Id: descriptor.c 4879 2006-05-05 17:34:49Z edwin $
*/
+#include "config.h"
+
#include <assert.h>
-#include "types.h"
+#include "vm/types.h"
+
#include "md-abi.h"
#include "mm/memory.h"
#include "vm/descriptor.h"
#include "vm/exceptions.h"
+#include "vm/options.h"
#include "vm/resolve.h"
#include "vm/stringlocal.h"
#ifdef DESCRIPTOR_VERBOSE
fprintf(stderr,"descriptor_pool_add_class(%p,",(void*)pool);
- utf_fprint(stderr,name);fprintf(stderr,")\n");
+ utf_fprint_printable_ascii(stderr,name);fprintf(stderr,")\n");
#endif
/* find a place in the hashtable */
#ifdef DESCRIPTOR_VERBOSE
fprintf(stderr,"descriptor_pool_add(%p,",(void*)pool);
- utf_fprint(stderr,desc);fprintf(stderr,")\n");
+ utf_fprint_printable_ascii(stderr,desc);fprintf(stderr,")\n");
#endif
assert(pool);
#ifdef DESCRIPTOR_VERBOSE
fprintf(stderr,"descriptor_pool_parse_method_descriptor(%p,%d,%p,",
(void*)pool,(int)mflags,(void*)thisclass);
- utf_fprint(stderr,desc); fprintf(stderr,")\n");
+ utf_fprint_printable_ascii(stderr,desc); fprintf(stderr,")\n");
#endif
assert(pool);
}
/* fill the paramdesc */
- /* md_param_alloc has to be called if md->paramcount == 0, too, so it */
- /* can make the reservation for the Linkage Area, Return Register... */
- md_param_alloc(md);
- }
- else {
- /* params will be allocated later by descriptor_params_from_paramtypes */
- /* if necessary */
+ /* md_param_alloc has to be called if md->paramcount == 0,
+ too, so it can make the reservation for the Linkage Area,
+ Return Register... */
+
+#if defined(ENABLE_JIT)
+# if defined(ENABLE_INTRP)
+ if (!opt_intrp)
+# endif
+ md_param_alloc(md);
+#endif
+
+ } else {
+ /* params will be allocated later by
+ descriptor_params_from_paramtypes if necessary */
+
md->params = NULL;
}
/* allocate memory for params */
md->params = MNEW(paramdesc, md->paramcount);
- }
- else {
+
+ } else {
md->params = METHODDESC_NOPARAMS;
}
/* fill the paramdesc */
- /* md_param_alloc has to be called if md->paramcount == 0, too, so */
- /* it can make the reservation for the Linkage Area, Return Register.. */
-
- md_param_alloc(md);
+ /* md_param_alloc has to be called if md->paramcount == 0, too, so
+ it can make the reservation for the Linkage Area, Return
+ Register.. */
+
+#if defined(ENABLE_JIT)
+# if defined(ENABLE_INTRP)
+ if (!opt_intrp)
+# endif
+ md_param_alloc(md);
+#endif
return true;
}
if (d->type == TYPE_ADDRESS) {
if (d->classref)
- utf_fprint(file,d->classref->name);
+ utf_fprint_printable_ascii(file,d->classref->name);
else
fprintf(file,"<class=NULL>");
}
u4 size;
fprintf(file,"======[descriptor_pool for ");
- utf_fprint(file,pool->referer->name);
+ utf_fprint_printable_ascii(file,pool->referer->name);
fprintf(file,"]======\n");
fprintf(file,"fieldcount: %d\n",pool->fieldcount);
classref_hash_entry *c = (classref_hash_entry *) pool->classrefhash.ptr[slot];
while (c) {
fprintf(file," %4d: ",c->index);
- utf_fprint(file,c->name);
+ utf_fprint_printable_ascii(file,c->name);
fprintf(file,"\n");
c = c->hashlink;
}
descriptor_hash_entry *c = (descriptor_hash_entry *) pool->descriptorhash.ptr[slot];
while (c) {
fprintf(file," %p: ",c->parseddesc.any);
- utf_fprint(file,c->desc);
+ utf_fprint_printable_ascii(file,c->desc);
fprintf(file,"\n");
c = c->hashlink;
}