]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: make map functions ABI insensitive
authorCherry Zhang <cherryyz@google.com>
Mon, 12 Apr 2021 20:12:20 +0000 (16:12 -0400)
committerCherry Zhang <cherryyz@google.com>
Tue, 13 Apr 2021 21:18:03 +0000 (21:18 +0000)
commit9913f821e23e9e26b84ce2b96698140116ee342b
tree2cb875a81df1063e16fe8fb781e68577daacc8a6
parentc19759aa487f7d6f479daa00e7462425f4efc481
cmd/compile: make map functions ABI insensitive

Following CL 309029, this CL does the same thing for map
functions (mapaccess, mapassign, mapdelete).

For simplicity, always wrap "defer delete(m, k)". With
regabidefers enabled, this call is wrapped in a closure and the
rewriting happens automatically. Without regabidefers, it may not
be wrapped for certain key types, and then we'd need special
handling of the delete (because earlier the order pass does not
handle it). And we will turn on defer wrapping by default anyway.

Change-Id: I30663b1aa8e1d6f98e1fb81bf8c0c0ce607ab80b
Reviewed-on: https://go-review.googlesource.com/c/go/+/309510
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/compile/internal/typecheck/builtin.go
src/cmd/compile/internal/typecheck/builtin/runtime.go
src/cmd/compile/internal/walk/assign.go
src/cmd/compile/internal/walk/complit.go
src/cmd/compile/internal/walk/expr.go
src/cmd/compile/internal/walk/order.go
src/cmd/compile/internal/walk/stmt.go
src/cmd/compile/internal/walk/walk.go