History log of /art/runtime/java_vm_ext.h
Revision Date Author Comments
ac4d45ae2999c0dbecbc31da3edbbc61d6ac6d61 15-Feb-2018 Ian Rogers <irogers@google.com> Reduce the scope of CheckJNI.

CheckJNI wasn't anonymous so that it could friend JniEnvExt. Add
accessors for the CheckJNI parts of JniEnvExt and make CheckJNI and
related classes anonymous. This is equivalent to making functions
within the scope of a file static and preferred now by cppstyle.
Make the force_copy_ field that could be const, const.
Test: m -j32; booted emulator.

Change-Id: I7e740d3b9bf4a3fedd30c4f44a852af67898d2f0
473191c4093aac1ec50bc275c588287fa37a981e 29-Dec-2017 Andreas Gampe <agampe@google.com> ART: Clean up library loading

Retrieve the library path from the classloader before attempting to
load, instead of getting it passed down. This allows unifying said
loading behavior for follow-up changes.

Fix up test code to support the new required data in classloader
objects.

Bug: 70901841
Test: m test-art-host
Test: device boots
Change-Id: Iaccaeb56422877abac9f7fe6f5a17364c8adf4ca
2ffb703bf431d74326c88266b4ddaf225eb3c6ad 08-Nov-2017 Igor Murashkin <iam@google.com> cpplint: Cleanup errors

Cleanup errors from upstream cpplint in preparation
for moving art's cpplint fork to upstream tip-of-tree cpplint.

Test: cd art && mm
Bug: 68951293
Change-Id: I15faed4594cbcb8399850f8bdee39d42c0c5b956
1b35b469e0e8a70d9fd3f6c22d7e828b044c0df8 30-Sep-2017 Andreas Gampe <agampe@google.com> ART: Add allocation tracking to JNI global refs

Add allocation tracking to global references. When the reference
table's free capacity falls under an adjustable value, enable
tracking so as to help tracking down possibly-leaky allocations.

Bug: 67044702
Test: m test-art-host
Change-Id: Ic17d6ebbad895b54c5ac63558027e04aef2b14c1
8a2a1fc5d7a338a9b29794b2ee5b40a1c24a4e52 30-Sep-2017 Andreas Gampe <agampe@google.com> ART: Dump allocation stacks in reference table dumps

When allocation tracking is enabled and allocation stacks are available,
print the stack traces of the objects in a reference table dumps, to
aid tracking table overflows.

Extend reference_table_test.

Bug: 67044702
Test: m test-art-host
Change-Id: I0118ba095f08dc66739707cd6a184487974b1570
57cf00bde719ddc84a6015b107b90a20169e3099 06-Jun-2017 Andreas Gampe <agampe@google.com> ART: Remove old object_callbacks.h includes

Remove unused includes.

Test: m
Change-Id: I70c227d32c6900904e186b975d1f2131b718d93d
3049324f4ef71b5d7a3de49bd77c75f07dbf8f3a 03-Nov-2016 Hiroshi Yamauchi <yamauchi@google.com> Make empty checkpoint work while weak ref access is disabled.

Fix a potential race on PushOntoMarkStack for CC by running an empty
checkpoint (while weak ref access is disabled).

Bug: 32508093
Bug: 12687968
Test: test-art-host with CC/CMS, libartd boot with N9, Ritz EAAC.
Change-Id: I3749bb525e7734804307ee16262355f3fc730312
da0a69edb24122d3d35ce1483c5ab94de919d714 11-Oct-2016 Richard Uhler <ruhler@google.com> Return error message if IndirectReferenceTable construction fails.

Previously if there was an error when constructing the
IndirectReferenceTable, the error message was lost. Now expose and
include the error message when throwing an exception related to
failures to construct the IndirectReferenceTable.

The error message is propagated through JVMEnvExt, JavaVMExt, and
Runtime::Init as well.

Bug: 32013594
Test: Added new 151-OpenFileLimit runtest.
Test: m test-art-host, m test-art-target

Change-Id: I3692f6928c9570358571bce634569d6f14cdeb05
05a364c8d8271ceeca307d04736f53e92d03de9d 14-Oct-2016 Andreas Gampe <agampe@google.com> ART: Make JNI global and weak global locks global

Add them to Locks. Give the JNI global table lock
a lock level, close to the weak global JNI references.

Bug: 31684578
Test: m test-art-host
Change-Id: I3857a3b0be69b16811d9999096b2c42e7a25d227
c4f3925490a73da8dc74884a1deb965d4ecaf14e 06-Oct-2016 Mathieu Chartier <mathieuc@google.com> Move remaining jobject related functions to use ObjPtr

