summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--INSTALL.MPW5
-rw-r--r--byterun/Makefile.Mac6
-rw-r--r--byterun/fix_code.c7
-rw-r--r--byterun/interp.a30
-rw-r--r--byterun/startup.c1
5 files changed, 30 insertions, 19 deletions
diff --git a/INSTALL.MPW b/INSTALL.MPW
index e39bc7fb3..e8fe64270 100644
--- a/INSTALL.MPW
+++ b/INSTALL.MPW
@@ -8,11 +8,6 @@
# To install Objective Caml in your MPW environment, follow this script.
# Read the comments and execute the commands. If you run the commands
# without changing anything, you'll get a reasonable default configuration.
-#
-# Set the shell's stack size to at least 128k because O'Caml uses a lot of
-# stack space.
-
-SetShellSize -s 128k
# Go to the directory where you found this file.
diff --git a/byterun/Makefile.Mac b/byterun/Makefile.Mac
index 75048ff0c..f64833d52 100644
--- a/byterun/Makefile.Mac
+++ b/byterun/Makefile.Mac
@@ -19,7 +19,8 @@ OBJS = interp.a.o misc.c.o stacks.c.o fix_code.c.o startup.c.o main.c.o ¶
compare.c.o ints.c.o floats.c.o str.c.o array.c.o io.c.o extern.c.o ¶
intern.c.o ¶
hash.c.o sys.c.o meta.c.o parsing.c.o gc_ctrl.c.o terminfo.c.o md5.c.o ¶
- obj.c.o lexing.c.o macintosh.c.o rotatecursor.c.o printexc.c.o callback.c.o
+ obj.c.o lexing.c.o macintosh.c.o rotatecursor.c.o printexc.c.o callback.c.o ¶
+ debugger.c.o
PPCOBJS = interp.c.x misc.c.x stacks.c.x fix_code.c.x startup.c.x main.c.x ¶
freelist.c.x major_gc.c.x minor_gc.c.x memory.c.x alloc.c.x roots.c.x ¶
@@ -27,7 +28,8 @@ PPCOBJS = interp.c.x misc.c.x stacks.c.x fix_code.c.x startup.c.x main.c.x ¶
compare.c.x ints.c.x floats.c.x str.c.x array.c.x io.c.x extern.c.x ¶
intern.c.x ¶
hash.c.x sys.c.x meta.c.x parsing.c.x gc_ctrl.c.x terminfo.c.x md5.c.x ¶
- obj.c.x lexing.c.x macintosh.c.x rotatecursor.c.x printexc.c.x callback.c.x
+ obj.c.x lexing.c.x macintosh.c.x rotatecursor.c.x printexc.c.x callback.c.x ¶
+ debugger.c.x
PRIMS = array.c compare.c extern.c floats.c gc_ctrl.c hash.c ¶
intern.c interp.c ints.c io.c lexing.c md5.c meta.c obj.c parsing.c ¶
diff --git a/byterun/fix_code.c b/byterun/fix_code.c
index 5713330d6..189b1b48c 100644
--- a/byterun/fix_code.c
+++ b/byterun/fix_code.c
@@ -16,10 +16,10 @@
#include "config.h"
#include "debugger.h"
#include "fix_code.h"
+#include "instruct.h"
#include "memory.h"
#include "misc.h"
#include "mlvalues.h"
-#include "instruct.h"
#include "reverse.h"
#ifdef HAS_UNISTD
#include <unistd.h>
@@ -41,7 +41,7 @@ void load_code(fd, len)
start_code = (code_t) stat_alloc(code_size);
if (read(fd, (char *) start_code, code_size) != code_size)
fatal_error("Fatal error: truncated bytecode file.\n");
-#ifdef BIG_ENDIAN
+#ifdef ARCH_BIG_ENDIAN
fixup_endianness(start_code, code_size);
#endif
if (debugger_in_use) {
@@ -108,7 +108,8 @@ void thread_code (code_t code, asize_t len)
for (p = code; p < code + len; /*nothing*/) {
opcode_t instr = *p;
if (instr < 0 || instr > STOP){
- fatal_error_arg ("Fatal error: bad opcode (%lx)\n", (void *) instr);
+ fatal_error_arg ("Fatal error in fix_code: bad opcode (%lx)\n",
+ (void *) instr);
}
*p++ = (opcode_t)((unsigned long)(instr_table[instr]));
if (instr == SWITCH) {
diff --git a/byterun/interp.a b/byterun/interp.a
index 982717c1e..c2c8a2cd6 100644
--- a/byterun/interp.a
+++ b/byterun/interp.a
@@ -45,7 +45,7 @@
import (callback_depth): data
msg record
- dc.b 'Fatal error: bad opcode (%lx)', $0D, $00
+ dc.b 'Fatal error in interp: bad opcode (%lx)', $0D, $00
endr
interprete proc export
@@ -110,12 +110,20 @@ initial_callback_depth_ equ $00
LEA.L -local_var_size_(A7), A7
Call_restore
- MOVEA.L local_var_size_+4*10+$4(A7), A0 ; code
- CMPI.L #122, (A0)
- BHI.S nothread ; deja tresse
-
+ MOVE.L local_var_size_+4*10+$4(A7), D0 ; code
+ BNE.S noinit ; == NULL => init
LEA.L table(PC), A0
MOVE.L A0, (instr_table).L
+ MOVEQ.L #1, D0
+ Call_setup ; 2eme copie: "lbl_1B88"
+ LEA.L local_var_size_(A7), A7
+ MOVEM.L (A7)+, D3-D7/A2-A6
+ RTS
+
+noinit: MOVEA.L local_var_size_+4*10+$4(A7), A0 ; code
+ CMPI.L #124, (A0)
+ BHI.S nothread ; deja tresse
+
MOVE.L local_var_size_+4*10+$8(A7), -(A7) ; argument 1 (size)
MOVE.L local_var_size_+4*10+$8(A7), -(A7) ; argument 0 (code)
Call_setup
@@ -147,6 +155,7 @@ nothread: LEA.L i_start(PC), A6
MOVE.L initial_local_roots_(A7), (local_roots).L
MOVE.L initial_callback_depth_(A7), (callback_depth).L
MOVEA.L (exn_bucket).L, accu_
+ MOVEA.L (extern_sp).L, sp_
JMP i_82-i_base(A6) ; RAISE
lbl_78: LEA.L raise_buf_(A7), A0
MOVE.L A0, (external_raise).L
@@ -157,7 +166,7 @@ lbl_78: LEA.L raise_buf_(A7), A0
Make_table
lcla &i
&i seta 0
- while &i < 122 do
+ while &i < 124 do
DC.L i_&i - i_base
&i seta &i + 1
endw
@@ -908,7 +917,6 @@ i_83: TST.L (something_to_do).L
i_83x: CLR.L (something_to_do).L
TST.L (force_major_slice).L
BEQ.S lbl_1116
- CLR.L (force_major_slice).L
Setup_for_gc
Call_setup
JSR (minor_collection).L
@@ -1184,6 +1192,12 @@ i_121: MOVE.L initial_external_raise_(A7), (external_raise).L
BRA lbl_1B88
Nodispatch
+; EVENT
+i_122: Dispatch
+
+; BREAK
+i_123: Dispatch
+
Spacer 12100 ; complete a 64k
BRA fatal
@@ -1241,7 +1255,7 @@ chk_stks: CMPA.L (stack_threshold).L, sp_
MOVE.L (extern_sp).L, sp_
BRA i_83
-lbl_1B88: Call_setup
+lbl_1B88: Call_setup ; 2eme copie: "init"
LEA.L local_var_size_(A7), A7
MOVEM.L (A7)+, D3-D7/A2-A6
RTS
diff --git a/byterun/startup.c b/byterun/startup.c
index ff31db569..baa5c1e83 100644
--- a/byterun/startup.c
+++ b/byterun/startup.c
@@ -41,7 +41,6 @@
#endif
header_t atom_table[256];
-code_t start_code;
/* Initialize the atom table */