In stack bound check pass, check a call once, not over and over
again. Fix an accidental quadratic behavior...
In particular, switching to the new linker caused MIPS builders
noticeably slower. This CL fixes it.
Change-Id: Idd00c79e80af6278652c92a1d9d7bb2d194e9490
Reviewed-on: https://go-review.googlesource.com/c/go/+/227078
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Austin Clements <austin@google.com>
relocs := ldr.Relocs(s)
var ch1 chain
pcsp := obj.NewPCIter(uint32(ctxt.Arch.MinLC))
+ ri := 0
for pcsp.Init(info.Pcsp()); !pcsp.Done; pcsp.Next() {
// pcsp.value is in effect for [pcsp.pc, pcsp.nextpc).
}
// Process calls in this span.
- for i := 0; i < relocs.Count(); i++ {
- r := relocs.At2(i)
+ for ; ri < relocs.Count(); ri++ {
+ r := relocs.At2(ri)
if uint32(r.Off()) >= pcsp.NextPC {
break
}