Mach).
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/i386/lapgen.scm,v 1.15 1992/02/15 16:16:57 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/i386/lapgen.scm,v 1.16 1992/02/16 02:06:41 jinx Exp $
$MC68020-Header: /scheme/compiler/bobcat/RCS/lapgen.scm,v 4.42 1991/05/28 19:14:26 jinx Exp $
Copyright (c) 1992 Massachusetts Institute of Technology
set! define lookup-apply primitive-error
quotient remainder modulo))
+(define-integrable (invoke-hook entry)
+ (LAP (JMP ,entry)))
+
+(define-integrable (invoke-hook/call entry)
+ (LAP (CALL ,entry)))
+
(define-integrable (invoke-interface code)
(LAP (MOV B (R ,eax) (& ,code))
- (JMP F ,entry:compiler-scheme-to-interface)))
+ ,@(invoke-hook entry:compiler-scheme-to-interface)))
(define-integrable (invoke-interface/call code)
(LAP (MOV B (R ,eax) (& ,code))
- (CALL F ,entry:compiler-scheme-to-interface/call)))
+ ,@(invoke-hook/call entry:compiler-scheme-to-interface/call)))
\f
(let-syntax ((define-entries
(macro (start . names)
(car names))
(byte-offset-reference regnum:regs-pointer
,index))
- (loop (cdr names) (+ index 8)))))
+ (loop (cdr names) (+ index 4)))))
`(BEGIN ,@(loop names start)))))
(define-entries #x40 ; (* 16 4)
scheme-to-interface ; Main entry point (only one necessary)
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/i386/rules3.scm,v 1.14 1992/02/15 14:34:45 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/i386/rules3.scm,v 1.15 1992/02/16 02:06:29 jinx Exp $
$MC68020-Header: /scheme/compiler/bobcat/RCS/rules3.scm,v 4.31 1991/05/28 19:14:55 jinx Exp $
Copyright (c) 1992 Massachusetts Institute of Technology
(LAP ,@(clear-map!)
#|
,@(case frame-size
- ((1) (LAP (JMP F ,entry:compiler-shortcircuit-apply-size-1)))
- ((2) (LAP (JMP F ,entry:compiler-shortcircuit-apply-size-2)))
- ((3) (LAP (JMP F ,entry:compiler-shortcircuit-apply-size-3)))
- ((4) (LAP (JMP F ,entry:compiler-shortcircuit-apply-size-4)))
- ((5) (LAP (JMP F ,entry:compiler-shortcircuit-apply-size-5)))
- ((6) (LAP (JMP F ,entry:compiler-shortcircuit-apply-size-6)))
- ((7) (LAP (JMP F ,entry:compiler-shortcircuit-apply-size-7)))
- ((8) (LAP (JMP F ,entry:compiler-shortcircuit-apply-size-8)))
+ ((1) (invoke-hook entry:compiler-shortcircuit-apply-size-1))
+ ((2) (invoke-hook entry:compiler-shortcircuit-apply-size-2))
+ ((3) (invoke-hook entry:compiler-shortcircuit-apply-size-3))
+ ((4) (invoke-hook entry:compiler-shortcircuit-apply-size-4))
+ ((5) (invoke-hook entry:compiler-shortcircuit-apply-size-5))
+ ((6) (invoke-hook entry:compiler-shortcircuit-apply-size-6))
+ ((7) (invoke-hook entry:compiler-shortcircuit-apply-size-7))
+ ((8) (invoke-hook entry:compiler-shortcircuit-apply-size-8))
(else
(LAP (MOV W (R ,ecx) (& ,frame-size))
- (JMP F ,entry:compiler-shortcircuit-apply))))
+ ,@(invoke-hook entry:compiler-shortcircuit-apply))))
|#
(MOV W (R ,ecx) (& ,frame-size))
,@(invoke-interface code:compiler-apply)))
(define-rule statement
(INVOCATION:PRIMITIVE (? frame-size) (? continuation) (? primitive))
continuation ; ignored
- (define-integrable (invoke-entry entry)
- (LAP (JMP F ,entry)))
(let-syntax ((invoke
(macro (code entry)
`(invoke-interface ,code))))
(define (optimized-primitive-invocation entry)
(LAP ,@(clear-map!)
- (JMP F ,entry)))
+ ,@(invoke-hook entry)))
;;; Invocation Prefixes
(define-integrable (simple-procedure-header code-word label entry)
(let ((gc-label (generate-label)))
(LAP (LABEL ,gc-label)
- (CALL F ,entry)
+ ,@(invoke-hook/call entry)
,@(make-external-label code-word label)
(CMP W (R ,regnum:free-pointer) ,reg:compiled-memtop)
(JGE (@PCR ,gc-label)))))
,@(if (zero? entry)
(LAP)
(LAP (ADD W (@R ,esp) (& ,(* 10 entry)))))
- (JMP F ,entry:compiler-interrupt-closure)
+ ,@(invoke-hook entry:compiler-interrupt-closure)
,@(make-external-label internal-entry-code-word
external-label)
(ADD W (@R ,esp)
(LEA (R ,ebx) (@RO W ,eax (- ,free-ref-label ,pc-label)))
(MOV W ,reg:utility-arg-4 (& ,n-sections))
#|
- (CALL F ,entry:compiler-link)
+ ,@(invoke-hook/call entry:compiler-link)
|#
,@(invoke-interface/call code:compiler-link)
,@(make-external-label (continuation-code-word false)
(MOV W (@RO W ,edx ,environment-offset) (R ,ecx))
(MOV W ,reg:utility-arg-4 (& ,n-sections))
#|
- (CALL F ,entry:compiler-link)
+ ,@(invoke-hook/call entry:compiler-link)
|#
,@(invoke-interface/call code:compiler-link)
,@(make-external-label (continuation-code-word false)
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/i386/rules4.scm,v 1.3 1992/02/15 14:17:10 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/i386/rules4.scm,v 1.4 1992/02/16 02:06:50 jinx Exp $
$mc68020-Header: rules4.scm,v 4.12 90/05/03 15:17:38 GMT jinx Exp $
Copyright (c) 1992 Massachusetts Institute of Technology
(LAP ,@set-extension
,@(clear-map!)
#|
- (CALL F ,(if safe?
- entry:compiler-safe-reference-trap
- entry:compiler-reference-trap))
+ ,@(invoke-hook/call (if safe?
+ entry:compiler-safe-reference-trap
+ entry:compiler-reference-trap))
|#
,@(invoke-interface/call
(if safe?
,@set-value
,@(clear-map!)
#|
- (CALL F ,entry:compiler-assignment-trap)
+ ,@(invoke-hook/call entry:compiler-assignment-trap)
|#
,@(invoke-interface/call code:compiler-assignment-trap))))
### -*-Midas-*-
###
-### $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/cmpauxmd/i386.m4,v 1.8 1992/02/16 00:12:38 jinx Exp $
+### $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/cmpauxmd/i386.m4,v 1.9 1992/02/16 02:07:10 jinx Exp $
###
### Copyright (c) 1992 Massachusetts Institute of Technology
###
movl REGBLOCK_VAL()(regs),%eax # Value/dynamic link
movl IMMEDIATE(ADDRESS_MASK),rmask # = %ebp
movl external_reference(Ext_Stack_Pointer),%esp
- movl %edx,(rfree) # Far pointer offset
- xorl %ecx,%ecx # Far pointer segment
- movw %ds,%ecx
- movl %ecx,4(rfree)
movl %eax,%ecx # Preserve if used
andl rmask,%ecx # Restore potential
movl %ecx,REGBLOCK_DLINK()(regs) # dynamic link
-# Apparently gas does not understand the following instruction
-# even though gdb disassembles the word into that format.
-# ljmp *(rfree)
-# .word 0x2fff
- ljmp 0(rfree)
+ jmp *%edx
define_c_label(interface_to_C)
movl %edx,%eax # Set up result
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/cmpintmd/i386.h,v 1.9 1992/02/16 00:10:40 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/cmpintmd/i386.h,v 1.10 1992/02/16 02:07:02 jinx Exp $
Copyright (c) 1992 Massachusetts Institute of Technology
*
* See cmpint.txt for a description of these fields.
*
- * Specialized for the Intel 386 (and successor) architecture.
+ * Specialized for the Intel 386 (and successors) architecture.
*/
#ifndef CMPINT2_H_INCLUDED
- Trampoline encoding:
entry 0 MOV AL,code 0xB0, code-byte
- 2 LCALL n(ESI) 0xFF 0x9e n-longword
+ 2 CALL n(ESI) 0xFF 0x96 n-longword
8 <trampoline dependent storage>
- GC & interrupt check at procedure/continuation entry:
-gc_lab -7 LCALL n(ESI) 0xFF 0x5e n-byte
+gc_lab -7 CALL n(ESI) 0xFF 0x56 n-byte
-4 <type/arity info>
-2 <gc offset>
entry 0 CMP EDI,(ESI) 0x39 0x3e
- GC & interrupt check at closure entry:
gc_lab -11 ADD (ESP),&offset 0x83 0x04 0x24 offset-byte
- -7 LJMP n(ESI) 0xFF 0x6e n-byte
+ -7 JMP n(ESI) 0xFF 0x66 n-byte
-4 <type/arity info>
-2 <gc offset>
entry 0 ADD (ESP),&magic 0x81 0x04 0x24 magic-longword
\
*PC++ = 0xb0; /* MOV AL,byte */ \
*PC++ = (index); /* byte value */ \
- *PC++ = 0xff; /* LCALL */ \
- *PC++ = 0x9e; /* /3 disp32(ESI) */ \
+ *PC++ = 0xff; /* CALL */ \
+ *PC++ = 0x96; /* /2 disp32(ESI) */ \
(* ((unsigned long *) PC)) = ESI_TRAMPOLINE_TO_INTERFACE_OFFSET; \
} while (0)
#define COMPILER_REGBLOCK_N_FIXED 16
#define COMPILER_REGBLOCK_N_HOOKS 80
- /* A hook is a 48-bit address (segment + offset) for a far-indirect
- CALL/JMP instruction. Pad to 64 bits.
- */
-#define COMPILER_HOOK_SIZE 2
+
+ /* A hook is the address (offset) of an assembly-language routine. */
+
+#define COMPILER_HOOK_SIZE 1
#define COMPILER_REGBLOCK_EXTRA_SIZE \
(COMPILER_REGBLOCK_N_HOOKS * COMPILER_HOOK_SIZE)
#define SETUP_REGISTER(hook) do \
{ \
extern void hook (); \
- unsigned long * far_pointer = \
- ((unsigned long *) (esi_value + offset)); \
\
- *far_pointer++ = ((unsigned long) hook); \
- *far_pointer = ((unsigned long) code_segment); \
+ (* ((unsigned long *) (esi_value + offset))) = \
+ ((unsigned long) hook); \
offset += (COMPILER_HOOK_SIZE * (sizeof (SCHEME_OBJECT))); \
} while (0)