Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement runtime callers #177

Merged
merged 32 commits into from
Sep 1, 2022
Merged

implement runtime callers #177

merged 32 commits into from
Sep 1, 2022

Conversation

visualfc
Copy link
Member

@visualfc visualfc commented Aug 22, 2022

implement runtime func

runtime.Caller
runtime.FuncForPC
runtime.Callers
(*runtime.Frames).Next
(*runtime.Func).FileLine
(reflect.Value).Pointer
runtime.Stack 
runtime/debug.Stack
runtime/debug.PrintStack

*runtime.Stack(bug []uint8, all bool) always = runtime.Stack(buf, false)

ssa method wrapper

func$bound T(0).f -> runtime main.T.f-fm
func$thunk T.f -> runtime main.T.f
func$thunk (struct{ T }).f -> runtime go.struct { main.T }.main.f 1

type T int

func (T) f() int
func (*T) g()
var (
	// thunks
	a = T.f
	b = T.f
	c = (struct{ T }).f
	d = (struct{ T }).f
	e = (*T).g
	f = (*T).g
	g = (struct{ *T }).g
	h = (struct{ *T }).g

	// bounds
	i = T(0).f
	j = T(0).f
	k = new(T).g
	l = new(T).g
}

@visualfc visualfc changed the title implement runtime.Caller implement runtime.Caller runtime.FuncForPC Aug 23, 2022
@visualfc visualfc changed the title implement runtime.Caller runtime.FuncForPC implement runtime callers Aug 31, 2022
@visualfc visualfc merged commit f74d4b5 into main Sep 1, 2022
@visualfc visualfc deleted the caller branch September 1, 2022 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant