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

cmd/compile: extra write barrier on map access+append #15023

Closed
randall77 opened this issue Mar 29, 2016 · 1 comment
Closed

cmd/compile: extra write barrier on map access+append #15023

randall77 opened this issue Mar 29, 2016 · 1 comment

Comments

@randall77
Copy link
Contributor

func f(m map[int][]*byte, p *byte) {
    m[3] = append(m[3], p)
}

This function under SSA generates two write barriers, where the old compiler only generated one.
The required write barrier is the store of p to the backing array of the slice.
The spurious write barrier is the write of the slice pointer to an autotmp_ in preparation for the address of that autotmp_ to be passed to mapassign1.

See #14869 , this is decomposeBuiltIn case.

@aclements

@randall77
Copy link
Contributor Author

Dup of #14969

@golang golang locked and limited conversation to collaborators Mar 30, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants