Changeset 5572


Ignore:
Timestamp:
Dec 3, 2006, 1:28:35 AM (18 years ago)
Author:
Gary Byers
Message:

Do vector bounds checking by clearing the low byte of the header, shifting
it right, and comparing the index to that. (It's not reliable to shift
the index left.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lisp-kernel/x86-spentry64.s

    r5566 r5572  
    172172        __(je,pt 1f)
    173173        __(uuo_error_reg_not_fixnum(Rarg_z))
    174 1:      __(movq %arg_z,%imm0)
    175         __(shlq $num_subtag_bits-fixnumshift,%imm0)
    176         __(movb $-1,%imm0_b)
    177         __(cmpq misc_header_offset(%arg_y),%imm0)
    178         __(jb 2f)
     1741:      __(movq misc_header_offset(%arg_y),%imm0)
     175        __(xorb %imm0_b,%imm0_b)
     176        __(shrq $num_subtag_bits-fixnumshift,%imm0)
     177        __(cmpq %imm0,%arg_z)
     178        __(jb,pt 2f)
    179179        __(uuo_error_vector_bounds(Rarg_z,Rarg_y))
    1801802:      __(movb misc_subtag_offset(%arg_y),%imm1_b)
     
    578578        __(je,pt 1f)
    579579        __(uuo_error_reg_not_fixnum(Rarg_z))
    580 1:      __(movq %arg_z,%imm0)
    581         __(shlq $num_subtag_bits-fixnumshift,%imm0)
    582         __(movb $255,%imm0_b)
    583         __(cmpq misc_header_offset(%arg_y),%imm0)
     5801:      __(movq misc_header_offset(%arg_y),%imm0)
     581        __(xorb %imm0_b,%imm0_b)
     582        __(shrq $num_subtag_bits-fixnumshift,%imm0)
     583        __(cmpq %imm0,%arg_z)
    584584        __(jb 2f)
    585585        __(uuo_error_vector_bounds(Rarg_z,Rarg_y))
     
    597597        __(je,pt 1f)
    598598        __(uuo_error_reg_not_fixnum(Rarg_y))
    599 1:      __(movq %arg_y,%imm0)
    600         __(shlq $num_subtag_bits-fixnumshift,%imm0)
    601         __(movb $255,%imm0_b)
    602         __(cmpq misc_header_offset(%arg_x),%imm0)
     5991:      __(movq misc_header_offset(%arg_x),%imm0)
     600        __(xorb %imm0_b,%imm0_b)
     601        __(shrq $num_subtag_bits-fixnumshift,%imm0)
     602        __(cmpq %imm0,%arg_y)
    603603        __(jb 2f)
    604604        __(uuo_error_vector_bounds(Rarg_y,Rarg_x))
     
    616616        __(je,pt 1f)
    617617        __(uuo_error_reg_not_fixnum(Rarg_y))
    618 1:      __(movq %arg_y,%imm0)
    619         __(shlq $num_subtag_bits-fixnumshift,%imm0)
    620         __(movb $255,%imm0_b)
    621         __(cmpq misc_header_offset(%arg_x),%imm0)
     6181:      __(movq misc_header_offset(%arg_x),%imm0)
     619        __(xorb %imm0_b,%imm0_b)
     620        __(shrq $num_subtag_bits-fixnumshift,%imm0)
     621        __(cmpq %imm0,%arg_y)
    622622        __(jb 2f)
    623623        __(uuo_error_vector_bounds(Rarg_y,Rarg_x))
Note: See TracChangeset for help on using the changeset viewer.