1
0
mirror of https://github.com/golang/go synced 2024-11-26 16:46:58 -07:00

[dev.typeparams] cmd/compile: add ORECOVERFP, OGETCALLER{PC,SP} ops

This CLs adds new frontend ops that will be used in the next CL. Split
out separately so generated code is less distracting in the main CL.

Change-Id: I66125e0ec2217bfa05f7b0ea0bc99ada13f563f7
Reviewed-on: https://go-review.googlesource.com/c/go/+/330191
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
Matthew Dempsky 2021-06-22 13:45:51 -07:00
parent 70f4ab6565
commit 9be8303df9
2 changed files with 64 additions and 58 deletions

View File

@ -237,6 +237,7 @@ const (
OSLICE3ARR // X[Low : High : Max] (X is pointer to array) OSLICE3ARR // X[Low : High : Max] (X is pointer to array)
OSLICEHEADER // sliceheader{Ptr, Len, Cap} (Ptr is unsafe.Pointer, Len is length, Cap is capacity) OSLICEHEADER // sliceheader{Ptr, Len, Cap} (Ptr is unsafe.Pointer, Len is length, Cap is capacity)
ORECOVER // recover() ORECOVER // recover()
ORECOVERFP // recover(Args) w/ explicit FP argument
ORECV // <-X ORECV // <-X
ORUNESTR // Type(X) (Type is string, X is rune) ORUNESTR // Type(X) (Type is string, X is rune)
OSELRECV2 // like OAS2: Lhs = Rhs where len(Lhs)=2, len(Rhs)=1, Rhs[0].Op = ORECV (appears as .Var of OCASE) OSELRECV2 // like OAS2: Lhs = Rhs where len(Lhs)=2, len(Rhs)=1, Rhs[0].Op = ORECV (appears as .Var of OCASE)
@ -320,6 +321,8 @@ const (
// arch-specific opcodes // arch-specific opcodes
OTAILCALL // tail call to another function OTAILCALL // tail call to another function
OGETG // runtime.getg() (read g pointer) OGETG // runtime.getg() (read g pointer)
OGETCALLERPC // runtime.getcallerpc() (continuation PC in caller frame)
OGETCALLERSP // runtime.getcallersp() (stack pointer in caller frame)
OEND OEND
) )

View File

