@@ -377,13 +377,14 @@ macro _nospecializeinfer_meta()
377377    return  Expr (:meta , :nospecializeinfer )
378378end 
379379
380- function  _checkbounds_array (:: Type{Bool} , A:: Union{Array, GenericMemory} , i:: Int )
380+ #  These special checkbounds methods are defined early for bootstrapping
381+ function  checkbounds (:: Type{Bool} , A:: Union{Array, Memory} , i:: Int )
381382    @inline 
382383    ult_int (bitcast (UInt, sub_int (i, 1 )), bitcast (UInt, length (A)))
383384end 
384- function  _checkbounds_array (A:: Union{Array, GenericMemory} , i:: Int )
385+ function  checkbounds (A:: Union{Array, GenericMemory} , i:: Int )
385386    @inline 
386-     _checkbounds_array (Bool, A, i) ||  throw_boundserror (A, (i,))
387+     checkbounds (Bool, A, i) ||  throw_boundserror (A, (i,))
387388end 
388389
389390default_access_order (a:: GenericMemory{:not_atomic} ) =  :not_atomic 
@@ -393,7 +394,7 @@ default_access_order(a::GenericMemoryRef{:atomic}) = :monotonic
393394
394395function  getindex (A:: GenericMemory , i:: Int )
395396    @_noub_if_noinbounds_meta 
396-     (@_boundscheck ) &&  _checkbounds_array (A, i)
397+     (@_boundscheck ) &&  checkbounds (A, i)
397398    memoryrefget (memoryrefnew (memoryrefnew (A), i, false ), default_access_order (A), false )
398399end 
399400
@@ -962,13 +963,13 @@ end
962963#  linear indexing
963964function  getindex (A:: Array , i:: Int )
964965    @_noub_if_noinbounds_meta 
965-     @boundscheck  _checkbounds_array (A, i)
966+     @boundscheck  checkbounds (A, i)
966967    memoryrefget (memoryrefnew (getfield (A, :ref ), i, false ), :not_atomic , false )
967968end 
968969#  simple Array{Any} operations needed for bootstrap
969970function  setindex! (A:: Array{Any} , @nospecialize (x), i:: Int )
970971    @_noub_if_noinbounds_meta 
971-     @boundscheck  _checkbounds_array (A, i)
972+     @boundscheck  checkbounds (A, i)
972973    memoryrefset! (memoryrefnew (getfield (A, :ref ), i, false ), x, :not_atomic , false )
973974    return  A
974975end 
0 commit comments