github.com/twelsh-aw/go/src@v0.0.0-20230516233729-a56fe86a7c81/internal/abi/funcpc.go (about)

     1  // Copyright 2023 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 abi
     6  
     7  // FuncPC* intrinsics.
     8  //
     9  // CAREFUL: In programs with plugins, FuncPC* can return different values
    10  // for the same function (because there are actually multiple copies of
    11  // the same function in the address space). To be safe, don't use the
    12  // results of this function in any == expression. It is only safe to
    13  // use the result as an address at which to start executing code.
    14  
    15  // FuncPCABI0 returns the entry PC of the function f, which must be a
    16  // direct reference of a function defined as ABI0. Otherwise it is a
    17  // compile-time error.
    18  //
    19  // Implemented as a compile intrinsic.
    20  func FuncPCABI0(f interface{}) uintptr
    21  
    22  // FuncPCABIInternal returns the entry PC of the function f. If f is a
    23  // direct reference of a function, it must be defined as ABIInternal.
    24  // Otherwise it is a compile-time error. If f is not a direct reference
    25  // of a defined function, it assumes that f is a func value. Otherwise
    26  // the behavior is undefined.
    27  //
    28  // Implemented as a compile intrinsic.
    29  func FuncPCABIInternal(f interface{}) uintptr