Skip to content

Commit

Permalink
reflect: cram method dispatch into one memory page
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCount committed Sep 12, 2023
1 parent ffc6822 commit 929e369
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cmd/internal/obj/x86/asm6.go
Original file line number Diff line number Diff line change
Expand Up @@ -2044,8 +2044,8 @@ type nopPad struct {
// cursym: current function being assembled
// returns number of bytes of padding needed
func addpad(pc, a int64, ctxt *obj.Link, cursym *obj.LSym) int {
if !((a&(a-1) == 0) && 8 <= a && a <= 2048) {
ctxt.Diag("alignment value of an instruction must be a power of two and in the range [8, 2048], got %d\n", a)
if !((a&(a-1) == 0) && 8 <= a && a <= 4096) {
ctxt.Diag("alignment value of an instruction must be a power of two and in the range [8, 4096], got %d\n", a)
return 0
}

Expand Down
2 changes: 2 additions & 0 deletions src/reflect/asm_amd64.s
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ TEXT ·methodValueCall(SB),(NOSPLIT|WRAPPER),$312
// the closure which implements the method.
// No preamble of any kind, we need to do things manually.
TEXT ·dispatchToMethod<ABIInternal>(SB),(NOSPLIT|NOFRAME),$0-0
// cram dispatchToMethod and dispatchLabel into a single memory page
PCALIGN $4096
CALL ·dispatchLabel(SB)
CALL ·dispatchLabel(SB)
CALL ·dispatchLabel(SB)
Expand Down

0 comments on commit 929e369

Please sign in to comment.