MacOSX threads working (somewhat)
[cacao.git] / src / cacaoh / headers.c
1 /* headers.c - main for header generation (cacaoh)
2
3    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
4    R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser,
5    M. Probst, S. Ring, E. Steiner, C. Thalinger, D. Thuernbeck,
6    P. Tomsich, J. Wenninger
7
8    This file is part of CACAO.
9
10    This program is free software; you can redistribute it and/or
11    modify it under the terms of the GNU General Public License as
12    published by the Free Software Foundation; either version 2, or (at
13    your option) any later version.
14
15    This program is distributed in the hope that it will be useful, but
16    WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    General Public License for more details.
19
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23    02111-1307, USA.
24
25    Contact: cacao@complang.tuwien.ac.at
26
27    Authors: Reinhard Grafl
28
29    Changes: Mark Probst
30             Philipp Tomsich
31
32    $Id: headers.c 1073 2004-05-19 23:21:15Z stefan $
33
34 */
35
36
37 #include <stdlib.h>
38 #include <string.h>
39 #include <ctype.h>
40 #include "config.h"
41 #include "global.h"
42 #include "tables.h"
43 #include "loader.h"
44 #include "builtin.h"
45 #include "mm/boehm.h"
46 #include "toolbox/chain.h"
47 #include "toolbox/memory.h"
48 #include "toolbox/logging.h"
49 #include "nat/java_lang_String.h"
50
51
52 /* replace command line options */
53
54 bool verbose =  false;
55 bool verboseexception =  false;
56 bool compileall = false;
57 bool runverbose = false;
58 bool collectverbose = false;
59
60 bool loadverbose = false;
61 bool linkverbose = false;
62 bool initverbose = false;
63
64 bool opt_rt = false;            /* true if RTA parse should be used     RT-CO */
65 bool opt_xta = false;           /* true if XTA parse should be used    XTA-CO */
66 bool opt_vta = false;           /* true if VTA parse should be used    VTA-CO */
67 bool opt_verify = true;        /* true if classfiles should be verified      */
68 bool opt_liberalutf = false;   /* Don't check overlong UTF-8 sequences       */
69
70 bool showmethods = false;
71 bool showconstantpool = false;
72 bool showutf = false;
73
74 bool makeinitializations = true;
75
76 bool getloadingtime = false;
77 s8 loadingtime = 0;
78
79
80 /******* replace some external functions  *********/
81  
82 functionptr native_findfunction(utf *cname, utf *mname, utf *desc, bool isstatic)
83 { return NULL; }
84
85 java_objectheader *javastring_new(utf *text)
86 { return NULL; }
87
88 utf *javastring_toutf(java_lang_String *string, bool isclassname)
89 { return NULL; }
90
91
92 /* some exception stuff */
93
94 char *string_java_lang_ClassCircularityError =
95     "java/lang/ClassCircularityError";
96
97 char *string_java_lang_ClassFormatError =
98     "java/lang/ClassFormatError";
99
100 char *string_java_lang_IllegalMonitorStateException =
101     "java/lang/IllegalMonitorStateException";
102
103 char *string_java_lang_LinkageError =
104     "java/lang/LinkageError";
105
106 char *string_java_lang_NegativeArraySizeException =
107     "java/lang/NegativeArraySizeException";
108
109 char *string_java_lang_NoClassDefFoundError =
110     "java/lang/NoClassDefFoundError";
111
112 char *string_java_lang_OutOfMemoryError =
113     "java/lang/OutOfMemoryError";
114
115
116 void throw_exception_exit() {}
117 void new_exception(char *classname) {}
118 void new_exception_message(char *classname, char *message) {}
119 void new_exception_throwable(char *classname, java_objectheader *t) {}
120 void new_exception_utfmessage(char *classname, utf *message)
121 {
122         printf("%s: ", classname);
123         utf_display(message);
124         printf("\n");
125         exit(1);
126 }
127
128 java_objectheader *literalstring_new(utf *u) { return NULL; }  
129
130
131 void literalstring_free(java_objectheader *o) { }
132 void stringtable_update() { }
133 void synchronize_caches() { }
134 void asm_call_jit_compiler() { }
135 void asm_calljavafunction() { }
136 s4 asm_builtin_checkcast(java_objectheader *obj, classinfo *class) { return 0; }
137
138 s4 asm_builtin_idiv(s4 a, s4 b) {return 0;}
139 s4 asm_builtin_irem(s4 a, s4 b) {return 0;}
140 s8 asm_builtin_ldiv(s8 a, s8 b) {return 0;}
141 s8 asm_builtin_lrem(s8 a, s8 b) {return 0;}
142
143 s4 asm_builtin_f2i(float a) { return 0; }
144 s8 asm_builtin_f2l(float a) { return 0; }
145 s4 asm_builtin_d2i(double a) { return 0; }
146 s8 asm_builtin_d2l(double a) { return 0; }
147
148 void asm_builtin_monitorenter(java_objectheader *o) {}
149 void asm_builtin_monitorexit(java_objectheader *o) {}
150
151 s4 asm_builtin_checkarraycast(java_objectheader *obj, vftbl *target) {return 0;}
152
153
154 #if defined(__I386__)
155 s4 asm_builtin_arrayinstanceof(java_objectheader *obj, classinfo *class) { return 0; }
156 void asm_builtin_newarray(s4 size, vftbl *arrayvftbl) {}
157 #endif
158
159 void asm_builtin_aastore(java_objectarray *a, s4 index, java_objectheader *o) {}
160
161 u1 *createcompilerstub(methodinfo *m) {return NULL;}
162 u1 *createnativestub(functionptr f, methodinfo *m) {return NULL;}
163 u1 *oldcreatenativestub(functionptr f, methodinfo *m) {return NULL;}
164
165 void removecompilerstub(u1 *stub) {}
166 void removenativestub(u1 *stub) {}
167
168 void asm_perform_threadswitch(u1 **from, u1 **to, u1 **stackTop) {}
169 u1* asm_initialize_thread_stack(void *func, u1 *stack) { return NULL; }
170 void thread_restartcriticalsection() {}
171 void asm_switchstackandcall() {}
172 void asm_handle_builtin_exception(classinfo *c) {}
173 void asm_getclassvalues_atomic() {}
174
175 #if defined(__DARWIN__)
176 int cacao_catch_Handler() {}
177 #endif
178
179 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
180 threadcritnode asm_criticalsections;
181 #endif
182
183 java_objectheader *native_new_and_init(void *p) { return NULL; }
184
185
186 /************************ global variables **********************/
187
188 THREADSPECIFIC java_objectheader *_exceptionptr;
189
190 static chain *nativemethod_chain;    /* chain with native methods     */
191 static chain *nativeclass_chain;                               /* chain with processed classes  */      
192 static chain *ident_chain;        /* chain with method and field names in current class */
193 static FILE *file = NULL;
194 static u4 outputsize;
195 static bool dopadding;
196
197
198 static void printIDpart(int c) 
199 {
200         if ((c >= 'a' && c <= 'z')
201                 || (c >= 'A' && c <= 'Z')
202                 || (c >= '0' && c <= '9')
203                 || (c == '_'))
204                 putc(c, file);
205         else
206                 putc('_', file);
207 }
208
209
210 static void printID(utf *u)
211 {
212         char *utf_ptr = u->text;
213         int i;
214
215         for (i = 0; i < utf_strlen(u); i++) 
216                 printIDpart(utf_nextu2(&utf_ptr));
217 }
218
219
220 static void addoutputsize (int len)
221 {
222         u4 newsize,i;
223         if (!dopadding) return;
224
225         newsize = ALIGN(outputsize, len);
226         
227         for (i = outputsize; i < newsize; i++) fprintf(file, "   u1 pad%d\n", (int) i);
228         outputsize = newsize;
229 }
230
231
232 static char *printtype(char *utf_ptr)
233 {
234         u2 c;
235
236         switch (utf_nextu2(&utf_ptr)) {
237         case 'V': fprintf (file, "void");
238                 break;
239         case 'I':
240         case 'S':
241         case 'B':
242         case 'C':
243         case 'Z': addoutputsize (4);
244                 fprintf (file, "s4");
245                 break;
246         case 'J': addoutputsize (8);
247                 fprintf (file, "s8");
248                 break;
249         case 'F': addoutputsize (4);
250                 fprintf (file, "float");
251                 break;
252         case 'D': addoutputsize (8);
253                 fprintf (file, "double");
254                 break;
255         case '[':
256                 addoutputsize ( sizeof(java_arrayheader*) ); 
257                 switch (utf_nextu2(&utf_ptr)) {
258                 case 'I':  fprintf (file, "java_intarray*"); break;
259                 case 'J':  fprintf (file, "java_longarray*"); break;
260                 case 'Z':  fprintf (file, "java_booleanarray*"); break;
261                 case 'B':  fprintf (file, "java_bytearray*"); break;
262                 case 'S':  fprintf (file, "java_shortarray*"); break;
263                 case 'C':  fprintf (file, "java_chararray*"); break;
264                 case 'F':  fprintf (file, "java_floatarray*"); break;
265                 case 'D':  fprintf (file, "java_doublearray*"); break;
266                                 
267                 case '[':  fprintf (file, "java_objectarray*");                                        
268                         while ((c = utf_nextu2(&utf_ptr)) == '[') ;
269                         if (c=='L') 
270                                 while (utf_nextu2(&utf_ptr) != ';');
271                         break;
272                            
273                 case 'L':  fprintf (file, "java_objectarray*");
274                         while ( utf_nextu2(&utf_ptr) != ';');
275                         break;
276                 default: panic ("invalid type descriptor");
277                 }
278                 break;
279                 
280         case 'L': 
281                 addoutputsize ( sizeof(java_objectheader*));
282                 fprintf (file, "struct ");
283                 while ( (c = utf_nextu2(&utf_ptr)) != ';' ) printIDpart (c);     
284                 fprintf (file, "*");
285                 break;
286                                         
287         default:  panic ("Unknown type in field descriptor");
288         }
289         
290         return utf_ptr;
291 }
292
293
294 /***** determine the number of entries of a utf string in the ident chain *****/
295
296 static int searchidentchain_utf(utf *ident) 
297 {
298         utf *u = chain_first(ident_chain);     /* first element of list */
299         int count = 0;
300
301         while (u) {
302                 if (u==ident) count++;         /* string found */
303                 u = chain_next(ident_chain);   /* next element in list */ 
304         }
305
306         return count;
307 }
308
309
310 /************** print structure for direct access to objects ******************/
311
312 static void printfields(classinfo *c)
313 {
314         u4 i;
315         fieldinfo *f;
316         int ident_count;
317         
318         if (!c) {
319                 addoutputsize(sizeof(java_objectheader));
320                 fprintf(file, "   java_objectheader header;\n");
321                 return;
322         }
323                 
324         printfields(c->super);
325         
326         for (i = 0; i < c->fieldscount; i++) {
327                 f = &(c->fields[i]);
328                 
329                 if (!(f->flags & ACC_STATIC)) {
330                         fprintf(file, "   ");
331                         printtype(f->descriptor->text);
332                         fprintf(file, " ");
333                         utf_fprint(file, f->name);
334
335                         /* rename multiple fieldnames */
336                         if ((ident_count = searchidentchain_utf(f->name)))
337                                 fprintf(file, "%d", ident_count - 1);
338                         chain_addlast(ident_chain, f->name);    
339
340                         fprintf(file, ";\n");
341                 }
342         }
343 }
344
345
346 /***************** store prototype for native method in file ******************/
347
348 static void printmethod(methodinfo *m)
349 {
350         char *utf_ptr;
351         u2 paramnum = 1;
352         u2 ident_count;
353
354         /* search for return-type in descriptor */      
355         utf_ptr = m->descriptor->text;
356         while (utf_nextu2(&utf_ptr) != ')');
357
358         /* create remarks */
359         fprintf(file, "\n/*\n * Class:     ");
360         utf_fprint(file, m->class->name);
361         fprintf(file, "\n * Method:    ");
362         utf_fprint(file, m->name);
363         fprintf(file, "\n * Signature: ");
364         utf_fprint(file, m->descriptor);
365         fprintf(file, "\n */\n");       
366
367         /* create prototype */                  
368         fprintf(file, "JNIEXPORT ");                            
369         printtype(utf_ptr);
370         fprintf(file, " JNICALL Java_");
371         printID(m->class->name);           
372
373         /* rename overloaded method */
374         if ((ident_count = searchidentchain_utf(m->name)))
375                 fprintf(file, "%d", ident_count - 1);           
376         chain_addlast(ident_chain, m->name);    
377
378         fprintf(file, "_");
379         printID(m->name);
380         fprintf(file, "(JNIEnv *env");
381         
382         utf_ptr = m->descriptor->text + 1;
383                         
384         if (!(m->flags & ACC_STATIC)) {
385                 fprintf(file, ", struct ");
386                 printID(m->class->name);
387                 fprintf(file, "* this");
388
389         } else {
390                 fprintf(file, ", jclass clazz");
391         }
392
393         if ((*utf_ptr) != ')') fprintf(file, ", ");
394                         
395         while ((*utf_ptr) != ')') {
396                 utf_ptr = printtype(utf_ptr);
397                 fprintf(file, " par%d", paramnum++);
398                 if ((*utf_ptr)!=')') fprintf(file, ", ");
399         }
400                         
401         fprintf(file, ");\n\n");
402 }
403
404
405 /******* remove package-name in fully-qualified classname *********************/
406
407 static void gen_header_filename(char *buffer, utf *u)
408 {
409         int i;
410   
411         for (i = 0;i < utf_strlen(u); i++) {
412                 if ((u->text[i] == '/') || (u->text[i] == '$')) buffer[i] = '_';  /* convert '$' and '/' to '_' */
413                 else buffer[i] = u->text[i];
414         }
415         buffer[utf_strlen(u)] = '\0';
416 }
417
418
419 /* create headerfile for classes and store native methods in chain ************/
420
421 static void headerfile_generate(classinfo *c)
422 {
423         char header_filename[1024] = "";
424         char classname[1024]; 
425         char uclassname[1024];
426         u2 i;
427         methodinfo *m;                  
428                       
429         /* store class in chain */                    
430         chain_addlast(nativeclass_chain, c);
431                                 
432         /* open headerfile for class */
433         gen_header_filename(classname, c->name);
434
435         /* create chain for renaming fields */
436         ident_chain = chain_new();
437         
438         sprintf(header_filename, "nat/%s.h", classname);
439         file = fopen(header_filename, "w");
440         if (!file) panic("Can not open file to store header information");
441
442         fprintf(file, "/* This file is machine generated, don't edit it !*/\n\n");
443
444         /* convert to uppercase */
445         for (i = 0; classname[i]; i++) {
446                 uclassname[i] = toupper(classname[i]);
447         }
448         uclassname[i] = '\0';
449
450         fprintf(file, "#ifndef _%s_H\n#define _%s_H\n\n", uclassname, uclassname);
451
452         /* create structure for direct access to objects */     
453         fprintf(file, "/* Structure information for class: ");
454         utf_fprint(file, c->name);
455         fprintf(file, " */\n\n");
456         fprintf(file, "typedef struct ");
457         printID(c->name);                                                       
458         fprintf(file, " {\n");
459         outputsize = 0;
460         dopadding = true;
461
462         printfields(c);
463
464         fprintf(file, "} ");
465         printID(c->name);
466         fprintf(file, ";\n\n");
467
468         /* create chain for renaming overloaded methods */
469         chain_free(ident_chain);
470         ident_chain = chain_new();
471
472         /* create method-prototypes */
473                                 
474         for (i = 0; i < c->methodscount; i++) {
475
476                 m = &(c->methods[i]);
477
478                 if (m->flags & ACC_NATIVE) {
479                         chain_addlast(nativemethod_chain, m);
480                         printmethod(m);
481                 }
482         }
483
484         chain_free(ident_chain);
485
486         fprintf(file, "#endif\n\n");
487
488         fclose(file);
489 }
490
491
492 /******** print classname, '$' used to seperate inner-class name ***********/
493
494 void print_classname(classinfo *clazz)
495 {
496         utf *u = clazz->name;
497     char *endpos  = u->text + u->blength;
498     char *utf_ptr = u->text; 
499         u2 c;
500
501     while (utf_ptr < endpos) {
502                 if ((c = utf_nextu2(&utf_ptr)) == '_') {
503                         putc('$', file);
504
505                 } else {
506                         putc(c, file);
507                 }
508         }
509
510
511
512 /*************** create table for locating native functions ****************/
513
514 static void printnativetableentry(methodinfo *m)
515 {
516         fprintf(file, "   { \"");
517         print_classname(m->class);
518         fprintf(file, "\",\n     \"");
519         utf_fprint(file, m->name);
520         fprintf(file, "\",\n     \"");
521         utf_fprint(file, m->descriptor);
522         fprintf(file, "\",\n     ");
523
524         if ((m->flags & ACC_STATIC) != 0)
525                 fprintf(file, "true");
526         else
527                 fprintf(file, "false");
528
529         fprintf(file, ",\n     ");
530         fprintf(file, "(functionptr) Java_");
531         printID(m->class->name);
532         fprintf(file,"_");
533         printID(m->name);
534         fprintf(file,"\n   },\n");
535 }
536
537
538 /***************************************************************************
539
540         create the nativetypes-headerfile which includes 
541         the headerfiles of the classes stored in the classes-chain 
542
543 ****************************************************************************/
544
545 static void headers_finish()
546 {
547         methodinfo *m;
548         classinfo *c;
549         char classname[1024];
550         
551         file = fopen("nativetypes.hh", "w");
552
553         if (!file)
554                 panic("Can not open file 'native.h' to store header information");
555         
556         fprintf(file, "/* Headerfile for native methods: nativetypes.hh */\n");
557         fprintf(file, "/* This file is machine generated, don't edit it !*/\n\n");      
558         fprintf(file, "\n/* include native-Headerfiles */\n\n");
559                         
560         c = chain_first(nativeclass_chain);
561         while (c) {
562                 dopadding = false;
563                 gen_header_filename(classname, c->name);                                                                                                                                                                                        
564                 fprintf(file, "#include \"nat/%s.h\"\n", classname);            
565                 c = chain_next(nativeclass_chain);              
566         }
567
568     fclose(file);
569         chain_free(nativeclass_chain);
570         
571         /* create table of native-methods */
572
573         file = fopen("nativetable.hh", "w");
574
575         if (!file)
576                 panic("Can not open file 'nativetable' to store native-link-table");
577
578         fprintf(file, "/* Table of native methods: nativetables.hh */\n");
579         fprintf(file, "/* This file is machine generated, don't edit it !*/\n\n"); 
580
581         while ((m = chain_first(nativemethod_chain)) != NULL) {
582                 chain_remove(nativemethod_chain);               
583                 printnativetableentry(m);
584         }
585                 
586         chain_free(nativemethod_chain);
587         fclose(file);
588 }
589
590
591 /******************** internal function: print_usage ************************
592
593 Prints usage information for the JAVA header generator to stdout.
594
595 ***************************************************************************/
596
597 static void print_usage()
598 {
599         printf("Usage: cacaoh class [class..]\n");
600 }   
601
602
603
604 /************************** Function: main *******************************
605
606    Main program.
607    
608 **************************************************************************/
609
610 int main(int argc, char **argv)
611 {
612         s4 i,a;
613         char *cp;
614         classinfo *topclass;
615                 
616
617         /********** internal (only used by main) *****************************/
618    
619         char classpath[500] = "";
620         char offsets_filename[1024] = ""; /* phil */
621         u4 heapmaxsize = 1000000;
622         u4 heapstartsize = 100000;
623
624         /*********** options so only headers are generated *******************/
625    
626         makeinitializations = false;
627    
628
629         /************ Collect some info from the environment *****************/
630
631         cp = getenv("CLASSPATH");
632         if (cp) {
633                 strcpy(classpath + strlen(classpath), ":");
634                 strcpy(classpath + strlen(classpath), cp);
635         }
636
637         if (argc < 2) {
638                 print_usage();
639                 exit(10);
640         }
641
642
643         /**************************** Program start **************************/
644
645         log_init(NULL);
646         log_text("Java - header-generator started"); 
647         
648         sprintf(offsets_filename, "jit/%s/offsets.h", ARCH_DIR);
649         file = fopen(offsets_filename, "w");
650         if (file == NULL) {
651                 fprintf(stderr, "Can not open file '%s' for write", offsets_filename);
652                 exit(-1);
653         }
654         
655         fprintf(file, "/* This file is machine generated, don't edit it !*/\n\n"); 
656
657         fprintf(file, "#define offobjvftbl    %3d\n", (int) OFFSET(java_objectheader, vftbl));
658         fprintf(file, "#define offarraysize   %3d\n", (int) OFFSET(java_arrayheader, size));
659         fprintf(file, "#define offobjarrdata  %3d\n\n", (int) OFFSET(java_objectarray, data[0]));
660         fprintf(file, "#define offbaseval     %3d\n", (int) OFFSET(vftbl, baseval));
661         fprintf(file, "#define offdiffval     %3d\n\n", (int) OFFSET(vftbl, diffval));
662
663         fprintf(file, "#define offclassvftbl  %3d\n", (int) OFFSET(classinfo, vftbl));
664         fprintf(file, "#define offclassinit   %3d\n", (int) OFFSET(classinfo, initialized));
665         fprintf(file, "#define offclassloaded %3d\n", (int) OFFSET(classinfo, loaded));
666         fprintf(file, "#define offclasslinked %3d\n\n", (int) OFFSET(classinfo, linked));
667
668         fprintf(file, "#define offjniitemtype %3d\n", (int) OFFSET(jni_callblock, itemtype));
669         fprintf(file, "#define offjniitem     %3d\n", (int) OFFSET(jni_callblock, item));
670         fprintf(file, "#define sizejniblock   %3d\n\n", (int) sizeof(jni_callblock));
671
672         fprintf(file, "#define offclassmethodinfo   %3d\n\n", (int) OFFSET(methodinfo,class));
673
674         fprintf(file, "#define offmethodnative %3d\n", (int) OFFSET(native_stackframeinfo,method));
675         fprintf(file, "#define offreturnfromnative %3d\n", (int) OFFSET(native_stackframeinfo,returnFromNative));
676         fprintf(file, "#define offaddrreturnfromnative %3d\n", (int) OFFSET(native_stackframeinfo,addrReturnFromNative));
677         fprintf(file, "#define offprevnative %3d\n", (int) OFFSET(native_stackframeinfo,prev));
678         fprintf(file, "#define offnextnative %3d\n", (int) OFFSET(native_stackframeinfo,next));
679
680         fprintf(file, "\n");
681         fprintf(file, "#define offcast_super_baseval  %3d\n", (int) OFFSET(castinfo, super_baseval));
682         fprintf(file, "#define offcast_super_diffval  %3d\n", (int) OFFSET(castinfo, super_diffval));
683         fprintf(file, "#define offcast_sub_baseval    %3d\n", (int) OFFSET(castinfo, sub_baseval));
684
685         fclose(file);
686
687         /* initialize the garbage collector */
688         gc_init(heapmaxsize, heapstartsize);
689
690         suck_init(classpath);
691    
692         tables_init();
693
694 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
695         initThreadsEarly();
696 #endif
697         loader_init();
698
699
700         /*********************** Load JAVA classes  **************************/
701         
702         nativemethod_chain = chain_new();
703         nativeclass_chain = chain_new();
704         
705         for (a = 1; a < argc; a++) {
706                 cp = argv[a];
707
708                 /* convert classname */
709                 for (i = strlen(cp) - 1; i >= 0; i--) {
710                         switch (cp[i]) {
711                         case '.': cp[i]='/';
712                                 break;
713                         case '_': cp[i]='$';    
714                         }
715                 }
716         
717 /*              topclass = loader_load(utf_new_char(cp)); */
718                 topclass = class_load(class_new(utf_new_char(cp)));
719                 class_link(topclass);
720
721         headerfile_generate(topclass);
722         }
723
724         headers_finish();
725
726         /************************ Release all resources **********************/
727
728         loader_close();
729         tables_close(literalstring_free);
730
731         /* Print "finished" message */
732
733         log_text("Java - header-generator stopped");
734         log_cputime();
735         mem_usagelog(1);
736         
737         return 0;
738 }
739
740
741 void setVMClassField(classinfo *c)
742 {
743 }
744
745
746 void *Java_java_lang_VMObject_clone(void *env, void *clazz, void * this) {
747         return 0;
748 }
749
750
751 /*
752  * These are local overrides for various environment variables in Emacs.
753  * Please do not remove this and leave it at the end of the file, where
754  * Emacs will automagically detect them.
755  * ---------------------------------------------------------------------
756  * Local variables:
757  * mode: c
758  * indent-tabs-mode: t
759  * c-basic-offset: 4
760  * tab-width: 4
761  * End:
762  */