2 #include "structdefs.h"
3 extern int classsize[];
5 int ___Object______hashcode____(struct ___Object___ * ___this___) {
6 return (int) ___this___;
9 void ___System______printInt____I(int x) {
13 void ___System______printString____L___String___(struct ___String___ * s) {
14 struct ArrayObject * chararray=s->___string___;
16 for(i=0;i<chararray->___length___;i++) {
17 short s= ((short *)(((char *)& chararray->___length___)+sizeof(int)))[i];
23 void * allocate_new(int type) {
24 void * v=calloc(1,classsize[type]);
29 void * allocate_newarray(int type, int length) {
30 void * v=calloc(1,sizeof(struct ArrayObject)+length*classsize[type]);
32 ((struct ArrayObject *)v)->___length___=length;
36 struct ___String___ * NewString(char *str,int length) {
37 struct ArrayObject * chararray=allocate_newarray(CHARARRAYTYPE, length);
38 struct ___String___ * strobj=allocate_new(STRINGTYPE);
40 strobj->___string___=chararray;
41 for(i=0;i<length;i++) {
42 ((short *)(((char *)& chararray->___length___)+sizeof(int)))[i]=(short)str[i]; }