Text file src/runtime/memclr_wasm.s

     1  // Copyright 2018 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  #include "textflag.h"
     6  
     7  // See memclrNoHeapPointers Go doc for important implementation constraints.
     8  
     9  // func memclrNoHeapPointers(ptr unsafe.Pointer, n uintptr)
    10  TEXT runtime¬∑memclrNoHeapPointers(SB), NOSPLIT, $0-16
    11  	MOVD ptr+0(FP), R0
    12  	MOVD n+8(FP), R1
    13  
    14  loop:
    15  	Loop
    16  		Get R1
    17  		I64Eqz
    18  		If
    19  			RET
    20  		End
    21  
    22  		Get R0
    23  		I32WrapI64
    24  		I64Const $0
    25  		I64Store8 $0
    26  
    27  		Get R0
    28  		I64Const $1
    29  		I64Add
    30  		Set R0
    31  
    32  		Get R1
    33  		I64Const $1
    34  		I64Sub
    35  		Set R1
    36  
    37  		Br loop
    38  	End
    39  	UNDEF
    40  

View as plain text