]> Cypherpunks.ru repositories - gostls13.git/commitdiff
[dev.garbage] all: merge default (f38460037b72) into dev.garbage
authorRuss Cox <rsc@golang.org>
Fri, 14 Nov 2014 16:37:54 +0000 (11:37 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 14 Nov 2014 16:37:54 +0000 (11:37 -0500)
This is the revision that dev.cc is branched from.

LGTM=austin
R=austin
CC=golang-codereviews
https://golang.org/cl/169590043

13 files changed:
1  2 
lib/codereview/codereview.py
src/cmd/dist/build.c
src/runtime/asm_386.s
src/runtime/asm_amd64.s
src/runtime/asm_amd64p32.s
src/runtime/asm_arm.s
src/runtime/heapdump.c
src/runtime/malloc.go
src/runtime/mgc0.c
src/runtime/proc.c
src/runtime/runtime.h
src/runtime/stack.c
src/runtime/stubs.go

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index a18e77421e886b0a243a30871624c8f0e9408797,8cf1c3d342664269703fe0fdc727851cddc308b0..fab8cf269579f423341b45a4c94f4f21e49e19a1
@@@ -358,40 -344,9 +358,40 @@@ marked
        return x
  }
  
 +func loadPtrMask(typ *_type) []uint8 {
 +      var ptrmask *uint8
 +      nptr := (uintptr(typ.size) + ptrSize - 1) / ptrSize
 +      if typ.kind&kindGCProg != 0 {
 +              masksize := nptr
 +              if masksize%2 != 0 {
 +                      masksize *= 2 // repeated
 +              }
 +              masksize = masksize * pointersPerByte / 8 // 4 bits per word
 +              masksize++                                // unroll flag in the beginning
 +              if masksize > maxGCMask && typ.gc[1] != 0 {
 +                      // write barriers have not been updated to deal with this case yet.
 +                      gothrow("maxGCMask too small for now")
 +              }
 +              ptrmask = (*uint8)(unsafe.Pointer(uintptr(typ.gc[0])))
 +              // Check whether the program is already unrolled
 +              // by checking if the unroll flag byte is set
 +              maskword := uintptr(atomicloadp(unsafe.Pointer(ptrmask)))
 +              if *(*uint8)(unsafe.Pointer(&maskword)) == 0 {
 +                      mp := acquirem()
 +                      mp.ptrarg[0] = unsafe.Pointer(typ)
 +                      onM(unrollgcprog_m)
 +                      releasem(mp)
 +              }
 +              ptrmask = (*uint8)(add(unsafe.Pointer(ptrmask), 1)) // skip the unroll flag byte
 +      } else {
 +              ptrmask = (*uint8)(unsafe.Pointer(typ.gc[0])) // pointer to unrolled mask
 +      }
 +      return (*[1 << 30]byte)(unsafe.Pointer(ptrmask))[:(nptr+1)/2]
 +}
 +
  // implementation of new builtin
  func newobject(typ *_type) unsafe.Pointer {
-       flags := 0
+       flags := uint32(0)
        if typ.kind&kindNoPointers != 0 {
                flags |= flagNoScan
        }
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge