mirror of
https://github.com/golang/go.git
synced 2026-01-30 15:42:04 +03:00
Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
564c76a268 | ||
|
|
b620f6fde5 | ||
|
|
e577ba98d8 | ||
|
|
229247d33b | ||
|
|
c5125098b2 | ||
|
|
adba22a9ae | ||
|
|
fd85ff5ee0 | ||
|
|
8e804f19b6 | ||
|
|
6717d27be2 | ||
|
|
9c41c1d8dc | ||
|
|
2e08d80732 | ||
|
|
76a6adcf3a | ||
|
|
0e9f7ac7ca | ||
|
|
e6036e7da5 | ||
|
|
c54e36905b | ||
|
|
329317472f | ||
|
|
99f8de7339 | ||
|
|
3dcb516d42 | ||
|
|
20a838ab94 | ||
|
|
c49910abc3 | ||
|
|
6a7f08952e | ||
|
|
8ced42e78b | ||
|
|
f63e55b541 | ||
|
|
17acbdb357 | ||
|
|
babeec29aa | ||
|
|
b4dca6416f | ||
|
|
f5293d77a9 | ||
|
|
51534757da | ||
|
|
d898c7b544 | ||
|
|
29ccdfc853 | ||
|
|
3f0cdedfdd | ||
|
|
a068054af1 | ||
|
|
331b8661a0 |
14
.gitattributes
vendored
14
.gitattributes
vendored
@@ -1,16 +1,10 @@
|
||||
# Treat all files in the Go repo as binary, with no git magic updating
|
||||
# line endings. This produces predictable results in different environments.
|
||||
#
|
||||
# Windows users contributing to Go will need to use a modern version
|
||||
# of git and editors capable of LF line endings.
|
||||
#
|
||||
# Windows .bat files are known to have multiple bugs when run with LF
|
||||
# endings, and so they are checked in with CRLF endings, with a test
|
||||
# in test/winbatch.go to catch problems. (See golang.org/issue/37791.)
|
||||
# line endings. Windows users contributing to Go will need to use a
|
||||
# modern version of git and editors capable of LF line endings.
|
||||
#
|
||||
# We'll prevent accidental CRLF line endings from entering the repo
|
||||
# via the git-codereview gofmt checks and tests.
|
||||
# via the git-review gofmt checks.
|
||||
#
|
||||
# See golang.org/issue/9281.
|
||||
# See golang.org/issue/9281
|
||||
|
||||
* -text
|
||||
|
||||
10
AUTHORS
10
AUTHORS
@@ -96,7 +96,6 @@ Alexei Sholik <alcosholik@gmail.com>
|
||||
Alexey Borzenkov <snaury@gmail.com>
|
||||
Alexey Neganov <neganovalexey@gmail.com>
|
||||
Alexey Palazhchenko <alexey.palazhchenko@gmail.com>
|
||||
Alexey Semenyuk <alexsemenyuk88@gmail.com>
|
||||
Alexis Hildebrandt <surryhill@gmail.com>
|
||||
Ali Rizvi-Santiago <arizvisa@gmail.com>
|
||||
Aliaksandr Valialkin <valyala@gmail.com>
|
||||
@@ -145,7 +144,6 @@ Andy Davis <andy@bigandian.com>
|
||||
Andy Finkenstadt <afinkenstadt@zynga.com>
|
||||
Andy Lindeman <andy@lindeman.io>
|
||||
Andy Maloney <asmaloney@gmail.com>
|
||||
Andy Pan <panjf2000@gmail.com>
|
||||
Andy Walker <walkeraj@gmail.com>
|
||||
Anfernee Yongkun Gui <anfernee.gui@gmail.com>
|
||||
Angelo Bulfone <mbulfone@gmail.com>
|
||||
@@ -563,7 +561,6 @@ Hitoshi Mitake <mitake.hitoshi@gmail.com>
|
||||
Holden Huang <ttyh061@gmail.com>
|
||||
Hong Ruiqi <hongruiqi@gmail.com>
|
||||
Hongfei Tan <feilengcui008@gmail.com>
|
||||
Hootsuite Inc.
|
||||
Hsin-Ho Yeh <yhh92u@gmail.com>
|
||||
Hu Keping <hukeping@huawei.com>
|
||||
Hugues Bruant <hugues.bruant@gmail.com>
|
||||
@@ -935,7 +932,7 @@ Maya Rashish <maya@netbsd.org>
|
||||
Mayank Kumar <krmayankk@gmail.com>
|
||||
MediaMath, Inc
|
||||
Meir Fischer <meirfischer@gmail.com>
|
||||
Meng Zhuo <mengzhuo1203@gmail.com> <mzh@golangcn.org>
|
||||
Meng Zhuo <mengzhuo1203@gmail.com>
|
||||
Meteor Development Group
|
||||
Mhd Sulhan <m.shulhan@gmail.com>
|
||||
Micah Stetson <micah.stetson@gmail.com>
|
||||
@@ -1045,7 +1042,6 @@ Niels Widger <niels.widger@gmail.com>
|
||||
Nigel Kerr <nigel.kerr@gmail.com>
|
||||
Nik Nyby <nnyby@columbia.edu>
|
||||
Nikhil Benesch <nikhil.benesch@gmail.com>
|
||||
Nikita Gillmann <nikita@n0.is> <ng0@n0.is>
|
||||
Niklas Schnelle <niklas.schnelle@gmail.com>
|
||||
Niko Dziemba <niko@dziemba.com>
|
||||
Nikolay Turpitko <nikolay@turpitko.com>
|
||||
@@ -1144,11 +1140,9 @@ Pietro Gagliardi <pietro10@mac.com>
|
||||
Piyush Mishra <piyush@codeitout.com>
|
||||
Platform.sh
|
||||
Pontus Leitzler <leitzler@gmail.com>
|
||||
Prasanga Siripala <pj@pjebs.com.au>
|
||||
Prashant Varanasi <prashant@prashantv.com>
|
||||
Pravendra Singh <hackpravj@gmail.com>
|
||||
Preetam Jinka <pj@preet.am>
|
||||
Qais Patankar <qaisjp@gmail.com>
|
||||
Qiuxuan Zhu <ilsh1022@gmail.com>
|
||||
Qualcomm Data Center, Inc.
|
||||
Quan Tran <qeed.quan@gmail.com>
|
||||
@@ -1314,7 +1308,6 @@ Szabolcs Nagy <nsz@port70.net>
|
||||
Taavi Kivisik <taavi.kivisik@gmail.com>
|
||||
Tad Fisher <tadfisher@gmail.com>
|
||||
Tad Glines <tad.glines@gmail.com>
|
||||
Tailscale Inc.
|
||||
Taj Khattra <taj.khattra@gmail.com>
|
||||
Takayoshi Nishida <takayoshi.nishida@gmail.com>
|
||||
Takeshi YAMANASHI <9.nashi@gmail.com>
|
||||
@@ -1399,7 +1392,6 @@ Upthere, Inc.
|
||||
Uriel Mangado <uriel@berlinblue.org>
|
||||
Vadim Grek <vadimprog@gmail.com>
|
||||
Vadim Vygonets <unixdj@gmail.com>
|
||||
Vee Zhang <veezhang@126.com> <vveezhang@gmail.com>
|
||||
Vendasta
|
||||
Veselkov Konstantin <kostozyb@gmail.com>
|
||||
Victor Vrantchan <vrancean+github@gmail.com>
|
||||
|
||||
141
CONTRIBUTORS
141
CONTRIBUTORS
@@ -31,7 +31,6 @@ Aaron Cannon <cannona@fireantproductions.com>
|
||||
Aaron France <aaron.l.france@gmail.com>
|
||||
Aaron Jacobs <jacobsa@google.com>
|
||||
Aaron Kemp <kemp.aaron@gmail.com>
|
||||
Aaron Patterson <tenderlove@ruby-lang.org>
|
||||
Aaron Stein <aaronstein12@gmail.com>
|
||||
Aaron Torres <tcboox@gmail.com>
|
||||
Aaron Zinman <aaron@azinman.com>
|
||||
@@ -59,7 +58,6 @@ Adrian Hesketh <adrianhesketh@hushmail.com>
|
||||
Adrian Nos <nos.adrian@gmail.com>
|
||||
Adrian O'Grady <elpollouk@gmail.com>
|
||||
Adrien Bustany <adrien-xx-google@bustany.org>
|
||||
Adrien Delorme <adrien.delorme@icloud.com>
|
||||
Adrien Petel <peteladrien@gmail.com>
|
||||
Aécio Júnior <aeciodantasjunior@gmail.com>
|
||||
Aeneas Rekkas (arekkas) <aeneas@ory.am>
|
||||
@@ -116,7 +114,6 @@ Alex Zhirov <azhirov@google.com>
|
||||
Alexander Demakin <alexander.demakin@gmail.com>
|
||||
Alexander Döring <email@alexd.ch>
|
||||
Alexander F Rødseth <alexander.rodseth@appeartv.com>
|
||||
Alexander Greim <alexxx@iltempo.de>
|
||||
Alexander Guz <kalimatas@gmail.com>
|
||||
Alexander Kauer <alexander@affine.space>
|
||||
Alexander Kucherenko <alxkchr@gmail.com>
|
||||
@@ -125,7 +122,6 @@ Alexander Lourier <aml@rulezz.ru>
|
||||
Alexander Menzhinsky <amenzhinsky@gmail.com>
|
||||
Alexander Morozov <lk4d4math@gmail.com>
|
||||
Alexander Neumann <alexander@bumpern.de>
|
||||
Alexander Nohe <alex.nohe427@gmail.com>
|
||||
Alexander Orlov <alexander.orlov@loxal.net>
|
||||
Alexander Pantyukhin <apantykhin@gmail.com>
|
||||
Alexander Polcyn <apolcyn@google.com>
|
||||
@@ -149,11 +145,9 @@ Alexey Borzenkov <snaury@gmail.com>
|
||||
Alexey Naidonov <alexey.naidyonov@gmail.com>
|
||||
Alexey Neganov <neganovalexey@gmail.com>
|
||||
Alexey Palazhchenko <alexey.palazhchenko@gmail.com>
|
||||
Alexey Semenyuk <alexsemenyuk88@gmail.com>
|
||||
Alexis Hildebrandt <surryhill@gmail.com>
|
||||
Alexis Hunt <lexer@google.com>
|
||||
Alexis Imperial-Legrand <ail@google.com>
|
||||
Ali Farooq <ali.farooq0@pm.me>
|
||||
Ali Rizvi-Santiago <arizvisa@gmail.com>
|
||||
Aliaksandr Valialkin <valyala@gmail.com>
|
||||
Alif Rachmawadi <subosito@gmail.com>
|
||||
@@ -161,17 +155,14 @@ Allan Simon <allan.simon@supinfo.com>
|
||||
Allen Li <ayatane@google.com>
|
||||
Alok Menghrajani <alok.menghrajani@gmail.com>
|
||||
Aman Gupta <aman@tmm1.net>
|
||||
Amarjeet Anand <amarjeetanandsingh@gmail.com>
|
||||
Amir Mohammad Saied <amir@gluegadget.com>
|
||||
Amr Mohammed <merodiro@gmail.com>
|
||||
Amrut Joshi <amrut.joshi@gmail.com>
|
||||
An Long <aisk1988@gmail.com>
|
||||
An Xiao <hac@zju.edu.cn>
|
||||
Anand K. Mistry <anand@mistry.ninja>
|
||||
Anders Pearson <anders@columbia.edu>
|
||||
Anderson Queiroz <contato@andersonq.eti.br>
|
||||
André Carvalho <asantostc@gmail.com>
|
||||
André Martins <aanm90@gmail.com>
|
||||
Andre Nathan <andrenth@gmail.com>
|
||||
Andrea Nodari <andrea.nodari91@gmail.com>
|
||||
Andrea Spadaccini <spadaccio@google.com>
|
||||
@@ -195,11 +186,9 @@ Andrew Braunstein <awbraunstein@gmail.com>
|
||||
Andrew Bursavich <abursavich@gmail.com>
|
||||
Andrew Ekstedt <andrew.ekstedt@gmail.com>
|
||||
Andrew Etter <andrew.etter@gmail.com>
|
||||
Andrew G. Morgan <agm@google.com>
|
||||
Andrew Gerrand <adg@golang.org>
|
||||
Andrew Harding <andrew@spacemonkey.com>
|
||||
Andrew Jackura <ajackura@google.com>
|
||||
Andrew Louis <alouis@digitalocean.com>
|
||||
Andrew Lutomirski <andy@luto.us>
|
||||
Andrew Medvedev <andrew.y.medvedev@gmail.com>
|
||||
Andrew Pilloud <andrewpilloud@igneoussystems.com>
|
||||
@@ -227,9 +216,7 @@ Andy Davis <andy@bigandian.com>
|
||||
Andy Finkenstadt <afinkenstadt@zynga.com>
|
||||
Andy Lindeman <andy@lindeman.io>
|
||||
Andy Maloney <asmaloney@gmail.com>
|
||||
Andy Pan <panjf2000@gmail.com>
|
||||
Andy Walker <walkeraj@gmail.com>
|
||||
Andy Wang <cbeuw.andy@gmail.com>
|
||||
Andzej Maciusovic <andzej.maciusovic@gmail.com>
|
||||
Anfernee Yongkun Gui <anfernee.gui@gmail.com>
|
||||
Angelo Bulfone <mbulfone@gmail.com>
|
||||
@@ -237,7 +224,6 @@ Anh Hai Trinh <anh.hai.trinh@gmail.com>
|
||||
Anit Gandhi <anitgandhi@gmail.com>
|
||||
Ankit Goyal <ankit3goyal@gmail.com>
|
||||
Anmol Sethi <anmol@aubble.com>
|
||||
Annirudh Prasad <annirudh@wandb.com>
|
||||
Anschel Schaffer-Cohen <anschelsc@gmail.com>
|
||||
Anthony Alves <cvballa3g0@gmail.com>
|
||||
Anthony Canino <anthony.canino1@gmail.com>
|
||||
@@ -251,18 +237,15 @@ Anthony Woods <awoods@raintank.io>
|
||||
Antoine GIRARD <sapk@sapk.fr>
|
||||
Antoine Martin <antoine97.martin@gmail.com>
|
||||
Anton Gyllenberg <anton@iki.fi>
|
||||
Anton Kuklin <anton.a.kuklin@gmail.com>
|
||||
Antonin Amand <antonin.amand@gmail.com>
|
||||
Antonio Antelo <aantelov87@gmail.com>
|
||||
Antonio Bibiano <antbbn@gmail.com>
|
||||
Antonio Huete Jimenez <tuxillo@quantumachine.net>
|
||||
Antonio Murdaca <runcom@redhat.com>
|
||||
Antonio Troina <thoeni@gmail.com>
|
||||
Anze Kolar <me@akolar.com>
|
||||
Aofei Sheng <aofei@aofeisheng.com>
|
||||
Apisak Darakananda <pongad@gmail.com>
|
||||
Aram Hăvărneanu <aram@mgk.ro>
|
||||
Araragi Hokuto <kanseihonbucho@protonmail.com>
|
||||
Arash Bina <arash@arash.io>
|
||||
Arda Güçlü <ardaguclu@gmail.com>
|
||||
Areski Belaid <areski@gmail.com>
|
||||
@@ -288,7 +271,6 @@ Audrius Butkevicius <audrius.butkevicius@gmail.com>
|
||||
Augusto Roman <aroman@gmail.com>
|
||||
Aulus Egnatius Varialus <varialus@gmail.com>
|
||||
Aurélien Rainone <aurelien.rainone@gmail.com>
|
||||
Aurélio A. Heckert <aurium@gmail.com>
|
||||
Austin Clements <austin@google.com> <aclements@csail.mit.edu>
|
||||
Avi Flax <avi@timehop.com>
|
||||
awaw fumin <awawfumin@gmail.com>
|
||||
@@ -331,7 +313,6 @@ Benoit Sigoure <tsunanet@gmail.com>
|
||||
Berengar Lehr <Berengar.Lehr@gmx.de>
|
||||
Berkant Ipek <41230766+0xbkt@users.noreply.github.com>
|
||||
Bharath Thiruveedula <tbharath91@gmail.com>
|
||||
Bhavin Gandhi <bhavin7392@gmail.com>
|
||||
Bill Neubauer <wcn@golang.org> <wcn@google.com> <bill.neubauer@gmail.com>
|
||||
Bill O'Farrell <billo@ca.ibm.com>
|
||||
Bill Prin <waprin@google.com>
|
||||
@@ -339,7 +320,6 @@ Bill Thiede <couchmoney@gmail.com>
|
||||
Bill Zissimopoulos <billziss@navimatics.com>
|
||||
Billie Harold Cleek <bhcleek@gmail.com>
|
||||
Billy Lynch <wlynch@google.com>
|
||||
Billy Zaelani Malik <m.billyzaelani@gmail.com>
|
||||
Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
|
||||
Bjorn Tillenius <bjorn@tillenius.me>
|
||||
Bjorn Tipling <bjorn.tipling@gmail.com>
|
||||
@@ -349,15 +329,12 @@ Blake Mesdag <blakemesdag@gmail.com>
|
||||
Blake Mizerany <blake.mizerany@gmail.com>
|
||||
Blixt <me@blixt.nyc>
|
||||
Bob Briski <rbriski@gmail.com>
|
||||
Bob McNaughton <bobmcn@gmail.com>
|
||||
Bob Potter <bobby.potter@gmail.com>
|
||||
Bobby DeSimone <bobbydesimone@gmail.com>
|
||||
Bobby Powers <bobbypowers@gmail.com>
|
||||
Boqin Qin <bobbqqin@gmail.com>
|
||||
Boris Nagaev <nagaev@google.com>
|
||||
Borja Clemente <borja.clemente@gmail.com>
|
||||
Brad Burch <brad.burch@gmail.com>
|
||||
Brad Erickson <bderickson@gmail.com>
|
||||
Brad Fitzpatrick <bradfitz@golang.org> <bradfitz@gmail.com>
|
||||
Brad Garcia <bgarcia@golang.org>
|
||||
Brad Jones <rbjones@google.com>
|
||||
@@ -372,7 +349,6 @@ Brandon Bennett <bbennett@fb.com>
|
||||
Brandon Gilmore <varz@google.com>
|
||||
Brandon Philips <brandon@ifup.org>
|
||||
Brandon Ryan <bjryan19@gmail.com>
|
||||
Brayden Cloud <bcloud@google.com>
|
||||
Brendan Daniel Tracey <tracey.brendan@gmail.com>
|
||||
Brendan O'Dea <bod@golang.org>
|
||||
Brett Cannon <bcannon@gmail.com>
|
||||
@@ -412,7 +388,6 @@ Carlos Castillo <cookieo9@gmail.com>
|
||||
Carlos Cirello <uldericofilho@gmail.com>
|
||||
Carlos Eduardo <me@carlosedp.com>
|
||||
Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
|
||||
Carlos Iriarte <ciriarte@gmail.com>
|
||||
Carlos Souza <carloshrsouza@gmail.com>
|
||||
Carolyn Van Slyck <me@carolynvanslyck.com>
|
||||
Carrie Bynon <cbynon@gmail.com>
|
||||
@@ -428,7 +403,6 @@ Chad Rosier <mrosier.qdt@qualcommdatacenter.com>
|
||||
ChaiShushan <chaishushan@gmail.com>
|
||||
Changkun Ou <hi@changkun.us>
|
||||
Channing Kimble-Brown <channing@golang.org>
|
||||
Chao Xu <xuchao@google.com>
|
||||
Charles Fenwick Elliott <Charles@FenwickElliott.io>
|
||||
Charles Kenney <charlesc.kenney@gmail.com>
|
||||
Charles L. Dorian <cldorian@gmail.com>
|
||||
@@ -450,7 +424,6 @@ Chris Howey <howeyc@gmail.com>
|
||||
Chris Hundt <hundt@google.com>
|
||||
Chris Jones <chris@cjones.org> <chris.jones.yar@gmail.com>
|
||||
Chris Kastorff <encryptio@gmail.com>
|
||||
Chris Le Roy <brompwnie@users.noreply.github.com>
|
||||
Chris Lennert <calennert@gmail.com>
|
||||
Chris Liles <caveryliles@gmail.com>
|
||||
Chris Manghane <cmang@golang.org>
|
||||
@@ -500,7 +473,6 @@ Conrad Meyer <cemeyer@cs.washington.edu>
|
||||
Conrado Gouvea <conradoplg@gmail.com>
|
||||
Constantin Konstantinidis <constantinkonstantinidis@gmail.com>
|
||||
Corey Thomasson <cthom.lists@gmail.com>
|
||||
Corne van der Plas <vdplas@gmail.com>
|
||||
Cosmos Nicolaou <cnicolaou@google.com>
|
||||
Costin Chirvasuta <ctin@google.com>
|
||||
Craig Citro <craigcitro@google.com>
|
||||
@@ -532,11 +504,9 @@ Daniel Ingram <ingramds@appstate.edu>
|
||||
Daniel Johansson <dajo2002@gmail.com>
|
||||
Daniel Kerwin <d.kerwin@gini.net>
|
||||
Daniel Krech <eikeon@eikeon.com>
|
||||
Daniel Kumor <rdkumor@gmail.com>
|
||||
Daniel Langner <s8572327@gmail.com>
|
||||
Daniel Lidén <daniel.liden.87@gmail.com>
|
||||
Daniel Lublin <daniel@lublin.se>
|
||||
Daniel Mangum <georgedanielmangum@gmail.com>
|
||||
Daniel Martí <mvdan@mvdan.cc>
|
||||
Daniel Morsing <daniel.morsing@gmail.com>
|
||||
Daniel Nadasi <dnadasi@google.com>
|
||||
@@ -547,8 +517,6 @@ Daniel Speichert <daniel@speichert.pl>
|
||||
Daniel Theophanes <kardianos@gmail.com>
|
||||
Daniel Upton <daniel@floppy.co>
|
||||
Daniela Petruzalek <daniela.petruzalek@gmail.com>
|
||||
Danish Dua <danishdua@google.com>
|
||||
Danish Prakash <grafitykoncept@gmail.com>
|
||||
Danny Rosseau <daniel.rosseau@gmail.com>
|
||||
Daria Kolistratova <daria.kolistratova@intel.com>
|
||||
Darien Raymond <admin@v2ray.com>
|
||||
@@ -572,7 +540,6 @@ David Brophy <dave@brophy.uk>
|
||||
David Bürgin <676c7473@gmail.com>
|
||||
David Calavera <david.calavera@gmail.com>
|
||||
David Carlier <devnexen@gmail.com>
|
||||
David Carter <fresco.raja@gmail.com>
|
||||
David Chase <drchase@google.com>
|
||||
David Covert <davidhcovert@gmail.com>
|
||||
David Crawshaw <david.crawshaw@zentus.com> <crawshaw@google.com> <crawshaw@golang.org>
|
||||
@@ -581,7 +548,6 @@ David Finkel <david.finkel@gmail.com>
|
||||
David Forsythe <dforsythe@gmail.com>
|
||||
David G. Andersen <dave.andersen@gmail.com>
|
||||
David Glasser <glasser@meteor.com>
|
||||
David Golden <david@autopragmatic.com>
|
||||
David Heuschmann <heuschmann.d@gmail.com>
|
||||
David Howden <dhowden@gmail.com>
|
||||
David Hubbard <dsp@google.com>
|
||||
@@ -606,7 +572,6 @@ David Volquartz Lebech <david@lebech.info>
|
||||
David Wimmer <davidlwimmer@gmail.com>
|
||||
Davies Liu <davies.liu@gmail.com>
|
||||
Davor Kapsa <davor.kapsa@gmail.com>
|
||||
Dean Eigenmann <7621705+decanus@users.noreply.github.com>
|
||||
Dean Prichard <dean.prichard@gmail.com>
|
||||
Deepak Jois <deepak.jois@gmail.com>
|
||||
Denis Bernard <db047h@gmail.com>
|
||||
@@ -652,7 +617,6 @@ Dmitry Mottl <dmitry.mottl@gmail.com>
|
||||
Dmitry Neverov <dmitry.neverov@gmail.com>
|
||||
Dmitry Savintsev <dsavints@gmail.com>
|
||||
Dmitry Yakunin <nonamezeil@gmail.com>
|
||||
Doga Fincan <doga@icloud.com>
|
||||
Domas Tamašauskas <puerdomus@gmail.com>
|
||||
Domen Ipavec <domen@ipavec.net>
|
||||
Dominic Green <dominicgreen1@gmail.com>
|
||||
@@ -676,7 +640,6 @@ Dustin Sallings <dsallings@gmail.com>
|
||||
Dustin Shields-Cloues <dcloues@gmail.com>
|
||||
Dvir Volk <dvir@everything.me> <dvirsky@gmail.com>
|
||||
Dylan Waits <dylan@waits.io>
|
||||
Ed Schouten <ed@nuxi.nl>
|
||||
Edan Bedrik <3d4nb3@gmail.com>
|
||||
Eddie Scholtz <escholtz@google.com>
|
||||
Eden Li <eden.li@gmail.com>
|
||||
@@ -694,13 +657,11 @@ Elena Grahovac <elena@grahovac.me>
|
||||
Eli Bendersky <eliben@google.com>
|
||||
Elias Naur <mail@eliasnaur.com> <elias.naur@gmail.com>
|
||||
Elliot Morrison-Reed <elliotmr@gmail.com>
|
||||
Ellison Leão <ellisonleao@gmail.com>
|
||||
Emerson Lin <linyintor@gmail.com>
|
||||
Emil Hessman <emil@hessman.se>
|
||||
Emil Mursalimov <mursalimovemeel@gmail.com>
|
||||
Emilien Kenler <hello@emilienkenler.com>
|
||||
Emmanuel Odeke <emm.odeke@gmail.com> <odeke@ualberta.ca>
|
||||
Emrecan Bati <emrecanbati@gmail.com>
|
||||
Eno Compton <enocom@google.com>
|
||||
Eoghan Sherry <ejsherry@gmail.com>
|
||||
Eric Biggers <ebiggers@google.com>
|
||||
@@ -719,7 +680,6 @@ Eric Rescorla <ekr@rtfm.com>
|
||||
Eric Roshan-Eisner <eric.d.eisner@gmail.com>
|
||||
Eric Rutherford <erutherford@gmail.com>
|
||||
Eric Rykwalder <e.rykwalder@gmail.com>
|
||||
Erick Tryzelaar <etryzelaar@google.com>
|
||||
Erik Aigner <aigner.erik@gmail.com>
|
||||
Erik Dubbelboer <erik@dubbelboer.com>
|
||||
Erik St. Martin <alakriti@gmail.com>
|
||||
@@ -732,7 +692,6 @@ Esko Luontola <esko.luontola@gmail.com>
|
||||
Ethan Burns <eaburns@google.com>
|
||||
Ethan Miller <eamiller@us.ibm.com>
|
||||
Euan Kemp <euank@euank.com>
|
||||
Eugene Formanenko <mo4islona@gmail.com>
|
||||
Eugene Kalinin <e.v.kalinin@gmail.com>
|
||||
Evan Broder <evan@stripe.com>
|
||||
Evan Brown <evanbrown@google.com>
|
||||
@@ -744,7 +703,6 @@ Evan Kroske <evankroske@google.com>
|
||||
Evan Martin <evan.martin@gmail.com>
|
||||
Evan Phoenix <evan@phx.io>
|
||||
Evan Shaw <chickencha@gmail.com>
|
||||
Evgeniy Kulikov <tuxuls@gmail.com>
|
||||
Evgeniy Polyakov <zbr@ioremap.net>
|
||||
Ewan Chou <coocood@gmail.com>
|
||||
Ewan Valentine <ewan.valentine89@gmail.com>
|
||||
@@ -765,10 +723,8 @@ Fedor Indutny <fedor@indutny.com>
|
||||
Fedor Korotkiy <dartslon@gmail.com>
|
||||
Felipe Oliveira <felipeweb.programador@gmail.com>
|
||||
Felix Bünemann <Felix.Buenemann@gmail.com>
|
||||
Felix Cornelius <9767036+fcornelius@users.noreply.github.com>
|
||||
Felix Geisendörfer <haimuiba@gmail.com>
|
||||
Felix Kollmann <fk@konsorten.de>
|
||||
Ferenc Szabo <frncmx@gmail.com>
|
||||
Filip Gruszczyński <gruszczy@gmail.com>
|
||||
Filip Haglund <drathier@users.noreply.github.com>
|
||||
Filip Stanis <fstanis@google.com>
|
||||
@@ -816,7 +772,6 @@ Gary Elliott <garyelliott@google.com>
|
||||
Gaurish Sharma <contact@gaurishsharma.com>
|
||||
Gautham Thambidorai <gautham.dorai@gmail.com>
|
||||
Gauthier Jolly <gauthier.jolly@gmail.com>
|
||||
Gawen Arab <gawen.arab@c.zen.ly>
|
||||
Geert-Johan Riemer <gjr19912@gmail.com>
|
||||
Genevieve Luyt <genevieve.luyt@gmail.com>
|
||||
Gengliang Wang <ltnwgl@gmail.com>
|
||||
@@ -838,7 +793,6 @@ Gianguido Sora` <g.sora4@gmail.com>
|
||||
Gideon Jan-Wessel Redelinghuys <gjredelinghuys@gmail.com>
|
||||
Giles Lean <giles.lean@pobox.com>
|
||||
Giovanni Bajo <rasky@develer.com>
|
||||
GitHub User @aca (50316549) <acadx0@gmail.com>
|
||||
GitHub User @ajnirp (1688456) <ajnirp@users.noreply.github.com>
|
||||
GitHub User @ajz01 (4744634) <ajzdenek@gmail.com>
|
||||
GitHub User @alkesh26 (1019076) <alkesh26@gmail.com>
|
||||
@@ -849,18 +803,12 @@ GitHub User @bakape (7851952) <bakape@gmail.com>
|
||||
GitHub User @bgadrian (830001) <aditza8@gmail.com>
|
||||
GitHub User @bontequero (2674999) <bontequero@gmail.com>
|
||||
GitHub User @cch123 (384546) <buaa.cch@gmail.com>
|
||||
GitHub User @chainhelen (7046329) <chainhelen@gmail.com>
|
||||
GitHub User @chanxuehong (3416908) <chanxuehong@gmail.com>
|
||||
GitHub User @cncal (23520240) <flycalvin@qq.com>
|
||||
GitHub User @DQNEO (188741) <dqneoo@gmail.com>
|
||||
GitHub User @Dreamacro (8615343) <chuainian@gmail.com>
|
||||
GitHub User @dupoxy (1143957) <dupoxy@users.noreply.github.com>
|
||||
GitHub User @erifan (31343225) <eric.fang@arm.com>
|
||||
GitHub User @esell (9735165) <eujon.sellers@gmail.com>
|
||||
GitHub User @fatedier (7346661) <fatedier@gmail.com>
|
||||
GitHub User @frennkie (6499251) <mail@rhab.de>
|
||||
GitHub User @geedchin (11672310) <geedchin@gmail.com>
|
||||
GitHub User @GrigoriyMikhalkin (3637857) <grigoriymikhalkin@gmail.com>
|
||||
GitHub User @hengwu0 (41297446) <41297446+hengwu0@users.noreply.github.com>
|
||||
GitHub User @itchyny (375258) <itchyny@hatena.ne.jp>
|
||||
GitHub User @jinmiaoluo (39730824) <jinmiaoluo@icloud.com>
|
||||
@@ -870,13 +818,11 @@ GitHub User @kc1212 (1093806) <kc1212@users.noreply.github.com>
|
||||
GitHub User @Kropekk (13366453) <kamilkropiewnicki@gmail.com>
|
||||
GitHub User @linguohua (3434367) <lghchinaidea@gmail.com>
|
||||
GitHub User @LotusFenn (13775899) <fenn.lotus@gmail.com>
|
||||
GitHub User @ly303550688 (11519839) <yang.liu636@gmail.com>
|
||||
GitHub User @madiganz (18340029) <zacharywmadigan@gmail.com>
|
||||
GitHub User @maltalex (10195391) <code@bit48.net>
|
||||
GitHub User @Matts966 (28551465) <Matts966@users.noreply.github.com>
|
||||
GitHub User @micnncim (21333876) <micnncim@gmail.com>
|
||||
GitHub User @mkishere (224617) <224617+mkishere@users.noreply.github.com>
|
||||
GitHub User @nu50218 (40682920) <nu_ll@icloud.com>
|
||||
GitHub User @OlgaVlPetrova (44112727) <OVPpetrova@gmail.com>
|
||||
GitHub User @pityonline (438222) <pityonline@gmail.com>
|
||||
GitHub User @po3rin (29445112) <abctail30@gmail.com>
|
||||
@@ -888,7 +834,6 @@ GitHub User @shogo-ma (9860598) <Choroma194@gmail.com>
|
||||
GitHub User @skanehira (7888591) <sho19921005@gmail.com>
|
||||
GitHub User @tatsumack (4510569) <tatsu.mack@gmail.com>
|
||||
GitHub User @tell-k (26263) <ffk2005@gmail.com>
|
||||
GitHub User @tennashi (10219626) <tennashio@gmail.com>
|
||||
GitHub User @uhei (2116845) <uhei@users.noreply.github.com>
|
||||
GitHub User @uropek (39370426) <uropek@gmail.com>
|
||||
GitHub User @utkarsh-extc (53217283) <utkarsh.extc@gmail.com>
|
||||
@@ -914,7 +859,6 @@ Greg Thelen <gthelen@google.com>
|
||||
Greg Ward <greg@gerg.ca>
|
||||
Grégoire Delattre <gregoire.delattre@gmail.com>
|
||||
Gregory Man <man.gregory@gmail.com>
|
||||
Gregory Petrosyan <gregory.petrosyan@gmail.com>
|
||||
Guilherme Caruso <gui.martinscaruso@gmail.com>
|
||||
Guilherme Garnier <guilherme.garnier@gmail.com>
|
||||
Guilherme Goncalves <guilhermeaugustosg@gmail.com>
|
||||
@@ -971,7 +915,6 @@ Hitoshi Mitake <mitake.hitoshi@gmail.com>
|
||||
Holden Huang <ttyh061@gmail.com>
|
||||
Hong Ruiqi <hongruiqi@gmail.com>
|
||||
Hongfei Tan <feilengcui008@gmail.com>
|
||||
Horacio Duran <horacio.duran@gmail.com>
|
||||
Horst Rutter <hhrutter@gmail.com>
|
||||
Hossein Sheikh Attar <hattar@google.com>
|
||||
Howard Zhang <howard.zhang@arm.com>
|
||||
@@ -982,7 +925,6 @@ Huan Du <i@huandu.me>
|
||||
Hugues Bruant <hugues.bruant@gmail.com>
|
||||
Huy Le <huy.dinh.le.89@gmail.com>
|
||||
Hyang-Ah Hana Kim <hakim@google.com> <hyangah@gmail.com>
|
||||
Hyoyoung Chang <hyoyoung@gmail.com>
|
||||
Ian Cottrell <iancottrell@google.com>
|
||||
Ian Davis <nospam@iandavis.com>
|
||||
Ian Gudger <ian@loosescre.ws>
|
||||
@@ -1014,7 +956,7 @@ Irfan Sharif <irfanmahmoudsharif@gmail.com>
|
||||
Irieda Noboru <irieda@gmail.com>
|
||||
Isaac Ardis <isaac.ardis@gmail.com>
|
||||
Isaac Wagner <ibw@isaacwagner.me>
|
||||
Isfan Azhabil <isfanazhabil@gmail.com>
|
||||
Isfan Azhabil <isfan.azhabil@tokopedia.com>
|
||||
Iskander Sharipov <iskander.sharipov@intel.com> <quasilyte@gmail.com>
|
||||
Issac Trotts <issactrotts@google.com>
|
||||
Ivan Babrou <ivan@cloudflare.com>
|
||||
@@ -1042,7 +984,6 @@ Jake B <doogie1012@gmail.com>
|
||||
Jakob Borg <jakob@nym.se>
|
||||
Jakob Weisblat <jakobw@mit.edu>
|
||||
Jakub Čajka <jcajka@redhat.com>
|
||||
Jakub Kaczmarzyk <jakubk@mit.edu>
|
||||
Jakub Ryszard Czarnowicz <j.czarnowicz@gmail.com>
|
||||
Jamal Carvalho <jamal.a.carvalho@gmail.com>
|
||||
James Aguilar <jaguilar@google.com>
|
||||
@@ -1089,7 +1030,6 @@ Jan Steinke <jan.steinke@gmail.com>
|
||||
Jan Ziak <0xe2.0x9a.0x9b@gmail.com>
|
||||
Jani Monoses <jani.monoses@ubuntu.com> <jani.monoses@gmail.com>
|
||||
Jannis Andrija Schnitzer <jannis@schnitzer.im>
|
||||
Jared Allard <jaredallard@users.noreply.github.com>
|
||||
Jared Culp <jculp14@gmail.com>
|
||||
Jaroslavas Počepko <jp@webmaster.ms>
|
||||
Jason A. Donenfeld <Jason@zx2c4.com>
|
||||
@@ -1144,11 +1084,8 @@ Jerrin Shaji George <jerrinsg@gmail.com>
|
||||
Jess Frazelle <me@jessfraz.com>
|
||||
Jesse Szwedko <jesse.szwedko@gmail.com>
|
||||
Jesús Espino <jespinog@gmail.com>
|
||||
Jia Zhan <jzhan@uber.com>
|
||||
Jiacai Liu <jiacai2050@gmail.com>
|
||||
Jianing Yu <jnyu@google.com>
|
||||
Jianqiao Li <jianqiaoli@google.com>
|
||||
Jie Ma <jienius@outlook.com>
|
||||
Jihyun Yu <yjh0502@gmail.com>
|
||||
Jim Cote <jfcote87@gmail.com>
|
||||
Jim Kingdon <jim@bolt.me>
|
||||
@@ -1196,7 +1133,6 @@ John Howard Palevich <jack.palevich@gmail.com>
|
||||
John Jeffery <jjeffery@sp.com.au>
|
||||
John Jenkins <twodopeshaggy@gmail.com>
|
||||
John Leidegren <john.leidegren@gmail.com>
|
||||
John McCabe <john@johnmccabe.net>
|
||||
John Moore <johnkenneth.moore@gmail.com>
|
||||
John Newlin <jnewlin@google.com>
|
||||
John Papandriopoulos <jpap.code@gmail.com>
|
||||
@@ -1208,7 +1144,6 @@ John Tuley <john@tuley.org>
|
||||
John Weldon <johnweldon4@gmail.com>
|
||||
Johnny Luo <johnnyluo1980@gmail.com>
|
||||
Jon Chen <jchen@justin.tv>
|
||||
Jon Johnson <jonjohnson@google.com>
|
||||
Jonas Bernoulli <jonas@bernoul.li>
|
||||
Jonathan Allie <jonallie@google.com>
|
||||
Jonathan Amsterdam <jba@google.com>
|
||||
@@ -1228,7 +1163,6 @@ Jonathon Lacher <jonathon.lacher@gmail.com>
|
||||
Jongmin Kim <atomaths@gmail.com>
|
||||
Joonas Kuorilehto <joneskoo@derbian.fi>
|
||||
Joop Kiefte <ikojba@gmail.com> <joop@kiefte.net>
|
||||
Jordan Christiansen <xordspar0@gmail.com>
|
||||
Jordan Krage <jmank88@gmail.com>
|
||||
Jordan Lewis <jordanthelewis@gmail.com>
|
||||
Jordan Liggitt <liggitt@google.com>
|
||||
@@ -1241,7 +1175,6 @@ Josa Gesell <josa@gesell.me>
|
||||
Jose Luis Vázquez González <josvazg@gmail.com>
|
||||
Joseph Bonneau <jcb@google.com>
|
||||
Joseph Holsten <joseph@josephholsten.com>
|
||||
Josh Baum <joshbaum@google.com>
|
||||
Josh Bleecher Snyder <josharian@gmail.com>
|
||||
Josh Chorlton <jchorlton@gmail.com>
|
||||
Josh Deprez <josh.deprez@gmail.com>
|
||||
@@ -1250,10 +1183,8 @@ Josh Hoak <jhoak@google.com>
|
||||
Josh Holland <jrh@joshh.co.uk>
|
||||
Josh Roppo <joshroppo@gmail.com>
|
||||
Josh Varga <josh.varga@gmail.com>
|
||||
Joshua Bezaleel Abednego <joshua.bezaleel@gmail.com>
|
||||
Joshua Boelter <joshua.boelter@intel.com>
|
||||
Joshua Chase <jcjoshuachase@gmail.com>
|
||||
Joshua Crowgey <jcrowgey@uw.edu>
|
||||
Joshua M. Clulow <josh.clulow@joyent.com>
|
||||
Joshua Rubin <joshua@rubixconsulting.com>
|
||||
Josselin Costanzi <josselin@costanzi.fr>
|
||||
@@ -1332,7 +1263,6 @@ Kenji Yano <kenji.yano@gmail.com>
|
||||
Kenneth Shaw <kenshaw@gmail.com>
|
||||
Kenny Grant <kennygrant@gmail.com>
|
||||
Kenta Mori <zoncoen@gmail.com>
|
||||
Kerollos Magdy <kerolloz@yahoo.com>
|
||||
Ketan Parmar <ketanbparmar@gmail.com>
|
||||
Kevan Swanberg <kevswanberg@gmail.com>
|
||||
Kevin Ballard <kevin@sb.org>
|
||||
@@ -1345,14 +1275,10 @@ Kevin Malachowski <chowski@google.com>
|
||||
Kevin Ruffin <kruffin@gmail.com>
|
||||
Kevin Vu <kevin.m.vu@gmail.com>
|
||||
Kevin Zita <bleedgreenandgold@gmail.com>
|
||||
Keyan Pishdadian <kpishdadian@gmail.com>
|
||||
Kezhu Wang <kezhuw@gmail.com>
|
||||
Khosrow Moossavi <khos2ow@gmail.com>
|
||||
Kieran Colford <kieran@kcolford.com>
|
||||
Kim Shrier <kshrier@racktopsystems.com>
|
||||
Kim Yongbin <kybinz@gmail.com>
|
||||
Kir Kolyshkin <kolyshkin@gmail.com>
|
||||
Kirill Korotaev <kirillx@gmail.com>
|
||||
Kirill Motkov <Motkov.Kirill@gmail.com>
|
||||
Kirill Smelkov <kirr@nexedi.com>
|
||||
Kirill Tatchihin <kirabsuir@gmail.com>
|
||||
@@ -1375,12 +1301,10 @@ Kshitij Saraogi <kshitijsaraogi@gmail.com>
|
||||
Kun Li <likunarmstrong@gmail.com>
|
||||
Kunpei Sakai <namusyaka@gmail.com>
|
||||
Kuntal Majumder <hellozee@disroot.org>
|
||||
Kush Patel <kush.patel@hootsuite.com>
|
||||
Kyle Consalus <consalus@gmail.com>
|
||||
Kyle Isom <kyle@gokyle.net>
|
||||
Kyle Jones <kyle@kyledj.com>
|
||||
Kyle Lemons <kyle@kylelemons.net> <kevlar@google.com>
|
||||
Kyle Nusbaum <kyle@datadog.com>
|
||||
Kyle Shannon <kyle@pobox.com>
|
||||
Kyle Spiers <eiais@google.com>
|
||||
Kyle Wood <kyle@kylewood.cc>
|
||||
@@ -1412,8 +1336,6 @@ Leonardo Comelli <leonardo.comelli@gmail.com>
|
||||
Leonel Quinteros <leonel.quinteros@gmail.com>
|
||||
Lev Shamardin <shamardin@gmail.com>
|
||||
Lewin Bormann <lewin.bormann@gmail.com>
|
||||
Liam Haworth <liam@haworth.id.au>
|
||||
Lily Chung <lilithkchung@gmail.com>
|
||||
Lion Yang <lion@aosc.xyz>
|
||||
Liz Rice <liz@lizrice.com>
|
||||
Lloyd Dewolf <foolswisdom@gmail.com>
|
||||
@@ -1471,7 +1393,6 @@ Marcel van Lohuizen <mpvl@golang.org>
|
||||
Marcelo Cantos <marcelo.cantos@gmail.com>
|
||||
Marcelo E. Magallon <marcelo.magallon@gmail.com>
|
||||
Marco Hennings <marco.hennings@freiheit.com>
|
||||
Marcus Weiner <marcus.weiner@gmail.com>
|
||||
Marcus Willock <crazcalm@gmail.com>
|
||||
Marga Manterola <marga@google.com>
|
||||
Mariano Cano <mariano@smallstep.com>
|
||||
@@ -1502,7 +1423,6 @@ Markus Duft <markus.duft@salomon.at>
|
||||
Markus Sonderegger <marraison@gmail.com>
|
||||
Markus Zimmermann <zimmski@gmail.com>
|
||||
Marten Seemann <martenseemann@gmail.com>
|
||||
Martin Asquino <martin.asquino@gmail.com>
|
||||
Martin Bertschler <mbertschler@gmail.com>
|
||||
Martin Garton <garton@gmail.com>
|
||||
Martin Habbecke <marhab@google.com>
|
||||
@@ -1526,7 +1446,6 @@ Maryan Hratson <gmarik@gmail.com>
|
||||
Masahiro Furudate <masahiro.furudate@gmail.com>
|
||||
Masahiro Wakame <vvakame@gmail.com>
|
||||
Masaki Yoshida <yoshida.masaki@gmail.com>
|
||||
Masaya Watanabe <sfbgwm30@gmail.com>
|
||||
Mat Byczkowski <mbyczkowski@gmail.com>
|
||||
Mat Ryer <thatmatryer@gmail.com>
|
||||
Máté Gulyás <mgulyas86@gmail.com>
|
||||
@@ -1573,7 +1492,6 @@ Max Ushakov <ushmax@gmail.com>
|
||||
Maxim Eryomenko <moeryomenko@gmail.com>
|
||||
Maxim Khitrov <max@mxcrypt.com>
|
||||
Maxim Pimenov <mpimenov@google.com>
|
||||
Maxim Pugachev <pugachev.mm@gmail.com>
|
||||
Maxim Ushakov <ushakov@google.com>
|
||||
Maxime de Roucy <maxime.deroucy@gmail.com>
|
||||
Máximo Cuadros Ortiz <mcuadros@gmail.com>
|
||||
@@ -1581,7 +1499,7 @@ Maxwell Krohn <themax@gmail.com>
|
||||
Maya Rashish <maya@NetBSD.org>
|
||||
Mayank Kumar <krmayankk@gmail.com>
|
||||
Meir Fischer <meirfischer@gmail.com>
|
||||
Meng Zhuo <mengzhuo1203@gmail.com> <mzh@golangcn.org>
|
||||
Meng Zhuo <mengzhuo1203@gmail.com>
|
||||
Mhd Sulhan <m.shulhan@gmail.com>
|
||||
Micah Stetson <micah.stetson@gmail.com>
|
||||
Michael Anthony Knyszek <mknyszek@google.com>
|
||||
@@ -1628,7 +1546,6 @@ Michal Bohuslávek <mbohuslavek@gmail.com>
|
||||
Michal Cierniak <cierniak@google.com>
|
||||
Michał Derkacz <ziutek@lnet.pl>
|
||||
Michal Franc <lam.michal.franc@gmail.com>
|
||||
Michał Łowicki <mlowicki@gmail.com>
|
||||
Michal Pristas <michal.pristas@gmail.com>
|
||||
Michal Rostecki <mrostecki@suse.de>
|
||||
Michalis Kargakis <michaliskargakis@gmail.com>
|
||||
@@ -1636,7 +1553,6 @@ Michel Lespinasse <walken@google.com>
|
||||
Mickael Kerjean <mickael.kerjean@gmail.com>
|
||||
Mickey Reiss <mickeyreiss@gmail.com>
|
||||
Miek Gieben <miek@miek.nl> <remigius.gieben@gmail.com>
|
||||
Miguel Acero <acero@google.com>
|
||||
Miguel Mendez <stxmendez@gmail.com>
|
||||
Miguel Molina <hi@mvader.me>
|
||||
Mihai Borobocea <MihaiBorobocea@gmail.com>
|
||||
@@ -1663,7 +1579,6 @@ Mikio Hara <mikioh.mikioh@gmail.com>
|
||||
Mikkel Krautz <mikkel@krautz.dk> <krautz@gmail.com>
|
||||
Mikołaj Baranowski <mikolajb@gmail.com>
|
||||
Milan Knezevic <milan.knezevic@mips.com>
|
||||
Milan Patel <bicelot3@gmail.com>
|
||||
Milutin Jovanović <jovanovic.milutin@gmail.com>
|
||||
MinJae Kwon <mingrammer@gmail.com>
|
||||
Miquel Sabaté Solà <mikisabate@gmail.com>
|
||||
@@ -1685,10 +1600,8 @@ Mrunal Patel <mrunalp@gmail.com>
|
||||
Muhammad Falak R Wani <falakreyaz@gmail.com>
|
||||
Muhammed Uluyol <uluyol0@gmail.com>
|
||||
Muir Manders <muir@mnd.rs>
|
||||
Mukesh Sharma <sharma.mukesh439@gmail.com>
|
||||
Mura Li <mura_li@castech.com.tw>
|
||||
Mykhailo Lesyk <mikhail@lesyk.org>
|
||||
Naman Aggarwal <aggarwal.nam@gmail.com>
|
||||
Nan Deng <monnand@gmail.com>
|
||||
Nao Yonashiro <owan.orisano@gmail.com>
|
||||
Naoki Kanatani <k12naoki@gmail.com>
|
||||
@@ -1696,7 +1609,6 @@ Nate Wilkinson <nathanwilk7@gmail.com>
|
||||
Nathan Cantelmo <n.cantelmo@gmail.com>
|
||||
Nathan Caza <mastercactapus@gmail.com>
|
||||
Nathan Dias <nathan.dias@orijtech.com>
|
||||
Nathan Fiscaletti <nathan.fiscaletti@vrazo.com>
|
||||
Nathan Humphreys <nkhumphreys@gmail.com>
|
||||
Nathan John Youngman <nj@nathany.com>
|
||||
Nathan Otterness <otternes@cs.unc.edu>
|
||||
@@ -1706,7 +1618,6 @@ Nathan Youngman <git@nathany.com>
|
||||
Nathan(yinian) Hu <nathanhu@google.com>
|
||||
Nathaniel Cook <nvcook42@gmail.com>
|
||||
Naveen Kumar Sangi <naveenkumarsangi@protonmail.com>
|
||||
Neeilan Selvalingam <neeilan96@gmail.com>
|
||||
Neelesh Chandola <neelesh.c98@gmail.com>
|
||||
Neil Lyons <nwjlyons@googlemail.com>
|
||||
Neuman Vong <neuman.vong@gmail.com>
|
||||
@@ -1741,26 +1652,22 @@ Nigel Kerr <nigel.kerr@gmail.com>
|
||||
Nigel Tao <nigeltao@golang.org>
|
||||
Nik Nyby <nnyby@columbia.edu>
|
||||
Nikhil Benesch <nikhil.benesch@gmail.com>
|
||||
Nikita Gillmann <nikita@n0.is> <ng0@n0.is>
|
||||
Nikita Kryuchkov <nkryuchkov10@gmail.com>
|
||||
Nikita Vanyasin <nikita.vanyasin@gmail.com>
|
||||
Niklas Schnelle <niklas.schnelle@gmail.com>
|
||||
Niko Dziemba <niko@dziemba.com>
|
||||
Nikolay Turpitko <nikolay@turpitko.com>
|
||||
Nikson Kanti Paul <nikson.sust@gmail.com>
|
||||
Nils Larsgård <nilsmagnus@gmail.com>
|
||||
Nir Soffer <nirsof@gmail.com>
|
||||
Niranjan Godbole <niranjan8192@gmail.com>
|
||||
Nishanth Shanmugham <nishanth.gerrard@gmail.com>
|
||||
Noah Campbell <noahcampbell@gmail.com>
|
||||
Noah Goldman <noahg34@gmail.com>
|
||||
Noble Johnson <noblepoly@gmail.com>
|
||||
Nodir Turakulov <nodir@google.com>
|
||||
Noel Georgi <git@frezbo.com>
|
||||
Norberto Lopes <nlopes.ml@gmail.com>
|
||||
Norman B. Lancaster <qbradq@gmail.com>
|
||||
Nuno Cruces <ncruces@users.noreply.github.com>
|
||||
Obeyda Djeffal <djefobey@gmail.com>
|
||||
Odin Ugedal <odin@ugedal.com>
|
||||
Oleg Bulatov <dmage@yandex-team.ru>
|
||||
Oleg Vakheta <helginet@gmail.com>
|
||||
@@ -1778,7 +1685,6 @@ Omar Jarjur <ojarjur@google.com>
|
||||
Oryan Moshe <iamoryanmoshe@gmail.com>
|
||||
Osamu TONOMORI <osamingo@gmail.com>
|
||||
Özgür Kesim <oec-go@kesim.org>
|
||||
Pablo Caderno <kaderno@gmail.com>
|
||||
Pablo Lalloni <plalloni@gmail.com>
|
||||
Pablo Rozas Larraondo <pablo.larraondo@anu.edu.au>
|
||||
Pablo Santiago Blum de Aguiar <scorphus@gmail.com>
|
||||
@@ -1792,8 +1698,6 @@ Parker Moore <parkrmoore@gmail.com>
|
||||
Parminder Singh <parmsingh101@gmail.com>
|
||||
Pascal Dierich <pascal@pascaldierich.com>
|
||||
Pascal S. de Kloe <pascal@quies.net>
|
||||
Paschalis Tsilias <paschalis.tsilias@gmail.com>
|
||||
Pasi Tähkäpää <pasi.tahkapaa@gmail.com>
|
||||
Pat Moroney <pat@pat.email>
|
||||
Patrick Barker <barkerp@vmware.com>
|
||||
Patrick Crosby <patrick@stathat.com>
|
||||
@@ -1810,7 +1714,6 @@ Paul A Querna <paul.querna@gmail.com>
|
||||
Paul Borman <borman@google.com>
|
||||
Paul Boyd <boyd.paul2@gmail.com>
|
||||
Paul Chang <paulchang@google.com>
|
||||
Paul D. Weber <x0bdev@gmail.com>
|
||||
Paul Hammond <paul@paulhammond.org>
|
||||
Paul Hankin <paulhankin@google.com>
|
||||
Paul Jolly <paul@myitcv.org.uk>
|
||||
@@ -1836,10 +1739,8 @@ Pavel Zinovkin <pavel.zinovkin@gmail.com>
|
||||
Pavlo Sumkin <ymkins@gmail.com>
|
||||
Pawel Knap <pawelknap88@gmail.com>
|
||||
Pawel Szczur <filemon@google.com>
|
||||
Pei Xian Chee <luciolas1991@gmail.com>
|
||||
Percy Wegmann <ox.to.a.cart@gmail.com>
|
||||
Perry Abbott <perry.j.abbott@gmail.com>
|
||||
Petar Dambovaliev <petar.atanasov.1987@gmail.com>
|
||||
Petar Maymounkov <petarm@gmail.com>
|
||||
Peter Armitage <peter.armitage@gmail.com>
|
||||
Peter Bourgon <peter@bourgon.org>
|
||||
@@ -1876,7 +1777,6 @@ Philip Hofer <phofer@umich.edu>
|
||||
Philip K. Warren <pkwarren@gmail.com>
|
||||
Philip Nelson <me@pnelson.ca>
|
||||
Philipp Stephani <phst@google.com>
|
||||
Pierre Carru <pierre.carru@eshard.com>
|
||||
Pierre Durand <pierredurand@gmail.com>
|
||||
Pierre Prinetti <pierreprinetti@gmail.com>
|
||||
Pierre Roullon <pierre.roullon@gmail.com>
|
||||
@@ -1885,14 +1785,10 @@ Pieter Droogendijk <pieter@binky.org.uk>
|
||||
Pietro Gagliardi <pietro10@mac.com>
|
||||
Piyush Mishra <piyush@codeitout.com>
|
||||
Plekhanov Maxim <kishtatix@gmail.com>
|
||||
Polina Osadcha <polliosa@google.com>
|
||||
Pontus Leitzler <leitzler@gmail.com>
|
||||
Povilas Versockas <p.versockas@gmail.com>
|
||||
Prasanga Siripala <pj@pjebs.com.au>
|
||||
Prasanna Swaminathan <prasanna@mediamath.com>
|
||||
Prashant Agrawal <prashant.a.vjti@gmail.com>
|
||||
Prashant Varanasi <prashant@prashantv.com>
|
||||
Praveen Kumar <praveen+git@kumar.in>
|
||||
Pravendra Singh <hackpravj@gmail.com>
|
||||
Preetam Jinka <pj@preet.am>
|
||||
Pure White <wu.purewhite@gmail.com>
|
||||
@@ -1903,7 +1799,6 @@ Quan Yong Zhai <qyzhai@gmail.com>
|
||||
Quentin Perez <qperez@ocs.online.net>
|
||||
Quentin Renard <contact@asticode.com>
|
||||
Quentin Smith <quentin@golang.org>
|
||||
Quey-Liang Kao <s101062801@m101.nthu.edu.tw>
|
||||
Quinn Slack <sqs@sourcegraph.com>
|
||||
Quinten Yearsley <qyearsley@chromium.org>
|
||||
Quoc-Viet Nguyen <afelion@gmail.com>
|
||||
@@ -1931,7 +1826,6 @@ Reilly Watson <reillywatson@gmail.com>
|
||||
Reinaldo de Souza Jr <juniorz@gmail.com>
|
||||
Remi Gillig <remigillig@gmail.com>
|
||||
Rémy Oudompheng <oudomphe@phare.normalesup.org> <remyoudompheng@gmail.com>
|
||||
Ren Ogaki <re.yuz77777@gmail.com>
|
||||
Rens Rikkerink <Ikkerens@users.noreply.github.com>
|
||||
Rhys Hiltner <rhys@justin.tv>
|
||||
Ricardo Padilha <ricardospadilha@gmail.com>
|
||||
@@ -1943,8 +1837,6 @@ Richard Eric Gavaletz <gavaletz@gmail.com>
|
||||
Richard Gibson <richard.gibson@gmail.com>
|
||||
Richard Miller <miller.research@gmail.com>
|
||||
Richard Musiol <mail@richard-musiol.de> <neelance@gmail.com>
|
||||
Richard Ulmer <codesoap@mailbox.org>
|
||||
Richard Wilkes <wilkes@me.com>
|
||||
Rick Arnold <rickarnoldjr@gmail.com>
|
||||
Rick Hudson <rlh@golang.org>
|
||||
Rick Sayre <whorfin@gmail.com>
|
||||
@@ -1963,7 +1855,6 @@ Robert Figueiredo <robfig@gmail.com>
|
||||
Robert Griesemer <gri@golang.org>
|
||||
Robert Hencke <robert.hencke@gmail.com>
|
||||
Robert Iannucci <iannucci@google.com>
|
||||
Robert Kuska <rkuska@gmail.com>
|
||||
Robert Obryk <robryk@gmail.com>
|
||||
Robert Sesek <rsesek@google.com>
|
||||
Robert Snedegar <roberts@google.com>
|
||||
@@ -1982,7 +1873,6 @@ Roger Pau Monné <royger@gmail.com>
|
||||
Roger Peppe <rogpeppe@gmail.com>
|
||||
Rohan Challa <rohan@golang.org>
|
||||
Rohan Verma <rohanverma2004@gmail.com>
|
||||
Rohith Ravi <entombedvirus@gmail.com>
|
||||
Roland Illig <roland.illig@gmx.de>
|
||||
Roland Shoemaker <rolandshoemaker@gmail.com>
|
||||
Romain Baugue <romain.baugue@elwinar.com>
|
||||
@@ -1992,7 +1882,6 @@ Roman Shchekin <mrqtros@gmail.com>
|
||||
Ron Hashimoto <mail@h2so5.net>
|
||||
Ron Minnich <rminnich@gmail.com>
|
||||
Ross Chater <rdchater@gmail.com>
|
||||
Ross Kinsey <rossikinsey@gmail.com>
|
||||
Ross Light <light@google.com> <rlight2@gmail.com>
|
||||
Ross Smith II <ross@smithii.com>
|
||||
Rowan Marshall <rowanajmarshall@gmail.com>
|
||||
@@ -2027,8 +1916,6 @@ Sakeven Jiang <jc5930@sina.cn>
|
||||
Salmān Aljammāz <s@0x65.net>
|
||||
Sam Arnold <sarnold64@bloomberg.net>
|
||||
Sam Boyer <tech@samboyer.org>
|
||||
Sam Chen <chenxsan@gmail.com>
|
||||
Sam Cross <samgcdev@gmail.com>
|
||||
Sam Ding <samding@ca.ibm.com>
|
||||
Sam Hug <samuel.b.hug@gmail.com>
|
||||
Sam Thorogood <thorogood@google.com> <sam.thorogood@gmail.com>
|
||||
@@ -2080,7 +1967,6 @@ Sergey 'SnakE' Gromov <snake.scaly@gmail.com>
|
||||
Sergey Arseev <sergey.arseev@intel.com>
|
||||
Sergey Dobrodey <sergey.dobrodey@synesis.ru>
|
||||
Sergey Frolov <sfrolov@google.com>
|
||||
Sergey Glushchenko <gsserge@gmail.com>
|
||||
Sergey Ivanov <ser1325@gmail.com>
|
||||
Sergey Lukjanov <me@slukjanov.name>
|
||||
Sergey Mishin <sergeymishine@gmail.com>
|
||||
@@ -2096,9 +1982,7 @@ Seth Vargo <sethvargo@gmail.com>
|
||||
Shahar Kohanim <skohanim@gmail.com>
|
||||
Shamil Garatuev <garatuev@gmail.com>
|
||||
Shane Hansen <shanemhansen@gmail.com>
|
||||
Shang Jian Ding <sding3@ncsu.edu>
|
||||
Shaozhen Ding <dsz0111@gmail.com>
|
||||
Shaquille Wyan Que <shaqqywyan@gmail.com>
|
||||
Shaun Dunning <shaun.dunning@uservoice.com>
|
||||
Shawn Elliott <selliott@microsoft.com>
|
||||
Shawn Ledbetter <sledbetter@google.com>
|
||||
@@ -2119,7 +2003,6 @@ Shubham Sharma <shubham.sha12@gmail.com>
|
||||
Shun Fan <sfan@google.com>
|
||||
Silvan Jegen <s.jegen@gmail.com>
|
||||
Simarpreet Singh <simar@linux.com>
|
||||
Simon Drake <simondrake1990@gmail.com>
|
||||
Simon Ferquel <simon.ferquel@docker.com>
|
||||
Simon Jefford <simon.jefford@gmail.com>
|
||||
Simon Rawet <simon@rawet.se>
|
||||
@@ -2130,8 +2013,6 @@ Sina Siadat <siadat@gmail.com>
|
||||
Sjoerd Siebinga <sjoerd.siebinga@gmail.com>
|
||||
Sokolov Yura <funny.falcon@gmail.com>
|
||||
Song Gao <song@gao.io>
|
||||
Soojin Nam <jsunam@gmail.com>
|
||||
Søren L. Hansen <soren@linux2go.dk>
|
||||
Spencer Kocot <spencerkocot@gmail.com>
|
||||
Spencer Nelson <s@spenczar.com>
|
||||
Spencer Tung <spencertung@google.com>
|
||||
@@ -2188,7 +2069,6 @@ Taavi Kivisik <taavi.kivisik@gmail.com>
|
||||
Tad Fisher <tadfisher@gmail.com>
|
||||
Tad Glines <tad.glines@gmail.com>
|
||||
Tadas Valiukas <tadovas@gmail.com>
|
||||
Tadeo Kondrak <me@tadeo.ca>
|
||||
Taesu Pyo <pyotaesu@gmail.com>
|
||||
Tai Le <letientai299@gmail.com>
|
||||
Taj Khattra <taj.khattra@gmail.com>
|
||||
@@ -2198,7 +2078,6 @@ Takeshi YAMANASHI <9.nashi@gmail.com>
|
||||
Takuto Ikuta <tikuta@google.com>
|
||||
Takuya Ueda <uedatakuya@gmail.com>
|
||||
Tal Shprecher <tshprecher@gmail.com>
|
||||
Tamás Gulácsi <tgulacsi78@gmail.com>
|
||||
Tamir Duberstein <tamird@gmail.com>
|
||||
Tao Qingyun <qingyunha@gmail.com>
|
||||
Tao Shen <shentaoskyking@gmail.com>
|
||||
@@ -2218,7 +2097,6 @@ Tetsuo Kiso <tetsuokiso9@gmail.com>
|
||||
Than McIntosh <thanm@google.com>
|
||||
Thanabodee Charoenpiriyakij <wingyminus@gmail.com>
|
||||
Thanatat Tamtan <acoshift@gmail.com>
|
||||
The Hatsune Daishi <nao20010128@gmail.com>
|
||||
Thiago Avelino <t@avelino.xxx>
|
||||
Thiago Fransosi Farina <thiago.farina@gmail.com> <tfarina@chromium.org>
|
||||
Thomas Alan Copeland <talan.copeland@gmail.com>
|
||||
@@ -2245,11 +2123,9 @@ Tim Ebringer <tim.ebringer@gmail.com>
|
||||
Tim Heckman <t@heckman.io>
|
||||
Tim Henderson <tim.tadh@gmail.com>
|
||||
Tim Hockin <thockin@google.com>
|
||||
Tim Möhlmann <muhlemmer@gmail.com>
|
||||
Tim Swast <swast@google.com>
|
||||
Tim Wright <tenortim@gmail.com>
|
||||
Tim Xu <xiaoxubeii@gmail.com>
|
||||
Timmy Douglas <timmyd983@gmail.com>
|
||||
Timo Savola <timo.savola@gmail.com>
|
||||
Timo Truyts <alkaloid.btx@gmail.com>
|
||||
Timothy Studd <tim@timstudd.com>
|
||||
@@ -2268,7 +2144,6 @@ Tom Lanyon <tomlanyon@google.com>
|
||||
Tom Levy <tomlevy93@gmail.com>
|
||||
Tom Limoncelli <tal@whatexit.org>
|
||||
Tom Linford <tomlinford@gmail.com>
|
||||
Tom Parkin <tom.parkin@gmail.com>
|
||||
Tom Payne <twpayne@gmail.com>
|
||||
Tom Szymanski <tgs@google.com>
|
||||
Tom Thorogood <me+google@tomthorogood.co.uk>
|
||||
@@ -2282,7 +2157,6 @@ Tony Reix <tony.reix@bull.net>
|
||||
Tony Walker <walkert.uk@gmail.com>
|
||||
Tooru Takahashi <tooru.takahashi134@gmail.com>
|
||||
Tor Andersson <tor.andersson@gmail.com>
|
||||
Torben Schinke <torben.schinke@neotos.de>
|
||||
Tormod Erevik Lea <tormodlea@gmail.com>
|
||||
Toshihiro Shiino <shiino.toshihiro@gmail.com>
|
||||
Toshiki Shima <hayabusa1419@gmail.com>
|
||||
@@ -2299,15 +2173,12 @@ Tristan Ooohry <ooohry@gmail.com>
|
||||
Tristan Rice <rice@fn.lc>
|
||||
Troels Thomsen <troels@thomsen.io>
|
||||
Trung Nguyen <trung.n.k@gmail.com>
|
||||
Tsuji Daishiro <dram.dt.shonan@gmail.com>
|
||||
Tudor Golubenco <tudor.g@gmail.com>
|
||||
Tugdual Saunier <tugdual.saunier@gmail.com>
|
||||
Tuo Shan <sturbo89@gmail.com> <shantuo@google.com>
|
||||
Tyler Bui-Palsulich <tpalsulich@google.com>
|
||||
Tyler Bunnell <tylerbunnell@gmail.com>
|
||||
Tyler Treat <ttreat31@gmail.com>
|
||||
Tyson Andre <tysonandre775@gmail.com>
|
||||
Tzach Shabtay <tzachshabtay@gmail.com>
|
||||
Tzu-Jung Lee <roylee17@currant.com>
|
||||
Udalov Max <re.udalov@gmail.com>
|
||||
Ugorji Nwoke <ugorji@gmail.com>
|
||||
@@ -2321,7 +2192,6 @@ Vadim Grek <vadimprog@gmail.com>
|
||||
Vadim Vygonets <unixdj@gmail.com>
|
||||
Val Polouchkine <vpolouch@justin.tv>
|
||||
Valentin Vidic <vvidic@valentin-vidic.from.hr>
|
||||
Vee Zhang <veezhang@126.com> <vveezhang@gmail.com>
|
||||
Vega Garcia Luis Alfonso <vegacom@gmail.com>
|
||||
Venil Noronha <veniln@vmware.com>
|
||||
Veselkov Konstantin <kostozyb@gmail.com>
|
||||
@@ -2341,7 +2211,6 @@ Visweswara R <r.visweswara@gmail.com>
|
||||
Vitaly Zdanevich <zdanevich.vitaly@ya.ru>
|
||||
Vitor De Mario <vitordemario@gmail.com>
|
||||
Vivek Sekhar <vsekhar@google.com>
|
||||
Vivian Liang <vliang88@gmail.com>
|
||||
Vlad Krasnov <vlad@cloudflare.com>
|
||||
Vladimir Evgrafov <evgrafov.vladimir@gmail.com>
|
||||
Vladimir Kovpak <cn007b@gmail.com>
|
||||
@@ -2356,7 +2225,6 @@ Volodymyr Paprotski <vpaprots@ca.ibm.com>
|
||||
W. Trevor King <wking@tremily.us>
|
||||
Wade Simmons <wade@wades.im>
|
||||
Wagner Riffel <wgrriffel@gmail.com>
|
||||
Walt Della <walt@javins.net>
|
||||
Walter Poupore <wpoupore@google.com>
|
||||
Wander Lairson Costa <wcosta@mozilla.com>
|
||||
Wang Xuerui <git@xen0n.name>
|
||||
@@ -2400,15 +2268,12 @@ Xudong Zheng <7pkvm5aw@slicealias.com>
|
||||
Xuyang Kang <xuyangkang@gmail.com>
|
||||
Yamagishi Kazutoshi <ykzts@desire.sh>
|
||||
Yan Zou <yzou@google.com>
|
||||
Yang Hau <vulxj0j8j8@gmail.com>
|
||||
Yang Tian <linuxty@gmail.com>
|
||||
Yann Hodique <yhodique@google.com>
|
||||
Yann Kerhervé <yann.kerherve@gmail.com>
|
||||
Yann Salaün <yannsalaun1@gmail.com>
|
||||
Yannic Bonenberger <contact@yannic-bonenberger.com>
|
||||
Yao Zhang <lunaria21@gmail.com>
|
||||
Yaron de Leeuw <jarondl@google.com>
|
||||
Yaroslav Vorobiov <yar.vorobiov@gmail.com>
|
||||
Yasha Bubnov <girokompass@gmail.com>
|
||||
Yasser Abdolmaleki <yasser@yasser.ca>
|
||||
Yasuharu Goto <matope.ono@gmail.com>
|
||||
@@ -2427,7 +2292,6 @@ Yoshiyuki Mineo <yoshiyuki.mineo@gmail.com>
|
||||
Yosuke Akatsuka <yosuke.akatsuka@gmail.com>
|
||||
Yu Heng Zhang <annita.zhang@cn.ibm.com>
|
||||
Yu Xuan Zhang <zyxsh@cn.ibm.com>
|
||||
Yuichi Kishimoto <yk2220s@gmail.com>
|
||||
Yuichi Nishiwaki <yuichi.nishiwaki@gmail.com>
|
||||
Yuji Yaginuma <yuuji.yaginuma@gmail.com>
|
||||
Yuki OKUSHI <huyuumi.dev@gmail.com>
|
||||
@@ -2448,7 +2312,6 @@ Zak <zrjknill@gmail.com>
|
||||
Zakatell Kanda <hi@zkanda.io>
|
||||
Zellyn Hunter <zellyn@squareup.com> <zellyn@gmail.com>
|
||||
Zev Goldstein <zev.goldstein@gmail.com>
|
||||
Zhang Boyang <zhangboyang.id@gmail.com>
|
||||
Zheng Dayu <davidzheng23@gmail.com>
|
||||
Zheng Xu <zheng.xu@arm.com>
|
||||
Zhengyu He <hzy@google.com>
|
||||
|
||||
@@ -8,6 +8,10 @@ pkg os (linux-arm), const O_SYNC = 4096
|
||||
pkg os (linux-arm-cgo), const O_SYNC = 4096
|
||||
pkg os (linux-arm), const O_SYNC = 1052672
|
||||
pkg os (linux-arm-cgo), const O_SYNC = 1052672
|
||||
pkg syscall (darwin-386), const ImplementsGetwd = false
|
||||
pkg syscall (darwin-386), func Fchflags(string, int) error
|
||||
pkg syscall (darwin-386-cgo), const ImplementsGetwd = false
|
||||
pkg syscall (darwin-386-cgo), func Fchflags(string, int) error
|
||||
pkg syscall (darwin-amd64), const ImplementsGetwd = false
|
||||
pkg syscall (darwin-amd64), func Fchflags(string, int) error
|
||||
pkg syscall (darwin-amd64-cgo), const ImplementsGetwd = false
|
||||
@@ -456,4 +460,3 @@ pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Mntonname [88]int8
|
||||
pkg text/scanner, const GoTokens = 1012
|
||||
pkg unicode, const Version = "10.0.0"
|
||||
pkg unicode, const Version = "11.0.0"
|
||||
pkg unicode, const Version = "12.0.0"
|
||||
|
||||
130
api/go1.15.txt
130
api/go1.15.txt
@@ -1,130 +0,0 @@
|
||||
pkg bufio, var ErrBadReadCount error
|
||||
pkg crypto, method (Hash) String() string
|
||||
pkg crypto/ecdsa, func SignASN1(io.Reader, *PrivateKey, []uint8) ([]uint8, error)
|
||||
pkg crypto/ecdsa, func VerifyASN1(*PublicKey, []uint8, []uint8) bool
|
||||
pkg crypto/ecdsa, method (*PrivateKey) Equal(crypto.PrivateKey) bool
|
||||
pkg crypto/ecdsa, method (*PublicKey) Equal(crypto.PublicKey) bool
|
||||
pkg crypto/ed25519, method (PrivateKey) Equal(crypto.PrivateKey) bool
|
||||
pkg crypto/ed25519, method (PublicKey) Equal(crypto.PublicKey) bool
|
||||
pkg crypto/elliptic, func MarshalCompressed(Curve, *big.Int, *big.Int) []uint8
|
||||
pkg crypto/elliptic, func UnmarshalCompressed(Curve, []uint8) (*big.Int, *big.Int)
|
||||
pkg crypto/rsa, method (*PrivateKey) Equal(crypto.PrivateKey) bool
|
||||
pkg crypto/rsa, method (*PublicKey) Equal(crypto.PublicKey) bool
|
||||
pkg crypto/tls, method (*Dialer) Dial(string, string) (net.Conn, error)
|
||||
pkg crypto/tls, method (*Dialer) DialContext(context.Context, string, string) (net.Conn, error)
|
||||
pkg crypto/tls, method (ClientAuthType) String() string
|
||||
pkg crypto/tls, method (CurveID) String() string
|
||||
pkg crypto/tls, method (SignatureScheme) String() string
|
||||
pkg crypto/tls, type Config struct, VerifyConnection func(ConnectionState) error
|
||||
pkg crypto/tls, type Dialer struct
|
||||
pkg crypto/tls, type Dialer struct, Config *Config
|
||||
pkg crypto/tls, type Dialer struct, NetDialer *net.Dialer
|
||||
pkg crypto/x509, func CreateRevocationList(io.Reader, *RevocationList, *Certificate, crypto.Signer) ([]uint8, error)
|
||||
pkg crypto/x509, type RevocationList struct
|
||||
pkg crypto/x509, type RevocationList struct, ExtraExtensions []pkix.Extension
|
||||
pkg crypto/x509, type RevocationList struct, NextUpdate time.Time
|
||||
pkg crypto/x509, type RevocationList struct, Number *big.Int
|
||||
pkg crypto/x509, type RevocationList struct, RevokedCertificates []pkix.RevokedCertificate
|
||||
pkg crypto/x509, type RevocationList struct, SignatureAlgorithm SignatureAlgorithm
|
||||
pkg crypto/x509, type RevocationList struct, ThisUpdate time.Time
|
||||
pkg database/sql, method (*DB) SetConnMaxIdleTime(time.Duration)
|
||||
pkg database/sql, method (*Row) Err() error
|
||||
pkg database/sql, type DBStats struct, MaxIdleTimeClosed int64
|
||||
pkg database/sql/driver, type Validator interface { IsValid }
|
||||
pkg database/sql/driver, type Validator interface, IsValid() bool
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_APPCONTAINER = 4096
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_APPCONTAINER ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE = 64
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY = 128
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_GUARD_CF = 16384
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_GUARD_CF ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA = 32
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_NO_BIND = 2048
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_NO_BIND ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_NO_ISOLATION = 512
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_NO_ISOLATION ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_NO_SEH = 1024
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_NO_SEH ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_NX_COMPAT = 256
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_NX_COMPAT ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE = 32768
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE ideal-int
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_WDM_DRIVER = 8192
|
||||
pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_WDM_DRIVER ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_32BIT_MACHINE = 256
|
||||
pkg debug/pe, const IMAGE_FILE_32BIT_MACHINE ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_AGGRESIVE_WS_TRIM = 16
|
||||
pkg debug/pe, const IMAGE_FILE_AGGRESIVE_WS_TRIM ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_BYTES_REVERSED_HI = 32768
|
||||
pkg debug/pe, const IMAGE_FILE_BYTES_REVERSED_HI ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_BYTES_REVERSED_LO = 128
|
||||
pkg debug/pe, const IMAGE_FILE_BYTES_REVERSED_LO ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_DEBUG_STRIPPED = 512
|
||||
pkg debug/pe, const IMAGE_FILE_DEBUG_STRIPPED ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_DLL = 8192
|
||||
pkg debug/pe, const IMAGE_FILE_DLL ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_EXECUTABLE_IMAGE = 2
|
||||
pkg debug/pe, const IMAGE_FILE_EXECUTABLE_IMAGE ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_LARGE_ADDRESS_AWARE = 32
|
||||
pkg debug/pe, const IMAGE_FILE_LARGE_ADDRESS_AWARE ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_LINE_NUMS_STRIPPED = 4
|
||||
pkg debug/pe, const IMAGE_FILE_LINE_NUMS_STRIPPED ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_LOCAL_SYMS_STRIPPED = 8
|
||||
pkg debug/pe, const IMAGE_FILE_LOCAL_SYMS_STRIPPED ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_NET_RUN_FROM_SWAP = 2048
|
||||
pkg debug/pe, const IMAGE_FILE_NET_RUN_FROM_SWAP ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_RELOCS_STRIPPED = 1
|
||||
pkg debug/pe, const IMAGE_FILE_RELOCS_STRIPPED ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP = 1024
|
||||
pkg debug/pe, const IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_SYSTEM = 4096
|
||||
pkg debug/pe, const IMAGE_FILE_SYSTEM ideal-int
|
||||
pkg debug/pe, const IMAGE_FILE_UP_SYSTEM_ONLY = 16384
|
||||
pkg debug/pe, const IMAGE_FILE_UP_SYSTEM_ONLY ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_EFI_APPLICATION = 10
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_EFI_APPLICATION ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_EFI_ROM = 13
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_EFI_ROM ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_NATIVE = 1
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_NATIVE ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_NATIVE_WINDOWS = 8
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_NATIVE_WINDOWS ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_OS2_CUI = 5
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_OS2_CUI ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_POSIX_CUI = 7
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_POSIX_CUI ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_UNKNOWN = 0
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_UNKNOWN ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION = 16
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_WINDOWS_CE_GUI = 9
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_WINDOWS_CE_GUI ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_WINDOWS_CUI = 3
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_WINDOWS_CUI ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_WINDOWS_GUI = 2
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_WINDOWS_GUI ideal-int
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_XBOX = 14
|
||||
pkg debug/pe, const IMAGE_SUBSYSTEM_XBOX ideal-int
|
||||
pkg math/big, method (*Int) FillBytes([]uint8) []uint8
|
||||
pkg net, method (*Resolver) LookupIP(context.Context, string, string) ([]IP, error)
|
||||
pkg net/url, method (*URL) EscapedFragment() string
|
||||
pkg net/url, method (*URL) Redacted() string
|
||||
pkg net/url, type URL struct, RawFragment string
|
||||
pkg os, method (*File) ReadFrom(io.Reader) (int64, error)
|
||||
pkg os, var ErrDeadlineExceeded error
|
||||
pkg regexp, method (*Regexp) SubexpIndex(string) int
|
||||
pkg strconv, func FormatComplex(complex128, uint8, int, int) string
|
||||
pkg strconv, func ParseComplex(string, int) (complex128, error)
|
||||
pkg sync, method (*Map) LoadAndDelete(interface{}) (interface{}, bool)
|
||||
pkg testing, method (*B) TempDir() string
|
||||
pkg testing, method (*T) Deadline() (time.Time, bool)
|
||||
pkg testing, method (*T) TempDir() string
|
||||
pkg testing, type TB interface, TempDir() string
|
||||
pkg time, method (*Ticker) Reset(Duration)
|
||||
19
api/next.txt
19
api/next.txt
@@ -1,19 +0,0 @@
|
||||
pkg unicode, const Version = "13.0.0"
|
||||
pkg unicode, var Chorasmian *RangeTable
|
||||
pkg unicode, var Dives_Akuru *RangeTable
|
||||
pkg unicode, var Khitan_Small_Script *RangeTable
|
||||
pkg unicode, var Yezidi *RangeTable
|
||||
pkg text/template/parse, const NodeComment = 20
|
||||
pkg text/template/parse, const NodeComment NodeType
|
||||
pkg text/template/parse, const ParseComments = 1
|
||||
pkg text/template/parse, const ParseComments Mode
|
||||
pkg text/template/parse, method (*CommentNode) Copy() Node
|
||||
pkg text/template/parse, method (*CommentNode) String() string
|
||||
pkg text/template/parse, method (CommentNode) Position() Pos
|
||||
pkg text/template/parse, method (CommentNode) Type() NodeType
|
||||
pkg text/template/parse, type CommentNode struct
|
||||
pkg text/template/parse, type CommentNode struct, Text string
|
||||
pkg text/template/parse, type CommentNode struct, embedded NodeType
|
||||
pkg text/template/parse, type CommentNode struct, embedded Pos
|
||||
pkg text/template/parse, type Mode uint
|
||||
pkg text/template/parse, type Tree struct, Mode Mode
|
||||
|
||||
@@ -379,38 +379,6 @@ func (w *Watchdog) Start() {
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h3 id="Unsynchronized_send_and_close_operations">Unsynchronized send and close operations</h3>
|
||||
|
||||
<p>
|
||||
As this example demonstrates, unsynchronized send and close operations
|
||||
on the same channel can also be a race condition:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
c := make(chan struct{}) // or buffered channel
|
||||
|
||||
// The race detector cannot derive the happens before relation
|
||||
// for the following send and close operations. These two operations
|
||||
// are unsynchronized and happen concurrently.
|
||||
go func() { c <- struct{}{} }()
|
||||
close(c)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
According to the Go memory model, a send on a channel happens before
|
||||
the corresponding receive from that channel completes. To synchronize
|
||||
send and close operations, use a receive operation that guarantees
|
||||
the send is done before the close:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
c := make(chan struct{}) // or buffered channel
|
||||
|
||||
go func() { c <- struct{}{} }()
|
||||
<-c
|
||||
close(c)
|
||||
</pre>
|
||||
|
||||
<h2 id="Supported_Systems">Supported Systems</h2>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -257,7 +257,6 @@ To use the <code>net/http</code> package, it must be imported:
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
<b>"net/http"</b>
|
||||
)
|
||||
</pre>
|
||||
@@ -675,7 +674,7 @@ The closure returned by <code>makeHandler</code> is a function that takes
|
||||
an <code>http.ResponseWriter</code> and <code>http.Request</code> (in other
|
||||
words, an <code>http.HandlerFunc</code>).
|
||||
The closure extracts the <code>title</code> from the request path, and
|
||||
validates it with the <code>validPath</code> regexp. If the
|
||||
validates it with the <code>TitleValidator</code> regexp. If the
|
||||
<code>title</code> is invalid, an error will be written to the
|
||||
<code>ResponseWriter</code> using the <code>http.NotFound</code> function.
|
||||
If the <code>title</code> is valid, the enclosed handler function
|
||||
|
||||
32
doc/asm.html
32
doc/asm.html
@@ -437,31 +437,6 @@ This is a wrapper function and should not count as disabling <code>recover</code
|
||||
(For <code>TEXT</code> items.)
|
||||
This function is a closure so it uses its incoming context register.
|
||||
</li>
|
||||
<li>
|
||||
<code>LOCAL</code> = 128
|
||||
<br>
|
||||
This symbol is local to the dynamic shared object.
|
||||
</li>
|
||||
<li>
|
||||
<code>TLSBSS</code> = 256
|
||||
<br>
|
||||
(For <code>DATA</code> and <code>GLOBL</code> items.)
|
||||
Put this data in thread local storage.
|
||||
</li>
|
||||
<li>
|
||||
<code>NOFRAME</code> = 512
|
||||
<br>
|
||||
(For <code>TEXT</code> items.)
|
||||
Do not insert instructions to allocate a stack frame and save/restore the return
|
||||
address, even if this is not a leaf function.
|
||||
Only valid on functions that declare a frame size of 0.
|
||||
</li>
|
||||
<li>
|
||||
<code>TOPFRAME</code> = 2048
|
||||
<br>
|
||||
(For <code>TEXT</code> items.)
|
||||
Function is the top of the call stack. Traceback should stop at this function.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="runtime">Runtime Coordination</h3>
|
||||
@@ -687,13 +662,6 @@ MOVQ g(CX), AX // Move g into AX.
|
||||
MOVQ g_m(AX), BX // Move g.m into BX.
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Register <code>BP</code> is callee-save.
|
||||
The assembler automatically inserts <code>BP</code> save/restore when frame size is larger than zero.
|
||||
Using <code>BP</code> as a general purpose register is allowed,
|
||||
however it can interfere with sampling-based profiling.
|
||||
</p>
|
||||
|
||||
<h3 id="arm">ARM</h3>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -49,6 +49,7 @@ The <code>go</code> program manages Go source code and runs the other
|
||||
commands listed here.
|
||||
See the command docs for usage
|
||||
details.
|
||||
<br><br>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
133
doc/contrib.html
Normal file
133
doc/contrib.html
Normal file
@@ -0,0 +1,133 @@
|
||||
<!--{
|
||||
"Title": "The Go Project",
|
||||
"Path": "/project/"
|
||||
}-->
|
||||
|
||||
<img class="gopher" src="/doc/gopher/project.png" />
|
||||
|
||||
<div id="manual-nav"></div>
|
||||
|
||||
<p>
|
||||
Go is an open source project developed by a team at
|
||||
<a href="//google.com/">Google</a> and many
|
||||
<a href="/CONTRIBUTORS">contributors</a> from the open source community.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Go is distributed under a <a href="/LICENSE">BSD-style license</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="announce"><a href="//groups.google.com/group/golang-announce">Announcements Mailing List</a></h3>
|
||||
<p>
|
||||
A low traffic mailing list for important announcements, such as new releases.
|
||||
</p>
|
||||
<p>
|
||||
We encourage all Go users to subscribe to
|
||||
<a href="//groups.google.com/group/golang-announce">golang-announce</a>.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="go1">Version history</h2>
|
||||
|
||||
<h3 id="release"><a href="/doc/devel/release.html">Release History</a></h3>
|
||||
|
||||
<p>A <a href="/doc/devel/release.html">summary</a> of the changes between Go releases. Notes for the major releases:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="/doc/go1.14">Go 1.14</a> <small>(February 2020)</small></li>
|
||||
<li><a href="/doc/go1.13">Go 1.13</a> <small>(September 2019)</small></li>
|
||||
<li><a href="/doc/go1.12">Go 1.12</a> <small>(February 2019)</small></li>
|
||||
<li><a href="/doc/go1.11">Go 1.11</a> <small>(August 2018)</small></li>
|
||||
<li><a href="/doc/go1.10">Go 1.10</a> <small>(February 2018)</small></li>
|
||||
<li><a href="/doc/go1.9">Go 1.9</a> <small>(August 2017)</small></li>
|
||||
<li><a href="/doc/go1.8">Go 1.8</a> <small>(February 2017)</small></li>
|
||||
<li><a href="/doc/go1.7">Go 1.7</a> <small>(August 2016)</small></li>
|
||||
<li><a href="/doc/go1.6">Go 1.6</a> <small>(February 2016)</small></li>
|
||||
<li><a href="/doc/go1.5">Go 1.5</a> <small>(August 2015)</small></li>
|
||||
<li><a href="/doc/go1.4">Go 1.4</a> <small>(December 2014)</small></li>
|
||||
<li><a href="/doc/go1.3">Go 1.3</a> <small>(June 2014)</small></li>
|
||||
<li><a href="/doc/go1.2">Go 1.2</a> <small>(December 2013)</small></li>
|
||||
<li><a href="/doc/go1.1">Go 1.1</a> <small>(May 2013)</small></li>
|
||||
<li><a href="/doc/go1">Go 1</a> <small>(March 2012)</small></li>
|
||||
</ul>
|
||||
|
||||
<h3 id="go1compat"><a href="/doc/go1compat">Go 1 and the Future of Go Programs</a></h3>
|
||||
<p>
|
||||
What Go 1 defines and the backwards-compatibility guarantees one can expect as
|
||||
Go 1 matures.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="resources">Developer Resources</h2>
|
||||
|
||||
<h3 id="source"><a href="https://golang.org/change">Source Code</a></h3>
|
||||
<p>Check out the Go source code.</p>
|
||||
|
||||
<h3 id="discuss"><a href="//groups.google.com/group/golang-nuts">Discussion Mailing List</a></h3>
|
||||
<p>
|
||||
A mailing list for general discussion of Go programming.
|
||||
</p>
|
||||
<p>
|
||||
Questions about using Go or announcements relevant to other Go users should be sent to
|
||||
<a href="//groups.google.com/group/golang-nuts">golang-nuts</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="golang-dev"><a href="https://groups.google.com/group/golang-dev">Developer</a> and
|
||||
<a href="https://groups.google.com/group/golang-codereviews">Code Review Mailing List</a></h3>
|
||||
<p>The <a href="https://groups.google.com/group/golang-dev">golang-dev</a>
|
||||
mailing list is for discussing code changes to the Go project.
|
||||
The <a href="https://groups.google.com/group/golang-codereviews">golang-codereviews</a>
|
||||
mailing list is for actual reviewing of the code changes (CLs).</p>
|
||||
|
||||
<h3 id="golang-checkins"><a href="https://groups.google.com/group/golang-checkins">Checkins Mailing List</a></h3>
|
||||
<p>A mailing list that receives a message summarizing each checkin to the Go repository.</p>
|
||||
|
||||
<h3 id="build_status"><a href="//build.golang.org/">Build Status</a></h3>
|
||||
<p>View the status of Go builds across the supported operating
|
||||
systems and architectures.</p>
|
||||
|
||||
|
||||
<h2 id="howto">How you can help</h2>
|
||||
|
||||
<h3><a href="//golang.org/issue">Reporting issues</a></h3>
|
||||
|
||||
<p>
|
||||
If you spot bugs, mistakes, or inconsistencies in the Go project's code or
|
||||
documentation, please let us know by
|
||||
<a href="//golang.org/issue/new">filing a ticket</a>
|
||||
on our <a href="//golang.org/issue">issue tracker</a>.
|
||||
(Of course, you should check it's not an existing issue before creating
|
||||
a new one.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
We pride ourselves on being meticulous; no issue is too small.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Security-related issues should be reported to
|
||||
<a href="mailto:security@golang.org">security@golang.org</a>.<br>
|
||||
See the <a href="/security">security policy</a> for more details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Community-related issues should be reported to
|
||||
<a href="mailto:conduct@golang.org">conduct@golang.org</a>.<br>
|
||||
See the <a href="/conduct">Code of Conduct</a> for more details.
|
||||
</p>
|
||||
|
||||
<h3><a href="/doc/contribute.html">Contributing code & documentation</a></h3>
|
||||
|
||||
<p>
|
||||
Go is an open source project and we welcome contributions from the community.
|
||||
</p>
|
||||
<p>
|
||||
To get started, read these <a href="/doc/contribute.html">contribution
|
||||
guidelines</a> for information on design, testing, and our code review process.
|
||||
</p>
|
||||
<p>
|
||||
Check <a href="//golang.org/issue">the tracker</a> for
|
||||
open issues that interest you. Those labeled
|
||||
<a href="https://github.com/golang/go/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22">help wanted</a>
|
||||
are particularly in need of outside help.
|
||||
</p>
|
||||
@@ -174,7 +174,7 @@ The main Go repository is located at
|
||||
a Git server hosted by Google.
|
||||
Authentication on the web server is made through your Google account, but
|
||||
you also need to configure <code>git</code> on your computer to access it.
|
||||
Follow these steps:
|
||||
Follow this steps:
|
||||
</p>
|
||||
|
||||
<ol>
|
||||
@@ -263,24 +263,6 @@ a new issue</a> or by claiming
|
||||
an <a href="https://golang.org/issues">existing one</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="where">Where to contribute</h3>
|
||||
|
||||
<p>
|
||||
The Go project consists of the main
|
||||
<a href="https://go.googlesource.com/go">go</a> repository, which contains the
|
||||
source code for the Go language, as well as many golang.org/x/... repostories.
|
||||
These contain the various tools and infrastructure that support Go. For
|
||||
example, <a href="https://go.googlesource.com/pkgsite">golang.org/x/pkgsite</a>
|
||||
is for <a href="https://pkg.go.dev">pkg.go.dev</a>,
|
||||
<a href="https://go.googlesource.com/playground">golang.org/x/playground</a>
|
||||
is for the Go playground, and
|
||||
<a href="https://go.googlesource.com/tools">golang.org/x/tools</a> contains
|
||||
a variety of Go tools, including the Go language server,
|
||||
<a href="https://golang.org/s/gopls">gopls</a>. You can see a
|
||||
list of all the golang.org/x/... repositories on
|
||||
<a href="https://go.googlesource.com">go.googlesource.com</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="check_tracker">Check the issue tracker</h3>
|
||||
|
||||
<p>
|
||||
@@ -290,13 +272,6 @@ always the first place to go.
|
||||
Issues are triaged to categorize them and manage the workflow.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The majority of the golang.org/x/... repos also use the main Go
|
||||
issue tracker. However, a few of these repositories manage their issues
|
||||
separately, so please be sure to check the right tracker for the repository to
|
||||
which you would like to contribute.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Most issues will be marked with one of the following workflow labels:
|
||||
</p>
|
||||
@@ -310,7 +285,7 @@ Most issues will be marked with one of the following workflow labels:
|
||||
<b>NeedsDecision</b>: the issue is relatively well understood, but the
|
||||
Go team hasn't yet decided the best way to address it.
|
||||
It would be better to wait for a decision before writing code.
|
||||
If you are interested in working on an issue in this state,
|
||||
If you are interested on working on an issue in this state,
|
||||
feel free to "ping" maintainers in the issue's comments
|
||||
if some time has passed without a decision.
|
||||
</li>
|
||||
@@ -354,16 +329,11 @@ the code review tool is not the place for high-level discussions.
|
||||
|
||||
<p>
|
||||
When planning work, please note that the Go project follows a <a
|
||||
href="https://golang.org/wiki/Go-Release-Cycle">six-month development cycle</a>
|
||||
for the main Go repository. The latter half of each cycle is a three-month
|
||||
feature freeze during which only bug fixes and documentation updates are
|
||||
accepted. New contributions can be sent during a feature freeze, but they will
|
||||
not be merged until the freeze is over. The freeze applies to the entire main
|
||||
repository as well as to the code in golang.org/x/... repositories that is
|
||||
needed to build the binaries included in the release. See the lists of packages
|
||||
vendored into
|
||||
<a href="https://github.com/golang/go/blob/master/src/vendor/modules.txt">the standard library</a>
|
||||
and the <a href="https://github.com/golang/go/blob/master/src/cmd/vendor/modules.txt"><code>go</code> command</a>.
|
||||
href="https://golang.org/wiki/Go-Release-Cycle">six-month development cycle</a>.
|
||||
The latter half of each cycle is a three-month feature freeze during
|
||||
which only bug fixes and documentation updates are accepted.
|
||||
New contributions can be sent during a feature freeze, but they will
|
||||
not be merged until the freeze is over.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -438,29 +408,13 @@ This is an overview of the overall process:
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<b>Step 1:</b> Clone the source code from <code>go.googlesource.com</code> and
|
||||
make sure it's stable by compiling and testing it once.
|
||||
|
||||
<p>If you're making a change to the
|
||||
<a href="https://go.googlesource.com/go">main Go repository</a>:</p>
|
||||
|
||||
<b>Step 1:</b> Clone the Go source code from <code>go.googlesource.com</code>
|
||||
and make sure it's stable by compiling and testing it once:
|
||||
<pre>
|
||||
$ git clone https://go.googlesource.com/go
|
||||
$ cd go/src
|
||||
$ ./all.bash # compile and test
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If you're making a change to one of the golang.org/x/... repositories
|
||||
(<a href="https://go.googlesource.com/tools">golang.org/x/tools</a>,
|
||||
in this example):
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ git clone https://go.googlesource.com/tools
|
||||
$ cd tools
|
||||
$ go test ./... # compile and test
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
@@ -480,18 +434,10 @@ $ [etc.]
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<b>Step 3:</b> Test your changes, either by running the tests in the package
|
||||
you edited or by re-running <code>all.bash</code>.
|
||||
|
||||
<p>In the main Go repository:</p>
|
||||
<b>Step 3:</b> Test your changes, re-running <code>all.bash</code>.
|
||||
<pre>
|
||||
$ ./all.bash # recompile and test
|
||||
</pre>
|
||||
|
||||
<p>In a golang.org/x/... repository:</p>
|
||||
<pre>
|
||||
$ go test ./... # recompile and test
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
@@ -519,7 +465,7 @@ The rest of this section describes these steps in more detail.
|
||||
</p>
|
||||
|
||||
|
||||
<h3 id="checkout_go">Step 1: Clone the source code</h3>
|
||||
<h3 id="checkout_go">Step 1: Clone the Go source code</h3>
|
||||
|
||||
<p>
|
||||
In addition to a recent Go installation, you need to have a local copy of the source
|
||||
@@ -529,19 +475,11 @@ you want as long as it's outside your <code>GOPATH</code>.
|
||||
Clone from <code>go.googlesource.com</code> (not GitHub):
|
||||
</p>
|
||||
|
||||
<p>Main Go repository:</p>
|
||||
<pre>
|
||||
$ git clone https://go.googlesource.com/go
|
||||
$ cd go
|
||||
</pre>
|
||||
|
||||
<p>golang.org/x/... repository</p>
|
||||
(<a href="https://go.googlesource.com/tools">golang.org/x/tools</a> in this example):
|
||||
<pre>
|
||||
$ git clone https://go.googlesource.com/tools
|
||||
$ cd tools
|
||||
</pre>
|
||||
|
||||
<h3 id="make_branch">Step 2: Prepare changes in a new branch</h3>
|
||||
|
||||
<p>
|
||||
@@ -605,20 +543,18 @@ into a single one.
|
||||
<p>
|
||||
You've <a href="code.html">written and tested your code</a>, but
|
||||
before sending code out for review, run <i>all the tests for the whole
|
||||
tree</i> to make sure the changes don't break other packages or programs.
|
||||
tree</i> to make sure the changes don't break other packages or programs:
|
||||
</p>
|
||||
|
||||
<h4 id="test-gorepo">In the main Go repository</h4>
|
||||
|
||||
<p>This can be done by running <code>all.bash</code>:</p>
|
||||
|
||||
<pre>
|
||||
$ cd go/src
|
||||
$ ./all.bash
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
(To build under Windows use <code>all.bat</code>)
|
||||
(To build under Windows use <code>all.bat</code>; this also requires
|
||||
setting the environment variable <code>GOROOT_BOOTSTRAP</code> to the
|
||||
directory holding the Go tree for the bootstrap compiler.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -640,33 +576,6 @@ See also
|
||||
the section on how to <a href="#quick_test">test your changes quickly</a>.
|
||||
</p>
|
||||
|
||||
<h4 id="test-xrepo">In the golang.org/x/... repositories</h4>
|
||||
|
||||
<p>
|
||||
Run the tests for the entire repository
|
||||
(<a href="https://go.googlesource.com/tools">golang.org/x/tools</a>,
|
||||
in this example):
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ cd tools
|
||||
$ go test ./...
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If you're concerned about the build status,
|
||||
you can check the <a href="https://build.golang.org">Build Dashboard</a>.
|
||||
Test failures may also be caught by the TryBots in code review.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Some repositories, like
|
||||
<a href="https://go.googlesource.com/vscode-go">golang.org/x/vscode-go</a> will
|
||||
have different testing infrastructures, so always check the documentation
|
||||
for the repository in which you are working. The README file in the root of the
|
||||
repository will usually have this information.
|
||||
</p>
|
||||
|
||||
<h3 id="mail">Step 4: Send changes for review</h3>
|
||||
|
||||
<p>
|
||||
@@ -813,10 +722,10 @@ when the change is applied.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you are sending a change against a golang.org/x/... repository, you must use
|
||||
If you are sending a change against a subrepository, you must use
|
||||
the fully-qualified syntax supported by GitHub to make sure the change is
|
||||
linked to the issue in the main repository, not the x/ repository.
|
||||
Most issues are tracked in the main repository's issue tracker.
|
||||
linked to the issue in the main repository, not the subrepository.
|
||||
All issues are tracked in the main repository's issue tracker.
|
||||
The correct form is "Fixes golang/go#159".
|
||||
</p>
|
||||
|
||||
@@ -1099,7 +1008,7 @@ followed by <code>run.bash</code>.
|
||||
|
||||
<li>
|
||||
In this section, we'll call the directory into which you cloned the Go repository <code>$GODIR</code>.
|
||||
The <code>go</code> tool built by <code>$GODIR/src/make.bash</code> will be installed
|
||||
The <code>go</code> tool built by <code>$GODIR/make.bash</code> will be installed
|
||||
in <code>$GODIR/bin/go</code> and you
|
||||
can invoke it to test your code.
|
||||
For instance, if you
|
||||
@@ -1163,6 +1072,25 @@ $ $GODIR/bin/go run run.go
|
||||
</pre>
|
||||
</ul>
|
||||
|
||||
<h3 id="subrepos">Contributing to subrepositories (golang.org/x/...)</h3>
|
||||
|
||||
<p>
|
||||
If you are contributing a change to a subrepository, obtain the
|
||||
Go package using <code>go get</code>.
|
||||
For example, to contribute
|
||||
to <code>golang.org/x/oauth2</code>, check out the code by running:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ go get -d golang.org/x/oauth2/...
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Then, change your directory to the package's source directory
|
||||
(<code>$GOPATH/src/golang.org/x/oauth2</code>), and follow the
|
||||
normal contribution flow.
|
||||
</p>
|
||||
|
||||
|
||||
<h3 id="cc">Specifying a reviewer / CCing others</h3>
|
||||
|
||||
@@ -1283,5 +1211,5 @@ $ git codereview mail HEAD
|
||||
|
||||
<p>
|
||||
Make sure to explicitly specify <code>HEAD</code>, which is usually not required when sending
|
||||
single changes. More details can be found in the <a href="https://pkg.go.dev/golang.org/x/review/git-codereview?tab=doc#hdr-Multiple_Commit_Work_Branches">git-codereview documentation</a>.
|
||||
single changes.
|
||||
</p>
|
||||
|
||||
@@ -18,13 +18,13 @@ Gccgo has native gdb support.
|
||||
</p>
|
||||
<p>
|
||||
Note that
|
||||
<a href="https://github.com/go-delve/delve">Delve</a> is a better
|
||||
<a href="https://github.com/derekparker/delve">Delve</a> is a better
|
||||
alternative to GDB when debugging Go programs built with the standard
|
||||
toolchain. It understands the Go runtime, data structures, and
|
||||
expressions better than GDB. Delve currently supports Linux, OSX,
|
||||
and Windows on <code>amd64</code>.
|
||||
For the most up-to-date list of supported platforms, please see
|
||||
<a href="https://github.com/go-delve/delve/tree/master/Documentation/installation">
|
||||
<a href="https://github.com/derekparker/delve/tree/master/Documentation/installation">
|
||||
the Delve documentation</a>.
|
||||
</p>
|
||||
</i>
|
||||
|
||||
@@ -20,7 +20,7 @@ editing, navigation, testing, and debugging experience.
|
||||
|
||||
<ul>
|
||||
<li><a href="https://github.com/fatih/vim-go">vim</a>: vim-go plugin provides Go programming language support</li>
|
||||
<li><a href="https://marketplace.visualstudio.com/items?itemName=golang.go">Visual Studio Code</a>:
|
||||
<li><a href="https://marketplace.visualstudio.com/items?itemName=lukehoban.Go">Visual Studio Code</a>:
|
||||
Go extension provides support for the Go programming language</li>
|
||||
<li><a href="https://www.jetbrains.com/go">GoLand</a>: GoLand is distributed either as a standalone IDE
|
||||
or as a plugin for IntelliJ IDEA Ultimate</li>
|
||||
|
||||
@@ -2336,9 +2336,10 @@ of the request from the client.
|
||||
</p>
|
||||
<p>
|
||||
For brevity, let's ignore POSTs and assume HTTP requests are always
|
||||
GETs; that simplification does not affect the way the handlers are set up.
|
||||
Here's a trivial implementation of a handler to count the number of times
|
||||
the page is visited.
|
||||
GETs; that simplification does not affect the way the handlers are
|
||||
set up. Here's a trivial but complete implementation of a handler to
|
||||
count the number of times the
|
||||
page is visited.
|
||||
</p>
|
||||
<pre>
|
||||
// Simple counter server.
|
||||
@@ -2354,11 +2355,6 @@ func (ctr *Counter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
<p>
|
||||
(Keeping with our theme, note how <code>Fprintf</code> can print to an
|
||||
<code>http.ResponseWriter</code>.)
|
||||
In a real server, access to <code>ctr.n</code> would need protection from
|
||||
concurrent access.
|
||||
See the <code>sync</code> and <code>atomic</code> packages for suggestions.
|
||||
</p>
|
||||
<p>
|
||||
For reference, here's how to attach such a server to a node on the URL tree.
|
||||
</p>
|
||||
<pre>
|
||||
@@ -2699,7 +2695,8 @@ type ReadWriter interface {
|
||||
<p>
|
||||
This says just what it looks like: A <code>ReadWriter</code> can do
|
||||
what a <code>Reader</code> does <em>and</em> what a <code>Writer</code>
|
||||
does; it is a union of the embedded interfaces.
|
||||
does; it is a union of the embedded interfaces (which must be disjoint
|
||||
sets of methods).
|
||||
Only interfaces can be embedded within interfaces.
|
||||
</p>
|
||||
<p>
|
||||
|
||||
@@ -79,13 +79,15 @@ release.
|
||||
<h2 id="Source_code">Source code</h2>
|
||||
|
||||
<p>
|
||||
If you cannot use a release, or prefer to build gccgo for yourself, the
|
||||
gccgo source code is accessible via Git. The GCC web site has
|
||||
<a href="https://gcc.gnu.org/git.html">instructions for getting the GCC
|
||||
source code</a>. The gccgo source code is included. As a convenience, a
|
||||
stable version of the Go support is available in the
|
||||
<code>devel/gccgo</code> branch of the main GCC code repository:
|
||||
<code>git://gcc.gnu.org/git/gcc.git</code>.
|
||||
If you cannot use a release, or prefer to build gccgo for
|
||||
yourself,
|
||||
the gccgo source code is accessible via Subversion. The
|
||||
GCC web site
|
||||
has <a href="https://gcc.gnu.org/svn.html">instructions for getting the
|
||||
GCC source code</a>. The gccgo source code is included. As a
|
||||
convenience, a stable version of the Go support is available in
|
||||
a branch of the main GCC code
|
||||
repository: <code>svn://gcc.gnu.org/svn/gcc/branches/gccgo</code>.
|
||||
This branch is periodically updated with stable Go compiler sources.
|
||||
</p>
|
||||
|
||||
@@ -137,10 +139,13 @@ which you have write access):
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
git clone git://sourceware.org/git/binutils-gdb.git
|
||||
cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src login
|
||||
[password is "anoncvs"]
|
||||
[The next command will create a directory named src, not binutils]
|
||||
cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src co binutils
|
||||
mkdir binutils-objdir
|
||||
cd binutils-objdir
|
||||
../binutils-gdb/configure --enable-gold=default --prefix=/opt/gold
|
||||
../src/configure --enable-gold=default --prefix=/opt/gold
|
||||
make
|
||||
make install
|
||||
</pre>
|
||||
@@ -171,7 +176,7 @@ described above):
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
git clone --branch devel/gccgo git://gcc.gnu.org/git/gcc.git gccgo
|
||||
svn checkout svn://gcc.gnu.org/svn/gcc/branches/gccgo gccgo
|
||||
mkdir objdir
|
||||
cd objdir
|
||||
../gccgo/configure --prefix=/opt/gccgo --enable-languages=c,c++,go --with-ld=/opt/gold/bin/ld
|
||||
|
||||
@@ -30,7 +30,7 @@ adds <a href="#test">caching of successful test results</a>,
|
||||
runs <a href="#test-vet">vet automatically during tests</a>,
|
||||
and
|
||||
permits <a href="#cgo">passing string values directly between Go and C using cgo</a>.
|
||||
A new <a href="#cgo">hard-coded set of safe compiler options</a> may cause
|
||||
A new <a href="#cgo">compiler option whitelist</a> may cause
|
||||
unexpected <a href="https://golang.org/s/invalidflag"><code>invalid
|
||||
flag</code></a> errors in code that built successfully with older
|
||||
releases.
|
||||
@@ -267,7 +267,7 @@ and the <a href="/cmd/test2json/">test2json documentation</a>.
|
||||
|
||||
<p>
|
||||
Options specified by cgo using <code>#cgo CFLAGS</code> and the like
|
||||
are now checked against a list of permitted options.
|
||||
are now checked against a whitelist of permitted options.
|
||||
This closes a security hole in which a downloaded package uses
|
||||
compiler options like
|
||||
<span style="white-space: nowrap"><code>-fplugin</code></span>
|
||||
|
||||
@@ -466,15 +466,7 @@ Do not send CLs removing the interior tags from such phrases.
|
||||
certificate, and letting the package automatically select the best one.
|
||||
Note that the performance of this selection is going to be poor unless the
|
||||
<a href="/pkg/crypto/tls/#Certificate.Leaf"><code>Certificate.Leaf</code></a>
|
||||
field is set. The
|
||||
<a href="/pkg/crypto/tls/#Config.NameToCertificate"><code>Config.NameToCertificate</code></a>
|
||||
field, which only supports associating a single certificate with
|
||||
a give name, is now deprecated and should be left as <code>nil</code>.
|
||||
Similarly the
|
||||
<a href="/pkg/crypto/tls/#Config.BuildNameToCertificate"><code>Config.BuildNameToCertificate</code></a>
|
||||
method, which builds the <code>NameToCertificate</code> field
|
||||
from the leaf certificates, is now deprecated and should not be
|
||||
called.
|
||||
field is set.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 175517 -->
|
||||
@@ -609,12 +601,6 @@ Do not send CLs removing the interior tags from such phrases.
|
||||
If a program needs to accept invalid numbers like the empty string,
|
||||
consider wrapping the type with <a href="/pkg/encoding/json/#Unmarshaler"><code>Unmarshaler</code></a>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 200237 -->
|
||||
<a href="/pkg/encoding/json/#Unmarshal"><code>Unmarshal</code></a>
|
||||
can now support map keys with string underlying type which implement
|
||||
<a href="/pkg/encoding/#TextUnmarshaler"><code>encoding.TextUnmarshaler</code></a>.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- encoding/json -->
|
||||
|
||||
|
||||
1051
doc/go1.15.html
1051
doc/go1.15.html
File diff suppressed because it is too large
Load Diff
191
doc/go1.16.html
191
doc/go1.16.html
@@ -1,191 +0,0 @@
|
||||
<!--{
|
||||
"Title": "Go 1.16 Release Notes",
|
||||
"Path": "/doc/go1.16"
|
||||
}-->
|
||||
|
||||
<!--
|
||||
NOTE: In this document and others in this directory, the convention is to
|
||||
set fixed-width phrases with non-fixed-width spaces, as in
|
||||
<code>hello</code> <code>world</code>.
|
||||
Do not send CLs removing the interior tags from such phrases.
|
||||
-->
|
||||
|
||||
<style>
|
||||
main ul li { margin: 0.5em 0; }
|
||||
</style>
|
||||
|
||||
<h2 id="introduction">DRAFT RELEASE NOTES — Introduction to Go 1.16</h2>
|
||||
|
||||
<p>
|
||||
<strong>
|
||||
Go 1.16 is not yet released. These are work-in-progress
|
||||
release notes. Go 1.16 is expected to be released in February 2021.
|
||||
</strong>
|
||||
</p>
|
||||
|
||||
<h2 id="language">Changes to the language</h2>
|
||||
|
||||
<p>
|
||||
TODO
|
||||
</p>
|
||||
|
||||
<h2 id="ports">Ports</h2>
|
||||
|
||||
<p>
|
||||
TODO
|
||||
</p>
|
||||
|
||||
<h2 id="tools">Tools</h2>
|
||||
|
||||
<p>
|
||||
TODO
|
||||
</p>
|
||||
|
||||
<h3 id="go-command">Go command</h3>
|
||||
|
||||
<p><!-- golang.org/issue/24031 -->
|
||||
<code>retract</code> directives may now be used in a <code>go.mod</code> file
|
||||
to indicate that certain published versions of the module should not be used
|
||||
by other modules. A module author may retract a version after a severe problem
|
||||
is discovered or if the version was published unintentionally.<br>
|
||||
TODO: write and link to section in golang.org/ref/mod<br>
|
||||
TODO: write and link to tutorial or blog post
|
||||
</p>
|
||||
|
||||
<p><!-- golang.org/issue/29062 -->
|
||||
When using <code>go test</code>, a test that
|
||||
calls <code>os.Exit(0)</code> during execution of a test function
|
||||
will now be considered to fail.
|
||||
This will help catch cases in which a test calls code that calls
|
||||
os.Exit(0) and thereby stops running all future tests.
|
||||
If a <code>TestMain</code> function calls <code>os.Exit(0)</code>
|
||||
that is still considered to be a passing test.
|
||||
</p>
|
||||
|
||||
<h4 id="all-pattern">The <code>all</code> pattern</h4>
|
||||
|
||||
<p><!-- golang.org/cl/240623 -->
|
||||
When the main module's <code>go.mod</code> file
|
||||
declares <code>go</code> <code>1.16</code> or higher, the <code>all</code>
|
||||
package pattern now matches only those packages that are transitively imported
|
||||
by a package or test found in the main module. (Packages imported by <em>tests
|
||||
of</em> packages imported by the main module are no longer included.) This is
|
||||
the same set of packages retained
|
||||
by <code>go</code> <code>mod</code> <code>vendor</code> since Go 1.11.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
TODO
|
||||
</p>
|
||||
|
||||
<h2 id="runtime">Runtime</h2>
|
||||
|
||||
<p>
|
||||
TODO
|
||||
</p>
|
||||
|
||||
<h2 id="compiler">Compiler</h2>
|
||||
|
||||
<p>
|
||||
TODO
|
||||
</p>
|
||||
|
||||
<h2 id="linker">Linker</h2>
|
||||
|
||||
<p>
|
||||
This release includes additional improvements to the Go linker,
|
||||
reducing linker resource usage (both time and memory) and improving
|
||||
code robustness/maintainability. These changes form the second half
|
||||
of a two-release project to
|
||||
<a href="https://golang.org/s/better-linker">modernize the Go
|
||||
linker</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The linker changes in 1.16 extend the 1.15 improvements to all
|
||||
supported architecture/OS combinations (the 1.15 performance improvements
|
||||
were primarily focused on <code>ELF</code>-based OSes and
|
||||
<code>amd64</code> architectures). For a representative set of
|
||||
large Go programs, linking is 20-35% faster than 1.15 and requires
|
||||
5-15% less memory on average for <code>linux/amd64</code>, with larger
|
||||
improvements for other architectures and OSes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
TODO: update with final numbers later in the release.
|
||||
</p>
|
||||
|
||||
<h2 id="library">Core library</h2>
|
||||
|
||||
<p>
|
||||
TODO
|
||||
</p>
|
||||
|
||||
<h3 id="net"><a href="/pkg/net/">net</a></h3>
|
||||
|
||||
<p><!-- CL 250357 -->
|
||||
The case of I/O on a closed network connection, or I/O on a network
|
||||
connection that is closed before any of the I/O completes, can now
|
||||
be detected using the new <a href="/pkg/net/#ErrClosed">ErrClosed</a> error.
|
||||
A typical use would be <code>errors.Is(err, net.ErrClosed)</code>.
|
||||
In earlier releases the only way to reliably detect this case was to
|
||||
match the string returned by the <code>Error</code> method
|
||||
with <code>"use of closed network connection"</code>.
|
||||
</p>
|
||||
|
||||
|
||||
<h3 id="text/template/parse"><a href="/pkg/text/template/parse/">text/template/parse</a></h3>
|
||||
|
||||
<p><!-- CL 229398, golang.org/issue/34652 -->
|
||||
A new <a href="/pkg/text/template/parse/#CommentNode"><code>CommentNode</code></a>
|
||||
was added to the parse tree. The <a href="/pkg/text/template/parse/#Mode"><code>Mode</code></a>
|
||||
field in the <code>parse.Tree</code> enables access to it.
|
||||
</p>
|
||||
<!-- text/template/parse -->
|
||||
|
||||
<h3 id="unicode"><a href="/pkg/unicode/">unicode</a></h3>
|
||||
|
||||
<p><!-- CL 248765 -->
|
||||
The <a href="/pkg/unicode/"><code>unicode</code></a> package and associated
|
||||
support throughout the system has been upgraded from Unicode 12.0.0 to
|
||||
<a href="https://www.unicode.org/versions/Unicode13.0.0/">Unicode 13.0.0</a>,
|
||||
which adds 5,930 new characters, including four new scripts, and 55 new emoji.
|
||||
Unicode 13.0.0 also designates plane 3 (U+30000-U+3FFFF) as the tertiary
|
||||
ideographic plane.
|
||||
</p>
|
||||
|
||||
<h3 id="minor_library_changes">Minor changes to the library</h3>
|
||||
|
||||
<p>
|
||||
As always, there are various minor changes and updates to the library,
|
||||
made with the Go 1 <a href="/doc/go1compat">promise of compatibility</a>
|
||||
in mind.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
TODO
|
||||
</p>
|
||||
|
||||
<dl id="net/http"><dt><a href="/pkg/net/http/">net/http</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 233637 -->
|
||||
In the <a href="/pkg/net/http/"><code>net/http</code></a> package, the
|
||||
behavior of <a href="/pkg/net/http/#StripPrefix"><code>StripPrefix</code></a>
|
||||
has been changed to strip the prefix from the request URL's
|
||||
<code>RawPath</code> field in addition to its <code>Path</code> field.
|
||||
In past releases, only the <code>Path</code> field was trimmed, and so if the
|
||||
request URL contained any escaped characters the URL would be modified to
|
||||
have mismatched <code>Path</code> and <code>RawPath</code> fields.
|
||||
In Go 1.16, <code>StripPrefix</code> trims both fields.
|
||||
If there are escaped characters in the prefix part of the request URL the
|
||||
handler serves a 404 instead of its previous behavior of invoking the
|
||||
underlying handler with a mismatched <code>Path</code>/<code>RawPath</code> pair.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 252497 -->
|
||||
The <a href="/pkg/net/http/"><code>net/http</code></a> package now rejects HTTP range requests
|
||||
of the form <code>"Range": "bytes=--N"</code> where <code>"-N"</code> is a negative suffix length, for
|
||||
example <code>"Range": "bytes=--2"</code>. It now replies with a <code>416 "Range Not Satisfiable"</code> response.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- net/http -->
|
||||
@@ -515,7 +515,7 @@ when used well, can result in clean error-handling code.
|
||||
See the <a href="/doc/articles/defer_panic_recover.html">Defer, Panic, and Recover</a> article for details.
|
||||
Also, the <a href="https://blog.golang.org/errors-are-values">Errors are values</a> blog post
|
||||
describes one approach to handling errors cleanly in Go by demonstrating that,
|
||||
since errors are just values, the full power of Go can be deployed in error handling.
|
||||
since errors are just values, the full power of Go can deployed in error handling.
|
||||
</p>
|
||||
|
||||
<h3 id="assertions">
|
||||
|
||||
@@ -273,7 +273,9 @@ func f() {
|
||||
a = "hello, world"
|
||||
<-c
|
||||
}
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
func main() {
|
||||
go f()
|
||||
c <- 0
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
<h2 id="help">Get help</h2>
|
||||
|
||||
<img class="gopher" src="/doc/gopher/help.png" alt=""/>
|
||||
<img class="gopher" src="/doc/gopher/help.png"/>
|
||||
|
||||
{{if not $.GoogleCN}}
|
||||
<h3 id="mailinglist"><a href="https://groups.google.com/group/golang-nuts">Go Nuts Mailing List</a></h3>
|
||||
|
||||
@@ -33,7 +33,7 @@ compiler using the GCC back end, see
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The Go compilers support the following instruction sets:
|
||||
The Go compilers support twelve instruction sets:
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
@@ -48,30 +48,24 @@ The Go compilers support the following instruction sets:
|
||||
<dd>
|
||||
The <code>ARM</code> instruction set, 64-bit (<code>AArch64</code>) and 32-bit.
|
||||
</dd>
|
||||
<dt>
|
||||
<code>mips64</code>, <code>mips64le</code>, <code>mips</code>, <code>mipsle</code>
|
||||
</dt>
|
||||
<dd>
|
||||
The <code>MIPS</code> instruction set, big- and little-endian, 64- and 32-bit.
|
||||
</dd>
|
||||
<dt>
|
||||
<code>ppc64</code>, <code>ppc64le</code>
|
||||
</dt>
|
||||
<dd>
|
||||
The 64-bit PowerPC instruction set, big- and little-endian.
|
||||
</dd>
|
||||
<dt>
|
||||
<code>riscv64</code>
|
||||
</dt>
|
||||
<dd>
|
||||
The 64-bit RISC-V instruction set.
|
||||
</dd>
|
||||
<dt>
|
||||
<code>s390x</code>
|
||||
</dt>
|
||||
<dd>
|
||||
The IBM z/Architecture.
|
||||
</dd>
|
||||
<dt>
|
||||
<code>mips64</code>, <code>mips64le</code>, <code>mips</code>, <code>mipsle</code>
|
||||
</dt>
|
||||
<dd>
|
||||
The <code>MIPS</code> instruction set, big- and little-endian, 64- and 32-bit.
|
||||
</dd>
|
||||
<dt>
|
||||
<code>wasm</code>
|
||||
</dt>
|
||||
@@ -112,17 +106,23 @@ Go does not support CentOS 6 on these systems.
|
||||
|
||||
</div>
|
||||
|
||||
<h2 id="go14">Install Go compiler binaries for bootstrap</h2>
|
||||
<h2 id="go14">Install Go compiler binaries</h2>
|
||||
|
||||
<p>
|
||||
The Go toolchain is written in Go. To build it, you need a Go compiler installed.
|
||||
The scripts that do the initial build of the tools look for a "go" command
|
||||
in <code>$PATH</code>, so as long as you have Go installed in your
|
||||
system and configured in your <code>$PATH</code>, you are ready to build Go
|
||||
from source.
|
||||
Or if you prefer you can set <code>$GOROOT_BOOTSTRAP</code> to the
|
||||
root of a Go installation to use to build the new Go toolchain;
|
||||
<code>$GOROOT_BOOTSTRAP/bin/go</code> should be the go command to use.</p>
|
||||
The scripts that do the initial build of the tools look for an existing Go tool
|
||||
chain in <code>$GOROOT_BOOTSTRAP</code>.
|
||||
If unset, the default value of <code>GOROOT_BOOTSTRAP</code>
|
||||
is <code>$HOME/go1.4</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
There are many options for the bootstrap toolchain.
|
||||
After obtaining one, set <code>GOROOT_BOOTSTRAP</code> to the
|
||||
directory containing the unpacked tree.
|
||||
For example, <code>$GOROOT_BOOTSTRAP/bin/go</code> should be
|
||||
the <code>go</code> command binary for the bootstrap toolchain.
|
||||
</p>
|
||||
|
||||
<h3 id="bootstrapFromBinaryRelease">Bootstrap toolchain from binary release</h3>
|
||||
|
||||
@@ -507,7 +507,7 @@ These default to the values of <code>$GOHOSTOS</code> and
|
||||
|
||||
<p>
|
||||
Choices for <code>$GOOS</code> are
|
||||
<code>android</code>, <code>darwin</code> (macOS/iOS),
|
||||
<code>android</code>, <code>darwin</code> (macOS 10.11 and above and iOS),
|
||||
<code>dragonfly</code>, <code>freebsd</code>, <code>illumos</code>, <code>js</code>,
|
||||
<code>linux</code>, <code>netbsd</code>, <code>openbsd</code>,
|
||||
<code>plan9</code>, <code>solaris</code> and <code>windows</code>.
|
||||
@@ -546,9 +546,15 @@ The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are:
|
||||
<td></td><td><code>android</code></td> <td><code>arm64</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>darwin</code></td> <td><code>386</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>darwin</code></td> <td><code>amd64</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>darwin</code></td> <td><code>arm</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>darwin</code></td> <td><code>arm64</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -600,9 +606,6 @@ The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are:
|
||||
<td></td><td><code>linux</code></td> <td><code>mips64le</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>linux</code></td> <td><code>riscv64</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td><code>linux</code></td> <td><code>s390x</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<p>
|
||||
<a href="/dl/" target="_blank">Official binary
|
||||
distributions</a> are available for the FreeBSD (release 10-STABLE and above),
|
||||
Linux, macOS (10.11 and above), and Windows operating systems and
|
||||
Linux, macOS (10.10 and above), and Windows operating systems and
|
||||
the 32-bit (<code>386</code>) and 64-bit (<code>amd64</code>) x86 processor
|
||||
architectures.
|
||||
</p>
|
||||
@@ -49,7 +49,7 @@ If your OS or architecture is not on the list, you may be able to
|
||||
<tr><td colspan="3"><hr></td></tr>
|
||||
<tr><td>FreeBSD 10.3 or later</td> <td>amd64, 386</td> <td>Debian GNU/kFreeBSD not supported</td></tr>
|
||||
<tr valign='top'><td>Linux 2.6.23 or later with glibc</td> <td>amd64, 386, arm, arm64,<br>s390x, ppc64le</td> <td>CentOS/RHEL 5.x not supported.<br>Install from source for other libc.</td></tr>
|
||||
<tr><td>macOS 10.11 or later</td> <td>amd64</td> <td>use the clang or gcc<sup>†</sup> that comes with Xcode<sup>‡</sup> for <code>cgo</code> support</td></tr>
|
||||
<tr><td>macOS 10.10 or later</td> <td>amd64</td> <td>use the clang or gcc<sup>†</sup> that comes with Xcode<sup>‡</sup> for <code>cgo</code> support</td></tr>
|
||||
<tr valign='top'><td>Windows 7, Server 2008R2 or later</td> <td>amd64, 386</td> <td>use MinGW (<code>386</code>) or MinGW-W64 (<code>amd64</code>) gcc<sup>†</sup>.<br>No need for cygwin or msys.</td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ func test(tmpdir, file, want string) error {
|
||||
|
||||
// Canonicalize output.
|
||||
out = bytes.TrimRight(out, "\n")
|
||||
out = bytes.ReplaceAll(out, []byte{'\n'}, []byte{' '})
|
||||
out = bytes.Replace(out, []byte{'\n'}, []byte{' '}, -1)
|
||||
|
||||
// Check the result.
|
||||
match, err := regexp.Match(want, out)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
# Consult https://www.iana.org/time-zones for the latest versions.
|
||||
|
||||
# Versions to use.
|
||||
CODE=2020a
|
||||
DATA=2020a
|
||||
CODE=2019c
|
||||
DATA=2019c
|
||||
|
||||
set -e
|
||||
rm -rf work
|
||||
@@ -28,8 +28,6 @@ rm -f ../../zoneinfo.zip
|
||||
zip -0 -r ../../zoneinfo.zip *
|
||||
cd ../..
|
||||
|
||||
go generate time/tzdata
|
||||
|
||||
echo
|
||||
if [ "$1" = "-work" ]; then
|
||||
echo Left workspace behind in work/.
|
||||
|
||||
Binary file not shown.
@@ -32,7 +32,7 @@ func TestCrossPackageTests(t *testing.T) {
|
||||
t.Skip("Can't exec cmd/go subprocess on Android.")
|
||||
case "darwin":
|
||||
switch runtime.GOARCH {
|
||||
case "arm64":
|
||||
case "arm", "arm64":
|
||||
t.Skip("Can't exec cmd/go subprocess on iOS.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,22 +14,15 @@ package cgotest
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef _AIX
|
||||
// On AIX, SIGSTKSZ is too small to handle Go sighandler.
|
||||
#define CSIGSTKSZ 0x4000
|
||||
#else
|
||||
#define CSIGSTKSZ SIGSTKSZ
|
||||
#endif
|
||||
|
||||
static stack_t oss;
|
||||
static char signalStack[CSIGSTKSZ];
|
||||
static char signalStack[SIGSTKSZ];
|
||||
|
||||
static void changeSignalStack(void) {
|
||||
stack_t ss;
|
||||
memset(&ss, 0, sizeof ss);
|
||||
ss.ss_sp = signalStack;
|
||||
ss.ss_flags = 0;
|
||||
ss.ss_size = CSIGSTKSZ;
|
||||
ss.ss_size = SIGSTKSZ;
|
||||
if (sigaltstack(&ss, &oss) < 0) {
|
||||
perror("sigaltstack");
|
||||
abort();
|
||||
@@ -62,8 +55,10 @@ import (
|
||||
|
||||
func testSigaltstack(t *testing.T) {
|
||||
switch {
|
||||
case runtime.GOOS == "solaris", runtime.GOOS == "illumos", runtime.GOOS == "darwin" && runtime.GOARCH == "arm64":
|
||||
case runtime.GOOS == "solaris", runtime.GOOS == "illumos", runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64"):
|
||||
t.Skipf("switching signal stack not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
|
||||
case runtime.GOOS == "darwin" && runtime.GOARCH == "386":
|
||||
t.Skipf("sigaltstack fails on darwin/386")
|
||||
}
|
||||
|
||||
C.changeSignalStack()
|
||||
|
||||
@@ -319,7 +319,6 @@ typedef enum {
|
||||
|
||||
// issue 4339
|
||||
// We've historically permitted #include <>, so test it here. Issue 29333.
|
||||
// Also see issue 41059.
|
||||
#include <issue4339.h>
|
||||
|
||||
// issue 4417
|
||||
@@ -898,16 +897,6 @@ static uint16_t issue31093F(uint16_t v) { return v; }
|
||||
|
||||
// issue 32579
|
||||
typedef struct S32579 { unsigned char data[1]; } S32579;
|
||||
|
||||
// issue 38649
|
||||
// Test that #define'd type aliases work.
|
||||
#define netbsd_gid unsigned int
|
||||
|
||||
// issue 40494
|
||||
// Inconsistent handling of tagged enum and union types.
|
||||
enum Enum40494 { X_40494 };
|
||||
union Union40494 { int x; };
|
||||
void issue40494(enum Enum40494 e, union Union40494* up) {}
|
||||
*/
|
||||
import "C"
|
||||
|
||||
@@ -2203,18 +2192,3 @@ func test32579(t *testing.T) {
|
||||
t.Errorf("&s[0].data[0] failed: got %d, want %d", s[0].data[0], 1)
|
||||
}
|
||||
}
|
||||
|
||||
// issue 38649
|
||||
|
||||
var issue38649 C.netbsd_gid = 42
|
||||
|
||||
// issue 39877
|
||||
|
||||
var issue39877 *C.void = nil
|
||||
|
||||
// issue 40494
|
||||
// No runtime test; just make sure it compiles.
|
||||
|
||||
func Issue40494() {
|
||||
C.issue40494(C.enum_Enum40494(C.X_40494), (*C.union_Union40494)(nil))
|
||||
}
|
||||
|
||||
1
misc/cgo/test/testdata/issue27054/egl.h
vendored
1
misc/cgo/test/testdata/issue27054/egl.h
vendored
@@ -5,4 +5,3 @@
|
||||
// This is the relevant part of EGL/egl.h.
|
||||
|
||||
typedef void *EGLDisplay;
|
||||
typedef void *EGLConfig;
|
||||
|
||||
@@ -13,9 +13,5 @@ import (
|
||||
)
|
||||
|
||||
func Test27054(t *testing.T) {
|
||||
var (
|
||||
// Note: 0, not nil. That makes sure we use uintptr for these types.
|
||||
_ C.EGLDisplay = 0
|
||||
_ C.EGLConfig = 0
|
||||
)
|
||||
var _ C.EGLDisplay = 0 // Note: 0, not nil. That makes sure we use uintptr for this type.
|
||||
}
|
||||
|
||||
@@ -124,11 +124,6 @@ typedef struct {
|
||||
} Issue31891B;
|
||||
|
||||
void callIssue31891(void);
|
||||
|
||||
typedef struct {
|
||||
int i;
|
||||
} Issue38408, *PIssue38408;
|
||||
|
||||
*/
|
||||
import "C"
|
||||
|
||||
@@ -164,7 +159,7 @@ func Add(x int) {
|
||||
}
|
||||
|
||||
func testCthread(t *testing.T) {
|
||||
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
|
||||
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
|
||||
t.Skip("the iOS exec wrapper is unable to properly handle the panic from Add")
|
||||
}
|
||||
sum.i = 0
|
||||
@@ -557,8 +552,3 @@ func useIssue31891B(c *C.Issue31891B) {}
|
||||
func test31891(t *testing.T) {
|
||||
C.callIssue31891()
|
||||
}
|
||||
|
||||
// issue 38408
|
||||
// A typedef pointer can be used as the element type.
|
||||
// No runtime test; just make sure it compiles.
|
||||
var _ C.PIssue38408 = &C.Issue38408{i: 1}
|
||||
|
||||
@@ -134,7 +134,7 @@ func testMain(m *testing.M) int {
|
||||
} else {
|
||||
switch GOOS {
|
||||
case "darwin":
|
||||
if GOARCH == "arm64" {
|
||||
if GOARCH == "arm" || GOARCH == "arm64" {
|
||||
libbase += "_shared"
|
||||
}
|
||||
case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris", "illumos":
|
||||
@@ -305,7 +305,7 @@ func TestEarlySignalHandler(t *testing.T) {
|
||||
switch GOOS {
|
||||
case "darwin":
|
||||
switch GOARCH {
|
||||
case "arm64":
|
||||
case "arm", "arm64":
|
||||
t.Skipf("skipping on %s/%s; see https://golang.org/issue/13701", GOOS, GOARCH)
|
||||
}
|
||||
case "windows":
|
||||
@@ -487,7 +487,7 @@ func checkSignalForwardingTest(t *testing.T) {
|
||||
switch GOOS {
|
||||
case "darwin":
|
||||
switch GOARCH {
|
||||
case "arm64":
|
||||
case "arm", "arm64":
|
||||
t.Skipf("skipping on %s/%s; see https://golang.org/issue/13701", GOOS, GOARCH)
|
||||
}
|
||||
case "windows":
|
||||
@@ -603,7 +603,7 @@ func TestExtar(t *testing.T) {
|
||||
if runtime.Compiler == "gccgo" {
|
||||
t.Skip("skipping -extar test when using gccgo")
|
||||
}
|
||||
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
|
||||
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
|
||||
t.Skip("shell scripts are not executable on iOS hosts")
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ func testMain(m *testing.M) int {
|
||||
libgodir := GOOS + "_" + GOARCH
|
||||
switch GOOS {
|
||||
case "darwin":
|
||||
if GOARCH == "arm64" {
|
||||
if GOARCH == "arm" || GOARCH == "arm64" {
|
||||
libgodir += "_shared"
|
||||
}
|
||||
case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris", "illumos":
|
||||
|
||||
33
misc/cgo/testgodefs/testdata/issue37479.go
vendored
33
misc/cgo/testgodefs/testdata/issue37479.go
vendored
@@ -1,33 +0,0 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
//
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
/*
|
||||
typedef struct A A;
|
||||
|
||||
typedef struct {
|
||||
struct A *next;
|
||||
struct A **prev;
|
||||
} N;
|
||||
|
||||
struct A
|
||||
{
|
||||
N n;
|
||||
};
|
||||
|
||||
typedef struct B
|
||||
{
|
||||
A* a;
|
||||
} B;
|
||||
*/
|
||||
import "C"
|
||||
|
||||
type N C.N
|
||||
|
||||
type A C.A
|
||||
|
||||
type B C.B
|
||||
23
misc/cgo/testgodefs/testdata/issue37621.go
vendored
23
misc/cgo/testgodefs/testdata/issue37621.go
vendored
@@ -1,23 +0,0 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
//
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
/*
|
||||
struct tt {
|
||||
long long a;
|
||||
long long b;
|
||||
};
|
||||
|
||||
struct s {
|
||||
struct tt ts[3];
|
||||
};
|
||||
*/
|
||||
import "C"
|
||||
|
||||
type TT C.struct_tt
|
||||
|
||||
type S C.struct_s
|
||||
15
misc/cgo/testgodefs/testdata/issue38649.go
vendored
15
misc/cgo/testgodefs/testdata/issue38649.go
vendored
@@ -1,15 +0,0 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
//
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
/*
|
||||
struct Issue38649 { int x; };
|
||||
#define issue38649 struct Issue38649
|
||||
*/
|
||||
import "C"
|
||||
|
||||
type issue38649 C.issue38649
|
||||
12
misc/cgo/testgodefs/testdata/issue39534.go
vendored
12
misc/cgo/testgodefs/testdata/issue39534.go
vendored
@@ -1,12 +0,0 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
//
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
// enum { ENUMVAL = 0x1 };
|
||||
import "C"
|
||||
|
||||
const ENUMVAL = C.ENUMVAL
|
||||
11
misc/cgo/testgodefs/testdata/main.go
vendored
11
misc/cgo/testgodefs/testdata/main.go
vendored
@@ -11,16 +11,5 @@ var v2 = v1.L
|
||||
// Test that P, Q, and R all point to byte.
|
||||
var v3 = Issue8478{P: (*byte)(nil), Q: (**byte)(nil), R: (***byte)(nil)}
|
||||
|
||||
// Test that N, A and B are fully defined
|
||||
var v4 = N{}
|
||||
var v5 = A{}
|
||||
var v6 = B{}
|
||||
|
||||
// Test that S is fully defined
|
||||
var v7 = S{}
|
||||
|
||||
// Test that #define'd type is fully defined
|
||||
var _ = issue38649{X: 0}
|
||||
|
||||
func main() {
|
||||
}
|
||||
|
||||
@@ -21,10 +21,6 @@ var filePrefixes = []string{
|
||||
"anonunion",
|
||||
"issue8478",
|
||||
"fieldtypedef",
|
||||
"issue37479",
|
||||
"issue37621",
|
||||
"issue38649",
|
||||
"issue39534",
|
||||
}
|
||||
|
||||
func TestGoDefs(t *testing.T) {
|
||||
|
||||
@@ -32,7 +32,7 @@ func TestMain(m *testing.M) {
|
||||
}
|
||||
|
||||
func testMain(m *testing.M) int {
|
||||
// Copy testdata into GOPATH/src/testplugin, along with a go.mod file
|
||||
// Copy testdata into GOPATH/src/testarchive, along with a go.mod file
|
||||
// declaring the same path.
|
||||
|
||||
GOPATH, err := ioutil.TempDir("", "plugin_test")
|
||||
|
||||
@@ -38,15 +38,7 @@ var testWork = flag.Bool("testwork", false, "if true, log and do not delete the
|
||||
|
||||
// run runs a command and calls t.Errorf if it fails.
|
||||
func run(t *testing.T, msg string, args ...string) {
|
||||
runWithEnv(t, msg, nil, args...)
|
||||
}
|
||||
|
||||
// runWithEnv runs a command under the given environment and calls t.Errorf if it fails.
|
||||
func runWithEnv(t *testing.T, msg string, env []string, args ...string) {
|
||||
c := exec.Command(args[0], args[1:]...)
|
||||
if len(env) != 0 {
|
||||
c.Env = append(os.Environ(), env...)
|
||||
}
|
||||
if output, err := c.CombinedOutput(); err != nil {
|
||||
t.Errorf("executing %s (%s) failed %s:\n%s", strings.Join(args, " "), msg, err, output)
|
||||
}
|
||||
@@ -113,8 +105,6 @@ func testMain(m *testing.M) (int, error) {
|
||||
fmt.Printf("+ cd %s\n", modRoot)
|
||||
}
|
||||
os.Setenv("GOPATH", gopath)
|
||||
// Explicitly override GOBIN as well, in case it was set through a GOENV file.
|
||||
os.Setenv("GOBIN", filepath.Join(gopath, "bin"))
|
||||
os.Chdir(modRoot)
|
||||
os.Setenv("PWD", modRoot)
|
||||
|
||||
@@ -163,6 +153,10 @@ func TestMain(m *testing.M) {
|
||||
log.SetFlags(log.Lshortfile)
|
||||
flag.Parse()
|
||||
|
||||
// Some of the tests install binaries into a custom GOPATH.
|
||||
// That won't work if GOBIN is set.
|
||||
os.Unsetenv("GOBIN")
|
||||
|
||||
exitCode, err := testMain(m)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@@ -229,7 +223,7 @@ func cloneGOROOTDeps(goroot string) error {
|
||||
|
||||
for _, dir := range gorootDirs {
|
||||
if testing.Verbose() {
|
||||
fmt.Fprintf(os.Stderr, "+ cp -r %s %s\n", filepath.Join(oldGOROOT, dir), filepath.Join(goroot, dir))
|
||||
fmt.Fprintf(os.Stderr, "+ cp -r %s %s\n", filepath.Join(goroot, dir), filepath.Join(oldGOROOT, dir))
|
||||
}
|
||||
if err := overlayDir(filepath.Join(goroot, dir), filepath.Join(oldGOROOT, dir)); err != nil {
|
||||
return err
|
||||
@@ -462,7 +456,6 @@ func TestTrivialExecutable(t *testing.T) {
|
||||
run(t, "trivial executable", "../../bin/trivial")
|
||||
AssertIsLinkedTo(t, "../../bin/trivial", soname)
|
||||
AssertHasRPath(t, "../../bin/trivial", gorootInstallDir)
|
||||
checkSize(t, "../../bin/trivial", 100000) // it is 19K on linux/amd64, 100K should be enough
|
||||
}
|
||||
|
||||
// Build a trivial program in PIE mode that links against the shared runtime and check it runs.
|
||||
@@ -471,18 +464,6 @@ func TestTrivialExecutablePIE(t *testing.T) {
|
||||
run(t, "trivial executable", "./trivial.pie")
|
||||
AssertIsLinkedTo(t, "./trivial.pie", soname)
|
||||
AssertHasRPath(t, "./trivial.pie", gorootInstallDir)
|
||||
checkSize(t, "./trivial.pie", 100000) // it is 19K on linux/amd64, 100K should be enough
|
||||
}
|
||||
|
||||
// Check that the file size does not exceed a limit.
|
||||
func checkSize(t *testing.T, f string, limit int64) {
|
||||
fi, err := os.Stat(f)
|
||||
if err != nil {
|
||||
t.Fatalf("stat failed: %v", err)
|
||||
}
|
||||
if sz := fi.Size(); sz > limit {
|
||||
t.Errorf("file too large: got %d, want <= %d", sz, limit)
|
||||
}
|
||||
}
|
||||
|
||||
// Build a division test program and check it runs.
|
||||
@@ -1049,17 +1030,3 @@ func TestGeneratedHash(t *testing.T) {
|
||||
goCmd(nil, "install", "-buildmode=shared", "-linkshared", "./issue30768/issue30768lib")
|
||||
goCmd(nil, "test", "-linkshared", "./issue30768")
|
||||
}
|
||||
|
||||
// Test that packages can be added not in dependency order (here a depends on b, and a adds
|
||||
// before b). This could happen with e.g. go build -buildmode=shared std. See issue 39777.
|
||||
func TestPackageOrder(t *testing.T) {
|
||||
goCmd(t, "install", "-buildmode=shared", "-linkshared", "./issue39777/a", "./issue39777/b")
|
||||
}
|
||||
|
||||
// Test that GC data are generated correctly by the linker when it needs a type defined in
|
||||
// a shared library. See issue 39927.
|
||||
func TestGCData(t *testing.T) {
|
||||
goCmd(t, "install", "-buildmode=shared", "-linkshared", "./gcdata/p")
|
||||
goCmd(t, "build", "-linkshared", "./gcdata/main")
|
||||
runWithEnv(t, "running gcdata/main", []string{"GODEBUG=clobberfree=1"}, "./main")
|
||||
}
|
||||
|
||||
37
misc/cgo/testshared/testdata/gcdata/main/main.go
vendored
37
misc/cgo/testshared/testdata/gcdata/main/main.go
vendored
@@ -1,37 +0,0 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Test that GC data is generated correctly for global
|
||||
// variables with types defined in a shared library.
|
||||
// See issue 39927.
|
||||
|
||||
// This test run under GODEBUG=clobberfree=1. The check
|
||||
// *x[i] == 12345 depends on this debug mode to clobber
|
||||
// the value if the object is freed prematurely.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
"testshared/gcdata/p"
|
||||
)
|
||||
|
||||
var x p.T
|
||||
|
||||
func main() {
|
||||
for i := range x {
|
||||
x[i] = new(int)
|
||||
*x[i] = 12345
|
||||
}
|
||||
runtime.GC()
|
||||
runtime.GC()
|
||||
runtime.GC()
|
||||
for i := range x {
|
||||
if *x[i] != 12345 {
|
||||
fmt.Printf("x[%d] == %d, want 12345\n", i, *x[i])
|
||||
panic("FAIL")
|
||||
}
|
||||
}
|
||||
}
|
||||
7
misc/cgo/testshared/testdata/gcdata/p/p.go
vendored
7
misc/cgo/testshared/testdata/gcdata/p/p.go
vendored
@@ -1,7 +0,0 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package p
|
||||
|
||||
type T [10]*int
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package a
|
||||
|
||||
import "testshared/issue39777/b"
|
||||
|
||||
func F() { b.F() }
|
||||
@@ -20,14 +20,16 @@ import (
|
||||
func requireTestSOSupported(t *testing.T) {
|
||||
t.Helper()
|
||||
switch runtime.GOARCH {
|
||||
case "arm64":
|
||||
case "arm", "arm64":
|
||||
if runtime.GOOS == "darwin" {
|
||||
t.Skip("No exec facility on iOS.")
|
||||
}
|
||||
case "ppc64":
|
||||
if runtime.GOOS == "linux" {
|
||||
t.Skip("External linking not implemented on linux/ppc64 (issue #8912).")
|
||||
t.Skip("External linking not implemented on aix/ppc64 (issue #8912).")
|
||||
}
|
||||
case "mips64le", "mips64":
|
||||
t.Skip("External linking not implemented on mips64.")
|
||||
}
|
||||
if runtime.GOOS == "android" {
|
||||
t.Skip("No exec facility on Android.")
|
||||
|
||||
@@ -20,14 +20,16 @@ import (
|
||||
func requireTestSOSupported(t *testing.T) {
|
||||
t.Helper()
|
||||
switch runtime.GOARCH {
|
||||
case "arm64":
|
||||
case "arm", "arm64":
|
||||
if runtime.GOOS == "darwin" {
|
||||
t.Skip("No exec facility on iOS.")
|
||||
}
|
||||
case "ppc64":
|
||||
if runtime.GOOS == "linux" {
|
||||
t.Skip("External linking not implemented on linux/ppc64 (issue #8912).")
|
||||
t.Skip("External linking not implemented on aix/ppc64 (issue #8912).")
|
||||
}
|
||||
case "mips64le", "mips64":
|
||||
t.Skip("External linking not implemented on mips64.")
|
||||
}
|
||||
if runtime.GOOS == "android" {
|
||||
t.Skip("No exec facility on Android.")
|
||||
|
||||
@@ -8,7 +8,9 @@ export IPHONEOS_DEPLOYMENT_TARGET=5.1
|
||||
# cmd/cgo doesn't support llvm-gcc-4.2, so we have to use clang.
|
||||
CLANG=`xcrun --sdk $SDK --find clang`
|
||||
|
||||
if [ "$GOARCH" == "arm64" ]; then
|
||||
if [ "$GOARCH" == "arm" ]; then
|
||||
CLANGARCH="armv7"
|
||||
elif [ "$GOARCH" == "arm64" ]; then
|
||||
CLANGARCH="arm64"
|
||||
else
|
||||
echo "unknown GOARCH=$GOARCH" >&2
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
// - Node.js
|
||||
// - Electron
|
||||
// - Parcel
|
||||
// - Webpack
|
||||
|
||||
if (typeof global !== "undefined") {
|
||||
// global already exists
|
||||
@@ -28,10 +27,7 @@
|
||||
}
|
||||
|
||||
if (!global.fs && global.require) {
|
||||
const fs = require("fs");
|
||||
if (typeof fs === "object" && fs !== null && Object.keys(fs).length !== 0) {
|
||||
global.fs = fs;
|
||||
}
|
||||
global.fs = require("fs");
|
||||
}
|
||||
|
||||
const enosys = () => {
|
||||
@@ -176,19 +172,37 @@
|
||||
const storeValue = (addr, v) => {
|
||||
const nanHead = 0x7FF80000;
|
||||
|
||||
if (typeof v === "number" && v !== 0) {
|
||||
if (typeof v === "number") {
|
||||
if (isNaN(v)) {
|
||||
this.mem.setUint32(addr + 4, nanHead, true);
|
||||
this.mem.setUint32(addr, 0, true);
|
||||
return;
|
||||
}
|
||||
if (v === 0) {
|
||||
this.mem.setUint32(addr + 4, nanHead, true);
|
||||
this.mem.setUint32(addr, 1, true);
|
||||
return;
|
||||
}
|
||||
this.mem.setFloat64(addr, v, true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (v === undefined) {
|
||||
this.mem.setFloat64(addr, 0, true);
|
||||
return;
|
||||
switch (v) {
|
||||
case undefined:
|
||||
this.mem.setFloat64(addr, 0, true);
|
||||
return;
|
||||
case null:
|
||||
this.mem.setUint32(addr + 4, nanHead, true);
|
||||
this.mem.setUint32(addr, 2, true);
|
||||
return;
|
||||
case true:
|
||||
this.mem.setUint32(addr + 4, nanHead, true);
|
||||
this.mem.setUint32(addr, 3, true);
|
||||
return;
|
||||
case false:
|
||||
this.mem.setUint32(addr + 4, nanHead, true);
|
||||
this.mem.setUint32(addr, 4, true);
|
||||
return;
|
||||
}
|
||||
|
||||
let id = this._ids.get(v);
|
||||
@@ -202,13 +216,8 @@
|
||||
this._ids.set(v, id);
|
||||
}
|
||||
this._goRefCounts[id]++;
|
||||
let typeFlag = 0;
|
||||
let typeFlag = 1;
|
||||
switch (typeof v) {
|
||||
case "object":
|
||||
if (v !== null) {
|
||||
typeFlag = 1;
|
||||
}
|
||||
break;
|
||||
case "string":
|
||||
typeFlag = 2;
|
||||
break;
|
||||
@@ -431,14 +440,14 @@
|
||||
|
||||
// func valueInstanceOf(v ref, t ref) bool
|
||||
"syscall/js.valueInstanceOf": (sp) => {
|
||||
this.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);
|
||||
this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16));
|
||||
},
|
||||
|
||||
// func copyBytesToGo(dst []byte, src ref) (int, bool)
|
||||
"syscall/js.copyBytesToGo": (sp) => {
|
||||
const dst = loadSlice(sp + 8);
|
||||
const src = loadValue(sp + 32);
|
||||
if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {
|
||||
if (!(src instanceof Uint8Array)) {
|
||||
this.mem.setUint8(sp + 48, 0);
|
||||
return;
|
||||
}
|
||||
@@ -452,7 +461,7 @@
|
||||
"syscall/js.copyBytesToJS": (sp) => {
|
||||
const dst = loadValue(sp + 8);
|
||||
const src = loadSlice(sp + 16);
|
||||
if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {
|
||||
if (!(dst instanceof Uint8Array)) {
|
||||
this.mem.setUint8(sp + 48, 0);
|
||||
return;
|
||||
}
|
||||
@@ -481,17 +490,10 @@
|
||||
global,
|
||||
this,
|
||||
];
|
||||
this._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id
|
||||
this._ids = new Map([ // mapping from JS values to reference ids
|
||||
[0, 1],
|
||||
[null, 2],
|
||||
[true, 3],
|
||||
[false, 4],
|
||||
[global, 5],
|
||||
[this, 6],
|
||||
]);
|
||||
this._idPool = []; // unused ids that have been garbage collected
|
||||
this.exited = false; // whether the Go program has exited
|
||||
this._goRefCounts = []; // number of references that Go has to a JS value, indexed by reference id
|
||||
this._ids = new Map(); // mapping from JS values to reference ids
|
||||
this._idPool = []; // unused ids that have been garbage collected
|
||||
this.exited = false; // whether the Go program has exited
|
||||
|
||||
// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.
|
||||
let offset = 4096;
|
||||
@@ -557,7 +559,6 @@
|
||||
}
|
||||
|
||||
if (
|
||||
typeof module !== "undefined" &&
|
||||
global.require &&
|
||||
global.require.main === module &&
|
||||
global.process &&
|
||||
|
||||
53
src/all.bat
53
src/all.bat
@@ -1,27 +1,26 @@
|
||||
:: Copyright 2012 The Go Authors. All rights reserved.
|
||||
:: Use of this source code is governed by a BSD-style
|
||||
:: license that can be found in the LICENSE file.
|
||||
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
|
||||
if exist make.bat goto ok
|
||||
echo all.bat must be run from go\src
|
||||
:: cannot exit: would kill parent command interpreter
|
||||
goto end
|
||||
:ok
|
||||
|
||||
set OLDPATH=%PATH%
|
||||
call make.bat --no-banner --no-local
|
||||
if %GOBUILDFAIL%==1 goto end
|
||||
call run.bat --no-rebuild --no-local
|
||||
if %GOBUILDFAIL%==1 goto end
|
||||
:: we must restore %PATH% before running "dist banner" so that the latter
|
||||
:: can get the original %PATH% and give suggestion to add %GOROOT%/bin
|
||||
:: to %PATH% if necessary.
|
||||
set PATH=%OLDPATH%
|
||||
"%GOTOOLDIR%/dist" banner
|
||||
|
||||
:end
|
||||
if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL%
|
||||
:: Copyright 2012 The Go Authors. All rights reserved.
|
||||
:: Use of this source code is governed by a BSD-style
|
||||
:: license that can be found in the LICENSE file.
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
|
||||
if exist make.bat goto ok
|
||||
echo all.bat must be run from go\src
|
||||
:: cannot exit: would kill parent command interpreter
|
||||
goto end
|
||||
:ok
|
||||
|
||||
set OLDPATH=%PATH%
|
||||
call make.bat --no-banner --no-local
|
||||
if %GOBUILDFAIL%==1 goto end
|
||||
call run.bat --no-rebuild --no-local
|
||||
if %GOBUILDFAIL%==1 goto end
|
||||
:: we must restore %PATH% before running "dist banner" so that the latter
|
||||
:: can get the original %PATH% and give suggestion to add %GOROOT%/bin
|
||||
:: to %PATH% if necessary.
|
||||
set PATH=%OLDPATH%
|
||||
"%GOTOOLDIR%/dist" banner
|
||||
|
||||
:end
|
||||
if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL%
|
||||
|
||||
@@ -10,7 +10,7 @@ if(! test -f make.rc){
|
||||
exit wrongdir
|
||||
}
|
||||
|
||||
. ./make.rc --no-banner $*
|
||||
. ./make.rc --no-banner
|
||||
bind -b $GOROOT/bin /bin
|
||||
./run.rc --no-rebuild
|
||||
$GOTOOLDIR/dist banner # print build info
|
||||
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"io"
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
)
|
||||
|
||||
@@ -420,16 +419,20 @@ func (b *Reader) ReadLine() (line []byte, isPrefix bool, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// collectFragments reads until the first occurrence of delim in the input. It
|
||||
// returns (slice of full buffers, remaining bytes before delim, total number
|
||||
// of bytes in the combined first two elements, error).
|
||||
// The complete result is equal to
|
||||
// `bytes.Join(append(fullBuffers, finalFragment), nil)`, which has a
|
||||
// length of `totalLen`. The result is structured in this way to allow callers
|
||||
// to minimize allocations and copies.
|
||||
func (b *Reader) collectFragments(delim byte) (fullBuffers [][]byte, finalFragment []byte, totalLen int, err error) {
|
||||
// ReadBytes reads until the first occurrence of delim in the input,
|
||||
// returning a slice containing the data up to and including the delimiter.
|
||||
// If ReadBytes encounters an error before finding a delimiter,
|
||||
// it returns the data read before the error and the error itself (often io.EOF).
|
||||
// ReadBytes returns err != nil if and only if the returned data does not end in
|
||||
// delim.
|
||||
// For simple uses, a Scanner may be more convenient.
|
||||
func (b *Reader) ReadBytes(delim byte) ([]byte, error) {
|
||||
// Use ReadSlice to look for array,
|
||||
// accumulating full buffers.
|
||||
var frag []byte
|
||||
// Use ReadSlice to look for delim, accumulating full buffers.
|
||||
var full [][]byte
|
||||
var err error
|
||||
n := 0
|
||||
for {
|
||||
var e error
|
||||
frag, e = b.ReadSlice(delim)
|
||||
@@ -444,23 +447,12 @@ func (b *Reader) collectFragments(delim byte) (fullBuffers [][]byte, finalFragme
|
||||
// Make a copy of the buffer.
|
||||
buf := make([]byte, len(frag))
|
||||
copy(buf, frag)
|
||||
fullBuffers = append(fullBuffers, buf)
|
||||
totalLen += len(buf)
|
||||
full = append(full, buf)
|
||||
n += len(buf)
|
||||
}
|
||||
|
||||
totalLen += len(frag)
|
||||
return fullBuffers, frag, totalLen, err
|
||||
}
|
||||
n += len(frag)
|
||||
|
||||
// ReadBytes reads until the first occurrence of delim in the input,
|
||||
// returning a slice containing the data up to and including the delimiter.
|
||||
// If ReadBytes encounters an error before finding a delimiter,
|
||||
// it returns the data read before the error and the error itself (often io.EOF).
|
||||
// ReadBytes returns err != nil if and only if the returned data does not end in
|
||||
// delim.
|
||||
// For simple uses, a Scanner may be more convenient.
|
||||
func (b *Reader) ReadBytes(delim byte) ([]byte, error) {
|
||||
full, frag, n, err := b.collectFragments(delim)
|
||||
// Allocate new buffer to hold the full pieces and the fragment.
|
||||
buf := make([]byte, n)
|
||||
n = 0
|
||||
@@ -480,16 +472,8 @@ func (b *Reader) ReadBytes(delim byte) ([]byte, error) {
|
||||
// delim.
|
||||
// For simple uses, a Scanner may be more convenient.
|
||||
func (b *Reader) ReadString(delim byte) (string, error) {
|
||||
full, frag, n, err := b.collectFragments(delim)
|
||||
// Allocate new buffer to hold the full pieces and the fragment.
|
||||
var buf strings.Builder
|
||||
buf.Grow(n)
|
||||
// Copy full pieces and fragment in.
|
||||
for _, fb := range full {
|
||||
buf.Write(fb)
|
||||
}
|
||||
buf.Write(frag)
|
||||
return buf.String(), err
|
||||
bytes, err := b.ReadBytes(delim)
|
||||
return string(bytes), err
|
||||
}
|
||||
|
||||
// WriteTo implements io.WriterTo.
|
||||
|
||||
@@ -147,7 +147,7 @@ func TestReader(t *testing.T) {
|
||||
for i := 0; i < len(texts)-1; i++ {
|
||||
texts[i] = str + "\n"
|
||||
all += texts[i]
|
||||
str += string(rune(i)%26 + 'a')
|
||||
str += string(i%26 + 'a')
|
||||
}
|
||||
texts[len(texts)-1] = all
|
||||
|
||||
@@ -535,23 +535,6 @@ func TestReadWriteRune(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestReadStringAllocs(t *testing.T) {
|
||||
r := strings.NewReader(" foo foo 42 42 42 42 42 42 42 42 4.2 4.2 4.2 4.2\n")
|
||||
buf := NewReader(r)
|
||||
allocs := testing.AllocsPerRun(100, func() {
|
||||
r.Seek(0, io.SeekStart)
|
||||
buf.Reset(r)
|
||||
|
||||
_, err := buf.ReadString('\n')
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
})
|
||||
if allocs != 1 {
|
||||
t.Errorf("Unexpected number of allocations, got %f, want 1", allocs)
|
||||
}
|
||||
}
|
||||
|
||||
func TestWriter(t *testing.T) {
|
||||
var data [8192]byte
|
||||
|
||||
@@ -1661,21 +1644,6 @@ func BenchmarkReaderWriteToOptimal(b *testing.B) {
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkReaderReadString(b *testing.B) {
|
||||
r := strings.NewReader(" foo foo 42 42 42 42 42 42 42 42 4.2 4.2 4.2 4.2\n")
|
||||
buf := NewReader(r)
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
r.Seek(0, io.SeekStart)
|
||||
buf.Reset(r)
|
||||
|
||||
_, err := buf.ReadString('\n')
|
||||
if err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkWriterCopyOptimal(b *testing.B) {
|
||||
// Optimal case is where the underlying writer implements io.ReaderFrom
|
||||
srcBuf := bytes.NewBuffer(make([]byte, 8192))
|
||||
|
||||
@@ -69,7 +69,6 @@ var (
|
||||
ErrTooLong = errors.New("bufio.Scanner: token too long")
|
||||
ErrNegativeAdvance = errors.New("bufio.Scanner: SplitFunc returns negative advance count")
|
||||
ErrAdvanceTooFar = errors.New("bufio.Scanner: SplitFunc returns advance count beyond input")
|
||||
ErrBadReadCount = errors.New("bufio.Scanner: Read returned impossible count")
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -212,10 +211,6 @@ func (s *Scanner) Scan() bool {
|
||||
// be extra careful: Scanner is for safe, simple jobs.
|
||||
for loop := 0; ; {
|
||||
n, err := s.r.Read(s.buf[s.end:len(s.buf)])
|
||||
if n < 0 || len(s.buf)-s.end < n {
|
||||
s.setErr(ErrBadReadCount)
|
||||
break
|
||||
}
|
||||
s.end += n
|
||||
if err != nil {
|
||||
s.setErr(err)
|
||||
|
||||
@@ -537,60 +537,3 @@ func TestHugeBuffer(t *testing.T) {
|
||||
t.Fatal("after scan:", s.Err())
|
||||
}
|
||||
}
|
||||
|
||||
// negativeEOFReader returns an invalid -1 at the end, as though it
|
||||
// were wrapping the read system call.
|
||||
type negativeEOFReader int
|
||||
|
||||
func (r *negativeEOFReader) Read(p []byte) (int, error) {
|
||||
if *r > 0 {
|
||||
c := int(*r)
|
||||
if c > len(p) {
|
||||
c = len(p)
|
||||
}
|
||||
for i := 0; i < c; i++ {
|
||||
p[i] = 'a'
|
||||
}
|
||||
p[c-1] = '\n'
|
||||
*r -= negativeEOFReader(c)
|
||||
return c, nil
|
||||
}
|
||||
return -1, io.EOF
|
||||
}
|
||||
|
||||
// Test that the scanner doesn't panic and returns ErrBadReadCount
|
||||
// on a reader that returns a negative count of bytes read (issue 38053).
|
||||
func TestNegativeEOFReader(t *testing.T) {
|
||||
r := negativeEOFReader(10)
|
||||
scanner := NewScanner(&r)
|
||||
c := 0
|
||||
for scanner.Scan() {
|
||||
c++
|
||||
if c > 1 {
|
||||
t.Error("read too many lines")
|
||||
break
|
||||
}
|
||||
}
|
||||
if got, want := scanner.Err(), ErrBadReadCount; got != want {
|
||||
t.Errorf("scanner.Err: got %v, want %v", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
// largeReader returns an invalid count that is larger than the number
|
||||
// of bytes requested.
|
||||
type largeReader struct{}
|
||||
|
||||
func (largeReader) Read(p []byte) (int, error) {
|
||||
return len(p) + 1, nil
|
||||
}
|
||||
|
||||
// Test that the scanner doesn't panic and returns ErrBadReadCount
|
||||
// on a reader that returns an impossibly large count of bytes read (issue 38053).
|
||||
func TestLargeReader(t *testing.T) {
|
||||
scanner := NewScanner(largeReader{})
|
||||
for scanner.Scan() {
|
||||
}
|
||||
if got, want := scanner.Err(), ErrBadReadCount; got != want {
|
||||
t.Errorf("scanner.Err: got %v, want %v", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ gettargets() {
|
||||
}
|
||||
|
||||
selectedtargets() {
|
||||
gettargets | egrep -v 'android-arm|darwin-arm64' | egrep "$pattern"
|
||||
gettargets | egrep -v 'android-arm|darwin-arm' | egrep "$pattern"
|
||||
}
|
||||
|
||||
# put linux first in the target list to get all the architectures up front.
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
. "bytes"
|
||||
"io"
|
||||
"math/rand"
|
||||
"runtime"
|
||||
"testing"
|
||||
"unicode/utf8"
|
||||
)
|
||||
@@ -494,20 +495,20 @@ func TestGrow(t *testing.T) {
|
||||
x := []byte{'x'}
|
||||
y := []byte{'y'}
|
||||
tmp := make([]byte, 72)
|
||||
for _, growLen := range []int{0, 100, 1000, 10000, 100000} {
|
||||
for _, startLen := range []int{0, 100, 1000, 10000, 100000} {
|
||||
xBytes := Repeat(x, startLen)
|
||||
|
||||
for _, startLen := range []int{0, 100, 1000, 10000, 100000} {
|
||||
xBytes := Repeat(x, startLen)
|
||||
for _, growLen := range []int{0, 100, 1000, 10000, 100000} {
|
||||
buf := NewBuffer(xBytes)
|
||||
// If we read, this affects buf.off, which is good to test.
|
||||
readBytes, _ := buf.Read(tmp)
|
||||
buf.Grow(growLen)
|
||||
yBytes := Repeat(y, growLen)
|
||||
allocs := testing.AllocsPerRun(100, func() {
|
||||
buf.Grow(growLen)
|
||||
buf.Write(yBytes)
|
||||
})
|
||||
// Check no allocation occurs in write, as long as we're single-threaded.
|
||||
if allocs != 0 {
|
||||
var m1, m2 runtime.MemStats
|
||||
runtime.ReadMemStats(&m1)
|
||||
buf.Write(yBytes)
|
||||
runtime.ReadMemStats(&m2)
|
||||
if runtime.GOMAXPROCS(-1) == 1 && m1.Mallocs != m2.Mallocs {
|
||||
t.Errorf("allocation occurred during write")
|
||||
}
|
||||
// Check that buffer has correct data.
|
||||
|
||||
@@ -117,17 +117,17 @@ func LastIndex(s, sep []byte) int {
|
||||
return -1
|
||||
}
|
||||
// Rabin-Karp search from the end of the string
|
||||
hashss, pow := bytealg.HashStrRevBytes(sep)
|
||||
hashss, pow := hashStrRev(sep)
|
||||
last := len(s) - n
|
||||
var h uint32
|
||||
for i := len(s) - 1; i >= last; i-- {
|
||||
h = h*bytealg.PrimeRK + uint32(s[i])
|
||||
h = h*primeRK + uint32(s[i])
|
||||
}
|
||||
if h == hashss && Equal(s[last:], sep) {
|
||||
return last
|
||||
}
|
||||
for i := last - 1; i >= 0; i-- {
|
||||
h *= bytealg.PrimeRK
|
||||
h *= primeRK
|
||||
h += uint32(s[i])
|
||||
h -= pow * uint32(s[i+n])
|
||||
if h == hashss && Equal(s[i:i+n], sep) {
|
||||
@@ -183,29 +183,6 @@ func IndexAny(s []byte, chars string) int {
|
||||
// Avoid scanning all of s.
|
||||
return -1
|
||||
}
|
||||
if len(s) == 1 {
|
||||
r := rune(s[0])
|
||||
if r >= utf8.RuneSelf {
|
||||
// search utf8.RuneError.
|
||||
for _, r = range chars {
|
||||
if r == utf8.RuneError {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
if bytealg.IndexByteString(chars, s[0]) >= 0 {
|
||||
return 0
|
||||
}
|
||||
return -1
|
||||
}
|
||||
if len(chars) == 1 {
|
||||
r := rune(chars[0])
|
||||
if r >= utf8.RuneSelf {
|
||||
r = utf8.RuneError
|
||||
}
|
||||
return IndexRune(s, r)
|
||||
}
|
||||
if len(s) > 8 {
|
||||
if as, isASCII := makeASCIISet(chars); isASCII {
|
||||
for i, c := range s {
|
||||
@@ -220,26 +197,14 @@ func IndexAny(s []byte, chars string) int {
|
||||
for i := 0; i < len(s); i += width {
|
||||
r := rune(s[i])
|
||||
if r < utf8.RuneSelf {
|
||||
if bytealg.IndexByteString(chars, s[i]) >= 0 {
|
||||
width = 1
|
||||
} else {
|
||||
r, width = utf8.DecodeRune(s[i:])
|
||||
}
|
||||
for _, ch := range chars {
|
||||
if r == ch {
|
||||
return i
|
||||
}
|
||||
width = 1
|
||||
continue
|
||||
}
|
||||
r, width = utf8.DecodeRune(s[i:])
|
||||
if r == utf8.RuneError {
|
||||
for _, r = range chars {
|
||||
if r == utf8.RuneError {
|
||||
return i
|
||||
}
|
||||
}
|
||||
continue
|
||||
}
|
||||
// r is 2 to 4 bytes. Using strings.Index is more reasonable, but as the bytes
|
||||
// package should not import the strings package, use bytealg.IndexString
|
||||
// instead. And this does not seem to lose much performance.
|
||||
if chars == string(r) || bytealg.IndexString(chars, string(r)) >= 0 {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
@@ -264,59 +229,13 @@ func LastIndexAny(s []byte, chars string) int {
|
||||
return -1
|
||||
}
|
||||
}
|
||||
if len(s) == 1 {
|
||||
r := rune(s[0])
|
||||
if r >= utf8.RuneSelf {
|
||||
for _, r = range chars {
|
||||
if r == utf8.RuneError {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
if bytealg.IndexByteString(chars, s[0]) >= 0 {
|
||||
return 0
|
||||
}
|
||||
return -1
|
||||
}
|
||||
if len(chars) == 1 {
|
||||
cr := rune(chars[0])
|
||||
if cr >= utf8.RuneSelf {
|
||||
cr = utf8.RuneError
|
||||
}
|
||||
for i := len(s); i > 0; {
|
||||
r, size := utf8.DecodeLastRune(s[:i])
|
||||
i -= size
|
||||
if r == cr {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
for i := len(s); i > 0; {
|
||||
r := rune(s[i-1])
|
||||
if r < utf8.RuneSelf {
|
||||
if bytealg.IndexByteString(chars, s[i-1]) >= 0 {
|
||||
return i - 1
|
||||
}
|
||||
i--
|
||||
continue
|
||||
}
|
||||
r, size := utf8.DecodeLastRune(s[:i])
|
||||
i -= size
|
||||
if r == utf8.RuneError {
|
||||
for _, r = range chars {
|
||||
if r == utf8.RuneError {
|
||||
return i
|
||||
}
|
||||
for _, c := range chars {
|
||||
if r == c {
|
||||
return i
|
||||
}
|
||||
continue
|
||||
}
|
||||
// r is 2 to 4 bytes. Using strings.Index is more reasonable, but as the bytes
|
||||
// package should not import the strings package, use bytealg.IndexString
|
||||
// instead. And this does not seem to lose much performance.
|
||||
if chars == string(r) || bytealg.IndexString(chars, string(r)) >= 0 {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
@@ -445,9 +364,8 @@ func Fields(s []byte) [][]byte {
|
||||
// It splits the slice s at each run of code points c satisfying f(c) and
|
||||
// returns a slice of subslices of s. If all code points in s satisfy f(c), or
|
||||
// len(s) == 0, an empty slice is returned.
|
||||
//
|
||||
// FieldsFunc makes no guarantees about the order in which it calls f(c)
|
||||
// and assumes that f always returns the same value for a given c.
|
||||
// FieldsFunc makes no guarantees about the order in which it calls f(c).
|
||||
// If f does not return consistent results for a given c, FieldsFunc may crash.
|
||||
func FieldsFunc(s []byte, f func(rune) bool) [][]byte {
|
||||
// A span is used to record a slice of s of the form s[start:end].
|
||||
// The start index is inclusive and the end index is exclusive.
|
||||
@@ -458,10 +376,8 @@ func FieldsFunc(s []byte, f func(rune) bool) [][]byte {
|
||||
spans := make([]span, 0, 32)
|
||||
|
||||
// Find the field start and end indices.
|
||||
// Doing this in a separate pass (rather than slicing the string s
|
||||
// and collecting the result substrings right away) is significantly
|
||||
// more efficient, possibly due to cache effects.
|
||||
start := -1 // valid span start if >= 0
|
||||
wasField := false
|
||||
fromIndex := 0
|
||||
for i := 0; i < len(s); {
|
||||
size := 1
|
||||
r := rune(s[i])
|
||||
@@ -469,21 +385,22 @@ func FieldsFunc(s []byte, f func(rune) bool) [][]byte {
|
||||
r, size = utf8.DecodeRune(s[i:])
|
||||
}
|
||||
if f(r) {
|
||||
if start >= 0 {
|
||||
spans = append(spans, span{start, i})
|
||||
start = -1
|
||||
if wasField {
|
||||
spans = append(spans, span{start: fromIndex, end: i})
|
||||
wasField = false
|
||||
}
|
||||
} else {
|
||||
if start < 0 {
|
||||
start = i
|
||||
if !wasField {
|
||||
fromIndex = i
|
||||
wasField = true
|
||||
}
|
||||
}
|
||||
i += size
|
||||
}
|
||||
|
||||
// Last field might end at EOF.
|
||||
if start >= 0 {
|
||||
spans = append(spans, span{start, len(s)})
|
||||
if wasField {
|
||||
spans = append(spans, span{fromIndex, len(s)})
|
||||
}
|
||||
|
||||
// Create subslices from recorded field indices.
|
||||
@@ -1102,11 +1019,11 @@ func Index(s, sep []byte) int {
|
||||
if s[i] != c0 {
|
||||
// IndexByte is faster than bytealg.Index, so use it as long as
|
||||
// we're not getting lots of false positives.
|
||||
o := IndexByte(s[i+1:t], c0)
|
||||
o := IndexByte(s[i:t], c0)
|
||||
if o < 0 {
|
||||
return -1
|
||||
}
|
||||
i += o + 1
|
||||
i += o
|
||||
}
|
||||
if s[i+1] == c1 && Equal(s[i:i+n], sep) {
|
||||
return i
|
||||
@@ -1131,11 +1048,11 @@ func Index(s, sep []byte) int {
|
||||
t := len(s) - n + 1
|
||||
for i < t {
|
||||
if s[i] != c0 {
|
||||
o := IndexByte(s[i+1:t], c0)
|
||||
o := IndexByte(s[i:t], c0)
|
||||
if o < 0 {
|
||||
break
|
||||
}
|
||||
i += o + 1
|
||||
i += o
|
||||
}
|
||||
if s[i+1] == c1 && Equal(s[i:i+n], sep) {
|
||||
return i
|
||||
@@ -1151,7 +1068,7 @@ func Index(s, sep []byte) int {
|
||||
// we should cutover at even larger average skips,
|
||||
// because Equal becomes that much more expensive.
|
||||
// This code does not take that effect into account.
|
||||
j := bytealg.IndexRabinKarpBytes(s[i:], sep)
|
||||
j := indexRabinKarp(s[i:], sep)
|
||||
if j < 0 {
|
||||
return -1
|
||||
}
|
||||
@@ -1160,3 +1077,63 @@ func Index(s, sep []byte) int {
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
func indexRabinKarp(s, sep []byte) int {
|
||||
// Rabin-Karp search
|
||||
hashsep, pow := hashStr(sep)
|
||||
n := len(sep)
|
||||
var h uint32
|
||||
for i := 0; i < n; i++ {
|
||||
h = h*primeRK + uint32(s[i])
|
||||
}
|
||||
if h == hashsep && Equal(s[:n], sep) {
|
||||
return 0
|
||||
}
|
||||
for i := n; i < len(s); {
|
||||
h *= primeRK
|
||||
h += uint32(s[i])
|
||||
h -= pow * uint32(s[i-n])
|
||||
i++
|
||||
if h == hashsep && Equal(s[i-n:i], sep) {
|
||||
return i - n
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
// primeRK is the prime base used in Rabin-Karp algorithm.
|
||||
const primeRK = 16777619
|
||||
|
||||
// hashStr returns the hash and the appropriate multiplicative
|
||||
// factor for use in Rabin-Karp algorithm.
|
||||
func hashStr(sep []byte) (uint32, uint32) {
|
||||
hash := uint32(0)
|
||||
for i := 0; i < len(sep); i++ {
|
||||
hash = hash*primeRK + uint32(sep[i])
|
||||
}
|
||||
var pow, sq uint32 = 1, primeRK
|
||||
for i := len(sep); i > 0; i >>= 1 {
|
||||
if i&1 != 0 {
|
||||
pow *= sq
|
||||
}
|
||||
sq *= sq
|
||||
}
|
||||
return hash, pow
|
||||
}
|
||||
|
||||
// hashStrRev returns the hash of the reverse of sep and the
|
||||
// appropriate multiplicative factor for use in Rabin-Karp algorithm.
|
||||
func hashStrRev(sep []byte) (uint32, uint32) {
|
||||
hash := uint32(0)
|
||||
for i := len(sep) - 1; i >= 0; i-- {
|
||||
hash = hash*primeRK + uint32(sep[i])
|
||||
}
|
||||
var pow, sq uint32 = 1, primeRK
|
||||
for i := len(sep); i > 0; i >>= 1 {
|
||||
if i&1 != 0 {
|
||||
pow *= sq
|
||||
}
|
||||
sq *= sq
|
||||
}
|
||||
return hash, pow
|
||||
}
|
||||
|
||||
@@ -141,10 +141,9 @@ var indexTests = []BinOpTest{
|
||||
{"barfoobarfooyyyzzzyyyzzzyyyzzzyyyxxxzzzyyy", "x", 33},
|
||||
{"foofyfoobarfoobar", "y", 4},
|
||||
{"oooooooooooooooooooooo", "r", -1},
|
||||
// test fallback to Rabin-Karp.
|
||||
{"oxoxoxoxoxoxoxoxoxoxoxoy", "oy", 22},
|
||||
{"oxoxoxoxoxoxoxoxoxoxoxox", "oy", -1},
|
||||
// test fallback to Rabin-Karp.
|
||||
{"000000000000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000000001", 5},
|
||||
}
|
||||
|
||||
var lastIndexTests = []BinOpTest{
|
||||
@@ -169,7 +168,6 @@ var indexAnyTests = []BinOpTest{
|
||||
{"", "abc", -1},
|
||||
{"a", "", -1},
|
||||
{"a", "a", 0},
|
||||
{"\x80", "\xffb", 0},
|
||||
{"aaa", "a", 0},
|
||||
{"abc", "xyz", -1},
|
||||
{"abc", "xcz", 2},
|
||||
@@ -180,7 +178,6 @@ var indexAnyTests = []BinOpTest{
|
||||
{dots + dots + dots, " ", -1},
|
||||
{"012abcba210", "\xffb", 4},
|
||||
{"012\x80bcb\x80210", "\xffb", 3},
|
||||
{"0123456\xcf\x80abc", "\xcfb\x80", 10},
|
||||
}
|
||||
|
||||
var lastIndexAnyTests = []BinOpTest{
|
||||
@@ -189,7 +186,6 @@ var lastIndexAnyTests = []BinOpTest{
|
||||
{"", "abc", -1},
|
||||
{"a", "", -1},
|
||||
{"a", "a", 0},
|
||||
{"\x80", "\xffb", 0},
|
||||
{"aaa", "a", 2},
|
||||
{"abc", "xyz", -1},
|
||||
{"abc", "ab", 1},
|
||||
@@ -200,7 +196,6 @@ var lastIndexAnyTests = []BinOpTest{
|
||||
{dots + dots + dots, " ", -1},
|
||||
{"012abcba210", "\xffb", 6},
|
||||
{"012\x80bcb\x80210", "\xffb", 7},
|
||||
{"0123456\xcf\x80abc", "\xcfb\x80", 10},
|
||||
}
|
||||
|
||||
// Execute f on each test case. funcName should be the name of f; it's used
|
||||
@@ -214,27 +209,6 @@ func runIndexTests(t *testing.T, f func(s, sep []byte) int, funcName string, tes
|
||||
t.Errorf("%s(%q,%q) = %v; want %v", funcName, a, b, actual, test.i)
|
||||
}
|
||||
}
|
||||
var allocTests = []struct {
|
||||
a []byte
|
||||
b []byte
|
||||
i int
|
||||
}{
|
||||
// case for function Index.
|
||||
{[]byte("000000000000000000000000000000000000000000000000000000000000000000000001"), []byte("0000000000000000000000000000000000000000000000000000000000000000001"), 5},
|
||||
// case for function LastIndex.
|
||||
{[]byte("000000000000000000000000000000000000000000000000000000000000000010000"), []byte("00000000000000000000000000000000000000000000000000000000000001"), 3},
|
||||
}
|
||||
allocs := testing.AllocsPerRun(100, func() {
|
||||
if i := Index(allocTests[1].a, allocTests[1].b); i != allocTests[1].i {
|
||||
t.Errorf("Index([]byte(%q), []byte(%q)) = %v; want %v", allocTests[1].a, allocTests[1].b, i, allocTests[1].i)
|
||||
}
|
||||
if i := LastIndex(allocTests[0].a, allocTests[0].b); i != allocTests[0].i {
|
||||
t.Errorf("LastIndex([]byte(%q), []byte(%q)) = %v; want %v", allocTests[0].a, allocTests[0].b, i, allocTests[0].i)
|
||||
}
|
||||
})
|
||||
if allocs != 0 {
|
||||
t.Errorf("expected no allocations, got %f", allocs)
|
||||
}
|
||||
}
|
||||
|
||||
func runIndexAnyTests(t *testing.T, f func(s []byte, chars string) int, funcName string, testCases []BinOpTest) {
|
||||
@@ -1894,10 +1868,10 @@ func BenchmarkBytesCompare(b *testing.B) {
|
||||
}
|
||||
|
||||
func BenchmarkIndexAnyASCII(b *testing.B) {
|
||||
x := Repeat([]byte{'#'}, 2048) // Never matches set
|
||||
cs := "0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz"
|
||||
for k := 1; k <= 2048; k <<= 4 {
|
||||
for j := 1; j <= 64; j <<= 1 {
|
||||
x := Repeat([]byte{'#'}, 4096) // Never matches set
|
||||
cs := "0123456789abcdef"
|
||||
for k := 1; k <= 4096; k <<= 4 {
|
||||
for j := 1; j <= 16; j <<= 1 {
|
||||
b.Run(fmt.Sprintf("%d:%d", k, j), func(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
IndexAny(x[:k], cs[:j])
|
||||
@@ -1907,48 +1881,6 @@ func BenchmarkIndexAnyASCII(b *testing.B) {
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkIndexAnyUTF8(b *testing.B) {
|
||||
x := Repeat([]byte{'#'}, 2048) // Never matches set
|
||||
cs := "你好世界, hello world. 你好世界, hello world. 你好世界, hello world."
|
||||
for k := 1; k <= 2048; k <<= 4 {
|
||||
for j := 1; j <= 64; j <<= 1 {
|
||||
b.Run(fmt.Sprintf("%d:%d", k, j), func(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
IndexAny(x[:k], cs[:j])
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkLastIndexAnyASCII(b *testing.B) {
|
||||
x := Repeat([]byte{'#'}, 2048) // Never matches set
|
||||
cs := "0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz"
|
||||
for k := 1; k <= 2048; k <<= 4 {
|
||||
for j := 1; j <= 64; j <<= 1 {
|
||||
b.Run(fmt.Sprintf("%d:%d", k, j), func(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
LastIndexAny(x[:k], cs[:j])
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkLastIndexAnyUTF8(b *testing.B) {
|
||||
x := Repeat([]byte{'#'}, 2048) // Never matches set
|
||||
cs := "你好世界, hello world. 你好世界, hello world. 你好世界, hello world."
|
||||
for k := 1; k <= 2048; k <<= 4 {
|
||||
for j := 1; j <= 64; j <<= 1 {
|
||||
b.Run(fmt.Sprintf("%d:%d", k, j), func(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
LastIndexAny(x[:k], cs[:j])
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkTrimASCII(b *testing.B) {
|
||||
cs := "0123456789abcdef"
|
||||
for k := 1; k <= 4096; k <<= 4 {
|
||||
|
||||
@@ -11,7 +11,7 @@ if [ ! -f run.bash ]; then
|
||||
fi
|
||||
export GOROOT="$(cd .. && pwd)"
|
||||
|
||||
gobin="${GOROOT}"/bin
|
||||
gobin="${GOBIN:-../bin}"
|
||||
if ! "$gobin"/go help >/dev/null 2>&1; then
|
||||
echo 'cannot find go command; nothing to clean' >&2
|
||||
exit 1
|
||||
|
||||
@@ -1,32 +1,31 @@
|
||||
:: Copyright 2012 The Go Authors. All rights reserved.
|
||||
:: Use of this source code is governed by a BSD-style
|
||||
:: license that can be found in the LICENSE file.
|
||||
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
|
||||
set GOBUILDFAIL=0
|
||||
|
||||
go tool dist env -w -p >env.bat
|
||||
if errorlevel 1 goto fail
|
||||
call env.bat
|
||||
del env.bat
|
||||
echo.
|
||||
|
||||
if exist %GOTOOLDIR%\dist.exe goto distok
|
||||
echo cannot find %GOTOOLDIR%\dist; nothing to clean
|
||||
goto fail
|
||||
:distok
|
||||
|
||||
"%GOBIN%\go" clean -i std
|
||||
"%GOBIN%\go" tool dist clean
|
||||
"%GOBIN%\go" clean -i cmd
|
||||
|
||||
goto end
|
||||
|
||||
:fail
|
||||
set GOBUILDFAIL=1
|
||||
|
||||
:end
|
||||
if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL%
|
||||
:: Copyright 2012 The Go Authors. All rights reserved.
|
||||
:: Use of this source code is governed by a BSD-style
|
||||
:: license that can be found in the LICENSE file.
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
|
||||
set GOBUILDFAIL=0
|
||||
|
||||
go tool dist env -w -p >env.bat
|
||||
if errorlevel 1 goto fail
|
||||
call env.bat
|
||||
del env.bat
|
||||
echo.
|
||||
|
||||
if exist %GOTOOLDIR%\dist.exe goto distok
|
||||
echo cannot find %GOTOOLDIR%\dist; nothing to clean
|
||||
goto fail
|
||||
:distok
|
||||
|
||||
"%GOBIN%\go" clean -i std
|
||||
"%GOBIN%\go" tool dist clean
|
||||
"%GOBIN%\go" clean -i cmd
|
||||
|
||||
goto end
|
||||
|
||||
:fail
|
||||
set GOBUILDFAIL=1
|
||||
|
||||
:end
|
||||
if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL%
|
||||
|
||||
@@ -73,29 +73,19 @@ func testAddr2Line(t *testing.T, exepath, addr string) {
|
||||
if err != nil {
|
||||
t.Fatalf("Stat failed: %v", err)
|
||||
}
|
||||
// Debug paths are stored slash-separated, so convert to system-native.
|
||||
srcPath = filepath.FromSlash(srcPath)
|
||||
fi2, err := os.Stat(srcPath)
|
||||
if gorootFinal := os.Getenv("GOROOT_FINAL"); gorootFinal != "" && strings.HasPrefix(srcPath, gorootFinal) {
|
||||
if os.IsNotExist(err) || (err == nil && !os.SameFile(fi1, fi2)) {
|
||||
// srcPath has had GOROOT_FINAL substituted for GOROOT, and it doesn't
|
||||
// match the actual file. GOROOT probably hasn't been moved to its final
|
||||
// location yet, so try the original location instead.
|
||||
fi2, err = os.Stat(runtime.GOROOT() + strings.TrimPrefix(srcPath, gorootFinal))
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
t.Fatalf("Stat failed: %v", err)
|
||||
}
|
||||
if !os.SameFile(fi1, fi2) {
|
||||
t.Fatalf("addr2line_test.go and %s are not same file", srcPath)
|
||||
}
|
||||
if srcLineNo != "99" {
|
||||
t.Fatalf("line number = %v; want 99", srcLineNo)
|
||||
if srcLineNo != "89" {
|
||||
t.Fatalf("line number = %v; want 89", srcLineNo)
|
||||
}
|
||||
}
|
||||
|
||||
// This is line 98. The test depends on that.
|
||||
// This is line 88. The test depends on that.
|
||||
func TestAddr2Line(t *testing.T) {
|
||||
testenv.MustHaveGoBuild(t)
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ import (
|
||||
"runtime"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
)
|
||||
|
||||
func goCmd() string {
|
||||
@@ -60,6 +59,8 @@ var contexts = []*build.Context{
|
||||
{GOOS: "linux", GOARCH: "amd64"},
|
||||
{GOOS: "linux", GOARCH: "arm", CgoEnabled: true},
|
||||
{GOOS: "linux", GOARCH: "arm"},
|
||||
{GOOS: "darwin", GOARCH: "386", CgoEnabled: true},
|
||||
{GOOS: "darwin", GOARCH: "386"},
|
||||
{GOOS: "darwin", GOARCH: "amd64", CgoEnabled: true},
|
||||
{GOOS: "darwin", GOARCH: "amd64"},
|
||||
{GOOS: "windows", GOARCH: "amd64"},
|
||||
@@ -137,37 +138,68 @@ func main() {
|
||||
c.Compiler = build.Default.Compiler
|
||||
}
|
||||
|
||||
walkers := make([]*Walker, len(contexts))
|
||||
var wg sync.WaitGroup
|
||||
for i, context := range contexts {
|
||||
i, context := i, context
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
walkers[i] = NewWalker(context, filepath.Join(build.Default.GOROOT, "src"))
|
||||
}()
|
||||
}
|
||||
wg.Wait()
|
||||
|
||||
var featureCtx = make(map[string]map[string]bool) // feature -> context name -> true
|
||||
for _, w := range walkers {
|
||||
pkgNames := w.stdPackages
|
||||
if flag.NArg() > 0 {
|
||||
pkgNames = flag.Args()
|
||||
var pkgNames []string
|
||||
if flag.NArg() > 0 {
|
||||
pkgNames = flag.Args()
|
||||
} else {
|
||||
stds, err := exec.Command(goCmd(), "list", "std").Output()
|
||||
if err != nil {
|
||||
log.Fatalf("go list std: %v\n%s", err, stds)
|
||||
}
|
||||
for _, pkg := range strings.Fields(string(stds)) {
|
||||
if !internalPkg.MatchString(pkg) {
|
||||
pkgNames = append(pkgNames, pkg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
importDir, importMap := loadImports()
|
||||
|
||||
// The code below assumes that the import map can vary
|
||||
// by package, so that an import in one package (directory) might mean
|
||||
// something different from the same import in another.
|
||||
// While this can happen in GOPATH mode with vendoring,
|
||||
// it is not possible in the standard library: the one importMap
|
||||
// returned by loadImports applies to all packages.
|
||||
// Construct a per-directory importMap that resolves to
|
||||
// that single map for all packages.
|
||||
importMapForDir := make(map[string]map[string]string)
|
||||
for _, dir := range importDir {
|
||||
importMapForDir[dir] = importMap
|
||||
}
|
||||
var featureCtx = make(map[string]map[string]bool) // feature -> context name -> true
|
||||
for _, context := range contexts {
|
||||
w := NewWalker(context, filepath.Join(build.Default.GOROOT, "src"))
|
||||
w.importDir = importDir
|
||||
w.importMap = importMapForDir
|
||||
|
||||
for _, name := range pkgNames {
|
||||
pkg, err := w.Import(name)
|
||||
if _, nogo := err.(*build.NoGoError); nogo {
|
||||
// Vendored packages do not contribute to our
|
||||
// public API surface.
|
||||
if strings.HasPrefix(name, "vendor/") {
|
||||
continue
|
||||
}
|
||||
if err != nil {
|
||||
log.Fatalf("Import(%q): %v", name, err)
|
||||
// - Package "unsafe" contains special signatures requiring
|
||||
// extra care when printing them - ignore since it is not
|
||||
// going to change w/o a language change.
|
||||
// - We don't care about the API of commands.
|
||||
if name != "unsafe" && !strings.HasPrefix(name, "cmd/") {
|
||||
if name == "runtime/cgo" && !context.CgoEnabled {
|
||||
// w.Import(name) will return nil
|
||||
continue
|
||||
}
|
||||
pkg, err := w.Import(name)
|
||||
if _, nogo := err.(*build.NoGoError); nogo {
|
||||
continue
|
||||
}
|
||||
if err != nil {
|
||||
log.Fatalf("Import(%q): %v", name, err)
|
||||
}
|
||||
w.export(pkg)
|
||||
}
|
||||
w.export(pkg)
|
||||
}
|
||||
|
||||
ctxName := contextName(w.context)
|
||||
ctxName := contextName(context)
|
||||
for _, f := range w.Features() {
|
||||
if featureCtx[f] == nil {
|
||||
featureCtx[f] = make(map[string]bool)
|
||||
@@ -250,13 +282,6 @@ func featureWithoutContext(f string) string {
|
||||
return spaceParensRx.ReplaceAllString(f, "")
|
||||
}
|
||||
|
||||
// portRemoved reports whether the given port-specific API feature is
|
||||
// okay to no longer exist because its port was removed.
|
||||
func portRemoved(feature string) bool {
|
||||
return strings.Contains(feature, "(darwin-386)") ||
|
||||
strings.Contains(feature, "(darwin-386-cgo)")
|
||||
}
|
||||
|
||||
func compareAPI(w io.Writer, features, required, optional, exception []string, allowAdd bool) (ok bool) {
|
||||
ok = true
|
||||
|
||||
@@ -284,8 +309,6 @@ func compareAPI(w io.Writer, features, required, optional, exception []string, a
|
||||
// acknowledged by being in the file
|
||||
// "api/except.txt". No need to print them out
|
||||
// here.
|
||||
} else if portRemoved(feature) {
|
||||
// okay.
|
||||
} else if featureSet[featureWithoutContext(feature)] {
|
||||
// okay.
|
||||
} else {
|
||||
@@ -345,27 +368,23 @@ func fileFeatures(filename string) []string {
|
||||
var fset = token.NewFileSet()
|
||||
|
||||
type Walker struct {
|
||||
context *build.Context
|
||||
root string
|
||||
scope []string
|
||||
current *types.Package
|
||||
features map[string]bool // set
|
||||
imported map[string]*types.Package // packages already imported
|
||||
stdPackages []string // names, omitting "unsafe", internal, and vendored packages
|
||||
importMap map[string]map[string]string // importer dir -> import path -> canonical path
|
||||
importDir map[string]string // canonical import path -> dir
|
||||
|
||||
context *build.Context
|
||||
root string
|
||||
scope []string
|
||||
current *types.Package
|
||||
features map[string]bool // set
|
||||
imported map[string]*types.Package // packages already imported
|
||||
importMap map[string]map[string]string // importer dir -> import path -> canonical path
|
||||
importDir map[string]string // canonical import path -> dir
|
||||
}
|
||||
|
||||
func NewWalker(context *build.Context, root string) *Walker {
|
||||
w := &Walker{
|
||||
return &Walker{
|
||||
context: context,
|
||||
root: root,
|
||||
features: map[string]bool{},
|
||||
imported: map[string]*types.Package{"unsafe": types.Unsafe},
|
||||
}
|
||||
w.loadImports()
|
||||
return w
|
||||
}
|
||||
|
||||
func (w *Walker) Features() (fs []string) {
|
||||
@@ -436,120 +455,58 @@ func tagKey(dir string, context *build.Context, tags []string) string {
|
||||
return key
|
||||
}
|
||||
|
||||
type listImports struct {
|
||||
stdPackages []string // names, omitting "unsafe", internal, and vendored packages
|
||||
importDir map[string]string // canonical import path → directory
|
||||
importMap map[string]map[string]string // import path → canonical import path
|
||||
}
|
||||
|
||||
var listCache sync.Map // map[string]listImports, keyed by contextName
|
||||
|
||||
// listSem is a semaphore restricting concurrent invocations of 'go list'.
|
||||
var listSem = make(chan semToken, runtime.GOMAXPROCS(0))
|
||||
|
||||
type semToken struct{}
|
||||
|
||||
// loadImports populates w with information about the packages in the standard
|
||||
// library and the packages they themselves import in w's build context.
|
||||
//
|
||||
// loadImports returns information about the packages in the standard library
|
||||
// and the packages they themselves import.
|
||||
// importDir maps expanded import path to the directory containing that package.
|
||||
// importMap maps source import path to expanded import path.
|
||||
// The source import path and expanded import path are identical except for vendored packages.
|
||||
// For example, on return:
|
||||
//
|
||||
// w.importMap["math"] = "math"
|
||||
// w.importDir["math"] = "<goroot>/src/math"
|
||||
// importMap["math"] = "math"
|
||||
// importDir["math"] = "<goroot>/src/math"
|
||||
//
|
||||
// w.importMap["golang.org/x/net/route"] = "vendor/golang.org/x/net/route"
|
||||
// w.importDir["vendor/golang.org/x/net/route"] = "<goroot>/src/vendor/golang.org/x/net/route"
|
||||
// importMap["golang.org/x/net/route"] = "vendor/golang.org/x/net/route"
|
||||
// importDir["vendor/golang.org/x/net/route"] = "<goroot>/src/vendor/golang.org/x/net/route"
|
||||
//
|
||||
// Since the set of packages that exist depends on context, the result of
|
||||
// loadImports also depends on context. However, to improve test running time
|
||||
// the configuration for each environment is cached across runs.
|
||||
func (w *Walker) loadImports() {
|
||||
if w.context == nil {
|
||||
return // test-only Walker; does not use the import map
|
||||
// There are a few imports that only appear on certain platforms,
|
||||
// including it turns out x/net/route, and we add those explicitly.
|
||||
func loadImports() (importDir map[string]string, importMap map[string]string) {
|
||||
out, err := exec.Command(goCmd(), "list", "-e", "-deps", "-json", "std").CombinedOutput()
|
||||
if err != nil {
|
||||
log.Fatalf("loading imports: %v\n%s", err, out)
|
||||
}
|
||||
|
||||
name := contextName(w.context)
|
||||
|
||||
imports, ok := listCache.Load(name)
|
||||
if !ok {
|
||||
listSem <- semToken{}
|
||||
defer func() { <-listSem }()
|
||||
|
||||
cmd := exec.Command(goCmd(), "list", "-e", "-deps", "-json", "std")
|
||||
cmd.Env = listEnv(w.context)
|
||||
out, err := cmd.CombinedOutput()
|
||||
importDir = make(map[string]string)
|
||||
importMap = make(map[string]string)
|
||||
dec := json.NewDecoder(bytes.NewReader(out))
|
||||
for {
|
||||
var pkg struct {
|
||||
ImportPath, Dir string
|
||||
ImportMap map[string]string
|
||||
}
|
||||
err := dec.Decode(&pkg)
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
log.Fatalf("loading imports: %v\n%s", err, out)
|
||||
log.Fatalf("go list: invalid output: %v", err)
|
||||
}
|
||||
|
||||
var stdPackages []string
|
||||
importMap := make(map[string]map[string]string)
|
||||
importDir := make(map[string]string)
|
||||
dec := json.NewDecoder(bytes.NewReader(out))
|
||||
for {
|
||||
var pkg struct {
|
||||
ImportPath, Dir string
|
||||
ImportMap map[string]string
|
||||
}
|
||||
err := dec.Decode(&pkg)
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
log.Fatalf("go list: invalid output: %v", err)
|
||||
}
|
||||
|
||||
// - Package "unsafe" contains special signatures requiring
|
||||
// extra care when printing them - ignore since it is not
|
||||
// going to change w/o a language change.
|
||||
// - internal and vendored packages do not contribute to our
|
||||
// API surface.
|
||||
// - 'go list std' does not include commands, which cannot be
|
||||
// imported anyway.
|
||||
if ip := pkg.ImportPath; ip != "unsafe" && !strings.HasPrefix(ip, "vendor/") && !internalPkg.MatchString(ip) {
|
||||
stdPackages = append(stdPackages, ip)
|
||||
}
|
||||
importDir[pkg.ImportPath] = pkg.Dir
|
||||
if len(pkg.ImportMap) > 0 {
|
||||
importMap[pkg.Dir] = make(map[string]string, len(pkg.ImportMap))
|
||||
}
|
||||
for k, v := range pkg.ImportMap {
|
||||
importMap[pkg.Dir][k] = v
|
||||
}
|
||||
importDir[pkg.ImportPath] = pkg.Dir
|
||||
for k, v := range pkg.ImportMap {
|
||||
importMap[k] = v
|
||||
}
|
||||
|
||||
sort.Strings(stdPackages)
|
||||
imports = listImports{
|
||||
stdPackages: stdPackages,
|
||||
importMap: importMap,
|
||||
importDir: importDir,
|
||||
}
|
||||
imports, _ = listCache.LoadOrStore(name, imports)
|
||||
}
|
||||
|
||||
li := imports.(listImports)
|
||||
w.stdPackages = li.stdPackages
|
||||
w.importDir = li.importDir
|
||||
w.importMap = li.importMap
|
||||
}
|
||||
|
||||
// listEnv returns the process environment to use when invoking 'go list' for
|
||||
// the given context.
|
||||
func listEnv(c *build.Context) []string {
|
||||
if c == nil {
|
||||
return os.Environ()
|
||||
// Fixup for vendor packages listed in args above.
|
||||
fixup := []string{
|
||||
"vendor/golang.org/x/net/route",
|
||||
}
|
||||
|
||||
environ := append(os.Environ(),
|
||||
"GOOS="+c.GOOS,
|
||||
"GOARCH="+c.GOARCH)
|
||||
if c.CgoEnabled {
|
||||
environ = append(environ, "CGO_ENABLED=1")
|
||||
} else {
|
||||
environ = append(environ, "CGO_ENABLED=0")
|
||||
for _, pkg := range fixup {
|
||||
importDir[pkg] = filepath.Join(build.Default.GOROOT, "src", pkg)
|
||||
importMap[strings.TrimPrefix(pkg, "vendor/")] = pkg
|
||||
}
|
||||
return environ
|
||||
return
|
||||
}
|
||||
|
||||
// Importing is a sentinel taking the place in Walker.imported
|
||||
@@ -581,7 +538,7 @@ func (w *Walker) ImportFrom(fromPath, fromDir string, mode types.ImportMode) (*t
|
||||
dir = filepath.Join(w.root, filepath.FromSlash(name))
|
||||
}
|
||||
if fi, err := os.Stat(dir); err != nil || !fi.IsDir() {
|
||||
log.Panicf("no source in tree for import %q (from import %s in %s): %v", name, fromPath, fromDir, err)
|
||||
log.Fatalf("no source in tree for import %q (from import %s in %s): %v", name, fromPath, fromDir, err)
|
||||
}
|
||||
|
||||
context := w.context
|
||||
|
||||
@@ -9,36 +9,16 @@ import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"go/build"
|
||||
"internal/testenv"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
flag.Parse()
|
||||
for _, c := range contexts {
|
||||
c.Compiler = build.Default.Compiler
|
||||
}
|
||||
|
||||
// Warm up the import cache in parallel.
|
||||
var wg sync.WaitGroup
|
||||
for _, context := range contexts {
|
||||
context := context
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
_ = NewWalker(context, filepath.Join(build.Default.GOROOT, "src"))
|
||||
}()
|
||||
}
|
||||
wg.Wait()
|
||||
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
|
||||
var (
|
||||
updateGolden = flag.Bool("updategolden", false, "update golden files")
|
||||
)
|
||||
@@ -140,6 +120,7 @@ func TestCompareAPI(t *testing.T) {
|
||||
name: "contexts reconverging",
|
||||
required: []string{
|
||||
"A",
|
||||
"pkg syscall (darwin-386), type RawSockaddrInet6 struct",
|
||||
"pkg syscall (darwin-amd64), type RawSockaddrInet6 struct",
|
||||
},
|
||||
features: []string{
|
||||
@@ -183,12 +164,25 @@ func TestSkipInternal(t *testing.T) {
|
||||
}
|
||||
|
||||
func BenchmarkAll(b *testing.B) {
|
||||
stds, err := exec.Command(testenv.GoToolPath(b), "list", "std").Output()
|
||||
if err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
b.ResetTimer()
|
||||
pkgNames := strings.Fields(string(stds))
|
||||
|
||||
for _, c := range contexts {
|
||||
c.Compiler = build.Default.Compiler
|
||||
}
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
for _, context := range contexts {
|
||||
w := NewWalker(context, filepath.Join(build.Default.GOROOT, "src"))
|
||||
for _, name := range w.stdPackages {
|
||||
pkg, _ := w.Import(name)
|
||||
w.export(pkg)
|
||||
for _, name := range pkgNames {
|
||||
if name != "unsafe" && !strings.HasPrefix(name, "cmd/") && !internalPkg.MatchString(name) {
|
||||
pkg, _ := w.Import(name)
|
||||
w.export(pkg)
|
||||
}
|
||||
}
|
||||
w.Features()
|
||||
}
|
||||
@@ -196,6 +190,9 @@ func BenchmarkAll(b *testing.B) {
|
||||
}
|
||||
|
||||
func TestIssue21181(t *testing.T) {
|
||||
for _, c := range contexts {
|
||||
c.Compiler = build.Default.Compiler
|
||||
}
|
||||
for _, context := range contexts {
|
||||
w := NewWalker(context, "testdata/src/issue21181")
|
||||
pkg, err := w.Import("p")
|
||||
@@ -208,6 +205,9 @@ func TestIssue21181(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIssue29837(t *testing.T) {
|
||||
for _, c := range contexts {
|
||||
c.Compiler = build.Default.Compiler
|
||||
}
|
||||
for _, context := range contexts {
|
||||
w := NewWalker(context, "testdata/src/issue29837")
|
||||
_, err := w.Import("p")
|
||||
|
||||
@@ -33,17 +33,14 @@ Flags:
|
||||
Dump instructions as they are parsed.
|
||||
-dynlink
|
||||
Support references to Go symbols defined in other shared libraries.
|
||||
-gensymabis
|
||||
Write symbol ABI information to output file. Don't assemble.
|
||||
-o file
|
||||
Write output to file. The default is foo.o for /a/b/c/foo.s.
|
||||
-shared
|
||||
Generate code that can be linked into a shared library.
|
||||
-spectre list
|
||||
Enable spectre mitigations in list (all, ret).
|
||||
-trimpath prefix
|
||||
Remove prefix from recorded source file paths.
|
||||
|
||||
-gensymabis
|
||||
Write symbol ABI information to output file. Don't assemble.
|
||||
Input language:
|
||||
|
||||
The assembler uses mostly the same syntax for all architectures,
|
||||
|
||||
@@ -88,8 +88,7 @@ func jumpX86(word string) bool {
|
||||
|
||||
func jumpRISCV(word string) bool {
|
||||
switch word {
|
||||
case "BEQ", "BEQZ", "BGE", "BGEU", "BGEZ", "BGT", "BGTU", "BGTZ", "BLE", "BLEU", "BLEZ",
|
||||
"BLT", "BLTU", "BLTZ", "BNE", "BNEZ", "CALL", "JAL", "JALR", "JMP":
|
||||
case "BEQ", "BNE", "BLT", "BGE", "BLTU", "BGEU", "CALL", "JAL", "JALR", "JMP":
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -485,9 +484,6 @@ func archMips64(linkArch *obj.LinkArch) *Arch {
|
||||
for i := mips.REG_FCR0; i <= mips.REG_FCR31; i++ {
|
||||
register[obj.Rconv(i)] = int16(i)
|
||||
}
|
||||
for i := mips.REG_W0; i <= mips.REG_W31; i++ {
|
||||
register[obj.Rconv(i)] = int16(i)
|
||||
}
|
||||
register["HI"] = mips.REG_HI
|
||||
register["LO"] = mips.REG_LO
|
||||
// Pseudo-registers.
|
||||
@@ -505,7 +501,6 @@ func archMips64(linkArch *obj.LinkArch) *Arch {
|
||||
"FCR": true,
|
||||
"M": true,
|
||||
"R": true,
|
||||
"W": true,
|
||||
}
|
||||
|
||||
instructions := make(map[string]obj.As)
|
||||
|
||||
@@ -63,10 +63,6 @@ func mipsRegisterNumber(name string, n int16) (int16, bool) {
|
||||
if 0 <= n && n <= 31 {
|
||||
return mips.REG_R0 + n, true
|
||||
}
|
||||
case "W":
|
||||
if 0 <= n && n <= 31 {
|
||||
return mips.REG_W0 + n, true
|
||||
}
|
||||
}
|
||||
return 0, false
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// This file encapsulates some of the odd characteristics of the RISCV64
|
||||
// instruction set, to minimize its interaction with the core of the
|
||||
// assembler.
|
||||
|
||||
package arch
|
||||
|
||||
import (
|
||||
"cmd/internal/obj"
|
||||
"cmd/internal/obj/riscv"
|
||||
)
|
||||
|
||||
// IsRISCV64AMO reports whether the op (as defined by a riscv.A*
|
||||
// constant) is one of the AMO instructions that requires special
|
||||
// handling.
|
||||
func IsRISCV64AMO(op obj.As) bool {
|
||||
switch op {
|
||||
case riscv.ASCW, riscv.ASCD, riscv.AAMOSWAPW, riscv.AAMOSWAPD, riscv.AAMOADDW, riscv.AAMOADDD,
|
||||
riscv.AAMOANDW, riscv.AAMOANDD, riscv.AAMOORW, riscv.AAMOORD, riscv.AAMOXORW, riscv.AAMOXORD,
|
||||
riscv.AAMOMINW, riscv.AAMOMIND, riscv.AAMOMINUW, riscv.AAMOMINUD,
|
||||
riscv.AAMOMAXW, riscv.AAMOMAXD, riscv.AAMOMAXUW, riscv.AAMOMAXUD:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
@@ -590,7 +590,7 @@ func (p *Parser) asmInstruction(op obj.As, cond string, a []obj.Addr) {
|
||||
prog.To = a[1]
|
||||
case 3:
|
||||
switch p.arch.Family {
|
||||
case sys.MIPS, sys.MIPS64:
|
||||
case sys.MIPS, sys.MIPS64, sys.RISCV64:
|
||||
prog.From = a[0]
|
||||
prog.Reg = p.getRegister(prog, op, &a[1])
|
||||
prog.To = a[2]
|
||||
@@ -675,21 +675,6 @@ func (p *Parser) asmInstruction(op obj.As, cond string, a []obj.Addr) {
|
||||
p.errorf("invalid addressing modes for %s instruction", op)
|
||||
return
|
||||
}
|
||||
case sys.RISCV64:
|
||||
// RISCV64 instructions with one input and two outputs.
|
||||
if arch.IsRISCV64AMO(op) {
|
||||
prog.From = a[0]
|
||||
prog.To = a[1]
|
||||
if a[2].Type != obj.TYPE_REG {
|
||||
p.errorf("invalid addressing modes for third operand to %s instruction, must be register", op)
|
||||
return
|
||||
}
|
||||
prog.RegTo2 = a[2].Reg
|
||||
break
|
||||
}
|
||||
prog.From = a[0]
|
||||
prog.Reg = p.getRegister(prog, op, &a[1])
|
||||
prog.To = a[2]
|
||||
case sys.S390X:
|
||||
prog.From = a[0]
|
||||
if a[1].Type == obj.TYPE_REG {
|
||||
|
||||
@@ -390,12 +390,7 @@ func TestARM64Errors(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAMD64EndToEnd(t *testing.T) {
|
||||
defer func(old string) { objabi.GOAMD64 = old }(objabi.GOAMD64)
|
||||
for _, goamd64 := range []string{"normaljumps", "alignedjumps"} {
|
||||
t.Logf("GOAMD64=%s", goamd64)
|
||||
objabi.GOAMD64 = goamd64
|
||||
testEndToEnd(t, "amd64", "amd64")
|
||||
}
|
||||
testEndToEnd(t, "amd64", "amd64")
|
||||
}
|
||||
|
||||
func Test386Encoder(t *testing.T) {
|
||||
|
||||
70
src/cmd/asm/internal/asm/testdata/arm64.s
vendored
70
src/cmd/asm/internal/asm/testdata/arm64.s
vendored
@@ -77,10 +77,6 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
||||
SHA1H V5, V4 // a408285e
|
||||
SHA1M V8.S4, V7, V6 // e620085e
|
||||
SHA1P V11.S4, V10, V9 // 49110b5e
|
||||
SHA512H V2.D2, V1, V0 // 208062ce
|
||||
SHA512H2 V4.D2, V3, V2 // 628464ce
|
||||
SHA512SU0 V9.D2, V8.D2 // 2881c0ce
|
||||
SHA512SU1 V7.D2, V6.D2, V5.D2 // c58867ce
|
||||
VADDV V0.S4, V0 // 00b8b14e
|
||||
VMOVI $82, V0.B16 // 40e6024f
|
||||
VUADDLV V6.B16, V6 // c638306e
|
||||
@@ -145,37 +141,6 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
||||
VZIP2 V10.D2, V13.D2, V3.D2 // a379ca4e
|
||||
VZIP1 V17.S2, V4.S2, V26.S2 // 9a38910e
|
||||
VZIP2 V25.S2, V14.S2, V25.S2 // d979990e
|
||||
VUXTL V30.B8, V30.H8 // dea7082f
|
||||
VUXTL V30.H4, V29.S4 // dda7102f
|
||||
VUXTL V29.S2, V2.D2 // a2a7202f
|
||||
VUXTL2 V30.H8, V30.S4 // dea7106f
|
||||
VUXTL2 V29.S4, V2.D2 // a2a7206f
|
||||
VUXTL2 V30.B16, V2.H8 // c2a7086f
|
||||
VBIT V21.B16, V25.B16, V4.B16 // 241fb56e
|
||||
VBSL V23.B16, V3.B16, V7.B16 // 671c776e
|
||||
VCMTST V2.B8, V29.B8, V2.B8 // a28f220e
|
||||
VCMTST V2.D2, V23.D2, V3.D2 // e38ee24e
|
||||
VSUB V2.B8, V30.B8, V30.B8 // de87222e
|
||||
VUZP1 V0.B8, V30.B8, V1.B8 // c11b000e
|
||||
VUZP1 V1.B16, V29.B16, V2.B16 // a21b014e
|
||||
VUZP1 V2.H4, V28.H4, V3.H4 // 831b420e
|
||||
VUZP1 V3.H8, V27.H8, V4.H8 // 641b434e
|
||||
VUZP1 V28.S2, V2.S2, V5.S2 // 45189c0e
|
||||
VUZP1 V29.S4, V1.S4, V6.S4 // 26189d4e
|
||||
VUZP1 V30.D2, V0.D2, V7.D2 // 0718de4e
|
||||
VUZP2 V0.D2, V30.D2, V1.D2 // c15bc04e
|
||||
VUZP2 V30.D2, V0.D2, V29.D2 // 1d58de4e
|
||||
VUSHLL $0, V30.B8, V30.H8 // dea7082f
|
||||
VUSHLL $0, V30.H4, V29.S4 // dda7102f
|
||||
VUSHLL $0, V29.S2, V2.D2 // a2a7202f
|
||||
VUSHLL2 $0, V30.B16, V2.H8 // c2a7086f
|
||||
VUSHLL2 $0, V30.H8, V30.S4 // dea7106f
|
||||
VUSHLL2 $0, V29.S4, V2.D2 // a2a7206f
|
||||
VUSHLL $7, V30.B8, V30.H8 // dea70f2f
|
||||
VUSHLL $15, V30.H4, V29.S4 // dda71f2f
|
||||
VUSHLL2 $31, V30.S4, V2.D2 // c2a73f6f
|
||||
VBIF V0.B8, V30.B8, V1.B8 // c11fe02e
|
||||
VBIF V30.B16, V0.B16, V2.B16 // 021cfe6e
|
||||
MOVD (R2)(R6.SXTW), R4 // 44c866f8
|
||||
MOVD (R3)(R6), R5 // MOVD (R3)(R6*1), R5 // 656866f8
|
||||
MOVD (R2)(R6), R4 // MOVD (R2)(R6*1), R4 // 446866f8
|
||||
@@ -217,10 +182,6 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
||||
FMOVS $(0.96875), F3 // 03f02d1e
|
||||
FMOVD $(28.0), F4 // 0490671e
|
||||
|
||||
// move a large constant to a Vd.
|
||||
FMOVD $0x8040201008040201, V20 // FMOVD $-9205322385119247871, V20
|
||||
FMOVQ $0x8040201008040202, V29 // FMOVQ $-9205322385119247870, V29
|
||||
|
||||
FMOVS (R2)(R6), F4 // FMOVS (R2)(R6*1), F4 // 446866bc
|
||||
FMOVS (R2)(R6<<2), F4 // 447866bc
|
||||
FMOVD (R2)(R6), F4 // FMOVD (R2)(R6*1), F4 // 446866fc
|
||||
@@ -313,9 +274,6 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
||||
ADDW $0x60060, R2 // ADDW $393312, R2 // 4280011142804111
|
||||
CMPW $0x60060, R2 // CMPW $393312, R2 // 1b0c8052db00a0725f001b6b
|
||||
|
||||
// TODO: this could have better encoding
|
||||
ANDW $-1, R10 // 1b0080124a011b0a
|
||||
|
||||
AND $8, R0, RSP // 1f007d92
|
||||
ORR $8, R0, RSP // 1f007db2
|
||||
EOR $8, R0, RSP // 1f007dd2
|
||||
@@ -394,22 +352,18 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
||||
VLD4 (R15), [V10.H4, V11.H4, V12.H4, V13.H4] // ea05400c
|
||||
VLD4.P 32(R24), [V31.B8, V0.B8, V1.B8, V2.B8] // 1f03df0c
|
||||
VLD4.P (R13)(R9), [V14.S2, V15.S2, V16.S2, V17.S2] // VLD4.P (R13)(R9*1), [V14.S2,V15.S2,V16.S2,V17.S2] // ae09c90c
|
||||
VLD1R (R1), [V9.B8] // 29c0400d
|
||||
VLD1R.P (R1), [V9.B8] // 29c0df0d
|
||||
VLD1R.P 1(R1), [V2.B8] // 22c0df0d
|
||||
VLD1R.P 2(R1), [V2.H4] // 22c4df0d
|
||||
VLD1R (R0), [V0.B16] // 00c0404d
|
||||
VLD1R.P (R0), [V0.B16] // 00c0df4d
|
||||
VLD1R.P (R15)(R1), [V15.H4] // VLD1R.P (R15)(R1*1), [V15.H4] // efc5c10d
|
||||
VLD2R (R15), [V15.H4, V16.H4] // efc5600d
|
||||
VLD2R.P 16(R0), [V0.D2, V1.D2] // 00ccff4d
|
||||
VLD2R.P (R0)(R5), [V31.D1, V0.D1] // VLD2R.P (R0)(R5*1), [V31.D1, V0.D1] // 1fcce50d
|
||||
VLD3R (RSP), [V31.S2, V0.S2, V1.S2] // ffeb400d
|
||||
VLD3R.P 6(R15), [V15.H4, V16.H4, V17.H4] // efe5df0d
|
||||
VLD3R.P (R15)(R6), [V15.H8, V16.H8, V17.H8] // VLD3R.P (R15)(R6*1), [V15.H8, V16.H8, V17.H8] // efe5c64d
|
||||
VLD4R (R0), [V0.B8, V1.B8, V2.B8, V3.B8] // 00e0600d
|
||||
VLD4R.P 16(RSP), [V31.S4, V0.S4, V1.S4, V2.S4] // ffebff4d
|
||||
VLD4R.P (R15)(R9), [V15.H4, V16.H4, V17.H4, V18.H4] // VLD4R.P (R15)(R9*1), [V15.H4, V16.H4, V17.H4, V18.H4] // efe5e90d
|
||||
VLD1R (R0), [V0.B16] // 00c0404d
|
||||
VLD1R.P 16(R0), [V0.B16] // 00c0df4d
|
||||
VLD1R.P (R15)(R1), [V15.H4] // VLD1R.P (R15)(R1*1), [V15.H4] // efc5c10d
|
||||
VLD2R (R15), [V15.H4, V16.H4] // efc5600d
|
||||
VLD2R.P 32(R0), [V0.D2, V1.D2] // 00ccff4d
|
||||
VLD2R.P (R0)(R5), [V31.D1, V0.D1] // VLD2R.P (R0)(R5*1), [V31.D1, V0.D1] // 1fcce50d
|
||||
VLD3R (RSP), [V31.S2, V0.S2, V1.S2] // ffeb400d
|
||||
VLD3R.P 24(R15), [V15.H4, V16.H4, V17.H4] // efe5df0d
|
||||
VLD3R.P (R15)(R6), [V15.H8, V16.H8, V17.H8] // VLD3R.P (R15)(R6*1), [V15.H8, V16.H8, V17.H8] // efe5c64d
|
||||
VLD4R (R0), [V0.B8, V1.B8, V2.B8, V3.B8] // 00e0600d
|
||||
VLD4R.P 64(RSP), [V31.S4, V0.S4, V1.S4, V2.S4] // ffebff4d
|
||||
VLD4R.P (R15)(R9), [V15.H4, V16.H4, V17.H4, V18.H4] // VLD4R.P (R15)(R9*1), [V15.H4, V16.H4, V17.H4, V18.H4] // efe5e90d
|
||||
VST1.P [V24.S2], 8(R2) // 58789f0c
|
||||
VST1 [V29.S2, V30.S2], (R29) // bdab000c
|
||||
VST1 [V14.H4, V15.H4, V16.H4], (R27) // 6e67000c
|
||||
|
||||
7
src/cmd/asm/internal/asm/testdata/arm64enc.s
vendored
7
src/cmd/asm/internal/asm/testdata/arm64enc.s
vendored
@@ -420,7 +420,6 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$-8
|
||||
UXTBW R2, R6 // 461c0053
|
||||
UXTHW R7, R20 // f43c0053
|
||||
VCNT V0.B8, V0.B8 // 0058200e
|
||||
VCNT V0.B16, V0.B16 // 0058204e
|
||||
WFE // 5f2003d5
|
||||
WFI // 7f2003d5
|
||||
YIELD // 3f2003d5
|
||||
@@ -591,7 +590,7 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$-8
|
||||
FMOVS R8, F15 // 0f01271e
|
||||
FMOVD F2, F9 // 4940601e
|
||||
FMOVS F4, F27 // 9b40201e
|
||||
//TODO VFMOV $3.125, V8.D2 // 28f5006f
|
||||
//TODO VFMOV $3.125, V8.2D // 28f5006f
|
||||
FMSUBS F13, F21, F13, F19 // b3d50d1f
|
||||
FMSUBD F11, F7, F15, F31 // ff9d4b1f
|
||||
//TODO VFMUL V9.S[2], F21, F19 // b39a895f
|
||||
@@ -648,7 +647,7 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$-8
|
||||
FSUBS F25, F23, F0 // e03a391e
|
||||
FSUBD F11, F13, F24 // b8396b1e
|
||||
//TODO SCVTFSS F30, F20 // d4db215e
|
||||
//TODO VSCVTF V7.S2, V17.S2 // f1d8210e
|
||||
//TODO VSCVTF V7.2S, V17.2S // f1d8210e
|
||||
SCVTFWS R3, F16 // 7000221e
|
||||
SCVTFWD R20, F4 // 8402621e
|
||||
SCVTFS R16, F12 // 0c02229e
|
||||
@@ -713,8 +712,6 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$-8
|
||||
VPMULL2 V2.B16, V1.B16, V4.H8 // 24e0224e
|
||||
VRBIT V10.B16, V21.B16 // 5559606e
|
||||
VREV32 V2.H8, V1.H8 // 4108606e
|
||||
VREV16 V2.B8, V1.B8 // 4118200e
|
||||
VREV16 V5.B16, V16.B16 // b018204e
|
||||
SCVTFWS R6, F17 // d100221e
|
||||
SCVTFWD R3, F15 // 6f00621e
|
||||
SCVTFS R20, F25 // 9902229e
|
||||
|
||||
17
src/cmd/asm/internal/asm/testdata/arm64error.s
vendored
17
src/cmd/asm/internal/asm/testdata/arm64error.s
vendored
@@ -106,9 +106,6 @@ TEXT errors(SB),$0
|
||||
VST1.P [V1.B16], (R8)(R9<<1) // ERROR "invalid extended register"
|
||||
VREV64 V1.H4, V2.H8 // ERROR "invalid arrangement"
|
||||
VREV64 V1.D1, V2.D1 // ERROR "invalid arrangement"
|
||||
VREV16 V1.D1, V2.D1 // ERROR "invalid arrangement"
|
||||
VREV16 V1.B8, V2.B16 // ERROR "invalid arrangement"
|
||||
VREV16 V1.H4, V2.H4 // ERROR "invalid arrangement"
|
||||
FLDPD (R0), (R1, R2) // ERROR "invalid register pair"
|
||||
FLDPD (R1), (F2, F2) // ERROR "constrained unpredictable behavior"
|
||||
FLDPS (R2), (F3, F3) // ERROR "constrained unpredictable behavior"
|
||||
@@ -339,18 +336,4 @@ TEXT errors(SB),$0
|
||||
MRS ICV_EOIR1_EL1, R3 // ERROR "system register is not readable"
|
||||
MRS PMSWINC_EL0, R3 // ERROR "system register is not readable"
|
||||
MRS OSLAR_EL1, R3 // ERROR "system register is not readable"
|
||||
VLD3R.P 24(R15), [V15.H4,V16.H4,V17.H4] // ERROR "invalid post-increment offset"
|
||||
VBIT V1.H4, V12.H4, V3.H4 // ERROR "invalid arrangement"
|
||||
VBSL V1.D2, V12.D2, V3.D2 // ERROR "invalid arrangement"
|
||||
VUXTL V30.D2, V30.H8 // ERROR "operand mismatch"
|
||||
VUXTL2 V20.B8, V21.H8 // ERROR "operand mismatch"
|
||||
VUXTL V3.D2, V4.B8 // ERROR "operand mismatch"
|
||||
VUZP1 V0.B8, V30.B8, V1.B16 // ERROR "operand mismatch"
|
||||
VUZP2 V0.Q1, V30.Q1, V1.Q1 // ERROR "invalid arrangement"
|
||||
VUSHLL $0, V30.D2, V30.H8 // ERROR "operand mismatch"
|
||||
VUSHLL2 $0, V20.B8, V21.H8 // ERROR "operand mismatch"
|
||||
VUSHLL $8, V30.B8, V30.H8 // ERROR "shift amount out of range"
|
||||
VUSHLL2 $32, V30.S4, V2.D2 // ERROR "shift amount out of range"
|
||||
VBIF V0.B8, V1.B8, V2.B16 // ERROR "operand mismatch"
|
||||
VBIF V0.D2, V1.D2, V2.D2 // ERROR "invalid arrangement"
|
||||
RET
|
||||
|
||||
33
src/cmd/asm/internal/asm/testdata/mips64.s
vendored
33
src/cmd/asm/internal/asm/testdata/mips64.s
vendored
@@ -583,39 +583,6 @@ label4:
|
||||
NEGV R1, R2 // 0001102f
|
||||
RET
|
||||
|
||||
// MSA VMOVI
|
||||
VMOVB $511, W0 // 7b0ff807
|
||||
VMOVH $24, W23 // 7b20c5c7
|
||||
VMOVW $-24, W15 // 7b5f43c7
|
||||
VMOVD $-511, W31 // 7b700fc7
|
||||
|
||||
VMOVB (R0), W8 // 78000220
|
||||
VMOVB 511(R3), W0 // 79ff1820
|
||||
VMOVB -512(R12), W21 // 7a006560
|
||||
VMOVH (R24), W12 // 7800c321
|
||||
VMOVH 110(R19), W8 // 78379a21
|
||||
VMOVH -70(R12), W3 // 7bdd60e1
|
||||
VMOVW (R3), W31 // 78001fe2
|
||||
VMOVW 64(R20), W16 // 7810a422
|
||||
VMOVW -104(R17), W24 // 7be68e22
|
||||
VMOVD (R3), W2 // 780018a3
|
||||
VMOVD 128(R23), W19 // 7810bce3
|
||||
VMOVD -256(R31), W0 // 7be0f823
|
||||
|
||||
VMOVB W8, (R0) // 78000224
|
||||
VMOVB W0, 511(R3) // 79ff1824
|
||||
VMOVB W21, -512(R12) // 7a006564
|
||||
VMOVH W12, (R24) // 7800c325
|
||||
VMOVH W8, 110(R19) // 78379a25
|
||||
VMOVH W3, -70(R12) // 7bdd60e5
|
||||
VMOVW W31, (R3) // 78001fe6
|
||||
VMOVW W16, 64(R20) // 7810a426
|
||||
VMOVW W24, -104(R17) // 7be68e26
|
||||
VMOVD W2, (R3) // 780018a7
|
||||
VMOVD W19, 128(R23) // 7810bce7
|
||||
VMOVD W0, -256(R31) // 7be0f827
|
||||
RET
|
||||
|
||||
// END
|
||||
//
|
||||
// LEND comma // asm doesn't support the trailing comma.
|
||||
|
||||
41
src/cmd/asm/internal/asm/testdata/ppc64.s
vendored
41
src/cmd/asm/internal/asm/testdata/ppc64.s
vendored
@@ -748,14 +748,6 @@ label1:
|
||||
COPY R2,R1
|
||||
PASTECC R2,R1
|
||||
|
||||
// Modulo signed/unsigned double/word X-form
|
||||
// <MNEMONIC> RA,RB,RT produces
|
||||
// <mnemonic> RT,RA,RB
|
||||
MODUD R3,R4,R5
|
||||
MODUW R3,R4,R5
|
||||
MODSD R3,R4,R5
|
||||
MODSW R3,R4,R5
|
||||
|
||||
// VMX instructions
|
||||
|
||||
// Described as:
|
||||
@@ -958,19 +950,12 @@ label1:
|
||||
VCMPGTSDCC V3, V2, V1
|
||||
VCMPNEZB V3, V2, V1
|
||||
VCMPNEZBCC V3, V2, V1
|
||||
VCMPNEB V3, V2, V1
|
||||
VCMPNEBCC V3, V2, V1
|
||||
VCMPNEH V3, V2, V1
|
||||
VCMPNEHCC V3, V2, V1
|
||||
VCMPNEW V3, V2, V1
|
||||
VCMPNEWCC V3, V2, V1
|
||||
|
||||
// Vector permute, VA-form
|
||||
// <MNEMONIC> VRA,VRB,VRC,VRT produces
|
||||
// <mnemonic> VRT,VRA,VRB,VRC
|
||||
VPERM V3, V2, V1, V0
|
||||
VPERMXOR V3, V2, V1, V0
|
||||
VPERMR V3, V2, V1, V0
|
||||
|
||||
// Vector bit permute, VX-form
|
||||
// <MNEMONIC> VRA,VRB,VRT produces
|
||||
@@ -1034,10 +1019,6 @@ label1:
|
||||
LXSIWAX (R1)(R2*1), VS0
|
||||
LXSIWZX (R1)(R2*1), VS0
|
||||
|
||||
// VSX load with length X-form (also left-justified)
|
||||
LXVL R3,R4, VS0
|
||||
LXVLL R3,R4, VS0
|
||||
LXVX R3,R4, VS0
|
||||
// VSX load, DQ-form
|
||||
// <MNEMONIC> DQ(RA), XS produces
|
||||
// <mnemonic> XS, DQ(RA)
|
||||
@@ -1058,11 +1039,6 @@ label1:
|
||||
// <mnemonic> XS, DQ(RA)
|
||||
STXV VS63, -32752(R1)
|
||||
|
||||
// VSX store with length, X-form (also left-justified)
|
||||
STXVL VS0, R3,R4
|
||||
STXVLL VS0, R3,R4
|
||||
STXVX VS0, R3,R4
|
||||
|
||||
// VSX move from VSR, XX1-form
|
||||
// <MNEMONIC> XS,RA produces
|
||||
// <mnemonic> RA,XS
|
||||
@@ -1088,7 +1064,7 @@ label1:
|
||||
// VSX AND, XX3-form
|
||||
// <MNEMONIC> XA,XB,XT produces
|
||||
// <mnemonic> XT,XA,XB
|
||||
XXLAND VS0,VS1,VS32
|
||||
XXLANDQ VS0,VS1,VS32
|
||||
XXLANDC VS0,VS1,VS32
|
||||
XXLEQV VS0,VS1,VS32
|
||||
XXLNAND VS0,VS1,VS32
|
||||
@@ -1100,7 +1076,6 @@ label1:
|
||||
XXLNOR VS0,VS1,VS32
|
||||
XXLORQ VS0,VS1,VS32
|
||||
XXLXOR VS0,VS1,VS32
|
||||
XXLOR VS0,VS1,VS32
|
||||
|
||||
// VSX select, XX4-form
|
||||
// <MNEMONIC> XA,XB,XC,XT produces
|
||||
@@ -1117,12 +1092,6 @@ label1:
|
||||
// <MNEMONIC> XB,UIM,XT produces
|
||||
// <mnemonic> XT,XB,UIM
|
||||
XXSPLTW VS0,$3,VS32
|
||||
XXSPLTIB $26,VS0
|
||||
|
||||
// VSX permute, XX3-form
|
||||
// <MNEMONIC> XA,XB,XT produces
|
||||
// <mnemonic> XT,XA,XB
|
||||
XXPERM VS0,VS1,VS32
|
||||
|
||||
// VSX permute, XX3-form
|
||||
// <MNEMONIC> XA,XB,DM,XT produces
|
||||
@@ -1134,14 +1103,6 @@ label1:
|
||||
// <mnemonic> XT,XA,XB,SHW
|
||||
XXSLDWI VS0,VS1,$3,VS32
|
||||
|
||||
// VSX byte-reverse XX2-form
|
||||
// <MNEMONIC> XB,XT produces
|
||||
// <mnemonic> XT,XB
|
||||
XXBRQ VS0,VS1
|
||||
XXBRD VS0,VS1
|
||||
XXBRW VS0,VS1
|
||||
XXBRH VS0,VS1
|
||||
|
||||
// VSX scalar FP-FP conversion, XX2-form
|
||||
// <MNEMONIC> XB,XT produces
|
||||
// <mnemonic> XT,XB
|
||||
|
||||
537
src/cmd/asm/internal/asm/testdata/ppc64enc.s
vendored
537
src/cmd/asm/internal/asm/testdata/ppc64enc.s
vendored
@@ -19,66 +19,8 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
||||
MOVD $-32767, R5 // 38a08001
|
||||
MOVD $-32768, R6 // 38c08000
|
||||
MOVD $1234567, R5 // 6405001260a5d687
|
||||
MOVW $1, R3 // 38600001
|
||||
MOVW $-1, R4 // 3880ffff
|
||||
MOVW $65535, R5 // 6005ffff
|
||||
MOVW $65536, R6 // 64060001
|
||||
MOVW $-32767, R5 // 38a08001
|
||||
MOVW $-32768, R6 // 38c08000
|
||||
MOVW $1234567, R5 // 6405001260a5d687
|
||||
MOVD 8(R3), R4 // e8830008
|
||||
MOVD (R3)(R4), R5 // 7ca4182a
|
||||
MOVW 4(R3), R4 // e8830006
|
||||
MOVW (R3)(R4), R5 // 7ca41aaa
|
||||
MOVWZ 4(R3), R4 // 80830004
|
||||
MOVWZ (R3)(R4), R5 // 7ca4182e
|
||||
MOVH 4(R3), R4 // a8830004
|
||||
MOVH (R3)(R4), R5 // 7ca41aae
|
||||
MOVHZ 2(R3), R4 // a0830002
|
||||
MOVHZ (R3)(R4), R5 // 7ca41a2e
|
||||
MOVB 1(R3), R4 // 888300017c840774
|
||||
MOVB (R3)(R4), R5 // 7ca418ae7ca50774
|
||||
MOVBZ 1(R3), R4 // 88830001
|
||||
MOVBZ (R3)(R4), R5 // 7ca418ae
|
||||
MOVDBR (R3)(R4), R5 // 7ca41c28
|
||||
MOVWBR (R3)(R4), R5 // 7ca41c2c
|
||||
MOVHBR (R3)(R4), R5 // 7ca41e2c
|
||||
|
||||
MOVDU 8(R3), R4 // e8830009
|
||||
MOVDU (R3)(R4), R5 // 7ca4186a
|
||||
MOVWU (R3)(R4), R5 // 7ca41aea
|
||||
MOVWZU 4(R3), R4 // 84830004
|
||||
MOVWZU (R3)(R4), R5 // 7ca4186e
|
||||
MOVHU 2(R3), R4 // ac830002
|
||||
MOVHU (R3)(R4), R5 // 7ca41aee
|
||||
MOVHZU 2(R3), R4 // a4830002
|
||||
MOVHZU (R3)(R4), R5 // 7ca41a6e
|
||||
MOVBU 1(R3), R4 // 8c8300017c840774
|
||||
MOVBU (R3)(R4), R5 // 7ca418ee7ca50774
|
||||
MOVBZU 1(R3), R4 // 8c830001
|
||||
MOVBZU (R3)(R4), R5 // 7ca418ee
|
||||
|
||||
MOVD R4, 8(R3) // f8830008
|
||||
MOVD R5, (R3)(R4) // 7ca4192a
|
||||
MOVW R4, 4(R3) // 90830004
|
||||
MOVW R5, (R3)(R4) // 7ca4192e
|
||||
MOVH R4, 2(R3) // b0830002
|
||||
MOVH R5, (R3)(R4) // 7ca41b2e
|
||||
MOVB R4, 1(R3) // 98830001
|
||||
MOVB R5, (R3)(R4) // 7ca419ae
|
||||
MOVDBR R5, (R3)(R4) // 7ca41d28
|
||||
MOVWBR R5, (R3)(R4) // 7ca41d2c
|
||||
MOVHBR R5, (R3)(R4) // 7ca41f2c
|
||||
|
||||
MOVDU R4, 8(R3) // f8830009
|
||||
MOVDU R5, (R3)(R4) // 7ca4196a
|
||||
MOVWU R4, 4(R3) // 94830004
|
||||
MOVWU R5, (R3)(R4) // 7ca4196e
|
||||
MOVHU R4, 2(R3) // b4830002
|
||||
MOVHU R5, (R3)(R4) // 7ca41b6e
|
||||
MOVBU R4, 1(R3) // 9c830001
|
||||
MOVBU R5, (R3)(R4) // 7ca419ee
|
||||
|
||||
// add constants
|
||||
ADD $1, R3 // 38630001
|
||||
ADD $1, R3, R4 // 38830001
|
||||
ADD $-1, R4 // 3884ffff
|
||||
@@ -93,9 +35,8 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
||||
ADD $-32768, R6, R5 // 38a68000
|
||||
ADD $1234567, R5 // 641f001263ffd6877cbf2a14
|
||||
ADD $1234567, R5, R6 // 641f001263ffd6877cdf2a14
|
||||
ADDIS $8, R3 // 3c630008
|
||||
ADDIS $1000, R3, R4 // 3c8303e8
|
||||
|
||||
// and constants
|
||||
ANDCC $1, R3 // 70630001
|
||||
ANDCC $1, R3, R4 // 70640001
|
||||
ANDCC $-1, R4 // 3be0ffff7fe42039
|
||||
@@ -110,9 +51,8 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
||||
ANDCC $-32768, R5, R6 // 3be080007fe62839
|
||||
ANDCC $1234567, R5 // 641f001263ffd6877fe52839
|
||||
ANDCC $1234567, R5, R6 // 641f001263ffd6877fe62839
|
||||
ANDISCC $1, R3 // 74630001
|
||||
ANDISCC $1000, R3, R4 // 746403e8
|
||||
|
||||
// or constants
|
||||
OR $1, R3 // 60630001
|
||||
OR $1, R3, R4 // 60640001
|
||||
OR $-1, R4 // 3be0ffff7fe42378
|
||||
@@ -128,6 +68,7 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
||||
OR $1234567, R5 // 641f001263ffd6877fe52b78
|
||||
OR $1234567, R5, R3 // 641f001263ffd6877fe32b78
|
||||
|
||||
// or constants
|
||||
XOR $1, R3 // 68630001
|
||||
XOR $1, R3, R4 // 68640001
|
||||
XOR $-1, R4 // 3be0ffff7fe42278
|
||||
@@ -143,177 +84,6 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
||||
XOR $1234567, R5 // 641f001263ffd6877fe52a78
|
||||
XOR $1234567, R5, R3 // 641f001263ffd6877fe32a78
|
||||
|
||||
// TODO: the order of CR operands don't match
|
||||
CMP R3, R4 // 7c232000
|
||||
CMPU R3, R4 // 7c232040
|
||||
CMPW R3, R4 // 7c032000
|
||||
CMPWU R3, R4 // 7c032040
|
||||
|
||||
// TODO: constants for ADDC?
|
||||
ADD R3, R4 // 7c841a14
|
||||
ADD R3, R4, R5 // 7ca41a14
|
||||
ADDC R3, R4 // 7c841814
|
||||
ADDC R3, R4, R5 // 7ca41814
|
||||
ADDE R3, R4 // 7c841914
|
||||
ADDECC R3, R4 // 7c841915
|
||||
ADDEV R3, R4 // 7c841d14
|
||||
ADDEVCC R3, R4 // 7c841d15
|
||||
ADDV R3, R4 // 7c841e14
|
||||
ADDVCC R3, R4 // 7c841e15
|
||||
ADDCCC R3, R4, R5 // 7ca41815
|
||||
ADDME R3, R4 // 7c8301d4
|
||||
ADDMECC R3, R4 // 7c8301d5
|
||||
ADDMEV R3, R4 // 7c8305d4
|
||||
ADDMEVCC R3, R4 // 7c8305d5
|
||||
ADDCV R3, R4 // 7c841c14
|
||||
ADDCVCC R3, R4 // 7c841c15
|
||||
ADDZE R3, R4 // 7c830194
|
||||
ADDZECC R3, R4 // 7c830195
|
||||
ADDZEV R3, R4 // 7c830594
|
||||
ADDZEVCC R3, R4 // 7c830595
|
||||
SUBME R3, R4 // 7c8301d0
|
||||
SUBMECC R3, R4 // 7c8301d1
|
||||
SUBMEV R3, R4 // 7c8305d0
|
||||
SUBZE R3, R4 // 7c830190
|
||||
SUBZECC R3, R4 // 7c830191
|
||||
SUBZEV R3, R4 // 7c830590
|
||||
SUBZEVCC R3, R4 // 7c830591
|
||||
|
||||
AND R3, R4 // 7c841838
|
||||
AND R3, R4, R5 // 7c851838
|
||||
ANDN R3, R4, R5 // 7c851878
|
||||
ANDCC R3, R4, R5 // 7c851839
|
||||
OR R3, R4 // 7c841b78
|
||||
OR R3, R4, R5 // 7c851b78
|
||||
ORN R3, R4, R5 // 7c851b38
|
||||
ORCC R3, R4, R5 // 7c851b79
|
||||
XOR R3, R4 // 7c841a78
|
||||
XOR R3, R4, R5 // 7c851a78
|
||||
XORCC R3, R4, R5 // 7c851a79
|
||||
NAND R3, R4, R5 // 7c851bb8
|
||||
NANDCC R3, R4, R5 // 7c851bb9
|
||||
EQV R3, R4, R5 // 7c851a38
|
||||
EQVCC R3, R4, R5 // 7c851a39
|
||||
NOR R3, R4, R5 // 7c8518f8
|
||||
NORCC R3, R4, R5 // 7c8518f9
|
||||
|
||||
SUB R3, R4 // 7c832050
|
||||
SUB R3, R4, R5 // 7ca32050
|
||||
SUBC R3, R4 // 7c832010
|
||||
SUBC R3, R4, R5 // 7ca32010
|
||||
|
||||
MULLW R3, R4 // 7c8419d6
|
||||
MULLW R3, R4, R5 // 7ca419d6
|
||||
MULLWCC R3, R4, R5 // 7ca419d7
|
||||
MULHW R3, R4, R5 // 7ca41896
|
||||
|
||||
MULHWU R3, R4, R5 // 7ca41816
|
||||
MULLD R3, R4 // 7c8419d2
|
||||
MULLD R4, R4, R5 // 7ca421d2
|
||||
MULLDCC R3, R4, R5 // 7ca419d3
|
||||
MULHD R3, R4, R5 // 7ca41892
|
||||
MULHDCC R3, R4, R5 // 7ca41893
|
||||
|
||||
MULLWV R3, R4 // 7c841dd6
|
||||
MULLWV R3, R4, R5 // 7ca41dd6
|
||||
MULLWVCC R3, R4, R5 // 7ca41dd7
|
||||
MULHWUCC R3, R4, R5 // 7ca41817
|
||||
MULLDV R3, R4, R5 // 7ca41dd2
|
||||
MULLDVCC R3, R4, R5 // 7ca41dd3
|
||||
|
||||
DIVD R3,R4 // 7c841bd2
|
||||
DIVD R3, R4, R5 // 7ca41bd2
|
||||
DIVDCC R3,R4, R5 // 7ca41bd3
|
||||
DIVDU R3, R4, R5 // 7ca41b92
|
||||
DIVDV R3, R4, R5 // 7ca41fd2
|
||||
DIVDUCC R3, R4, R5 // 7ca41b93
|
||||
DIVDVCC R3, R4, R5 // 7ca41fd3
|
||||
DIVDUV R3, R4, R5 // 7ca41f92
|
||||
DIVDUVCC R3, R4, R5 // 7ca41f93
|
||||
DIVDE R3, R4, R5 // 7ca41b52
|
||||
DIVDECC R3, R4, R5 // 7ca41b53
|
||||
DIVDEU R3, R4, R5 // 7ca41b12
|
||||
DIVDEUCC R3, R4, R5 // 7ca41b13
|
||||
|
||||
REM R3, R4, R5 // 7fe41bd67fff19d67cbf2050
|
||||
REMU R3, R4, R5 // 7fe41b967fff19d67bff00287cbf2050
|
||||
REMD R3, R4, R5 // 7fe41bd27fff19d27cbf2050
|
||||
REMDU R3, R4, R5 // 7fe41b927fff19d27cbf2050
|
||||
|
||||
MODUD R3, R4, R5 // 7ca41a12
|
||||
MODUW R3, R4, R5 // 7ca41a16
|
||||
MODSD R3, R4, R5 // 7ca41e12
|
||||
MODSW R3, R4, R5 // 7ca41e16
|
||||
|
||||
SLW $8, R3, R4 // 5464402e
|
||||
SLW R3, R4, R5 // 7c851830
|
||||
SLWCC R3, R4 // 7c841831
|
||||
SLD $16, R3, R4 // 786483e4
|
||||
SLD R3, R4, R5 // 7c851836
|
||||
SLDCC R3, R4 // 7c841837
|
||||
|
||||
SRW $8, R3, R4 // 5464c23e
|
||||
SRW R3, R4, R5 // 7c851c30
|
||||
SRWCC R3, R4 // 7c841c31
|
||||
SRAW $8, R3, R4 // 7c644670
|
||||
SRAW R3, R4, R5 // 7c851e30
|
||||
SRAWCC R3, R4 // 7c841e31
|
||||
SRD $16, R3, R4 // 78648402
|
||||
SRD R3, R4, R5 // 7c851c36
|
||||
SRDCC R3, R4 // 7c841c37
|
||||
SRAD $16, R3, R4 // 7c648674
|
||||
SRAD R3, R4, R5 // 7c851e34
|
||||
SRDCC R3, R4 // 7c841c37
|
||||
ROTLW $16, R3, R4 // 5464803e
|
||||
ROTLW R3, R4, R5 // 5c85183e
|
||||
RLWMI $7, R3, $65535, R6 // 50663c3e
|
||||
RLWMICC $7, R3, $65535, R6 // 50663c3f
|
||||
RLWNM $3, R4, $7, R6 // 54861f7e
|
||||
RLWNMCC $3, R4, $7, R6 // 54861f7f
|
||||
RLDMI $0, R4, $7, R6 // 7886076c
|
||||
RLDMICC $0, R4, $7, R6 // 7886076d
|
||||
RLDIMI $0, R4, $7, R6 // 788601cc
|
||||
RLDIMICC $0, R4, $7, R6 // 788601cd
|
||||
RLDC $0, R4, $15, R6 // 78860728
|
||||
RLDCCC $0, R4, $15, R6 // 78860729
|
||||
RLDCL $0, R4, $7, R6 // 78860770
|
||||
RLDCLCC $0, R4, $15, R6 // 78860721
|
||||
RLDCR $0, R4, $-16, R6 // 788606f2
|
||||
RLDCRCC $0, R4, $-16, R6 // 788606f3
|
||||
RLDICL $0, R4, $15, R6 // 788603c0
|
||||
RLDICLCC $0, R4, $15, R6 // 788603c1
|
||||
RLDICR $0, R4, $15, R6 // 788603c4
|
||||
RLDICRCC $0, R4, $15, R6 // 788603c5
|
||||
|
||||
BEQ 0(PC) // 41820000
|
||||
BGE 0(PC) // 40800000
|
||||
BGT 4(PC) // 41810030
|
||||
BLE 0(PC) // 40810000
|
||||
BLT 0(PC) // 41800000
|
||||
BNE 0(PC) // 40820000
|
||||
JMP 8(PC) // 48000020
|
||||
|
||||
CRAND CR1, CR2, CR3 // 4c620a02
|
||||
CRANDN CR1, CR2, CR3 // 4c620902
|
||||
CREQV CR1, CR2, CR3 // 4c620a42
|
||||
CRNAND CR1, CR2, CR3 // 4c6209c2
|
||||
CRNOR CR1, CR2, CR3 // 4c620842
|
||||
CROR CR1, CR2, CR3 // 4c620b82
|
||||
CRORN CR1, CR2, CR3 // 4c620b42
|
||||
CRXOR CR1, CR2, CR3 // 4c620982
|
||||
|
||||
ISEL $1, R3, R4, R5 // 7ca3205e
|
||||
ISEL $0, R3, R4, R5 // 7ca3201e
|
||||
ISEL $2, R3, R4, R5 // 7ca3209e
|
||||
ISEL $3, R3, R4, R5 // 7ca320de
|
||||
ISEL $4, R3, R4, R5 // 7ca3211e
|
||||
POPCNTB R3, R4 // 7c6400f4
|
||||
POPCNTW R3, R4 // 7c6402f4
|
||||
POPCNTD R3, R4 // 7c6403f4
|
||||
|
||||
PASTECC R3, R4 // 7c23270d
|
||||
COPY R3, R4 // 7c23260c
|
||||
|
||||
// load-and-reserve
|
||||
LBAR (R4)(R3*1),$1,R5 // 7ca32069
|
||||
LBAR (R4),$0,R5 // 7ca02068
|
||||
@@ -328,306 +98,7 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
||||
LDAR (R4),$0,R5 // 7ca020a8
|
||||
LDAR (R3),R5 // 7ca018a8
|
||||
|
||||
STBCCC R3, (R4)(R5) // 7c65256d
|
||||
STWCCC R3, (R4)(R5) // 7c65212d
|
||||
STDCCC R3, (R4)(R5) // 7c6521ad
|
||||
STHCCC R3, (R4)(R5)
|
||||
|
||||
SYNC // 7c0004ac
|
||||
ISYNC // 4c00012c
|
||||
LWSYNC // 7c2004ac
|
||||
|
||||
DCBF (R3)(R4) // 7c0418ac
|
||||
DCBI (R3)(R4) // 7c041bac
|
||||
DCBST (R3)(R4) // 7c04186c
|
||||
DCBZ (R3)(R4) // 7c041fec
|
||||
DCBT (R3)(R4) // 7c041a2c
|
||||
ICBI (R3)(R4) // 7c041fac
|
||||
|
||||
// float constants
|
||||
FMOVD $(0.0), F1 // f0210cd0
|
||||
FMOVD $(-0.0), F1 // f0210cd0fc200850
|
||||
|
||||
FMOVD 8(R3), F1 // c8230008
|
||||
FMOVD (R3)(R4), F1 // 7c241cae
|
||||
FMOVDU 8(R3), F1 // cc230008
|
||||
FMOVDU (R3)(R4), F1 // 7c241cee
|
||||
FMOVS 4(R3), F1 // c0230004
|
||||
FMOVS (R3)(R4), F1 // 7c241c2e
|
||||
FMOVSU 4(R3), F1 // c4230004
|
||||
FMOVSU (R3)(R4), F1 // 7c241c6e
|
||||
|
||||
FMOVD F1, 8(R3) // d8230008
|
||||
FMOVD F1, (R3)(R4) // 7c241dae
|
||||
FMOVDU F1, 8(R3) // dc230008
|
||||
FMOVDU F1, (R3)(R4) // 7c241dee
|
||||
FMOVS F1, 4(R3) // d0230004
|
||||
FMOVS F1, (R3)(R4) // 7c241d2e
|
||||
FMOVSU F1, 4(R3) // d4230004
|
||||
FMOVSU F1, (R3)(R4) // 7c241d6e
|
||||
FADD F1, F2 // fc42082a
|
||||
FADD F1, F2, F3 // fc62082a
|
||||
FADDCC F1, F2, F3 // fc62082b
|
||||
FADDS F1, F2 // ec42082a
|
||||
FADDS F1, F2, F3 // ec62082a
|
||||
FADDSCC F1, F2, F3 // ec62082b
|
||||
FSUB F1, F2 // fc420828
|
||||
FSUB F1, F2, F3 // fc620828
|
||||
FSUBCC F1, F2, F3 // fc620829
|
||||
FSUBS F1, F2 // ec420828
|
||||
FSUBS F1, F2, F3 // ec620828
|
||||
FSUBCC F1, F2, F3 // fc620829
|
||||
FMUL F1, F2 // fc420072
|
||||
FMUL F1, F2, F3 // fc620072
|
||||
FMULCC F1, F2, F3 // fc620073
|
||||
FMULS F1, F2 // ec420072
|
||||
FMULS F1, F2, F3 // ec620072
|
||||
FMULSCC F1, F2, F3 // ec620073
|
||||
FDIV F1, F2 // fc420824
|
||||
FDIV F1, F2, F3 // fc620824
|
||||
FDIVCC F1, F2, F3 // fc620825
|
||||
FDIVS F1, F2 // ec420824
|
||||
FDIVS F1, F2, F3 // ec620824
|
||||
FDIVSCC F1, F2, F3 // ec620825
|
||||
FMADD F1, F2, F3, F4 // fc8110fa
|
||||
FMADDCC F1, F2, F3, F4 // fc8110fb
|
||||
FMADDS F1, F2, F3, F4 // ec8110fa
|
||||
FMADDSCC F1, F2, F3, F4 // ec8110fb
|
||||
FMSUB F1, F2, F3, F4 // fc8110f8
|
||||
FMSUBCC F1, F2, F3, F4 // fc8110f9
|
||||
FMSUBS F1, F2, F3, F4 // ec8110f8
|
||||
FMSUBSCC F1, F2, F3, F4 // ec8110f9
|
||||
FNMADD F1, F2, F3, F4 // fc8110fe
|
||||
FNMADDCC F1, F2, F3, F4 // fc8110ff
|
||||
FNMADDS F1, F2, F3, F4 // ec8110fe
|
||||
FNMADDSCC F1, F2, F3, F4 // ec8110ff
|
||||
FNMSUB F1, F2, F3, F4 // fc8110fc
|
||||
FNMSUBCC F1, F2, F3, F4 // fc8110fd
|
||||
FNMSUBS F1, F2, F3, F4 // ec8110fc
|
||||
FNMSUBSCC F1, F2, F3, F4 // ec8110fd
|
||||
FSEL F1, F2, F3, F4 // fc8110ee
|
||||
FSELCC F1, F2, F3, F4 // fc8110ef
|
||||
FABS F1, F2 // fc400a10
|
||||
FABSCC F1, F2 // fc400a11
|
||||
FNEG F1, F2 // fc400850
|
||||
FABSCC F1, F2 // fc400a11
|
||||
FRSP F1, F2 // fc400818
|
||||
FRSPCC F1, F2 // fc400819
|
||||
FCTIW F1, F2 // fc40081c
|
||||
FCTIWCC F1, F2 // fc40081d
|
||||
FCTIWZ F1, F2 // fc40081e
|
||||
FCTIWZCC F1, F2 // fc40081f
|
||||
FCTID F1, F2 // fc400e5c
|
||||
FCTIDCC F1, F2 // fc400e5d
|
||||
FCTIDZ F1, F2 // fc400e5e
|
||||
FCTIDZCC F1, F2 // fc400e5f
|
||||
FCFID F1, F2 // fc400e9c
|
||||
FCFIDCC F1, F2 // fc400e9d
|
||||
FCFIDU F1, F2 // fc400f9c
|
||||
FCFIDUCC F1, F2 // fc400f9d
|
||||
FCFIDS F1, F2 // ec400e9c
|
||||
FCFIDSCC F1, F2 // ec400e9d
|
||||
FRES F1, F2 // ec400830
|
||||
FRESCC F1, F2 // ec400831
|
||||
FRIM F1, F2 // fc400bd0
|
||||
FRIMCC F1, F2 // fc400bd1
|
||||
FRIP F1, F2 // fc400b90
|
||||
FRIPCC F1, F2 // fc400b91
|
||||
FRIZ F1, F2 // fc400b50
|
||||
FRIZCC F1, F2 // fc400b51
|
||||
FRIN F1, F2 // fc400b10
|
||||
FRINCC F1, F2 // fc400b11
|
||||
FRSQRTE F1, F2 // fc400834
|
||||
FRSQRTECC F1, F2 // fc400835
|
||||
FSQRT F1, F2 // fc40082c
|
||||
FSQRTCC F1, F2 // fc40082d
|
||||
FSQRTS F1, F2 // ec40082c
|
||||
FSQRTSCC F1, F2 // ec40082d
|
||||
FCPSGN F1, F2 // fc420810
|
||||
FCPSGNCC F1, F2 // fc420811
|
||||
FCMPO F1, F2 // fc011040
|
||||
FCMPU F1, F2 // fc011000
|
||||
LVX (R3)(R4), V1 // 7c2418ce
|
||||
LVXL (R3)(R4), V1 // 7c241ace
|
||||
LVSL (R3)(R4), V1 // 7c24180c
|
||||
LVSR (R3)(R4), V1 // 7c24184c
|
||||
LVEBX (R3)(R4), V1 // 7c24180e
|
||||
LVEHX (R3)(R4), V1 // 7c24184e
|
||||
LVEWX (R3)(R4), V1 // 7c24188e
|
||||
STVX V1, (R3)(R4) // 7c2419ce
|
||||
STVXL V1, (R3)(R4) // 7c241bce
|
||||
STVEBX V1, (R3)(R4) // 7c24190e
|
||||
STVEHX V1, (R3)(R4) // 7c24194e
|
||||
STVEWX V1, (R3)(R4) // 7c24198e
|
||||
|
||||
VAND V1, V2, V3 // 10611404
|
||||
VANDC V1, V2, V3 // 10611444
|
||||
VNAND V1, V2, V3 // 10611584
|
||||
VOR V1, V2, V3 // 10611484
|
||||
VORC V1, V2, V3 // 10611544
|
||||
VXOR V1, V2, V3 // 106114c4
|
||||
VNOR V1, V2, V3 // 10611504
|
||||
VEQV V1, V2, V3 // 10611684
|
||||
VADDUBM V1, V2, V3 // 10611000
|
||||
VADDUHM V1, V2, V3 // 10611040
|
||||
VADDUWM V1, V2, V3 // 10611080
|
||||
VADDUDM V1, V2, V3 // 106110c0
|
||||
VADDUQM V1, V2, V3 // 10611100
|
||||
VADDCUQ V1, V2, V3 // 10611140
|
||||
VADDCUW V1, V2, V3 // 10611180
|
||||
VADDUBS V1, V2, V3 // 10611200
|
||||
VADDUHS V1, V2, V3 // 10611240
|
||||
VADDUWS V1, V2, V3 // 10611280
|
||||
VSUBUBM V1, V2, V3 // 10611400
|
||||
VSUBUHM V1, V2, V3 // 10611440
|
||||
VSUBUWM V1, V2, V3 // 10611480
|
||||
VSUBUDM V1, V2, V3 // 106114c0
|
||||
VSUBUQM V1, V2, V3 // 10611500
|
||||
VSUBCUQ V1, V2, V3 // 10611540
|
||||
VSUBCUW V1, V2, V3 // 10611580
|
||||
VSUBUBS V1, V2, V3 // 10611600
|
||||
VSUBUHS V1, V2, V3 // 10611640
|
||||
VSUBUWS V1, V2, V3 // 10611680
|
||||
VSUBSBS V1, V2, V3 // 10611700
|
||||
VSUBSHS V1, V2, V3 // 10611740
|
||||
VSUBSWS V1, V2, V3 // 10611780
|
||||
VSUBEUQM V1, V2, V3, V4 // 108110fe
|
||||
VSUBECUQ V1, V2, V3, V4 // 108110ff
|
||||
VMULESB V1, V2, V3 // 10611308
|
||||
VMULOSB V1, V2, V3 // 10611108
|
||||
VMULEUB V1, V2, V3 // 10611208
|
||||
VMULOUB V1, V2, V3 // 10611008
|
||||
VMULESH V1, V2, V3 // 10611348
|
||||
VMULOSH V1, V2, V3 // 10611148
|
||||
VMULEUH V1, V2, V3 // 10611248
|
||||
VMULOUH V1, V2, V3 // 10611048
|
||||
VMULESH V1, V2, V3 // 10611348
|
||||
VMULOSW V1, V2, V3 // 10611188
|
||||
VMULEUW V1, V2, V3 // 10611288
|
||||
VMULOUW V1, V2, V3 // 10611088
|
||||
VMULUWM V1, V2, V3 // 10611089
|
||||
VPMSUMB V1, V2, V3 // 10611408
|
||||
VPMSUMH V1, V2, V3 // 10611448
|
||||
VPMSUMW V1, V2, V3 // 10611488
|
||||
VPMSUMD V1, V2, V3 // 106114c8
|
||||
VMSUMUDM V1, V2, V3, V4 // 108110e3
|
||||
VRLB V1, V2, V3 // 10611004
|
||||
VRLH V1, V2, V3 // 10611044
|
||||
VRLW V1, V2, V3 // 10611084
|
||||
VRLD V1, V2, V3 // 106110c4
|
||||
VSLB V1, V2, V3 // 10611104
|
||||
VSLH V1, V2, V3 // 10611144
|
||||
VSLW V1, V2, V3 // 10611184
|
||||
VSL V1, V2, V3 // 106111c4
|
||||
VSLO V1, V2, V3 // 1061140c
|
||||
VSRB V1, V2, V3 // 10611204
|
||||
VSRH V1, V2, V3 // 10611244
|
||||
VSRW V1, V2, V3 // 10611284
|
||||
VSR V1, V2, V3 // 106112c4
|
||||
VSRO V1, V2, V3 // 1061144c
|
||||
VSLD V1, V2, V3 // 106115c4
|
||||
VSRAB V1, V2, V3 // 10611304
|
||||
VSRAH V1, V2, V3 // 10611344
|
||||
VSRAW V1, V2, V3 // 10611384
|
||||
VSRAD V1, V2, V3 // 106113c4
|
||||
VSLDOI $3, V1, V2, V3 // 106110ec
|
||||
VCLZB V1, V2 // 10400f02
|
||||
VCLZH V1, V2 // 10400f42
|
||||
VCLZW V1, V2 // 10400f82
|
||||
VCLZD V1, V2 // 10400fc2
|
||||
VPOPCNTB V1, V2 // 10400f03
|
||||
VPOPCNTH V1, V2 // 10400f43
|
||||
VPOPCNTW V1, V2 // 10400f83
|
||||
VPOPCNTD V1, V2 // 10400fc3
|
||||
VCMPEQUB V1, V2, V3 // 10611006
|
||||
VCMPEQUBCC V1, V2, V3 // 10611406
|
||||
VCMPEQUH V1, V2, V3 // 10611046
|
||||
VCMPEQUHCC V1, V2, V3 // 10611446
|
||||
VCMPEQUW V1, V2, V3 // 10611086
|
||||
VCMPEQUWCC V1, V2, V3 // 10611486
|
||||
VCMPEQUD V1, V2, V3 // 106110c7
|
||||
VCMPEQUDCC V1, V2, V3 // 106114c7
|
||||
VCMPGTUB V1, V2, V3 // 10611206
|
||||
VCMPGTUBCC V1, V2, V3 // 10611606
|
||||
VCMPGTUH V1, V2, V3 // 10611246
|
||||
VCMPGTUHCC V1, V2, V3 // 10611646
|
||||
VCMPGTUW V1, V2, V3 // 10611286
|
||||
VCMPGTUWCC V1, V2, V3 // 10611686
|
||||
VCMPGTUD V1, V2, V3 // 106112c7
|
||||
VCMPGTUDCC V1, V2, V3 // 106116c7
|
||||
VCMPGTSB V1, V2, V3 // 10611306
|
||||
VCMPGTSBCC V1, V2, V3 // 10611706
|
||||
VCMPGTSH V1, V2, V3 // 10611346
|
||||
VCMPGTSHCC V1, V2, V3 // 10611746
|
||||
VCMPGTSW V1, V2, V3 // 10611386
|
||||
VCMPGTSWCC V1, V2, V3 // 10611786
|
||||
VCMPGTSD V1, V2, V3 // 106113c7
|
||||
VCMPGTSDCC V1, V2, V3 // 106117c7
|
||||
VCMPNEZB V1, V2, V3 // 10611107
|
||||
VCMPNEZBCC V1, V2, V3 // 10611507
|
||||
VCMPNEB V1, V2, V3 // 10611007
|
||||
VCMPNEBCC V1, V2, V3 // 10611407
|
||||
VCMPNEH V1, V2, V3 // 10611047
|
||||
VCMPNEHCC V1, V2, V3 // 10611447
|
||||
VCMPNEW V1, V2, V3 // 10611087
|
||||
VCMPNEWCC V1, V2, V3 // 10611487
|
||||
VPERM V1, V2, V3, V4 // 108110eb
|
||||
VPERMR V1, V2, V3, V4 // 108110fb
|
||||
VPERMXOR V1, V2, V3, V4 // 108110ed
|
||||
VBPERMQ V1, V2, V3 // 1061154c
|
||||
VBPERMD V1, V2, V3 // 106115cc
|
||||
VSEL V1, V2, V3, V4 // 108110ea
|
||||
VSPLTB $1, V1, V2 // 10410a0c
|
||||
VSPLTH $1, V1, V2 // 10410a4c
|
||||
VSPLTW $1, V1, V2 // 10410a8c
|
||||
VSPLTISB $1, V1 // 1021030c
|
||||
VSPLTISW $1, V1 // 1021038c
|
||||
VSPLTISH $1, V1 // 1021034c
|
||||
VCIPHER V1, V2, V3 // 10611508
|
||||
VCIPHERLAST V1, V2, V3 // 10611509
|
||||
VNCIPHER V1, V2, V3 // 10611548
|
||||
VNCIPHERLAST V1, V2, V3 // 10611549
|
||||
VSBOX V1, V2 // 104105c8
|
||||
VSHASIGMAW $1, V1, $15, V2 // 10418e82
|
||||
VSHASIGMAD $2, V1, $15, V2 // 104196c2
|
||||
|
||||
LXVD2X (R3)(R4), VS1 // 7c241e98
|
||||
LXV 16(R3), VS1 // f4230011
|
||||
LXVL R3, R4, VS1 // 7c23221a
|
||||
LXVLL R3, R4, VS1 // 7c23225a
|
||||
LXVX R3, R4, VS1 // 7c232218
|
||||
LXSDX (R3)(R4), VS1 // 7c241c98
|
||||
STXVD2X VS1, (R3)(R4) // 7c241f98
|
||||
STXV VS1,16(R3) // f4230015
|
||||
STXVL VS1, R3, R4 // 7c23231a
|
||||
STXVLL VS1, R3, R4 // 7c23235a
|
||||
STXVX VS1, R3, R4 // 7c232318
|
||||
STXSDX VS1, (R3)(R4) // 7c241d98
|
||||
LXSIWAX (R3)(R4), VS1 // 7c241898
|
||||
STXSIWX VS1, (R3)(R4) // 7c241918
|
||||
MFVSRD VS1, R3 // 7c230066
|
||||
MTVSRD R3, VS1 // 7c230166
|
||||
XXLAND VS1, VS2, VS3 // f0611410
|
||||
XXLOR VS1, VS2, VS3 // f0611490
|
||||
XXLORC VS1, VS2, VS3 // f0611550
|
||||
XXLXOR VS1, VS2, VS3 // f06114d0
|
||||
XXSEL VS1, VS2, VS3, VS4 // f08110f0
|
||||
XXMRGHW VS1, VS2, VS3 // f0611090
|
||||
XXSPLTW VS1, $1, VS2 // f0410a90
|
||||
XXPERM VS1, VS2, VS3 // f06110d0
|
||||
XXSLDWI VS1, VS2, $1, VS3 // f0611110
|
||||
XSCVDPSP VS1, VS2 // f0400c24
|
||||
XVCVDPSP VS1, VS2 // f0400e24
|
||||
XSCVSXDDP VS1, VS2 // f0400de0
|
||||
XVCVDPSXDS VS1, VS2 // f0400f60
|
||||
XVCVSXDDP VS1, VS2 // f0400fe0
|
||||
|
||||
MOVD R3, LR // 7c6803a6
|
||||
MOVD R3, CTR // 7c6903a6
|
||||
MOVD R3, XER // 7c6103a6
|
||||
MOVD LR, R3 // 7c6802a6
|
||||
MOVD CTR, R3 // 7c6902a6
|
||||
MOVD XER, R3 // 7c6102a6
|
||||
MOVFL CR3, CR1 // 4c8c0000
|
||||
|
||||
RET
|
||||
|
||||
74
src/cmd/asm/internal/asm/testdata/riscvenc.s
vendored
74
src/cmd/asm/internal/asm/testdata/riscvenc.s
vendored
@@ -122,9 +122,6 @@ start:
|
||||
SB X5, (X6) // 23005300
|
||||
SB X5, 4(X6) // 23025300
|
||||
|
||||
// 2.7: Memory Ordering Instructions
|
||||
FENCE // 0f00f00f
|
||||
|
||||
// 5.2: Integer Computational Instructions (RV64I)
|
||||
ADDIW $1, X5, X6 // 1b831200
|
||||
SLLIW $1, X5, X6 // 1b931200
|
||||
@@ -157,32 +154,6 @@ start:
|
||||
REMW X5, X6, X7 // bb635302
|
||||
REMUW X5, X6, X7 // bb735302
|
||||
|
||||
// 8.2: Load-Reserved/Store-Conditional
|
||||
LRW (X5), X6 // 2fa30214
|
||||
LRD (X5), X6 // 2fb30214
|
||||
SCW X5, (X6), X7 // af23531c
|
||||
SCD X5, (X6), X7 // af33531c
|
||||
|
||||
// 8.3: Atomic Memory Operations
|
||||
AMOSWAPW X5, (X6), X7 // af23530c
|
||||
AMOSWAPD X5, (X6), X7 // af33530c
|
||||
AMOADDW X5, (X6), X7 // af235304
|
||||
AMOADDD X5, (X6), X7 // af335304
|
||||
AMOANDW X5, (X6), X7 // af235364
|
||||
AMOANDD X5, (X6), X7 // af335364
|
||||
AMOORW X5, (X6), X7 // af235344
|
||||
AMOORD X5, (X6), X7 // af335344
|
||||
AMOXORW X5, (X6), X7 // af235324
|
||||
AMOXORD X5, (X6), X7 // af335324
|
||||
AMOMAXW X5, (X6), X7 // af2353a4
|
||||
AMOMAXD X5, (X6), X7 // af3353a4
|
||||
AMOMAXUW X5, (X6), X7 // af2353e4
|
||||
AMOMAXUD X5, (X6), X7 // af3353e4
|
||||
AMOMINW X5, (X6), X7 // af235384
|
||||
AMOMIND X5, (X6), X7 // af335384
|
||||
AMOMINUW X5, (X6), X7 // af2353c4
|
||||
AMOMINUD X5, (X6), X7 // af3353c4
|
||||
|
||||
// 10.1: Base Counters and Timers
|
||||
RDCYCLE X5 // f32200c0
|
||||
RDTIME X5 // f32210c0
|
||||
@@ -225,9 +196,6 @@ start:
|
||||
FLTS F0, F1, X7 // d39300a0
|
||||
FLES F0, F1, X7 // d38300a0
|
||||
|
||||
// 11.9: Single-Precision Floating-Point Classify Instruction
|
||||
FCLASSS F0, X5 // d31200e0
|
||||
|
||||
// 12.3: Double-Precision Load and Store Instructions
|
||||
FLD (X5), F0 // 07b00200
|
||||
FLD 4(X5), F0 // 07b04200
|
||||
@@ -260,9 +228,6 @@ start:
|
||||
FMVXD F0, X5 // d30200e2
|
||||
FMVDX X5, F0 // 538002f2
|
||||
|
||||
// 12.6: Double-Precision Floating-Point Classify Instruction
|
||||
FCLASSD F0, X5 // d31200e2
|
||||
|
||||
// Privileged ISA
|
||||
|
||||
// 3.2.1: Environment Call and Breakpoint
|
||||
@@ -305,20 +270,10 @@ start:
|
||||
MOVD F0, 4(X5) // 27b20200
|
||||
MOVD F0, F1 // d3000022
|
||||
|
||||
// NOT pseudo-instruction
|
||||
NOT X5 // 93c2f2ff
|
||||
NOT X5, X6 // 13c3f2ff
|
||||
|
||||
// NEG/NEGW pseudo-instructions
|
||||
NEG X5 // b3025040
|
||||
NEG X5, X6 // 33035040
|
||||
NEGW X5 // bb025040
|
||||
NEGW X5, X6 // 3b035040
|
||||
|
||||
// These jumps can get printed as jumps to 2 because they go to the
|
||||
// second instruction in the function (the first instruction is an
|
||||
// invisible stack pointer adjustment).
|
||||
JMP start // JMP 2 // 6ff01fc5
|
||||
JMP start // JMP 2 // 6ff0dfcc
|
||||
JMP (X5) // 67800200
|
||||
JMP 4(X5) // 67804200
|
||||
|
||||
@@ -330,29 +285,24 @@ start:
|
||||
CALL asmtest(SB) // 970f0000
|
||||
JMP asmtest(SB) // 970f0000
|
||||
|
||||
// Branch pseudo-instructions
|
||||
BEQZ X5, start // BEQZ X5, 2 // e38a02c2
|
||||
BGEZ X5, start // BGEZ X5, 2 // e3d802c2
|
||||
BGT X5, X6, start // BGT X5, X6, 2 // e3c662c2
|
||||
BGTU X5, X6, start // BGTU X5, X6, 2 // e3e462c2
|
||||
BGTZ X5, start // BGTZ X5, 2 // e34250c2
|
||||
BLE X5, X6, start // BLE X5, X6, 2 // e3d062c2
|
||||
BLEU X5, X6, start // BLEU X5, X6, 2 // e3fe62c0
|
||||
BLEZ X5, start // BLEZ X5, 2 // e35c50c0
|
||||
BLTZ X5, start // BLTZ X5, 2 // e3ca02c0
|
||||
BNEZ X5, start // BNEZ X5, 2 // e39802c0
|
||||
|
||||
// Set pseudo-instructions
|
||||
SEQZ X15, X15 // 93b71700
|
||||
SNEZ X15, X15 // b337f000
|
||||
|
||||
// F extension
|
||||
FNEGS F0, F1 // d3100020
|
||||
FNES F0, F1, X7 // d3a300a093c31300
|
||||
|
||||
// TODO(jsing): FNES gets encoded as FEQS+XORI - this should
|
||||
// be handled as a single *obj.Prog so that the full two
|
||||
// instruction encoding is tested here.
|
||||
FNES F0, F1, X7 // d3a300a0
|
||||
|
||||
// D extension
|
||||
FNEGD F0, F1 // d3100022
|
||||
FNED F0, F1, X5 // d3a200a293c21200
|
||||
FEQD F0, F1, X5 // d3a200a2
|
||||
FLTD F0, F1, X5 // d39200a2
|
||||
FLED F0, F1, X5 // d38200a2
|
||||
FEQD F0, F1, X5 // d3a200a2
|
||||
|
||||
// TODO(jsing): FNED gets encoded as FEQD+XORI - this should
|
||||
// be handled as a single *obj.Prog so that the full two
|
||||
// instruction encoding is tested here.
|
||||
FNED F0, F1, X5 // d3a200a2
|
||||
|
||||
5
src/cmd/asm/internal/asm/testdata/s390x.s
vendored
5
src/cmd/asm/internal/asm/testdata/s390x.s
vendored
@@ -89,7 +89,6 @@ TEXT main·foo(SB),DUPOK|NOSPLIT,$16-0 // TEXT main.foo(SB), DUPOK|NOSPLIT, $16-
|
||||
ADDW R1, R2, R3 // b9f81032
|
||||
ADDW $8192, R1 // a71a2000
|
||||
ADDW $8192, R1, R2 // ec21200000d8
|
||||
ADDE R1, R2 // b9880021
|
||||
SUB R3, R4 // b9090043
|
||||
SUB R3, R4, R5 // b9e93054
|
||||
SUB $8192, R3 // a73be000
|
||||
@@ -184,9 +183,6 @@ TEXT main·foo(SB),DUPOK|NOSPLIT,$16-0 // TEXT main.foo(SB), DUPOK|NOSPLIT, $16-
|
||||
ADDW 4095(R7), R8 // 5a807fff
|
||||
ADDW -1(R1), R2 // e3201fffff5a
|
||||
ADDW 4096(R3), R4 // e3403000015a
|
||||
ADDE 4096(R3), R4 // e34030000188
|
||||
ADDE 4096(R3)(R2*1), R4 // e34230000188
|
||||
ADDE 524288(R3)(R4*1), R5 // c0a10008000041aa4000e35a30000088
|
||||
MULLD (R1)(R2*1), R3 // e3321000000c
|
||||
MULLW (R3)(R4*1), R5 // 71543000
|
||||
MULLW 4096(R3), R4 // e34030000151
|
||||
@@ -263,7 +259,6 @@ TEXT main·foo(SB),DUPOK|NOSPLIT,$16-0 // TEXT main.foo(SB), DUPOK|NOSPLIT, $16-
|
||||
NC $8, (R15), n-8(SP) // d407f010f000
|
||||
OC $8, (R15), n-8(SP) // d607f010f000
|
||||
MVC $8, (R15), n-8(SP) // d207f010f000
|
||||
MVCIN $8, (R15), n-8(SP) // e807f010f000
|
||||
CLC $8, (R15), n-8(SP) // d507f000f010
|
||||
XC $256, -8(R15), -8(R15) // b90400afc2a8fffffff8d7ffa000a000
|
||||
MVC $256, 8192(R1), 8192(R2) // b90400a2c2a800002000b90400b1c2b800002000d2ffa000b000
|
||||
|
||||
@@ -23,8 +23,7 @@ var (
|
||||
Dynlink = flag.Bool("dynlink", false, "support references to Go symbols defined in other shared libraries")
|
||||
AllErrors = flag.Bool("e", false, "no limit on number of errors reported")
|
||||
SymABIs = flag.Bool("gensymabis", false, "write symbol ABI information to output file, don't assemble")
|
||||
Importpath = flag.String("p", "", "set expected package import to path")
|
||||
Spectre = flag.String("spectre", "", "enable spectre mitigations in `list` (all, ret)")
|
||||
Newobj = flag.Bool("newobj", false, "use new object file format")
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -40,21 +40,7 @@ func main() {
|
||||
}
|
||||
ctxt.Flag_dynlink = *flags.Dynlink
|
||||
ctxt.Flag_shared = *flags.Shared || *flags.Dynlink
|
||||
ctxt.IsAsm = true
|
||||
ctxt.Pkgpath = *flags.Importpath
|
||||
switch *flags.Spectre {
|
||||
default:
|
||||
log.Printf("unknown setting -spectre=%s", *flags.Spectre)
|
||||
os.Exit(2)
|
||||
case "":
|
||||
// nothing
|
||||
case "index":
|
||||
// known to compiler; ignore here so people can use
|
||||
// the same list with -gcflags=-spectre=LIST and -asmflags=-spectrre=LIST
|
||||
case "all", "ret":
|
||||
ctxt.Retpoline = true
|
||||
}
|
||||
|
||||
ctxt.Flag_newobj = *flags.Newobj
|
||||
ctxt.Bso = bufio.NewWriter(os.Stdout)
|
||||
defer ctxt.Bso.Flush()
|
||||
|
||||
@@ -88,7 +74,7 @@ func main() {
|
||||
pList.Firstpc, ok = parser.Parse()
|
||||
// reports errors to parser.Errorf
|
||||
if ok {
|
||||
obj.Flushplist(ctxt, pList, nil, *flags.Importpath)
|
||||
obj.Flushplist(ctxt, pList, nil, "")
|
||||
}
|
||||
}
|
||||
if !ok {
|
||||
@@ -97,8 +83,8 @@ func main() {
|
||||
}
|
||||
}
|
||||
if ok && !*flags.SymABIs {
|
||||
ctxt.NumberSyms()
|
||||
obj.WriteObjFile(ctxt, buf)
|
||||
ctxt.NumberSyms(true)
|
||||
obj.WriteObjFile(ctxt, buf, "")
|
||||
}
|
||||
if !ok || diag {
|
||||
if failedFile != "" {
|
||||
|
||||
@@ -112,13 +112,6 @@ The default C and C++ compilers may be changed by the CC and CXX
|
||||
environment variables, respectively; those environment variables
|
||||
may include command line options.
|
||||
|
||||
The cgo tool will always invoke the C compiler with the source file's
|
||||
directory in the include path; i.e. -I${SRCDIR} is always implied. This
|
||||
means that if a header file foo/bar.h exists both in the source
|
||||
directory and also in the system include directory (or some other place
|
||||
specified by a -I flag), then "#include <foo/bar.h>" will always find the
|
||||
local version in preference to any other version.
|
||||
|
||||
The cgo tool is enabled by default for native builds on systems where
|
||||
it is expected to work. It is disabled by default when
|
||||
cross-compiling. You can control this by setting the CGO_ENABLED
|
||||
@@ -420,7 +413,7 @@ type in Go are instead represented by a uintptr. Those include:
|
||||
jobjectArray
|
||||
jweak
|
||||
|
||||
3. The EGLDisplay and EGLConfig types from the EGL API.
|
||||
3. The EGLDisplay type from the EGL API.
|
||||
|
||||
These types are uintptr on the Go side because they would otherwise
|
||||
confuse the Go garbage collector; they are sometimes not really
|
||||
@@ -436,16 +429,11 @@ from Go 1.9 and earlier, use the cftype or jni rewrites in the Go fix tool:
|
||||
|
||||
It will replace nil with 0 in the appropriate places.
|
||||
|
||||
The EGLDisplay case was introduced in Go 1.12. Use the egl rewrite
|
||||
The EGLDisplay case were introduced in Go 1.12. Use the egl rewrite
|
||||
to auto-update code from Go 1.11 and earlier:
|
||||
|
||||
go tool fix -r egl <pkg>
|
||||
|
||||
The EGLConfig case was introduced in Go 1.15. Use the eglconf rewrite
|
||||
to auto-update code from Go 1.14 and earlier:
|
||||
|
||||
go tool fix -r eglconf <pkg>
|
||||
|
||||
Using cgo directly
|
||||
|
||||
Usage:
|
||||
@@ -997,7 +985,7 @@ produces a file named a.out, even if cmd/link does so by invoking the host
|
||||
linker in external linking mode.
|
||||
|
||||
By default, cmd/link will decide the linking mode as follows: if the only
|
||||
packages using cgo are those on a list of known standard library
|
||||
packages using cgo are those on a whitelist of standard library
|
||||
packages (net, os/user, runtime/cgo), cmd/link will use internal linking
|
||||
mode. Otherwise, there are non-standard cgo packages involved, and cmd/link
|
||||
will use external linking mode. The first rule means that a build of
|
||||
|
||||
@@ -182,9 +182,6 @@ func (p *Package) Translate(f *File) {
|
||||
numTypedefs = len(p.typedefs)
|
||||
// Also ask about any typedefs we've seen so far.
|
||||
for _, info := range p.typedefList {
|
||||
if f.Name[info.typedef] != nil {
|
||||
continue
|
||||
}
|
||||
n := &Name{
|
||||
Go: info.typedef,
|
||||
C: info.typedef,
|
||||
@@ -336,7 +333,7 @@ func (p *Package) guessKinds(f *File) []*Name {
|
||||
// void __cgo_f_xxx_5(void) { static const char __cgo_undefined__5[] = (name); }
|
||||
//
|
||||
// If we see an error at not-declared:xxx, the corresponding name is not declared.
|
||||
// If we see an error at not-type:xxx, the corresponding name is not a type.
|
||||
// If we see an error at not-type:xxx, the corresponding name is a type.
|
||||
// If we see an error at not-int-const:xxx, the corresponding name is not an integer constant.
|
||||
// If we see an error at not-num-const:xxx, the corresponding name is not a number constant.
|
||||
// If we see an error at not-str-lit:xxx, the corresponding name is not a string literal.
|
||||
@@ -369,18 +366,7 @@ func (p *Package) guessKinds(f *File) []*Name {
|
||||
fmt.Fprintf(&b, "#line 1 \"completed\"\n"+
|
||||
"int __cgo__1 = __cgo__2;\n")
|
||||
|
||||
// We need to parse the output from this gcc command, so ensure that it
|
||||
// doesn't have any ANSI escape sequences in it. (TERM=dumb is
|
||||
// insufficient; if the user specifies CGO_CFLAGS=-fdiagnostics-color,
|
||||
// GCC will ignore TERM, and GCC can also be configured at compile-time
|
||||
// to ignore TERM.)
|
||||
stderr := p.gccErrors(b.Bytes(), "-fdiagnostics-color=never")
|
||||
if strings.Contains(stderr, "unrecognized command line option") {
|
||||
// We're using an old version of GCC that doesn't understand
|
||||
// -fdiagnostics-color. Those versions can't print color anyway,
|
||||
// so just rerun without that option.
|
||||
stderr = p.gccErrors(b.Bytes())
|
||||
}
|
||||
stderr := p.gccErrors(b.Bytes())
|
||||
if stderr == "" {
|
||||
fatalf("%s produced no output\non input:\n%s", p.gccBaseCmd()[0], b.Bytes())
|
||||
}
|
||||
@@ -724,9 +710,6 @@ func (p *Package) prepareNames(f *File) {
|
||||
}
|
||||
}
|
||||
p.mangleName(n)
|
||||
if n.Kind == "type" && typedef[n.Mangle] == nil {
|
||||
typedef[n.Mangle] = n.Type
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1365,9 +1348,6 @@ func (p *Package) rewriteRef(f *File) {
|
||||
|
||||
if *godefs {
|
||||
// Substitute definition for mangled type name.
|
||||
if r.Name.Type != nil && r.Name.Kind == "type" {
|
||||
expr = r.Name.Type.Go
|
||||
}
|
||||
if id, ok := expr.(*ast.Ident); ok {
|
||||
if t := typedef[id.Name]; t != nil {
|
||||
expr = t.Go
|
||||
@@ -1433,7 +1413,9 @@ func (p *Package) rewriteName(f *File, r *Ref) ast.Expr {
|
||||
r.Context = ctxType
|
||||
if r.Name.Type == nil {
|
||||
error_(r.Pos(), "invalid conversion to C.%s: undefined C type '%s'", fixGo(r.Name.Go), r.Name.C)
|
||||
break
|
||||
}
|
||||
expr = r.Name.Type.Go
|
||||
break
|
||||
}
|
||||
error_(r.Pos(), "call of non-function C.%s", fixGo(r.Name.Go))
|
||||
@@ -1490,7 +1472,9 @@ func (p *Package) rewriteName(f *File, r *Ref) ast.Expr {
|
||||
// Okay - might be new(T)
|
||||
if r.Name.Type == nil {
|
||||
error_(r.Pos(), "expression C.%s: undefined C type '%s'", fixGo(r.Name.Go), r.Name.C)
|
||||
break
|
||||
}
|
||||
expr = r.Name.Type.Go
|
||||
case "var":
|
||||
expr = &ast.StarExpr{Star: (*r.Expr).Pos(), X: expr}
|
||||
case "macro":
|
||||
@@ -1509,6 +1493,8 @@ func (p *Package) rewriteName(f *File, r *Ref) ast.Expr {
|
||||
// Use of C.enum_x, C.struct_x or C.union_x without C definition.
|
||||
// GCC won't raise an error when using pointers to such unknown types.
|
||||
error_(r.Pos(), "type C.%s: undefined C type '%s'", fixGo(r.Name.Go), r.Name.C)
|
||||
} else {
|
||||
expr = r.Name.Type.Go
|
||||
}
|
||||
default:
|
||||
if r.Name.Kind == "func" {
|
||||
@@ -1981,25 +1967,22 @@ func (p *Package) gccDefines(stdin []byte) string {
|
||||
// gccErrors runs gcc over the C program stdin and returns
|
||||
// the errors that gcc prints. That is, this function expects
|
||||
// gcc to fail.
|
||||
func (p *Package) gccErrors(stdin []byte, extraArgs ...string) string {
|
||||
func (p *Package) gccErrors(stdin []byte) string {
|
||||
// TODO(rsc): require failure
|
||||
args := p.gccCmd()
|
||||
|
||||
// Optimization options can confuse the error messages; remove them.
|
||||
nargs := make([]string, 0, len(args)+len(extraArgs))
|
||||
nargs := make([]string, 0, len(args))
|
||||
for _, arg := range args {
|
||||
if !strings.HasPrefix(arg, "-O") {
|
||||
nargs = append(nargs, arg)
|
||||
}
|
||||
}
|
||||
|
||||
// Force -O0 optimization and append extra arguments, but keep the
|
||||
// trailing "-" at the end.
|
||||
li := len(nargs) - 1
|
||||
last := nargs[li]
|
||||
nargs[li] = "-O0"
|
||||
nargs = append(nargs, extraArgs...)
|
||||
nargs = append(nargs, last)
|
||||
// Force -O0 optimization but keep the trailing "-" at the end.
|
||||
nargs = append(nargs, "-O0")
|
||||
nl := len(nargs)
|
||||
nargs[nl-2], nargs[nl-1] = nargs[nl-1], nargs[nl-2]
|
||||
|
||||
if *debugGcc {
|
||||
fmt.Fprintf(os.Stderr, "$ %s <<EOF\n", strings.Join(nargs, " "))
|
||||
@@ -2077,10 +2060,6 @@ var goIdent = make(map[string]*ast.Ident)
|
||||
// that may contain a pointer. This is used for cgo pointer checking.
|
||||
var unionWithPointer = make(map[ast.Expr]bool)
|
||||
|
||||
// anonymousStructTag provides a consistent tag for an anonymous struct.
|
||||
// The same dwarf.StructType pointer will always get the same tag.
|
||||
var anonymousStructTag = make(map[*dwarf.StructType]string)
|
||||
|
||||
func (c *typeConv) Init(ptrSize, intSize int64) {
|
||||
c.ptrSize = ptrSize
|
||||
c.intSize = intSize
|
||||
@@ -2264,7 +2243,7 @@ func (c *typeConv) loadType(dtype dwarf.Type, pos token.Pos, parent string) *Typ
|
||||
// Translate to zero-length array instead.
|
||||
count = 0
|
||||
}
|
||||
sub := c.Type(dt.Type, pos)
|
||||
sub := c.loadType(dt.Type, pos, key)
|
||||
t.Align = sub.Align
|
||||
t.Go = &ast.ArrayType{
|
||||
Len: c.intExpr(count),
|
||||
@@ -2409,7 +2388,7 @@ func (c *typeConv) loadType(dtype dwarf.Type, pos token.Pos, parent string) *Typ
|
||||
c.ptrs[key] = append(c.ptrs[key], t)
|
||||
|
||||
case *dwarf.QualType:
|
||||
t1 := c.Type(dt.Type, pos)
|
||||
t1 := c.loadType(dt.Type, pos, key)
|
||||
t.Size = t1.Size
|
||||
t.Align = t1.Align
|
||||
t.Go = t1.Go
|
||||
@@ -2429,12 +2408,8 @@ func (c *typeConv) loadType(dtype dwarf.Type, pos token.Pos, parent string) *Typ
|
||||
break
|
||||
}
|
||||
if tag == "" {
|
||||
tag = anonymousStructTag[dt]
|
||||
if tag == "" {
|
||||
tag = "__" + strconv.Itoa(tagGen)
|
||||
tagGen++
|
||||
anonymousStructTag[dt] = tag
|
||||
}
|
||||
tag = "__" + strconv.Itoa(tagGen)
|
||||
tagGen++
|
||||
} else if t.C.Empty() {
|
||||
t.C.Set(dt.Kind + " " + tag)
|
||||
}
|
||||
@@ -2497,13 +2472,7 @@ func (c *typeConv) loadType(dtype dwarf.Type, pos token.Pos, parent string) *Typ
|
||||
}
|
||||
name := c.Ident("_Ctype_" + dt.Name)
|
||||
goIdent[name.Name] = name
|
||||
akey := ""
|
||||
if c.anonymousStructTypedef(dt) {
|
||||
// only load type recursively for typedefs of anonymous
|
||||
// structs, see issues 37479 and 37621.
|
||||
akey = key
|
||||
}
|
||||
sub := c.loadType(dt.Type, pos, akey)
|
||||
sub := c.loadType(dt.Type, pos, key)
|
||||
if c.badPointerTypedef(dt) {
|
||||
// Treat this typedef as a uintptr.
|
||||
s := *sub
|
||||
@@ -3024,16 +2993,8 @@ func fieldPrefix(fld []*ast.Field) string {
|
||||
return prefix
|
||||
}
|
||||
|
||||
// anonymousStructTypedef reports whether dt is a C typedef for an anonymous
|
||||
// struct.
|
||||
func (c *typeConv) anonymousStructTypedef(dt *dwarf.TypedefType) bool {
|
||||
st, ok := dt.Type.(*dwarf.StructType)
|
||||
return ok && st.StructName == ""
|
||||
}
|
||||
|
||||
// badPointerTypedef reports whether dt is a C typedef that should not be
|
||||
// considered a pointer in Go. A typedef is bad if C code sometimes stores
|
||||
// non-pointers in this type.
|
||||
// badPointerTypedef reports whether t is a C typedef that should not be considered a pointer in Go.
|
||||
// A typedef is bad if C code sometimes stores non-pointers in this type.
|
||||
// TODO: Currently our best solution is to find these manually and list them as
|
||||
// they come up. A better solution is desired.
|
||||
func (c *typeConv) badPointerTypedef(dt *dwarf.TypedefType) bool {
|
||||
@@ -3043,7 +3004,7 @@ func (c *typeConv) badPointerTypedef(dt *dwarf.TypedefType) bool {
|
||||
if c.badJNI(dt) {
|
||||
return true
|
||||
}
|
||||
if c.badEGLType(dt) {
|
||||
if c.badEGLDisplay(dt) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -3182,11 +3143,11 @@ func (c *typeConv) badJNI(dt *dwarf.TypedefType) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (c *typeConv) badEGLType(dt *dwarf.TypedefType) bool {
|
||||
if dt.Name != "EGLDisplay" && dt.Name != "EGLConfig" {
|
||||
func (c *typeConv) badEGLDisplay(dt *dwarf.TypedefType) bool {
|
||||
if dt.Name != "EGLDisplay" {
|
||||
return false
|
||||
}
|
||||
// Check that the typedef is "typedef void *<name>".
|
||||
// Check that the typedef is "typedef void *EGLDisplay".
|
||||
if ptr, ok := dt.Type.(*dwarf.PtrType); ok {
|
||||
if _, ok := ptr.Type.(*dwarf.VoidType); ok {
|
||||
return true
|
||||
|
||||
@@ -22,7 +22,6 @@ import (
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"unicode"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -98,11 +97,6 @@ func (p *Package) writeDefs() {
|
||||
|
||||
typedefNames := make([]string, 0, len(typedef))
|
||||
for name := range typedef {
|
||||
if name == "_Ctype_void" {
|
||||
// We provide an appropriate declaration for
|
||||
// _Ctype_void below (#39877).
|
||||
continue
|
||||
}
|
||||
typedefNames = append(typedefNames, name)
|
||||
}
|
||||
sort.Strings(typedefNames)
|
||||
@@ -123,9 +117,7 @@ func (p *Package) writeDefs() {
|
||||
// Moreover, empty file name makes compile emit no source debug info at all.
|
||||
var buf bytes.Buffer
|
||||
noSourceConf.Fprint(&buf, fset, def.Go)
|
||||
if bytes.HasPrefix(buf.Bytes(), []byte("_Ctype_")) ||
|
||||
strings.HasPrefix(name, "_Ctype_enum_") ||
|
||||
strings.HasPrefix(name, "_Ctype_union_") {
|
||||
if bytes.HasPrefix(buf.Bytes(), []byte("_Ctype_")) {
|
||||
// This typedef is of the form `typedef a b` and should be an alias.
|
||||
fmt.Fprintf(fgo2, "= ")
|
||||
}
|
||||
@@ -243,7 +235,6 @@ func (p *Package) writeDefs() {
|
||||
if err != nil {
|
||||
fatalf("%s", err)
|
||||
}
|
||||
defer fgcch.Close()
|
||||
_, err = io.Copy(fexp, fgcch)
|
||||
if err != nil {
|
||||
fatalf("%s", err)
|
||||
@@ -811,28 +802,6 @@ func (p *Package) packedAttribute() string {
|
||||
return s + "))"
|
||||
}
|
||||
|
||||
// exportParamName returns the value of param as it should be
|
||||
// displayed in a c header file. If param contains any non-ASCII
|
||||
// characters, this function will return the character p followed by
|
||||
// the value of position; otherwise, this function will return the
|
||||
// value of param.
|
||||
func exportParamName(param string, position int) string {
|
||||
if param == "" {
|
||||
return fmt.Sprintf("p%d", position)
|
||||
}
|
||||
|
||||
pname := param
|
||||
|
||||
for i := 0; i < len(param); i++ {
|
||||
if param[i] > unicode.MaxASCII {
|
||||
pname = fmt.Sprintf("p%d", position)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return pname
|
||||
}
|
||||
|
||||
// Write out the various stubs we need to support functions exported
|
||||
// from Go so that they are callable from C.
|
||||
func (p *Package) writeExports(fgo2, fm, fgcc, fgcch io.Writer) {
|
||||
@@ -946,45 +915,42 @@ func (p *Package) writeExports(fgo2, fm, fgcc, fgcch io.Writer) {
|
||||
if i > 0 || fn.Recv != nil {
|
||||
s += ", "
|
||||
}
|
||||
s += fmt.Sprintf("%s %s", p.cgoType(atype).C, exportParamName(aname, i))
|
||||
s += fmt.Sprintf("%s p%d", p.cgoType(atype).C, i)
|
||||
})
|
||||
s += ")"
|
||||
|
||||
if len(exp.Doc) > 0 {
|
||||
fmt.Fprintf(fgcch, "\n%s", exp.Doc)
|
||||
if !strings.HasSuffix(exp.Doc, "\n") {
|
||||
fmt.Fprint(fgcch, "\n")
|
||||
}
|
||||
}
|
||||
fmt.Fprintf(fgcch, "extern %s;\n", s)
|
||||
fmt.Fprintf(fgcch, "\nextern %s;\n", s)
|
||||
|
||||
fmt.Fprintf(fgcc, "extern void _cgoexp%s_%s(void *, int, __SIZE_TYPE__);\n", cPrefix, exp.ExpName)
|
||||
fmt.Fprintf(fgcc, "\nCGO_NO_SANITIZE_THREAD")
|
||||
fmt.Fprintf(fgcc, "\n%s\n", s)
|
||||
fmt.Fprintf(fgcc, "{\n")
|
||||
fmt.Fprintf(fgcc, "\t__SIZE_TYPE__ _cgo_ctxt = _cgo_wait_runtime_init_done();\n")
|
||||
fmt.Fprintf(fgcc, "\t%s %v _cgo_a;\n", ctype, p.packedAttribute())
|
||||
fmt.Fprintf(fgcc, "\t%s %v a;\n", ctype, p.packedAttribute())
|
||||
if gccResult != "void" && (len(fntype.Results.List) > 1 || len(fntype.Results.List[0].Names) > 1) {
|
||||
fmt.Fprintf(fgcc, "\t%s r;\n", gccResult)
|
||||
}
|
||||
if fn.Recv != nil {
|
||||
fmt.Fprintf(fgcc, "\t_cgo_a.recv = recv;\n")
|
||||
fmt.Fprintf(fgcc, "\ta.recv = recv;\n")
|
||||
}
|
||||
forFieldList(fntype.Params,
|
||||
func(i int, aname string, atype ast.Expr) {
|
||||
fmt.Fprintf(fgcc, "\t_cgo_a.p%d = %s;\n", i, exportParamName(aname, i))
|
||||
fmt.Fprintf(fgcc, "\ta.p%d = p%d;\n", i, i)
|
||||
})
|
||||
fmt.Fprintf(fgcc, "\t_cgo_tsan_release();\n")
|
||||
fmt.Fprintf(fgcc, "\tcrosscall2(_cgoexp%s_%s, &_cgo_a, %d, _cgo_ctxt);\n", cPrefix, exp.ExpName, off)
|
||||
fmt.Fprintf(fgcc, "\tcrosscall2(_cgoexp%s_%s, &a, %d, _cgo_ctxt);\n", cPrefix, exp.ExpName, off)
|
||||
fmt.Fprintf(fgcc, "\t_cgo_tsan_acquire();\n")
|
||||
fmt.Fprintf(fgcc, "\t_cgo_release_context(_cgo_ctxt);\n")
|
||||
if gccResult != "void" {
|
||||
if len(fntype.Results.List) == 1 && len(fntype.Results.List[0].Names) <= 1 {
|
||||
fmt.Fprintf(fgcc, "\treturn _cgo_a.r0;\n")
|
||||
fmt.Fprintf(fgcc, "\treturn a.r0;\n")
|
||||
} else {
|
||||
forFieldList(fntype.Results,
|
||||
func(i int, aname string, atype ast.Expr) {
|
||||
fmt.Fprintf(fgcc, "\tr.r%d = _cgo_a.r%d;\n", i, i)
|
||||
fmt.Fprintf(fgcc, "\tr.r%d = a.r%d;\n", i, i)
|
||||
})
|
||||
fmt.Fprintf(fgcc, "\treturn r;\n")
|
||||
}
|
||||
|
||||
@@ -77,6 +77,8 @@ Flags:
|
||||
-lang version
|
||||
Set language version to compile, as in -lang=go1.12.
|
||||
Default is current version.
|
||||
-largemodel
|
||||
Generate code that assumes a large memory model.
|
||||
-linkobj file
|
||||
Write linker-specific object to file and compiler-specific
|
||||
object to usual output file (as specified by -o).
|
||||
@@ -107,8 +109,6 @@ Flags:
|
||||
Warn about composite literals that can be simplified.
|
||||
-shared
|
||||
Generate code that can be linked into a shared library.
|
||||
-spectre list
|
||||
Enable spectre mitigations in list (all, index, ret).
|
||||
-traceprofile file
|
||||
Write an execution trace to file.
|
||||
-trimpath prefix
|
||||
@@ -197,58 +197,30 @@ directive can skip over a directive like any other comment.
|
||||
// Line directives typically appear in machine-generated code, so that compilers and debuggers
|
||||
// will report positions in the original input to the generator.
|
||||
/*
|
||||
The line directive is a historical special case; all other directives are of the form
|
||||
//go:name, indicating that they are defined by the Go toolchain.
|
||||
Each directive must be placed its own line, with only leading spaces and tabs
|
||||
allowed before the comment.
|
||||
Each directive applies to the Go code that immediately follows it,
|
||||
which typically must be a declaration.
|
||||
The line directive is an historical special case; all other directives are of the form
|
||||
//go:name and must start at the beginning of a line, indicating that the directive is defined
|
||||
by the Go toolchain.
|
||||
|
||||
//go:noescape
|
||||
|
||||
The //go:noescape directive must be followed by a function declaration without
|
||||
a body (meaning that the function has an implementation not written in Go).
|
||||
It specifies that the function does not allow any of the pointers passed as
|
||||
arguments to escape into the heap or into the values returned from the function.
|
||||
This information can be used during the compiler's escape analysis of Go code
|
||||
calling the function.
|
||||
|
||||
//go:uintptrescapes
|
||||
|
||||
The //go:uintptrescapes directive must be followed by a function declaration.
|
||||
It specifies that the function's uintptr arguments may be pointer values
|
||||
that have been converted to uintptr and must be treated as such by the
|
||||
garbage collector. The conversion from pointer to uintptr must appear in
|
||||
the argument list of any call to this function. This directive is necessary
|
||||
for some low-level system call implementations and should be avoided otherwise.
|
||||
|
||||
//go:noinline
|
||||
|
||||
The //go:noinline directive must be followed by a function declaration.
|
||||
It specifies that calls to the function should not be inlined, overriding
|
||||
the compiler's usual optimization rules. This is typically only needed
|
||||
for special runtime functions or when debugging the compiler.
|
||||
|
||||
//go:norace
|
||||
|
||||
The //go:norace directive must be followed by a function declaration.
|
||||
It specifies that the function's memory accesses must be ignored by the
|
||||
race detector. This is most commonly used in low-level code invoked
|
||||
at times when it is unsafe to call into the race detector runtime.
|
||||
The //go:noescape directive specifies that the next declaration in the file, which
|
||||
must be a func without a body (meaning that it has an implementation not written
|
||||
in Go) does not allow any of the pointers passed as arguments to escape into the
|
||||
heap or into the values returned from the function. This information can be used
|
||||
during the compiler's escape analysis of Go code calling the function.
|
||||
|
||||
//go:nosplit
|
||||
|
||||
The //go:nosplit directive must be followed by a function declaration.
|
||||
It specifies that the function must omit its usual stack overflow check.
|
||||
This is most commonly used by low-level runtime code invoked
|
||||
at times when it is unsafe for the calling goroutine to be preempted.
|
||||
The //go:nosplit directive specifies that the next function declared in the file must
|
||||
not include a stack overflow check. This is most commonly used by low-level
|
||||
runtime sources invoked at times when it is unsafe for the calling goroutine to be
|
||||
preempted.
|
||||
|
||||
//go:linkname localname [importpath.name]
|
||||
|
||||
This special directive does not apply to the Go code that follows it.
|
||||
Instead, the //go:linkname directive instructs the compiler to use ``importpath.name''
|
||||
as the object file symbol name for the variable or function declared as ``localname''
|
||||
in the source code.
|
||||
The //go:linkname directive instructs the compiler to use ``importpath.name'' as the
|
||||
object file symbol name for the variable or function declared as ``localname'' in the
|
||||
source code.
|
||||
If the ``importpath.name'' argument is omitted, the directive uses the
|
||||
symbol's default object file symbol name and only has the effect of making
|
||||
the symbol accessible to other packages.
|
||||
|
||||
@@ -96,7 +96,7 @@ func TestFormats(t *testing.T) {
|
||||
}
|
||||
|
||||
importPath := filepath.Join("cmd/compile", path)
|
||||
if ignoredPackages[filepath.ToSlash(importPath)] {
|
||||
if blacklistedPackages[filepath.ToSlash(importPath)] {
|
||||
return filepath.SkipDir
|
||||
}
|
||||
|
||||
@@ -344,7 +344,8 @@ func collectPkgFormats(t *testing.T, pkg *build.Package) {
|
||||
for index, file := range files {
|
||||
ast.Inspect(file, func(n ast.Node) bool {
|
||||
if call, ok := n.(*ast.CallExpr); ok {
|
||||
if ignoredFunctions[nodeString(call.Fun)] {
|
||||
// ignore blacklisted functions
|
||||
if blacklistedFunctions[nodeString(call.Fun)] {
|
||||
return true
|
||||
}
|
||||
// look for an arguments that might be a format string
|
||||
@@ -353,7 +354,7 @@ func collectPkgFormats(t *testing.T, pkg *build.Package) {
|
||||
// make sure we have enough arguments
|
||||
n := numFormatArgs(s)
|
||||
if i+1+n > len(call.Args) {
|
||||
t.Errorf("%s: not enough format args (ignore %s?)", posString(call), nodeString(call.Fun))
|
||||
t.Errorf("%s: not enough format args (blacklist %s?)", posString(call), nodeString(call.Fun))
|
||||
break // ignore this call
|
||||
}
|
||||
// assume last n arguments are to be formatted;
|
||||
@@ -548,14 +549,14 @@ func formatReplace(in string, f func(i int, s string) string) string {
|
||||
return string(append(buf, in[i0:]...))
|
||||
}
|
||||
|
||||
// ignoredPackages is the set of packages which can
|
||||
// blacklistedPackages is the set of packages which can
|
||||
// be ignored.
|
||||
var ignoredPackages = map[string]bool{}
|
||||
var blacklistedPackages = map[string]bool{}
|
||||
|
||||
// ignoredFunctions is the set of functions which may have
|
||||
// blacklistedFunctions is the set of functions which may have
|
||||
// format-like arguments but which don't do any formatting and
|
||||
// thus may be ignored.
|
||||
var ignoredFunctions = map[string]bool{}
|
||||
var blacklistedFunctions = map[string]bool{}
|
||||
|
||||
func init() {
|
||||
// verify that knownFormats entries are correctly formatted
|
||||
|
||||
@@ -112,10 +112,8 @@ var knownFormats = map[string]string{
|
||||
"cmd/compile/internal/ssa.Location %s": "",
|
||||
"cmd/compile/internal/ssa.Op %s": "",
|
||||
"cmd/compile/internal/ssa.Op %v": "",
|
||||
"cmd/compile/internal/ssa.Sym %v": "",
|
||||
"cmd/compile/internal/ssa.ValAndOff %s": "",
|
||||
"cmd/compile/internal/ssa.domain %v": "",
|
||||
"cmd/compile/internal/ssa.flagConstant %s": "",
|
||||
"cmd/compile/internal/ssa.posetNode %v": "",
|
||||
"cmd/compile/internal/ssa.posetTestOp %v": "",
|
||||
"cmd/compile/internal/ssa.rbrank %d": "",
|
||||
@@ -141,7 +139,6 @@ var knownFormats = map[string]string{
|
||||
"float64 %.3f": "",
|
||||
"float64 %.6g": "",
|
||||
"float64 %g": "",
|
||||
"int %#x": "",
|
||||
"int %-12d": "",
|
||||
"int %-6d": "",
|
||||
"int %-8o": "",
|
||||
@@ -153,14 +150,13 @@ var knownFormats = map[string]string{
|
||||
"int %x": "",
|
||||
"int16 %d": "",
|
||||
"int16 %x": "",
|
||||
"int32 %#x": "",
|
||||
"int32 %d": "",
|
||||
"int32 %v": "",
|
||||
"int32 %x": "",
|
||||
"int64 %#x": "",
|
||||
"int64 %+d": "",
|
||||
"int64 %-10d": "",
|
||||
"int64 %.5d": "",
|
||||
"int64 %X": "",
|
||||
"int64 %d": "",
|
||||
"int64 %v": "",
|
||||
"int64 %x": "",
|
||||
@@ -205,7 +201,6 @@ var knownFormats = map[string]string{
|
||||
"uint64 %b": "",
|
||||
"uint64 %d": "",
|
||||
"uint64 %x": "",
|
||||
"uint8 %#x": "",
|
||||
"uint8 %d": "",
|
||||
"uint8 %v": "",
|
||||
"uint8 %x": "",
|
||||
|
||||
@@ -257,7 +257,7 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
|
||||
|
||||
// CPU faults upon signed overflow, which occurs when the most
|
||||
// negative int is divided by -1. Handle divide by -1 as a special case.
|
||||
if ssa.DivisionNeedsFixUp(v) {
|
||||
if ssa.NeedsFixUp(v) {
|
||||
var c *obj.Prog
|
||||
switch v.Op {
|
||||
case ssa.OpAMD64DIVQ:
|
||||
@@ -319,8 +319,8 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
|
||||
// TODO(khr): issue only the -1 fixup code we need.
|
||||
// For instance, if only the quotient is used, no point in zeroing the remainder.
|
||||
|
||||
j1.To.SetTarget(n1)
|
||||
j2.To.SetTarget(s.Pc())
|
||||
j1.To.Val = n1
|
||||
j2.To.Val = s.Pc()
|
||||
}
|
||||
|
||||
case ssa.OpAMD64HMULQ, ssa.OpAMD64HMULL, ssa.OpAMD64HMULQU, ssa.OpAMD64HMULLU:
|
||||
@@ -681,19 +681,6 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
|
||||
gc.AddAux2(&p.From, v, sc.Off())
|
||||
p.To.Type = obj.TYPE_CONST
|
||||
p.To.Offset = sc.Val()
|
||||
case ssa.OpAMD64CMPQloadidx8, ssa.OpAMD64CMPQloadidx1, ssa.OpAMD64CMPLloadidx4, ssa.OpAMD64CMPLloadidx1, ssa.OpAMD64CMPWloadidx2, ssa.OpAMD64CMPWloadidx1, ssa.OpAMD64CMPBloadidx1:
|
||||
p := s.Prog(v.Op.Asm())
|
||||
memIdx(&p.From, v)
|
||||
gc.AddAux(&p.From, v)
|
||||
p.To.Type = obj.TYPE_REG
|
||||
p.To.Reg = v.Args[2].Reg()
|
||||
case ssa.OpAMD64CMPQconstloadidx8, ssa.OpAMD64CMPQconstloadidx1, ssa.OpAMD64CMPLconstloadidx4, ssa.OpAMD64CMPLconstloadidx1, ssa.OpAMD64CMPWconstloadidx2, ssa.OpAMD64CMPWconstloadidx1, ssa.OpAMD64CMPBconstloadidx1:
|
||||
sc := v.AuxValAndOff()
|
||||
p := s.Prog(v.Op.Asm())
|
||||
memIdx(&p.From, v)
|
||||
gc.AddAux2(&p.From, v, sc.Off())
|
||||
p.To.Type = obj.TYPE_CONST
|
||||
p.To.Offset = sc.Val()
|
||||
case ssa.OpAMD64MOVLconst, ssa.OpAMD64MOVQconst:
|
||||
x := v.Reg()
|
||||
|
||||
@@ -752,12 +739,7 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
|
||||
p.To.Reg = v.Args[0].Reg()
|
||||
gc.AddAux(&p.To, v)
|
||||
case ssa.OpAMD64MOVBstoreidx1, ssa.OpAMD64MOVWstoreidx1, ssa.OpAMD64MOVLstoreidx1, ssa.OpAMD64MOVQstoreidx1, ssa.OpAMD64MOVSSstoreidx1, ssa.OpAMD64MOVSDstoreidx1,
|
||||
ssa.OpAMD64MOVQstoreidx8, ssa.OpAMD64MOVSDstoreidx8, ssa.OpAMD64MOVLstoreidx8, ssa.OpAMD64MOVSSstoreidx4, ssa.OpAMD64MOVLstoreidx4, ssa.OpAMD64MOVWstoreidx2,
|
||||
ssa.OpAMD64ADDLmodifyidx1, ssa.OpAMD64ADDLmodifyidx4, ssa.OpAMD64ADDLmodifyidx8, ssa.OpAMD64ADDQmodifyidx1, ssa.OpAMD64ADDQmodifyidx8,
|
||||
ssa.OpAMD64SUBLmodifyidx1, ssa.OpAMD64SUBLmodifyidx4, ssa.OpAMD64SUBLmodifyidx8, ssa.OpAMD64SUBQmodifyidx1, ssa.OpAMD64SUBQmodifyidx8,
|
||||
ssa.OpAMD64ANDLmodifyidx1, ssa.OpAMD64ANDLmodifyidx4, ssa.OpAMD64ANDLmodifyidx8, ssa.OpAMD64ANDQmodifyidx1, ssa.OpAMD64ANDQmodifyidx8,
|
||||
ssa.OpAMD64ORLmodifyidx1, ssa.OpAMD64ORLmodifyidx4, ssa.OpAMD64ORLmodifyidx8, ssa.OpAMD64ORQmodifyidx1, ssa.OpAMD64ORQmodifyidx8,
|
||||
ssa.OpAMD64XORLmodifyidx1, ssa.OpAMD64XORLmodifyidx4, ssa.OpAMD64XORLmodifyidx8, ssa.OpAMD64XORQmodifyidx1, ssa.OpAMD64XORQmodifyidx8:
|
||||
ssa.OpAMD64MOVQstoreidx8, ssa.OpAMD64MOVSDstoreidx8, ssa.OpAMD64MOVLstoreidx8, ssa.OpAMD64MOVSSstoreidx4, ssa.OpAMD64MOVLstoreidx4, ssa.OpAMD64MOVWstoreidx2:
|
||||
p := s.Prog(v.Op.Asm())
|
||||
p.From.Type = obj.TYPE_REG
|
||||
p.From.Reg = v.Args[2].Reg()
|
||||
@@ -801,7 +783,6 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
|
||||
p.To.Type = obj.TYPE_MEM
|
||||
p.To.Reg = v.Args[0].Reg()
|
||||
gc.AddAux2(&p.To, v, off)
|
||||
|
||||
case ssa.OpAMD64MOVQstoreconst, ssa.OpAMD64MOVLstoreconst, ssa.OpAMD64MOVWstoreconst, ssa.OpAMD64MOVBstoreconst:
|
||||
p := s.Prog(v.Op.Asm())
|
||||
p.From.Type = obj.TYPE_CONST
|
||||
@@ -810,29 +791,11 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
|
||||
p.To.Type = obj.TYPE_MEM
|
||||
p.To.Reg = v.Args[0].Reg()
|
||||
gc.AddAux2(&p.To, v, sc.Off())
|
||||
case ssa.OpAMD64MOVQstoreconstidx1, ssa.OpAMD64MOVQstoreconstidx8, ssa.OpAMD64MOVLstoreconstidx1, ssa.OpAMD64MOVLstoreconstidx4, ssa.OpAMD64MOVWstoreconstidx1, ssa.OpAMD64MOVWstoreconstidx2, ssa.OpAMD64MOVBstoreconstidx1,
|
||||
ssa.OpAMD64ADDLconstmodifyidx1, ssa.OpAMD64ADDLconstmodifyidx4, ssa.OpAMD64ADDLconstmodifyidx8, ssa.OpAMD64ADDQconstmodifyidx1, ssa.OpAMD64ADDQconstmodifyidx8,
|
||||
ssa.OpAMD64ANDLconstmodifyidx1, ssa.OpAMD64ANDLconstmodifyidx4, ssa.OpAMD64ANDLconstmodifyidx8, ssa.OpAMD64ANDQconstmodifyidx1, ssa.OpAMD64ANDQconstmodifyidx8,
|
||||
ssa.OpAMD64ORLconstmodifyidx1, ssa.OpAMD64ORLconstmodifyidx4, ssa.OpAMD64ORLconstmodifyidx8, ssa.OpAMD64ORQconstmodifyidx1, ssa.OpAMD64ORQconstmodifyidx8,
|
||||
ssa.OpAMD64XORLconstmodifyidx1, ssa.OpAMD64XORLconstmodifyidx4, ssa.OpAMD64XORLconstmodifyidx8, ssa.OpAMD64XORQconstmodifyidx1, ssa.OpAMD64XORQconstmodifyidx8:
|
||||
case ssa.OpAMD64MOVQstoreconstidx1, ssa.OpAMD64MOVQstoreconstidx8, ssa.OpAMD64MOVLstoreconstidx1, ssa.OpAMD64MOVLstoreconstidx4, ssa.OpAMD64MOVWstoreconstidx1, ssa.OpAMD64MOVWstoreconstidx2, ssa.OpAMD64MOVBstoreconstidx1:
|
||||
p := s.Prog(v.Op.Asm())
|
||||
p.From.Type = obj.TYPE_CONST
|
||||
sc := v.AuxValAndOff()
|
||||
p.From.Offset = sc.Val()
|
||||
switch {
|
||||
case p.As == x86.AADDQ && p.From.Offset == 1:
|
||||
p.As = x86.AINCQ
|
||||
p.From.Type = obj.TYPE_NONE
|
||||
case p.As == x86.AADDQ && p.From.Offset == -1:
|
||||
p.As = x86.ADECQ
|
||||
p.From.Type = obj.TYPE_NONE
|
||||
case p.As == x86.AADDL && p.From.Offset == 1:
|
||||
p.As = x86.AINCL
|
||||
p.From.Type = obj.TYPE_NONE
|
||||
case p.As == x86.AADDL && p.From.Offset == -1:
|
||||
p.As = x86.ADECL
|
||||
p.From.Type = obj.TYPE_NONE
|
||||
}
|
||||
memIdx(&p.To, v)
|
||||
gc.AddAux2(&p.To, v, sc.Off())
|
||||
case ssa.OpAMD64MOVLQSX, ssa.OpAMD64MOVWQSX, ssa.OpAMD64MOVBQSX, ssa.OpAMD64MOVLQZX, ssa.OpAMD64MOVWQZX, ssa.OpAMD64MOVBQZX,
|
||||
@@ -864,32 +827,6 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
|
||||
p := s.Prog(v.Op.Asm())
|
||||
p.From.Type = obj.TYPE_MEM
|
||||
p.From.Reg = v.Args[1].Reg()
|
||||
gc.AddAux(&p.From, v)
|
||||
p.To.Type = obj.TYPE_REG
|
||||
p.To.Reg = v.Reg()
|
||||
if v.Reg() != v.Args[0].Reg() {
|
||||
v.Fatalf("input[0] and output not in same register %s", v.LongString())
|
||||
}
|
||||
case ssa.OpAMD64ADDLloadidx1, ssa.OpAMD64ADDLloadidx4, ssa.OpAMD64ADDLloadidx8, ssa.OpAMD64ADDQloadidx1, ssa.OpAMD64ADDQloadidx8,
|
||||
ssa.OpAMD64SUBLloadidx1, ssa.OpAMD64SUBLloadidx4, ssa.OpAMD64SUBLloadidx8, ssa.OpAMD64SUBQloadidx1, ssa.OpAMD64SUBQloadidx8,
|
||||
ssa.OpAMD64ANDLloadidx1, ssa.OpAMD64ANDLloadidx4, ssa.OpAMD64ANDLloadidx8, ssa.OpAMD64ANDQloadidx1, ssa.OpAMD64ANDQloadidx8,
|
||||
ssa.OpAMD64ORLloadidx1, ssa.OpAMD64ORLloadidx4, ssa.OpAMD64ORLloadidx8, ssa.OpAMD64ORQloadidx1, ssa.OpAMD64ORQloadidx8,
|
||||
ssa.OpAMD64XORLloadidx1, ssa.OpAMD64XORLloadidx4, ssa.OpAMD64XORLloadidx8, ssa.OpAMD64XORQloadidx1, ssa.OpAMD64XORQloadidx8,
|
||||
ssa.OpAMD64ADDSSloadidx1, ssa.OpAMD64ADDSSloadidx4, ssa.OpAMD64ADDSDloadidx1, ssa.OpAMD64ADDSDloadidx8,
|
||||
ssa.OpAMD64SUBSSloadidx1, ssa.OpAMD64SUBSSloadidx4, ssa.OpAMD64SUBSDloadidx1, ssa.OpAMD64SUBSDloadidx8,
|
||||
ssa.OpAMD64MULSSloadidx1, ssa.OpAMD64MULSSloadidx4, ssa.OpAMD64MULSDloadidx1, ssa.OpAMD64MULSDloadidx8,
|
||||
ssa.OpAMD64DIVSSloadidx1, ssa.OpAMD64DIVSSloadidx4, ssa.OpAMD64DIVSDloadidx1, ssa.OpAMD64DIVSDloadidx8:
|
||||
p := s.Prog(v.Op.Asm())
|
||||
|
||||
r, i := v.Args[1].Reg(), v.Args[2].Reg()
|
||||
p.From.Type = obj.TYPE_MEM
|
||||
p.From.Scale = v.Op.Scale()
|
||||
if p.From.Scale == 1 && i == x86.REG_SP {
|
||||
r, i = i, r
|
||||
}
|
||||
p.From.Reg = r
|
||||
p.From.Index = i
|
||||
|
||||
gc.AddAux(&p.From, v)
|
||||
p.To.Type = obj.TYPE_REG
|
||||
p.To.Reg = v.Reg()
|
||||
@@ -922,16 +859,7 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
|
||||
p := s.Prog(obj.ADUFFCOPY)
|
||||
p.To.Type = obj.TYPE_ADDR
|
||||
p.To.Sym = gc.Duffcopy
|
||||
if v.AuxInt%16 != 0 {
|
||||
v.Fatalf("bad DUFFCOPY AuxInt %v", v.AuxInt)
|
||||
}
|
||||
p.To.Offset = 14 * (64 - v.AuxInt/16)
|
||||
// 14 and 64 are magic constants. 14 is the number of bytes to encode:
|
||||
// MOVUPS (SI), X0
|
||||
// ADDQ $16, SI
|
||||
// MOVUPS X0, (DI)
|
||||
// ADDQ $16, DI
|
||||
// and 64 is the number of such blocks. See src/runtime/duff_amd64.s:duffcopy.
|
||||
p.To.Offset = v.AuxInt
|
||||
|
||||
case ssa.OpCopy: // TODO: use MOVQreg for reg->reg copies instead of OpCopy?
|
||||
if v.Type.IsMemory() {
|
||||
@@ -961,12 +889,6 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
|
||||
p.From.Type = obj.TYPE_REG
|
||||
p.From.Reg = v.Args[0].Reg()
|
||||
gc.AddrAuto(&p.To, v)
|
||||
case ssa.OpAMD64LoweredHasCPUFeature:
|
||||
p := s.Prog(x86.AMOVBQZX)
|
||||
p.From.Type = obj.TYPE_MEM
|
||||
gc.AddAux(&p.From, v)
|
||||
p.To.Type = obj.TYPE_REG
|
||||
p.To.Reg = v.Reg()
|
||||
case ssa.OpAMD64LoweredGetClosurePtr:
|
||||
// Closure pointer is DX.
|
||||
gc.CheckLoweredGetClosurePtr(v)
|
||||
@@ -1025,8 +947,7 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
|
||||
p := s.Prog(obj.ACALL)
|
||||
p.To.Type = obj.TYPE_MEM
|
||||
p.To.Name = obj.NAME_EXTERN
|
||||
// arg0 is in DI. Set sym to match where regalloc put arg1.
|
||||
p.To.Sym = gc.GCWriteBarrierReg[v.Args[1].Reg()]
|
||||
p.To.Sym = v.Aux.(*obj.LSym)
|
||||
|
||||
case ssa.OpAMD64LoweredPanicBoundsA, ssa.OpAMD64LoweredPanicBoundsB, ssa.OpAMD64LoweredPanicBoundsC:
|
||||
p := s.Prog(obj.ACALL)
|
||||
@@ -1160,6 +1081,7 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
|
||||
p.From.Reg = x86.REG_AX
|
||||
p.To.Type = obj.TYPE_MEM
|
||||
p.To.Reg = v.Args[0].Reg()
|
||||
gc.AddAux(&p.To, v)
|
||||
if logopt.Enabled() {
|
||||
logopt.LogOpt(v.Pos, "nilcheck", "genssa", v.Block.Func.Name)
|
||||
}
|
||||
@@ -1256,11 +1178,11 @@ var blockJump = [...]struct {
|
||||
ssa.BlockAMD64NAN: {x86.AJPS, x86.AJPC},
|
||||
}
|
||||
|
||||
var eqfJumps = [2][2]gc.IndexJump{
|
||||
var eqfJumps = [2][2]gc.FloatingEQNEJump{
|
||||
{{Jump: x86.AJNE, Index: 1}, {Jump: x86.AJPS, Index: 1}}, // next == b.Succs[0]
|
||||
{{Jump: x86.AJNE, Index: 1}, {Jump: x86.AJPC, Index: 0}}, // next == b.Succs[1]
|
||||
}
|
||||
var nefJumps = [2][2]gc.IndexJump{
|
||||
var nefJumps = [2][2]gc.FloatingEQNEJump{
|
||||
{{Jump: x86.AJNE, Index: 0}, {Jump: x86.AJPC, Index: 1}}, // next == b.Succs[0]
|
||||
{{Jump: x86.AJNE, Index: 0}, {Jump: x86.AJPS, Index: 0}}, // next == b.Succs[1]
|
||||
}
|
||||
@@ -1300,10 +1222,10 @@ func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
|
||||
p.To.Sym = b.Aux.(*obj.LSym)
|
||||
|
||||
case ssa.BlockAMD64EQF:
|
||||
s.CombJump(b, next, &eqfJumps)
|
||||
s.FPJump(b, next, &eqfJumps)
|
||||
|
||||
case ssa.BlockAMD64NEF:
|
||||
s.CombJump(b, next, &nefJumps)
|
||||
s.FPJump(b, next, &nefJumps)
|
||||
|
||||
case ssa.BlockAMD64EQ, ssa.BlockAMD64NE,
|
||||
ssa.BlockAMD64LT, ssa.BlockAMD64GE,
|
||||
|
||||
@@ -857,8 +857,12 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
|
||||
p := s.Prog(obj.AGETCALLERPC)
|
||||
p.To.Type = obj.TYPE_REG
|
||||
p.To.Reg = v.Reg()
|
||||
case ssa.OpARMFlagConstant:
|
||||
v.Fatalf("FlagConstant op should never make it to codegen %v", v.LongString())
|
||||
case ssa.OpARMFlagEQ,
|
||||
ssa.OpARMFlagLT_ULT,
|
||||
ssa.OpARMFlagLT_UGT,
|
||||
ssa.OpARMFlagGT_ULT,
|
||||
ssa.OpARMFlagGT_UGT:
|
||||
v.Fatalf("Flag* ops should never make it to codegen %v", v.LongString())
|
||||
case ssa.OpARMInvertFlags:
|
||||
v.Fatalf("InvertFlags should never make it to codegen %v", v.LongString())
|
||||
case ssa.OpClobber:
|
||||
@@ -884,30 +888,16 @@ var condBits = map[ssa.Op]uint8{
|
||||
var blockJump = map[ssa.BlockKind]struct {
|
||||
asm, invasm obj.As
|
||||
}{
|
||||
ssa.BlockARMEQ: {arm.ABEQ, arm.ABNE},
|
||||
ssa.BlockARMNE: {arm.ABNE, arm.ABEQ},
|
||||
ssa.BlockARMLT: {arm.ABLT, arm.ABGE},
|
||||
ssa.BlockARMGE: {arm.ABGE, arm.ABLT},
|
||||
ssa.BlockARMLE: {arm.ABLE, arm.ABGT},
|
||||
ssa.BlockARMGT: {arm.ABGT, arm.ABLE},
|
||||
ssa.BlockARMULT: {arm.ABLO, arm.ABHS},
|
||||
ssa.BlockARMUGE: {arm.ABHS, arm.ABLO},
|
||||
ssa.BlockARMUGT: {arm.ABHI, arm.ABLS},
|
||||
ssa.BlockARMULE: {arm.ABLS, arm.ABHI},
|
||||
ssa.BlockARMLTnoov: {arm.ABMI, arm.ABPL},
|
||||
ssa.BlockARMGEnoov: {arm.ABPL, arm.ABMI},
|
||||
}
|
||||
|
||||
// To model a 'LEnoov' ('<=' without overflow checking) branching
|
||||
var leJumps = [2][2]gc.IndexJump{
|
||||
{{Jump: arm.ABEQ, Index: 0}, {Jump: arm.ABPL, Index: 1}}, // next == b.Succs[0]
|
||||
{{Jump: arm.ABMI, Index: 0}, {Jump: arm.ABEQ, Index: 0}}, // next == b.Succs[1]
|
||||
}
|
||||
|
||||
// To model a 'GTnoov' ('>' without overflow checking) branching
|
||||
var gtJumps = [2][2]gc.IndexJump{
|
||||
{{Jump: arm.ABMI, Index: 1}, {Jump: arm.ABEQ, Index: 1}}, // next == b.Succs[0]
|
||||
{{Jump: arm.ABEQ, Index: 1}, {Jump: arm.ABPL, Index: 0}}, // next == b.Succs[1]
|
||||
ssa.BlockARMEQ: {arm.ABEQ, arm.ABNE},
|
||||
ssa.BlockARMNE: {arm.ABNE, arm.ABEQ},
|
||||
ssa.BlockARMLT: {arm.ABLT, arm.ABGE},
|
||||
ssa.BlockARMGE: {arm.ABGE, arm.ABLT},
|
||||
ssa.BlockARMLE: {arm.ABLE, arm.ABGT},
|
||||
ssa.BlockARMGT: {arm.ABGT, arm.ABLE},
|
||||
ssa.BlockARMULT: {arm.ABLO, arm.ABHS},
|
||||
ssa.BlockARMUGE: {arm.ABHS, arm.ABLO},
|
||||
ssa.BlockARMUGT: {arm.ABHI, arm.ABLS},
|
||||
ssa.BlockARMULE: {arm.ABLS, arm.ABHI},
|
||||
}
|
||||
|
||||
func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
|
||||
@@ -951,8 +941,7 @@ func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
|
||||
ssa.BlockARMLT, ssa.BlockARMGE,
|
||||
ssa.BlockARMLE, ssa.BlockARMGT,
|
||||
ssa.BlockARMULT, ssa.BlockARMUGT,
|
||||
ssa.BlockARMULE, ssa.BlockARMUGE,
|
||||
ssa.BlockARMLTnoov, ssa.BlockARMGEnoov:
|
||||
ssa.BlockARMULE, ssa.BlockARMUGE:
|
||||
jmp := blockJump[b.Kind]
|
||||
switch next {
|
||||
case b.Succs[0].Block():
|
||||
@@ -969,12 +958,6 @@ func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
|
||||
}
|
||||
}
|
||||
|
||||
case ssa.BlockARMLEnoov:
|
||||
s.CombJump(b, next, &leJumps)
|
||||
|
||||
case ssa.BlockARMGTnoov:
|
||||
s.CombJump(b, next, >Jumps)
|
||||
|
||||
default:
|
||||
b.Fatalf("branch not implemented: %s", b.LongString())
|
||||
}
|
||||
|
||||
@@ -816,7 +816,7 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
|
||||
}
|
||||
p := s.Prog(v.Op.Asm())
|
||||
p.From.Type = obj.TYPE_REG // assembler encodes conditional bits in Reg
|
||||
p.From.Reg = condBits[ssa.Op(v.AuxInt)]
|
||||
p.From.Reg = condBits[v.Aux.(ssa.Op)]
|
||||
p.Reg = v.Args[0].Reg()
|
||||
p.SetFrom3(obj.Addr{Type: obj.TYPE_REG, Reg: r1})
|
||||
p.To.Type = obj.TYPE_REG
|
||||
@@ -943,8 +943,12 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
|
||||
p := s.Prog(obj.AGETCALLERPC)
|
||||
p.To.Type = obj.TYPE_REG
|
||||
p.To.Reg = v.Reg()
|
||||
case ssa.OpARM64FlagConstant:
|
||||
v.Fatalf("FlagConstant op should never make it to codegen %v", v.LongString())
|
||||
case ssa.OpARM64FlagEQ,
|
||||
ssa.OpARM64FlagLT_ULT,
|
||||
ssa.OpARM64FlagLT_UGT,
|
||||
ssa.OpARM64FlagGT_ULT,
|
||||
ssa.OpARM64FlagGT_UGT:
|
||||
v.Fatalf("Flag* ops should never make it to codegen %v", v.LongString())
|
||||
case ssa.OpARM64InvertFlags:
|
||||
v.Fatalf("InvertFlags should never make it to codegen %v", v.LongString())
|
||||
case ssa.OpClobber:
|
||||
@@ -974,40 +978,26 @@ var condBits = map[ssa.Op]int16{
|
||||
var blockJump = map[ssa.BlockKind]struct {
|
||||
asm, invasm obj.As
|
||||
}{
|
||||
ssa.BlockARM64EQ: {arm64.ABEQ, arm64.ABNE},
|
||||
ssa.BlockARM64NE: {arm64.ABNE, arm64.ABEQ},
|
||||
ssa.BlockARM64LT: {arm64.ABLT, arm64.ABGE},
|
||||
ssa.BlockARM64GE: {arm64.ABGE, arm64.ABLT},
|
||||
ssa.BlockARM64LE: {arm64.ABLE, arm64.ABGT},
|
||||
ssa.BlockARM64GT: {arm64.ABGT, arm64.ABLE},
|
||||
ssa.BlockARM64ULT: {arm64.ABLO, arm64.ABHS},
|
||||
ssa.BlockARM64UGE: {arm64.ABHS, arm64.ABLO},
|
||||
ssa.BlockARM64UGT: {arm64.ABHI, arm64.ABLS},
|
||||
ssa.BlockARM64ULE: {arm64.ABLS, arm64.ABHI},
|
||||
ssa.BlockARM64Z: {arm64.ACBZ, arm64.ACBNZ},
|
||||
ssa.BlockARM64NZ: {arm64.ACBNZ, arm64.ACBZ},
|
||||
ssa.BlockARM64ZW: {arm64.ACBZW, arm64.ACBNZW},
|
||||
ssa.BlockARM64NZW: {arm64.ACBNZW, arm64.ACBZW},
|
||||
ssa.BlockARM64TBZ: {arm64.ATBZ, arm64.ATBNZ},
|
||||
ssa.BlockARM64TBNZ: {arm64.ATBNZ, arm64.ATBZ},
|
||||
ssa.BlockARM64FLT: {arm64.ABMI, arm64.ABPL},
|
||||
ssa.BlockARM64FGE: {arm64.ABGE, arm64.ABLT},
|
||||
ssa.BlockARM64FLE: {arm64.ABLS, arm64.ABHI},
|
||||
ssa.BlockARM64FGT: {arm64.ABGT, arm64.ABLE},
|
||||
ssa.BlockARM64LTnoov: {arm64.ABMI, arm64.ABPL},
|
||||
ssa.BlockARM64GEnoov: {arm64.ABPL, arm64.ABMI},
|
||||
}
|
||||
|
||||
// To model a 'LEnoov' ('<=' without overflow checking) branching
|
||||
var leJumps = [2][2]gc.IndexJump{
|
||||
{{Jump: arm64.ABEQ, Index: 0}, {Jump: arm64.ABPL, Index: 1}}, // next == b.Succs[0]
|
||||
{{Jump: arm64.ABMI, Index: 0}, {Jump: arm64.ABEQ, Index: 0}}, // next == b.Succs[1]
|
||||
}
|
||||
|
||||
// To model a 'GTnoov' ('>' without overflow checking) branching
|
||||
var gtJumps = [2][2]gc.IndexJump{
|
||||
{{Jump: arm64.ABMI, Index: 1}, {Jump: arm64.ABEQ, Index: 1}}, // next == b.Succs[0]
|
||||
{{Jump: arm64.ABEQ, Index: 1}, {Jump: arm64.ABPL, Index: 0}}, // next == b.Succs[1]
|
||||
ssa.BlockARM64EQ: {arm64.ABEQ, arm64.ABNE},
|
||||
ssa.BlockARM64NE: {arm64.ABNE, arm64.ABEQ},
|
||||
ssa.BlockARM64LT: {arm64.ABLT, arm64.ABGE},
|
||||
ssa.BlockARM64GE: {arm64.ABGE, arm64.ABLT},
|
||||
ssa.BlockARM64LE: {arm64.ABLE, arm64.ABGT},
|
||||
ssa.BlockARM64GT: {arm64.ABGT, arm64.ABLE},
|
||||
ssa.BlockARM64ULT: {arm64.ABLO, arm64.ABHS},
|
||||
ssa.BlockARM64UGE: {arm64.ABHS, arm64.ABLO},
|
||||
ssa.BlockARM64UGT: {arm64.ABHI, arm64.ABLS},
|
||||
ssa.BlockARM64ULE: {arm64.ABLS, arm64.ABHI},
|
||||
ssa.BlockARM64Z: {arm64.ACBZ, arm64.ACBNZ},
|
||||
ssa.BlockARM64NZ: {arm64.ACBNZ, arm64.ACBZ},
|
||||
ssa.BlockARM64ZW: {arm64.ACBZW, arm64.ACBNZW},
|
||||
ssa.BlockARM64NZW: {arm64.ACBNZW, arm64.ACBZW},
|
||||
ssa.BlockARM64TBZ: {arm64.ATBZ, arm64.ATBNZ},
|
||||
ssa.BlockARM64TBNZ: {arm64.ATBNZ, arm64.ATBZ},
|
||||
ssa.BlockARM64FLT: {arm64.ABMI, arm64.ABPL},
|
||||
ssa.BlockARM64FGE: {arm64.ABGE, arm64.ABLT},
|
||||
ssa.BlockARM64FLE: {arm64.ABLS, arm64.ABHI},
|
||||
ssa.BlockARM64FGT: {arm64.ABGT, arm64.ABLE},
|
||||
}
|
||||
|
||||
func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
|
||||
@@ -1055,8 +1045,7 @@ func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
|
||||
ssa.BlockARM64Z, ssa.BlockARM64NZ,
|
||||
ssa.BlockARM64ZW, ssa.BlockARM64NZW,
|
||||
ssa.BlockARM64FLT, ssa.BlockARM64FGE,
|
||||
ssa.BlockARM64FLE, ssa.BlockARM64FGT,
|
||||
ssa.BlockARM64LTnoov, ssa.BlockARM64GEnoov:
|
||||
ssa.BlockARM64FLE, ssa.BlockARM64FGT:
|
||||
jmp := blockJump[b.Kind]
|
||||
var p *obj.Prog
|
||||
switch next {
|
||||
@@ -1094,14 +1083,10 @@ func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
|
||||
s.Br(obj.AJMP, b.Succs[0].Block())
|
||||
}
|
||||
}
|
||||
p.From.Offset = b.AuxInt
|
||||
p.From.Offset = b.Aux.(int64)
|
||||
p.From.Type = obj.TYPE_CONST
|
||||
p.Reg = b.Controls[0].Reg()
|
||||
|
||||
case ssa.BlockARM64LEnoov:
|
||||
s.CombJump(b, next, &leJumps)
|
||||
case ssa.BlockARM64GTnoov:
|
||||
s.CombJump(b, next, >Jumps)
|
||||
default:
|
||||
b.Fatalf("branch not implemented: %s", b.LongString())
|
||||
}
|
||||
|
||||
@@ -8,15 +8,12 @@ import (
|
||||
"cmd/compile/internal/types"
|
||||
"cmd/internal/obj"
|
||||
"fmt"
|
||||
"sort"
|
||||
)
|
||||
|
||||
// AlgKind describes the kind of algorithms used for comparing and
|
||||
// hashing a Type.
|
||||
type AlgKind int
|
||||
|
||||
//go:generate stringer -type AlgKind -trimprefix A
|
||||
|
||||
const (
|
||||
// These values are known by runtime.
|
||||
ANOEQ AlgKind = iota
|
||||
@@ -63,26 +60,6 @@ func IncomparableField(t *types.Type) *types.Field {
|
||||
return nil
|
||||
}
|
||||
|
||||
// EqCanPanic reports whether == on type t could panic (has an interface somewhere).
|
||||
// t must be comparable.
|
||||
func EqCanPanic(t *types.Type) bool {
|
||||
switch t.Etype {
|
||||
default:
|
||||
return false
|
||||
case TINTER:
|
||||
return true
|
||||
case TARRAY:
|
||||
return EqCanPanic(t.Elem())
|
||||
case TSTRUCT:
|
||||
for _, f := range t.FieldSlice() {
|
||||
if !f.Sym.IsBlank() && EqCanPanic(f.Type) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// algtype is like algtype1, except it returns the fixed-width AMEMxx variants
|
||||
// instead of the general AMEM kind when possible.
|
||||
func algtype(t *types.Type) AlgKind {
|
||||
@@ -429,7 +406,8 @@ func hashfor(t *types.Type) *Node {
|
||||
}
|
||||
|
||||
n := newname(sym)
|
||||
setNodeNameFunc(n)
|
||||
n.SetClass(PFUNC)
|
||||
n.Sym.SetFunc(true)
|
||||
n.Type = functype(nil, []*Node{
|
||||
anonfield(types.NewPtr(t)),
|
||||
anonfield(types.Types[TUINTPTR]),
|
||||
@@ -524,7 +502,7 @@ func geneq(t *types.Type) *obj.LSym {
|
||||
namedfield("p", types.NewPtr(t)),
|
||||
namedfield("q", types.NewPtr(t)),
|
||||
)
|
||||
tfn.Rlist.Set1(namedfield("r", types.Types[TBOOL]))
|
||||
tfn.Rlist.Set1(anonfield(types.Types[TBOOL]))
|
||||
|
||||
fn := dclfunc(sym, tfn)
|
||||
np := asNode(tfn.Type.Params().Field(0).Nname)
|
||||
@@ -538,118 +516,48 @@ func geneq(t *types.Type) *obj.LSym {
|
||||
Fatalf("geneq %v", t)
|
||||
|
||||
case TARRAY:
|
||||
nelem := t.NumElem()
|
||||
// An array of pure memory would be handled by the
|
||||
// standard memequal, so the element type must not be
|
||||
// pure memory. Even if we unrolled the range loop,
|
||||
// each iteration would be a function call, so don't bother
|
||||
// unrolling.
|
||||
nrange := nod(ORANGE, nil, nod(ODEREF, np, nil))
|
||||
|
||||
// checkAll generates code to check the equality of all array elements.
|
||||
// If unroll is greater than nelem, checkAll generates:
|
||||
//
|
||||
// if eq(p[0], q[0]) && eq(p[1], q[1]) && ... {
|
||||
// } else {
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// And so on.
|
||||
//
|
||||
// Otherwise it generates:
|
||||
//
|
||||
// for i := 0; i < nelem; i++ {
|
||||
// if eq(p[i], q[i]) {
|
||||
// } else {
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// TODO(josharian): consider doing some loop unrolling
|
||||
// for larger nelem as well, processing a few elements at a time in a loop.
|
||||
checkAll := func(unroll int64, eq func(pi, qi *Node) *Node) {
|
||||
// checkIdx generates a node to check for equality at index i.
|
||||
checkIdx := func(i *Node) *Node {
|
||||
// pi := p[i]
|
||||
pi := nod(OINDEX, np, i)
|
||||
pi.SetBounded(true)
|
||||
pi.Type = t.Elem()
|
||||
// qi := q[i]
|
||||
qi := nod(OINDEX, nq, i)
|
||||
qi.SetBounded(true)
|
||||
qi.Type = t.Elem()
|
||||
return eq(pi, qi)
|
||||
}
|
||||
ni := newname(lookup("i"))
|
||||
ni.Type = types.Types[TINT]
|
||||
nrange.List.Set1(ni)
|
||||
nrange.SetColas(true)
|
||||
colasdefn(nrange.List.Slice(), nrange)
|
||||
ni = nrange.List.First()
|
||||
|
||||
if nelem <= unroll {
|
||||
// Generate a series of checks.
|
||||
var cond *Node
|
||||
for i := int64(0); i < nelem; i++ {
|
||||
c := nodintconst(i)
|
||||
check := checkIdx(c)
|
||||
if cond == nil {
|
||||
cond = check
|
||||
continue
|
||||
}
|
||||
cond = nod(OANDAND, cond, check)
|
||||
}
|
||||
nif := nod(OIF, cond, nil)
|
||||
nif.Rlist.Append(nod(ORETURN, nil, nil))
|
||||
fn.Nbody.Append(nif)
|
||||
return
|
||||
}
|
||||
// if p[i] != q[i] { return false }
|
||||
nx := nod(OINDEX, np, ni)
|
||||
|
||||
// Generate a for loop.
|
||||
// for i := 0; i < nelem; i++
|
||||
i := temp(types.Types[TINT])
|
||||
init := nod(OAS, i, nodintconst(0))
|
||||
cond := nod(OLT, i, nodintconst(nelem))
|
||||
post := nod(OAS, i, nod(OADD, i, nodintconst(1)))
|
||||
loop := nod(OFOR, cond, post)
|
||||
loop.Ninit.Append(init)
|
||||
// if eq(pi, qi) {} else { return }
|
||||
check := checkIdx(i)
|
||||
nif := nod(OIF, check, nil)
|
||||
nif.Rlist.Append(nod(ORETURN, nil, nil))
|
||||
loop.Nbody.Append(nif)
|
||||
fn.Nbody.Append(loop)
|
||||
}
|
||||
nx.SetBounded(true)
|
||||
ny := nod(OINDEX, nq, ni)
|
||||
ny.SetBounded(true)
|
||||
|
||||
nif := nod(OIF, nil, nil)
|
||||
nif.Left = nod(ONE, nx, ny)
|
||||
r := nod(ORETURN, nil, nil)
|
||||
r.List.Append(nodbool(false))
|
||||
nif.Nbody.Append(r)
|
||||
nrange.Nbody.Append(nif)
|
||||
fn.Nbody.Append(nrange)
|
||||
|
||||
switch t.Elem().Etype {
|
||||
case TSTRING:
|
||||
// Do two loops. First, check that all the lengths match (cheap).
|
||||
// Second, check that all the contents match (expensive).
|
||||
// TODO: when the array size is small, unroll the length match checks.
|
||||
checkAll(3, func(pi, qi *Node) *Node {
|
||||
// Compare lengths.
|
||||
eqlen, _ := eqstring(pi, qi)
|
||||
return eqlen
|
||||
})
|
||||
checkAll(1, func(pi, qi *Node) *Node {
|
||||
// Compare contents.
|
||||
_, eqmem := eqstring(pi, qi)
|
||||
return eqmem
|
||||
})
|
||||
case TFLOAT32, TFLOAT64:
|
||||
checkAll(2, func(pi, qi *Node) *Node {
|
||||
// p[i] == q[i]
|
||||
return nod(OEQ, pi, qi)
|
||||
})
|
||||
// TODO: pick apart structs, do them piecemeal too
|
||||
default:
|
||||
checkAll(1, func(pi, qi *Node) *Node {
|
||||
// p[i] == q[i]
|
||||
return nod(OEQ, pi, qi)
|
||||
})
|
||||
}
|
||||
// return true
|
||||
ret := nod(ORETURN, nil, nil)
|
||||
ret.List.Append(nodbool(true))
|
||||
fn.Nbody.Append(ret)
|
||||
|
||||
case TSTRUCT:
|
||||
// Build a list of conditions to satisfy.
|
||||
// The conditions are a list-of-lists. Conditions are reorderable
|
||||
// within each inner list. The outer lists must be evaluated in order.
|
||||
var conds [][]*Node
|
||||
conds = append(conds, []*Node{})
|
||||
var cond *Node
|
||||
and := func(n *Node) {
|
||||
i := len(conds) - 1
|
||||
conds[i] = append(conds[i], n)
|
||||
if cond == nil {
|
||||
cond = n
|
||||
return
|
||||
}
|
||||
cond = nod(OANDAND, cond, n)
|
||||
}
|
||||
|
||||
// Walk the struct using memequal for runs of AMEM
|
||||
@@ -665,24 +573,7 @@ func geneq(t *types.Type) *obj.LSym {
|
||||
|
||||
// Compare non-memory fields with field equality.
|
||||
if !IsRegularMemory(f.Type) {
|
||||
if EqCanPanic(f.Type) {
|
||||
// Enforce ordering by starting a new set of reorderable conditions.
|
||||
conds = append(conds, []*Node{})
|
||||
}
|
||||
p := nodSym(OXDOT, np, f.Sym)
|
||||
q := nodSym(OXDOT, nq, f.Sym)
|
||||
switch {
|
||||
case f.Type.IsString():
|
||||
eqlen, eqmem := eqstring(p, q)
|
||||
and(eqlen)
|
||||
and(eqmem)
|
||||
default:
|
||||
and(nod(OEQ, p, q))
|
||||
}
|
||||
if EqCanPanic(f.Type) {
|
||||
// Also enforce ordering after something that can panic.
|
||||
conds = append(conds, []*Node{})
|
||||
}
|
||||
and(eqfield(np, nq, f.Sym))
|
||||
i++
|
||||
continue
|
||||
}
|
||||
@@ -704,27 +595,8 @@ func geneq(t *types.Type) *obj.LSym {
|
||||
i = next
|
||||
}
|
||||
|
||||
// Sort conditions to put runtime calls last.
|
||||
// Preserve the rest of the ordering.
|
||||
var flatConds []*Node
|
||||
for _, c := range conds {
|
||||
isCall := func(n *Node) bool {
|
||||
return n.Op == OCALL || n.Op == OCALLFUNC
|
||||
}
|
||||
sort.SliceStable(c, func(i, j int) bool {
|
||||
return !isCall(c[i]) && isCall(c[j])
|
||||
})
|
||||
flatConds = append(flatConds, c...)
|
||||
}
|
||||
|
||||
var cond *Node
|
||||
if len(flatConds) == 0 {
|
||||
if cond == nil {
|
||||
cond = nodbool(true)
|
||||
} else {
|
||||
cond = flatConds[0]
|
||||
for _, c := range flatConds[1:] {
|
||||
cond = nod(OANDAND, cond, c)
|
||||
}
|
||||
}
|
||||
|
||||
ret := nod(ORETURN, nil, nil)
|
||||
@@ -771,70 +643,6 @@ func eqfield(p *Node, q *Node, field *types.Sym) *Node {
|
||||
return ne
|
||||
}
|
||||
|
||||
// eqstring returns the nodes
|
||||
// len(s) == len(t)
|
||||
// and
|
||||
// memequal(s.ptr, t.ptr, len(s))
|
||||
// which can be used to construct string equality comparison.
|
||||
// eqlen must be evaluated before eqmem, and shortcircuiting is required.
|
||||
func eqstring(s, t *Node) (eqlen, eqmem *Node) {
|
||||
s = conv(s, types.Types[TSTRING])
|
||||
t = conv(t, types.Types[TSTRING])
|
||||
sptr := nod(OSPTR, s, nil)
|
||||
tptr := nod(OSPTR, t, nil)
|
||||
slen := conv(nod(OLEN, s, nil), types.Types[TUINTPTR])
|
||||
tlen := conv(nod(OLEN, t, nil), types.Types[TUINTPTR])
|
||||
|
||||
fn := syslook("memequal")
|
||||
fn = substArgTypes(fn, types.Types[TUINT8], types.Types[TUINT8])
|
||||
call := nod(OCALL, fn, nil)
|
||||
call.List.Append(sptr, tptr, slen.copy())
|
||||
call = typecheck(call, ctxExpr|ctxMultiOK)
|
||||
|
||||
cmp := nod(OEQ, slen, tlen)
|
||||
cmp = typecheck(cmp, ctxExpr)
|
||||
cmp.Type = types.Types[TBOOL]
|
||||
return cmp, call
|
||||
}
|
||||
|
||||
// eqinterface returns the nodes
|
||||
// s.tab == t.tab (or s.typ == t.typ, as appropriate)
|
||||
// and
|
||||
// ifaceeq(s.tab, s.data, t.data) (or efaceeq(s.typ, s.data, t.data), as appropriate)
|
||||
// which can be used to construct interface equality comparison.
|
||||
// eqtab must be evaluated before eqdata, and shortcircuiting is required.
|
||||
func eqinterface(s, t *Node) (eqtab, eqdata *Node) {
|
||||
if !types.Identical(s.Type, t.Type) {
|
||||
Fatalf("eqinterface %v %v", s.Type, t.Type)
|
||||
}
|
||||
// func ifaceeq(tab *uintptr, x, y unsafe.Pointer) (ret bool)
|
||||
// func efaceeq(typ *uintptr, x, y unsafe.Pointer) (ret bool)
|
||||
var fn *Node
|
||||
if s.Type.IsEmptyInterface() {
|
||||
fn = syslook("efaceeq")
|
||||
} else {
|
||||
fn = syslook("ifaceeq")
|
||||
}
|
||||
|
||||
stab := nod(OITAB, s, nil)
|
||||
ttab := nod(OITAB, t, nil)
|
||||
sdata := nod(OIDATA, s, nil)
|
||||
tdata := nod(OIDATA, t, nil)
|
||||
sdata.Type = types.Types[TUNSAFEPTR]
|
||||
tdata.Type = types.Types[TUNSAFEPTR]
|
||||
sdata.SetTypecheck(1)
|
||||
tdata.SetTypecheck(1)
|
||||
|
||||
call := nod(OCALL, fn, nil)
|
||||
call.List.Append(stab, sdata, tdata)
|
||||
call = typecheck(call, ctxExpr|ctxMultiOK)
|
||||
|
||||
cmp := nod(OEQ, stab, ttab)
|
||||
cmp = typecheck(cmp, ctxExpr)
|
||||
cmp.Type = types.Types[TBOOL]
|
||||
return cmp, call
|
||||
}
|
||||
|
||||
// eqmem returns the node
|
||||
// memequal(&p.field, &q.field [, size])
|
||||
func eqmem(p *Node, q *Node, field *types.Sym, size int64) *Node {
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
// Code generated by "stringer -type AlgKind -trimprefix A"; DO NOT EDIT.
|
||||
|
||||
package gc
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[ANOEQ-0]
|
||||
_ = x[AMEM0-1]
|
||||
_ = x[AMEM8-2]
|
||||
_ = x[AMEM16-3]
|
||||
_ = x[AMEM32-4]
|
||||
_ = x[AMEM64-5]
|
||||
_ = x[AMEM128-6]
|
||||
_ = x[ASTRING-7]
|
||||
_ = x[AINTER-8]
|
||||
_ = x[ANILINTER-9]
|
||||
_ = x[AFLOAT32-10]
|
||||
_ = x[AFLOAT64-11]
|
||||
_ = x[ACPLX64-12]
|
||||
_ = x[ACPLX128-13]
|
||||
_ = x[AMEM-100]
|
||||
_ = x[ASPECIAL - -1]
|
||||
}
|
||||
|
||||
const (
|
||||
_AlgKind_name_0 = "SPECIALNOEQMEM0MEM8MEM16MEM32MEM64MEM128STRINGINTERNILINTERFLOAT32FLOAT64CPLX64CPLX128"
|
||||
_AlgKind_name_1 = "MEM"
|
||||
)
|
||||
|
||||
var (
|
||||
_AlgKind_index_0 = [...]uint8{0, 7, 11, 15, 19, 24, 29, 34, 40, 46, 51, 59, 66, 73, 79, 86}
|
||||
)
|
||||
|
||||
func (i AlgKind) String() string {
|
||||
switch {
|
||||
case -1 <= i && i <= 13:
|
||||
i -= -1
|
||||
return _AlgKind_name_0[_AlgKind_index_0[i]:_AlgKind_index_0[i+1]]
|
||||
case i == 100:
|
||||
return _AlgKind_name_1
|
||||
default:
|
||||
return "AlgKind(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
}
|
||||
@@ -319,10 +319,10 @@ func dowidth(t *types.Type) {
|
||||
Fatalf("dowidth any")
|
||||
|
||||
case TSTRING:
|
||||
if sizeofString == 0 {
|
||||
if sizeof_String == 0 {
|
||||
Fatalf("early dowidth string")
|
||||
}
|
||||
w = sizeofString
|
||||
w = int64(sizeof_String)
|
||||
t.Align = uint8(Widthptr)
|
||||
|
||||
case TARRAY:
|
||||
@@ -344,7 +344,7 @@ func dowidth(t *types.Type) {
|
||||
if t.Elem() == nil {
|
||||
break
|
||||
}
|
||||
w = sizeofSlice
|
||||
w = int64(sizeof_Slice)
|
||||
checkwidth(t.Elem())
|
||||
t.Align = uint8(Widthptr)
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package gc
|
||||
|
||||
import "testing"
|
||||
|
||||
var globl int64
|
||||
|
||||
func BenchmarkLoadAdd(b *testing.B) {
|
||||
x := make([]int64, 1024)
|
||||
y := make([]int64, 1024)
|
||||
for i := 0; i < b.N; i++ {
|
||||
var s int64
|
||||
for i := range x {
|
||||
s ^= x[i] + y[i]
|
||||
}
|
||||
globl = s
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkModify(b *testing.B) {
|
||||
a := make([]int64, 1024)
|
||||
v := globl
|
||||
for i := 0; i < b.N; i++ {
|
||||
for j := range a {
|
||||
a[j] += v
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkConstModify(b *testing.B) {
|
||||
a := make([]int64, 1024)
|
||||
for i := 0; i < b.N; i++ {
|
||||
for j := range a {
|
||||
a[j] += 3
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,330 +10,324 @@ var runtimeDecls = [...]struct {
|
||||
typ int
|
||||
}{
|
||||
{"newobject", funcTag, 4},
|
||||
{"mallocgc", funcTag, 8},
|
||||
{"panicdivide", funcTag, 9},
|
||||
{"panicshift", funcTag, 9},
|
||||
{"panicmakeslicelen", funcTag, 9},
|
||||
{"panicmakeslicecap", funcTag, 9},
|
||||
{"throwinit", funcTag, 9},
|
||||
{"panicwrap", funcTag, 9},
|
||||
{"gopanic", funcTag, 11},
|
||||
{"gorecover", funcTag, 14},
|
||||
{"goschedguarded", funcTag, 9},
|
||||
{"goPanicIndex", funcTag, 16},
|
||||
{"goPanicIndexU", funcTag, 18},
|
||||
{"goPanicSliceAlen", funcTag, 16},
|
||||
{"goPanicSliceAlenU", funcTag, 18},
|
||||
{"goPanicSliceAcap", funcTag, 16},
|
||||
{"goPanicSliceAcapU", funcTag, 18},
|
||||
{"goPanicSliceB", funcTag, 16},
|
||||
{"goPanicSliceBU", funcTag, 18},
|
||||
{"goPanicSlice3Alen", funcTag, 16},
|
||||
{"goPanicSlice3AlenU", funcTag, 18},
|
||||
{"goPanicSlice3Acap", funcTag, 16},
|
||||
{"goPanicSlice3AcapU", funcTag, 18},
|
||||
{"goPanicSlice3B", funcTag, 16},
|
||||
{"goPanicSlice3BU", funcTag, 18},
|
||||
{"goPanicSlice3C", funcTag, 16},
|
||||
{"goPanicSlice3CU", funcTag, 18},
|
||||
{"printbool", funcTag, 19},
|
||||
{"printfloat", funcTag, 21},
|
||||
{"printint", funcTag, 23},
|
||||
{"printhex", funcTag, 25},
|
||||
{"printuint", funcTag, 25},
|
||||
{"printcomplex", funcTag, 27},
|
||||
{"printstring", funcTag, 29},
|
||||
{"printpointer", funcTag, 30},
|
||||
{"printiface", funcTag, 30},
|
||||
{"printeface", funcTag, 30},
|
||||
{"printslice", funcTag, 30},
|
||||
{"printnl", funcTag, 9},
|
||||
{"printsp", funcTag, 9},
|
||||
{"printlock", funcTag, 9},
|
||||
{"printunlock", funcTag, 9},
|
||||
{"concatstring2", funcTag, 33},
|
||||
{"concatstring3", funcTag, 34},
|
||||
{"concatstring4", funcTag, 35},
|
||||
{"concatstring5", funcTag, 36},
|
||||
{"concatstrings", funcTag, 38},
|
||||
{"cmpstring", funcTag, 39},
|
||||
{"intstring", funcTag, 42},
|
||||
{"slicebytetostring", funcTag, 43},
|
||||
{"slicebytetostringtmp", funcTag, 44},
|
||||
{"slicerunetostring", funcTag, 47},
|
||||
{"stringtoslicebyte", funcTag, 49},
|
||||
{"stringtoslicerune", funcTag, 52},
|
||||
{"slicecopy", funcTag, 53},
|
||||
{"slicestringcopy", funcTag, 54},
|
||||
{"decoderune", funcTag, 55},
|
||||
{"countrunes", funcTag, 56},
|
||||
{"convI2I", funcTag, 57},
|
||||
{"convT16", funcTag, 58},
|
||||
{"convT32", funcTag, 58},
|
||||
{"convT64", funcTag, 58},
|
||||
{"convTstring", funcTag, 58},
|
||||
{"convTslice", funcTag, 58},
|
||||
{"convT2E", funcTag, 59},
|
||||
{"convT2Enoptr", funcTag, 59},
|
||||
{"convT2I", funcTag, 59},
|
||||
{"convT2Inoptr", funcTag, 59},
|
||||
{"assertE2I", funcTag, 57},
|
||||
{"assertE2I2", funcTag, 60},
|
||||
{"assertI2I", funcTag, 57},
|
||||
{"assertI2I2", funcTag, 60},
|
||||
{"panicdottypeE", funcTag, 61},
|
||||
{"panicdottypeI", funcTag, 61},
|
||||
{"panicnildottype", funcTag, 62},
|
||||
{"ifaceeq", funcTag, 64},
|
||||
{"efaceeq", funcTag, 64},
|
||||
{"fastrand", funcTag, 66},
|
||||
{"makemap64", funcTag, 68},
|
||||
{"makemap", funcTag, 69},
|
||||
{"makemap_small", funcTag, 70},
|
||||
{"mapaccess1", funcTag, 71},
|
||||
{"mapaccess1_fast32", funcTag, 72},
|
||||
{"mapaccess1_fast64", funcTag, 72},
|
||||
{"mapaccess1_faststr", funcTag, 72},
|
||||
{"mapaccess1_fat", funcTag, 73},
|
||||
{"mapaccess2", funcTag, 74},
|
||||
{"mapaccess2_fast32", funcTag, 75},
|
||||
{"mapaccess2_fast64", funcTag, 75},
|
||||
{"mapaccess2_faststr", funcTag, 75},
|
||||
{"mapaccess2_fat", funcTag, 76},
|
||||
{"mapassign", funcTag, 71},
|
||||
{"mapassign_fast32", funcTag, 72},
|
||||
{"mapassign_fast32ptr", funcTag, 72},
|
||||
{"mapassign_fast64", funcTag, 72},
|
||||
{"mapassign_fast64ptr", funcTag, 72},
|
||||
{"mapassign_faststr", funcTag, 72},
|
||||
{"mapiterinit", funcTag, 77},
|
||||
{"mapdelete", funcTag, 77},
|
||||
{"mapdelete_fast32", funcTag, 78},
|
||||
{"mapdelete_fast64", funcTag, 78},
|
||||
{"mapdelete_faststr", funcTag, 78},
|
||||
{"mapiternext", funcTag, 79},
|
||||
{"mapclear", funcTag, 80},
|
||||
{"makechan64", funcTag, 82},
|
||||
{"makechan", funcTag, 83},
|
||||
{"chanrecv1", funcTag, 85},
|
||||
{"chanrecv2", funcTag, 86},
|
||||
{"chansend1", funcTag, 88},
|
||||
{"closechan", funcTag, 30},
|
||||
{"writeBarrier", varTag, 90},
|
||||
{"typedmemmove", funcTag, 91},
|
||||
{"typedmemclr", funcTag, 92},
|
||||
{"typedslicecopy", funcTag, 93},
|
||||
{"selectnbsend", funcTag, 94},
|
||||
{"selectnbrecv", funcTag, 95},
|
||||
{"selectnbrecv2", funcTag, 97},
|
||||
{"selectsetpc", funcTag, 98},
|
||||
{"selectgo", funcTag, 99},
|
||||
{"block", funcTag, 9},
|
||||
{"makeslice", funcTag, 100},
|
||||
{"makeslice64", funcTag, 101},
|
||||
{"makeslicecopy", funcTag, 102},
|
||||
{"growslice", funcTag, 104},
|
||||
{"memmove", funcTag, 105},
|
||||
{"memclrNoHeapPointers", funcTag, 106},
|
||||
{"memclrHasPointers", funcTag, 106},
|
||||
{"memequal", funcTag, 107},
|
||||
{"memequal0", funcTag, 108},
|
||||
{"memequal8", funcTag, 108},
|
||||
{"memequal16", funcTag, 108},
|
||||
{"memequal32", funcTag, 108},
|
||||
{"memequal64", funcTag, 108},
|
||||
{"memequal128", funcTag, 108},
|
||||
{"f32equal", funcTag, 109},
|
||||
{"f64equal", funcTag, 109},
|
||||
{"c64equal", funcTag, 109},
|
||||
{"c128equal", funcTag, 109},
|
||||
{"strequal", funcTag, 109},
|
||||
{"interequal", funcTag, 109},
|
||||
{"nilinterequal", funcTag, 109},
|
||||
{"memhash", funcTag, 110},
|
||||
{"memhash0", funcTag, 111},
|
||||
{"memhash8", funcTag, 111},
|
||||
{"memhash16", funcTag, 111},
|
||||
{"memhash32", funcTag, 111},
|
||||
{"memhash64", funcTag, 111},
|
||||
{"memhash128", funcTag, 111},
|
||||
{"f32hash", funcTag, 111},
|
||||
{"f64hash", funcTag, 111},
|
||||
{"c64hash", funcTag, 111},
|
||||
{"c128hash", funcTag, 111},
|
||||
{"strhash", funcTag, 111},
|
||||
{"interhash", funcTag, 111},
|
||||
{"nilinterhash", funcTag, 111},
|
||||
{"int64div", funcTag, 112},
|
||||
{"uint64div", funcTag, 113},
|
||||
{"int64mod", funcTag, 112},
|
||||
{"uint64mod", funcTag, 113},
|
||||
{"float64toint64", funcTag, 114},
|
||||
{"float64touint64", funcTag, 115},
|
||||
{"float64touint32", funcTag, 116},
|
||||
{"int64tofloat64", funcTag, 117},
|
||||
{"uint64tofloat64", funcTag, 118},
|
||||
{"uint32tofloat64", funcTag, 119},
|
||||
{"complex128div", funcTag, 120},
|
||||
{"racefuncenter", funcTag, 121},
|
||||
{"racefuncenterfp", funcTag, 9},
|
||||
{"racefuncexit", funcTag, 9},
|
||||
{"raceread", funcTag, 121},
|
||||
{"racewrite", funcTag, 121},
|
||||
{"racereadrange", funcTag, 122},
|
||||
{"racewriterange", funcTag, 122},
|
||||
{"msanread", funcTag, 122},
|
||||
{"msanwrite", funcTag, 122},
|
||||
{"checkptrAlignment", funcTag, 123},
|
||||
{"checkptrArithmetic", funcTag, 125},
|
||||
{"libfuzzerTraceCmp1", funcTag, 127},
|
||||
{"libfuzzerTraceCmp2", funcTag, 129},
|
||||
{"libfuzzerTraceCmp4", funcTag, 130},
|
||||
{"libfuzzerTraceCmp8", funcTag, 131},
|
||||
{"libfuzzerTraceConstCmp1", funcTag, 127},
|
||||
{"libfuzzerTraceConstCmp2", funcTag, 129},
|
||||
{"libfuzzerTraceConstCmp4", funcTag, 130},
|
||||
{"libfuzzerTraceConstCmp8", funcTag, 131},
|
||||
{"x86HasPOPCNT", varTag, 6},
|
||||
{"x86HasSSE41", varTag, 6},
|
||||
{"x86HasFMA", varTag, 6},
|
||||
{"armHasVFPv4", varTag, 6},
|
||||
{"arm64HasATOMICS", varTag, 6},
|
||||
{"panicdivide", funcTag, 5},
|
||||
{"panicshift", funcTag, 5},
|
||||
{"panicmakeslicelen", funcTag, 5},
|
||||
{"throwinit", funcTag, 5},
|
||||
{"panicwrap", funcTag, 5},
|
||||
{"gopanic", funcTag, 7},
|
||||
{"gorecover", funcTag, 10},
|
||||
{"goschedguarded", funcTag, 5},
|
||||
{"goPanicIndex", funcTag, 12},
|
||||
{"goPanicIndexU", funcTag, 14},
|
||||
{"goPanicSliceAlen", funcTag, 12},
|
||||
{"goPanicSliceAlenU", funcTag, 14},
|
||||
{"goPanicSliceAcap", funcTag, 12},
|
||||
{"goPanicSliceAcapU", funcTag, 14},
|
||||
{"goPanicSliceB", funcTag, 12},
|
||||
{"goPanicSliceBU", funcTag, 14},
|
||||
{"goPanicSlice3Alen", funcTag, 12},
|
||||
{"goPanicSlice3AlenU", funcTag, 14},
|
||||
{"goPanicSlice3Acap", funcTag, 12},
|
||||
{"goPanicSlice3AcapU", funcTag, 14},
|
||||
{"goPanicSlice3B", funcTag, 12},
|
||||
{"goPanicSlice3BU", funcTag, 14},
|
||||
{"goPanicSlice3C", funcTag, 12},
|
||||
{"goPanicSlice3CU", funcTag, 14},
|
||||
{"printbool", funcTag, 16},
|
||||
{"printfloat", funcTag, 18},
|
||||
{"printint", funcTag, 20},
|
||||
{"printhex", funcTag, 22},
|
||||
{"printuint", funcTag, 22},
|
||||
{"printcomplex", funcTag, 24},
|
||||
{"printstring", funcTag, 26},
|
||||
{"printpointer", funcTag, 27},
|
||||
{"printiface", funcTag, 27},
|
||||
{"printeface", funcTag, 27},
|
||||
{"printslice", funcTag, 27},
|
||||
{"printnl", funcTag, 5},
|
||||
{"printsp", funcTag, 5},
|
||||
{"printlock", funcTag, 5},
|
||||
{"printunlock", funcTag, 5},
|
||||
{"concatstring2", funcTag, 30},
|
||||
{"concatstring3", funcTag, 31},
|
||||
{"concatstring4", funcTag, 32},
|
||||
{"concatstring5", funcTag, 33},
|
||||
{"concatstrings", funcTag, 35},
|
||||
{"cmpstring", funcTag, 36},
|
||||
{"intstring", funcTag, 39},
|
||||
{"slicebytetostring", funcTag, 41},
|
||||
{"slicebytetostringtmp", funcTag, 42},
|
||||
{"slicerunetostring", funcTag, 45},
|
||||
{"stringtoslicebyte", funcTag, 46},
|
||||
{"stringtoslicerune", funcTag, 49},
|
||||
{"slicecopy", funcTag, 51},
|
||||
{"slicestringcopy", funcTag, 52},
|
||||
{"decoderune", funcTag, 53},
|
||||
{"countrunes", funcTag, 54},
|
||||
{"convI2I", funcTag, 55},
|
||||
{"convT16", funcTag, 57},
|
||||
{"convT32", funcTag, 57},
|
||||
{"convT64", funcTag, 57},
|
||||
{"convTstring", funcTag, 57},
|
||||
{"convTslice", funcTag, 57},
|
||||
{"convT2E", funcTag, 58},
|
||||
{"convT2Enoptr", funcTag, 58},
|
||||
{"convT2I", funcTag, 58},
|
||||
{"convT2Inoptr", funcTag, 58},
|
||||
{"assertE2I", funcTag, 55},
|
||||
{"assertE2I2", funcTag, 59},
|
||||
{"assertI2I", funcTag, 55},
|
||||
{"assertI2I2", funcTag, 59},
|
||||
{"panicdottypeE", funcTag, 60},
|
||||
{"panicdottypeI", funcTag, 60},
|
||||
{"panicnildottype", funcTag, 61},
|
||||
{"ifaceeq", funcTag, 63},
|
||||
{"efaceeq", funcTag, 63},
|
||||
{"fastrand", funcTag, 65},
|
||||
{"makemap64", funcTag, 67},
|
||||
{"makemap", funcTag, 68},
|
||||
{"makemap_small", funcTag, 69},
|
||||
{"mapaccess1", funcTag, 70},
|
||||
{"mapaccess1_fast32", funcTag, 71},
|
||||
{"mapaccess1_fast64", funcTag, 71},
|
||||
{"mapaccess1_faststr", funcTag, 71},
|
||||
{"mapaccess1_fat", funcTag, 72},
|
||||
{"mapaccess2", funcTag, 73},
|
||||
{"mapaccess2_fast32", funcTag, 74},
|
||||
{"mapaccess2_fast64", funcTag, 74},
|
||||
{"mapaccess2_faststr", funcTag, 74},
|
||||
{"mapaccess2_fat", funcTag, 75},
|
||||
{"mapassign", funcTag, 70},
|
||||
{"mapassign_fast32", funcTag, 71},
|
||||
{"mapassign_fast32ptr", funcTag, 71},
|
||||
{"mapassign_fast64", funcTag, 71},
|
||||
{"mapassign_fast64ptr", funcTag, 71},
|
||||
{"mapassign_faststr", funcTag, 71},
|
||||
{"mapiterinit", funcTag, 76},
|
||||
{"mapdelete", funcTag, 76},
|
||||
{"mapdelete_fast32", funcTag, 77},
|
||||
{"mapdelete_fast64", funcTag, 77},
|
||||
{"mapdelete_faststr", funcTag, 77},
|
||||
{"mapiternext", funcTag, 78},
|
||||
{"mapclear", funcTag, 79},
|
||||
{"makechan64", funcTag, 81},
|
||||
{"makechan", funcTag, 82},
|
||||
{"chanrecv1", funcTag, 84},
|
||||
{"chanrecv2", funcTag, 85},
|
||||
{"chansend1", funcTag, 87},
|
||||
{"closechan", funcTag, 27},
|
||||
{"writeBarrier", varTag, 89},
|
||||
{"typedmemmove", funcTag, 90},
|
||||
{"typedmemclr", funcTag, 91},
|
||||
{"typedslicecopy", funcTag, 92},
|
||||
{"selectnbsend", funcTag, 93},
|
||||
{"selectnbrecv", funcTag, 94},
|
||||
{"selectnbrecv2", funcTag, 96},
|
||||
{"selectsetpc", funcTag, 61},
|
||||
{"selectgo", funcTag, 97},
|
||||
{"block", funcTag, 5},
|
||||
{"makeslice", funcTag, 98},
|
||||
{"makeslice64", funcTag, 99},
|
||||
{"growslice", funcTag, 101},
|
||||
{"memmove", funcTag, 102},
|
||||
{"memclrNoHeapPointers", funcTag, 103},
|
||||
{"memclrHasPointers", funcTag, 103},
|
||||
{"memequal", funcTag, 104},
|
||||
{"memequal0", funcTag, 105},
|
||||
{"memequal8", funcTag, 105},
|
||||
{"memequal16", funcTag, 105},
|
||||
{"memequal32", funcTag, 105},
|
||||
{"memequal64", funcTag, 105},
|
||||
{"memequal128", funcTag, 105},
|
||||
{"f32equal", funcTag, 106},
|
||||
{"f64equal", funcTag, 106},
|
||||
{"c64equal", funcTag, 106},
|
||||
{"c128equal", funcTag, 106},
|
||||
{"strequal", funcTag, 106},
|
||||
{"interequal", funcTag, 106},
|
||||
{"nilinterequal", funcTag, 106},
|
||||
{"memhash", funcTag, 107},
|
||||
{"memhash0", funcTag, 108},
|
||||
{"memhash8", funcTag, 108},
|
||||
{"memhash16", funcTag, 108},
|
||||
{"memhash32", funcTag, 108},
|
||||
{"memhash64", funcTag, 108},
|
||||
{"memhash128", funcTag, 108},
|
||||
{"f32hash", funcTag, 108},
|
||||
{"f64hash", funcTag, 108},
|
||||
{"c64hash", funcTag, 108},
|
||||
{"c128hash", funcTag, 108},
|
||||
{"strhash", funcTag, 108},
|
||||
{"interhash", funcTag, 108},
|
||||
{"nilinterhash", funcTag, 108},
|
||||
{"int64div", funcTag, 109},
|
||||
{"uint64div", funcTag, 110},
|
||||
{"int64mod", funcTag, 109},
|
||||
{"uint64mod", funcTag, 110},
|
||||
{"float64toint64", funcTag, 111},
|
||||
{"float64touint64", funcTag, 112},
|
||||
{"float64touint32", funcTag, 113},
|
||||
{"int64tofloat64", funcTag, 114},
|
||||
{"uint64tofloat64", funcTag, 115},
|
||||
{"uint32tofloat64", funcTag, 116},
|
||||
{"complex128div", funcTag, 117},
|
||||
{"racefuncenter", funcTag, 118},
|
||||
{"racefuncenterfp", funcTag, 5},
|
||||
{"racefuncexit", funcTag, 5},
|
||||
{"raceread", funcTag, 118},
|
||||
{"racewrite", funcTag, 118},
|
||||
{"racereadrange", funcTag, 119},
|
||||
{"racewriterange", funcTag, 119},
|
||||
{"msanread", funcTag, 119},
|
||||
{"msanwrite", funcTag, 119},
|
||||
{"checkptrAlignment", funcTag, 120},
|
||||
{"checkptrArithmetic", funcTag, 122},
|
||||
{"libfuzzerTraceCmp1", funcTag, 124},
|
||||
{"libfuzzerTraceCmp2", funcTag, 126},
|
||||
{"libfuzzerTraceCmp4", funcTag, 127},
|
||||
{"libfuzzerTraceCmp8", funcTag, 128},
|
||||
{"libfuzzerTraceConstCmp1", funcTag, 124},
|
||||
{"libfuzzerTraceConstCmp2", funcTag, 126},
|
||||
{"libfuzzerTraceConstCmp4", funcTag, 127},
|
||||
{"libfuzzerTraceConstCmp8", funcTag, 128},
|
||||
{"x86HasPOPCNT", varTag, 15},
|
||||
{"x86HasSSE41", varTag, 15},
|
||||
{"x86HasFMA", varTag, 15},
|
||||
{"armHasVFPv4", varTag, 15},
|
||||
{"arm64HasATOMICS", varTag, 15},
|
||||
}
|
||||
|
||||
func runtimeTypes() []*types.Type {
|
||||
var typs [132]*types.Type
|
||||
var typs [129]*types.Type
|
||||
typs[0] = types.Bytetype
|
||||
typs[1] = types.NewPtr(typs[0])
|
||||
typs[2] = types.Types[TANY]
|
||||
typs[3] = types.NewPtr(typs[2])
|
||||
typs[4] = functype(nil, []*Node{anonfield(typs[1])}, []*Node{anonfield(typs[3])})
|
||||
typs[5] = types.Types[TUINTPTR]
|
||||
typs[6] = types.Types[TBOOL]
|
||||
typs[7] = types.Types[TUNSAFEPTR]
|
||||
typs[8] = functype(nil, []*Node{anonfield(typs[5]), anonfield(typs[1]), anonfield(typs[6])}, []*Node{anonfield(typs[7])})
|
||||
typs[9] = functype(nil, nil, nil)
|
||||
typs[10] = types.Types[TINTER]
|
||||
typs[11] = functype(nil, []*Node{anonfield(typs[10])}, nil)
|
||||
typs[12] = types.Types[TINT32]
|
||||
typs[13] = types.NewPtr(typs[12])
|
||||
typs[14] = functype(nil, []*Node{anonfield(typs[13])}, []*Node{anonfield(typs[10])})
|
||||
typs[15] = types.Types[TINT]
|
||||
typs[16] = functype(nil, []*Node{anonfield(typs[15]), anonfield(typs[15])}, nil)
|
||||
typs[17] = types.Types[TUINT]
|
||||
typs[18] = functype(nil, []*Node{anonfield(typs[17]), anonfield(typs[15])}, nil)
|
||||
typs[19] = functype(nil, []*Node{anonfield(typs[6])}, nil)
|
||||
typs[20] = types.Types[TFLOAT64]
|
||||
typs[21] = functype(nil, []*Node{anonfield(typs[20])}, nil)
|
||||
typs[22] = types.Types[TINT64]
|
||||
typs[23] = functype(nil, []*Node{anonfield(typs[22])}, nil)
|
||||
typs[24] = types.Types[TUINT64]
|
||||
typs[25] = functype(nil, []*Node{anonfield(typs[24])}, nil)
|
||||
typs[26] = types.Types[TCOMPLEX128]
|
||||
typs[27] = functype(nil, []*Node{anonfield(typs[26])}, nil)
|
||||
typs[28] = types.Types[TSTRING]
|
||||
typs[29] = functype(nil, []*Node{anonfield(typs[28])}, nil)
|
||||
typs[30] = functype(nil, []*Node{anonfield(typs[2])}, nil)
|
||||
typs[31] = types.NewArray(typs[0], 32)
|
||||
typs[32] = types.NewPtr(typs[31])
|
||||
typs[33] = functype(nil, []*Node{anonfield(typs[32]), anonfield(typs[28]), anonfield(typs[28])}, []*Node{anonfield(typs[28])})
|
||||
typs[34] = functype(nil, []*Node{anonfield(typs[32]), anonfield(typs[28]), anonfield(typs[28]), anonfield(typs[28])}, []*Node{anonfield(typs[28])})
|
||||
typs[35] = functype(nil, []*Node{anonfield(typs[32]), anonfield(typs[28]), anonfield(typs[28]), anonfield(typs[28]), anonfield(typs[28])}, []*Node{anonfield(typs[28])})
|
||||
typs[36] = functype(nil, []*Node{anonfield(typs[32]), anonfield(typs[28]), anonfield(typs[28]), anonfield(typs[28]), anonfield(typs[28]), anonfield(typs[28])}, []*Node{anonfield(typs[28])})
|
||||
typs[37] = types.NewSlice(typs[28])
|
||||
typs[38] = functype(nil, []*Node{anonfield(typs[32]), anonfield(typs[37])}, []*Node{anonfield(typs[28])})
|
||||
typs[39] = functype(nil, []*Node{anonfield(typs[28]), anonfield(typs[28])}, []*Node{anonfield(typs[15])})
|
||||
typs[40] = types.NewArray(typs[0], 4)
|
||||
typs[41] = types.NewPtr(typs[40])
|
||||
typs[42] = functype(nil, []*Node{anonfield(typs[41]), anonfield(typs[22])}, []*Node{anonfield(typs[28])})
|
||||
typs[43] = functype(nil, []*Node{anonfield(typs[32]), anonfield(typs[1]), anonfield(typs[15])}, []*Node{anonfield(typs[28])})
|
||||
typs[44] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[15])}, []*Node{anonfield(typs[28])})
|
||||
typs[45] = types.Runetype
|
||||
typs[46] = types.NewSlice(typs[45])
|
||||
typs[47] = functype(nil, []*Node{anonfield(typs[32]), anonfield(typs[46])}, []*Node{anonfield(typs[28])})
|
||||
typs[48] = types.NewSlice(typs[0])
|
||||
typs[49] = functype(nil, []*Node{anonfield(typs[32]), anonfield(typs[28])}, []*Node{anonfield(typs[48])})
|
||||
typs[50] = types.NewArray(typs[45], 32)
|
||||
typs[51] = types.NewPtr(typs[50])
|
||||
typs[52] = functype(nil, []*Node{anonfield(typs[51]), anonfield(typs[28])}, []*Node{anonfield(typs[46])})
|
||||
typs[53] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[15]), anonfield(typs[3]), anonfield(typs[15]), anonfield(typs[5])}, []*Node{anonfield(typs[15])})
|
||||
typs[54] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[15]), anonfield(typs[28])}, []*Node{anonfield(typs[15])})
|
||||
typs[55] = functype(nil, []*Node{anonfield(typs[28]), anonfield(typs[15])}, []*Node{anonfield(typs[45]), anonfield(typs[15])})
|
||||
typs[56] = functype(nil, []*Node{anonfield(typs[28])}, []*Node{anonfield(typs[15])})
|
||||
typs[57] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[2])}, []*Node{anonfield(typs[2])})
|
||||
typs[58] = functype(nil, []*Node{anonfield(typs[2])}, []*Node{anonfield(typs[7])})
|
||||
typs[59] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[3])}, []*Node{anonfield(typs[2])})
|
||||
typs[60] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[2])}, []*Node{anonfield(typs[2]), anonfield(typs[6])})
|
||||
typs[61] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[1]), anonfield(typs[1])}, nil)
|
||||
typs[62] = functype(nil, []*Node{anonfield(typs[1])}, nil)
|
||||
typs[63] = types.NewPtr(typs[5])
|
||||
typs[64] = functype(nil, []*Node{anonfield(typs[63]), anonfield(typs[7]), anonfield(typs[7])}, []*Node{anonfield(typs[6])})
|
||||
typs[65] = types.Types[TUINT32]
|
||||
typs[66] = functype(nil, nil, []*Node{anonfield(typs[65])})
|
||||
typs[67] = types.NewMap(typs[2], typs[2])
|
||||
typs[68] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[22]), anonfield(typs[3])}, []*Node{anonfield(typs[67])})
|
||||
typs[69] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[15]), anonfield(typs[3])}, []*Node{anonfield(typs[67])})
|
||||
typs[70] = functype(nil, nil, []*Node{anonfield(typs[67])})
|
||||
typs[71] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[67]), anonfield(typs[3])}, []*Node{anonfield(typs[3])})
|
||||
typs[72] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[67]), anonfield(typs[2])}, []*Node{anonfield(typs[3])})
|
||||
typs[73] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[67]), anonfield(typs[3]), anonfield(typs[1])}, []*Node{anonfield(typs[3])})
|
||||
typs[74] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[67]), anonfield(typs[3])}, []*Node{anonfield(typs[3]), anonfield(typs[6])})
|
||||
typs[75] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[67]), anonfield(typs[2])}, []*Node{anonfield(typs[3]), anonfield(typs[6])})
|
||||
typs[76] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[67]), anonfield(typs[3]), anonfield(typs[1])}, []*Node{anonfield(typs[3]), anonfield(typs[6])})
|
||||
typs[77] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[67]), anonfield(typs[3])}, nil)
|
||||
typs[78] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[67]), anonfield(typs[2])}, nil)
|
||||
typs[79] = functype(nil, []*Node{anonfield(typs[3])}, nil)
|
||||
typs[80] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[67])}, nil)
|
||||
typs[81] = types.NewChan(typs[2], types.Cboth)
|
||||
typs[82] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[22])}, []*Node{anonfield(typs[81])})
|
||||
typs[83] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[15])}, []*Node{anonfield(typs[81])})
|
||||
typs[84] = types.NewChan(typs[2], types.Crecv)
|
||||
typs[85] = functype(nil, []*Node{anonfield(typs[84]), anonfield(typs[3])}, nil)
|
||||
typs[86] = functype(nil, []*Node{anonfield(typs[84]), anonfield(typs[3])}, []*Node{anonfield(typs[6])})
|
||||
typs[87] = types.NewChan(typs[2], types.Csend)
|
||||
typs[88] = functype(nil, []*Node{anonfield(typs[87]), anonfield(typs[3])}, nil)
|
||||
typs[89] = types.NewArray(typs[0], 3)
|
||||
typs[90] = tostruct([]*Node{namedfield("enabled", typs[6]), namedfield("pad", typs[89]), namedfield("needed", typs[6]), namedfield("cgo", typs[6]), namedfield("alignme", typs[24])})
|
||||
typs[91] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[3]), anonfield(typs[3])}, nil)
|
||||
typs[92] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[3])}, nil)
|
||||
typs[93] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[3]), anonfield(typs[15]), anonfield(typs[3]), anonfield(typs[15])}, []*Node{anonfield(typs[15])})
|
||||
typs[94] = functype(nil, []*Node{anonfield(typs[87]), anonfield(typs[3])}, []*Node{anonfield(typs[6])})
|
||||
typs[95] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[84])}, []*Node{anonfield(typs[6])})
|
||||
typs[96] = types.NewPtr(typs[6])
|
||||
typs[97] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[96]), anonfield(typs[84])}, []*Node{anonfield(typs[6])})
|
||||
typs[98] = functype(nil, []*Node{anonfield(typs[63])}, nil)
|
||||
typs[99] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[1]), anonfield(typs[63]), anonfield(typs[15]), anonfield(typs[15]), anonfield(typs[6])}, []*Node{anonfield(typs[15]), anonfield(typs[6])})
|
||||
typs[100] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[15]), anonfield(typs[15])}, []*Node{anonfield(typs[7])})
|
||||
typs[101] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[22]), anonfield(typs[22])}, []*Node{anonfield(typs[7])})
|
||||
typs[102] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[15]), anonfield(typs[15]), anonfield(typs[7])}, []*Node{anonfield(typs[7])})
|
||||
typs[103] = types.NewSlice(typs[2])
|
||||
typs[104] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[103]), anonfield(typs[15])}, []*Node{anonfield(typs[103])})
|
||||
typs[105] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[3]), anonfield(typs[5])}, nil)
|
||||
typs[106] = functype(nil, []*Node{anonfield(typs[7]), anonfield(typs[5])}, nil)
|
||||
typs[107] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[3]), anonfield(typs[5])}, []*Node{anonfield(typs[6])})
|
||||
typs[108] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[3])}, []*Node{anonfield(typs[6])})
|
||||
typs[109] = functype(nil, []*Node{anonfield(typs[7]), anonfield(typs[7])}, []*Node{anonfield(typs[6])})
|
||||
typs[110] = functype(nil, []*Node{anonfield(typs[7]), anonfield(typs[5]), anonfield(typs[5])}, []*Node{anonfield(typs[5])})
|
||||
typs[111] = functype(nil, []*Node{anonfield(typs[7]), anonfield(typs[5])}, []*Node{anonfield(typs[5])})
|
||||
typs[112] = functype(nil, []*Node{anonfield(typs[22]), anonfield(typs[22])}, []*Node{anonfield(typs[22])})
|
||||
typs[113] = functype(nil, []*Node{anonfield(typs[24]), anonfield(typs[24])}, []*Node{anonfield(typs[24])})
|
||||
typs[114] = functype(nil, []*Node{anonfield(typs[20])}, []*Node{anonfield(typs[22])})
|
||||
typs[115] = functype(nil, []*Node{anonfield(typs[20])}, []*Node{anonfield(typs[24])})
|
||||
typs[116] = functype(nil, []*Node{anonfield(typs[20])}, []*Node{anonfield(typs[65])})
|
||||
typs[117] = functype(nil, []*Node{anonfield(typs[22])}, []*Node{anonfield(typs[20])})
|
||||
typs[118] = functype(nil, []*Node{anonfield(typs[24])}, []*Node{anonfield(typs[20])})
|
||||
typs[119] = functype(nil, []*Node{anonfield(typs[65])}, []*Node{anonfield(typs[20])})
|
||||
typs[120] = functype(nil, []*Node{anonfield(typs[26]), anonfield(typs[26])}, []*Node{anonfield(typs[26])})
|
||||
typs[121] = functype(nil, []*Node{anonfield(typs[5])}, nil)
|
||||
typs[122] = functype(nil, []*Node{anonfield(typs[5]), anonfield(typs[5])}, nil)
|
||||
typs[123] = functype(nil, []*Node{anonfield(typs[7]), anonfield(typs[1]), anonfield(typs[5])}, nil)
|
||||
typs[124] = types.NewSlice(typs[7])
|
||||
typs[125] = functype(nil, []*Node{anonfield(typs[7]), anonfield(typs[124])}, nil)
|
||||
typs[126] = types.Types[TUINT8]
|
||||
typs[127] = functype(nil, []*Node{anonfield(typs[126]), anonfield(typs[126])}, nil)
|
||||
typs[128] = types.Types[TUINT16]
|
||||
typs[129] = functype(nil, []*Node{anonfield(typs[128]), anonfield(typs[128])}, nil)
|
||||
typs[130] = functype(nil, []*Node{anonfield(typs[65]), anonfield(typs[65])}, nil)
|
||||
typs[131] = functype(nil, []*Node{anonfield(typs[24]), anonfield(typs[24])}, nil)
|
||||
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[TINT]
|
||||
typs[12] = functype(nil, []*Node{anonfield(typs[11]), anonfield(typs[11])}, nil)
|
||||
typs[13] = types.Types[TUINT]
|
||||
typs[14] = functype(nil, []*Node{anonfield(typs[13]), anonfield(typs[11])}, nil)
|
||||
typs[15] = types.Types[TBOOL]
|
||||
typs[16] = functype(nil, []*Node{anonfield(typs[15])}, nil)
|
||||
typs[17] = types.Types[TFLOAT64]
|
||||
typs[18] = functype(nil, []*Node{anonfield(typs[17])}, nil)
|
||||
typs[19] = types.Types[TINT64]
|
||||
typs[20] = functype(nil, []*Node{anonfield(typs[19])}, nil)
|
||||
typs[21] = types.Types[TUINT64]
|
||||
typs[22] = functype(nil, []*Node{anonfield(typs[21])}, nil)
|
||||
typs[23] = types.Types[TCOMPLEX128]
|
||||
typs[24] = functype(nil, []*Node{anonfield(typs[23])}, nil)
|
||||
typs[25] = types.Types[TSTRING]
|
||||
typs[26] = functype(nil, []*Node{anonfield(typs[25])}, nil)
|
||||
typs[27] = functype(nil, []*Node{anonfield(typs[2])}, nil)
|
||||
typs[28] = types.NewArray(typs[0], 32)
|
||||
typs[29] = types.NewPtr(typs[28])
|
||||
typs[30] = functype(nil, []*Node{anonfield(typs[29]), anonfield(typs[25]), anonfield(typs[25])}, []*Node{anonfield(typs[25])})
|
||||
typs[31] = functype(nil, []*Node{anonfield(typs[29]), anonfield(typs[25]), anonfield(typs[25]), anonfield(typs[25])}, []*Node{anonfield(typs[25])})
|
||||
typs[32] = functype(nil, []*Node{anonfield(typs[29]), anonfield(typs[25]), anonfield(typs[25]), anonfield(typs[25]), anonfield(typs[25])}, []*Node{anonfield(typs[25])})
|
||||
typs[33] = functype(nil, []*Node{anonfield(typs[29]), anonfield(typs[25]), anonfield(typs[25]), anonfield(typs[25]), anonfield(typs[25]), anonfield(typs[25])}, []*Node{anonfield(typs[25])})
|
||||
typs[34] = types.NewSlice(typs[25])
|
||||
typs[35] = functype(nil, []*Node{anonfield(typs[29]), anonfield(typs[34])}, []*Node{anonfield(typs[25])})
|
||||
typs[36] = functype(nil, []*Node{anonfield(typs[25]), anonfield(typs[25])}, []*Node{anonfield(typs[11])})
|
||||
typs[37] = types.NewArray(typs[0], 4)
|
||||
typs[38] = types.NewPtr(typs[37])
|
||||
typs[39] = functype(nil, []*Node{anonfield(typs[38]), anonfield(typs[19])}, []*Node{anonfield(typs[25])})
|
||||
typs[40] = types.NewSlice(typs[0])
|
||||
typs[41] = functype(nil, []*Node{anonfield(typs[29]), anonfield(typs[40])}, []*Node{anonfield(typs[25])})
|
||||
typs[42] = functype(nil, []*Node{anonfield(typs[40])}, []*Node{anonfield(typs[25])})
|
||||
typs[43] = types.Runetype
|
||||
typs[44] = types.NewSlice(typs[43])
|
||||
typs[45] = functype(nil, []*Node{anonfield(typs[29]), anonfield(typs[44])}, []*Node{anonfield(typs[25])})
|
||||
typs[46] = functype(nil, []*Node{anonfield(typs[29]), anonfield(typs[25])}, []*Node{anonfield(typs[40])})
|
||||
typs[47] = types.NewArray(typs[43], 32)
|
||||
typs[48] = types.NewPtr(typs[47])
|
||||
typs[49] = functype(nil, []*Node{anonfield(typs[48]), anonfield(typs[25])}, []*Node{anonfield(typs[44])})
|
||||
typs[50] = types.Types[TUINTPTR]
|
||||
typs[51] = functype(nil, []*Node{anonfield(typs[2]), anonfield(typs[2]), anonfield(typs[50])}, []*Node{anonfield(typs[11])})
|
||||
typs[52] = functype(nil, []*Node{anonfield(typs[2]), anonfield(typs[2])}, []*Node{anonfield(typs[11])})
|
||||
typs[53] = functype(nil, []*Node{anonfield(typs[25]), anonfield(typs[11])}, []*Node{anonfield(typs[43]), anonfield(typs[11])})
|
||||
typs[54] = functype(nil, []*Node{anonfield(typs[25])}, []*Node{anonfield(typs[11])})
|
||||
typs[55] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[2])}, []*Node{anonfield(typs[2])})
|
||||
typs[56] = types.Types[TUNSAFEPTR]
|
||||
typs[57] = functype(nil, []*Node{anonfield(typs[2])}, []*Node{anonfield(typs[56])})
|
||||
typs[58] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[3])}, []*Node{anonfield(typs[2])})
|
||||
typs[59] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[2])}, []*Node{anonfield(typs[2]), anonfield(typs[15])})
|
||||
typs[60] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[1]), anonfield(typs[1])}, nil)
|
||||
typs[61] = functype(nil, []*Node{anonfield(typs[1])}, nil)
|
||||
typs[62] = types.NewPtr(typs[50])
|
||||
typs[63] = functype(nil, []*Node{anonfield(typs[62]), anonfield(typs[56]), anonfield(typs[56])}, []*Node{anonfield(typs[15])})
|
||||
typs[64] = types.Types[TUINT32]
|
||||
typs[65] = functype(nil, nil, []*Node{anonfield(typs[64])})
|
||||
typs[66] = types.NewMap(typs[2], typs[2])
|
||||
typs[67] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[19]), anonfield(typs[3])}, []*Node{anonfield(typs[66])})
|
||||
typs[68] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[11]), anonfield(typs[3])}, []*Node{anonfield(typs[66])})
|
||||
typs[69] = functype(nil, nil, []*Node{anonfield(typs[66])})
|
||||
typs[70] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[66]), anonfield(typs[3])}, []*Node{anonfield(typs[3])})
|
||||
typs[71] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[66]), anonfield(typs[2])}, []*Node{anonfield(typs[3])})
|
||||
typs[72] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[66]), anonfield(typs[3]), anonfield(typs[1])}, []*Node{anonfield(typs[3])})
|
||||
typs[73] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[66]), anonfield(typs[3])}, []*Node{anonfield(typs[3]), anonfield(typs[15])})
|
||||
typs[74] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[66]), anonfield(typs[2])}, []*Node{anonfield(typs[3]), anonfield(typs[15])})
|
||||
typs[75] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[66]), anonfield(typs[3]), anonfield(typs[1])}, []*Node{anonfield(typs[3]), anonfield(typs[15])})
|
||||
typs[76] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[66]), anonfield(typs[3])}, nil)
|
||||
typs[77] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[66]), anonfield(typs[2])}, nil)
|
||||
typs[78] = functype(nil, []*Node{anonfield(typs[3])}, nil)
|
||||
typs[79] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[66])}, nil)
|
||||
typs[80] = types.NewChan(typs[2], types.Cboth)
|
||||
typs[81] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[19])}, []*Node{anonfield(typs[80])})
|
||||
typs[82] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[11])}, []*Node{anonfield(typs[80])})
|
||||
typs[83] = types.NewChan(typs[2], types.Crecv)
|
||||
typs[84] = functype(nil, []*Node{anonfield(typs[83]), anonfield(typs[3])}, nil)
|
||||
typs[85] = functype(nil, []*Node{anonfield(typs[83]), anonfield(typs[3])}, []*Node{anonfield(typs[15])})
|
||||
typs[86] = types.NewChan(typs[2], types.Csend)
|
||||
typs[87] = functype(nil, []*Node{anonfield(typs[86]), anonfield(typs[3])}, nil)
|
||||
typs[88] = types.NewArray(typs[0], 3)
|
||||
typs[89] = tostruct([]*Node{namedfield("enabled", typs[15]), namedfield("pad", typs[88]), namedfield("needed", typs[15]), namedfield("cgo", typs[15]), namedfield("alignme", typs[21])})
|
||||
typs[90] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[3]), anonfield(typs[3])}, nil)
|
||||
typs[91] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[3])}, nil)
|
||||
typs[92] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[2]), anonfield(typs[2])}, []*Node{anonfield(typs[11])})
|
||||
typs[93] = functype(nil, []*Node{anonfield(typs[86]), anonfield(typs[3])}, []*Node{anonfield(typs[15])})
|
||||
typs[94] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[83])}, []*Node{anonfield(typs[15])})
|
||||
typs[95] = types.NewPtr(typs[15])
|
||||
typs[96] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[95]), anonfield(typs[83])}, []*Node{anonfield(typs[15])})
|
||||
typs[97] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[1]), anonfield(typs[11])}, []*Node{anonfield(typs[11]), anonfield(typs[15])})
|
||||
typs[98] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[11]), anonfield(typs[11])}, []*Node{anonfield(typs[56])})
|
||||
typs[99] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[19]), anonfield(typs[19])}, []*Node{anonfield(typs[56])})
|
||||
typs[100] = types.NewSlice(typs[2])
|
||||
typs[101] = functype(nil, []*Node{anonfield(typs[1]), anonfield(typs[100]), anonfield(typs[11])}, []*Node{anonfield(typs[100])})
|
||||
typs[102] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[3]), anonfield(typs[50])}, nil)
|
||||
typs[103] = functype(nil, []*Node{anonfield(typs[56]), anonfield(typs[50])}, nil)
|
||||
typs[104] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[3]), anonfield(typs[50])}, []*Node{anonfield(typs[15])})
|
||||
typs[105] = functype(nil, []*Node{anonfield(typs[3]), anonfield(typs[3])}, []*Node{anonfield(typs[15])})
|
||||
typs[106] = functype(nil, []*Node{anonfield(typs[56]), anonfield(typs[56])}, []*Node{anonfield(typs[15])})
|
||||
typs[107] = functype(nil, []*Node{anonfield(typs[56]), anonfield(typs[50]), anonfield(typs[50])}, []*Node{anonfield(typs[50])})
|
||||
typs[108] = functype(nil, []*Node{anonfield(typs[56]), anonfield(typs[50])}, []*Node{anonfield(typs[50])})
|
||||
typs[109] = functype(nil, []*Node{anonfield(typs[19]), anonfield(typs[19])}, []*Node{anonfield(typs[19])})
|
||||
typs[110] = functype(nil, []*Node{anonfield(typs[21]), anonfield(typs[21])}, []*Node{anonfield(typs[21])})
|
||||
typs[111] = functype(nil, []*Node{anonfield(typs[17])}, []*Node{anonfield(typs[19])})
|
||||
typs[112] = functype(nil, []*Node{anonfield(typs[17])}, []*Node{anonfield(typs[21])})
|
||||
typs[113] = functype(nil, []*Node{anonfield(typs[17])}, []*Node{anonfield(typs[64])})
|
||||
typs[114] = functype(nil, []*Node{anonfield(typs[19])}, []*Node{anonfield(typs[17])})
|
||||
typs[115] = functype(nil, []*Node{anonfield(typs[21])}, []*Node{anonfield(typs[17])})
|
||||
typs[116] = functype(nil, []*Node{anonfield(typs[64])}, []*Node{anonfield(typs[17])})
|
||||
typs[117] = functype(nil, []*Node{anonfield(typs[23]), anonfield(typs[23])}, []*Node{anonfield(typs[23])})
|
||||
typs[118] = functype(nil, []*Node{anonfield(typs[50])}, nil)
|
||||
typs[119] = functype(nil, []*Node{anonfield(typs[50]), anonfield(typs[50])}, nil)
|
||||
typs[120] = functype(nil, []*Node{anonfield(typs[56]), anonfield(typs[1]), anonfield(typs[50])}, nil)
|
||||
typs[121] = types.NewSlice(typs[56])
|
||||
typs[122] = functype(nil, []*Node{anonfield(typs[56]), anonfield(typs[121])}, nil)
|
||||
typs[123] = types.Types[TUINT8]
|
||||
typs[124] = functype(nil, []*Node{anonfield(typs[123]), anonfield(typs[123])}, nil)
|
||||
typs[125] = types.Types[TUINT16]
|
||||
typs[126] = functype(nil, []*Node{anonfield(typs[125]), anonfield(typs[125])}, nil)
|
||||
typs[127] = functype(nil, []*Node{anonfield(typs[64]), anonfield(typs[64])}, nil)
|
||||
typs[128] = functype(nil, []*Node{anonfield(typs[21]), anonfield(typs[21])}, nil)
|
||||
return typs[:]
|
||||
}
|
||||
|
||||
@@ -15,11 +15,9 @@ package runtime
|
||||
import "unsafe"
|
||||
|
||||
func newobject(typ *byte) *any
|
||||
func mallocgc(size uintptr, typ *byte, needszero bool) unsafe.Pointer
|
||||
func panicdivide()
|
||||
func panicshift()
|
||||
func panicmakeslicelen()
|
||||
func panicmakeslicecap()
|
||||
func throwinit()
|
||||
func panicwrap()
|
||||
|
||||
@@ -70,13 +68,13 @@ func concatstrings(*[32]byte, []string) string
|
||||
|
||||
func cmpstring(string, string) int
|
||||
func intstring(*[4]byte, int64) string
|
||||
func slicebytetostring(buf *[32]byte, ptr *byte, n int) string
|
||||
func slicebytetostringtmp(ptr *byte, n int) string
|
||||
func slicebytetostring(*[32]byte, []byte) string
|
||||
func slicebytetostringtmp([]byte) string
|
||||
func slicerunetostring(*[32]byte, []rune) string
|
||||
func stringtoslicebyte(*[32]byte, string) []byte
|
||||
func stringtoslicerune(*[32]rune, string) []rune
|
||||
func slicecopy(toPtr *any, toLen int, frPtr *any, frLen int, wid uintptr) int
|
||||
func slicestringcopy(toPtr *byte, toLen int, fr string) int
|
||||
func slicecopy(to any, fr any, wid uintptr) int
|
||||
func slicestringcopy(to any, fr any) int
|
||||
|
||||
func decoderune(string, int) (retv rune, retk int)
|
||||
func countrunes(string) int
|
||||
@@ -163,19 +161,18 @@ var writeBarrier struct {
|
||||
// *byte is really *runtime.Type
|
||||
func typedmemmove(typ *byte, dst *any, src *any)
|
||||
func typedmemclr(typ *byte, dst *any)
|
||||
func typedslicecopy(typ *byte, dstPtr *any, dstLen int, srcPtr *any, srcLen int) int
|
||||
func typedslicecopy(typ *byte, dst any, src any) int
|
||||
|
||||
func selectnbsend(hchan chan<- any, elem *any) bool
|
||||
func selectnbrecv(elem *any, hchan <-chan any) bool
|
||||
func selectnbrecv2(elem *any, received *bool, hchan <-chan any) bool
|
||||
|
||||
func selectsetpc(pc *uintptr)
|
||||
func selectgo(cas0 *byte, order0 *byte, pc0 *uintptr, nsends int, nrecvs int, block bool) (int, bool)
|
||||
func selectsetpc(cas *byte)
|
||||
func selectgo(cas0 *byte, order0 *byte, ncases int) (int, bool)
|
||||
func block()
|
||||
|
||||
func makeslice(typ *byte, len int, cap int) unsafe.Pointer
|
||||
func makeslice64(typ *byte, len int64, cap int64) unsafe.Pointer
|
||||
func makeslicecopy(typ *byte, tolen int, fromlen int, from unsafe.Pointer) unsafe.Pointer
|
||||
func growslice(typ *byte, old []any, cap int) (ary []any)
|
||||
func memmove(to *any, frm *any, length uintptr)
|
||||
func memclrNoHeapPointers(ptr unsafe.Pointer, n uintptr)
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
|
||||
package gc
|
||||
|
||||
import (
|
||||
"math/bits"
|
||||
)
|
||||
|
||||
const (
|
||||
wordBits = 32
|
||||
wordMask = wordBits - 1
|
||||
@@ -112,11 +108,30 @@ func (bv bvec) Next(i int32) int32 {
|
||||
|
||||
// Find 1 bit.
|
||||
w := bv.b[i>>wordShift] >> uint(i&wordMask)
|
||||
i += int32(bits.TrailingZeros32(w))
|
||||
|
||||
for w&1 == 0 {
|
||||
w >>= 1
|
||||
i++
|
||||
}
|
||||
|
||||
return i
|
||||
}
|
||||
|
||||
// Len returns the minimum number of bits required to represent bv.
|
||||
// The result is 0 if no bits are set in bv.
|
||||
func (bv bvec) Len() int32 {
|
||||
for wi := len(bv.b) - 1; wi >= 0; wi-- {
|
||||
if w := bv.b[wi]; w != 0 {
|
||||
for i := wordBits - 1; i >= 0; i-- {
|
||||
if w>>uint(i) != 0 {
|
||||
return int32(wi)*wordBits + int32(i) + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (bv bvec) IsEmpty() bool {
|
||||
for _, x := range bv.b {
|
||||
if x != 0 {
|
||||
|
||||
@@ -107,7 +107,8 @@ func typecheckclosure(clo *Node, top int) {
|
||||
}
|
||||
|
||||
xfunc.Func.Nname.Sym = closurename(Curfn)
|
||||
setNodeNameFunc(xfunc.Func.Nname)
|
||||
disableExport(xfunc.Func.Nname.Sym)
|
||||
declare(xfunc.Func.Nname, PFUNC)
|
||||
xfunc = typecheck(xfunc, ctxStmt)
|
||||
|
||||
// Type check the body now, but only if we're inside a function.
|
||||
@@ -428,7 +429,6 @@ func typecheckpartialcall(fn *Node, sym *types.Sym) {
|
||||
// Create top-level function.
|
||||
xfunc := makepartialcall(fn, fn.Type, sym)
|
||||
fn.Func = xfunc.Func
|
||||
fn.Func.SetWrapper(true)
|
||||
fn.Right = newname(sym)
|
||||
fn.Op = OCALLPART
|
||||
fn.Type = xfunc.Type
|
||||
@@ -462,6 +462,7 @@ func makepartialcall(fn *Node, t0 *types.Type, meth *types.Sym) *Node {
|
||||
tfn.List.Set(structargs(t0.Params(), true))
|
||||
tfn.Rlist.Set(structargs(t0.Results(), false))
|
||||
|
||||
disableExport(sym)
|
||||
xfunc := dclfunc(sym, tfn)
|
||||
xfunc.Func.SetDupok(true)
|
||||
xfunc.Func.SetNeedctxt(true)
|
||||
@@ -524,7 +525,7 @@ func walkpartialcall(n *Node, init *Nodes) *Node {
|
||||
// Create closure in the form of a composite literal.
|
||||
// For x.M with receiver (x) type T, the generated code looks like:
|
||||
//
|
||||
// clos = &struct{F uintptr; R T}{T.M·f, x}
|
||||
// clos = &struct{F uintptr; R T}{M.T·f, x}
|
||||
//
|
||||
// Like walkclosure above.
|
||||
|
||||
@@ -565,20 +566,3 @@ func walkpartialcall(n *Node, init *Nodes) *Node {
|
||||
|
||||
return walkexpr(clos, init)
|
||||
}
|
||||
|
||||
// callpartMethod returns the *types.Field representing the method
|
||||
// referenced by method value n.
|
||||
func callpartMethod(n *Node) *types.Field {
|
||||
if n.Op != OCALLPART {
|
||||
Fatalf("expected OCALLPART, got %v", n)
|
||||
}
|
||||
|
||||
// TODO(mdempsky): Optimize this. If necessary,
|
||||
// makepartialcall could save m for us somewhere.
|
||||
var m *types.Field
|
||||
if lookdot0(n.Right.Sym, n.Left.Type, &m, false) != 1 {
|
||||
Fatalf("failed to find field for OCALLPART")
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user