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

Issue 802013002: Avoid duplicate definitions of JSCONST_n*Hash and QeTable variables. (Closed)

Created:
6 years ago by brucedawson
Modified:
6 years ago
Reviewers:
Bo Xu
CC:
pdfium-reviews_googlegroups.com, Tom Sepez
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Avoid duplicate definitions of JSCONST_n*Hash and QeTable variables. QeTable is a 752 byte array that was defined in a header file. This caused it to be instantiated by the VC++ compiler 12 times, wasting 8,272 bytes of space in the data segment. Because 'const' implies 'static' this did not cause any duplicate symbol errors. JSCONST_n*HASH are a set of eight variables that are defined in a header file. This causes them to be replicated 15 times. The variables themselves are tiny but they are dynamically initialized and this dynamic initialization code is replicated 15 times. When tested on pdfium_test.exe the effect of this change is to: Reduce the .text (code) segment by 3,616 bytes. Reduce the .rdata section by 8,656 bytes. Reduce the total binary file size by 13312 bytes. These are the worst offenders for pdf.dll as shown in: https://drive.google.com/open?id=1BvubxoA2SU_2e4T5cq7jHTjc1TlT0qOndpIfX3DMeA8&authuser=0 This will also drastically simplify the list of work to be done for bug 441899 (getting rid of initializers). BUG=441988 R=bo_xu@foxitsoftware.com Committed: https://pdfium.googlesource.com/pdfium/+/7be67b2e4f496cb638b365264ce835e3b23a555e

Patch Set 1 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+69 lines, -57 lines) Patch
M core/src/fxcodec/jbig2/JBig2_ArithQe.h View 1 chunk +1 line, -49 lines 0 comments Download
M core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp View 1 chunk +51 lines, -0 lines 3 comments Download
M fpdfsdk/include/javascript/JS_Define.h View 1 chunk +8 lines, -8 lines 0 comments Download
M fpdfsdk/src/javascript/global.cpp View 1 chunk +9 lines, -0 lines 3 comments Download

Messages

Total messages: 9 (3 generated)
brucedawson
This is a small optimization which saves a bit of space and also makes bug ...
6 years ago (2014-12-13 01:33:58 UTC) #2
Bo Xu
https://codereview.chromium.org/802013002/diff/1/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp File core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp (right): https://codereview.chromium.org/802013002/diff/1/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp#newcode14 core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp:14: extern const JBig2ArithQe QeTable[] = { The "extern" keyword ...
6 years ago (2014-12-13 01:47:37 UTC) #3
brucedawson
https://codereview.chromium.org/802013002/diff/1/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp File core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp (right): https://codereview.chromium.org/802013002/diff/1/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp#newcode14 core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp:14: extern const JBig2ArithQe QeTable[] = { On 2014/12/13 01:47:37, ...
6 years ago (2014-12-13 01:56:25 UTC) #4
Bo Xu
LGTM https://codereview.chromium.org/802013002/diff/1/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp File core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp (right): https://codereview.chromium.org/802013002/diff/1/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp#newcode14 core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp:14: extern const JBig2ArithQe QeTable[] = { On 2014/12/13 ...
6 years ago (2014-12-13 03:39:55 UTC) #5
commit-bot: I haz the power
Commit queue rejected this change because it did not recognize the base URL. Please commit ...
6 years ago (2014-12-13 05:24:31 UTC) #8
brucedawson
6 years ago (2014-12-13 05:30:43 UTC) #9
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
7be67b2e4f496cb638b365264ce835e3b23a555e (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698