1. 16 Jul, 2013 3 commits
  2. 15 Jul, 2013 8 commits
  3. 14 Jul, 2013 2 commits
  4. 13 Jul, 2013 3 commits
    • Russ Cox's avatar
      cmd/6l, cmd/8l: use one-byte XCHG forms when possible · aad4720b
      Russ Cox authored
      Pointed out by khr.
      
      R=ken2
      CC=golang-dev
      https://golang.org/cl/11145044
      aad4720b
    • Russ Cox's avatar
      encoding/json: add more tests for UTF-8 coercion · 4274d074
      Russ Cox authored
      Suggested by Rob in CL 11211045, but the mail arrived
      moments after hg submit completed.
      
      R=golang-dev, r
      CC=golang-dev
      https://golang.org/cl/11138045
      4274d074
    • Russ Cox's avatar
      cmd/go, testing: streamline direct use of test binaries · ccc45534
      Russ Cox authored
      Before:
      
              $ go test -c -cover fmt
              $ ./fmt.test -test.covermode=set
              PASS
              coverage: 65.1% of statements in strconv
              $
      
      After:
      
              $ go test -c -cover fmt
              $ ./fmt.test
              PASS
              coverage: 65.1% of statements in strconv
              $
      
      In addition to being cumbersome, the old flag didn't make sense:
      the cover mode cannot be changed after the binary has been built.
      
      Another useful effect of this CL is that if you happen to do
      
              $ go test -c -covermode=atomic fmt
      
      and then forget you did that and run benchmarks,
      the final line of the output (the coverage summary) reminds you
      that you are benchmarking with coverage enabled, which might
      not be what you want.
      
              $ ./fmt.test -test.bench .
              PASS
              BenchmarkSprintfEmpty	10000000	       217 ns/op
              BenchmarkSprintfString	 2000000	       755 ns/op
              BenchmarkSprintfInt	 2000000	       774 ns/op
              BenchmarkSprintfIntInt	 1000000	      1363 ns/op
              BenchmarkSprintfPrefixedInt	 1000000	      1501 ns/op
              BenchmarkSprintfFloat	 1000000	      1257 ns/op
              BenchmarkManyArgs	  500000	      5346 ns/op
              BenchmarkScanInts	    1000	   2562402 ns/op
              BenchmarkScanRecursiveInt	     500	   3189457 ns/op
              coverage: 91.4% of statements
              $
      
      As part of passing the new mode setting in via _testmain.go, merge
      the two registration mechanisms into one extensible mechanism
      (a struct).
      
      R=r
      CC=golang-dev
      https://golang.org/cl/11219043
      ccc45534
  5. 12 Jul, 2013 19 commits
    • Russ Cox's avatar
      undo CL 11161044 / ba455262a9db · 4419d7e5
      Russ Cox authored
      I want to think more carefully about this.
      
      We put this in because Marshal encoded named []byte but Unmarshal rejected them.
      And we noticed that Marshal's behavior was undocumented so we documented it.
      But I am starting to think the docs and Unmarshal were correct and Marshal's
      behavior was the problem.
      
      Rolling back to give us more time to think.
      
      ««« original CL description
      json: unmarshal types that are byte slices.
      
      The json package cheerfully would marshal
      
              type S struct {
                      IP net.IP
              }
      
      but would give an error when unmarshalling.  This change allows any
      type whose concrete type is a byte slice to be unmarshalled from a
      string.
      
      Fixes #5086.
      
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/11161044
      
      »»»
      
      R=golang-dev, r
      CC=golang-dev
      https://golang.org/cl/11042046
      4419d7e5
    • Russ Cox's avatar
      encoding/json: coerce invalid UTF-8 to valid UTF-8 during Marshal · 64054a40
      Russ Cox authored
      In practice, rejecting an entire structure due to a single invalid byte
      in a string is just too picky, and too hard to track down.
      Be consistent with the bulk of the standard library by converting
      invalid UTF-8 into UTF-8 with replacement runes.
      
      R=golang-dev, crawshaw
      CC=golang-dev
      https://golang.org/cl/11211045
      64054a40
    • Keith Randall's avatar
      cmd/dist: allow assembly code to use enumerated constants. · cfefe6a7
      Keith Randall authored
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/11056044
      cfefe6a7
    • Russ Cox's avatar
      cmd/5a, cmd/6a, cmd/8a: fix flag parsing · 8124a02c
      Russ Cox authored
      go tool 6a -$(unicode fffd) was crashing.
      
      Fixes #5878.
      
      R=ken2
      CC=golang-dev
      https://golang.org/cl/11208045
      8124a02c
    • Shenghou Ma's avatar
      run.bash: enlarge timeout of runtime tests · 0ce56e60
      Shenghou Ma authored
      Recently addition to runtime test makes it take very close to 720s
      of timeout limit on the netbsd-arm-qemu builder.
      
      R=golang-dev, go.peter.90, rsc
      CC=golang-dev
      https://golang.org/cl/10935043
      0ce56e60
    • Russ Cox's avatar
      cmd/5g, cmd/6g, cmd/8g: fix line number of caller of deferred func · 7e97d398
      Russ Cox authored
      Deferred functions are not run by a call instruction. They are run by
      the runtime editing registers to make the call start with a caller PC
      returning to a
              CALL deferreturn
      instruction.
      
      That instruction has always had the line number of the function's
      closing brace, but that instruction's line number is irrelevant.
      Stack traces show the line number of the instruction before the
      return PC, because normally that's what started the call. Not so here.
      The instruction before the CALL deferreturn could be almost anywhere
      in the function; it's unrelated and its line number is incorrect to show.
      
      Fix the line number by inserting a true hardware no-op with the right
      line number before the returned-to CALL instruction. That is, the deferred
      calls now appear to start with a caller PC returning to the second instruction
      in this sequence:
              NOP
              CALL deferreturn
      
      The traceback will show the line number of the NOP, which we've set
      to be the line number of the function's closing brace.
      
      The NOP here is not the usual pseudo-instruction, which would be
      elided by the linker. Instead it is the real hardware instruction:
      XCHG AX, AX on 386 and amd64, and AND.EQ R0, R0, R0 on ARM.
      
      Fixes #5856.
      
      R=ken2, ken
      CC=golang-dev
      https://golang.org/cl/11223043
      7e97d398
    • Russ Cox's avatar
      cmd/ld: fix large stack split for preempt check · 031c107c
      Russ Cox authored
      If the stack frame size is larger than the known-unmapped region at the
      bottom of the address space, then the stack split prologue cannot use the usual
      condition:
      
              SP - size >= stackguard
      
      because SP - size may wrap around to a very large number.
      Instead, if the stack frame is large, the prologue tests:
      
              SP - stackguard >= size
      
      (This ends up being a few instructions more expensive, so we don't do it always.)
      
      Preemption requests register by setting stackguard to a very large value, so
      that the first test (SP - size >= stackguard) cannot possibly succeed.
      Unfortunately, that same very large value causes a wraparound in the
      second test (SP - stackguard >= size), making it succeed incorrectly.
      
      To avoid *that* wraparound, we have to amend the test:
      
              stackguard != StackPreempt && SP - stackguard >= size
      
      This test is only used for functions with large frames, which essentially
      always split the stack, so the cost of the few instructions is noise.
      
      This CL and CL 11085043 together fix the known issues with preemption,
      at the beginning of a function, so we will be able to try turning it on again.
      
      R=ken2
      CC=golang-dev
      https://golang.org/cl/11205043
      031c107c
    • Russ Cox's avatar
      cmd/go, testing: remove redundant "for pkg" in coverage message · 56cd47b2
      Russ Cox authored
      This is a transcript before this change. I've capitalized the text being removed.
      Note that it is always near another line that already says fmt, marked with <<<
      
      $ cd $GOROOT/src/pkg/fmt
      
      $ go test -cover
      PASS
      coverage FOR FMT: 91.3% of statements
      ok  	fmt	0.040s <<<
      
      $ go test -coverpkg strconv
      PASS
      coverage FOR FMT: 64.9% of statements in strconv
      ok  	fmt	0.039s <<<
      
      $ go test -cover -c
      $ ./fmt.test -test.covermode=set <<<
      PASS
      coverage FOR FMT: 91.3% of statements
      
      $ go test -coverpkg strconv -c
      $ ./fmt.test -test.covermode=set <<<
      PASS
      coverage FOR FMT: 64.9% of statements in strconv
      
      That the summary printed by 'go test [options] fmt' is unchanged:
      
      $ go test -cover fmt
      ok  	fmt	0.040s	coverage: 91.3% of statements
      
      $ go test -coverpkg strconv fmt
      ok  	fmt	0.038s	coverage: 64.9% of statements in strconv
      
      R=r
      CC=gobot, golang-dev
      https://golang.org/cl/10932045
      56cd47b2
    • Shenghou Ma's avatar
      misc/cgo/test: relax the threshold in test3250. · 39b5f3a4
      Shenghou Ma authored
      Fixes build for some slow FreeBSD/NetBSD/Darwin builder.
      
      R=golang-dev
      CC=golang-dev
      https://golang.org/cl/11207043
      39b5f3a4
    • Russ Cox's avatar
      runtime: fix 386 build after cas64 change · f70a19f0
      Russ Cox authored
      Missed this in CL 10909045.
      
      TBR=golang-dev
      CC=golang-dev
      https://golang.org/cl/10803045
      f70a19f0
    • David Symonds's avatar
      encoding/json: escape U+2028 and U+2029. · d7546479
      David Symonds authored
      Fixes #5836.
      
      R=golang-dev, bradfitz, r, rsc
      CC=golang-dev
      https://golang.org/cl/10883045
      d7546479
    • Russ Cox's avatar
      runtime: make cas64 like cas32 and casp · fb63e4fe
      Russ Cox authored
      The current cas64 definition hard-codes the x86 behavior
      of updating *old with the new value when the cas fails.
      This is inconsistent with cas32 and casp.
      Make it consistent.
      
      This means that the cas64 uses will be epsilon less efficient
      than they might be, because they have to do an unnecessary
      memory load on x86. But so be it. Code clarity and consistency
      is more important.
      
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/10909045
      fb63e4fe
    • Russ Cox's avatar
      run.bash: actually stop on cgo failures · 3a8845b5
      Russ Cox authored
      I hate bash.
      
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/11200043
      3a8845b5
    • Russ Cox's avatar
      misc/cgo/test: make test work with -linkmode=internal · 41fd4f98
      Russ Cox authored
      The static func named thread in issue5337.go's C snippet
      conflicts with the static func named thread in issue3350.go's C snippet.
      I don't know why (they're both static) but I also don't care,
      because -linkmode=internal only needs to be able to handle
      the cgo in the standard library, and it does.
      
      Change the test to avoid this problem.
      
      Fixes build (after run.bash is fixed to detect the breakage).
      
      R=minux.ma
      TBR=minux.ma
      CC=golang-dev
      https://golang.org/cl/11201043
      41fd4f98
    • Russ Cox's avatar
      cmd/ld: place read-only data in non-executable segment · d6d83c91
      Russ Cox authored
      R=golang-dev, dave, r
      CC=golang-dev, nigeltao
      https://golang.org/cl/10713043
      d6d83c91
    • Russ Cox's avatar
      cmd/5l, cmd/6l, cmd/8l: increase error buffer size · 6c99b5c0
      Russ Cox authored
      STRINGSZ (200) is fine for lines generated by things like
      instruction dumps, but an error containing a couple file
      names can easily exceed that, especially on Macs with
      the ridiculous default $TMPDIR.
      
      R=ken2
      CC=golang-dev
      https://golang.org/cl/11199043
      6c99b5c0
    • Russ Cox's avatar
      cmd/gc: fix error message for import as 'init' · 1d4ed0c8
      Russ Cox authored
      Fixes #5853.
      
      R=ken2
      CC=golang-dev
      https://golang.org/cl/11104044
      1d4ed0c8
    • Paul Borman's avatar
      json: unmarshal types that are byte slices. · 59306493
      Paul Borman authored
      The json package cheerfully would marshal
      
              type S struct {
                      IP net.IP
              }
      
      but would give an error when unmarshalling.  This change allows any
      type whose concrete type is a byte slice to be unmarshalled from a
      string.
      
      Fixes #5086.
      
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/11161044
      59306493
    • Alex Brainman's avatar
      make.bat: incease runtime test timeout to 300s (fixes build) · 09e72f56
      Alex Brainman authored
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/11064044
      09e72f56
  6. 11 Jul, 2013 5 commits