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

Issue 472553002: Make class lookup lazy in jni_generator when using lazy method lookup. (Closed)

Created:
6 years, 4 months ago by mkosiba (inactive)
Modified:
6 years, 4 months ago
CC:
chromium-reviews, klundberg+watch_chromium.org, erikwright+watch_chromium.org, yfriedman+watch_chromium.org, ilevy-cc_chromium.org
Project:
chromium
Visibility:
Public.

Description

Make class lookup lazy in jni_generator when using lazy method lookup. This removes the eager class registration from RegisterNatives when possible. BUG=402003 TBR=sievers@chromium.org, brettw@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=290810

Patch Set 1 #

Patch Set 2 : rebase #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 3

Patch Set 5 : use method for getting jclass #

Total comments: 14

Patch Set 6 : code review feedback #

Patch Set 7 : fix build #

Patch Set 8 : ignore clang warning about unused autogenerated method #

Patch Set 9 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+707 lines, -371 lines) Patch
M android_webview/lib/main/webview_entry_point.cc View 1 2 3 4 5 2 chunks +4 lines, -0 lines 0 comments Download
M base/BUILD.gn View 1 2 2 chunks +3 lines, -0 lines 0 comments Download
M base/android/base_jni_registrar.cc View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
A base/android/java/src/org/chromium/base/JNIUtils.java View 1 2 1 chunk +20 lines, -0 lines 0 comments Download
M base/android/jni_android.h View 1 2 3 4 5 2 chunks +20 lines, -0 lines 0 comments Download
M base/android/jni_android.cc View 1 2 3 4 5 6 3 chunks +56 lines, -1 line 0 comments Download
M base/android/jni_generator/golden_sample_for_tests_jni.h View 1 2 3 4 5 6 7 8 14 chunks +35 lines, -25 lines 0 comments Download
M base/android/jni_generator/jni_generator.py View 1 2 3 4 5 6 7 8 7 chunks +47 lines, -14 lines 0 comments Download
M base/android/jni_generator/testCalledByNatives.golden View 1 2 3 4 5 6 7 8 22 chunks +50 lines, -41 lines 0 comments Download
M base/android/jni_generator/testConstantsFromJavaP.golden View 1 2 3 4 5 6 7 8 88 chunks +201 lines, -193 lines 0 comments Download
M base/android/jni_generator/testEagerCalledByNativesOption.golden View 1 2 3 4 5 6 7 8 7 chunks +19 lines, -10 lines 0 comments Download
M base/android/jni_generator/testFromJavaP.golden View 1 2 3 4 5 6 7 8 12 chunks +31 lines, -23 lines 0 comments Download
M base/android/jni_generator/testFromJavaPGenerics.golden View 1 2 3 4 5 6 7 8 3 chunks +11 lines, -3 lines 0 comments Download
M base/android/jni_generator/testInnerClassNatives.golden View 1 2 3 4 5 6 7 8 3 chunks +11 lines, -3 lines 0 comments Download
M base/android/jni_generator/testInnerClassNativesBothInnerAndOuter.golden View 1 2 3 4 5 6 7 8 3 chunks +13 lines, -5 lines 0 comments Download
M base/android/jni_generator/testInnerClassNativesMultiple.golden View 1 2 3 4 5 6 7 8 3 chunks +13 lines, -5 lines 0 comments Download
M base/android/jni_generator/testJNIInitNativeNameOption.golden View 1 2 3 4 5 6 7 8 3 chunks +11 lines, -3 lines 0 comments Download
M base/android/jni_generator/testJarJarRemapping.golden View 1 2 3 4 5 6 7 8 3 chunks +11 lines, -3 lines 0 comments Download
M base/android/jni_generator/testMultipleJNIAdditionalImport.golden View 1 2 3 4 5 6 7 8 5 chunks +15 lines, -7 lines 0 comments Download
M base/android/jni_generator/testNativeExportsOption.golden View 1 2 3 4 5 6 7 8 10 chunks +30 lines, -18 lines 0 comments Download
M base/android/jni_generator/testNatives.golden View 1 2 3 4 5 6 7 8 3 chunks +11 lines, -3 lines 0 comments Download
M base/android/jni_generator/testNativesLong.golden View 1 2 3 4 5 6 7 8 3 chunks +11 lines, -3 lines 0 comments Download
M base/android/jni_generator/testPureNativeMethodsOption.golden View 1 2 3 4 5 6 7 8 3 chunks +11 lines, -3 lines 0 comments Download
M base/android/jni_generator/testSingleJNIAdditionalImport.golden View 1 2 3 4 5 6 7 8 5 chunks +15 lines, -7 lines 0 comments Download
A base/android/jni_utils.h View 1 2 3 4 5 1 chunk +27 lines, -0 lines 0 comments Download
A base/android/jni_utils.cc View 1 2 1 chunk +25 lines, -0 lines 0 comments Download
M base/base.gyp View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M base/base.gypi View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M ui/gl/android/scoped_java_surface.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 17 (0 generated)
mkosiba (inactive)
PTAL https://codereview.chromium.org/472553002/diff/60001/base/android/jni_android.cc File base/android/jni_android.cc (right): https://codereview.chromium.org/472553002/diff/60001/base/android/jni_android.cc#newcode134 base/android/jni_android.cc:134: ScopedJavaLocalRef<jobject> class_loader = GetClassLoader(env); having jni_android depend on ...
6 years, 4 months ago (2014-08-15 16:53:50 UTC) #1
mkosiba (inactive)
https://codereview.chromium.org/472553002/diff/60001/ui/gl/android/scoped_java_surface.cc File ui/gl/android/scoped_java_surface.cc (left): https://codereview.chromium.org/472553002/diff/60001/ui/gl/android/scoped_java_surface.cc#oldcode35 ui/gl/android/scoped_java_surface.cc:35: DCHECK(env->IsInstanceOf(surface.obj(), g_Surface_clazz)); On 2014/08/15 16:53:50, mkosiba wrote: > I ...
6 years, 4 months ago (2014-08-18 11:01:22 UTC) #2
Torne
https://codereview.chromium.org/472553002/diff/80001/base/android/jni_android.cc File base/android/jni_android.cc (right): https://codereview.chromium.org/472553002/diff/80001/base/android/jni_android.cc#newcode179 base/android/jni_android.cc:179: subtle::AtomicWord value = base::subtle::NoBarrier_Load(atomic_class_id); Can't we just return old ...
6 years, 4 months ago (2014-08-18 14:54:40 UTC) #3
rmcilroy
Looks good overall, a couple of suggestions. https://codereview.chromium.org/472553002/diff/80001/base/android/java/src/org/chromium/base/JNIUtils.java File base/android/java/src/org/chromium/base/JNIUtils.java (right): https://codereview.chromium.org/472553002/diff/80001/base/android/java/src/org/chromium/base/JNIUtils.java#newcode10 base/android/java/src/org/chromium/base/JNIUtils.java:10: public class ...
6 years, 4 months ago (2014-08-18 15:16:41 UTC) #4
Torne
https://codereview.chromium.org/472553002/diff/80001/base/android/jni_generator/jni_generator.py File base/android/jni_generator/jni_generator.py (right): https://codereview.chromium.org/472553002/diff/80001/base/android/jni_generator/jni_generator.py#newcode1128 base/android/jni_generator/jni_generator.py:1128: first_param_in_call = ('%s_clazz(env)' % (java_class,)) On 2014/08/18 15:16:41, rmcilroy ...
6 years, 4 months ago (2014-08-18 15:27:21 UTC) #5
rmcilroy
https://codereview.chromium.org/472553002/diff/80001/base/android/jni_generator/jni_generator.py File base/android/jni_generator/jni_generator.py (right): https://codereview.chromium.org/472553002/diff/80001/base/android/jni_generator/jni_generator.py#newcode1128 base/android/jni_generator/jni_generator.py:1128: first_param_in_call = ('%s_clazz(env)' % (java_class,)) On 2014/08/18 15:27:21, Torne ...
6 years, 4 months ago (2014-08-18 15:32:17 UTC) #6
mkosiba (inactive)
https://codereview.chromium.org/472553002/diff/80001/base/android/java/src/org/chromium/base/JNIUtils.java File base/android/java/src/org/chromium/base/JNIUtils.java (right): https://codereview.chromium.org/472553002/diff/80001/base/android/java/src/org/chromium/base/JNIUtils.java#newcode10 base/android/java/src/org/chromium/base/JNIUtils.java:10: public class JNIUtils { On 2014/08/18 15:16:41, rmcilroy wrote: ...
6 years, 4 months ago (2014-08-19 09:50:15 UTC) #7
rmcilroy
lgtm, thanks! https://codereview.chromium.org/472553002/diff/80001/base/android/java/src/org/chromium/base/JNIUtils.java File base/android/java/src/org/chromium/base/JNIUtils.java (right): https://codereview.chromium.org/472553002/diff/80001/base/android/java/src/org/chromium/base/JNIUtils.java#newcode10 base/android/java/src/org/chromium/base/JNIUtils.java:10: public class JNIUtils { On 2014/08/19 09:50:15, ...
6 years, 4 months ago (2014-08-19 10:42:00 UTC) #8
Torne
lgtm
6 years, 4 months ago (2014-08-19 10:58:08 UTC) #9
mkosiba (inactive)
Ross, please take a quick look at the most recent changes. I had to suppress ...
6 years, 4 months ago (2014-08-19 16:29:02 UTC) #10
rmcilroy
On 2014/08/19 16:29:02, mkosiba wrote: > Ross, please take a quick look at the most ...
6 years, 4 months ago (2014-08-19 17:03:51 UTC) #11
mkosiba (inactive)
TBR'ing brettw for base/ .gyp and .gn changes TBR'ing sievers for ui/gl
6 years, 4 months ago (2014-08-20 09:15:44 UTC) #12
mkosiba (inactive)
The CQ bit was checked by mkosiba@chromium.org
6 years, 4 months ago (2014-08-20 09:15:51 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mkosiba@chromium.org/472553002/160001
6 years, 4 months ago (2014-08-20 09:17:04 UTC) #14
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_dbg_tests_recipe on tryserver.chromium.linux ...
6 years, 4 months ago (2014-08-20 10:19:04 UTC) #15
commit-bot: I haz the power
Committed patchset #9 (160001) as 290810
6 years, 4 months ago (2014-08-20 11:19:59 UTC) #16
mkosiba (inactive)
6 years, 4 months ago (2014-08-20 13:52:51 UTC) #17
Message was sent while issue was closed.
this was reverted in https://codereview.chromium.org/492713002 since it broke
the build on the Android 64 bit builder.

Powered by Google App Engine
This is Rietveld 408576698