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

Issue 1776343004: Subzero: Tweaks to reduce malloc use. (Closed)

Created:
4 years, 9 months ago by Jim Stichnoth
Modified:
4 years, 9 months ago
Reviewers:
Eric Holk, Karl, sehr, John
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

Subzero: Tweaks to reduce malloc use. 1. Subzero constructs many strings based in part on function name. When function names are not present (as in properly finalized pexes), they are synthesized as something like "Function12345". We can shorten these strings to e.g. "F12345" by using --default-function-prefix=F . Similar for global variable names. Using short strings makes it much less likely to have to use malloc. As such, we force that to be the default in the browser translator build. For perf-testing the command-line version, the user can just add the option manually for now. Ultimately, we should avoid use of strings in this way. 2. The register allocator uses a few instances of llvm::SmallVector that are sized too small and therefore end up using malloc. This can be fixed in a clean way, and there is a TODO for it, but in the meantime we just bump the size. BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4360 R=jpp@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=843142fe0c5913df2391f9ac4608a02c038953cb

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -2 lines) Patch
M src/IceBrowserCompileServer.cpp View 1 chunk +7 lines, -0 lines 0 comments Download
M src/IceRegAlloc.h View 1 chunk +4 lines, -2 lines 2 comments Download

Messages

Total messages: 7 (3 generated)
Jim Stichnoth
4 years, 9 months ago (2016-03-09 23:12:49 UTC) #3
John
lgtm https://codereview.chromium.org/1776343004/diff/1/src/IceRegAlloc.h File src/IceRegAlloc.h (right): https://codereview.chromium.org/1776343004/diff/1/src/IceRegAlloc.h#newcode71 src/IceRegAlloc.h:71: llvm::SmallVector<RegWeight, REGS_SIZE> Weights; Perhaps change this to std::array?
4 years, 9 months ago (2016-03-09 23:15:41 UTC) #4
Jim Stichnoth
https://codereview.chromium.org/1776343004/diff/1/src/IceRegAlloc.h File src/IceRegAlloc.h (right): https://codereview.chromium.org/1776343004/diff/1/src/IceRegAlloc.h#newcode71 src/IceRegAlloc.h:71: llvm::SmallVector<RegWeight, REGS_SIZE> Weights; On 2016/03/09 23:15:41, John wrote: > ...
4 years, 9 months ago (2016-03-09 23:19:32 UTC) #5
Jim Stichnoth
4 years, 9 months ago (2016-03-09 23:19:44 UTC) #7
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
843142fe0c5913df2391f9ac4608a02c038953cb (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698