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

Issue 18761: Reduce the size of a release sample shell by 55k. (Closed)

Created:
11 years, 11 months ago by Dean McNamee
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Reduce the size of a release sample shell by 55k. The ExternalReferenceTable population code was code driven, using the list macro callbacks to call an Add() function. Additionally this Add() function was defined in the class defintion, making it inline. This caused this single function to be ~100k of code. It is now mostly table driven, but there are still some cases left as code, and these could be improved in the future for further reduction in binary size.

Patch Set 1 #

Total comments: 3

Patch Set 2 : Pull work into PopulateTable(). #

Unified diffs Side-by-side diffs Delta from patch set Stats (+103 lines, -33 lines) Patch
M src/serialize.cc View 1 5 chunks +103 lines, -33 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Dean McNamee
This change is kinda ugly, but this code was ugly before I got to it. ...
11 years, 11 months ago (2009-01-26 14:59:59 UTC) #1
Mads Ager (chromium)
LGTM
11 years, 11 months ago (2009-01-26 15:21:27 UTC) #2
olehougaard
LGTM http://codereview.chromium.org/18761/diff/1/2 File src/serialize.cc (right): http://codereview.chromium.org/18761/diff/1/2#newcode499 Line 499: }; Consider moving this to class scope. ...
11 years, 11 months ago (2009-01-26 15:24:40 UTC) #3
Dean McNamee
11 years, 11 months ago (2009-01-26 15:55:44 UTC) #4
Additionally, I pulled the code out of the constructor and into PopulateTable. 
This better follows the style guide (only trivial work in a constructor), and
due to ABI reasons for generating 2 constructors, this now saves a total of
57920 bytes on a final release shell.

I find it makes more sense to have the types along with the definitions, since
they aren't really part of the class, but more of a implementation detail of the
function.  If you think that's crazy, let me know.

On 2009/01/26 15:24:40, olehougaard wrote:
> LGTM
> 
> http://codereview.chromium.org/18761/diff/1/2
> File src/serialize.cc (right):
> 
> http://codereview.chromium.org/18761/diff/1/2#newcode499
> Line 499: };
> Consider moving this to class scope. I don't think we have any other types
with
> function scope.
> 
> http://codereview.chromium.org/18761/diff/1/2#newcode501
> Line 501: static const RefTableEntry ref_table[] = {
> Same with static const tables.
> 
> http://codereview.chromium.org/18761/diff/1/2#newcode575
> Line 575: 
> Ditto.

Powered by Google App Engine
This is Rietveld 408576698