Also added ObjPtr::DownCast.

Bug: 31113334

Test: test-art-host

Change-Id: I59c253211dc435579ffdfd49f856861ab13d262c
0795f23920ee9aabf28e45c63cd592dcccf00216 28-Sep-2016 Mathieu Chartier <mathieuc@google.com> Clean up ScopedThreadStateChange to use ObjPtr

Also fixed inclusion of -inl.h files in .h files by adding
scoped_object_access-inl.h and scoped_fast_natvie_object_access-inl.h

Changed AddLocalReference / Decode to use ObjPtr.

Changed libartbenchmark to be debug to avoid linkage errors.

Bug: 31113334

Test: test-art-host

Change-Id: I4d2e160483a29d21e1e0e440585ed328b9811483
bdf7f1c3ab65ccb70f62db5ab31dba060632d458 31-Aug-2016 Andreas Gampe <agampe@google.com> ART: SHARED_REQUIRES to REQUIRES_SHARED

This coincides with the actual attribute name and upstream usage.
Preparation for deferring to libbase.

Test: m
Test: m test-art-host
Change-Id: Ia8986b5dfd926ba772bf00b0a35eaf83596d8518
185d134a3b43ab7529053e965917e0fa74bceba4 11-Aug-2016 Alex Light <allight@google.com> Add basic runtime-plugins support.

This allows one to pass shared-libraries on the command line that the
runtime will load as plugins. They have access to runtime code and can
install hooks to add functionality. Currently the only hook they can
touch is JavaVMExt::AddEnvironmentHook to register a callback for
GetEnv(). More hooks might be added in the future.

Test: ./test/run-test 900
Change-Id: I852b4daf5a3fa71e9888722bc07794632c0e5010
942dc298d7af3e60fe40c69b4b416ef144e5c723 24-Feb-2016 Dimitry Ivanov <dimitry@google.com> Simplify LoadNativeLibrary()

With ApplicationLoaders.getClassLoader() ensuring
linker-namespace initialization there is no longer
need for LoadNativeLibrary() and callers to pass
along namespace-specific information to art.

This change removes unnecessary parameters of such
calls.

Bug: http://b/27189432
Bug: http://b/22548808
Change-Id: I341d35a2d5195e634678b352f4361f8712984b69
(cherry picked from commit c286a7fcd8a446c086127bf03fd07f904e017336)
c286a7fcd8a446c086127bf03fd07f904e017336 24-Feb-2016 Dimitry Ivanov <dimitry@google.com> Simplify LoadNativeLibrary()

With ApplicationLoaders.getClassLoader() ensuring
linker-namespace initialization there is no longer
need for LoadNativeLibrary() and callers to pass
along namespace-specific information to art.

This change removes unnecessary parameters of such
calls.

Bug: http://b/27189432
Bug: http://b/22548808
Change-Id: I341d35a2d5195e634678b352f4361f8712984b69
d5bbadf44032510b1ce12d9e5f2adad9234cf6b9 15-Dec-2015 Dimitry Ivanov <dimitry@google.com> Use shared namespaces for bundled apps

Shared namespaces clone the list of loaded native
libraries from the caller namespace. This allows
classloaders for bundled apps to share already loaded
libraries with default namespace.

Bug: http://b/26165097
Bug: http://b/22548808
Change-Id: Ia90b603a0ca97194618b82fb191d6790a4b1f281
(cherry picked from commit 986f650d8b552e8b7dbebef1f50f015e7850edfc)
986f650d8b552e8b7dbebef1f50f015e7850edfc 15-Dec-2015 Dimitry Ivanov <dimitry@google.com> Use shared namespaces for bundled apps

Shared namespaces clone the list of loaded native
libraries from the caller namespace. This allows
classloaders for bundled apps to share already loaded
libraries with default namespace.

Bug: http://b/26165097
Bug: http://b/22548808
Change-Id: Ia90b603a0ca97194618b82fb191d6790a4b1f281
44409d33e05cd2f73d69e0a98daa5c9e2fe38089 11-Nov-2015 Dmitriy Ivanov <dimitry@google.com> Use isolated namespaces for app native libs

Linker namespaces provide necessary level
of isolation for application native libraries.

The native libraries will no longer be able to
mistakenly depend on platform private libraries
like /system/lib/libssl.so

This change creates one namespace for each instance
of class-loader and uses it when loading native libraries.

For backwards compatibility with older apps we keep
using default namespace and LD_LIBRARY_PATH if target
sdk version is <= 23. (currently set to 0 for testing)

