github.com/sbinet/go@v0.0.0-20160827155028-54d7de7dd62b/src/cmd/internal/obj/funcdata.go (about)

     1  // Copyright 2013 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package obj
     6  
     7  // This file defines the IDs for PCDATA and FUNCDATA instructions
     8  // in Go binaries. It is included by assembly sources, so it must
     9  // be written using #defines.
    10  //
    11  // The Go compiler also #includes this file, for now.
    12  //
    13  // symtab.go also contains a copy of these constants.
    14  
    15  // Pseudo-assembly statements.
    16  
    17  // GO_ARGS, GO_RESULTS_INITIALIZED, and NO_LOCAL_POINTERS are macros
    18  // that communicate to the runtime information about the location and liveness
    19  // of pointers in an assembly function's arguments, results, and stack frame.
    20  // This communication is only required in assembly functions that make calls
    21  // to other functions that might be preempted or grow the stack.
    22  // NOSPLIT functions that make no calls do not need to use these macros.
    23  
    24  // GO_ARGS indicates that the Go prototype for this assembly function
    25  // defines the pointer map for the function's arguments.
    26  // GO_ARGS should be the first instruction in a function that uses it.
    27  // It can be omitted if there are no arguments at all.
    28  // GO_ARGS is inserted implicitly by the linker for any function
    29  // that also has a Go prototype and therefore is usually not necessary
    30  // to write explicitly.
    31  
    32  // GO_RESULTS_INITIALIZED indicates that the assembly function
    33  // has initialized the stack space for its results and that those results
    34  // should be considered live for the remainder of the function.
    35  
    36  // NO_LOCAL_POINTERS indicates that the assembly function stores
    37  // no pointers to heap objects in its local stack variables.
    38  
    39  // ArgsSizeUnknown is set in Func.argsize to mark all functions
    40  // whose argument size is unknown (C vararg functions, and
    41  // assembly code without an explicit specification).
    42  // This value is generated by the compiler, assembler, or linker.
    43  const (
    44  	PCDATA_StackMapIndex       = 0
    45  	FUNCDATA_ArgsPointerMaps   = 0
    46  	FUNCDATA_LocalsPointerMaps = 1
    47  	ArgsSizeUnknown            = -0x80000000
    48  )