An error occurred fetching the project authors.
  1. 27 Feb, 2018 1 commit
    • Keith Randall's avatar
      cmd/compile: mark the first word of an interface as a uintptr · 2413b548
      Keith Randall authored
      The first word of an interface is a pointer, but for the purposes
      of GC we don't need to treat it as such.
       1. If it is a non-empty interface, the pointer points to an itab
          which is always in persistentalloc space.
       2. If it is an empty interface, the pointer points to a _type.
         a. If it is a compile-time-allocated type, it points into
            the read-only data section.
         b. If it is a reflect-allocated type, it points into the Go heap.
            Reflect is responsible for keeping a reference to
            the underlying type so it won't be GCd.
      
      If we ever have a moving GC, we need to change this for 2b (as
      well as scan itabs to update their itab._type fields).
      
      Write barriers on the first word of interfaces have already been removed.
      
      Change-Id: I643e91d7ac4de980ac2717436eff94097c65d959
      Reviewed-on: https://go-review.googlesource.com/97518
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      2413b548
  2. 26 Feb, 2018 1 commit
  3. 11 Oct, 2017 1 commit
  4. 05 Oct, 2017 1 commit
  5. 25 Sep, 2017 1 commit
  6. 20 Sep, 2017 3 commits
  7. 19 Sep, 2017 1 commit
    • Keith Randall's avatar
      cmd/compile: remove Symbol wrappers from Aux fields · 1787ced8
      Keith Randall authored
      We used to have {Arg,Auto,Extern}Symbol structs with which we wrapped
      a *gc.Node or *obj.LSym before storing them in the Aux field
      of an ssa.Value.  This let the SSA part of the compiler distinguish
      between autos and args, for example.  We no longer need the wrappers
      as we can query the underlying objects directly.
      
      There was also some sloppy usage, where VarDef had a *gc.Node
      directly in its Aux field, whereas the use of that variable had
      that *gc.Node wrapped in an AutoSymbol. Thus the Aux fields didn't
      match (using ==) when they probably should.
      This sloppy usage cleanup is the only thing in the CL that changes the
      generated code - we can get rid of some more unused auto variables if
      the matching happens reliably.
      
      Removing this wrapper also lets us get rid of the varsyms cache
      (which was used to prevent wrapping the same *gc.Node twice).
      
      Change-Id: I0dedf8f82f84bfee413d310342b777316bd1d478
      Reviewed-on: https://go-review.googlesource.com/64452
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      1787ced8
  8. 24 Aug, 2017 1 commit
  9. 09 May, 2017 1 commit
    • Josh Bleecher Snyder's avatar
      cmd/compile: change ssa.Type into *types.Type · 46b88c9f
      Josh Bleecher Snyder authored
      When package ssa was created, Type was in package gc.
      To avoid circular dependencies, we used an interface (ssa.Type)
      to represent type information in SSA.
      
      In the Go 1.9 cycle, gri extricated the Type type from package gc.
      As a result, we can now use it in package ssa.
      Now, instead of package types depending on package ssa,
      it is the other way.
      This is a more sensible dependency tree,
      and helps compiler performance a bit.
      
      Though this is a big CL, most of the changes are
      mechanical and uninteresting.
      
      Interesting bits:
      
      * Add new singleton globals to package types for the special
        SSA types Memory, Void, Invalid, Flags, and Int128.
      * Add two new Types, TSSA for the special types,
        and TTUPLE, for SSA tuple types.
        ssa.MakeTuple is now types.NewTuple.
      * Move type comparison result constants CMPlt, CMPeq, and CMPgt
        to package types.
      * We had picked the name "types" in our rules for the handy
        list of types provided by ssa.Config. That conflicted with
        the types package name, so change it to "typ".
      * Update the type comparison routine to handle tuples and special
        types inline.
      * Teach gc/fmt.go how to print special types.
      * We can now eliminate ElemTypes in favor of just Elem,
        and probably also some other duplicated Type methods
        designed to return ssa.Type instead of *types.Type.
      * The ssa tests were using their own dummy types,
        and they were not particularly careful about types in general.
        Of necessity, this CL switches them to use *types.Type;
        it does not make them more type-accurate.
        Unfortunately, using types.Type means initializing a bit
        of the types universe.
        This is prime for refactoring and improvement.
      
      This shrinks ssa.Value; it now fits in a smaller size class
      on 64 bit systems. This doesn't have a giant impact,
      though, since most Values are preallocated in a chunk.
      
      name        old alloc/op      new alloc/op      delta
      Template         37.9MB ± 0%       37.7MB ± 0%  -0.57%  (p=0.000 n=10+8)
      Unicode          28.9MB ± 0%       28.7MB ± 0%  -0.52%  (p=0.000 n=10+10)
      GoTypes           110MB ± 0%        109MB ± 0%  -0.88%  (p=0.000 n=10+10)
      Flate            24.7MB ± 0%       24.6MB ± 0%  -0.66%  (p=0.000 n=10+10)
      GoParser         31.1MB ± 0%       30.9MB ± 0%  -0.61%  (p=0.000 n=10+9)
      Reflect          73.9MB ± 0%       73.4MB ± 0%  -0.62%  (p=0.000 n=10+8)
      Tar              25.8MB ± 0%       25.6MB ± 0%  -0.77%  (p=0.000 n=9+10)
      XML              41.2MB ± 0%       40.9MB ± 0%  -0.80%  (p=0.000 n=10+10)
      [Geo mean]       40.5MB            40.3MB       -0.68%
      
      name        old allocs/op     new allocs/op     delta
      Template           385k ± 0%         386k ± 0%    ~     (p=0.356 n=10+9)
      Unicode            343k ± 1%         344k ± 0%    ~     (p=0.481 n=10+10)
      GoTypes           1.16M ± 0%        1.16M ± 0%  -0.16%  (p=0.004 n=10+10)
      Flate              238k ± 1%         238k ± 1%    ~     (p=0.853 n=10+10)
      GoParser           320k ± 0%         320k ± 0%    ~     (p=0.720 n=10+9)
      Reflect            957k ± 0%         957k ± 0%    ~     (p=0.460 n=10+8)
      Tar                252k ± 0%         252k ± 0%    ~     (p=0.133 n=9+10)
      XML                400k ± 0%         400k ± 0%    ~     (p=0.796 n=10+10)
      [Geo mean]         428k              428k       -0.01%
      
      
      Removing all the interface calls helps non-trivially with CPU, though.
      
      name        old time/op       new time/op       delta
      Template          178ms ± 4%        173ms ± 3%  -2.90%  (p=0.000 n=94+96)
      Unicode          85.0ms ± 4%       83.9ms ± 4%  -1.23%  (p=0.000 n=96+96)
      GoTypes           543ms ± 3%        528ms ± 3%  -2.73%  (p=0.000 n=98+96)
      Flate             116ms ± 3%        113ms ± 4%  -2.34%  (p=0.000 n=96+99)
      GoParser          144ms ± 3%        140ms ± 4%  -2.80%  (p=0.000 n=99+97)
      Reflect           344ms ± 3%        334ms ± 4%  -3.02%  (p=0.000 n=100+99)
      Tar               106ms ± 5%        103ms ± 4%  -3.30%  (p=0.000 n=98+94)
      XML               198ms ± 5%        192ms ± 4%  -2.88%  (p=0.000 n=92+95)
      [Geo mean]        178ms             173ms       -2.65%
      
      name        old user-time/op  new user-time/op  delta
      Template          229ms ± 5%        224ms ± 5%  -2.36%  (p=0.000 n=95+99)
      Unicode           107ms ± 6%        106ms ± 5%  -1.13%  (p=0.001 n=93+95)
      GoTypes           696ms ± 4%        679ms ± 4%  -2.45%  (p=0.000 n=97+99)
      Flate             137ms ± 4%        134ms ± 5%  -2.66%  (p=0.000 n=99+96)
      GoParser          176ms ± 5%        172ms ± 8%  -2.27%  (p=0.000 n=98+100)
      Reflect           430ms ± 6%        411ms ± 5%  -4.46%  (p=0.000 n=100+92)
      Tar               128ms ±13%        123ms ±13%  -4.21%  (p=0.000 n=100+100)
      XML               239ms ± 6%        233ms ± 6%  -2.50%  (p=0.000 n=95+97)
      [Geo mean]        220ms             213ms       -2.76%
      
      
      Change-Id: I15c7d6268347f8358e75066dfdbd77db24e8d0c1
      Reviewed-on: https://go-review.googlesource.com/42145
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      46b88c9f
  10. 28 Apr, 2017 2 commits
    • Josh Bleecher Snyder's avatar
      cmd/compile: use a map to track liveness variable indices · 794d29a4
      Josh Bleecher Snyder authored
      It is not safe to modify Node.Opt in the backend.
      Instead of using Node.Opt to store liveness variable indices, use a map.
      This simplifies the code and makes it much more clearly race-free.
      There are generally few such variables, so the maps are not a significant
      source of allocations; this also remove some allocations from putting
      int32s into interfaces.
      
      Because map lookups are more expensive than interface value extraction,
      reorder valueEffects to do the map lookup last.
      
      The only remaining use of Node.Opt is now in esc.go.
      
      Passes toolstash-check.
      
      Fixes #20144
      
      name        old alloc/op      new alloc/op      delta
      Template         37.8MB ± 0%       37.9MB ± 0%    ~     (p=0.548 n=5+5)
      Unicode          28.9MB ± 0%       28.9MB ± 0%    ~     (p=0.548 n=5+5)
      GoTypes           110MB ± 0%        110MB ± 0%  +0.16%  (p=0.008 n=5+5)
      Compiler          461MB ± 0%        462MB ± 0%  +0.08%  (p=0.008 n=5+5)
      SSA              1.11GB ± 0%       1.11GB ± 0%  +0.11%  (p=0.008 n=5+5)
      Flate            24.7MB ± 0%       24.7MB ± 0%    ~     (p=0.690 n=5+5)
      GoParser         31.1MB ± 0%       31.1MB ± 0%    ~     (p=0.841 n=5+5)
      Reflect          73.7MB ± 0%       73.8MB ± 0%  +0.23%  (p=0.008 n=5+5)
      Tar              25.8MB ± 0%       25.7MB ± 0%    ~     (p=0.690 n=5+5)
      XML              41.2MB ± 0%       41.2MB ± 0%    ~     (p=0.841 n=5+5)
      [Geo mean]       71.9MB            71.9MB       +0.06%
      
      name        old allocs/op     new allocs/op     delta
      Template           385k ± 0%         384k ± 0%    ~     (p=0.548 n=5+5)
      Unicode            344k ± 0%         343k ± 1%    ~     (p=0.421 n=5+5)
      GoTypes           1.16M ± 0%        1.16M ± 0%    ~     (p=0.690 n=5+5)
      Compiler          4.43M ± 0%        4.42M ± 0%    ~     (p=0.095 n=5+5)
      SSA               9.86M ± 0%        9.84M ± 0%  -0.19%  (p=0.008 n=5+5)
      Flate              238k ± 0%         238k ± 0%    ~     (p=1.000 n=5+5)
      GoParser           321k ± 0%         320k ± 0%    ~     (p=0.310 n=5+5)
      Reflect            956k ± 0%         956k ± 0%    ~     (p=1.000 n=5+5)
      Tar                252k ± 0%         251k ± 0%    ~     (p=0.056 n=5+5)
      XML                402k ± 1%         400k ± 1%  -0.57%  (p=0.032 n=5+5)
      [Geo mean]         740k              739k       -0.19%
      
      Change-Id: Id5916c9def76add272e89c59fe10968f0a6bb01d
      Reviewed-on: https://go-review.googlesource.com/42135
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      794d29a4
    • Josh Bleecher Snyder's avatar
      Revert "cmd/compile: add Type.MustSize and Type.MustAlignment" · dae5389d
      Josh Bleecher Snyder authored
      This reverts commit 94d540a4.
      
      Reason for revert: prefer something along the lines of CL 42018.
      
      Change-Id: I876fe32e98f37d8d725fe55e0fd0ea429c0198e0
      Reviewed-on: https://go-review.googlesource.com/42022
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      dae5389d
  11. 27 Apr, 2017 2 commits
    • Josh Bleecher Snyder's avatar
      cmd/compile: move Used from gc.Node to gc.Name · fc08a19c
      Josh Bleecher Snyder authored
      Node.Used was written to from the backend
      concurrently with reads of Node.Class
      for the same ONAME Nodes.
      I do not know why it was not failing consistently
      under the race detector, but it is a race.
      
      This is likely also a problem with Node.HasVal and Node.HasOpt.
      They will be handled in a separate CL.
      
      Fix Used by moving it to gc.Name and making it a separate bool.
      There was one non-Name use of Used, marking OLABELs as used.
      That is no longer needed, now that goto and label checking
      happens early in the front end.
      
      Leave the getters and setters in place,
      to ease changing the representation in the future
      (or changing to an interface!).
      
      Updates #20144
      
      Change-Id: I9bec7c6d33dcb129a4cfa9d338462ea33087f9f7
      Reviewed-on: https://go-review.googlesource.com/42015
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      fc08a19c
    • Josh Bleecher Snyder's avatar
      cmd/compile: add Type.MustSize and Type.MustAlignment · 94d540a4
      Josh Bleecher Snyder authored
      Type.Size and Type.Alignment are for the front end:
      They calculate size and alignment if needed.
      
      Type.MustSize and Type.MustAlignment are for the back end:
      They call Fatal if size and alignment are not already calculated.
      
      Most uses are of MustSize and MustAlignment,
      but that's because the back end is newer,
      and this API was added to support it.
      
      This CL was mostly generated with sed and selective reversion.
      The only mildly interesting bit is the change of the ssa.Type interface
      and the supporting ssa dummy types.
      
      Follow-up to review feedback on CL 41970.
      
      Passes toolstash-check.
      
      Change-Id: I0d9b9505e57453dae8fb6a236a07a7a02abd459e
      Reviewed-on: https://go-review.googlesource.com/42016
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      94d540a4
  12. 26 Apr, 2017 1 commit
    • Josh Bleecher Snyder's avatar
      cmd/compile: move Node.Class to flags · 386765af
      Josh Bleecher Snyder authored
      Put it at position zero, since it is fairly hot.
      
      This shrinks gc.Node into a smaller size class on 64 bit systems.
      
      name        old time/op       new time/op       delta
      Template          193ms ± 5%        192ms ± 3%    ~     (p=0.353 n=94+93)
      Unicode          86.1ms ± 5%       85.0ms ± 4%  -1.23%  (p=0.000 n=95+98)
      GoTypes           546ms ± 3%        544ms ± 4%  -0.40%  (p=0.007 n=94+97)
      Compiler          2.56s ± 3%        2.54s ± 3%  -0.67%  (p=0.000 n=99+97)
      SSA               5.13s ± 2%        5.10s ± 3%  -0.55%  (p=0.000 n=94+98)
      Flate             122ms ± 6%        121ms ± 4%  -0.75%  (p=0.002 n=97+95)
      GoParser          144ms ± 5%        144ms ± 4%    ~     (p=0.298 n=98+97)
      Reflect           348ms ± 4%        349ms ± 4%    ~     (p=0.350 n=98+97)
      Tar               105ms ± 5%        104ms ± 5%    ~     (p=0.154 n=96+98)
      XML               200ms ± 5%        198ms ± 4%  -0.71%  (p=0.015 n=97+98)
      [Geo mean]        330ms             328ms       -0.52%
      
      name        old user-time/op  new user-time/op  delta
      Template          229ms ±11%        224ms ± 7%  -2.16%  (p=0.001 n=100+87)
      Unicode           109ms ± 5%        109ms ± 6%    ~     (p=0.897 n=96+91)
      GoTypes           712ms ± 4%        709ms ± 4%    ~     (p=0.085 n=96+98)
      Compiler          3.41s ± 3%        3.36s ± 3%  -1.43%  (p=0.000 n=98+98)
      SSA               7.46s ± 3%        7.31s ± 3%  -2.02%  (p=0.000 n=100+99)
      Flate             145ms ± 6%        143ms ± 6%  -1.11%  (p=0.001 n=99+97)
      GoParser          177ms ± 5%        176ms ± 5%  -0.78%  (p=0.018 n=95+95)
      Reflect           432ms ± 7%        435ms ± 9%    ~     (p=0.296 n=100+100)
      Tar               121ms ± 7%        121ms ± 5%    ~     (p=0.072 n=100+95)
      XML               241ms ± 4%        239ms ± 5%    ~     (p=0.085 n=97+99)
      [Geo mean]        413ms             410ms       -0.73%
      
      name        old alloc/op      new alloc/op      delta
      Template         38.4MB ± 0%       37.7MB ± 0%  -1.85%  (p=0.008 n=5+5)
      Unicode          30.1MB ± 0%       28.8MB ± 0%  -4.09%  (p=0.008 n=5+5)
      GoTypes           112MB ± 0%        110MB ± 0%  -1.69%  (p=0.008 n=5+5)
      Compiler          470MB ± 0%        461MB ± 0%  -1.91%  (p=0.008 n=5+5)
      SSA              1.13GB ± 0%       1.11GB ± 0%  -1.70%  (p=0.008 n=5+5)
      Flate            25.0MB ± 0%       24.6MB ± 0%  -1.67%  (p=0.008 n=5+5)
      GoParser         31.6MB ± 0%       31.1MB ± 0%  -1.66%  (p=0.008 n=5+5)
      Reflect          77.1MB ± 0%       75.8MB ± 0%  -1.69%  (p=0.008 n=5+5)
      Tar              26.3MB ± 0%       25.7MB ± 0%  -2.06%  (p=0.008 n=5+5)
      XML              41.9MB ± 0%       41.1MB ± 0%  -1.93%  (p=0.008 n=5+5)
      [Geo mean]       73.5MB            72.0MB       -2.03%
      
      name        old allocs/op     new allocs/op     delta
      Template           383k ± 0%         383k ± 0%    ~     (p=0.690 n=5+5)
      Unicode            343k ± 0%         343k ± 0%    ~     (p=0.841 n=5+5)
      GoTypes           1.16M ± 0%        1.16M ± 0%    ~     (p=0.310 n=5+5)
      Compiler          4.43M ± 0%        4.42M ± 0%  -0.17%  (p=0.008 n=5+5)
      SSA               9.85M ± 0%        9.85M ± 0%    ~     (p=0.310 n=5+5)
      Flate              236k ± 0%         236k ± 1%    ~     (p=0.841 n=5+5)
      GoParser           320k ± 0%         320k ± 0%    ~     (p=0.421 n=5+5)
      Reflect            988k ± 0%         987k ± 0%    ~     (p=0.690 n=5+5)
      Tar                252k ± 0%         251k ± 0%    ~     (p=0.095 n=5+5)
      XML                399k ± 0%         399k ± 0%    ~     (p=1.000 n=5+5)
      [Geo mean]         741k              740k       -0.07%
      
      Change-Id: I9e952b58a98e30a12494304db9ce50d0a85e459c
      Reviewed-on: https://go-review.googlesource.com/41797
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarMarvin Stenger <marvin.stenger94@gmail.com>
      386765af
  13. 23 Apr, 2017 1 commit
  14. 21 Apr, 2017 3 commits
    • Josh Bleecher Snyder's avatar
      cmd/compile: rename dxxx -> dxxxLSym · a544df33
      Josh Bleecher Snyder authored
      Follow-up to previous CL.
      
      gorename -from '"cmd/compile/internal/gc".duintxxLSym' -to duintxx
      gorename -from '"cmd/compile/internal/gc".duint8LSym' -to duint8
      gorename -from '"cmd/compile/internal/gc".duint16LSym' -to duint16
      gorename -from '"cmd/compile/internal/gc".duint32LSym' -to duint32
      gorename -from '"cmd/compile/internal/gc".duintptrLSym' -to duintptr
      gorename -from '"cmd/compile/internal/gc".dbvecLSym' -to dbvec
      gorename -from '"cmd/compile/internal/gc".dsnameLSym' -to dsname
      gorename -from '"cmd/compile/internal/gc".dsymptrLSym' -to dsymptr
      gorename -from '"cmd/compile/internal/gc".dsymptrOffLSym' -to dsymptrOff
      gorename -from '"cmd/compile/internal/gc".dsymptrWeakOffLSym' -to dsymptrWeakOff
      
      Passes toolstash-check.
      
      Change-Id: I007f57340f9e8b1468553242556ae25a71167e8c
      Reviewed-on: https://go-review.googlesource.com/41397
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      a544df33
    • Cherry Zhang's avatar
      cmd/compile: mark ARM's CALLudiv not safepoint · 7b0b52ef
      Cherry Zhang authored
      ARM's udiv function is nosplit and it shouldn't be preemptied
      (passing args in registers). It is in some sense like DUFFCOPY,
      which we don't mark as safepoint.
      
      Change-Id: I49f7c4e69e787ac364d0b0def0661e79a0ea9e69
      Reviewed-on: https://go-review.googlesource.com/41370
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      7b0b52ef
    • Keith Randall's avatar
      cmd/compile: experiment which clobbers all dead pointer fields · 1e72bf62
      Keith Randall authored
      The experiment "clobberdead" clobbers all pointer fields that the
      compiler thinks are dead, just before and after every safepoint.
      Useful for debugging the generation of live pointer bitmaps.
      
      Helped find the following issues:
      Update #15936
      Update #16026
      Update #16095
      Update #18860
      
      Change-Id: Id1d12f86845e3d93bae903d968b1eac61fc461f9
      Reviewed-on: https://go-review.googlesource.com/23924
      Run-TryBot: Keith Randall <khr@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      1e72bf62
  15. 20 Apr, 2017 1 commit
    • Keith Randall's avatar
      cmd/compile: zero ambiguously live variables at VARKILLs · 38dee12d
      Keith Randall authored
      At VARKILLs, zero a variable if it is ambiguously live.
      After the VARKILL anything this variable references
      might be collected. If it were to become live again later,
      the GC will see references to already-collected objects.
      
      We don't know a variable is ambiguously live until very
      late in compilation (after lowering, register allocation, ...),
      so it is hard to generate the code in an arch-independent way.
      We also have to be careful not to clobber any registers.
      Fortunately, this almost never happens so performance is ~irrelevant.
      
      There are only 2 instances where this triggers in the stdlib.
      
      Fixes #20029
      
      Change-Id: Ia9585a91d7b823fad4a9d141d954464cc7af31f4
      Reviewed-on: https://go-review.googlesource.com/41076
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      38dee12d
  16. 18 Apr, 2017 4 commits
    • Matthew Dempsky's avatar
      cmd/internal/obj: un-embed FuncInfo field in LSym · 17470786
      Matthew Dempsky authored
      Automated refactoring using github.com/mdempsky/unbed (to rewrite
      s.Foo to s.FuncInfo.Foo) and then gorename (to rename the FuncInfo
      field to just Func).
      
      Passes toolstash-check -all.
      
      Change-Id: I802c07a1239e0efea058a91a87c5efe12170083a
      Reviewed-on: https://go-review.googlesource.com/40670
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      17470786
    • Josh Bleecher Snyder's avatar
      cmd/internal/obj: unexport Link.Hash · 9d4a8467
      Josh Bleecher Snyder authored
      A prior CL eliminated the last reference to Ctxt.Hash
      from the compiler.
      
      Change-Id: Ic97ff84ed1a14e0c93fb0e8ec0b2617c3397c0e8
      Reviewed-on: https://go-review.googlesource.com/40699
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      9d4a8467
    • Josh Bleecher Snyder's avatar
      cmd/compile: relocate large comment to plive.go · b3fb6b00
      Josh Bleecher Snyder authored
      It was a bit weird to have it at the top of pgen.go.
      This does half of the TODO at the top of the comment.
      
      Change-Id: I65140fa05673b2dbb6feddb8c1877f6d624a7844
      Reviewed-on: https://go-review.googlesource.com/40698
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      b3fb6b00
    • Josh Bleecher Snyder's avatar
      cmd/internal/obj: rework gclocals handling · da15fe68
      Josh Bleecher Snyder authored
      The compiler handled gcargs and gclocals LSyms unusually.
      It generated placeholder symbols (makefuncdatasym),
      filled them in, and then renamed them for content-addressability.
      This is an important binary size optimization;
      the same locals information occurs over and over.
      
      This CL continues to treat these LSyms unusually,
      but in a slightly more explicit way,
      and importantly for concurrent compilation,
      in a way that does not require concurrent
      modification of Ctxt.Hash.
      
      Instead of creating gcargs and gclocals in the usual way,
      by creating a types.Sym and then an obj.LSym,
      we add them directly to obj.FuncInfo,
      initialize them in obj.InitTextSym,
      and deduplicate and add them to ctxt.Data at the end.
      Then the backend's job is simply to fill them in
      and rename them appropriately.
      
      Updates #15756
      
      name       old alloc/op      new alloc/op      delta
      Template        38.8MB ± 0%       38.7MB ± 0%  -0.22%  (p=0.016 n=5+5)
      Unicode         29.8MB ± 0%       29.8MB ± 0%    ~     (p=0.690 n=5+5)
      GoTypes          113MB ± 0%        113MB ± 0%  -0.24%  (p=0.008 n=5+5)
      SSA             1.25GB ± 0%       1.24GB ± 0%  -0.39%  (p=0.008 n=5+5)
      Flate           25.3MB ± 0%       25.2MB ± 0%  -0.43%  (p=0.008 n=5+5)
      GoParser        31.7MB ± 0%       31.7MB ± 0%  -0.22%  (p=0.008 n=5+5)
      Reflect         78.2MB ± 0%       77.6MB ± 0%  -0.80%  (p=0.008 n=5+5)
      Tar             26.6MB ± 0%       26.3MB ± 0%  -0.85%  (p=0.008 n=5+5)
      XML             42.4MB ± 0%       41.9MB ± 0%  -1.04%  (p=0.008 n=5+5)
      
      name       old allocs/op     new allocs/op     delta
      Template          378k ± 0%         377k ± 1%    ~     (p=0.151 n=5+5)
      Unicode           321k ± 1%         321k ± 0%    ~     (p=0.841 n=5+5)
      GoTypes          1.14M ± 0%        1.14M ± 0%  -0.47%  (p=0.016 n=5+5)
      SSA              9.71M ± 0%        9.67M ± 0%  -0.33%  (p=0.008 n=5+5)
      Flate             233k ± 1%         232k ± 1%    ~     (p=0.151 n=5+5)
      GoParser          316k ± 0%         315k ± 0%  -0.49%  (p=0.016 n=5+5)
      Reflect           979k ± 0%         972k ± 0%  -0.75%  (p=0.008 n=5+5)
      Tar               250k ± 0%         247k ± 1%  -0.92%  (p=0.008 n=5+5)
      XML               392k ± 1%         389k ± 0%  -0.67%  (p=0.008 n=5+5)
      
      Change-Id: Idc36186ca9d2f8214b5f7720bbc27b6bb22fdc48
      Reviewed-on: https://go-review.googlesource.com/40697
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      da15fe68
  17. 07 Apr, 2017 1 commit
    • Robert Griesemer's avatar
      cmd/compile: factor out Pkg, Sym, and Type into package types · f68f2928
      Robert Griesemer authored
      - created new package cmd/compile/internal/types
      - moved Pkg, Sym, Type to new package
      - to break cycles, for now we need the (ugly) types/utils.go
        file which contains a handful of functions that must be installed
        early by the gc frontend
      - to break cycles, for now we need two functions to convert between
        *gc.Node and *types.Node (the latter is a dummy type)
      - adjusted the gc's code to use the new package and the conversion
        functions as needed
      - made several Pkg, Sym, and Type methods functions as needed
      - renamed constructors typ, typPtr, typArray, etc. to types.New,
        types.NewPtr, types.NewArray, etc.
      
      Passes toolstash-check -all.
      
      Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
      Reviewed-on: https://go-review.googlesource.com/39855Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      f68f2928
  18. 24 Mar, 2017 1 commit
  19. 23 Mar, 2017 1 commit
  20. 21 Mar, 2017 4 commits
  21. 20 Mar, 2017 3 commits
  22. 17 Mar, 2017 3 commits
  23. 14 Mar, 2017 2 commits