summaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-29 18:14:50 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-29 18:14:50 +0000
commit19d0f2fa7d70a2e7256a3b68087b7cd7840c0bcd (patch)
tree571dc5d41bd31a1e7befb942446857d17016547b /libgo
parent3f2bdc95466d7474b448d5a72abb5d284872f293 (diff)
downloadgcc-19d0f2fa7d70a2e7256a3b68087b7cd7840c0bcd.tar.gz
compiler, reflect, runtime: remove zero field from type descriptor
Type descriptors picked up a zero field because the gc map implementation used it. However, it's since been dropped by the gc library. It was never used by gccgo. Drop it now in preparation for upgrading to the Go 1.5 library. Reviewed-on: https://go-review.googlesource.com/16486 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229546 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r--libgo/go/reflect/type.go6
-rw-r--r--libgo/runtime/go-type.h5
-rw-r--r--libgo/runtime/go-unsafe-pointer.c11
-rw-r--r--libgo/runtime/proc.c4
4 files changed, 3 insertions, 23 deletions
diff --git a/libgo/go/reflect/type.go b/libgo/go/reflect/type.go
index 61b195563b6..5cdfba55648 100644
--- a/libgo/go/reflect/type.go
+++ b/libgo/go/reflect/type.go
@@ -262,7 +262,6 @@ type rtype struct {
string *string // string form; unnecessary but undeniably useful
*uncommonType // (relatively) uncommon fields
ptrToThis *rtype // type for pointer to this type, if used in binary or has methods
- zero unsafe.Pointer // pointer to zero value
}
// Method on non-interface type
@@ -1129,7 +1128,6 @@ func (t *rtype) ptrTo() *rtype {
p.uncommonType = nil
p.ptrToThis = nil
- p.zero = unsafe.Pointer(&make([]byte, p.size)[0])
p.elem = t
if t.kind&kindNoPointers != 0 {
@@ -1505,7 +1503,6 @@ func ChanOf(dir ChanDir, t Type) Type {
ch.elem = typ
ch.uncommonType = nil
ch.ptrToThis = nil
- ch.zero = unsafe.Pointer(&make([]byte, ch.size)[0])
ch.gc = unsafe.Pointer(&chanGC{
width: ch.size,
@@ -1561,7 +1558,6 @@ func MapOf(key, elem Type) Type {
mt.elem = etyp
mt.uncommonType = nil
mt.ptrToThis = nil
- mt.zero = unsafe.Pointer(&make([]byte, mt.size)[0])
// mt.gc = unsafe.Pointer(&ptrGC{
// width: unsafe.Sizeof(uintptr(0)),
// op: _GC_PTR,
@@ -1848,7 +1844,6 @@ func SliceOf(t Type) Type {
slice.elem = typ
slice.uncommonType = nil
slice.ptrToThis = nil
- slice.zero = unsafe.Pointer(&make([]byte, slice.size)[0])
if typ.size == 0 {
slice.gc = unsafe.Pointer(&sliceEmptyGCProg)
@@ -1920,7 +1915,6 @@ func arrayOf(count int, elem Type) Type {
// TODO:
array.uncommonType = nil
array.ptrToThis = nil
- array.zero = unsafe.Pointer(&make([]byte, array.size)[0])
array.len = uintptr(count)
array.slice = slice.(*rtype)
diff --git a/libgo/runtime/go-type.h b/libgo/runtime/go-type.h
index 72c9f56986e..eb063ec6789 100644
--- a/libgo/runtime/go-type.h
+++ b/libgo/runtime/go-type.h
@@ -108,11 +108,6 @@ struct __go_type_descriptor
/* The descriptor for the type which is a pointer to this type.
This may be NULL. */
const struct __go_type_descriptor *__pointer_to_this;
-
- /* A pointer to a zero value for this type. All types will point to
- the same zero value, go$zerovalue, which is a common variable so
- that it will be large enough. */
- void *__zero;
};
/* The information we store for each method of a type. */
diff --git a/libgo/runtime/go-unsafe-pointer.c b/libgo/runtime/go-unsafe-pointer.c
index a59ae852185..ce82fcd4070 100644
--- a/libgo/runtime/go-unsafe-pointer.c
+++ b/libgo/runtime/go-unsafe-pointer.c
@@ -10,9 +10,6 @@
#include "go-type.h"
#include "mgc0.h"
-/* A pointer with a zero value. */
-static void *zero_pointer;
-
/* This file provides the type descriptor for the unsafe.Pointer type.
The unsafe package is defined by the compiler itself, which means
that there is no package to compile to define the type
@@ -64,9 +61,7 @@ const struct __go_type_descriptor unsafe_Pointer =
/* __uncommon */
NULL,
/* __pointer_to_this */
- NULL,
- /* __zero */
- &zero_pointer
+ NULL
};
/* We also need the type descriptor for the pointer to unsafe.Pointer,
@@ -109,9 +104,7 @@ const struct __go_ptr_type pointer_unsafe_Pointer =
/* __uncommon */
NULL,
/* __pointer_to_this */
- NULL,
- /* __zero */
- &zero_pointer
+ NULL
},
/* __element_type */
&unsafe_Pointer
diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c
index db8b94f28f7..8f82f5b9cc4 100644
--- a/libgo/runtime/proc.c
+++ b/libgo/runtime/proc.c
@@ -538,9 +538,7 @@ static struct __go_channel_type chan_bool_type_descriptor =
/* __uncommon */
NULL,
/* __pointer_to_this */
- NULL,
- /* __zero */
- NULL /* This value doesn't matter */
+ NULL
},
/* __element_type */
&bool_type_descriptor,