]> Cypherpunks.ru repositories - gostls13.git/commitdiff
runtime: undo manual inlining of mbits.setMarked
authorAustin Clements <austin@google.com>
Wed, 26 Sep 2018 19:36:28 +0000 (15:36 -0400)
committerAustin Clements <austin@google.com>
Tue, 9 Oct 2018 16:44:45 +0000 (16:44 +0000)
Since atomic.Or8 is now an intrinsic (and has been for some time),
markBits.setMarked is inlinable. Undo the manual inlining of it.

Change-Id: I8e37ccf0851ad1d3088d9c8ae0f6f0c439d7eb2d
Reviewed-on: https://go-review.googlesource.com/c/138659
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/runtime/mbitmap.go
src/runtime/mgcmark.go

index 87fa027b4ebec94df91569379909c5cc89979e32..4854c0e632874dbf893ea49613ac845bf33122dc 100644 (file)
@@ -283,9 +283,7 @@ func (m markBits) isMarked() bool {
        return *m.bytep&m.mask != 0
 }
 
-// setMarked sets the marked bit in the markbits, atomically. Some compilers
-// are not able to inline atomic.Or8 function so if it appears as a hot spot consider
-// inlining it manually.
+// setMarked sets the marked bit in the markbits, atomically.
 func (m markBits) setMarked() {
        // Might be racing with other updates, so use atomic update always.
        // We used to be clever here and use a non-atomic update in certain
index d4dcfb6cb92da0b37c73013270717f1b7834c0dc..14f09700eedbfa98ec1813fa2a101d047f3f8ec8 100644 (file)
@@ -1228,8 +1228,7 @@ func greyobject(obj, base, off uintptr, span *mspan, gcw *gcWork, objIndex uintp
                if mbits.isMarked() {
                        return
                }
-               // mbits.setMarked() // Avoid extra call overhead with manual inlining.
-               atomic.Or8(mbits.bytep, mbits.mask)
+               mbits.setMarked()
                // If this is a noscan object, fast-track it to black
                // instead of greying it.
                if span.spanclass.noscan() {