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

Issue 6484008: Enable RTTI for ICU.... (Closed)

Created:
9 years, 10 months ago by jungshik at Google
Modified:
9 years, 7 months ago
CC:
chromium-reviews, jshin+watch_chromium.org
Visibility:
Public.

Description

Enable RTTI for ICU. ICU 4.6 uses RTTI (dynamic_cast and typeid) in many places. It'll increase the vtbl size. I'm gonna measure the size impact by making two builds: 1. With rtti enabled 2. With rtti disabled, but with dynamic_cast replaced with static_cast and typeid with 'something' buildable. This build wouldn't run properly, but for the size comparision, just compiling it should be fine. On Windows, we set _HAS_EXCEPTIONS to 0 in common.gypi. To build ICU without enabling exception as well on Windows, we replaced the following line #include <typeinfo> with #include "unicode/utypeinfo.h" and add a new file 'common/unicode/utypeinfo.h' with the following: #if defined(_MSC_VERSION) && _HAS_EXCEPTIONS == 0 #include <exception> using std::exception; #endif #include <typeinfo> BUG=61514 TEST=On all 3 platforms, Chrome can be built and can be run without crash. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=75186

Patch Set 1 #

Patch Set 2 : Enable RTTI for ICU.... #

Patch Set 3 : exception_handling disabled #

Patch Set 4 : '' #

Patch Set 5 : use _MSC_VERSION for conditional include on Win #

Total comments: 1

Patch Set 6 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+72 lines, -30 lines) Patch
M third_party/icu/icu.gyp View 1 2 3 4 5 2 chunks +30 lines, -0 lines 0 comments Download
A third_party/icu/public/common/unicode/utypeinfo.h View 1 2 3 4 5 1 chunk +12 lines, -0 lines 0 comments Download
M third_party/icu/source/common/rbbi.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/common/schriter.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/common/uchriter.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/common/ustrenum.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/calendar.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/currfmt.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/currunit.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/dtitvfmt.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/dtrule.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/format.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/measure.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/nfsubs.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/olsontz.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/rbnf.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/rbtz.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/selfmt.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/simpletz.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/tblcoll.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/timezone.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/tmunit.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/tmutfmt.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/translit.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/tzrule.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/tztrans.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/ucal.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/i18n/vtzone.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/test/intltest/citrtest.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/test/intltest/icusvtst.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/test/intltest/rbbitst.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/icu/source/test/intltest/uobjtest.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 10 (0 generated)
jungshik at Google
This is for ICU 4.6, which is not yet pulled in. I have yet to ...
9 years, 10 months ago (2011-02-10 19:43:17 UTC) #1
M-A Ruel
You can just compare the size with the current version of ICU in optimized build. ...
9 years, 10 months ago (2011-02-10 19:55:08 UTC) #2
Mark Mentovai
LGTM for the experiments, but not LGTM for an actual live release until your investigation ...
9 years, 10 months ago (2011-02-10 19:59:29 UTC) #3
jungshik at Google
On 2011/02/10 19:59:29, Mark Mentovai wrote: > LGTM for the experiments, but not LGTM for ...
9 years, 10 months ago (2011-02-12 03:02:45 UTC) #4
jungshik at Google
Patch set 5 does the following: - enable RTTI - disable exception handling - To ...
9 years, 10 months ago (2011-02-15 01:28:06 UTC) #5
jungshik at Google
The raw data for the measurements is at https://spreadsheets.google.com/pub?key=0AqR-4TI2U6sidHZPNFdpQXR2WmRFMDl5THNMV2lUWlE&hl=en&output=html
9 years, 10 months ago (2011-02-15 01:33:35 UTC) #6
Mark Mentovai
Patch set 5 is LGTM in as far as the Mac is concerned, and the ...
9 years, 10 months ago (2011-02-15 02:17:59 UTC) #7
jungshik at Google
Thank you for the review. On 2011/02/15 02:17:59, Mark Mentovai wrote: > Patch set 5 ...
9 years, 10 months ago (2011-02-15 07:50:47 UTC) #8
Marc-Antoine Ruel (Google)
I think it'd be nicer to have a typeinfo.h that would do the wrap up ...
9 years, 10 months ago (2011-02-15 13:48:43 UTC) #9
jungshik at Google
9 years, 10 months ago (2011-02-16 21:30:41 UTC) #10
On 2011/02/15 13:48:43, Marc-Antoine Ruel (Google) wrote:
> I think it'd be nicer to have a typeinfo.h that would do the wrap up but I
don't
> really mind at that point, having it upstreamed would be the most important
> thing to reduce pain.
> 
> So the change itself LGTM. Sorry for the pain.
> 
>
http://codereview.chromium.org/6484008/diff/14001/third_party/icu/source/comm...
> File third_party/icu/source/common/rbbi.cpp (right):
> 
>
http://codereview.chromium.org/6484008/diff/14001/third_party/icu/source/comm...
> third_party/icu/source/common/rbbi.cpp:13: #if defined(_MSC_VER) &&
> defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS
> I think  
> #if defined(_MSC_VER) && _HAS_EXCEPTIONS == 0
> would work and would be a tad shorter?

Thank you for the suggestion. In patch set 6, I did that (and added a new file
utypeinfo.h and refer to it in individual files). I've also suggested that to
the upstream, too. 

As for the size impact,  to make sure, I build official builds on Windows and as
expected, the size increase is modest (34.8kB) and is swamped by the ICU data
size reduction. 

I'll land patch set 6. Thank you, all.

Powered by Google App Engine
This is Rietveld 408576698