1.0.25.21: handling of potential corruptions
[sbcl.git] / src / runtime / alpha-assem.S
index c23e546..dd4e218 100644 (file)
 #endif
 #include "sbcl.h"
 #include "lispregs.h"
+#include "genesis/fdefn.h"
+#include "genesis/closure.h"
+#include "genesis/funcallable-instance.h"
+#include "genesis/simple-fun.h"
+#include "genesis/static-symbols.h"
+
 /* #include "globals.h" */
        
 /*
@@ -89,7 +95,7 @@ call_into_lisp:
 
        /* Indirect the closure */
        ldl     reg_CODE, CLOSURE_FUN_OFFSET(reg_LEXENV)
-       addl    reg_CODE,6*4-FUN_POINTER_LOWTAG, reg_LIP
+       addl    reg_CODE, SIMPLE_FUN_CODE_OFFSET, reg_LIP
 
        /* And into lisp we go. */
        jsr     reg_ZERO,(reg_LIP)
@@ -252,9 +258,7 @@ start_of_tramps:
  */
         .text
        .globl  start_of_tramps
-       .globl  closure_tramp
        .globl  undefined_tramp
-       .globl  closure_tramp_offset
        .globl  undefined_tramp_offset
         .ent    undefined_tramp_offset
 undefined_tramp_offset:
@@ -279,9 +283,10 @@ undefined_tramp= call_into_lisp_LRA_page+0x140
 /* The closure trampoline. */
         .text
         .globl  closure_tramp
+        .globl  closure_tramp_offset
         .ent    closure_tramp_offset
-closure_tramp= call_into_lisp_LRA_page+0x150
 closure_tramp_offset:
+closure_tramp= call_into_lisp_LRA_page+0x150
         ldl     reg_LEXENV, FDEFN_FUN_OFFSET(reg_FDEFN)
         ldl     reg_L0, CLOSURE_FUN_OFFSET(reg_LEXENV)
         addl    reg_L0, SIMPLE_FUN_CODE_OFFSET, reg_LIP
@@ -292,6 +297,24 @@ closure_tramp_offset:
        .globl  end_of_tramps
 end_of_tramps:
 
+       .text
+       .globl funcallable_instance_tramp
+       .align 2
+       .long SIMPLE_FUN_HEADER_WIDETAG
+funcallable_instance_tramp = . + 1
+       .long funcallable_instance_tramp
+       .long NIL
+       .long NIL
+       .long NIL
+       .long NIL
+       .long NIL
+
+       ldl reg_LEXENV, FUNCALLABLE_INSTANCE_FUNCTION_OFFSET(reg_LEXENV)
+       /* I think we don't actually need to use reg_CODE here, because
+          $CODE is computed from $LIP in the function itself */
+       ldl reg_CODE, CLOSURE_FUN_OFFSET(reg_LEXENV) 
+       addl reg_CODE, SIMPLE_FUN_CODE_OFFSET, reg_LIP
+       jmp reg_ZERO, (reg_LIP)
 
 /*
  * fun-end breakpoint magic.