summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_options.h
diff options
context:
space:
mode:
authorAlex Light <allight@google.com>2019-06-26 16:31:53 -0700
committerAlex Light <allight@google.com>2019-07-29 22:22:53 +0000
commitf3677471a58c2738a3d9dd05f07f01c18a5e61be (patch)
tree21b4279c1077e051b84aad12da29240672f54913 /compiler/driver/compiler_options.h
parentf1468b53d0427a45011fe6446d189babe0acd6e0 (diff)
Add ability to switch to index ids late.
In order to support some debugging features we need to have JNI code mostly running with jmethodIDs and jfieldIDs as opaque indexes disconnected from any underlying art data-structure pointers. For performance though we want to continue to use data-structure pointers as these IDs when debugging is not needed. To support both possibilities this adds support for changing from a 'swapablePointer' to either 'pointer' or 'indicies' regime at runtime. The SwapablePointer regime still uses pointers as the ids but creates the data-structures needed to ensure that we can (1) detect that the methods have pointer-type IDs and (2) we can change some WellKnownClass internal IDs from one to the other. Currently one must select this mode explicitly using '-Xopaque-jni-ids:swapable'. Depending on when the final jni-id-type is selected a small amount of extra memory is used. Currently manual testing of turning the default id-type to swapable and changing to pointer immediately after zygote-fork shows a additional 40-90 kb of shared zygote-heap memory. Test: ./test.py --host Test: m libfieldcounts; \ ./tools/jvmti-agents/field-counts/count-fields.py 'Ljava/lang/Class;.extData:Ldalvik/system/ClassExt;' 'Ldalvik/system/ClassExt;.jmethodIDs:Ljava/lang/Object;' 'Ldalvik/system/ClassExt;.staticJfieldIDs:Ljava/lang/Object;' 'Ldalvik/system/ClassExt;.instanceJfieldIDs:Ljava/lang/Object;' -p `adb shell pidof com.android.deskclock`; Examine output Bug: 134162467 Change-Id: I1885b10056d5dcc65dad5ae4f858ddc12ba79403
Diffstat (limited to 'compiler/driver/compiler_options.h')
0 files changed, 0 insertions, 0 deletions