Skip to content

runtime: remove mapaccess2 in favour of mapaccess (or in reverse) #73196

@mateusz834

Description

@mateusz834

Given that mapaccess returns the zeroval pointer, i don't see a reason to maintain a second mapaccess2 function that also return a boolean. We could instead at the caller site use mapaccess and compute the ok boolean based on ptr == zeroval. This way we could eliminate mapaccess2 (1xnormal and 3xfast ones) implementations from the runtime.

Given that registers die at every CALL this might be also done in reverse, so remove mapaccess in favour of mapaccess2 (the asm diff is going to show only a additional MOV 1 BX) difference, between mapaccess/mapaccess2).

Maybe i am missing some details though. Any thoughts?

CC @prattmic

Metadata

Metadata

Assignees

Labels

ImplementationIssues describing a semantics-preserving change to the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions