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

Issue 883493002: Remove unnecessary fields in top-level parser of Subzero. (Closed)

Created:
5 years, 11 months ago by Karl
Modified:
5 years, 10 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Remove unnecessary fields in top-level parser of Subzero. Cleans up code by removing unnecessary fields/data structures in top-level parser of Subzero. In particular: 1) Uses FunctionDeclarationList.size() instead of NumFunctionIds. 2) Removes the need for vector DefiningFunctionDeclarationList. Instead uses an (incremented) index NextDefiningFunctionID into vector FunctionDeclarationList. BUG=None R=jvoung@chromium.org, stichnot@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=0c729c8cb60f1316d589a5890abb5bdc1e59bc9f

Patch Set 1 #

Total comments: 6

Patch Set 2 : Fix issues in last patch. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -26 lines) Patch
M src/PNaClTranslator.cpp View 1 6 chunks +21 lines, -26 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
Karl
5 years, 11 months ago (2015-01-26 22:06:01 UTC) #2
jvoung (off chromium)
Could you describe more specifically waas is removed in the commit message (seems like all ...
5 years, 11 months ago (2015-01-26 22:58:02 UTC) #3
Jim Stichnoth
also otherwise lgtm https://codereview.chromium.org/883493002/diff/1/src/PNaClTranslator.cpp File src/PNaClTranslator.cpp (right): https://codereview.chromium.org/883493002/diff/1/src/PNaClTranslator.cpp#newcode237 src/PNaClTranslator.cpp:237: unsigned NumDeclaredFunctions = FunctionDeclarationList.size(); It's probably ...
5 years, 11 months ago (2015-01-26 23:12:54 UTC) #4
Karl
Committed patchset #2 (id:20001) manually as 0c729c8cb60f1316d589a5890abb5bdc1e59bc9f (presubmit successful).
5 years, 10 months ago (2015-01-28 18:58:33 UTC) #5
Karl
5 years, 10 months ago (2015-01-28 18:59:18 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/883493002/diff/1/src/PNaClTranslator.cpp
File src/PNaClTranslator.cpp (left):

https://codereview.chromium.org/883493002/diff/1/src/PNaClTranslator.cpp#oldc...
src/PNaClTranslator.cpp:2915: }
On 2015/01/26 22:58:02, jvoung wrote:
> Might be more clear to have a "bool IsProto = Values[2] == 1;" then pass that
to
> the create().

Done.

https://codereview.chromium.org/883493002/diff/1/src/PNaClTranslator.cpp
File src/PNaClTranslator.cpp (right):

https://codereview.chromium.org/883493002/diff/1/src/PNaClTranslator.cpp#newc...
src/PNaClTranslator.cpp:237: unsigned NumDeclaredFunctions =
FunctionDeclarationList.size();
On 2015/01/26 23:12:54, stichnot wrote:
> It's probably a good idea to change some of these "unsigned" declarations to
> something like size_t (or worse, std::vector::size_type).

For this field, and the local here, I will fix it to size_t. However, I am
hesitant to change more deeply since the base class NaClBitcodeParser assumes
ID's (in general) are unsigned (not size_t_. Will consider a separate CL to
consider more general clean ups on size_t and unsigned.

https://codereview.chromium.org/883493002/diff/1/src/PNaClTranslator.cpp#newc...
src/PNaClTranslator.cpp:375: unsigned NextDefiningFunctionID;
On 2015/01/26 22:58:02, jvoung wrote:
> Might be more clear to put this next FunctionDeclarationList and describe the
> relationship.
> 
> FunctionDeclarationList is filled first. It's the set of functions (either
> defined or isproto).
> 
> Then function definitions are encountered/parsed and NextDefiningFunctionID
> incremented to track the next actually-defined function.

Done.

Powered by Google App Engine
This is Rietveld 408576698