mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-11-04 01:42:26 -06:00 
			
		
		
		
	[chore]: Bump github.com/gin-contrib/gzip from 1.0.1 to 1.1.0 (#3639)
Bumps [github.com/gin-contrib/gzip](https://github.com/gin-contrib/gzip) from 1.0.1 to 1.1.0. - [Release notes](https://github.com/gin-contrib/gzip/releases) - [Changelog](https://github.com/gin-contrib/gzip/blob/master/.goreleaser.yaml) - [Commits](https://github.com/gin-contrib/gzip/compare/v1.0.1...v1.1.0) --- updated-dependencies: - dependency-name: github.com/gin-contrib/gzip dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
		
					parent
					
						
							
								8cfae010a9
							
						
					
				
			
			
				commit
				
					
						4d423102c1
					
				
			
		
					 519 changed files with 156968 additions and 132058 deletions
				
			
		
							
								
								
									
										53
									
								
								vendor/github.com/bytedance/sonic/internal/encoder/x86/asm_stubs_amd64_go117.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								vendor/github.com/bytedance/sonic/internal/encoder/x86/asm_stubs_amd64_go117.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,53 @@
 | 
			
		|||
//go:build go1.17 && !go1.21
 | 
			
		||||
// +build go1.17,!go1.21
 | 
			
		||||
 | 
			
		||||
// Copyright 2023 CloudWeGo Authors
 | 
			
		||||
//
 | 
			
		||||
// Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
// you may not use this file except in compliance with the License.
 | 
			
		||||
// You may obtain a copy of the License at
 | 
			
		||||
//
 | 
			
		||||
//     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
//
 | 
			
		||||
// Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
// distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
// See the License for the specific language governing permissions and
 | 
			
		||||
// limitations under the License.
 | 
			
		||||
 | 
			
		||||
package x86
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"unsafe"
 | 
			
		||||
 | 
			
		||||
	"github.com/bytedance/sonic/internal/jit"
 | 
			
		||||
	"github.com/bytedance/sonic/internal/rt"
 | 
			
		||||
	"github.com/twitchyliquid64/golang-asm/obj"
 | 
			
		||||
	"github.com/twitchyliquid64/golang-asm/obj/x86"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
    _V_writeBarrier = jit.Imm(int64(uintptr(unsafe.Pointer(&rt.RuntimeWriteBarrier))))
 | 
			
		||||
 | 
			
		||||
    _F_gcWriteBarrierAX = jit.Func(rt.GcWriteBarrierAX)
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func (self *Assembler) WritePtr(i int, ptr obj.Addr, rec obj.Addr) {
 | 
			
		||||
    if rec.Reg == x86.REG_AX || rec.Index == x86.REG_AX {
 | 
			
		||||
        panic("rec contains AX!")
 | 
			
		||||
    }
 | 
			
		||||
    self.Emit("MOVQ", _V_writeBarrier, _BX)
 | 
			
		||||
    self.Emit("CMPL", jit.Ptr(_BX, 0), jit.Imm(0))
 | 
			
		||||
    self.Sjmp("JE", "_no_writeBarrier" + strconv.Itoa(i) + "_{n}")
 | 
			
		||||
    self.xsave(_DI)
 | 
			
		||||
    self.Emit("MOVQ", ptr, _AX)
 | 
			
		||||
    self.Emit("LEAQ", rec, _DI)
 | 
			
		||||
    self.Emit("MOVQ", _F_gcWriteBarrierAX, _BX)  // MOVQ ${fn}, AX
 | 
			
		||||
    self.Rjmp("CALL", _BX)  
 | 
			
		||||
    self.xload(_DI)  
 | 
			
		||||
    self.Sjmp("JMP", "_end_writeBarrier" + strconv.Itoa(i) + "_{n}")
 | 
			
		||||
    self.Link("_no_writeBarrier" + strconv.Itoa(i) + "_{n}")
 | 
			
		||||
    self.Emit("MOVQ", ptr, rec)
 | 
			
		||||
    self.Link("_end_writeBarrier" + strconv.Itoa(i) + "_{n}")
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										52
									
								
								vendor/github.com/bytedance/sonic/internal/encoder/x86/asm_stubs_amd64_go121.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								vendor/github.com/bytedance/sonic/internal/encoder/x86/asm_stubs_amd64_go121.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,52 @@
 | 
			
		|||
//go:build go1.21 && !go1.24
 | 
			
		||||
// +build go1.21,!go1.24
 | 
			
		||||
 | 
			
		||||
// Copyright 2023 CloudWeGo Authors
 | 
			
		||||
//
 | 
			
		||||
// Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
// you may not use this file except in compliance with the License.
 | 
			
		||||
// You may obtain a copy of the License at
 | 
			
		||||
//
 | 
			
		||||
//     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
//
 | 
			
		||||
// Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
// distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
// See the License for the specific language governing permissions and
 | 
			
		||||
// limitations under the License.
 | 
			
		||||
 | 
			
		||||
package x86
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"unsafe"
 | 
			
		||||
 | 
			
		||||
	"github.com/bytedance/sonic/internal/jit"
 | 
			
		||||
	"github.com/bytedance/sonic/internal/rt"
 | 
			
		||||
	"github.com/twitchyliquid64/golang-asm/obj"
 | 
			
		||||
	"github.com/twitchyliquid64/golang-asm/obj/x86"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
    _V_writeBarrier = jit.Imm(int64(uintptr(unsafe.Pointer(&rt.RuntimeWriteBarrier))))
 | 
			
		||||
 | 
			
		||||
    _F_gcWriteBarrier2 = jit.Func(rt.GcWriteBarrier2)
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func (self *Assembler) WritePtr(i int, ptr obj.Addr, old obj.Addr) {
 | 
			
		||||
    if old.Reg == x86.REG_AX || old.Index == x86.REG_AX {
 | 
			
		||||
        panic("rec contains AX!")
 | 
			
		||||
    }
 | 
			
		||||
    self.Emit("MOVQ", _V_writeBarrier, _BX)
 | 
			
		||||
    self.Emit("CMPL", jit.Ptr(_BX, 0), jit.Imm(0))
 | 
			
		||||
    self.Sjmp("JE", "_no_writeBarrier" + strconv.Itoa(i) + "_{n}")
 | 
			
		||||
    self.xsave(_SP_q)
 | 
			
		||||
    self.Emit("MOVQ", _F_gcWriteBarrier2, _BX)  // MOVQ ${fn}, AX
 | 
			
		||||
    self.Rjmp("CALL", _BX)  
 | 
			
		||||
    self.Emit("MOVQ", ptr, jit.Ptr(_SP_q, 0))
 | 
			
		||||
    self.Emit("MOVQ", old, _AX)
 | 
			
		||||
    self.Emit("MOVQ", _AX, jit.Ptr(_SP_q, 8))
 | 
			
		||||
    self.xload(_SP_q)  
 | 
			
		||||
    self.Link("_no_writeBarrier" + strconv.Itoa(i) + "_{n}")
 | 
			
		||||
    self.Emit("MOVQ", ptr, old)
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										1195
									
								
								vendor/github.com/bytedance/sonic/internal/encoder/x86/assembler_regabi_amd64.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1195
									
								
								vendor/github.com/bytedance/sonic/internal/encoder/x86/assembler_regabi_amd64.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
							
								
								
									
										66
									
								
								vendor/github.com/bytedance/sonic/internal/encoder/x86/debug_go116.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										66
									
								
								vendor/github.com/bytedance/sonic/internal/encoder/x86/debug_go116.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,66 @@
 | 
			
		|||
// +build go1.17,!go1.17
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2021 ByteDance Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package x86
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
    `os`
 | 
			
		||||
    `strings`
 | 
			
		||||
    `runtime`
 | 
			
		||||
    `runtime/debug`
 | 
			
		||||
 | 
			
		||||
    `github.com/bytedance/sonic/internal/jit`
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
    debugSyncGC  = os.Getenv("SONIC_SYNC_GC") != ""
 | 
			
		||||
    debugAsyncGC = os.Getenv("SONIC_NO_ASYNC_GC") == ""
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
    _Instr_End _Instr = newInsOp(_OP_null)
 | 
			
		||||
 | 
			
		||||
    _F_gc       = jit.Func(runtime.GC)
 | 
			
		||||
    _F_force_gc = jit.Func(debug.FreeOSMemory)
 | 
			
		||||
    _F_println  = jit.Func(println_wrapper)
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func println_wrapper(i int, op1 int, op2 int){
 | 
			
		||||
    println(i, " Intrs ", op1, _OpNames[op1], "next: ", op2, _OpNames[op2])
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (self *_Assembler) force_gc() {
 | 
			
		||||
    self.call_go(_F_gc)
 | 
			
		||||
    self.call_go(_F_force_gc)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (self *_Assembler) debug_instr(i int, v *_Instr) {
 | 
			
		||||
    if debugSyncGC {
 | 
			
		||||
        if (i+1 == len(self.p)) {
 | 
			
		||||
            self.print_gc(i, v, &_Instr_End) 
 | 
			
		||||
        } else {
 | 
			
		||||
            next := &(self.p[i+1])
 | 
			
		||||
            self.print_gc(i, v, next)
 | 
			
		||||
            name := _OpNames[next.op()]
 | 
			
		||||
            if strings.Contains(name, "save") {
 | 
			
		||||
                return
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        self.force_gc()
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										201
									
								
								vendor/github.com/bytedance/sonic/internal/encoder/x86/debug_go117.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										201
									
								
								vendor/github.com/bytedance/sonic/internal/encoder/x86/debug_go117.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,201 @@
 | 
			
		|||
//go:build go1.17 && !go1.24
 | 
			
		||||
// +build go1.17,!go1.24
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2021 ByteDance Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package x86
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"runtime"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"unsafe"
 | 
			
		||||
 | 
			
		||||
	"github.com/bytedance/sonic/internal/encoder/ir"
 | 
			
		||||
	"github.com/bytedance/sonic/internal/encoder/vars"
 | 
			
		||||
	"github.com/bytedance/sonic/internal/jit"
 | 
			
		||||
	"github.com/twitchyliquid64/golang-asm/obj"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
const _FP_debug = 128
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
	_Instr_End = ir.NewInsOp(ir.OP_is_nil)
 | 
			
		||||
 | 
			
		||||
	_F_gc      = jit.Func(gc)
 | 
			
		||||
	_F_println = jit.Func(println_wrapper)
 | 
			
		||||
	_F_print   = jit.Func(print)
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func (self *Assembler) dsave(r ...obj.Addr) {
 | 
			
		||||
	for i, v := range r {
 | 
			
		||||
		if i > _FP_debug/8-1 {
 | 
			
		||||
			panic("too many registers to save")
 | 
			
		||||
		} else {
 | 
			
		||||
			self.Emit("MOVQ", v, jit.Ptr(_SP, _FP_fargs+_FP_saves+_FP_locals+int64(i)*8))
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (self *Assembler) dload(r ...obj.Addr) {
 | 
			
		||||
	for i, v := range r {
 | 
			
		||||
		if i > _FP_debug/8-1 {
 | 
			
		||||
			panic("too many registers to load")
 | 
			
		||||
		} else {
 | 
			
		||||
			self.Emit("MOVQ", jit.Ptr(_SP, _FP_fargs+_FP_saves+_FP_locals+int64(i)*8), v)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func println_wrapper(i int, op1 int, op2 int) {
 | 
			
		||||
	println(i, " Intrs ", op1, ir.OpNames[op1], "next: ", op2, ir.OpNames[op2])
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func print(i int) {
 | 
			
		||||
	println(i)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func gc() {
 | 
			
		||||
	if !vars.DebugSyncGC {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	runtime.GC()
 | 
			
		||||
	// debug.FreeOSMemory()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (self *Assembler) dcall(fn obj.Addr) {
 | 
			
		||||
	self.Emit("MOVQ", fn, _R10) // MOVQ ${fn}, R10
 | 
			
		||||
	self.Rjmp("CALL", _R10)     // CALL R10
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (self *Assembler) debug_gc() {
 | 
			
		||||
	if !vars.DebugSyncGC {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	self.dsave(_REG_debug...)
 | 
			
		||||
	self.dcall(_F_gc)
 | 
			
		||||
	self.dload(_REG_debug...)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (self *Assembler) debug_instr(i int, v *ir.Instr) {
 | 
			
		||||
	if vars.DebugSyncGC {
 | 
			
		||||
		if i+1 == len(self.p) {
 | 
			
		||||
			self.print_gc(i, v, &_Instr_End)
 | 
			
		||||
		} else {
 | 
			
		||||
			next := &(self.p[i+1])
 | 
			
		||||
			self.print_gc(i, v, next)
 | 
			
		||||
			name := ir.OpNames[next.Op()]
 | 
			
		||||
			if strings.Contains(name, "save") {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		// self.debug_gc()
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//go:noescape
 | 
			
		||||
//go:linkname checkptrBase runtime.checkptrBase
 | 
			
		||||
func checkptrBase(p unsafe.Pointer) uintptr
 | 
			
		||||
 | 
			
		||||
//go:noescape
 | 
			
		||||
//go:linkname findObject runtime.findObject
 | 
			
		||||
func findObject(p, refBase, refOff uintptr) (base uintptr, s unsafe.Pointer, objIndex uintptr)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
	_F_checkptr = jit.Func(checkptr)
 | 
			
		||||
	_F_printptr = jit.Func(printptr)
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
	_R10 = jit.Reg("R10")
 | 
			
		||||
)
 | 
			
		||||
var _REG_debug = []obj.Addr{
 | 
			
		||||
	jit.Reg("AX"),
 | 
			
		||||
	jit.Reg("BX"),
 | 
			
		||||
	jit.Reg("CX"),
 | 
			
		||||
	jit.Reg("DX"),
 | 
			
		||||
	jit.Reg("DI"),
 | 
			
		||||
	jit.Reg("SI"),
 | 
			
		||||
	jit.Reg("BP"),
 | 
			
		||||
	jit.Reg("SP"),
 | 
			
		||||
	jit.Reg("R8"),
 | 
			
		||||
	jit.Reg("R9"),
 | 
			
		||||
	jit.Reg("R10"),
 | 
			
		||||
	jit.Reg("R11"),
 | 
			
		||||
	jit.Reg("R12"),
 | 
			
		||||
	jit.Reg("R13"),
 | 
			
		||||
	jit.Reg("R14"),
 | 
			
		||||
	jit.Reg("R15"),
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func checkptr(ptr uintptr) {
 | 
			
		||||
	if ptr == 0 {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	fmt.Printf("pointer: %x\n", ptr)
 | 
			
		||||
	f := checkptrBase(unsafe.Pointer(uintptr(ptr)))
 | 
			
		||||
	if f == 0 {
 | 
			
		||||
		fmt.Printf("! unknown-based pointer: %x\n", ptr)
 | 
			
		||||
	} else if f == 1 {
 | 
			
		||||
		fmt.Printf("! stack pointer: %x\n", ptr)
 | 
			
		||||
	} else {
 | 
			
		||||
		fmt.Printf("base: %x\n", f)
 | 
			
		||||
	}
 | 
			
		||||
	findobj(ptr)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func findobj(ptr uintptr) {
 | 
			
		||||
	base, s, objIndex := findObject(ptr, 0, 0)
 | 
			
		||||
	if s != nil && base == 0 {
 | 
			
		||||
		fmt.Printf("! invalid pointer: %x\n", ptr)
 | 
			
		||||
	}
 | 
			
		||||
	fmt.Printf("objIndex: %d\n", objIndex)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (self *Assembler) check_ptr(ptr obj.Addr, lea bool) {
 | 
			
		||||
	if !vars.DebugCheckPtr {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	self.dsave(_REG_debug...)
 | 
			
		||||
	if lea {
 | 
			
		||||
		self.Emit("LEAQ", ptr, _R10)
 | 
			
		||||
	} else {
 | 
			
		||||
		self.Emit("MOVQ", ptr, _R10)
 | 
			
		||||
	}
 | 
			
		||||
	self.Emit("MOVQ", _R10, jit.Ptr(_SP, 0))
 | 
			
		||||
	self.dcall(_F_checkptr)
 | 
			
		||||
	self.dload(_REG_debug...)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func printptr(i int, ptr uintptr) {
 | 
			
		||||
	fmt.Printf("[%d] ptr: %x\n", i, ptr)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (self *Assembler) print_ptr(i int, ptr obj.Addr, lea bool) {
 | 
			
		||||
	self.dsave(_REG_debug...)
 | 
			
		||||
	if lea {
 | 
			
		||||
		self.Emit("LEAQ", ptr, _R10)
 | 
			
		||||
	} else {
 | 
			
		||||
		self.Emit("MOVQ", ptr, _R10)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	self.Emit("MOVQ", jit.Imm(int64(i)), _AX)
 | 
			
		||||
	self.Emit("MOVQ", _R10, _BX)
 | 
			
		||||
	self.dcall(_F_printptr)
 | 
			
		||||
	self.dload(_REG_debug...)
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										54
									
								
								vendor/github.com/bytedance/sonic/internal/encoder/x86/stbus.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								vendor/github.com/bytedance/sonic/internal/encoder/x86/stbus.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,54 @@
 | 
			
		|||
/**
 | 
			
		||||
 * Copyright 2024 ByteDance Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package x86
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"unsafe"
 | 
			
		||||
	_ "unsafe"
 | 
			
		||||
 | 
			
		||||
	"github.com/bytedance/sonic/internal/encoder/alg"
 | 
			
		||||
	"github.com/bytedance/sonic/internal/encoder/vars"
 | 
			
		||||
	"github.com/bytedance/sonic/internal/rt"
 | 
			
		||||
	"github.com/bytedance/sonic/loader"
 | 
			
		||||
	_ "github.com/cloudwego/base64x"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
//go:linkname _subr__b64encode github.com/cloudwego/base64x._subr__b64encode
 | 
			
		||||
var _subr__b64encode uintptr
 | 
			
		||||
 | 
			
		||||
var compiler func(*rt.GoType, ... interface{}) (interface{}, error)
 | 
			
		||||
 | 
			
		||||
func SetCompiler(c func(*rt.GoType, ... interface{}) (interface{}, error)) {
 | 
			
		||||
	compiler = c
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func ptoenc(p loader.Function) vars.Encoder {
 | 
			
		||||
    return *(*vars.Encoder)(unsafe.Pointer(&p))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func EncodeTypedPointer(buf *[]byte, vt *rt.GoType, vp *unsafe.Pointer, sb *vars.Stack, fv uint64) error {
 | 
			
		||||
	if vt == nil {
 | 
			
		||||
		return alg.EncodeNil(buf)
 | 
			
		||||
	} else if fn, err := vars.FindOrCompile(vt, (fv&(1<<alg.BitPointerValue)) != 0, compiler); err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	} else if vt.Indirect() {
 | 
			
		||||
		return	fn.(vars.Encoder)(buf, *vp, sb, fv)
 | 
			
		||||
	} else {
 | 
			
		||||
		return fn.(vars.Encoder)(buf, unsafe.Pointer(vp), sb, fv)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue