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