2 * Copyright (C) 2003, 2004, 2005, 2006, 2007
3 * Robert Lougher <rob@lougher.org.uk>.
5 * This file is part of JamVM.
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2,
10 * or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 static int VM_initing
= TRUE
;
30 extern void initialisePlatform();
32 /* Setup default values for command line args */
34 void setDefaultInitArgs(InitArgs
*args
) {
35 args
->noasyncgc
= FALSE
;
37 args
->verbosegc
= FALSE
;
38 args
->verbosedll
= FALSE
;
39 args
->verboseclass
= FALSE
;
41 args
->compact_specified
= FALSE
;
43 args
->classpath
= NULL
;
44 args
->bootpath
= NULL
;
46 args
->java_stack
= DEFAULT_STACK
;
47 args
->min_heap
= DEFAULT_MIN_HEAP
;
48 args
->max_heap
= DEFAULT_MAX_HEAP
;
50 args
->props_count
= 0;
52 args
->vfprintf
= vfprintf
;
57 args
->replication
= 10;
58 args
->codemem
= args
->max_heap
/ 4;
62 int VMInitialising() {
66 void initVM(InitArgs
*args
) {
67 /* Perform platform dependent initialisation */
70 /* Initialise the VM modules -- ordering is important! */
71 initialiseHooks(args
);
72 initialiseProperties(args
);
73 initialiseAlloc(args
);
74 initialiseClass(args
);
78 initialiseInterpreter(args
);
79 initialiseMainThread(args
);
80 initialiseException();
86 /* No need to check for exception - if one occurs, signalException aborts VM */
87 findSystemClass("java/lang/NoClassDefFoundError");
88 findSystemClass("java/lang/ClassFormatError");
89 findSystemClass("java/lang/NoSuchFieldError");
90 findSystemClass("java/lang/NoSuchMethodError");
95 unsigned long parseMemValue(char *str
) {
97 unsigned long n
= strtol(str
, &end
, 0);