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

Issue 700963002: Replace C++ bitfields with our own BitFields (Closed)

Created:
6 years, 1 month ago by Jakob Kummerow
Modified:
5 years, 2 months ago
Reviewers:
Sven Panne, brucedawson
CC:
v8-dev
Project:
v8
Visibility:
Public.

Description

Replace C++ bitfields with our own BitFields Shave this yak from orbit, it's the only way to be sure. BUG=chromium:427616 LOG=n R=svenpanne@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=25148

Patch Set 1 #

Total comments: 17

Patch Set 2 : fixed AST node field sizes; more scanner fixes; undid hydrogen.h/cc changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+552 lines, -425 lines) Patch
M src/ast.h View 1 17 chunks +122 lines, -69 lines 0 comments Download
M src/ast.cc View 1 3 chunks +10 lines, -11 lines 0 comments Download
M src/heap-snapshot-generator.h View 2 chunks +8 lines, -10 lines 0 comments Download
M src/heap-snapshot-generator.cc View 2 chunks +2 lines, -4 lines 0 comments Download
M src/heap-snapshot-generator-inl.h View 1 chunk +1 line, -1 line 0 comments Download
M src/hydrogen-instructions.h View 32 chunks +201 lines, -144 lines 0 comments Download
M src/hydrogen-instructions.cc View 9 chunks +120 lines, -132 lines 0 comments Download
M src/profile-generator.h View 3 chunks +9 lines, -4 lines 0 comments Download
M src/profile-generator.cc View 2 chunks +9 lines, -11 lines 0 comments Download
M src/profile-generator-inl.h View 2 chunks +6 lines, -9 lines 0 comments Download
M src/runtime/runtime-array.cc View 6 chunks +24 lines, -12 lines 0 comments Download
M src/scanner.cc View 1 9 chunks +14 lines, -11 lines 0 comments Download
M src/unicode.h View 2 chunks +17 lines, -6 lines 0 comments Download
M src/unicode-inl.h View 1 chunk +1 line, -1 line 0 comments Download
M src/utils.h View 1 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (2 generated)
Jakob Kummerow
As discussed. Some of these changes should not affect object layout at all; in some ...
6 years, 1 month ago (2014-11-04 21:45:21 UTC) #2
brucedawson
I looked through all of the .h files and some of the .cc files. All ...
6 years, 1 month ago (2014-11-05 01:33:18 UTC) #4
Jakob Kummerow
Thanks for looking. As I wrote before, I'm aware that some of the changes are ...
6 years, 1 month ago (2014-11-05 09:02:04 UTC) #5
Sven Panne
NOT LGTM as it is: ast.h must stay as it is, and the changes in ...
6 years, 1 month ago (2014-11-05 09:11:49 UTC) #6
Jakob Kummerow
PTAL. https://codereview.chromium.org/700963002/diff/1/src/ast.h File src/ast.h (right): https://codereview.chromium.org/700963002/diff/1/src/ast.h#newcode427 src/ast.h:427: uint32_t bit_field_; On 2014/11/05 09:11:49, Sven Panne wrote: ...
6 years, 1 month ago (2014-11-05 12:13:46 UTC) #7
Sven Panne
lgtm
6 years, 1 month ago (2014-11-05 12:23:20 UTC) #8
Jakob Kummerow
Committed patchset #2 (id:20001) manually as 25148 (presubmit successful).
6 years, 1 month ago (2014-11-05 12:41:15 UTC) #9
Nico
Zombie review comment! Can you expand on the "as discussed" bit a bit? The BUG= ...
5 years, 2 months ago (2015-10-23 00:24:11 UTC) #10
Jakob Kummerow
On 2015/10/23 00:24:11, Nico (vacation Fri Oct 23) wrote: > Zombie review comment! Can you ...
5 years, 2 months ago (2015-10-23 12:27:00 UTC) #11
brucedawson
5 years, 2 months ago (2015-10-23 13:54:41 UTC) #12
Message was sent while issue was closed.
Yup, 1-bit enum bitfields are a problem because enums are signed in VC++. 1-bit
int bitfields would show the same problem in gcc - a bitfield that can't store
'1' (0 and -1 only) is confusing.

Additionally the packing rules for bitfields can vary between compilers. In
particular, in VC++ different sized bitfield storage types don't pack together,
so bool doesn't pack with short or int, int doesn't pack with short, etc.

What a mess.

The initial problem was found by VC++'s /analyze which pointed out that we were
comparing one of the bitfields to '1', which is a value it could never have.

Powered by Google App Engine
This is Rietveld 408576698