@ -109,65 +109,68 @@ func _() {
_ = x[OSLICE3ARR-98] _ = x[OSLICE3ARR-98]
_ = x[OSLICEHEADER-99] _ = x[OSLICEHEADER-99]
_ = x[ORECOVER-100] _ = x[ORECOVER-100]
_ = x[ORECV-101] _ = x[ORECOVERFP-101]
_ = x[ORUNESTR-102] _ = x[ORECV-102]
_ = x[OSELRECV2-103] _ = x[ORUNESTR-103]
_ = x[OIOTA-104] _ = x[OSELRECV2-104]
_ = x[OREAL-105] _ = x[OIOTA-105]
_ = x[OIMAG-106] _ = x[OREAL-106]
_ = x[OCOMPLEX-107] _ = x[OIMAG-107]
_ = x[OALIGNOF-108] _ = x[OCOMPLEX-108]
_ = x[OOFFSETOF-109] _ = x[OALIGNOF-109]
_ = x[OSIZEOF-110] _ = x[OOFFSETOF-110]
_ = x[OUNSAFEADD-111] _ = x[OSIZEOF-111]
_ = x[OUNSAFESLICE-112] _ = x[OUNSAFEADD-112]
_ = x[OMETHEXPR-113] _ = x[OUNSAFESLICE-113]
_ = x[OBLOCK-114] _ = x[OMETHEXPR-114]
_ = x[OBREAK-115] _ = x[OBLOCK-115]
_ = x[OCASE-116] _ = x[OBREAK-116]
_ = x[OCONTINUE-117] _ = x[OCASE-117]
_ = x[ODEFER-118] _ = x[OCONTINUE-118]
_ = x[OFALL-119] _ = x[ODEFER-119]
_ = x[OFOR-120] _ = x[OFALL-120]
_ = x[OFORUNTIL-121] _ = x[OFOR-121]
_ = x[OGOTO-122] _ = x[OFORUNTIL-122]
_ = x[OIF-123] _ = x[OGOTO-123]
_ = x[OLABEL-124] _ = x[OIF-124]
_ = x[OGO-125] _ = x[OLABEL-125]
_ = x[ORANGE-126] _ = x[OGO-126]
_ = x[ORETURN-127] _ = x[ORANGE-127]
_ = x[OSELECT-128] _ = x[ORETURN-128]
_ = x[OSWITCH-129] _ = x[OSELECT-129]
_ = x[OTYPESW-130] _ = x[OSWITCH-130]
_ = x[OFUNCINST-131] _ = x[OTYPESW-131]
_ = x[OTCHAN-132] _ = x[OFUNCINST-132]
_ = x[OTMAP-133] _ = x[OTCHAN-133]
_ = x[OTSTRUCT-134] _ = x[OTMAP-134]
_ = x[OTINTER-135] _ = x[OTSTRUCT-135]
_ = x[OTFUNC-136] _ = x[OTINTER-136]
_ = x[OTARRAY-137] _ = x[OTFUNC-137]
_ = x[OTSLICE-138] _ = x[OTARRAY-138]
_ = x[OINLCALL-139] _ = x[OTSLICE-139]
_ = x[OEFACE-140] _ = x[OINLCALL-140]
_ = x[OITAB-141] _ = x[OEFACE-141]
_ = x[OIDATA-142] _ = x[OITAB-142]
_ = x[OSPTR-143] _ = x[OIDATA-143]
_ = x[OCFUNC-144] _ = x[OSPTR-144]
_ = x[OCHECKNIL-145] _ = x[OCFUNC-145]
_ = x[OVARDEF-146] _ = x[OCHECKNIL-146]
_ = x[OVARKILL-147] _ = x[OVARDEF-147]
_ = x[OVARLIVE-148] _ = x[OVARKILL-148]
_ = x[ORESULT-149] _ = x[OVARLIVE-149]
_ = x[OINLMARK-150] _ = x[ORESULT-150]
_ = x[OLINKSYMOFFSET-151] _ = x[OINLMARK-151]
_ = x[OTAILCALL-152] _ = x[OLINKSYMOFFSET-152]
_ = x[OGETG-153] _ = x[OTAILCALL-153]
_ = x[OEND-154] _ = x[OGETG-154]
_ = x[OGETCALLERPC-155]
_ = x[OGETCALLERSP-156]
_ = x[OEND-157]
} }
const _Op_name = "XXXNAMENONAMETYPEPACKLITERALNILADDSUBORXORADDSTRADDRANDANDAPPENDBYTES2STRBYTES2STRTMPRUNES2STRSTR2BYTESSTR2BYTESTMPSTR2RUNESSLICE2ARRPTRASAS2AS2DOTTYPEAS2FUNCAS2MAPRAS2RECVASOPCALLCALLFUNCCALLMETHCALLINTERCALLPARTCAPCLOSECLOSURECOMPLITMAPLITSTRUCTLITARRAYLITSLICELITPTRLITCONVCONVIFACECONVNOPCOPYDCLDCLFUNCDCLCONSTDCLTYPEDELETEDOTDOTPTRDOTMETHDOTINTERXDOTDOTTYPEDOTTYPE2EQNELTLEGEGTDEREFINDEXINDEXMAPKEYSTRUCTKEYLENMAKEMAKECHANMAKEMAPMAKESLICEMAKESLICECOPYMULDIVMODLSHRSHANDANDNOTNEWNOTBITNOTPLUSNEGORORPANICPRINTPRINTNPARENSENDSLICESLICEARRSLICESTRSLICE3SLICE3ARRSLICEHEADERRECOVERRECVRUNESTRSELRECV2IOTAREALIMAGCOMPLEXALIGNOFOFFSETOFSIZEOFUNSAFEADDUNSAFESLICEMETHEXPRBLOCKBREAKCASECONTINUEDEFERFALLFORFORUNTILGOTOIFLABELGORANGERETURNSELECTSWITCHTYPESWFUNCINSTTCHANTMAPTSTRUCTTINTERTFUNCTARRAYTSLICEINLCALLEFACEITABIDATASPTRCFUNCCHECKNILVARDEFVARKILLVARLIVERESULTINLMARKLINKSYMOFFSETTAILCALLGETGEND" const _Op_name = "XXXNAMENONAMETYPEPACKLITERALNILADDSUBORXORADDSTRADDRANDANDAPPENDBYTES2STRBYTES2STRTMPRUNES2STRSTR2BYTESSTR2BYTESTMPSTR2RUNESSLICE2ARRPTRASAS2AS2DOTTYPEAS2FUNCAS2MAPRAS2RECVASOPCALLCALLFUNCCALLMETHCALLINTERCALLPARTCAPCLOSECLOSURECOMPLITMAPLITSTRUCTLITARRAYLITSLICELITPTRLITCONVCONVIFACECONVNOPCOPYDCLDCLFUNCDCLCONSTDCLTYPEDELETEDOTDOTPTRDOTMETHDOTINTERXDOTDOTTYPEDOTTYPE2EQNELTLEGEGTDEREFINDEXINDEXMAPKEYSTRUCTKEYLENMAKEMAKECHANMAKEMAPMAKESLICEMAKESLICECOPYMULDIVMODLSHRSHANDANDNOTNEWNOTBITNOTPLUSNEGORORPANICPRINTPRINTNPARENSENDSLICESLICEARRSLICESTRSLICE3SLICE3ARRSLICEHEADERRECOVERRECOVERFPRECVRUNESTRSELRECV2IOTAREALIMAGCOMPLEXALIGNOFOFFSETOFSIZEOFUNSAFEADDUNSAFESLICEMETHEXPRBLOCKBREAKCASECONTINUEDEFERFALLFORFORUNTILGOTOIFLABELGORANGERETURNSELECTSWITCHTYPESWFUNCINSTTCHANTMAPTSTRUCTTINTERTFUNCTARRAYTSLICEINLCALLEFACEITABIDATASPTRCFUNCCHECKNILVARDEFVARKILLVARLIVERESULTINLMARKLINKSYMOFFSETTAILCALLGETGGETCALLERPCGETCALLERSPEND"
var _Op_index = [...]uint16{0, 3, 7, 13, 17, 21, 28, 31, 34, 37, 39, 42, 48, 52, 58, 64, 73, 85, 94, 103, 115, 124, 136, 138, 141, 151, 158, 165, 172, 176, 180, 188, 196, 205, 213, 216, 221, 228, 235, 241, 250, 258, 266, 272, 276, 285, 292, 296, 299, 306, 314, 321, 327, 330, 336, 343, 351, 355, 362, 370, 372, 374, 376, 378, 380, 382, 387, 392, 400, 403, 412, 415, 419, 427, 434, 443, 456, 459, 462, 465, 468, 471, 474, 480, 483, 486, 492, 496, 499, 503, 508, 513, 519, 524, 528, 533, 541, 549, 555, 564, 575, 582, 586, 593, 601, 605, 609, 613, 620, 627, 635, 641, 650, 661, 669, 674, 679, 683, 691, 696, 700, 703, 711, 715, 717, 722, 724, 729, 735, 741, 747, 753, 761, 766, 770, 777, 783, 788, 794, 800, 807, 812, 816, 821, 825, 830, 838, 844, 851, 858, 864, 871, 884, 892, 896, 899} var _Op_index = [...]uint16{0, 3, 7, 13, 17, 21, 28, 31, 34, 37, 39, 42, 48, 52, 58, 64, 73, 85, 94, 103, 115, 124, 136, 138, 141, 151, 158, 165, 172, 176, 180, 188, 196, 205, 213, 216, 221, 228, 235, 241, 250, 258, 266, 272, 276, 285, 292, 296, 299, 306, 314, 321, 327, 330, 336, 343, 351, 355, 362, 370, 372, 374, 376, 378, 380, 382, 387, 392, 400, 403, 412, 415, 419, 427, 434, 443, 456, 459, 462, 465, 468, 471, 474, 480, 483, 486, 492, 496, 499, 503, 508, 513, 519, 524, 528, 533, 541, 549, 555, 564, 575, 582, 591, 595, 602, 610, 614, 618, 622, 629, 636, 644, 650, 659, 670, 678, 683, 688, 692, 700, 705, 709, 712, 720, 724, 726, 731, 733, 738, 744, 750, 756, 762, 770, 775, 779, 786, 792, 797, 803, 809, 816, 821, 825, 830, 834, 839, 847, 853, 860, 867, 873, 880, 893, 901, 905, 916, 927, 930}
func (i Op) String() string { func (i Op) String() string {
if i >= Op(len(_Op_index)-1) { if i >= Op(len(_Op_index)-1) {