Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Issue 460593003: Initial import of ChangeLowering. (Closed)

Created:
6 years, 4 months ago by Benedikt Meurer
Modified:
6 years, 4 months ago
Reviewers:
titzer, Jarin
CC:
v8-dev
Project:
v8
Visibility:
Public.

Description

Initial import of ChangeLowering. ChangeLowering is a Reducer to lower simplified change operators to machine subgraphs. This initial version supports ChangeBitToBool, ChangeBoolToBit, ChangeTaggedToFloat64 and ChangeInt32ToTagged. TEST=compiler-unittests/change-lowering-unittest BUG=v8:3489 LOG=n R=jarin@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=23068

Patch Set 1 #

Total comments: 2

Patch Set 2 : Fix #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+1168 lines, -9 lines) Patch
A src/compiler/change-lowering.h View 1 chunk +79 lines, -0 lines 0 comments Download
A src/compiler/change-lowering.cc View 1 chunk +260 lines, -0 lines 7 comments Download
M src/compiler/node-properties.h View 2 chunks +5 lines, -6 lines 0 comments Download
M src/unique.h View 1 chunk +1 line, -1 line 0 comments Download
M test/compiler-unittests/DEPS View 1 chunk +2 lines, -1 line 0 comments Download
A test/compiler-unittests/change-lowering-unittest.cc View 1 chunk +257 lines, -0 lines 0 comments Download
M test/compiler-unittests/compiler-unittests.h View 1 chunk +0 lines, -1 line 0 comments Download
M test/compiler-unittests/compiler-unittests.gyp View 1 chunk +3 lines, -0 lines 0 comments Download
A test/compiler-unittests/node-matchers.h View 1 chunk +71 lines, -0 lines 0 comments Download
A test/compiler-unittests/node-matchers.cc View 1 1 chunk +453 lines, -0 lines 0 comments Download
M testing/gtest.gyp View 1 chunk +1 line, -0 lines 0 comments Download
A testing/gtest-type-names.h View 1 chunk +34 lines, -0 lines 0 comments Download
M tools/gyp/v8.gyp View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Benedikt Meurer
PTAL
6 years, 4 months ago (2014-08-12 06:30:52 UTC) #1
Jarin
lgtm https://codereview.chromium.org/460593003/diff/1/test/compiler-unittests/node-matchers.cc File test/compiler-unittests/node-matchers.cc (right): https://codereview.chromium.org/460593003/diff/1/test/compiler-unittests/node-matchers.cc#newcode54 test/compiler-unittests/node-matchers.cc:54: MatchResultListener* listener) const { Should not this be ...
6 years, 4 months ago (2014-08-12 08:22:38 UTC) #2
Benedikt Meurer
https://codereview.chromium.org/460593003/diff/1/test/compiler-unittests/node-matchers.cc File test/compiler-unittests/node-matchers.cc (right): https://codereview.chromium.org/460593003/diff/1/test/compiler-unittests/node-matchers.cc#newcode54 test/compiler-unittests/node-matchers.cc:54: MatchResultListener* listener) const { On 2014/08/12 08:22:38, jarin wrote: ...
6 years, 4 months ago (2014-08-12 08:24:02 UTC) #3
Benedikt Meurer
Committed patchset #2 manually as 23068 (presubmit successful).
6 years, 4 months ago (2014-08-12 08:24:36 UTC) #4
titzer
https://codereview.chromium.org/460593003/diff/20001/src/compiler/change-lowering.cc File src/compiler/change-lowering.cc (right): https://codereview.chromium.org/460593003/diff/20001/src/compiler/change-lowering.cc#newcode27 src/compiler/change-lowering.cc:27: Node* ChangeLoweringBase::ExternalConstant(ExternalReference reference) { This is a big duplication ...
6 years, 4 months ago (2014-08-13 08:59:47 UTC) #5
Benedikt Meurer
https://codereview.chromium.org/460593003/diff/20001/src/compiler/change-lowering.cc File src/compiler/change-lowering.cc (right): https://codereview.chromium.org/460593003/diff/20001/src/compiler/change-lowering.cc#newcode138 src/compiler/change-lowering.cc:138: Reduction ChangeLowering<4>::ChangeBoolToBit(Node* val) { Before it was simple and ...
6 years, 4 months ago (2014-08-13 09:03:42 UTC) #6
titzer
https://codereview.chromium.org/460593003/diff/20001/src/compiler/change-lowering.cc File src/compiler/change-lowering.cc (right): https://codereview.chromium.org/460593003/diff/20001/src/compiler/change-lowering.cc#newcode138 src/compiler/change-lowering.cc:138: Reduction ChangeLowering<4>::ChangeBoolToBit(Node* val) { On 2014/08/13 09:03:41, Benedikt Meurer ...
6 years, 4 months ago (2014-08-13 09:11:13 UTC) #7
Benedikt Meurer
https://codereview.chromium.org/460593003/diff/20001/src/compiler/change-lowering.cc File src/compiler/change-lowering.cc (right): https://codereview.chromium.org/460593003/diff/20001/src/compiler/change-lowering.cc#newcode138 src/compiler/change-lowering.cc:138: Reduction ChangeLowering<4>::ChangeBoolToBit(Node* val) { That's another option, sure. But ...
6 years, 4 months ago (2014-08-13 09:14:13 UTC) #8
titzer
On 2014/08/13 09:14:13, Benedikt Meurer wrote: > https://codereview.chromium.org/460593003/diff/20001/src/compiler/change-lowering.cc > File src/compiler/change-lowering.cc (right): > > https://codereview.chromium.org/460593003/diff/20001/src/compiler/change-lowering.cc#newcode138 ...
6 years, 4 months ago (2014-08-13 09:19:45 UTC) #9
Benedikt Meurer
On 2014/08/13 at 09:19:45, titzer wrote: > On 2014/08/13 09:14:13, Benedikt Meurer wrote: > > ...
6 years, 4 months ago (2014-08-13 09:26:41 UTC) #10
titzer
On 2014/08/13 09:26:41, Benedikt Meurer wrote: > On 2014/08/13 at 09:19:45, titzer wrote: > > ...
6 years, 4 months ago (2014-08-13 09:41:02 UTC) #11
Benedikt Meurer
On 2014/08/13 at 09:41:02, titzer wrote: > On 2014/08/13 09:26:41, Benedikt Meurer wrote: > > ...
6 years, 4 months ago (2014-08-13 09:43:47 UTC) #12
titzer
On 2014/08/13 09:43:47, Benedikt Meurer wrote: > On 2014/08/13 at 09:41:02, titzer wrote: > > ...
6 years, 4 months ago (2014-08-13 09:54:27 UTC) #13
Benedikt Meurer
6 years, 4 months ago (2014-08-13 10:05:38 UTC) #14
Message was sent while issue was closed.
On 2014/08/13 at 09:54:27, titzer wrote:
> On 2014/08/13 09:43:47, Benedikt Meurer wrote:
> > On 2014/08/13 at 09:41:02, titzer wrote:
> > > On 2014/08/13 09:26:41, Benedikt Meurer wrote:
> > > > On 2014/08/13 at 09:19:45, titzer wrote:
> > > > > On 2014/08/13 09:14:13, Benedikt Meurer wrote:
> > > > > >
> > > >
> >
https://codereview.chromium.org/460593003/diff/20001/src/compiler/change-lowe...
> > > > > > File src/compiler/change-lowering.cc (right):
> > > > > > 
> > > > > >
> > > >
> >
https://codereview.chromium.org/460593003/diff/20001/src/compiler/change-lowe...
> > > > > > src/compiler/change-lowering.cc:138: Reduction
> > > > > > ChangeLowering<4>::ChangeBoolToBit(Node* val) {
> > > > > > That's another option, sure. But I decided to do it this way.
> > > > > 
> > > > > This is not necessary complexity. You undid a simple branch and
replaced
> > it
> > > > with template specialization on the pointer size. This an abuse of
templates
> > > > with clear disadvantages and little or no benefit.
> > > > > 
> > > > > Can we please go back to the simpler code?
> > > > 
> > > > It was "a simple branch" because it was using the global state
implicitly
> > (i.e.
> > > > WordEqual and friends). Of course it's simple if you solve only a subset
of
> > the
> > > > actual problem. Doing it right will require the "simple branch" in many
> > places,
> > > > which is probably less readable than just having specialized templates.
> > > > 
> > > > Note that this class is not finished yet, and because we can now
actually
> > test
> > > > it, it'll be easy to refactor and remove the duplication.
> > > 
> > > As I mentioned, a simple field on the class would suffice to get rid of
the
> > dependency on the kPointerSize. A template is still IMHO overkill.
> > 
> > As I mentioned, you'll still need the simple branch on the simple field. So
> > that's just a matter of "template specialization" vs. "if specialization".
> > 
> > Let's see how things work out and if the template version is really much
more
> > complex compare to the if version, then we can easily refactor that.
> 
> Can we please do the simpler thing first? We shouldn't be using templates like
this until we are forced to really really good reasons.
> 
> Do the simpler thing first. It was already simple. Just go back to that.
> 
> BTW the MachineOperator builder already has a built-in word size, so you don't
even need a field on this class, just check the word size of the one passed in,
and in the test you can pass in one or the other.

As this is just a matter of personal preference, I'll do the actual work first
and check if it makes sense based on the result.

Powered by Google App Engine
This is Rietveld 408576698