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

Issue 7395052: code review 7395052: exp/ssa: reimplement logic for field selection. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 3 months ago by adonovan
Modified:
12 years, 3 months ago
Reviewers:
CC:
gri, golang-dev
Visibility:
Public.

Description

exp/ssa: reimplement logic for field selection. The previous approach desugared the ast.SelectorExpr to make implicit field selections explicit. But: 1) it was clunky since it required allocating temporary syntax trees. 2) it was not thread-safe since it required poking types into the shared type map for the new ASTs. 3) the desugared syntax had no place to represent the package lexically enclosing each implicit field selection, so it was as if they all occurred in the same package as the explicit field selection. This meant unexported field names changed meaning. This CL does what I should have done all along: just generate the SSA instructions directly from the original AST and the promoted field information. Also: - add logStack util for paired start/end log messages. Useful for debugging crashes.

Patch Set 1 #

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

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

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

Total comments: 4

Patch Set 5 : diff -r 77d278b771f0 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+119 lines, -91 lines) Patch
src/pkg/exp/ssa/builder.go View 1 2 3 4 9 chunks +99 lines, -82 lines 0 comments Download
src/pkg/exp/ssa/func.go View 1 2 chunks +0 lines, -6 lines 0 comments Download
src/pkg/exp/ssa/promote.go View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
src/pkg/exp/ssa/ssa.go View 1 1 chunk +1 line, -1 line 0 comments Download
src/pkg/exp/ssa/util.go View 1 2 3 4 2 chunks +17 lines, -0 lines 0 comments Download

Messages

Total messages: 3
adonovan
Hello gri@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
12 years, 3 months ago (2013-02-23 04:59:50 UTC) #1
gri
LGTM I am not claiming to have understood the details. https://codereview.appspot.com/7395052/diff/6001/src/pkg/exp/ssa/builder.go File src/pkg/exp/ssa/builder.go (right): https://codereview.appspot.com/7395052/diff/6001/src/pkg/exp/ssa/builder.go#newcode548 ...
12 years, 3 months ago (2013-02-26 00:05:06 UTC) #2
adonovan
12 years, 3 months ago (2013-02-26 18:32:25 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=81bda3810efb ***

exp/ssa: reimplement logic for field selection.

The previous approach desugared the ast.SelectorExpr
to make implicit field selections explicit.  But:
1) it was clunky since it required allocating temporary
   syntax trees.
2) it was not thread-safe since it required poking
   types into the shared type map for the new ASTs.
3) the desugared syntax had no place to represent the
   package lexically enclosing each implicit field
   selection, so it was as if they all occurred in the
   same package as the explicit field selection.
   This meant unexported field names changed meaning.

This CL does what I should have done all along: just
generate the SSA instructions directly from the original
AST and the promoted field information.

Also:
- add logStack util for paired start/end log messages.
  Useful for debugging crashes.

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

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