Changeset 11237


Ignore:
Timestamp:
Oct 27, 2008, 6:47:51 PM (11 years ago)
Author:
rme
Message:

%AREF3, SParef3: Don't use imm0 to hold one of the array indicies:
put it on the stack instead. (Have I mentioned that I could really
use more registers?)

Even though it would be an error, it's possible that the user might
pass a node as the value for i, and it's not safe to put nodes in
imm0. In this case, we would detect that the thing in imm0 isn't
a fixnum and signal an error, but if the GC ran during the time when
we were doing the checking, it'd probably move the object that imm0
pointed to, and wouldn't update imm0. When the error handling code
looked at the value that was in imm0, it would discover that it's
pointing to who-knows-what, leading to confusion and woe.

Location:
trunk/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/X86/X8632/x8632-float.lisp

    r10959 r11237  
    312312  (single-value-return))
    313313
     314;;; Return the x87 status word in effect after the last ff-call.
     315;;; It's kept in the high half of the ffi-exception slot in the
     316;;; TCR.
     317(defx8632lapfunction %get-post-ffi-x87-status ()
     318  (xor (% arg_z) (% arg_z))
     319  (movzwl (:rcontext (+ 2 x8632::tcr.ffi-exception)) (% imm0))
     320  (movl (% arg_z) (:rcontext x8632::tcr.ffi-exception))
     321  (box-fixnum imm0 arg_z)
     322  (single-value-return))
     323
    314324;;; The next several defuns are copied verbatim from x8664-float.lisp.
    315325;;; It will probably be desirable to factor this code out into a new
     
    325335  (logior (%get-mxcsr-control)
    326336          (logand x86::mxcsr-status-mask (the fixnum (%get-post-ffi-mxcsr)))))
     337
     338(defun %ffi-exception-status-x87 ()
     339  (logior (%get-mxcsr-control)
     340          (logand x86::mxcsr-status-mask (the fixnum (%get-post-ffi-x87-status)))))
    327341
    328342;;; See if the binary double-float operation OP set any enabled
  • trunk/source/lisp-kernel/x86-spentry32.s

    r11236 r11237  
    44564456_endsubp(aset2)
    44574457
    4458 /* temp1 = array, imm0 = i, temp0 = j, arg_y = k, arg_z = newval */
    4459 /* ARRAY-DIMENSION-LIMIT is required to be a fixnum, so using imm0 is OK. */
     4458/* temp1 = array, (%esp) = i, temp0 = j, arg_y = k, arg_z = newval */
    44604459_spentry(aset3)
    4461         __(testb $fixnummask,%imm0_b)
     4460        __(testb $fixnummask,(%esp))
    44624461        __(jne 0f)
    4463         __(push %imm0)
    44644462        __(testb $fixnummask,%temp0_b)
    44654463        __(jne 1f)
     
    44964494        __(ja C(misc_set_common))
    44974495        __(jmp 8b)
    4498 0:      __(uuo_error_reg_not_fixnum(Rimm0))
     44960:      __(pop %temp0)  /* supplied i */
     4497        __(uuo_error_reg_not_fixnum(Rtemp0))
    449944981:      __(uuo_error_reg_not_fixnum(Rtemp0))
    450044992:      __(uuo_error_reg_not_fixnum(Rarg_y))
    450145003:      __(uuo_error_reg_not_type(Rtemp1,error_object_not_array_3d))
    4502 4:      __(uuo_error_array_bounds(Rimm0,Rtemp1))
     45014:      __(pop %imm0)   /* supplied i is on stack */
     4502        __(uuo_error_array_bounds(Rimm0,Rtemp1))
    450345035:      __(uuo_error_array_bounds(Rtemp0,Rtemp1))
    450445046:      __(uuo_error_array_bounds(Rarg_y,Rtemp1))
Note: See TracChangeset for help on using the changeset viewer.