Bug: http://b/22548808
Change-Id: I64e97af7450fbf7e3740ccddda96bb2f7c52e03b
(cherry picked from commit f5a3099c509cf9b8a4ce9c3073a4db47e14a23bc)
f5a3099c509cf9b8a4ce9c3073a4db47e14a23bc 11-Nov-2015 Dmitriy Ivanov <dimitry@google.com> Use isolated namespaces for app native libs

Linker namespaces provide necessary level
of isolation for application native libraries.

The native libraries will no longer be able to
mistakenly depend on platform private libraries
like /system/lib/libssl.so

This change creates one namespace for each instance
of class-loader and uses it when loading native libraries.

For backwards compatibility with older apps we keep
using default namespace and LD_LIBRARY_PATH if target
sdk version is <= 23. (currently set to 0 for testing)

Bug: http://b/22548808
Change-Id: I64e97af7450fbf7e3740ccddda96bb2f7c52e03b
04302dbb106d590ff72c0dfecda23d85b6565059 12-Nov-2015 Hiroshi Yamauchi <yamauchi@google.com> Fix class unloading with the CC collector.

Avoid unnecessarily decoding dex cache and class loader weak roots,
which would trigger read barriers.

Re-enable 141-class-unload with the CC collector.

Bug: 12687968
Bug: 24468364
Change-Id: Ib4c19f25000873cab0e06047040442d135285745
598302ac91fd3e990f50e1aa530c3ad61d6d946e 23-Sep-2015 Mathieu Chartier <mathieuc@google.com> Call JNI_OnUnload when class loaders get collected

Added test case to 141-class-unload.

Bug: 22720414
Change-Id: I0575fae72521520a17587e8b0088bf8112705ad8
498b160f0cb61ea4756d8ce859ae73c522366458 17-Sep-2015 Hiroshi Yamauchi <yamauchi@google.com> Allow null self only in DecodeWeakGlobalDuringShutdown().

To follow up CL 169855, allow a null current thread only in
DecodeWeakGlobalDuringShutdown() as a special case rather than
DecodeWeakGlobal(). This is to prevent a bug where null is accidentally
passed to DecodeWeakGlobal().

Bug: 23897251

Change-Id: I5e7bb78ec739b8bfcf77284ed321d507737ee33e
fdbd13c7af91a042eda753e436eeebf0e1937250 03-Sep-2015 Hiroshi Yamauchi <yamauchi@google.com> Some fixes for the CC collector.

- Remove a DCHECK in DisableMarkingCheckpoint, which caused
occasional (false) failures.
- Check the thread-local GetWeakRefAccessEnabled in boxed lambdas weak
access.
- Add missing BroadcastForNewAllocationRecords and
BroadcastForNewWeakBoxedLambdas. The lack of the former caused
occasional deadlocks in the ddmc test.
- Remove the 'ensure system weaks disallowed' calls, which weren't
useful and dead.

Bug: 12687968
Change-Id: I33850c8d12e6e1a3aed1c2bb18eba263cbab76e8
30b5e27083913bb711fca0ca89a941797fcf3d5d 01-Sep-2015 Mathieu Chartier <mathieuc@google.com> Enable lockless decoding of weak globals

Will help speed up decoding weak DexCache roots.

Change-Id: I9a68beb4106cbd383111a30e249c9b0149064e78
673ed3d8aedc5462a47ded827c99f35d46525457 28-Aug-2015 Mathieu Chartier <mathieuc@google.com> Revert "Revert "Change dex caches to be weak roots""

This reverts commit 81a9087f0df0518c39405b7d18ba5858a6d8b77b.

Boot.oat creation time goes from 4.7s to 4.9s on host due to extra
locking. Will try to improve this in another CL.

Bug: 23602225
Bug: 22720414

Change-Id: I7e25b75cfb63faa196c7b0f60e46cce50bf12021
90443477f9a0061581c420775ce3b7eeae7468bc 17-Jul-2015 Mathieu Chartier <mathieuc@google.com> Move to newer clang annotations

Also enable -Wthread-safety-negative.

Changes:
Switch to capabilities and negative capabilities.

Future work:
Use capabilities to implement uninterruptible annotations to work
with AssertNoThreadSuspension.

Bug: 20072211

Change-Id: I42fcbe0300d98a831c89d1eff3ecd5a7e99ebf33
97509954404d031594b2ecbda607314d169d512e 13-Jul-2015 Mathieu Chartier <mathieuc@google.com> Clean up GC callbacks to be virtual methods

