diff options
Diffstat (limited to 'src/runtime/mbitmap.go')
| -rw-r--r-- | src/runtime/mbitmap.go | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/src/runtime/mbitmap.go b/src/runtime/mbitmap.go index a3a8b2e70a..7c5856d9e7 100644 --- a/src/runtime/mbitmap.go +++ b/src/runtime/mbitmap.go @@ -573,9 +573,8 @@ func bulkBarrierPreWrite(dst, src, size uintptr) { break } dstx := (*uintptr)(unsafe.Pointer(addr)) - if !buf.putFast(*dstx, 0) { - wbBufFlush() - } + p := buf.get1() + p[0] = *dstx } } else { for { @@ -585,9 +584,9 @@ func bulkBarrierPreWrite(dst, src, size uintptr) { } dstx := (*uintptr)(unsafe.Pointer(addr)) srcx := (*uintptr)(unsafe.Pointer(src + (addr - dst))) - if !buf.putFast(*dstx, *srcx) { - wbBufFlush() - } + p := buf.get2() + p[0] = *dstx + p[1] = *srcx } } } @@ -617,9 +616,8 @@ func bulkBarrierPreWriteSrcOnly(dst, src, size uintptr) { break } srcx := (*uintptr)(unsafe.Pointer(addr - dst + src)) - if !buf.putFast(0, *srcx) { - wbBufFlush() - } + p := buf.get1() + p[0] = *srcx } } @@ -650,14 +648,13 @@ func bulkBarrierBitmap(dst, src, size, maskOffset uintptr, bits *uint8) { if *bits&mask != 0 { dstx := (*uintptr)(unsafe.Pointer(dst + i)) if src == 0 { - if !buf.putFast(*dstx, 0) { - wbBufFlush() - } + p := buf.get1() + p[0] = *dstx } else { srcx := (*uintptr)(unsafe.Pointer(src + i)) - if !buf.putFast(*dstx, *srcx) { - wbBufFlush() - } + p := buf.get2() + p[0] = *dstx + p[1] = *srcx } } mask <<= 1 @@ -709,9 +706,9 @@ func typeBitsBulkBarrier(typ *_type, dst, src, size uintptr) { if bits&1 != 0 { dstx := (*uintptr)(unsafe.Pointer(dst + i)) srcx := (*uintptr)(unsafe.Pointer(src + i)) - if !buf.putFast(*dstx, *srcx) { - wbBufFlush() - } + p := buf.get2() + p[0] = *dstx + p[1] = *srcx } } } |
