1
0
mirror of https://github.com/golang/go synced 2024-11-17 00:14:50 -07:00

cmd/compile: cleanup nodpc and nodfp

Instead of creating a new &nodfp expression for every recover() call,
or a new nodpc variable for every function instrumented by the race
detector, this CL introduces two new uintptr-typed pseudo-variables
callerSP and callerPC. These pseudo-variables act just like calls to
the runtime's getcallersp() and getcallerpc() functions.

For consistency, change runtime.gorecover's builtin stub's parameter
type from "*int32" to "uintptr".

Passes toolstash-check, but toolstash-check -race fails because of
register allocator changes.

Change-Id: I985d644653de2dac8b7b03a28829ad04dfd4f358
Reviewed-on: https://go-review.googlesource.com/99416
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Matthew Dempsky 2018-03-08 01:50:36 -08:00
parent 6a5cfa8b63
commit dcac984b97
9 changed files with 261 additions and 270 deletions

View File

@ -16,144 +16,144 @@ var runtimeDecls = [...]struct {
{"throwinit", funcTag, 5},
{"panicwrap", funcTag, 5},
{"gopanic", funcTag, 7},
{"gorecover", funcTag, 10},
{"gorecover", funcTag, 9},
{"goschedguarded", funcTag, 5},
{"printbool", funcTag, 12},
{"printfloat", funcTag, 14},
{"printint", funcTag, 16},
{"printhex", funcTag, 18},
{"printuint", funcTag, 18},
{"printcomplex", funcTag, 20},
{"printstring", funcTag, 22},
{"printpointer", funcTag, 23},
{"printiface", funcTag, 23},
{"printeface", funcTag, 23},
{"printslice", funcTag, 23},
{"printbool", funcTag, 11},
{"printfloat", funcTag, 13},
{"printint", funcTag, 15},
{"printhex", funcTag, 17},
{"printuint", funcTag, 17},
{"printcomplex", funcTag, 19},
{"printstring", funcTag, 21},
{"printpointer", funcTag, 22},
{"printiface", funcTag, 22},
{"printeface", funcTag, 22},
{"printslice", funcTag, 22},
{"printnl", funcTag, 5},
{"printsp", funcTag, 5},
{"printlock", funcTag, 5},
{"printunlock", funcTag, 5},
{"concatstring2", funcTag, 26},
{"concatstring3", funcTag, 27},
{"concatstring4", funcTag, 28},
{"concatstring5", funcTag, 29},
{"concatstrings", funcTag, 31},
{"cmpstring", funcTag, 33},
{"intstring", funcTag, 36},
{"slicebytetostring", funcTag, 38},
{"slicebytetostringtmp", funcTag, 39},
{"slicerunetostring", funcTag, 42},
{"stringtoslicebyte", funcTag, 43},
{"stringtoslicerune", funcTag, 46},
{"decoderune", funcTag, 47},
{"slicecopy", funcTag, 49},
{"slicestringcopy", funcTag, 50},
{"convI2I", funcTag, 51},
{"convT2E", funcTag, 52},
{"convT2E16", funcTag, 52},
{"convT2E32", funcTag, 52},
{"convT2E64", funcTag, 52},
{"convT2Estring", funcTag, 52},
{"convT2Eslice", funcTag, 52},
{"convT2Enoptr", funcTag, 52},
{"convT2I", funcTag, 52},
{"convT2I16", funcTag, 52},
{"convT2I32", funcTag, 52},
{"convT2I64", funcTag, 52},
{"convT2Istring", funcTag, 52},
{"convT2Islice", funcTag, 52},
{"convT2Inoptr", funcTag, 52},
{"assertE2I", funcTag, 51},
{"assertE2I2", funcTag, 53},
{"assertI2I", funcTag, 51},
{"assertI2I2", funcTag, 53},
{"panicdottypeE", funcTag, 54},
{"panicdottypeI", funcTag, 54},
{"panicnildottype", funcTag, 55},
{"ifaceeq", funcTag, 58},
{"efaceeq", funcTag, 58},
{"fastrand", funcTag, 60},
{"makemap64", funcTag, 62},
{"makemap", funcTag, 63},
{"makemap_small", funcTag, 64},
{"mapaccess1", funcTag, 65},
{"mapaccess1_fast32", funcTag, 66},
{"mapaccess1_fast64", funcTag, 66},
{"mapaccess1_faststr", funcTag, 66},
{"mapaccess1_fat", funcTag, 67},
{"mapaccess2", funcTag, 68},
{"mapaccess2_fast32", funcTag, 69},
{"mapaccess2_fast64", funcTag, 69},
{"mapaccess2_faststr", funcTag, 69},
{"mapaccess2_fat", funcTag, 70},
{"mapassign", funcTag, 65},
{"mapassign_fast32", funcTag, 66},
{"mapassign_fast32ptr", funcTag, 66},
{"mapassign_fast64", funcTag, 66},
{"mapassign_fast64ptr", funcTag, 66},
{"mapassign_faststr", funcTag, 66},
{"mapiterinit", funcTag, 71},
{"mapdelete", funcTag, 71},
{"mapdelete_fast32", funcTag, 72},
{"mapdelete_fast64", funcTag, 72},
{"mapdelete_faststr", funcTag, 72},
{"mapiternext", funcTag, 73},
{"makechan64", funcTag, 75},
{"makechan", funcTag, 76},
{"chanrecv1", funcTag, 78},
{"chanrecv2", funcTag, 79},
{"chansend1", funcTag, 81},
{"closechan", funcTag, 23},
{"writeBarrier", varTag, 83},
{"typedmemmove", funcTag, 84},
{"typedmemclr", funcTag, 85},
{"typedslicecopy", funcTag, 86},
{"selectnbsend", funcTag, 87},
{"selectnbrecv", funcTag, 88},
{"selectnbrecv2", funcTag, 90},
{"newselect", funcTag, 91},
{"selectsend", funcTag, 92},
{"selectrecv", funcTag, 93},
{"selectdefault", funcTag, 55},
{"selectgo", funcTag, 94},
{"concatstring2", funcTag, 25},
{"concatstring3", funcTag, 26},
{"concatstring4", funcTag, 27},
{"concatstring5", funcTag, 28},
{"concatstrings", funcTag, 30},
{"cmpstring", funcTag, 32},
{"intstring", funcTag, 35},
{"slicebytetostring", funcTag, 37},
{"slicebytetostringtmp", funcTag, 38},
{"slicerunetostring", funcTag, 41},
{"stringtoslicebyte", funcTag, 42},
{"stringtoslicerune", funcTag, 45},
{"decoderune", funcTag, 46},
{"slicecopy", funcTag, 47},
{"slicestringcopy", funcTag, 48},
{"convI2I", funcTag, 49},
{"convT2E", funcTag, 50},
{"convT2E16", funcTag, 50},
{"convT2E32", funcTag, 50},
{"convT2E64", funcTag, 50},
{"convT2Estring", funcTag, 50},
{"convT2Eslice", funcTag, 50},
{"convT2Enoptr", funcTag, 50},
{"convT2I", funcTag, 50},
{"convT2I16", funcTag, 50},
{"convT2I32", funcTag, 50},
{"convT2I64", funcTag, 50},
{"convT2Istring", funcTag, 50},
{"convT2Islice", funcTag, 50},
{"convT2Inoptr", funcTag, 50},
{"assertE2I", funcTag, 49},
{"assertE2I2", funcTag, 51},
{"assertI2I", funcTag, 49},
{"assertI2I2", funcTag, 51},
{"panicdottypeE", funcTag, 52},
{"panicdottypeI", funcTag, 52},
{"panicnildottype", funcTag, 53},
{"ifaceeq", funcTag, 56},
{"efaceeq", funcTag, 56},
{"fastrand", funcTag, 58},
{"makemap64", funcTag, 60},
{"makemap", funcTag, 61},
{"makemap_small", funcTag, 62},
{"mapaccess1", funcTag, 63},
{"mapaccess1_fast32", funcTag, 64},
{"mapaccess1_fast64", funcTag, 64},
{"mapaccess1_faststr", funcTag, 64},
{"mapaccess1_fat", funcTag, 65},
{"mapaccess2", funcTag, 66},
{"mapaccess2_fast32", funcTag, 67},
{"mapaccess2_fast64", funcTag, 67},
{"mapaccess2_faststr", funcTag, 67},
{"mapaccess2_fat", funcTag, 68},
{"mapassign", funcTag, 63},
{"mapassign_fast32", funcTag, 64},
{"mapassign_fast32ptr", funcTag, 64},
{"mapassign_fast64", funcTag, 64},
{"mapassign_fast64ptr", funcTag, 64},
{"mapassign_faststr", funcTag, 64},
{"mapiterinit", funcTag, 69},
{"mapdelete", funcTag, 69},
{"mapdelete_fast32", funcTag, 70},
{"mapdelete_fast64", funcTag, 70},
{"mapdelete_faststr", funcTag, 70},
{"mapiternext", funcTag, 71},
{"makechan64", funcTag, 73},
{"makechan", funcTag, 74},
{"chanrecv1", funcTag, 76},
{"chanrecv2", funcTag, 77},
{"chansend1", funcTag, 79},
{"closechan", funcTag, 22},
{"writeBarrier", varTag, 81},
{"typedmemmove", funcTag, 82},
{"typedmemclr", funcTag, 83},
{"typedslicecopy", funcTag, 84},
{"selectnbsend", funcTag, 85},
{"selectnbrecv", funcTag, 86},
{"selectnbrecv2", funcTag, 88},
{"newselect", funcTag, 90},
{"selectsend", funcTag, 91},
{"selectrecv", funcTag, 92},
{"selectdefault", funcTag, 53},
{"selectgo", funcTag, 93},
{"block", funcTag, 5},
{"makeslice", funcTag, 96},
{"makeslice64", funcTag, 97},
{"growslice", funcTag, 98},
{"memmove", funcTag, 99},
{"memclrNoHeapPointers", funcTag, 100},
{"memclrHasPointers", funcTag, 100},
{"memequal", funcTag, 101},
{"memequal8", funcTag, 102},
{"memequal16", funcTag, 102},
{"memequal32", funcTag, 102},
{"memequal64", funcTag, 102},
{"memequal128", funcTag, 102},
{"int64div", funcTag, 103},
{"uint64div", funcTag, 104},
{"int64mod", funcTag, 103},
{"uint64mod", funcTag, 104},
{"float64toint64", funcTag, 105},
{"float64touint64", funcTag, 106},
{"float64touint32", funcTag, 107},
{"int64tofloat64", funcTag, 108},
{"uint64tofloat64", funcTag, 109},
{"uint32tofloat64", funcTag, 110},
{"complex128div", funcTag, 111},
{"racefuncenter", funcTag, 112},
{"makeslice", funcTag, 95},
{"makeslice64", funcTag, 96},
{"growslice", funcTag, 97},
{"memmove", funcTag, 98},
{"memclrNoHeapPointers", funcTag, 99},
{"memclrHasPointers", funcTag, 99},
{"memequal", funcTag, 100},
{"memequal8", funcTag, 101},
{"memequal16", funcTag, 101},
{"memequal32", funcTag, 101},
{"memequal64", funcTag, 101},
{"memequal128", funcTag, 101},
{"int64div", funcTag, 102},
{"uint64div", funcTag, 103},
{"int64mod", funcTag, 102},
{"uint64mod", funcTag, 103},
{"float64toint64", funcTag, 104},
{"float64touint64", funcTag, 105},
{"float64touint32", funcTag, 106},
{"int64tofloat64", funcTag, 107},
{"uint64tofloat64", funcTag, 108},
{"uint32tofloat64", funcTag, 109},
{"complex128div", funcTag, 110},
{"racefuncenter", funcTag, 111},
{"racefuncexit", funcTag, 5},
{"raceread", funcTag, 112},
{"racewrite", funcTag, 112},
{"racereadrange", funcTag, 113},
{"racewriterange", funcTag, 113},
{"msanread", funcTag, 113},
{"msanwrite", funcTag, 113},
{"support_popcnt", varTag, 11},
{"support_sse41", varTag, 11},
{"raceread", funcTag, 111},
{"racewrite", funcTag, 111},
{"racereadrange", funcTag, 112},
{"racewriterange", funcTag, 112},
{"msanread", funcTag, 112},
{"msanwrite", funcTag, 112},
{"support_popcnt", varTag, 10},
{"support_sse41", varTag, 10},
}
func runtimeTypes() []*types.Type {
var typs [114]*types.Type
var typs [113]*types.Type
typs[0] = types.Bytetype
typs[1] = types.NewPtr(typs[0])
typs[2] = types.Types[TANY]
@ -162,111 +162,110 @@ func runtimeTypes() []*types.Type {
typs[5] = functype(nil, nil, nil)
typs[6] = types.Types[TINTER]
typs[7] = functype(nil, []*Node{anonfield(typs[6])}, nil)
typs[8] = types.Types[TINT32]
typs[9] = types.NewPtr(typs[8])
typs[10] = functype(nil, []*Node{anonfield(typs[9])}, []*Node{anonfield(typs[6])})
typs[11] = types.Types[TBOOL]
typs[12] = functype(nil, []*Node{anonfield(typs[11])}, nil)
typs[13] = types.Types[TFLOAT64]
typs[14] = functype(nil, []*Node{anonfield(typs[13])}, nil)
typs[15] = types.Types[TINT64]
typs[16] = functype(nil, []*Node{anonfield(typs[15])}, nil)
typs[17] = types.Types[TUINT64]
typs[18] = functype(nil, []*Node{anonfield(typs[17])}, nil)
typs[19] = types.Types[TCOMPLEX128]
typs[20] = functype(nil, []*Node{anonfield(typs[19])}, nil)
typs[21] = types.Types[TSTRING]
typs[22] = functype(nil, []*Node{anonfield(typs[21])}, nil)
typs[23] = functype(nil, []*Node{anonfield(typs[2])}, nil)
typs[24] = types.NewArray(typs[0], 32)
typs[25] = types.NewPtr(typs[24])
typs[26] = functype(nil, []*Node{anonfield(typs[25]), anonfield(typs[21]), anonfield(typs[21])}, []*Node{anonfield(typs[21])})
typs[27] = functype(nil, []*Node{anonfield(typs[25]), anonfield(typs[21]), anonfield(typs[21]), anonfield(typs[21])}, []*Node{anonfield(typs[21])})
typs[28] = functype(nil, []*Node{anonfield(typs[25]), anonfield(typs[21]), anonfield(typs[21]), anonfield(typs[21]), anonfield(typs[21])}, []*Node{anonfield(typs[21])})
typs[29] = functype(nil, []*Node{anonfield(typs[25]), anonfield(typs[21]), anonfield(typs[21]), anonfield(typs[21]), anonfield(typs[21]), anonfield(typs[21])}, []*Node{anonfield(typs[21])})
typs[30] = types.NewSlice(typs[21])
typs[31] = functype(nil, []*Node{anonfield(typs[25]), anonfield(typs[30])}, []*Node{anonfield(typs[21])})
typs[32] = types.Types[TINT]
typs[33] = functype(nil, []*Node{anonfield(typs[21]), anonfield(typs[21])}, []*Node{anonfield(typs[32])})
typs[34] = types.NewArray(typs[0], 4)
typs[35] = types.NewPtr(typs[34])
typs[36] = functype(nil, []*Node{anonfield(typs[35]), anonfield(typs[15])}, []*Node{anonfield(typs[21])})
typs[37] = types.NewSlice(typs[0])
typs[38] = functype(nil, []*Node{anonfield(typs[25]), anonfield(typs[37])}, []*Node{anonfield(typs[21])})
typs[39] = functype(nil, []*Node{anonfield(typs[37])}, []*Node{anonfield(typs[21])})
typs[40] = types.Runetype
typs[41] = types.NewSlice(typs[40])
typs[42] = functype(nil, []*Node{anonfield(typs[25]), anonfield(typs[41])}, []*Node{anonfield(typs[21])})
typs[43] = functype(nil, []*Node{anonfield(typs[25]), anonfield(typs[21])}, []*Node{anonfield(typs[37])})
typs[44] = types.NewArray(typs[40], 32)
typs[45] = types.NewPtr(typs[44])
typs[46] = functype(nil, []*Node{anonfield(typs[45]), anonfield(typs[21])}, []*Node{anonfield(typs[41])})
typs[47] = functype(nil, []*Node{anonfield(typs[21]), anonfield(typs[32])}, []*Node{anonfield(typs[40]), anonfield(typs[32])})
typs[48] = types.Types[TUINTPTR]
typs[49] = functype(nil, []*Node{anonfield(typs[2]), anonfield(typs[2]), anonfield(typs[48])}, []*Node{anonfield(typs[32])})
typs[50] = functype(nil, []*Node{anonfield(typs[2]), anonfield(typs[2])}, []*Node{anonfield(typs[32])})
typs[51] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[2])}, []*Node{anonfield(typs[2])})
typs[52] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[3])}, []*Node{anonfield(typs[2])})
typs[53] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[2])}, []*Node{anonfield(typs[2]), anonfield(typs[11])})
typs[54] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[1]), anonfield(typs[1])}, nil)
typs[55] = functype(nil, []*Node{anonfield(typs[1])}, nil)
typs[56] = types.NewPtr(typs[48])
typs[57] = types.Types[TUNSAFEPTR]
typs[58] = functype(nil, []*Node{anonfield(typs[56]), anonfield(typs[57]), anonfield(typs[57])}, []*Node{anonfield(typs[11])})
typs[59] = types.Types[TUINT32]
typs[60] = functype(nil, nil, []*Node{anonfield(typs[59])})
typs[61] = types.NewMap(typs[2], typs[2])
typs[62] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[15]), anonfield(typs[3])}, []*Node{anonfield(typs[61])})
typs[63] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[32]), anonfield(typs[3])}, []*Node{anonfield(typs[61])})
typs[64] = functype(nil, nil, []*Node{anonfield(typs[61])})
typs[65] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[61]), anonfield(typs[3])}, []*Node{anonfield(typs[3])})
typs[66] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[61]), anonfield(typs[2])}, []*Node{anonfield(typs[3])})
typs[67] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[61]), anonfield(typs[3]), anonfield(typs[1])}, []*Node{anonfield(typs[3])})
typs[68] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[61]), anonfield(typs[3])}, []*Node{anonfield(typs[3]), anonfield(typs[11])})
typs[69] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[61]), anonfield(typs[2])}, []*Node{anonfield(typs[3]), anonfield(typs[11])})
typs[70] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[61]), anonfield(typs[3]), anonfield(typs[1])}, []*Node{anonfield(typs[3]), anonfield(typs[11])})
typs[71] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[61]), anonfield(typs[3])}, nil)
typs[72] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[61]), anonfield(typs[2])}, nil)
typs[73] = functype(nil, []*Node{anonfield(typs[3])}, nil)
typs[74] = types.NewChan(typs[2], types.Cboth)
typs[75] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[15])}, []*Node{anonfield(typs[74])})
typs[76] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[32])}, []*Node{anonfield(typs[74])})
typs[77] = types.NewChan(typs[2], types.Crecv)
typs[78] = functype(nil, []*Node{anonfield(typs[77]), anonfield(typs[3])}, nil)
typs[79] = functype(nil, []*Node{anonfield(typs[77]), anonfield(typs[3])}, []*Node{anonfield(typs[11])})
typs[80] = types.NewChan(typs[2], types.Csend)
typs[81] = functype(nil, []*Node{anonfield(typs[80]), anonfield(typs[3])}, nil)
typs[82] = types.NewArray(typs[0], 3)
typs[83] = tostruct([]*Node{namedfield("enabled", typs[11]), namedfield("pad", typs[82]), namedfield("needed", typs[11]), namedfield("cgo", typs[11]), namedfield("alignme", typs[17])})
typs[84] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[3]), anonfield(typs[3])}, nil)
typs[85] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[3])}, nil)
typs[86] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[2]), anonfield(typs[2])}, []*Node{anonfield(typs[32])})
typs[87] = functype(nil, []*Node{anonfield(typs[80]), anonfield(typs[3])}, []*Node{anonfield(typs[11])})
typs[88] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[77])}, []*Node{anonfield(typs[11])})
typs[89] = types.NewPtr(typs[11])
typs[90] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[89]), anonfield(typs[77])}, []*Node{anonfield(typs[11])})
typs[91] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[15]), anonfield(typs[8])}, nil)
typs[92] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[80]), anonfield(typs[3])}, nil)
typs[93] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[77]), anonfield(typs[3]), anonfield(typs[89])}, nil)
typs[94] = functype(nil, []*Node{anonfield(typs[1])}, []*Node{anonfield(typs[32])})
typs[95] = types.NewSlice(typs[2])
typs[96] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[32]), anonfield(typs[32])}, []*Node{anonfield(typs[95])})
typs[97] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[15]), anonfield(typs[15])}, []*Node{anonfield(typs[95])})
typs[98] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[95]), anonfield(typs[32])}, []*Node{anonfield(typs[95])})
typs[99] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[3]), anonfield(typs[48])}, nil)
typs[100] = functype(nil, []*Node{anonfield(typs[57]), anonfield(typs[48])}, nil)
typs[101] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[3]), anonfield(typs[48])}, []*Node{anonfield(typs[11])})
typs[102] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[3])}, []*Node{anonfield(typs[11])})
typs[103] = functype(nil, []*Node{anonfield(typs[15]), anonfield(typs[15])}, []*Node{anonfield(typs[15])})
typs[104] = functype(nil, []*Node{anonfield(typs[17]), anonfield(typs[17])}, []*Node{anonfield(typs[17])})
typs[105] = functype(nil, []*Node{anonfield(typs[13])}, []*Node{anonfield(typs[15])})
typs[106] = functype(nil, []*Node{anonfield(typs[13])}, []*Node{anonfield(typs[17])})
typs[107] = functype(nil, []*Node{anonfield(typs[13])}, []*Node{anonfield(typs[59])})
typs[108] = functype(nil, []*Node{anonfield(typs[15])}, []*Node{anonfield(typs[13])})
typs[109] = functype(nil, []*Node{anonfield(typs[17])}, []*Node{anonfield(typs[13])})
typs[110] = functype(nil, []*Node{anonfield(typs[59])}, []*Node{anonfield(typs[13])})
typs[111] = functype(nil, []*Node{anonfield(typs[19]), anonfield(typs[19])}, []*Node{anonfield(typs[19])})
typs[112] = functype(nil, []*Node{anonfield(typs[48])}, nil)
typs[113] = functype(nil, []*Node{anonfield(typs[48]), anonfield(typs[48])}, nil)
typs[8] = types.Types[TUINTPTR]
typs[9] = functype(nil, []*Node{anonfield(typs[8])}, []*Node{anonfield(typs[6])})
typs[10] = types.Types[TBOOL]
typs[11] = functype(nil, []*Node{anonfield(typs[10])}, nil)
typs[12] = types.Types[TFLOAT64]
typs[13] = functype(nil, []*Node{anonfield(typs[12])}, nil)
typs[14] = types.Types[TINT64]
typs[15] = functype(nil, []*Node{anonfield(typs[14])}, nil)
typs[16] = types.Types[TUINT64]
typs[17] = functype(nil, []*Node{anonfield(typs[16])}, nil)
typs[18] = types.Types[TCOMPLEX128]
typs[19] = functype(nil, []*Node{anonfield(typs[18])}, nil)
typs[20] = types.Types[TSTRING]
typs[21] = functype(nil, []*Node{anonfield(typs[20])}, nil)
typs[22] = functype(nil, []*Node{anonfield(typs[2])}, nil)
typs[23] = types.NewArray(typs[0], 32)
typs[24] = types.NewPtr(typs[23])
typs[25] = functype(nil, []*Node{anonfield(typs[24]), anonfield(typs[20]), anonfield(typs[20])}, []*Node{anonfield(typs[20])})
typs[26] = functype(nil, []*Node{anonfield(typs[24]), anonfield(typs[20]), anonfield(typs[20]), anonfield(typs[20])}, []*Node{anonfield(typs[20])})
typs[27] = functype(nil, []*Node{anonfield(typs[24]), anonfield(typs[20]), anonfield(typs[20]), anonfield(typs[20]), anonfield(typs[20])}, []*Node{anonfield(typs[20])})
typs[28] = functype(nil, []*Node{anonfield(typs[24]), anonfield(typs[20]), anonfield(typs[20]), anonfield(typs[20]), anonfield(typs[20]), anonfield(typs[20])}, []*Node{anonfield(typs[20])})
typs[29] = types.NewSlice(typs[20])
typs[30] = functype(nil, []*Node{anonfield(typs[24]), anonfield(typs[29])}, []*Node{anonfield(typs[20])})
typs[31] = types.Types[TINT]
typs[32] = functype(nil, []*Node{anonfield(typs[20]), anonfield(typs[20])}, []*Node{anonfield(typs[31])})
typs[33] = types.NewArray(typs[0], 4)
typs[34] = types.NewPtr(typs[33])
typs[35] = functype(nil, []*Node{anonfield(typs[34]), anonfield(typs[14])}, []*Node{anonfield(typs[20])})
typs[36] = types.NewSlice(typs[0])
typs[37] = functype(nil, []*Node{anonfield(typs[24]), anonfield(typs[36])}, []*Node{anonfield(typs[20])})
typs[38] = functype(nil, []*Node{anonfield(typs[36])}, []*Node{anonfield(typs[20])})
typs[39] = types.Runetype
typs[40] = types.NewSlice(typs[39])
typs[41] = functype(nil, []*Node{anonfield(typs[24]), anonfield(typs[40])}, []*Node{anonfield(typs[20])})
typs[42] = functype(nil, []*Node{anonfield(typs[24]), anonfield(typs[20])}, []*Node{anonfield(typs[36])})
typs[43] = types.NewArray(typs[39], 32)
typs[44] = types.NewPtr(typs[43])
typs[45] = functype(nil, []*Node{anonfield(typs[44]), anonfield(typs[20])}, []*Node{anonfield(typs[40])})
typs[46] = functype(nil, []*Node{anonfield(typs[20]), anonfield(typs[31])}, []*Node{anonfield(typs[39]), anonfield(typs[31])})
typs[47] = functype(nil, []*Node{anonfield(typs[2]), anonfield(typs[2]), anonfield(typs[8])}, []*Node{anonfield(typs[31])})
typs[48] = functype(nil, []*Node{anonfield(typs[2]), anonfield(typs[2])}, []*Node{anonfield(typs[31])})
typs[49] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[2])}, []*Node{anonfield(typs[2])})
typs[50] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[3])}, []*Node{anonfield(typs[2])})
typs[51] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[2])}, []*Node{anonfield(typs[2]), anonfield(typs[10])})
typs[52] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[1]), anonfield(typs[1])}, nil)
typs[53] = functype(nil, []*Node{anonfield(typs[1])}, nil)
typs[54] = types.NewPtr(typs[8])
typs[55] = types.Types[TUNSAFEPTR]
typs[56] = functype(nil, []*Node{anonfield(typs[54]), anonfield(typs[55]), anonfield(typs[55])}, []*Node{anonfield(typs[10])})
typs[57] = types.Types[TUINT32]
typs[58] = functype(nil, nil, []*Node{anonfield(typs[57])})
typs[59] = types.NewMap(typs[2], typs[2])
typs[60] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[14]), anonfield(typs[3])}, []*Node{anonfield(typs[59])})
typs[61] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[31]), anonfield(typs[3])}, []*Node{anonfield(typs[59])})
typs[62] = functype(nil, nil, []*Node{anonfield(typs[59])})
typs[63] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[59]), anonfield(typs[3])}, []*Node{anonfield(typs[3])})
typs[64] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[59]), anonfield(typs[2])}, []*Node{anonfield(typs[3])})
typs[65] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[59]), anonfield(typs[3]), anonfield(typs[1])}, []*Node{anonfield(typs[3])})
typs[66] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[59]), anonfield(typs[3])}, []*Node{anonfield(typs[3]), anonfield(typs[10])})
typs[67] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[59]), anonfield(typs[2])}, []*Node{anonfield(typs[3]), anonfield(typs[10])})
typs[68] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[59]), anonfield(typs[3]), anonfield(typs[1])}, []*Node{anonfield(typs[3]), anonfield(typs[10])})
typs[69] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[59]), anonfield(typs[3])}, nil)
typs[70] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[59]), anonfield(typs[2])}, nil)
typs[71] = functype(nil, []*Node{anonfield(typs[3])}, nil)
typs[72] = types.NewChan(typs[2], types.Cboth)
typs[73] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[14])}, []*Node{anonfield(typs[72])})
typs[74] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[31])}, []*Node{anonfield(typs[72])})
typs[75] = types.NewChan(typs[2], types.Crecv)
typs[76] = functype(nil, []*Node{anonfield(typs[75]), anonfield(typs[3])}, nil)
typs[77] = functype(nil, []*Node{anonfield(typs[75]), anonfield(typs[3])}, []*Node{anonfield(typs[10])})
typs[78] = types.NewChan(typs[2], types.Csend)
typs[79] = functype(nil, []*Node{anonfield(typs[78]), anonfield(typs[3])}, nil)
typs[80] = types.NewArray(typs[0], 3)
typs[81] = tostruct([]*Node{namedfield("enabled", typs[10]), namedfield("pad", typs[80]), namedfield("needed", typs[10]), namedfield("cgo", typs[10]), namedfield("alignme", typs[16])})
typs[82] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[3]), anonfield(typs[3])}, nil)
typs[83] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[3])}, nil)
typs[84] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[2]), anonfield(typs[2])}, []*Node{anonfield(typs[31])})
typs[85] = functype(nil, []*Node{anonfield(typs[78]), anonfield(typs[3])}, []*Node{anonfield(typs[10])})
typs[86] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[75])}, []*Node{anonfield(typs[10])})
typs[87] = types.NewPtr(typs[10])
typs[88] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[87]), anonfield(typs[75])}, []*Node{anonfield(typs[10])})
typs[89] = types.Types[TINT32]
typs[90] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[14]), anonfield(typs[89])}, nil)
typs[91] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[78]), anonfield(typs[3])}, nil)
typs[92] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[75]), anonfield(typs[3]), anonfield(typs[87])}, nil)
typs[93] = functype(nil, []*Node{anonfield(typs[1])}, []*Node{anonfield(typs[31])})
typs[94] = types.NewSlice(typs[2])
typs[95] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[31]), anonfield(typs[31])}, []*Node{anonfield(typs[94])})
typs[96] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[14]), anonfield(typs[14])}, []*Node{anonfield(typs[94])})
typs[97] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[94]), anonfield(typs[31])}, []*Node{anonfield(typs[94])})
typs[98] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[3]), anonfield(typs[8])}, nil)
typs[99] = functype(nil, []*Node{anonfield(typs[55]), anonfield(typs[8])}, nil)
typs[100] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[3]), anonfield(typs[8])}, []*Node{anonfield(typs[10])})
typs[101] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[3])}, []*Node{anonfield(typs[10])})
typs[102] = functype(nil, []*Node{anonfield(typs[14]), anonfield(typs[14])}, []*Node{anonfield(typs[14])})
typs[103] = functype(nil, []*Node{anonfield(typs[16]), anonfield(typs[16])}, []*Node{anonfield(typs[16])})
typs[104] = functype(nil, []*Node{anonfield(typs[12])}, []*Node{anonfield(typs[14])})
typs[105] = functype(nil, []*Node{anonfield(typs[12])}, []*Node{anonfield(typs[16])})
typs[106] = functype(nil, []*Node{anonfield(typs[12])}, []*Node{anonfield(typs[57])})
typs[107] = functype(nil, []*Node{anonfield(typs[14])}, []*Node{anonfield(typs[12])})
typs[108] = functype(nil, []*Node{anonfield(typs[16])}, []*Node{anonfield(typs[12])})
typs[109] = functype(nil, []*Node{anonfield(typs[57])}, []*Node{anonfield(typs[12])})
typs[110] = functype(nil, []*Node{anonfield(typs[18]), anonfield(typs[18])}, []*Node{anonfield(typs[18])})
typs[111] = functype(nil, []*Node{anonfield(typs[8])}, nil)
typs[112] = functype(nil, []*Node{anonfield(typs[8]), anonfield(typs[8])}, nil)
return typs[:]
}