Change-Id: Ia08034a4e5931c4fcb329c3bd3c4b1f301135735
0b71357fb52be9bb06d35396a3042b4381b01041 17-Jun-2015 Hiroshi Yamauchi <yamauchi@google.com> Thread-local mark stacks for the CC collector.

Thread-local mark stacks are assigned to mutators where they push
references in read barriers to reduce the (CAS) synchronization cost
in a global mark stack/queue.

We step through three mark stack modes (thread-local, shared,
GC-exclusive) and use per-thread flags to disable/enable system weak
accesses (only for the CC collector) instead of the existing global
one to safely perform the marking phase. The reasons are 1)
thread-local mark stacks for mutators need to be revoked using a
checkpoint to avoid races (incorrectly leaving a reference on mark
stacks) when terminating marking, and 2) we can’t use a checkpoint
while system weak accesses are disabled (or a deadlock would
happen). More details are described in the code comments.

Performance improvements in Ritzperf EAAC: a ~2.8% improvement
(13290->12918) in run time and a ~23% improvement (51.6s->39.8s) in
the total GC time on N5.

Bug: 12687968
Change-Id: I5d234d7e48bf115cd773d38bdb62ad24ce9116c7
3d21bdf8894e780d349c481e5c9e29fe1556051c 22-Apr-2015 Mathieu Chartier <mathieuc@google.com> Move mirror::ArtMethod to native

Optimizing + quick tests are passing, devices boot.

TODO: Test and fix bugs in mips64.

Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS.
Some of the savings are from removal of virtual methods and direct
methods object arrays.

Bug: 19264997

(cherry picked from commit e401d146407d61eeb99f8d6176b2ac13c4df1e33)

Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d

Fix some ArtMethod related bugs

Added root visiting for runtime methods, not currently required
since the GcRoots in these methods are null.

Added missing GetInterfaceMethodIfProxy in GetMethodLine, fixes
--trace run-tests 005, 044.

Fixed optimizing compiler bug where we used a normal stack location
instead of double on ARM64, this fixes the debuggable tests.

TODO: Fix JDWP tests.

Bug: 19264997

Change-Id: I7c55f69c61d1b45351fd0dc7185ffe5efad82bd3

ART: Fix casts for 64-bit pointers on 32-bit compiler.

Bug: 19264997
Change-Id: Ief45cdd4bae5a43fc8bfdfa7cf744e2c57529457

Fix JDWP tests after ArtMethod change

Fixes Throwable::GetStackDepth for exception event detection after
internal stack trace representation change.

Adds missing ArtMethod::GetInterfaceMethodIfProxy call in case of
proxy method.

Bug: 19264997
Change-Id: I363e293796848c3ec491c963813f62d868da44d2

Fix accidental IMT and root marking regression

Was always using the conflict trampoline. Also included fix for
regression in GC time caused by extra roots. Most of the regression
was IMT.

Fixed bug in DumpGcPerformanceInfo where we would get SIGABRT due to
detached thread.

EvaluateAndApplyChanges:
From ~2500 -> ~1980
GC time: 8.2s -> 7.2s due to 1s less of MarkConcurrentRoots

Bug: 19264997
Change-Id: I4333e80a8268c2ed1284f87f25b9f113d4f2c7e0

Fix bogus image test assert

Previously we were comparing the size of the non moving space to
size of the image file.

Now we properly compare the size of the image space against the size
of the image file.

Bug: 19264997
Change-Id: I7359f1f73ae3df60c5147245935a24431c04808a

[MIPS64] Fix art_quick_invoke_stub argument offsets.

ArtMethod reference's size got bigger, so we need to move other args
and leave enough space for ArtMethod* and 'this' pointer.

This fixes mips64 boot.

Bug: 19264997
Change-Id: I47198d5f39a4caab30b3b77479d5eedaad5006ab
e401d146407d61eeb99f8d6176b2ac13c4df1e33 22-Apr-2015 Mathieu Chartier <mathieuc@google.com> Move mirror::ArtMethod to native

Optimizing + quick tests are passing, devices boot.

TODO: Test and fix bugs in mips64.

Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS.
Some of the savings are from removal of virtual methods and direct
methods object arrays.

Bug: 19264997
Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d
83c81955bfbfe8fbe6daf215ca73e436747e3e60 28-May-2015 Jeff Hao <jeffhao@google.com> Fix updating of JNI references for String.<init>.

Was missing updates to globals and weak globals.

Bug: 21288130
Bug: 21440428

(cherry picked from commit 1a302fb4f84525289c1cf7a437f5be1999a75251)

