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

Issue 1308413003: Inline constructors/destructor for JavaRef. (Closed)

Created:
5 years, 4 months ago by Torne
Modified:
5 years, 4 months ago
Reviewers:
rmcilroy
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Inline constructors/destructor for JavaRef. JavaRef<object> only contains a POD type (jobject); the destructor does nothing and the default constructor just NULL-initializes. Inline both. Also inline the non-default constructor when !DCHECK_IS_ON (but leave it out of line otherwise as it contains a nontrivial DCHECK). This saves 8736 bytes in the .text section as of the time of writing, but will save 40kB or more as we wrap more JNI method parameters in JavaRef. BUG=519562 Committed: https://crrev.com/cf27355590f9fff414fdcd86ac4fee074d1e6271 Cr-Commit-Position: refs/heads/master@{#345114}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Add comments warning about inlining #

Patch Set 3 : also comment .cc file #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -8 lines) Patch
M base/android/scoped_java_ref.h View 1 2 chunks +11 lines, -3 lines 0 comments Download
M base/android/scoped_java_ref.cc View 1 2 1 chunk +4 lines, -5 lines 0 comments Download

Messages

Total messages: 9 (3 generated)
Torne
Yes, I know what the C++ dos & donts guide says about inlining constructors/destructors, but ...
5 years, 4 months ago (2015-08-24 16:30:53 UTC) #2
rmcilroy
lgtm with a suggestion. https://codereview.chromium.org/1308413003/diff/1/base/android/scoped_java_ref.h File base/android/scoped_java_ref.h (right): https://codereview.chromium.org/1308413003/diff/1/base/android/scoped_java_ref.h#newcode50 base/android/scoped_java_ref.h:50: JavaRef() : obj_(NULL) {} Could ...
5 years, 4 months ago (2015-08-24 16:40:19 UTC) #3
Torne
On 2015/08/24 16:40:19, rmcilroy wrote: > lgtm with a suggestion. > > https://codereview.chromium.org/1308413003/diff/1/base/android/scoped_java_ref.h > File ...
5 years, 4 months ago (2015-08-24 16:47:26 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1308413003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1308413003/40001
5 years, 4 months ago (2015-08-24 16:50:57 UTC) #7
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 4 months ago (2015-08-24 17:41:39 UTC) #8
commit-bot: I haz the power
5 years, 4 months ago (2015-08-24 17:42:19 UTC) #9
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/cf27355590f9fff414fdcd86ac4fee074d1e6271
Cr-Commit-Position: refs/heads/master@{#345114}

Powered by Google App Engine
This is Rietveld 408576698