github.com/cloudwego/dynamicgo@v0.2.6-0.20240519101509-707f41b6b834/internal/native/native_amd64.tmpl (about)

     1  /*
     2   * Copyright 2023 CloudWeGo Authors.
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *
     8   *     http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    16  
    17  package {{PACKAGE}}
    18  import (
    19  	"unsafe"
    20  
    21  	"github.com/cloudwego/dynamicgo/internal/caching"
    22  	"github.com/cloudwego/dynamicgo/internal/rt"
    23  	"github.com/cloudwego/dynamicgo/internal/native/types"
    24  )
    25  
    26  var (
    27  	__i64toa func(out unsafe.Pointer, val int64) (ret int)
    28  
    29      __f64toa func(out unsafe.Pointer, val float64) (ret int)
    30  
    31  	__quote func(sp unsafe.Pointer, nb int, dp unsafe.Pointer, dn unsafe.Pointer, flags uint64) (ret int)
    32  
    33  	__tb_write_i64 func(buf unsafe.Pointer, v int64) (ret uint64)
    34  
    35  	__hm_get func(hm unsafe.Pointer, k unsafe.Pointer) (val unsafe.Pointer)
    36  
    37  	__trie_get func(hm unsafe.Pointer, k unsafe.Pointer) (val unsafe.Pointer)
    38  
    39  	__j2t_fsm_exec func(fsm unsafe.Pointer, buf unsafe.Pointer, src unsafe.Pointer, flag uint64) (ret uint64)
    40  
    41  	__tb_skip func(st unsafe.Pointer, s unsafe.Pointer, n int, t uint8) (ret int)
    42  )
    43  
    44  //go:nosplit
    45  func i64toa(out *byte, val int64) (ret int) {
    46      return __i64toa(rt.NoEscape(unsafe.Pointer(out)), val)
    47  }
    48  
    49  //go:nosplit
    50  func f64toa(out *byte, val float64) (ret int) {
    51      return __f64toa(rt.NoEscape(unsafe.Pointer(out)), val)
    52  }
    53  
    54  //go:nosplit
    55  func quote(sp unsafe.Pointer, nb int, dp unsafe.Pointer, dn *int, flags uint64) (ret int) {
    56      return __quote(rt.NoEscape(unsafe.Pointer(sp)), nb, rt.NoEscape(unsafe.Pointer(dp)), rt.NoEscape(unsafe.Pointer(dn)), flags)
    57  }
    58  
    59  //go:nosplit
    60  func tb_write_i64(buf *[]byte, v int64) (ret uint64) {
    61  	return __tb_write_i64(rt.NoEscape(unsafe.Pointer(buf)), v)
    62  }
    63  
    64  //go:nosplit
    65  func hm_get(hm *caching.HashMap, k *string) (val unsafe.Pointer) {
    66  	return __hm_get(rt.NoEscape(unsafe.Pointer(hm)), rt.NoEscape(unsafe.Pointer(k)))
    67  }
    68  
    69  //go:nosplit
    70  func trie_get(hm *caching.TrieTree, k *string) (val unsafe.Pointer){
    71  	return __trie_get(rt.NoEscape(unsafe.Pointer(hm)), rt.NoEscape(unsafe.Pointer(k)))
    72  }
    73  
    74  //go:nosplit
    75  func j2t_fsm_exec(fsm *types.J2TStateMachine, buf *[]byte, src *string, flag uint64) (ret uint64) {
    76  	return __j2t_fsm_exec(rt.NoEscape(unsafe.Pointer(fsm)), rt.NoEscape(unsafe.Pointer(buf)), rt.NoEscape(unsafe.Pointer(src)), flag)
    77  }
    78  
    79  //go:nosplit
    80  func tb_skip(st *types.TStateMachine, s *byte, n int, t uint8) (ret int) {
    81  	return __tb_skip(rt.NoEscape(unsafe.Pointer(st)), rt.NoEscape(unsafe.Pointer(s)), n , t )
    82  }