Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1013)

Issue 13334052: code review 13334052: cmd/gc: eliminate redundant &x.Field nil checks (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 6 months ago by rsc
Modified:
11 years, 6 months ago
Reviewers:
CC:
ken2, golang-dev
Visibility:
Public.

Description

cmd/gc: eliminate redundant &x.Field nil checks This eliminates ~75% of the nil checks being emitted, on all architectures. We can do better, but we need a bit more general support from the compiler, and I don't want to do that so close to Go 1.2. What's here is simple but effective and safe. A few small code generation cleanups were required to make the analysis consistent on all systems about which nil checks are omitted, at least in the test. Fixes issue 6019.

Patch Set 1 #

Patch Set 2 : diff -r c111e30c49a4 https://code.google.com/p/go/ #

Patch Set 3 : diff -r 2e735aa41d4a https://code.google.com/p/go/ #

Patch Set 4 : diff -r 2e735aa41d4a https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+510 lines, -11 lines) Patch
M src/cmd/5g/ggen.c View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/5g/peep.c View 1 2 chunks +28 lines, -0 lines 0 comments Download
M src/cmd/5g/prog.c View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/5g/reg.c View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M src/cmd/6g/cgen.c View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/cmd/6g/ggen.c View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/6g/peep.c View 1 2 chunks +28 lines, -0 lines 0 comments Download
M src/cmd/8g/cgen.c View 1 2 1 chunk +28 lines, -0 lines 0 comments Download
M src/cmd/8g/ggen.c View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/8g/peep.c View 1 2 2 chunks +28 lines, -0 lines 0 comments Download
M src/cmd/gc/gen.c View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M src/cmd/gc/pgen.c View 1 2 2 chunks +6 lines, -2 lines 0 comments Download
M src/cmd/gc/popt.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
M src/cmd/gc/popt.c View 1 2 1 chunk +184 lines, -0 lines 0 comments Download
M src/cmd/gc/walk.c View 1 2 1 chunk +0 lines, -5 lines 0 comments Download
A test/nilptr3.go View 1 2 1 chunk +191 lines, -0 lines 0 comments Download

Messages

Total messages: 2
rsc
Hello ken2 (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
11 years, 6 months ago (2013-09-17 20:54:20 UTC) #1
rsc
11 years, 6 months ago (2013-09-17 20:54:28 UTC) #2
*** Submitted as https://code.google.com/p/go/source/detail?r=5981425e55ce ***

cmd/gc: eliminate redundant &x.Field nil checks

This eliminates ~75% of the nil checks being emitted,
on all architectures. We can do better, but we need
a bit more general support from the compiler, and
I don't want to do that so close to Go 1.2.
What's here is simple but effective and safe.

A few small code generation cleanups were required
to make the analysis consistent on all systems about
which nil checks are omitted, at least in the test.

Fixes issue 6019.

R=ken2
CC=golang-dev
https://codereview.appspot.com/13334052
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b