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

Issue 7461026: Record ToBoolean's type information in Hydrogen's HBranch instruction, so we can use it in LCodeG... (Closed)

Created:
9 years, 5 months ago by Sven Panne
Modified:
9 years, 5 months ago
Reviewers:
fschneider, danno
CC:
v8-dev
Visibility:
Public.

Description

Record ToBoolean's type information in Hydrogen's HBranch instruction, so we can use it in LCodeGen::DoBranch later.

Patch Set 1 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -7 lines) Patch
src/hydrogen.h View 2 chunks +2 lines, -1 line 0 comments Download
src/hydrogen.cc View 2 chunks +7 lines, -3 lines 2 comments Download
src/hydrogen-instructions.h View 2 chunks +13 lines, -2 lines 2 comments Download
src/ia32/full-codegen-ia32.cc View 1 chunk +1 line, -1 line 0 comments Download
src/type-info.h View 1 chunk +4 lines, -0 lines 2 comments Download
src/type-info.cc View 2 chunks +7 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Sven Panne
9 years, 5 months ago (2011-07-22 14:36:03 UTC) #1
fschneider
LGTM. http://codereview.chromium.org/7461026/diff/1/src/hydrogen-instructions.h File src/hydrogen-instructions.h (right): http://codereview.chromium.org/7461026/diff/1/src/hydrogen-instructions.h#newcode939 src/hydrogen-instructions.h:939: ToBooleanStub::Types expected_input_types = ToBooleanStub::Types()) Maybe use a named ...
9 years, 5 months ago (2011-07-25 11:55:18 UTC) #2
Sven Panne
9 years, 5 months ago (2011-07-25 14:06:32 UTC) #3
http://codereview.chromium.org/7461026/diff/1/src/hydrogen-instructions.h
File src/hydrogen-instructions.h (right):

http://codereview.chromium.org/7461026/diff/1/src/hydrogen-instructions.h#new...
src/hydrogen-instructions.h:939: ToBooleanStub::Types expected_input_types =
ToBooleanStub::Types())
On 2011/07/25 11:55:19, fschneider wrote:
> Maybe use a named constant ToBooleanStub::kNoTypes or the like to make clearer
> what the default value is.

Done, but because C++ is a bit broken regarding constants of a class type, I'll
use a simple function instead.

http://codereview.chromium.org/7461026/diff/1/src/hydrogen.cc
File src/hydrogen.cc (right):

http://codereview.chromium.org/7461026/diff/1/src/hydrogen.cc#newcode2162
src/hydrogen.cc:2162: ToBooleanStub::Types
expected(builder->oracle()->ToBooleanTypes(test_id));
On 2011/07/25 11:55:19, fschneider wrote:
> It would be nicer to just write
> 
> ToBooleanStub::Types expected = builder->oracle()->ToBooleanTypes(test_id);

I think that using the combination of an empty constructor plus assignment
operator is actually worse than using the parameterized constructor alone,
because the former potentially wastes effort. In our concrete case, it probably
won't make a big difference, but in general the former is not a good idea IMHO.
(The user of a class shouldn't be required to know that the compiler hopefully
irons out any inefficiencies.)

http://codereview.chromium.org/7461026/diff/1/src/type-info.h
File src/type-info.h (right):

http://codereview.chromium.org/7461026/diff/1/src/type-info.h#newcode242
src/type-info.h:242: // cylces in our headers. Death to tons of implementations
in headers!! :-P
On 2011/07/25 11:55:19, fschneider wrote:
> It would be a perfect opportunity to untangle one of the cycles!
> 
> If you add the comment, please add a todo with a corresponding issue to track.
> Otherwise, it will never happen ;)

Untangling our huge header mess is a separate task which will require a few
days, probably even weeks. I've tried some seemingly innocuous cleanups several
times and almost always completely reverted after half a day or so. Firing up
doxygen on our sources, switching the browser to full-screen and admiring the
enormous header dependency graphs should convince anyone that this cleanup task
is not a minor one... ;-)

I'll add a TODO here.

Powered by Google App Engine
This is Rietveld 408576698