mirror of
https://github.com/golang/go
synced 2024-11-18 16:04:44 -07:00
go/ssa/interp: fix intrinsics for (*runtime.Func) methods.
They changed when they were ported to Go in CL https://golang.org/cl/124300044. LGTM=crawshaw R=gri, crawshaw CC=golang-codereviews https://golang.org/cl/136780043
This commit is contained in:
parent
067a2992ee
commit
4aaa1f6f6c
@ -94,9 +94,9 @@ func init() {
|
||||
"runtime.NumCPU": ext۰runtime۰NumCPU,
|
||||
"runtime.ReadMemStats": ext۰runtime۰ReadMemStats,
|
||||
"runtime.SetFinalizer": ext۰runtime۰SetFinalizer,
|
||||
"runtime.funcentry_go": ext۰runtime۰funcentry_go,
|
||||
"runtime.funcline_go": ext۰runtime۰funcline_go,
|
||||
"runtime.funcname_go": ext۰runtime۰funcname_go,
|
||||
"(*runtime.Func).Entry": ext۰runtime۰Func۰Entry,
|
||||
"(*runtime.Func).FileLine": ext۰runtime۰Func۰FileLine,
|
||||
"(*runtime.Func).Name": ext۰runtime۰Func۰Name,
|
||||
"runtime.getgoroot": ext۰runtime۰getgoroot,
|
||||
"strings.IndexByte": ext۰strings۰IndexByte,
|
||||
"sync.runtime_Semacquire": ext۰sync۰runtime_Semacquire,
|
||||
@ -402,8 +402,10 @@ func ext۰runtime۰SetFinalizer(fr *frame, args []value) value {
|
||||
return nil // ignore
|
||||
}
|
||||
|
||||
func ext۰runtime۰funcline_go(fr *frame, args []value) value {
|
||||
// func funcline_go(*Func, uintptr) (string, int)
|
||||
// Pretend: type runtime.Func struct { entry *ssa.Function }
|
||||
|
||||
func ext۰runtime۰Func۰FileLine(fr *frame, args []value) value {
|
||||
// func (*runtime.Func) FileLine(uintptr) (string, int)
|
||||
f, _ := (*args[0].(*value)).(structure)[0].(*ssa.Function)
|
||||
pc := args[1].(uintptr)
|
||||
_ = pc
|
||||
@ -415,8 +417,8 @@ func ext۰runtime۰funcline_go(fr *frame, args []value) value {
|
||||
return tuple{"", 0}
|
||||
}
|
||||
|
||||
func ext۰runtime۰funcname_go(fr *frame, args []value) value {
|
||||
// func funcname_go(*Func) string
|
||||
func ext۰runtime۰Func۰Name(fr *frame, args []value) value {
|
||||
// func (*runtime.Func) Name() string
|
||||
f, _ := (*args[0].(*value)).(structure)[0].(*ssa.Function)
|
||||
if f != nil {
|
||||
return f.String()
|
||||
@ -424,8 +426,8 @@ func ext۰runtime۰funcname_go(fr *frame, args []value) value {
|
||||
return ""
|
||||
}
|
||||
|
||||
func ext۰runtime۰funcentry_go(fr *frame, args []value) value {
|
||||
// func funcentry_go(*Func) uintptr
|
||||
func ext۰runtime۰Func۰Entry(fr *frame, args []value) value {
|
||||
// func (*runtime.Func) Entry() uintptr
|
||||
f, _ := (*args[0].(*value)).(structure)[0].(*ssa.Function)
|
||||
return uintptr(unsafe.Pointer(f))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user