Change-Id: I41b64e8aae906f5986de483db096d8191e45f260
1a302fb4f84525289c1cf7a437f5be1999a75251 28-May-2015 Jeff Hao <jeffhao@google.com> Fix updating of JNI references for String.<init>.

Was missing updates to globals and weak globals.

Bug: 21288130
Bug: 21440428
Change-Id: I5f801f68b61f6b066b441b92ace367e6ba434789
bb87e0f1a52de656bc77cb01cb887e51a0e5198b 03-Apr-2015 Mathieu Chartier <mathieuc@google.com> Refactor and improve GC root handling

Changed GcRoot to use compressed references. Changed root visiting to
use virtual functions instead of function pointers. Changed root visting
interface to be an array of roots instead of a single root at a time.
Added buffered root marking helper to avoid dispatch overhead.

Root marking seems a bit faster on EvaluateAndApplyChanges due to batch
marking. Pause times unaffected.

Mips64 is untested but might work, maybe.

Before:
MarkConcurrentRoots: Sum: 67.678ms 99% C.I. 2us-664.999us Avg: 161.138us Max: 671us

After:
MarkConcurrentRoots: Sum: 54.806ms 99% C.I. 2us-499.986us Avg: 136.333us Max: 602us

Bug: 19264997

Change-Id: I0a71ebb5928f205b9b3f7945b25db6489d5657ca
aaebaa0121be3b9d9f13630585304482cbcaeb4b 26-Jan-2015 Igor Murashkin <iam@google.com> art: Refactor RuntimeOptions/ParsedOptions

Refactor the RuntimeOptions to be a
type-safe map (VariantMap, see runtime_options.h) and the ParsedOptions
to delegate the parsing to CmdlineParser (see cmdline/cmdline_parser.h).

This is the start of a command line parsing refactor, and may include
more in the future (dex2oat, patchoat, etc).

For more details of the command line parsing generator usage see cmdline/README.md

Change-Id: Ic67c6bca5e1f33bf2ec60e2e3ff8c366bab91563
2cd334ae2d4287216523882f0d298cf3901b7ab1 09-Jan-2015 Hiroshi Yamauchi <yamauchi@google.com> More of the concurrent copying collector.

Bug: 12687968
Change-Id: I62f70274d47df6d6cab714df95c518b750ce3105
91c2f0cde2a009bd52aa1c3d1dee705cc02c932f 26-Nov-2014 Mathieu Chartier <mathieuc@google.com> Trim reference tables when we trim the heap

Before:
System server:
virtual shared shared private private
size RSS PSS clean dirty clean dirty # object
2200 300 229 0 80 0 220 77 /dev/ashmem/dalvik-indirect ref table (deleted)
Location:
1896 128 102 0 28 0 100 39 /dev/ashmem/dalvik-indirect ref table (deleted)

After:
virtual shared shared private private
size RSS PSS clean dirty clean dirty # object
System server:
2216 64 64 0 0 0 64 79 /dev/ashmem/dalvik-indirect ref table (deleted)
Location:
2120 48 48 0 0 0 48 67 /dev/ashmem/dalvik-indirect ref table (deleted)

No pause time regression measured in memalloc test.

(cherry picked from commit 84dc99d2fa67e5dff018685661cb2bff62132989)

Change-Id: I80d9bd3b98e888fa8f77d03df69f8479ed209986
2e158932354e5950eb59c79498ab46b0586885fd 11-Sep-2014 Mathieu Chartier <mathieuc@google.com> Delete pin table

The pin table was brought over from dalvik but not really needed
since ART doesn't support pinning in movable spaces. The only
thing it did was hold objects live for JNI functions.
This shouldn't be necessary since people keep jni references to
these objects or else they could never release the elements.

Bug: 17456946

(cherry picked from commit a967c62e4e6675d3553445aa8e95a09e7a3381b0)
Change-Id: Ibed0d029157ffb9e75ecd80d4d544d690986c090
68d8b42ddec39ec0174162d90d4abaa004d1983e 17-Jul-2014 Ian Rogers <irogers@google.com> Wire up check JNI force copy mode.

Increase check JNI checks.
Break apart jni_internal.h in to jni_env_ext.h and java_vm_ext.h.
Fix the abuse of ScopedObjectAccess/annotalysis by ScopedCheck in the case
of VM routines.
Make class loader override and shared library class loader JNI global
references rather than mirror pointers.
Clean-ups to native bridge.

Change-Id: If7c6110b5aade7a402bfb67534af86a7b2cdeb55