View File

@ -22,7 +22,7 @@ func throwinit()
func panicwrap()
func gopanic(interface{})
func gorecover(*int32) interface{}
func gorecover(uintptr) interface{}
func goschedguarded()
func printbool(bool)

View File

@ -2025,10 +2025,6 @@ func addrescapes(n *Node) {
// Nothing to do.
case ONAME:
if n == nodfp {
break
}
// if this is a tmpname (PAUTO), it was tagged by tmpname as not escaping.
// on PPARAM it means something different.
if n.Class() == PAUTO && n.Esc == EscNever {

View File

@ -232,8 +232,6 @@ var writearchive bool
var Nacl bool
var nodfp *Node
var disable_checknil int
var autogeneratedPos src.XPos

View File

@ -131,12 +131,7 @@ func (s *ssafn) AllocFrame(f *ssa.Func) {
for _, v := range b.Values {
if n, ok := v.Aux.(*Node); ok {
switch n.Class() {
case PPARAM, PPARAMOUT:
// Don't modify nodfp; it is a global.
if n != nodfp {
n.Name.SetUsed(true)
}
case PAUTO:
case PAUTO, PPARAM, PPARAMOUT:
n.Name.SetUsed(true)
}
}

View File

@ -64,21 +64,11 @@ func instrument(fn *Node) {
}
if flag_race {
// nodpc is the PC of the caller as extracted by
// getcallerpc. We use -widthptr(FP) for x86.
// BUG: this will not work on arm.
nodpc := *nodfp
nodpc.Type = types.Types[TUINTPTR]
nodpc.Xoffset = int64(-Widthptr)
savedLineno := lineno
lno := lineno
lineno = src.NoXPos
nd := mkcall("racefuncenter", nil, nil, &nodpc)
fn.Func.Enter.Prepend(nd)
nd = mkcall("racefuncexit", nil, nil)
fn.Func.Exit.Append(nd)
fn.Func.Dcl = append(fn.Func.Dcl, &nodpc)
lineno = savedLineno
fn.Func.Enter.Prepend(mkcall("racefuncenter", nil, nil, callerPC))
fn.Func.Exit.Append(mkcall("racefuncexit", nil, nil))
lineno = lno
}
if Debug['W'] != 0 {

View File

@ -1471,6 +1471,12 @@ func (s *state) expr(n *Node) *ssa.Value {
sym := funcsym(n.Sym).Linksym()
return s.entryNewValue1A(ssa.OpAddr, types.NewPtr(n.Type), sym, s.sb)
}
switch n {
case callerSP:
return s.newValue0(ssa.OpGetCallerSP, n.Type)
case callerPC:
return s.newValue0(ssa.OpGetCallerPC, n.Type)
}
if s.canSSA(n) {
return s.variable(n, n.Type)
}
@ -3468,10 +3474,6 @@ func (s *state) addr(n *Node, bounded bool) *ssa.Value {
if v != nil {
return v
}
if n == nodfp {
// Special arg that points to the frame pointer (Used by ORECOVER).
return s.entryNewValue1A(ssa.OpAddr, t, n, s.sp)
}
s.Fatalf("addr of undeclared ONAME %v. declared: %v", n, s.decladdrs)
return nil
case PAUTO:

View File

@ -466,8 +466,19 @@ func finishUniverse() {
s1.Block = s.Block
}
nodfp = newname(lookup(".fp"))
nodfp.Type = types.Types[TINT32]
nodfp.SetClass(PPARAM)
nodfp.Name.SetUsed(true)
callerSP = newname(lookup(".sp"))
callerSP.Type = types.Types[TUINTPTR]
callerSP.SetClass(PPARAM)
callerSP.Name.SetUsed(true)
callerPC = newname(lookup(".pc"))
callerPC.Type = types.Types[TUINTPTR]
callerPC.SetClass(PPARAM)
callerPC.Name.SetUsed(true)
}
var (
// Pseudo variables that represent the caller's SP and PC, respectively.
callerSP *Node
callerPC *Node
)

View File

@ -604,7 +604,7 @@ opswitch:
n = mkcall("gopanic", nil, init, n.Left)
case ORECOVER:
n = mkcall("gorecover", n.Type, init, nod(OADDR, nodfp, nil))
n = mkcall("gorecover", n.Type, init, callerSP)
case OCLOSUREVAR, OCFUNC:
n.SetAddable(true)