1. 23 Aug, 2018 11 commits
    • Dmitri Shuralyov's avatar
      doc/go1.11: add link to new WebAssembly wiki page · 6e76aeba
      Dmitri Shuralyov authored
      The wiki page has recently been created, and at this time it's
      just a stub. It's expected that support for WebAssembly will be
      evolving over time, and the wiki page can be kept updated with
      helpful information, how to get started, tips and tricks, etc.
      
      Use present tense because it's expected that there will be more
      general information added by the time Go 1.11 release happens.
      
      Also add link to https://webassembly.org/ in first paragraph.
      
      Change-Id: I139c2dcec8f0d7fd89401df38a3e12960946693f
      Reviewed-on: https://go-review.googlesource.com/131078Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      6e76aeba
    • Heschi Kreinick's avatar
      runtime: handle morestack system stack transition in gentraceback · ae6361e4
      Heschi Kreinick authored
      gentraceback handles system stack transitions, but only when they're
      done by systemstack(). Handle morestack() too.
      
      I tried to do this generically but systemstack and morestack are
      actually *very* different functions. Most notably, systemstack returns
      "normally", just messes with $sp along the way. morestack never
      returns at all -- it calls newstack, and newstack then jumps both
      stacks and functions back to whoever called morestack. I couldn't
      think of a way to handle both of them generically. So don't.
      
      The current implementation does not include systemstack on the generated
      traceback. That's partly because I don't know how to find its stack frame
      reliably, and partly because the current structure of the code wants to
      do the transition before the call, not after. If we're willing to
      assume that morestack's stack frame is 0 size, this could probably be
      fixed.
      
      For posterity's sake, alternatives tried:
      
      - Have morestack put a dummy function into schedbuf, like systemstack
      does. This actually worked (see patchset 1) but more by a series of
      coincidences than by deliberate design. The biggest coincidence was that
      because morestack_switch was a RET and its stack was 0 size, it actually
      worked to jump back to it at the end of newstack -- it would just return
      to the caller of morestack. Way too subtle for me, and also a little
      slower than just jumping directly.
      
      - Put morestack's PC and SP into schedbuf, so that gentraceback could
      treat it like a normal function except for the changing SP. This was a
      terrible idea and caused newstack to reenter morestack in a completely
      unreasonable state.
      
      To make testing possible I did a small redesign of testCPUProfile to
      take a callback that defines how to check if the conditions pass to it
      are satisfied. This seemed better than making the syntax of the "need"
      strings even more complicated.
      
      Updates #25943
      
      Change-Id: I9271a30a976f80a093a3d4d1c7e9ec226faf74b4
      Reviewed-on: https://go-review.googlesource.com/126795
      Run-TryBot: Heschi Kreinick <heschi@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarAustin Clements <austin@google.com>
      ae6361e4
    • Heschi Kreinick's avatar
      runtime: fix use of wrong g in gentraceback · c9986d14
      Heschi Kreinick authored
      gentraceback gets the currently running g to do some sanity checks, but
      should use gp everywhere to do its actual work. Some noncritical checks
      later accidentally used g instead of gp. This seems like it could be a
      problem in many different contexts, but I noticed in Windows profiling,
      where profilem calls gentraceback on a goroutine from a different
      thread.
      
      Change-Id: I3da27a43e833b257f6411ee6893bdece45a9323f
      Reviewed-on: https://go-review.googlesource.com/128895
      Run-TryBot: Heschi Kreinick <heschi@google.com>
      Reviewed-by: 's avatarAustin Clements <austin@google.com>
      c9986d14
    • Michal Bohuslávek's avatar
      text/template: Put bad function name in quotes in panic from (*Template).Funcs · b15a1e3c
      Michal Bohuslávek authored
      This turns
      
      	panic: function name  is not a valid identifier
      
      into
      	panic: function name "" is not a valid identifier
      
      and also makes it consistent with the func signature check.
      
      This CL also makes the testBadFuncName func a test helper.
      
      Change-Id: Id967cb61ac28228de81e1cd76a39f5195a5ebd11
      Reviewed-on: https://go-review.googlesource.com/130998Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      b15a1e3c
    • Daniel Martí's avatar
      cmd/vet: check embedded field tags too · 4b439e41
      Daniel Martí authored
      We can no longer use the field's position for the duplicate field tag
      warning - since we now check embedded tags, the positions may belong to
      copmletely different packages.
      
      Instead, keep track of the lowest field that's still part of the
      top-level struct type that we are checking.
      
      Finally, be careful to not repeat the independent struct field warnings
      when checking fields again because they are embedded into another
      struct. To do this, separate the duplicate tag value logic into a func
      that recurses into embedded fields on a per-encoding basis.
      
      Fixes #25593.
      
      Change-Id: I3bd6e01306d8ec63c0314d25e3136d5e067a9517
      Reviewed-on: https://go-review.googlesource.com/115677
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarAlan Donovan <adonovan@google.com>
      4b439e41
    • Andrew Bonventre's avatar
      doc/go1.11: remove draft status · e897d43c
      Andrew Bonventre authored
      Change-Id: I3f99083b7d8ab06482c2c22eafda8b0141a872bd
      Reviewed-on: https://go-review.googlesource.com/131076Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      e897d43c
    • Kazuhiro Sera's avatar
      all: fix typos detected by github.com/client9/misspell · ad644d2e
      Kazuhiro Sera authored
      Change-Id: Iadb3c5de8ae9ea45855013997ed70f7929a88661
      GitHub-Last-Rev: ae85bcf82be8fee533e2b9901c6133921382c70a
      GitHub-Pull-Request: golang/go#26920
      Reviewed-on: https://go-review.googlesource.com/128955Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      ad644d2e
    • Martin Möhrmann's avatar
      cmd/compile: add convnop helper function · c5d38b89
      Martin Möhrmann authored
      Like the conv helper function but for creating OCONVNOP nodes
      instead of OCONV nodes.
      
      passes toolstash -cmp
      
      Change-Id: Ib93ffe66590ebaa2b4fa552c81f1a2902e789d8e
      Reviewed-on: https://go-review.googlesource.com/112597
      Run-TryBot: Martin Möhrmann <moehrmann@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarJosh Bleecher Snyder <josharian@gmail.com>
      c5d38b89
    • Yury Smolsky's avatar
      cmd/compile: add sources for inlined functions to ssa.html · 9e2a04d5
      Yury Smolsky authored
      This CL adds the source code of all inlined functions
      into the function specified in $GOSSAFUNC.
      The code is appended to the sources column of ssa.html.
      
      ssaDumpInlined is populated with references to inlined functions.
      Then it is used for dumping the sources in buildssa.
      
      The source columns contains code in following order:
      target function, inlined functions sorted by filename, lineno.
      
      Fixes #25904
      
      Change-Id: I4f6d4834376f1efdfda1f968a5335c0543ed36bc
      Reviewed-on: https://go-review.googlesource.com/126606
      Run-TryBot: Yury Smolsky <yury@smolsky.by>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      9e2a04d5
    • Yury Smolsky's avatar
      cmd/compile: export the Func.Endlineno field · c374984e
      Yury Smolsky authored
      This CL exports the Func.Endlineno value for inlineable functions.
      It is needed to grab the source code of an imported function
      inlined into the function specified in $GOSSAFUNC.
      
      See CL 126606 for details.
      
      Updates #25904
      
      Change-Id: I1e259e20445e4109b4621a95abb5bde1be457af1
      Reviewed-on: https://go-review.googlesource.com/126605
      Run-TryBot: Yury Smolsky <yury@smolsky.by>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      c374984e
    • Yury Smolsky's avatar
      cmd/compile: clean the output of GOSSAFUNC · c35069d6
      Yury Smolsky authored
      Since we print almost everything to ssa.html in the GOSSAFUNC mode,
      there is a need to stop spamming stdout when user just wants to see
      ssa.html.
      
      This changes cleans output of the GOSSAFUNC debug mode.
      To enable the dump of the debug data to stdout, one must
      put suffix + after the function name like that:
      
      GOSSAFUNC=Foo+
      
      Otherwise gc will not print the IR and ASM to stdout after each phase.
      AST IR is still sent to stdout because it is not included
      into ssa.html. It will be fixed in a separate change.
      
      The change adds printing out the full path to the ssa.html file.
      
      Updates #25942
      
      Change-Id: I711e145e05f0443c7df5459ca528dced273a62ee
      Reviewed-on: https://go-review.googlesource.com/126603
      Run-TryBot: Yury Smolsky <yury@smolsky.by>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      c35069d6
  2. 22 Aug, 2018 29 commits