diff options
Diffstat (limited to 'libgo/go/cmd/internal/objabi/funcid.go')
-rw-r--r-- | libgo/go/cmd/internal/objabi/funcid.go | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/libgo/go/cmd/internal/objabi/funcid.go b/libgo/go/cmd/internal/objabi/funcid.go index 0fda1db..1d098ee 100644 --- a/libgo/go/cmd/internal/objabi/funcid.go +++ b/libgo/go/cmd/internal/objabi/funcid.go @@ -4,11 +4,6 @@ package objabi -import ( - "strconv" - "strings" -) - // A FuncID identifies particular functions that need to be treated // specially by the runtime. // Note that in some situations involving plugins, there may be multiple @@ -31,7 +26,7 @@ const ( FuncID_gcBgMarkWorker FuncID_systemstack_switch FuncID_systemstack - FuncID_cgocallback_gofunc + FuncID_cgocallback FuncID_gogo FuncID_externalthreadhandler FuncID_debugCallV1 @@ -44,7 +39,10 @@ const ( // Get the function ID for the named function in the named file. // The function should be package-qualified. -func GetFuncID(name, file string) FuncID { +func GetFuncID(name string, isWrapper bool) FuncID { + if isWrapper { + return FuncID_wrapper + } switch name { case "runtime.main": return FuncID_runtime_main @@ -72,8 +70,8 @@ func GetFuncID(name, file string) FuncID { return FuncID_systemstack_switch case "runtime.systemstack": return FuncID_systemstack - case "runtime.cgocallback_gofunc": - return FuncID_cgocallback_gofunc + case "runtime.cgocallback": + return FuncID_cgocallback case "runtime.gogo": return FuncID_gogo case "runtime.externalthreadhandler": @@ -98,17 +96,5 @@ func GetFuncID(name, file string) FuncID { // Don't show in the call stack (used when invoking defer functions) return FuncID_wrapper } - if file == "<autogenerated>" { - return FuncID_wrapper - } - if strings.HasPrefix(name, "runtime.call") { - if _, err := strconv.Atoi(name[12:]); err == nil { - // runtime.callXX reflect call wrappers. - return FuncID_wrapper - } - } - if strings.HasSuffix(name, "-fm") { - return FuncID_wrapper - } return FuncID_normal } |