aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/go/_std_1.22/src/reflect
diff options
context:
space:
mode:
authormaxim-yurchuk <maxim-yurchuk@yandex-team.com>2024-10-09 12:29:46 +0300
committermaxim-yurchuk <maxim-yurchuk@yandex-team.com>2024-10-09 13:14:22 +0300
commit9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80 (patch)
treea8fb3181d5947c0d78cf402aa56e686130179049 /contrib/go/_std_1.22/src/reflect
parenta44b779cd359f06c3ebbef4ec98c6b38609d9d85 (diff)
downloadydb-9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80.tar.gz
publishFullContrib: true for ydb
<HIDDEN_URL> commit_hash:c82a80ac4594723cebf2c7387dec9c60217f603e
Diffstat (limited to 'contrib/go/_std_1.22/src/reflect')
-rw-r--r--contrib/go/_std_1.22/src/reflect/arena.go18
-rw-r--r--contrib/go/_std_1.22/src/reflect/asm_386.s38
-rw-r--r--contrib/go/_std_1.22/src/reflect/asm_arm.s42
-rw-r--r--contrib/go/_std_1.22/src/reflect/asm_loong64.s89
-rw-r--r--contrib/go/_std_1.22/src/reflect/asm_mips64x.s42
-rw-r--r--contrib/go/_std_1.22/src/reflect/asm_mipsx.s42
-rw-r--r--contrib/go/_std_1.22/src/reflect/asm_ppc64x.s83
-rw-r--r--contrib/go/_std_1.22/src/reflect/asm_riscv64.s76
-rw-r--r--contrib/go/_std_1.22/src/reflect/asm_s390x.s38
-rw-r--r--contrib/go/_std_1.22/src/reflect/asm_wasm.s52
-rw-r--r--contrib/go/_std_1.22/src/reflect/float32reg_ppc64x.s30
-rw-r--r--contrib/go/_std_1.22/src/reflect/float32reg_riscv64.s27
-rw-r--r--contrib/go/_std_1.22/src/reflect/internal/example1/example.go10
-rw-r--r--contrib/go/_std_1.22/src/reflect/internal/example1/ya.make9
-rw-r--r--contrib/go/_std_1.22/src/reflect/internal/example2/example.go10
-rw-r--r--contrib/go/_std_1.22/src/reflect/internal/example2/ya.make9
-rw-r--r--contrib/go/_std_1.22/src/reflect/internal/ya.make1
-rw-r--r--contrib/go/_std_1.22/src/reflect/stubs_ppc64x.go10
-rw-r--r--contrib/go/_std_1.22/src/reflect/stubs_riscv64.go8
19 files changed, 634 insertions, 0 deletions
diff --git a/contrib/go/_std_1.22/src/reflect/arena.go b/contrib/go/_std_1.22/src/reflect/arena.go
new file mode 100644
index 0000000000..cac1a1da5e
--- /dev/null
+++ b/contrib/go/_std_1.22/src/reflect/arena.go
@@ -0,0 +1,18 @@
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build goexperiment.arenas
+
+package reflect
+
+import "arena"
+
+// ArenaNew returns a Value representing a pointer to a new zero value for the
+// specified type, allocating storage for it in the provided arena. That is,
+// the returned Value's Type is PointerTo(typ).
+func ArenaNew(a *arena.Arena, typ Type) Value {
+ return ValueOf(arena_New(a, PointerTo(typ)))
+}
+
+func arena_New(a *arena.Arena, typ any) any
diff --git a/contrib/go/_std_1.22/src/reflect/asm_386.s b/contrib/go/_std_1.22/src/reflect/asm_386.s
new file mode 100644
index 0000000000..5bedea5807
--- /dev/null
+++ b/contrib/go/_std_1.22/src/reflect/asm_386.s
@@ -0,0 +1,38 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "textflag.h"
+#include "funcdata.h"
+
+// makeFuncStub is the code half of the function returned by MakeFunc.
+// See the comment on the declaration of makeFuncStub in makefunc.go
+// for more details.
+// No argsize here, gc generates argsize info at call site.
+TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$20
+ NO_LOCAL_POINTERS
+ MOVL DX, 0(SP)
+ LEAL argframe+0(FP), CX
+ MOVL CX, 4(SP)
+ MOVB $0, 16(SP)
+ LEAL 16(SP), AX
+ MOVL AX, 8(SP)
+ MOVL $0, 12(SP)
+ CALL ·callReflect(SB)
+ RET
+
+// methodValueCall is the code half of the function returned by makeMethodValue.
+// See the comment on the declaration of methodValueCall in makefunc.go
+// for more details.
+// No argsize here, gc generates argsize info at call site.
+TEXT ·methodValueCall(SB),(NOSPLIT|WRAPPER),$20
+ NO_LOCAL_POINTERS
+ MOVL DX, 0(SP)
+ LEAL argframe+0(FP), CX
+ MOVL CX, 4(SP)
+ MOVB $0, 16(SP)
+ LEAL 16(SP), AX
+ MOVL AX, 8(SP)
+ MOVL $0, 12(SP)
+ CALL ·callMethod(SB)
+ RET
diff --git a/contrib/go/_std_1.22/src/reflect/asm_arm.s b/contrib/go/_std_1.22/src/reflect/asm_arm.s
new file mode 100644
index 0000000000..057c941f59
--- /dev/null
+++ b/contrib/go/_std_1.22/src/reflect/asm_arm.s
@@ -0,0 +1,42 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "textflag.h"
+#include "funcdata.h"
+
+// makeFuncStub is jumped to by the code generated by MakeFunc.
+// See the comment on the declaration of makeFuncStub in makefunc.go
+// for more details.
+// No argsize here, gc generates argsize info at call site.
+TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$20
+ NO_LOCAL_POINTERS
+ MOVW R7, 4(R13)
+ MOVW $argframe+0(FP), R1
+ MOVW R1, 8(R13)
+ MOVW $0, R1
+ MOVB R1, 20(R13)
+ ADD $20, R13, R1
+ MOVW R1, 12(R13)
+ MOVW $0, R1
+ MOVW R1, 16(R13)
+ BL ·callReflect(SB)
+ RET
+
+// methodValueCall is the code half of the function returned by makeMethodValue.
+// See the comment on the declaration of methodValueCall in makefunc.go
+// for more details.
+// No argsize here, gc generates argsize info at call site.
+TEXT ·methodValueCall(SB),(NOSPLIT|WRAPPER),$20
+ NO_LOCAL_POINTERS
+ MOVW R7, 4(R13)
+ MOVW $argframe+0(FP), R1
+ MOVW R1, 8(R13)
+ MOVW $0, R1
+ MOVB R1, 20(R13)
+ ADD $20, R13, R1
+ MOVW R1, 12(R13)
+ MOVW $0, R1
+ MOVW R1, 16(R13)
+ BL ·callMethod(SB)
+ RET
diff --git a/contrib/go/_std_1.22/src/reflect/asm_loong64.s b/contrib/go/_std_1.22/src/reflect/asm_loong64.s
new file mode 100644
index 0000000000..520f0afdd5
--- /dev/null
+++ b/contrib/go/_std_1.22/src/reflect/asm_loong64.s
@@ -0,0 +1,89 @@
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "textflag.h"
+#include "funcdata.h"
+
+#define REGCTXT R29
+
+// The frames of each of the two functions below contain two locals, at offsets
+// that are known to the runtime.
+//
+// The first local is a bool called retValid with a whole pointer-word reserved
+// for it on the stack. The purpose of this word is so that the runtime knows
+// whether the stack-allocated return space contains valid values for stack
+// scanning.
+//
+// The second local is an abi.RegArgs value whose offset is also known to the
+// runtime, so that a stack map for it can be constructed, since it contains
+// pointers visible to the GC.
+#define LOCAL_RETVALID 40
+#define LOCAL_REGARGS 48
+
+// The frame size of the functions below is
+// 32 (args of callReflect) + 8 (bool + padding) + 392 (abi.RegArgs) = 432.
+
+// makeFuncStub is the code half of the function returned by MakeFunc.
+// See the comment on the declaration of makeFuncStub in makefunc.go
+// for more details.
+// No arg size here, runtime pulls arg map out of the func value.
+TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$432
+ NO_LOCAL_POINTERS
+ ADDV $LOCAL_REGARGS, R3, R25 // spillArgs using R25
+ JAL runtime·spillArgs(SB)
+ MOVV REGCTXT, 32(R3) // save REGCTXT > args of moveMakeFuncArgPtrs < LOCAL_REGARGS
+
+#ifdef GOEXPERIMENT_regabiargs
+ MOVV REGCTXT, R4
+ MOVV R25, R5
+#else
+ MOVV REGCTXT, 8(R3)
+ MOVV R25, 16(R3)
+#endif
+ JAL ·moveMakeFuncArgPtrs<ABIInternal>(SB)
+ MOVV 32(R3), REGCTXT // restore REGCTXT
+
+ MOVV REGCTXT, 8(R3)
+ MOVV $argframe+0(FP), R20
+ MOVV R20, 16(R3)
+ MOVV R0, LOCAL_RETVALID(R3)
+ ADDV $LOCAL_RETVALID, R3, R20
+ MOVV R20, 24(R3)
+ ADDV $LOCAL_REGARGS, R3, R20
+ MOVV R20, 32(R3)
+ JAL ·callReflect(SB)
+ ADDV $LOCAL_REGARGS, R3, R25 //unspillArgs using R25
+ JAL runtime·unspillArgs(SB)
+ RET
+
+// methodValueCall is the code half of the function returned by makeMethodValue.
+// See the comment on the declaration of methodValueCall in makefunc.go
+// for more details.
+// No arg size here; runtime pulls arg map out of the func value.
+TEXT ·methodValueCall(SB),(NOSPLIT|WRAPPER),$432
+ NO_LOCAL_POINTERS
+ ADDV $LOCAL_REGARGS, R3, R25 // spillArgs using R25
+ JAL runtime·spillArgs(SB)
+ MOVV REGCTXT, 32(R3) // save REGCTXT > args of moveMakeFuncArgPtrs < LOCAL_REGARGS
+#ifdef GOEXPERIMENT_regabiargs
+ MOVV REGCTXT, R4
+ MOVV R25, R5
+#else
+ MOVV REGCTXT, 8(R3)
+ MOVV R25, 16(R3)
+#endif
+ JAL ·moveMakeFuncArgPtrs<ABIInternal>(SB)
+ MOVV 32(R3), REGCTXT // restore REGCTXT
+ MOVV REGCTXT, 8(R3)
+ MOVV $argframe+0(FP), R20
+ MOVV R20, 16(R3)
+ MOVB R0, LOCAL_RETVALID(R3)
+ ADDV $LOCAL_RETVALID, R3, R20
+ MOVV R20, 24(R3)
+ ADDV $LOCAL_REGARGS, R3, R20
+ MOVV R20, 32(R3) // frame size to 32+SP as callreflect args)
+ JAL ·callMethod(SB)
+ ADDV $LOCAL_REGARGS, R3, R25 // unspillArgs using R25
+ JAL runtime·unspillArgs(SB)
+ RET
diff --git a/contrib/go/_std_1.22/src/reflect/asm_mips64x.s b/contrib/go/_std_1.22/src/reflect/asm_mips64x.s
new file mode 100644
index 0000000000..f21e34df1b
--- /dev/null
+++ b/contrib/go/_std_1.22/src/reflect/asm_mips64x.s
@@ -0,0 +1,42 @@
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build mips64 || mips64le
+
+#include "textflag.h"
+#include "funcdata.h"
+
+#define REGCTXT R22
+
+// makeFuncStub is the code half of the function returned by MakeFunc.
+// See the comment on the declaration of makeFuncStub in makefunc.go
+// for more details.
+// No arg size here, runtime pulls arg map out of the func value.
+TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$40
+ NO_LOCAL_POINTERS
+ MOVV REGCTXT, 8(R29)
+ MOVV $argframe+0(FP), R1
+ MOVV R1, 16(R29)
+ MOVB R0, 40(R29)
+ ADDV $40, R29, R1
+ MOVV R1, 24(R29)
+ MOVV R0, 32(R29)
+ JAL ·callReflect(SB)
+ RET
+
+// methodValueCall is the code half of the function returned by makeMethodValue.
+// See the comment on the declaration of methodValueCall in makefunc.go
+// for more details.
+// No arg size here; runtime pulls arg map out of the func value.
+TEXT ·methodValueCall(SB),(NOSPLIT|WRAPPER),$40
+ NO_LOCAL_POINTERS
+ MOVV REGCTXT, 8(R29)
+ MOVV $argframe+0(FP), R1
+ MOVV R1, 16(R29)
+ MOVB R0, 40(R29)
+ ADDV $40, R29, R1
+ MOVV R1, 24(R29)
+ MOVV R0, 32(R29)
+ JAL ·callMethod(SB)
+ RET
diff --git a/contrib/go/_std_1.22/src/reflect/asm_mipsx.s b/contrib/go/_std_1.22/src/reflect/asm_mipsx.s
new file mode 100644
index 0000000000..636c8a5c71
--- /dev/null
+++ b/contrib/go/_std_1.22/src/reflect/asm_mipsx.s
@@ -0,0 +1,42 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build mips || mipsle
+
+#include "textflag.h"
+#include "funcdata.h"
+
+#define REGCTXT R22
+
+// makeFuncStub is the code half of the function returned by MakeFunc.
+// See the comment on the declaration of makeFuncStub in makefunc.go
+// for more details.
+// No arg size here, runtime pulls arg map out of the func value.
+TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$20
+ NO_LOCAL_POINTERS
+ MOVW REGCTXT, 4(R29)
+ MOVW $argframe+0(FP), R1
+ MOVW R1, 8(R29)
+ MOVB R0, 20(R29)
+ ADD $20, R29, R1
+ MOVW R1, 12(R29)
+ MOVW R0, 16(R29)
+ JAL ·callReflect(SB)
+ RET
+
+// methodValueCall is the code half of the function returned by makeMethodValue.
+// See the comment on the declaration of methodValueCall in makefunc.go
+// for more details.
+// No arg size here; runtime pulls arg map out of the func value.
+TEXT ·methodValueCall(SB),(NOSPLIT|WRAPPER),$20
+ NO_LOCAL_POINTERS
+ MOVW REGCTXT, 4(R29)
+ MOVW $argframe+0(FP), R1
+ MOVW R1, 8(R29)
+ MOVB R0, 20(R29)
+ ADD $20, R29, R1
+ MOVW R1, 12(R29)
+ MOVW R0, 16(R29)
+ JAL ·callMethod(SB)
+ RET
diff --git a/contrib/go/_std_1.22/src/reflect/asm_ppc64x.s b/contrib/go/_std_1.22/src/reflect/asm_ppc64x.s
new file mode 100644
index 0000000000..3b529be685
--- /dev/null
+++ b/contrib/go/_std_1.22/src/reflect/asm_ppc64x.s
@@ -0,0 +1,83 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build ppc64 || ppc64le
+
+#include "textflag.h"
+#include "funcdata.h"
+#include "asm_ppc64x.h"
+
+// The frames of each of the two functions below contain two locals, at offsets
+// that are known to the runtime.
+//
+// The first local is a bool called retValid with a whole pointer-word reserved
+// for it on the stack. The purpose of this word is so that the runtime knows
+// whether the stack-allocated return space contains valid values for stack
+// scanning.
+//
+// The second local is an abi.RegArgs value whose offset is also known to the
+// runtime, so that a stack map for it can be constructed, since it contains
+// pointers visible to the GC.
+
+#define LOCAL_RETVALID 32+FIXED_FRAME
+#define LOCAL_REGARGS 40+FIXED_FRAME
+
+// The frame size of the functions below is
+// 32 (args of callReflect) + 8 (bool + padding) + 296 (abi.RegArgs) = 336.
+
+// makeFuncStub is the code half of the function returned by MakeFunc.
+// See the comment on the declaration of makeFuncStub in makefunc.go
+// for more details.
+// No arg size here, runtime pulls arg map out of the func value.
+TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$336
+ NO_LOCAL_POINTERS
+ // NO_LOCAL_POINTERS is a lie. The stack map for the two locals in this
+ // frame is specially handled in the runtime. See the comment above LOCAL_RETVALID.
+ ADD $LOCAL_REGARGS, R1, R20
+ CALL runtime·spillArgs(SB)
+ MOVD R11, FIXED_FRAME+32(R1) // save R11
+ MOVD R11, FIXED_FRAME+0(R1) // arg for moveMakeFuncArgPtrs
+ MOVD R20, FIXED_FRAME+8(R1) // arg for local args
+ CALL ·moveMakeFuncArgPtrs(SB)
+ MOVD FIXED_FRAME+32(R1), R11 // restore R11 ctxt
+ MOVD R11, FIXED_FRAME+0(R1) // ctxt (arg0)
+ MOVD $argframe+0(FP), R3 // save arg to callArg
+ MOVD R3, FIXED_FRAME+8(R1) // frame (arg1)
+ ADD $LOCAL_RETVALID, R1, R3 // addr of return flag
+ MOVB R0, (R3) // clear flag
+ MOVD R3, FIXED_FRAME+16(R1) // addr retvalid (arg2)
+ ADD $LOCAL_REGARGS, R1, R3
+ MOVD R3, FIXED_FRAME+24(R1) // abiregargs (arg3)
+ BL ·callReflect(SB)
+ ADD $LOCAL_REGARGS, R1, R20 // set address of spill area
+ CALL runtime·unspillArgs(SB)
+ RET
+
+// methodValueCall is the code half of the function returned by makeMethodValue.
+// See the comment on the declaration of methodValueCall in makefunc.go
+// for more details.
+// No arg size here; runtime pulls arg map out of the func value.
+TEXT ·methodValueCall(SB),(NOSPLIT|WRAPPER),$336
+ NO_LOCAL_POINTERS
+ // NO_LOCAL_POINTERS is a lie. The stack map for the two locals in this
+ // frame is specially handled in the runtime. See the comment above LOCAL_RETVALID.
+ ADD $LOCAL_REGARGS, R1, R20
+ CALL runtime·spillArgs(SB)
+ MOVD R11, FIXED_FRAME+0(R1) // arg0 ctxt
+ MOVD R11, FIXED_FRAME+32(R1) // save for later
+ MOVD R20, FIXED_FRAME+8(R1) // arg1 abiregargs
+ CALL ·moveMakeFuncArgPtrs(SB)
+ MOVD FIXED_FRAME+32(R1), R11 // restore ctxt
+ MOVD R11, FIXED_FRAME+0(R1) // set as arg0
+ MOVD $argframe+0(FP), R3 // frame pointer
+ MOVD R3, FIXED_FRAME+8(R1) // set as arg1
+ ADD $LOCAL_RETVALID, R1, R3
+ MOVB $0, (R3) // clear ret flag
+ MOVD R3, FIXED_FRAME+16(R1) // addr of return flag
+ ADD $LOCAL_REGARGS, R1, R3 // addr of abiregargs
+ MOVD R3, FIXED_FRAME+24(R1) // set as arg3
+ BL ·callMethod(SB)
+ ADD $LOCAL_REGARGS, R1, R20
+ CALL runtime·unspillArgs(SB)
+ RET
diff --git a/contrib/go/_std_1.22/src/reflect/asm_riscv64.s b/contrib/go/_std_1.22/src/reflect/asm_riscv64.s
new file mode 100644
index 0000000000..1200b4d08e
--- /dev/null
+++ b/contrib/go/_std_1.22/src/reflect/asm_riscv64.s
@@ -0,0 +1,76 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "textflag.h"
+#include "funcdata.h"
+
+// The frames of each of the two functions below contain two locals, at offsets
+// that are known to the runtime.
+//
+// The first local is a bool called retValid with a whole pointer-word reserved
+// for it on the stack. The purpose of this word is so that the runtime knows
+// whether the stack-allocated return space contains valid values for stack
+// scanning.
+//
+// The second local is an abi.RegArgs value whose offset is also known to the
+// runtime, so that a stack map for it can be constructed, since it contains
+// pointers visible to the GC.
+#define LOCAL_RETVALID 40
+#define LOCAL_REGARGS 48
+
+// The frame size of the functions below is
+// 32 (args of callReflect/callMethod) + (8 bool with padding) + 392 (abi.RegArgs) = 432.
+
+// makeFuncStub is the code half of the function returned by MakeFunc.
+// See the comment on the declaration of makeFuncStub in makefunc.go
+// for more details.
+// No arg size here, runtime pulls arg map out of the func value.
+TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$432
+ NO_LOCAL_POINTERS
+ ADD $LOCAL_REGARGS, SP, X25 // spillArgs using X25
+ CALL runtime·spillArgs(SB)
+ MOV CTXT, 32(SP) // save CTXT > args of moveMakeFuncArgPtrs < LOCAL_REGARGS
+ MOV CTXT, 8(SP)
+ MOV X25, 16(SP)
+ CALL ·moveMakeFuncArgPtrs(SB)
+ MOV 32(SP), CTXT // restore CTXT
+
+ MOV CTXT, 8(SP)
+ MOV $argframe+0(FP), T0
+ MOV T0, 16(SP)
+ MOV ZERO, LOCAL_RETVALID(SP)
+ ADD $LOCAL_RETVALID, SP, T1
+ MOV T1, 24(SP)
+ ADD $LOCAL_REGARGS, SP, T1
+ MOV T1, 32(SP)
+ CALL ·callReflect(SB)
+ ADD $LOCAL_REGARGS, SP, X25 // unspillArgs using X25
+ CALL runtime·unspillArgs(SB)
+ RET
+
+// methodValueCall is the code half of the function returned by makeMethodValue.
+// See the comment on the declaration of methodValueCall in makefunc.go
+// for more details.
+// No arg size here; runtime pulls arg map out of the func value.
+TEXT ·methodValueCall(SB),(NOSPLIT|WRAPPER),$432
+ NO_LOCAL_POINTERS
+ ADD $LOCAL_REGARGS, SP, X25 // spillArgs using X25
+ CALL runtime·spillArgs(SB)
+ MOV CTXT, 32(SP) // save CTXT
+ MOV CTXT, 8(SP)
+ MOV X25, 16(SP)
+ CALL ·moveMakeFuncArgPtrs(SB)
+ MOV 32(SP), CTXT // restore CTXT
+ MOV CTXT, 8(SP)
+ MOV $argframe+0(FP), T0
+ MOV T0, 16(SP)
+ MOV ZERO, LOCAL_RETVALID(SP)
+ ADD $LOCAL_RETVALID, SP, T1
+ MOV T1, 24(SP)
+ ADD $LOCAL_REGARGS, SP, T1
+ MOV T1, 32(SP) // frame size to 32+SP as callreflect args
+ CALL ·callMethod(SB)
+ ADD $LOCAL_REGARGS, SP, X25 // unspillArgs using X25
+ CALL runtime·unspillArgs(SB)
+ RET
diff --git a/contrib/go/_std_1.22/src/reflect/asm_s390x.s b/contrib/go/_std_1.22/src/reflect/asm_s390x.s
new file mode 100644
index 0000000000..4bd6613004
--- /dev/null
+++ b/contrib/go/_std_1.22/src/reflect/asm_s390x.s
@@ -0,0 +1,38 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "textflag.h"
+#include "funcdata.h"
+
+// makeFuncStub is the code half of the function returned by MakeFunc.
+// See the comment on the declaration of makeFuncStub in makefunc.go
+// for more details.
+// No arg size here, runtime pulls arg map out of the func value.
+TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$40
+ NO_LOCAL_POINTERS
+ MOVD R12, 8(R15)
+ MOVD $argframe+0(FP), R3
+ MOVD R3, 16(R15)
+ MOVB $0, 40(R15)
+ ADD $40, R15, R3
+ MOVD R3, 24(R15)
+ MOVD $0, 32(R15)
+ BL ·callReflect(SB)
+ RET
+
+// methodValueCall is the code half of the function returned by makeMethodValue.
+// See the comment on the declaration of methodValueCall in makefunc.go
+// for more details.
+// No arg size here; runtime pulls arg map out of the func value.
+TEXT ·methodValueCall(SB),(NOSPLIT|WRAPPER),$40
+ NO_LOCAL_POINTERS
+ MOVD R12, 8(R15)
+ MOVD $argframe+0(FP), R3
+ MOVD R3, 16(R15)
+ MOVB $0, 40(R15)
+ ADD $40, R15, R3
+ MOVD R3, 24(R15)
+ MOVD $0, 32(R15)
+ BL ·callMethod(SB)
+ RET
diff --git a/contrib/go/_std_1.22/src/reflect/asm_wasm.s b/contrib/go/_std_1.22/src/reflect/asm_wasm.s
new file mode 100644
index 0000000000..71abe6700e
--- /dev/null
+++ b/contrib/go/_std_1.22/src/reflect/asm_wasm.s
@@ -0,0 +1,52 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "textflag.h"
+#include "funcdata.h"
+
+// makeFuncStub is the code half of the function returned by MakeFunc.
+// See the comment on the declaration of makeFuncStub in makefunc.go
+// for more details.
+// No arg size here; runtime pulls arg map out of the func value.
+TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$40
+ NO_LOCAL_POINTERS
+
+ MOVD CTXT, 0(SP)
+
+ Get SP
+ Get SP
+ I64ExtendI32U
+ I64Const $argframe+0(FP)
+ I64Add
+ I64Store $8
+
+ MOVB $0, 32(SP)
+ MOVD $32(SP), 16(SP)
+ MOVD $0, 24(SP)
+
+ CALL ·callReflect(SB)
+ RET
+
+// methodValueCall is the code half of the function returned by makeMethodValue.
+// See the comment on the declaration of methodValueCall in makefunc.go
+// for more details.
+// No arg size here; runtime pulls arg map out of the func value.
+TEXT ·methodValueCall(SB),(NOSPLIT|WRAPPER),$40
+ NO_LOCAL_POINTERS
+
+ MOVD CTXT, 0(SP)
+
+ Get SP
+ Get SP
+ I64ExtendI32U
+ I64Const $argframe+0(FP)
+ I64Add
+ I64Store $8
+
+ MOVB $0, 32(SP)
+ MOVD $32(SP), 16(SP)
+ MOVD $0, 24(SP)
+
+ CALL ·callMethod(SB)
+ RET
diff --git a/contrib/go/_std_1.22/src/reflect/float32reg_ppc64x.s b/contrib/go/_std_1.22/src/reflect/float32reg_ppc64x.s
new file mode 100644
index 0000000000..a4deb18427
--- /dev/null
+++ b/contrib/go/_std_1.22/src/reflect/float32reg_ppc64x.s
@@ -0,0 +1,30 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build ppc64 || ppc64le
+
+#include "textflag.h"
+
+// On PPC64, the float32 becomes a float64
+// when loaded in a register, different from
+// other platforms. These functions are
+// needed to ensure correct conversions on PPC64.
+
+// Convert float32->uint64
+TEXT ·archFloat32ToReg(SB),NOSPLIT,$0-16
+ FMOVS val+0(FP), F1
+ FMOVD F1, ret+8(FP)
+ RET
+
+// Convert uint64->float32
+TEXT ·archFloat32FromReg(SB),NOSPLIT,$0-12
+ FMOVD reg+0(FP), F1
+ // Normally a float64->float32 conversion
+ // would need rounding, but that is not needed
+ // here since the uint64 was originally converted
+ // from float32, and should be avoided to
+ // preserve SNaN values.
+ FMOVS F1, ret+8(FP)
+ RET
+
diff --git a/contrib/go/_std_1.22/src/reflect/float32reg_riscv64.s b/contrib/go/_std_1.22/src/reflect/float32reg_riscv64.s
new file mode 100644
index 0000000000..8fcf3ba3e9
--- /dev/null
+++ b/contrib/go/_std_1.22/src/reflect/float32reg_riscv64.s
@@ -0,0 +1,27 @@
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "textflag.h"
+
+// riscv64 allows 32-bit floats to live in the bottom
+// part of the register, it expects them to be NaN-boxed.
+// These functions are needed to ensure correct conversions
+// on riscv64.
+
+// Convert float32->uint64
+TEXT ·archFloat32ToReg(SB),NOSPLIT,$0-16
+ MOVF val+0(FP), F1
+ MOVD F1, ret+8(FP)
+ RET
+
+// Convert uint64->float32
+TEXT ·archFloat32FromReg(SB),NOSPLIT,$0-12
+ // Normally a float64->float32 conversion
+ // would need rounding, but riscv64 store valid
+ // float32 in the lower 32 bits, thus we only need to
+ // unboxed the NaN-box by store a float32.
+ MOVD reg+0(FP), F1
+ MOVF F1, ret+8(FP)
+ RET
+
diff --git a/contrib/go/_std_1.22/src/reflect/internal/example1/example.go b/contrib/go/_std_1.22/src/reflect/internal/example1/example.go
new file mode 100644
index 0000000000..181dd993af
--- /dev/null
+++ b/contrib/go/_std_1.22/src/reflect/internal/example1/example.go
@@ -0,0 +1,10 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package example1
+
+type MyStruct struct {
+ MyStructs []MyStruct
+ MyStruct *MyStruct
+}
diff --git a/contrib/go/_std_1.22/src/reflect/internal/example1/ya.make b/contrib/go/_std_1.22/src/reflect/internal/example1/ya.make
new file mode 100644
index 0000000000..cc7e0bfed2
--- /dev/null
+++ b/contrib/go/_std_1.22/src/reflect/internal/example1/ya.make
@@ -0,0 +1,9 @@
+SUBSCRIBER(g:contrib)
+
+GO_LIBRARY()
+IF (TRUE)
+ SRCS(
+ example.go
+ )
+ENDIF()
+END()
diff --git a/contrib/go/_std_1.22/src/reflect/internal/example2/example.go b/contrib/go/_std_1.22/src/reflect/internal/example2/example.go
new file mode 100644
index 0000000000..8a55826a1c
--- /dev/null
+++ b/contrib/go/_std_1.22/src/reflect/internal/example2/example.go
@@ -0,0 +1,10 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package example2
+
+type MyStruct struct {
+ MyStructs []MyStruct
+ MyStruct *MyStruct
+}
diff --git a/contrib/go/_std_1.22/src/reflect/internal/example2/ya.make b/contrib/go/_std_1.22/src/reflect/internal/example2/ya.make
new file mode 100644
index 0000000000..cc7e0bfed2
--- /dev/null
+++ b/contrib/go/_std_1.22/src/reflect/internal/example2/ya.make
@@ -0,0 +1,9 @@
+SUBSCRIBER(g:contrib)
+
+GO_LIBRARY()
+IF (TRUE)
+ SRCS(
+ example.go
+ )
+ENDIF()
+END()
diff --git a/contrib/go/_std_1.22/src/reflect/internal/ya.make b/contrib/go/_std_1.22/src/reflect/internal/ya.make
new file mode 100644
index 0000000000..31d1b72bf8
--- /dev/null
+++ b/contrib/go/_std_1.22/src/reflect/internal/ya.make
@@ -0,0 +1 @@
+SUBSCRIBER(g:contrib)
diff --git a/contrib/go/_std_1.22/src/reflect/stubs_ppc64x.go b/contrib/go/_std_1.22/src/reflect/stubs_ppc64x.go
new file mode 100644
index 0000000000..06c8bf5483
--- /dev/null
+++ b/contrib/go/_std_1.22/src/reflect/stubs_ppc64x.go
@@ -0,0 +1,10 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build ppc64le || ppc64
+
+package reflect
+
+func archFloat32FromReg(reg uint64) float32
+func archFloat32ToReg(val float32) uint64
diff --git a/contrib/go/_std_1.22/src/reflect/stubs_riscv64.go b/contrib/go/_std_1.22/src/reflect/stubs_riscv64.go
new file mode 100644
index 0000000000..a72ebab970
--- /dev/null
+++ b/contrib/go/_std_1.22/src/reflect/stubs_riscv64.go
@@ -0,0 +1,8 @@
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package reflect
+
+func archFloat32FromReg(reg uint64) float32
+func archFloat32ToReg(val float32) uint64