Skip to content

Commit b84a139

Browse files
committed
reflect/makefunc: move amd64-specific definitions
Move amd64-specific definitions from general makefunc.go to amd64-specific makefunc_amd64.go. For golang#38783
1 parent dd6ac7d commit b84a139

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/reflect/makefunc.go

-10
Original file line numberDiff line numberDiff line change
@@ -202,16 +202,6 @@ var dispatchToMethodAddr = abi.FuncPCABIInternal(dispatchToMethod)
202202
// at runtime. Initially, it's the actual code address of dispatchToMethod.
203203
var currentMethodKey = dispatchToMethodAddr
204204

205-
const (
206-
// dispatchStep is the number of bytes we should call deeper into
207-
// dispatchToMethod with each generated method.
208-
dispatchStep = 5 // FIXME: AMD64 specific
209-
210-
// dispatchLimit is the upper limit for currentMethodKey. Once this limit
211-
// is reached, we need to switch to a different page.
212-
dispatchLimit = dispatchStep * 812 // FIXME: AMD64 specific
213-
)
214-
215205
// methodSlotsExhausted is a drop-in for when there are no more method slots.
216206
// It will cause the method to panic when called. This late-failure behaviour
217207
// makes it possible to successfully call StructOf even if no more slots for

src/reflect/makefunc_amd64.go

+10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ import (
1111
"unsafe"
1212
)
1313

14+
const (
15+
// dispatchStep is the number of bytes we should call deeper into
16+
// dispatchToMethod with each generated method.
17+
dispatchStep = 5
18+
19+
// dispatchLimit is the upper limit for currentMethodKey. Once this limit
20+
// is reached, we need to switch to a different page.
21+
dispatchLimit = dispatchStep * 812
22+
)
23+
1424
// getMethodImpl returns the pointer to the closure for the specified key.
1525
// It is called from the ASM dispatch code.
1626
func getMethodImpl(

0 commit comments

Comments
 (0)