1996-07-24 05:58:12 -07:00
|
|
|
/***********************************************************************/
|
|
|
|
/* */
|
|
|
|
/* Objective Caml */
|
|
|
|
/* */
|
|
|
|
/* Xavier Leroy and Damien Doligez, INRIA Rocquencourt */
|
|
|
|
/* */
|
|
|
|
/* Copyright 1996 Institut National de Recherche en Informatique et */
|
1999-11-17 10:59:06 -08:00
|
|
|
/* en Automatique. All rights reserved. This file is distributed */
|
|
|
|
/* under the terms of the GNU Library General Public License. */
|
1996-07-24 05:58:12 -07:00
|
|
|
/* */
|
|
|
|
/***********************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
/* Start-up code */
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include "config.h"
|
|
|
|
#ifdef HAS_UNISTD
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
2000-04-04 06:19:12 -07:00
|
|
|
#ifdef _WIN32
|
|
|
|
#include <windows.h>
|
|
|
|
#endif
|
1996-07-24 05:58:12 -07:00
|
|
|
#include "alloc.h"
|
1999-02-14 08:48:25 -08:00
|
|
|
#include "callback.h"
|
2000-02-11 07:09:27 -08:00
|
|
|
#include "custom.h"
|
1996-11-29 10:36:42 -08:00
|
|
|
#include "debugger.h"
|
1996-07-24 05:58:12 -07:00
|
|
|
#include "exec.h"
|
|
|
|
#include "fail.h"
|
|
|
|
#include "fix_code.h"
|
|
|
|
#include "gc_ctrl.h"
|
|
|
|
#include "interp.h"
|
|
|
|
#include "intext.h"
|
|
|
|
#include "io.h"
|
1997-06-13 08:49:36 -07:00
|
|
|
#include "memory.h"
|
1996-07-24 05:58:12 -07:00
|
|
|
#include "minor_gc.h"
|
|
|
|
#include "misc.h"
|
|
|
|
#include "mlvalues.h"
|
1997-06-13 08:49:36 -07:00
|
|
|
#include "prims.h"
|
2000-03-06 01:29:33 -08:00
|
|
|
#include "reverse.h"
|
2000-01-31 21:41:23 -08:00
|
|
|
#include "signals.h"
|
1996-07-24 05:58:12 -07:00
|
|
|
#include "stacks.h"
|
|
|
|
#include "sys.h"
|
|
|
|
|
|
|
|
#ifndef O_BINARY
|
|
|
|
#define O_BINARY 0
|
|
|
|
#endif
|
|
|
|
|
1997-06-13 08:49:36 -07:00
|
|
|
#ifndef SEEK_END
|
|
|
|
#define SEEK_END 2
|
|
|
|
#endif
|
|
|
|
|
1996-07-24 05:58:12 -07:00
|
|
|
header_t atom_table[256];
|
1996-11-07 02:57:59 -08:00
|
|
|
|
|
|
|
/* Initialize the atom table */
|
1996-07-24 05:58:12 -07:00
|
|
|
|
1997-09-02 05:55:01 -07:00
|
|
|
static void init_atoms(void)
|
1996-07-24 05:58:12 -07:00
|
|
|
{
|
|
|
|
int i;
|
2000-01-02 08:10:00 -08:00
|
|
|
for(i = 0; i < 256; i++) atom_table[i] = Make_header(0, i, Caml_white);
|
1996-07-24 05:58:12 -07:00
|
|
|
}
|
|
|
|
|
1996-11-07 02:57:59 -08:00
|
|
|
/* Read the trailer of a bytecode file */
|
|
|
|
|
1996-07-24 05:58:12 -07:00
|
|
|
#define FILE_NOT_FOUND (-1)
|
|
|
|
#define TRUNCATED_FILE (-2)
|
|
|
|
#define BAD_MAGIC_NUM (-3)
|
|
|
|
|
2000-03-05 11:18:50 -08:00
|
|
|
static void fixup_endianness_trailer(uint32 * p)
|
1996-07-24 05:58:12 -07:00
|
|
|
{
|
2000-03-05 11:18:50 -08:00
|
|
|
#ifndef ARCH_BIG_ENDIAN
|
|
|
|
Reverse_32(p, p);
|
|
|
|
#endif
|
|
|
|
}
|
1996-07-24 05:58:12 -07:00
|
|
|
|
2000-03-05 11:18:50 -08:00
|
|
|
static int read_trailer(int fd, struct exec_trailer *trail)
|
|
|
|
{
|
1997-06-13 08:49:36 -07:00
|
|
|
lseek(fd, (long) -TRAILER_SIZE, SEEK_END);
|
2000-03-05 11:18:50 -08:00
|
|
|
if (read(fd, (char *) trail, TRAILER_SIZE) < TRAILER_SIZE)
|
|
|
|
return TRUNCATED_FILE;
|
|
|
|
fixup_endianness_trailer(&trail->num_sections);
|
|
|
|
if (strncmp(trail->magic, EXEC_MAGIC, 12) == 0)
|
1996-07-24 05:58:12 -07:00
|
|
|
return 0;
|
|
|
|
else
|
|
|
|
return BAD_MAGIC_NUM;
|
|
|
|
}
|
|
|
|
|
2000-03-05 11:18:50 -08:00
|
|
|
static int attempt_open(char **name, struct exec_trailer *trail,
|
|
|
|
int do_open_script)
|
1996-07-24 05:58:12 -07:00
|
|
|
{
|
|
|
|
char * truename;
|
|
|
|
int fd;
|
|
|
|
int err;
|
|
|
|
char buf [2];
|
|
|
|
|
|
|
|
truename = searchpath(*name);
|
|
|
|
if (truename == 0) truename = *name; else *name = truename;
|
|
|
|
fd = open(truename, O_RDONLY | O_BINARY);
|
|
|
|
if (fd == -1) return FILE_NOT_FOUND;
|
|
|
|
if (!do_open_script){
|
|
|
|
err = read (fd, buf, 2);
|
|
|
|
if (err < 2) { close(fd); return TRUNCATED_FILE; }
|
|
|
|
if (buf [0] == '#' && buf [1] == '!') { close(fd); return BAD_MAGIC_NUM; }
|
|
|
|
}
|
|
|
|
err = read_trailer(fd, trail);
|
|
|
|
if (err != 0) { close(fd); return err; }
|
|
|
|
return fd;
|
|
|
|
}
|
|
|
|
|
2000-03-05 11:18:50 -08:00
|
|
|
/* Read the section descriptors */
|
|
|
|
|
|
|
|
static void read_section_descriptors(int fd, struct exec_trailer *trail)
|
|
|
|
{
|
|
|
|
int toc_size, i;
|
|
|
|
|
|
|
|
toc_size = trail->num_sections * 8;
|
|
|
|
trail->section = stat_alloc(toc_size);
|
|
|
|
lseek(fd, - (long) (TRAILER_SIZE + toc_size), SEEK_END);
|
|
|
|
if (read(fd, (char *) trail->section, toc_size) != toc_size)
|
|
|
|
fatal_error("Fatal error: cannot read section table\n");
|
|
|
|
/* Fixup endianness of lengths */
|
|
|
|
for (i = 0; i < trail->num_sections; i++)
|
|
|
|
fixup_endianness_trailer(&(trail->section[i].len));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Position fd at the beginning of the section having the given name.
|
|
|
|
Return the length of the section data in bytes. */
|
|
|
|
|
|
|
|
static int32 seek_section(int fd, struct exec_trailer *trail, char *name)
|
|
|
|
{
|
|
|
|
long ofs;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
ofs = TRAILER_SIZE + trail->num_sections * 8;
|
|
|
|
for (i = trail->num_sections - 1; i >= 0; i--) {
|
|
|
|
ofs += trail->section[i].len;
|
|
|
|
if (strncmp(trail->section[i].name, name, 4) == 0) {
|
|
|
|
lseek(fd, -ofs, SEEK_END);
|
|
|
|
return trail->section[i].len;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fatal_error_arg("Fatal_error: section `%s' is missing\n", name);
|
|
|
|
return 0; /* not reached */
|
|
|
|
}
|
|
|
|
|
1997-06-13 08:49:36 -07:00
|
|
|
/* Check the primitives used by the bytecode file against the table of
|
|
|
|
primitives linked in this interpreter */
|
|
|
|
|
1997-09-02 05:55:01 -07:00
|
|
|
static void check_primitives(int fd, int prim_size)
|
1997-06-13 08:49:36 -07:00
|
|
|
{
|
|
|
|
char * prims = stat_alloc(prim_size);
|
|
|
|
char * p;
|
|
|
|
int idx;
|
|
|
|
|
|
|
|
if (read(fd, prims, prim_size) != prim_size)
|
|
|
|
fatal_error("Fatal error: cannot read primitive table\n");
|
|
|
|
/* prims contains 0-terminated strings, concatenated. */
|
|
|
|
for (p = prims, idx = 0;
|
|
|
|
p < prims + prim_size;
|
|
|
|
p = p + strlen(p) + 1, idx++) {
|
|
|
|
if (names_of_cprim[idx] == NULL ||
|
|
|
|
strcmp(p, names_of_cprim[idx]) != 0)
|
2000-03-30 09:28:39 -08:00
|
|
|
fatal_error_arg("Fatal error: this bytecode file cannot run "
|
2000-03-05 11:18:50 -08:00
|
|
|
"on this bytecode interpreter\n"
|
|
|
|
"Mismatch on primitive `%s'\n", p);
|
1997-06-13 08:49:36 -07:00
|
|
|
}
|
|
|
|
stat_free(prims);
|
|
|
|
}
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
/* Invocation of ocamlrun: 4 cases.
|
1996-07-24 05:58:12 -07:00
|
|
|
|
|
|
|
1. runtime + bytecode
|
1998-10-02 06:02:32 -07:00
|
|
|
user types: ocamlrun [options] bytecode args...
|
|
|
|
arguments: ocamlrun [options] bytecode args...
|
1996-07-24 05:58:12 -07:00
|
|
|
|
|
|
|
2. bytecode script
|
|
|
|
user types: bytecode args...
|
1998-10-02 06:02:32 -07:00
|
|
|
2a (kernel 1) arguments: ocamlrun ./bytecode args...
|
1996-07-24 05:58:12 -07:00
|
|
|
2b (kernel 2) arguments: bytecode bytecode args...
|
|
|
|
|
|
|
|
3. concatenated runtime and bytecode
|
|
|
|
user types: composite args...
|
|
|
|
arguments: composite args...
|
|
|
|
|
|
|
|
Algorithm:
|
|
|
|
1- If argument 0 is a valid byte-code file that does not start with #!,
|
|
|
|
then we are in case 3 and we pass the same command line to the
|
1998-10-02 06:02:32 -07:00
|
|
|
Objective Caml program.
|
1996-07-24 05:58:12 -07:00
|
|
|
2- In all other cases, we parse the command line as:
|
|
|
|
(whatever) [options] bytecode args...
|
|
|
|
and we strip "(whatever) [options]" from the command line.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
1997-05-13 07:45:38 -07:00
|
|
|
/* Configuration parameters and flags */
|
|
|
|
|
1997-05-21 08:28:15 -07:00
|
|
|
static unsigned long verbose_init = 0;
|
|
|
|
static unsigned long percent_free_init = Percent_free_def;
|
|
|
|
static unsigned long max_percent_free_init = Max_percent_free_def;
|
1997-05-13 07:45:38 -07:00
|
|
|
static unsigned long minor_heap_init = Minor_heap_def;
|
|
|
|
static unsigned long heap_chunk_init = Heap_chunk_def;
|
|
|
|
static unsigned long heap_size_init = Init_heap_def;
|
|
|
|
static unsigned long max_stack_init = Max_stack_def;
|
1996-11-07 02:57:59 -08:00
|
|
|
extern int trace_flag;
|
|
|
|
|
|
|
|
/* Parse options on the command line */
|
|
|
|
|
1997-09-02 05:55:01 -07:00
|
|
|
static int parse_command_line(char **argv)
|
1996-11-07 02:57:59 -08:00
|
|
|
{
|
1998-04-14 07:48:34 -07:00
|
|
|
int i, j;
|
1996-11-07 02:57:59 -08:00
|
|
|
|
|
|
|
for(i = 1; argv[i] != NULL && argv[i][0] == '-'; i++) {
|
|
|
|
switch(argv[i][1]) {
|
|
|
|
#ifdef DEBUG
|
|
|
|
case 't':
|
|
|
|
trace_flag = 1;
|
|
|
|
break;
|
1998-11-05 04:53:32 -08:00
|
|
|
case 'P':
|
|
|
|
{ extern int parser_trace;
|
|
|
|
parser_trace = 1;
|
|
|
|
break; }
|
1996-11-07 02:57:59 -08:00
|
|
|
#endif
|
|
|
|
case 'v':
|
1998-08-07 11:43:39 -07:00
|
|
|
verbose_init = 1+4+8+16+32;
|
1996-11-07 02:57:59 -08:00
|
|
|
break;
|
1998-04-14 07:48:34 -07:00
|
|
|
case 'p':
|
|
|
|
for (j = 0; names_of_cprim[j] != NULL; j++)
|
|
|
|
printf("%s\n", names_of_cprim[j]);
|
|
|
|
exit(0);
|
|
|
|
break;
|
1996-11-07 02:57:59 -08:00
|
|
|
default:
|
|
|
|
fatal_error_arg("Unknown option %s.\n", argv[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Parse the CAMLRUNPARAM variable */
|
|
|
|
/* The option letter for each runtime option is the first letter of the
|
1997-05-13 07:45:38 -07:00
|
|
|
last word of the ML name of the option (see [stdlib/gc.mli]).
|
|
|
|
Except for l (maximum stack size) and h (initial heap size).
|
|
|
|
*/
|
|
|
|
|
1997-09-02 05:55:01 -07:00
|
|
|
static void scanmult (char *opt, long unsigned int *var)
|
1997-05-13 07:45:38 -07:00
|
|
|
{
|
|
|
|
char mult = ' ';
|
|
|
|
sscanf (opt, "=%lu%c", var, &mult);
|
|
|
|
if (mult == 'k') *var = *var * 1024;
|
|
|
|
if (mult == 'M') *var = *var * (1024 * 1024);
|
|
|
|
if (mult == 'G') *var = *var * (1024 * 1024 * 1024);
|
|
|
|
}
|
1996-11-07 02:57:59 -08:00
|
|
|
|
1997-09-02 05:55:01 -07:00
|
|
|
static void parse_camlrunparam(void)
|
1996-11-07 02:57:59 -08:00
|
|
|
{
|
1999-11-09 07:39:42 -08:00
|
|
|
char *opt = getenv ("OCAMLRUNPARAM");
|
|
|
|
|
|
|
|
if (opt == NULL) opt = getenv ("CAMLRUNPARAM");
|
|
|
|
|
1996-11-07 02:57:59 -08:00
|
|
|
if (opt != NULL){
|
|
|
|
while (*opt != '\0'){
|
|
|
|
switch (*opt++){
|
1997-05-19 08:42:21 -07:00
|
|
|
case 's': scanmult (opt, &minor_heap_init); break;
|
1997-05-13 07:45:38 -07:00
|
|
|
case 'i': scanmult (opt, &heap_chunk_init); break;
|
|
|
|
case 'h': scanmult (opt, &heap_size_init); break;
|
|
|
|
case 'l': scanmult (opt, &max_stack_init); break;
|
1997-05-21 08:28:15 -07:00
|
|
|
case 'o': scanmult (opt, &percent_free_init); break;
|
|
|
|
case 'O': scanmult (opt, &max_percent_free_init); break;
|
|
|
|
case 'v': scanmult (opt, &verbose_init); break;
|
1996-11-07 02:57:59 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1997-09-02 05:55:01 -07:00
|
|
|
extern void init_ieee_floats (void);
|
1996-11-07 02:57:59 -08:00
|
|
|
|
2000-01-31 21:41:23 -08:00
|
|
|
#ifdef _WIN32
|
|
|
|
extern DWORD WINAPI caml_signal_thread(LPVOID lpParam);
|
|
|
|
#endif
|
|
|
|
|
1996-11-07 02:57:59 -08:00
|
|
|
/* Main entry point when loading code from a file */
|
1996-07-24 05:58:12 -07:00
|
|
|
|
1997-09-02 05:55:01 -07:00
|
|
|
void caml_main(char **argv)
|
1996-07-24 05:58:12 -07:00
|
|
|
{
|
2000-03-05 11:18:50 -08:00
|
|
|
int fd, pos;
|
1996-07-24 05:58:12 -07:00
|
|
|
struct exec_trailer trail;
|
2000-03-05 11:18:50 -08:00
|
|
|
asize_t prog_size;
|
1997-08-29 08:37:22 -07:00
|
|
|
struct channel * chan;
|
1999-02-14 08:48:25 -08:00
|
|
|
value res;
|
1996-07-24 05:58:12 -07:00
|
|
|
|
|
|
|
/* Machine-dependent initialization of the floating-point hardware
|
|
|
|
so that it behaves as much as possible as specified in IEEE */
|
|
|
|
init_ieee_floats();
|
2000-02-11 07:09:27 -08:00
|
|
|
init_custom_operations();
|
1999-02-14 08:48:25 -08:00
|
|
|
external_raise = NULL;
|
|
|
|
/* Determine options and position of bytecode file */
|
1997-06-13 08:49:36 -07:00
|
|
|
#ifdef DEBUG
|
1999-02-14 08:48:25 -08:00
|
|
|
verbose_init = 63;
|
1997-06-13 08:49:36 -07:00
|
|
|
#endif
|
1999-02-14 08:48:25 -08:00
|
|
|
parse_camlrunparam();
|
|
|
|
pos = 0;
|
|
|
|
fd = attempt_open(&argv[0], &trail, 0);
|
|
|
|
if (fd < 0) {
|
|
|
|
pos = parse_command_line(argv);
|
|
|
|
if (argv[pos] == 0)
|
|
|
|
fatal_error("No bytecode file specified.\n");
|
|
|
|
fd = attempt_open(&argv[pos], &trail, 1);
|
|
|
|
switch(fd) {
|
|
|
|
case FILE_NOT_FOUND:
|
|
|
|
fatal_error_arg("Fatal error: cannot find file %s\n", argv[pos]);
|
|
|
|
break;
|
|
|
|
case TRUNCATED_FILE:
|
|
|
|
case BAD_MAGIC_NUM:
|
|
|
|
fatal_error_arg(
|
|
|
|
"Fatal error: the file %s is not a bytecode executable file\n",
|
|
|
|
argv[pos]);
|
|
|
|
break;
|
1997-06-13 08:49:36 -07:00
|
|
|
}
|
1999-02-14 08:48:25 -08:00
|
|
|
}
|
2000-03-05 11:18:50 -08:00
|
|
|
/* Read the table of contents (section descriptors) */
|
|
|
|
read_section_descriptors(fd, &trail);
|
1999-02-14 08:48:25 -08:00
|
|
|
/* Initialize the abstract machine */
|
|
|
|
init_gc (minor_heap_init, heap_size_init, heap_chunk_init,
|
|
|
|
percent_free_init, max_percent_free_init, verbose_init);
|
|
|
|
init_stack (max_stack_init);
|
|
|
|
init_atoms();
|
|
|
|
/* Initialize the interpreter */
|
|
|
|
interprete(NULL, 0);
|
|
|
|
/* Initialize the debugger, if needed */
|
|
|
|
debugger_init();
|
|
|
|
/* Load the code */
|
2000-03-05 11:18:50 -08:00
|
|
|
code_size = seek_section(fd, &trail, "CODE");
|
|
|
|
load_code(fd, code_size);
|
1999-02-14 08:48:25 -08:00
|
|
|
/* Check the primitives */
|
2000-03-05 11:18:50 -08:00
|
|
|
check_primitives(fd, seek_section(fd, &trail, "PRIM"));
|
1999-02-14 08:48:25 -08:00
|
|
|
/* Load the globals */
|
2000-03-05 11:18:50 -08:00
|
|
|
seek_section(fd, &trail, "DATA");
|
1999-02-14 08:48:25 -08:00
|
|
|
chan = open_descriptor(fd);
|
|
|
|
global_data = input_val(chan);
|
2000-03-05 11:18:50 -08:00
|
|
|
close_channel(chan); /* this also closes fd */
|
|
|
|
stat_free(trail.section);
|
1999-02-14 08:48:25 -08:00
|
|
|
/* Ensure that the globals are in the major heap. */
|
|
|
|
oldify(global_data, &global_data);
|
|
|
|
/* Initialize system libraries */
|
|
|
|
init_exceptions();
|
|
|
|
sys_init(argv + pos);
|
2000-01-31 21:41:23 -08:00
|
|
|
#ifdef _WIN32
|
2000-03-05 11:18:50 -08:00
|
|
|
/* Start a thread to handle signals */
|
2000-01-31 21:41:23 -08:00
|
|
|
if (getenv("CAMLSIGPIPE")) {
|
|
|
|
int lpThreadId;
|
|
|
|
CreateThread(NULL, 0, caml_signal_thread, NULL, 0, &lpThreadId);
|
|
|
|
}
|
|
|
|
#endif
|
1999-02-14 08:48:25 -08:00
|
|
|
/* Execute the program */
|
|
|
|
debugger(PROGRAM_START);
|
2000-03-05 11:18:50 -08:00
|
|
|
res = interprete(start_code, code_size);
|
1999-02-14 08:48:25 -08:00
|
|
|
if (Is_exception_result(res)) {
|
|
|
|
exn_bucket = Extract_exception(res);
|
1997-12-09 05:53:13 -08:00
|
|
|
extern_sp = &exn_bucket; /* The debugger needs the exception value. */
|
1996-11-29 10:36:42 -08:00
|
|
|
debugger(UNCAUGHT_EXC);
|
1996-11-07 02:57:59 -08:00
|
|
|
fatal_uncaught_exception(exn_bucket);
|
1996-07-24 05:58:12 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1996-11-07 02:57:59 -08:00
|
|
|
/* Main entry point when code is linked in as initialized data */
|
|
|
|
|
1997-09-02 05:55:01 -07:00
|
|
|
void caml_startup_code(code_t code, asize_t code_size, char *data, char **argv)
|
1996-11-07 02:57:59 -08:00
|
|
|
{
|
1999-02-14 08:48:25 -08:00
|
|
|
value res;
|
1996-11-07 02:57:59 -08:00
|
|
|
|
|
|
|
init_ieee_floats();
|
|
|
|
#ifdef DEBUG
|
1998-10-07 12:01:42 -07:00
|
|
|
verbose_init = 63;
|
1996-11-07 02:57:59 -08:00
|
|
|
#endif
|
|
|
|
parse_camlrunparam();
|
1999-02-14 08:48:25 -08:00
|
|
|
external_raise = NULL;
|
|
|
|
/* Initialize the abstract machine */
|
|
|
|
init_gc (minor_heap_init, heap_size_init, heap_chunk_init,
|
|
|
|
percent_free_init, max_percent_free_init, verbose_init);
|
|
|
|
init_stack (max_stack_init);
|
|
|
|
init_atoms();
|
|
|
|
/* Initialize the interpreter */
|
|
|
|
interprete(NULL, 0);
|
|
|
|
/* Load the code */
|
|
|
|
start_code = code;
|
1997-02-02 06:53:44 -08:00
|
|
|
#ifdef THREADED_CODE
|
1999-02-14 08:48:25 -08:00
|
|
|
thread_code(start_code, code_size);
|
1997-02-02 06:53:44 -08:00
|
|
|
#endif
|
1999-02-14 08:48:25 -08:00
|
|
|
/* Load the globals */
|
|
|
|
global_data = input_val_from_string((value)data, 0);
|
|
|
|
/* Ensure that the globals are in the major heap. */
|
|
|
|
oldify(global_data, &global_data);
|
|
|
|
/* Run the code */
|
|
|
|
init_exceptions();
|
|
|
|
sys_init(argv);
|
|
|
|
res = interprete(start_code, code_size);
|
|
|
|
if (Is_exception_result(res))
|
|
|
|
fatal_uncaught_exception(Extract_exception(res));
|
1996-11-07 02:57:59 -08:00
|
|
|
}
|
1998-10-02 06:02:32 -07:00
|
|
|
|