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

Issue 1278793006: Fix processing of global variable indices in the global vars block. (Closed)

Created:
5 years, 4 months ago by Karl
Modified:
5 years, 4 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

Fix processing of global variable indices in the global vars block. The code used to use a vector to hold global variables associated with indices. The problem was that the count record in the global vars block would generate variables for the given count (even if very large). To fix this, we created a local unordered map to associate indices with defined/referenced globals. After processing the global vars block, this unordered map is used to verify the size makes sense, and then install the recognized global variables into the (top-level) contents. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4257 R=stichnot@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=aa0ce790f7426ad3be6e3c648ba84abbf1928378

Patch Set 1 #

Patch Set 2 : Fix nit. #

Total comments: 6

Patch Set 3 : Fix nits. #

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

Messages

Total messages: 5 (1 generated)
Karl
5 years, 4 months ago (2015-08-06 21:43:26 UTC) #2
Jim Stichnoth
lgtm https://codereview.chromium.org/1278793006/diff/20001/src/PNaClTranslator.cpp File src/PNaClTranslator.cpp (left): https://codereview.chromium.org/1278793006/diff/20001/src/PNaClTranslator.cpp#oldcode1091 src/PNaClTranslator.cpp:1091: unsigned Index = Values[0]; Nice. Any other "unsigned" ...
5 years, 4 months ago (2015-08-06 22:09:13 UTC) #3
Karl
Committed patchset #3 (id:40001) manually as aa0ce790f7426ad3be6e3c648ba84abbf1928378 (presubmit successful).
5 years, 4 months ago (2015-08-07 16:29:01 UTC) #4
Karl
5 years, 4 months ago (2015-08-07 16:29:22 UTC) #5
Message was sent while issue was closed.
https://codereview.chromium.org/1278793006/diff/20001/src/PNaClTranslator.cpp
File src/PNaClTranslator.cpp (left):

https://codereview.chromium.org/1278793006/diff/20001/src/PNaClTranslator.cpp...
src/PNaClTranslator.cpp:1091: unsigned Index = Values[0];
On 2015/08/06 22:09:12, stichnot wrote:
> Nice.  Any other "unsigned" types that you can change to something like
> NaClBcIndexSize_t, would also be welcome.  (I generally try to avoid "int" and
> "unsigned" in favor of int32_t, uint32_t, size_t, etc.)

Acknowledged.

https://codereview.chromium.org/1278793006/diff/20001/src/PNaClTranslator.cpp
File src/PNaClTranslator.cpp (right):

https://codereview.chromium.org/1278793006/diff/20001/src/PNaClTranslator.cpp...
src/PNaClTranslator.cpp:948: NumFunctionIDs = Context->getNumFunctionIDs();
On 2015/08/06 22:09:12, stichnot wrote:
> Can this be added to the member initializer list?  Or is Context not
stabilized
> at that point?

I originally thought it had to wait. However, since it gets initialized after
the base class, it can be initialized as a member. Changing.

https://codereview.chromium.org/1278793006/diff/20001/src/PNaClTranslator.cpp...
src/PNaClTranslator.cpp:994: // Returns the global declaratoin associated with
the given index.
On 2015/08/06 22:09:12, stichnot wrote:
> declaration

Done.

Powered by Google App Engine
This is Rietveld 408576698