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

Issue 1293923002: Restore function-local variables to use a vector. (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

Restore function-local variables to use a vector. CL 1282523002 changed the bitcode parser from using a vector, to using an unordered map. This was done because one could forward reference a local variable, and would freeze the computer trying to allocate a vector large enough to contain the index. This patch goes back to using vectors. To fix the forward variable reference, we use the number of bytes in the function to determine if the index is possible. This stops very large (probematic) vector resizes from happening. BUG=None R=stichnot@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=7a99327dae74a3abd7f222de1b218d20da665e1c

Patch Set 1 #

Patch Set 2 : Fix nit. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -55 lines) Patch
M src/PNaClTranslator.cpp View 1 7 chunks +36 lines, -42 lines 2 comments Download
A + tests_lit/parse_errs/Inputs/bad-var-fwdref.tbc View 1 chunk +7 lines, -13 lines 0 comments Download
A tests_lit/parse_errs/bad-var-fwdref.test View 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (2 generated)
Karl
5 years, 4 months ago (2015-08-17 17:43:43 UTC) #3
Karl
ping?
5 years, 4 months ago (2015-08-17 17:44:04 UTC) #4
Karl
On 2015/08/17 17:44:04, Karl wrote: > ping? Sorry, Ignore this ping. I still want the ...
5 years, 4 months ago (2015-08-17 17:47:23 UTC) #5
Jim Stichnoth
lgtm https://codereview.chromium.org/1293923002/diff/20001/src/PNaClTranslator.cpp File src/PNaClTranslator.cpp (right): https://codereview.chromium.org/1293923002/diff/20001/src/PNaClTranslator.cpp#newcode1339 src/PNaClTranslator.cpp:1339: std::vector<Ice::Operand *> LocalOperands; It occurs to me that ...
5 years, 4 months ago (2015-08-17 19:41:03 UTC) #6
Karl
Committed patchset #2 (id:20001) manually as 7a99327dae74a3abd7f222de1b218d20da665e1c (presubmit successful).
5 years, 4 months ago (2015-08-17 19:43:34 UTC) #7
Karl
5 years, 4 months ago (2015-08-17 19:47:34 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/1293923002/diff/20001/src/PNaClTranslator.cpp
File src/PNaClTranslator.cpp (right):

https://codereview.chromium.org/1293923002/diff/20001/src/PNaClTranslator.cpp...
src/PNaClTranslator.cpp:1339: std::vector<Ice::Operand *> LocalOperands;
On 2015/08/17 19:41:03, stichnot wrote:
> It occurs to me that using STL containers with the default allocator may be
> partially responsible for Subzero's scalability problems (along with similar
> uses outside the parser code).
> 
> If containers are local to a Cfg, then a simple change is e.g. from:
>   std::vector<Foo>
> to:
>   std::vector<Foo, CfgLocalAllocator<Foo>>
> The same holds for list<>, unordered_map<>, etc.
> 
> It would be good to try these changes in a separate CL.  I would look at
> -threads=0 and -threads=1 performance, before and after the change.
> 
> The same would be done later to the non-parser code as well.

Acknowledged.

Powered by Google App Engine
This is Rietveld 408576698