text/template: add an unexported method to Node
Protects the package a little against undesirable clients.

R=golang-dev, bradfitz, rsc
CC=golang-dev
http://codereview.appspot.com/6624054
text/template: fix nil crash on Templates
Fixes issue 3872.

R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/6612060
cmd/gc: make rnd() more 64-bit-friendly.

Fixes issue 4200.

R=golang-dev, dave, rsc
CC=golang-dev
http://codereview.appspot.com/6619057
cmd/6g: fix out of registers when chaining integer divisions.

Fixes issue 4201.

R=golang-dev, rsc
CC=golang-dev, remy
http://codereview.appspot.com/6622055
cmd/gc: avoid clobbering the AST in cgen_callmeth.

It confused the detection of init loops when involving
method calls.

Fixes issue 3890.

R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/6620067
image/jpeg: add DCT tests, do a small optimization (common sub-expression
elimination) in idct.go.

benchmark                   old ns/op    new ns/op    delta
BenchmarkIDCT                    5649         5610   -0.69%
BenchmarkDecodeRGBOpaque      2948607      2941051   -0.26%

The "type block" declaration moved so that idct.go is compilable
as a stand-alone file: "go tool 6g -S idct.go" works.

R=r
CC=golang-dev
http://codereview.appspot.com/6619056
doc/debugging_with_gdb: fix minor typo (space before comma)

R=golang-dev, r
CC=golang-dev
http://codereview.appspot.com/6610061

Committer: Rob Pike <r@golang.org>
image/jpeg: clean up BenchmarkDecode and BenchmarkEncode to not
refer to opacity. Those references were copy/pasted from the
image/png encoding benchmarks, which cares whether or not the
source image is opaque, but the JPEG encoder does not care.

R=r
CC=golang-dev
http://codereview.appspot.com/6623052
image/jpeg: move the level-shift and clip out of the idct function,
to be consistent with the fdct function, and to ease any future
idct rewrites in assembly.

The BenchmarkIDCT delta is obviously just an accounting change and not
a real saving, but it does give an indication of what proportion of
time was spent in the actual IDCT and what proportion was in shift and
clip. The idct time taken is now comparable to fdct.

The BenchmarkFDCT delta is an estimate of benchmark noise.

benchmark                   old ns/op    new ns/op    delta
BenchmarkFDCT                    3842         3837   -0.13%
BenchmarkIDCT                    5611         3478  -38.01%
BenchmarkDecodeRGBOpaque      2932785      2929751   -0.10%

R=r
CC=golang-dev
http://codereview.appspot.com/6625057
cmd/5g: avoid temporary in slice bounds check

before

func addr(s[]int) *int {
        return &s[2]
   10c1c:       e28d0008        add     r0, sp, #8
   10c20:       e5901004        ldr     r1, [r0, #4]
   10c24:       e3a02002        mov     r2, #2
   10c28:       e1510002        cmp     r1, r2
   10c2c:       8a000000        bhi     10c34 <main.addr+0x34>
   10c30:       eb0035e6        bl      1e3d0 <runtime.panicindex>
   10c34:       e5900000        ldr     r0, [r0]
   10c38:       e2800008        add     r0, r0, #8
   10c3c:       e58d0014        str     r0, [sp, #20]
   10c40:       e49df004        pop     {pc}            ; (ldr pc, [sp], #4)

after

func addr(s[]int) *int {
	return &s[2]
   10c1c:       e28d0008        add     r0, sp, #8
   10c20:       e5901004        ldr     r1, [r0, #4]
   10c24:       e3510002        cmp     r1, #2
   10c28:       8a000000        bhi     10c30 <main.addr+0x30>
   10c2c:       eb0035e6        bl      1e3cc <runtime.panicindex>
   10c30:       e5900000        ldr     r0, [r0]
   10c34:       e2800008        add     r0, r0, #8
   10c38:       e58d0014        str     r0, [sp, #20]
   10c3c:       e49df004        pop     {pc}            ; (ldr pc, [sp], #4)

Also, relax gcmp restriction that 2nd operand must be a register. A followup
CL will address the remaining TODO items.

R=rsc, remyoudompheng, minux.ma
CC=golang-dev
http://codereview.appspot.com/6620064
cmd/gc: Don't export embedded builtins

Fixes issue 4124.

R=golang-dev, dave, minux.ma, remyoudompheng, rsc
CC=golang-dev
http://codereview.appspot.com/6543057
cmd/gc: don't dereference a nil Type pointer in widstruct

The nil dereference in the next few lines doesn't seem
to cause a segmentation fault on Unix, but does seem
to halt the Go compiler.

The following is a test case:

>>>
package main

func mine(int b) int {
        return b + 2
}

func main() {
        mine()

        c = mine()
}
<<<

Without this change only the following is caught:

typecheck.go:3: undefined: b
typecheck.go:4: undefined: b

with it, we catch all the errors:

typecheck.go:3: undefined: b
typecheck.go:4: undefined: b
typecheck.go:10: undefined: c
typecheck.go:10: cannot assign to c .

R=rsc, minux.ma
CC=golang-dev
http://codereview.appspot.com/6542060

Committer: Shenghou Ma <minux.ma@gmail.com>
cmd/gc: fix output filename generation on Windows

R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/6610060
image/jpeg: move the huffman bit decoder state higher up in the
decoder struct, inside the unmappedzero limit, to eliminate some
TESTB instructions in the inner decoding loop.

benchmark          old ns/op    new ns/op    delta
BenchmarkDecode      2943204      2746360   -6.69%

R=r, dave
CC=golang-dev
http://codereview.appspot.com/6625058