diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-12-22 01:15:33 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-12-22 01:15:33 +0000 |
commit | 409a5e7eb4cca107037fafa4a7eea92603edb83d (patch) | |
tree | 06f36bbef6fae78278f799194ad0df8ba2dabaa1 /libgo/runtime/mgc0.h | |
parent | 7e9268b4cf01ab87d9b602f592ed2e2facfadda9 (diff) | |
download | gcc-409a5e7eb4cca107037fafa4a7eea92603edb83d.zip gcc-409a5e7eb4cca107037fafa4a7eea92603edb83d.tar.gz gcc-409a5e7eb4cca107037fafa4a7eea92603edb83d.tar.bz2 |
libgo: Update to revision 15193:6fdc1974457c of master library.
From-SVN: r194692
Diffstat (limited to 'libgo/runtime/mgc0.h')
-rw-r--r-- | libgo/runtime/mgc0.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/libgo/runtime/mgc0.h b/libgo/runtime/mgc0.h new file mode 100644 index 0000000..a2798ef --- /dev/null +++ b/libgo/runtime/mgc0.h @@ -0,0 +1,42 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Garbage collector (GC) + +// GC instruction opcodes. +// +// The opcode of an instruction is followed by zero or more +// arguments to the instruction. +// +// Meaning of arguments: +// off Offset (in bytes) from the start of the current object +// objgc Pointer to GC info of an object +// len Length of an array +// elemsize Size (in bytes) of an element +// size Size (in bytes) +enum { + GC_END, // End of object, loop or subroutine. Args: none + GC_PTR, // A typed pointer. Args: (off, objgc) + GC_APTR, // Pointer to an arbitrary object. Args: (off) + GC_ARRAY_START, // Start an array with a fixed length. Args: (off, len, elemsize) + GC_ARRAY_NEXT, // The next element of an array. Args: none + GC_CALL, // Call a subroutine. Args: (off, objgc) + GC_MAP_PTR, // Go map. Args: (off, MapType*) + GC_STRING, // Go string. Args: (off) + GC_EFACE, // interface{}. Args: (off) + GC_IFACE, // interface{...}. Args: (off) + GC_SLICE, // Go slice. Args: (off, objgc) + GC_REGION, // A region/part of the current object. Args: (off, size, objgc) + + GC_NUM_INSTR, // Number of instruction opcodes +}; + +enum { + // Size of GC's fixed stack. + // + // The current GC implementation permits: + // - at most 1 stack allocation because of GC_CALL + // - at most GC_STACK_CAPACITY allocations because of GC_ARRAY_START + GC_STACK_CAPACITY = 8, +}; |