38// We have two different ways of doing defers. The older way involves creating a
39// defer record at the time that a defer statement is executing and adding it to a
40▶// defer chain. This chain is inspected by the deferreturn call at all function
41// exits in order to run the appropriate defer calls. A cheaper way (which we call
42// open-coded defers) is used for functions in which no defer statements occur in
· · ·
42▶// open-coded defers) is used for functions in which no defer statements occur in
43// loops. In that case, we simply store the defer function/arg information into
44// specific stack slots at the point of each defer statement, as well as setting a
· · ·
43▶// loops. In that case, we simply store the defer function/arg information into
44// specific stack slots at the point of each defer statement, as well as setting a
45// bit in a bitmask. At each function exit, we add inline code to directly make
· · ·
45▶// bit in a bitmask. At each function exit, we add inline code to directly make
46// the appropriate defer calls based on the bitmask and fn/arg information stored
47// on the stack. During panic/Goexit processing, the appropriate defer calls are
· · ·
48▶// made using extra funcdata info that indicates the exact stack slots that
49// contain the bitmask and defer fn/args.
50
+ 182 more matches in this file