summaryrefslogtreecommitdiff
path: root/runtime/common_dex_operations.h
Commit message (Collapse)AuthorAgeFilesLines
* Revert^4 "Walk internal ArtField/ArtMethod pointers"Alex Light2019-10-071-0/+8
| | | | | | | | | | | | | Several of the new tests make use of the invoke-custom opcode. This opcode is not supported by dexter/slicer causing the tests to fail. This reverts commit c34eab45161c51bf63e548e44645cbcc59d01268. Reason for revert: Added tests to redefine-stress known failures Test: ./test.py --host --redefine-stress Bug: 134162467 Change-Id: Ic1b375a0cb1e44d0252c17115af92c269fb8efc5
* Revert "Revert^2 "Walk internal ArtField/ArtMethod pointers""Nicolas Geoffray2019-10-071-8/+0
| | | | | | | | | | This reverts commit ea2a3d949354c8b054983ba629c81bc5ff7163da. Bug: 134162467 Reason for revert: Fails redefine stress Change-Id: If487c0bcacaf3a3f565ff475b6dad8321e3428b9
* Revert^2 "Walk internal ArtField/ArtMethod pointers"Alex Light2019-10-041-0/+8
| | | | | | | | | | | | | | | | | This reverts commit 712fa800b2b78e527d36c88dc369bf4b723587ea. We incorrectly didn't check if a method was obsolete before giving its class's MethodIds array. We then incorrectly used this array and the (placeholder) -1 index to try to find the previous method-id. Since -1 is not a valid array index we got check failures. To fix this we simply added a check that the method is not obsolete and if it is we go to the slow-path. Reason for revert: Fixed issue causing out-of-bounds array access Test: ./test.py --host --debuggable --ndebuggable Bug: 134162467 Change-Id: Iaffefeab6e889b4fb6554a11452d0af051001cb7
* Revert "Walk internal ArtField/ArtMethod pointers"Nicolas Geoffray2019-10-041-8/+0
| | | | | | | | | | This reverts commit c84fc3a742b160ce51cbf01c2e5f971ccc0a2c6c. Bug: 134162467 Reason for revert: Test fails on debuggable. Change-Id: I240d58fafcc7434749947330b64c67d65b9b7a1e
* Walk internal ArtField/ArtMethod pointersAlex Light2019-10-031-0/+8
| | | | | | | | | | | | | | | During structural class redefinition we sometimes need to update some of the ArtMethod/ArtField pointers held by runtime frames. This adds support for doing this through a StackReflectiveHandleScope similar to the StackHandleScope used for holding object references. This also updates various places where reflective-handles to ArtMethods and ArtFields are needed, for example the JniIdManager, field Read/Write operations and events, field resolution, and the old debugger. Test: ./test.py --host Bug: 134162467 Change-Id: I4ea73e85956a07735c6d7b125c5828a4233670bc
* JVMTI Force early returnAlex Light2019-06-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Add support for can_force_early_return jvmti capability. This allows one to force java frames to exit early. Exited frames have all of their normal locks released. We implement this by modifying the existing method exit events to allow one to modify the exit value during the callback. This is used to implement ForceEarlyReturn by adding internal-only events that will change the return value of methods once they return (using kForcePopFrame) avoiding the need to modify the actual interpreter very deeply. This also makes it simple to continue to use the standard deoptimization functions to force the actual return. In order to simplify book-keeping the internal event is refcounted, not associated with any specific jvmtiEnv, and only settable on specific threads. The internal event is added by the ForceEarlyReturn function and then removed by the MethodExit event when we update the return value. Bug: 130028055 Test: ./test.py --host Change-Id: Ifa44605b4e8032605f503a654ddf4bd2fc6b60bf
* ObjPtr<>-ify instrumentation.Vladimir Marko2019-05-081-3/+3
| | | | | | | Test: m test-art-host-gtest Test: testrunner.py --host --interpreter Bug: 31113334 Change-Id: I95d9e1c9c9a0c9e460048c686c229618126b66d5
* ART: Move dex structs into own headerAndreas Gampe2019-01-021-1/+2
| | | | | | | | | Separating out the structs from DexFile allows them to be forward- declared, which reduces the need to include the dex_file header. Bug: 119869270 Test: m Change-Id: I32dde5a632884bca7435cd584b4a81883de2e7b4
* ART: Move to using locks.h instead of mutex.hAndreas Gampe2018-12-061-1/+1
| | | | | | | | When only annotating lock requirements, use locks.h. Bug: 119869270 Test: mmma art Change-Id: I1608b03254712feff0072ebad012c3af0cc3dda4
* Revert^4 "JVMTI PopFrame support"Alex Light2018-10-111-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 202b617acf477e8e8e11915f467120a0bd518e74. This unreverts commit 202b617acf. This unreverts commit 88a2a9d7a1. There were several bugs with the implementation of pop-frame related to interactions between the jit, exception handling, class-loading, and deoptimization. - We were instrumenting the target thread stack in cases where it was unnecessary which caused the exception handler to incorrectly determine that a method was not deoptimizable. This caused the pop-frame to be ignored. - We were incorrectly sending ExceptionCatch events if an exception suppressed by pop-frame would have been caught in the current frame. - We were allowing pop-frame to be used on threads suspended in the ClassLoad or ClassPrepare events despite having surprising semantics in that situation (see b/117615146). Needed to modify test 1953 slightly for inclusion in CTS. I needed to make the CTS entrypoint not run the class-load tests (since the cts configuration means the classes are loaded by the verifier and not the interpreter). I updated the expected.txt and check script to reflect this. Reason for revert: Fixed issue causing Exception events to sometimes eat PopFrame and other issues. Test: ./test.py --host Test: ./art/tools/run-libjdwp-tests.sh --mode=host Bug: 73255278 Bug: 111357976 Bug: 117533193 Bug: 117615146 Change-Id: I655c4fe769938cf41d7589f931d6710cf2001506
* Revert "Revert^2 "JVMTI PopFrame support""Nicolas Geoffray2018-10-101-9/+0
| | | | | | | | | | | | This reverts commit 1c7b1fcf0ff29d83d13d38d0451a54474ccf5964. Bug: 73255278 Bug: 111357976 bug: 117533193 Reason for revert: Test failures Change-Id: I9da863fd95264007c4efeb85539e704e83499dcf
* Revert^2 "JVMTI PopFrame support"Alex Light2018-10-081-0/+9
| | | | | | | | | | | | | | | | | | | This reverts commit f67d0cbf2743b29aa6e1be7ae2f71762b8762785. Redefine-stress causes classes to be loaded at slightly different places due to the deep verification needed to redefine a class. This would cause the parts of tests 1953 and 1954 to fail due to classes loading at unexpected times. We changed the test to skip these test-cases when they cannot be correctly executed. Reason for revert: Fixed issue causing tests to fail under redefine-stress Test: ./test.py --host Test: ./art/tools/run-libjdwp-tests.sh --mode=host Test: ./test/testrunner/testrunner.py --host --redefine-stress Bug: 73255278 Bug: 111357976 Change-Id: I46fb4aed878bcc9398f2b73ad5040d7c97aec3ef
* Revert "JVMTI PopFrame support"Alex Light2018-10-051-9/+0
| | | | | | | | | | This reverts commit 88a2a9d7a14b67e10525d93b0ee57d9dd6bc345a. Reason for revert: Fails class-load/prepare tests with jit-at-first-use. Bug: 73255278 Bug: 111357976 Test: None Change-Id: Id8dea6dcf124d56e3a8dfa19e6ed39cc70370c34
* JVMTI PopFrame supportAlex Light2018-10-041-0/+9
| | | | | | | | | | | | | | | | | Implement support for the JVMTI can_pop_frames capability. This works by marking shadow-frames with a bit that forces it to be popped or an instruction to be retried. When a PopFrame is requested the plugin will deoptimize the targeted thread and force the interpreter to deal with the frame pop. If the can_pop_frames capability is enabled the runtime will be forced to handle all exceptions through the interpreter. This is required to support PopFrame during some exception events. Test: ./test.py --host Test: ./art/tools/run-libjdwp-tests.sh --mode=host Bug: 73255278 Bug: 111357976 Change-Id: I62d6b1f4ff387c794ba45093c3d6773aaf642067
* ART: Fix missing field type crasherOrion Hodson2018-05-231-1/+6
| | | | | | | | | Avoids nullptr dereference when a field with a missing field type is assigned. Bug: b/79751666 Test: art/test.py --host -r -t 173 Change-Id: I5868793f57802ed3de60264eefa7eb98845ae126
* ART: Fix jvalue includesAndreas Gampe2018-05-161-0/+1
| | | | | | | JValue::SetL is defined in the -inl header. Fix up some clients. Test: mmma art Change-Id: I903532c767873847f7746680cf35083cb3408ecf
* Header library to remove dependence on runtime/David Sehr2018-02-281-1/+1
| | | | | | | | | | | | Add a new header library to remove libdexfile and others' dependence on runtime (typically runtime/base) includes in libdexfile. Also a small step to tease dexlayout and profman away from relying on these as well. Bug: 22322814 Test: make -j 50 checkbuild make -j 50 test-art-host-gtest Change-Id: I38e2fe399a75f4bc6318c77a71954c00ea73ec2b
* Create dex subdirectoryDavid Sehr2018-01-051-1/+1
| | | | | | | | | Move all the DexFile related source to a common subdirectory dex/ of runtime. Bug: 71361973 Test: make -j 50 test-art-host Change-Id: I59e984ed660b93e0776556308be3d653722f5223
* Make CodeItem fields privateMathieu Chartier2017-12-221-3/+4
| | | | | | | | | | | | | | | | | | | Make code item fields private and use accessors. Added a hand full of friend classes to reduce the size of the change. Changed default to be nullable and removed CreateNullable. CreateNullable was a bad API since it defaulted to the unsafe, may add a CreateNonNullable if it's important for performance. Motivation: Have a different layout for code items in cdex. Bug: 63756964 Test: test-art-host-gtest Test: test/testrunner/testrunner.py --host Test: art/tools/run-jdwp-tests.sh '--mode=host' '--variant=X32' --debug Change-Id: I42bc7435e20358682075cb6de52713b595f95bf9
* Refactor ArtField::GetType<>() as {Lookup,Resolve}Type().Vladimir Marko2017-11-061-1/+1
| | | | | | | | | And add no thread suspension assertion to LookupType() as well as ArtMethod::LookupResolvedClassFromTypeIndex(). Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: If1541ccb0aafeabb6d1dd5566f10afcac98a2ef1
* ART: Correct static invariant checksAndreas Gampe2017-10-231-2/+14
| | | | | | | | | | | | | | | Instances of initializing classes may leak to other threads. It is legal to execute methods and access fields, as long as they are not static. However, the class should still be initializing (or already be erroneous). Replace checks with this weaker invariant. Follow-up to commit 4e99b3d8955131f3fc71aa113f0fa71f0092cb6f. Bug: 15899971 Bug: 62478025 Bug: 67719550 Test: m test-art-host Change-Id: I63190253759df95ca54e40fd4117a24e12e0c069
* ART: Fix headersAndreas Gampe2017-10-231-0/+10
| | | | | | | Include required headers. Test: m Change-Id: Ifce6c7b7a977c8db8eb4bb5ca34e354566d552bb
* Read and write constraints for clinitChang Xing2017-07-291-0/+5
| | | | | | | | | | | | | | | | | For clinits executed during pre-compile within a transaction, they are constrained to only be able to access their own static fields because the results of iniitialization relying on static fields, either read or write, of other classes are runtiime determined. Further discussion can be found at b/62887449. When SGET and SPUT series instructions are executed, interpreter will check whether fields are static and does the target match with the transaction owner, if not, abort transaction and throw an exception. Test: make test-art-host -j64 Bug: 62887449 Change-Id: I3e655269c8af5f0b3f2c1841fdd2602c827c2757
* Add field access & modify JVMTI callbacksAlex Light2017-06-191-5/+16
| | | | | | | | | | | | | | This adds support for the FieldAccess and FieldModification callbacks in JVMTI and all other functions and behaviors associated with the can_generate_field_modification_events and can_generate_field_access_events capabilities. Tests follow in the next CL. Bug: 34409228 Test: ./test.py --host -j40 Change-Id: Id18fc53677cc1f96e1460c498ade7607219d5a79
* Stop interpreter from accessing code items of compiled code.Jeff Hao2017-05-251-7/+5
| | | | | | | | | | | | | | | | | | | The ArtInterpreterToCompiledCodeBridge accesses the code item in a number of places to handle argument marshalling. However, the code item of a compiled method should have no need to be accessed by the runtime at all, since the code has been compiled. By removing these accesses, there is a drop in the memory footprint of the dex file, since these code items remain untouched by the runtime. Includes fixes for JIT and deopt. For Maps: Systrace vdex memory usage: 19.4/33.4MB -> 18.8/33.4MB Dumpsys meminfo vdex PSS: 9371kB -> 9275kB Bug: 35800981 Test: mm test-art-host Change-Id: I3bf17f8866287d9a8f127c16da23bebb801456dc
* Revert "Stop interpreter from accessing code items of compiled code."Nicolas Geoffray2017-05-181-2/+2
| | | | | | | | | | The entrypoint of a method can change concurrently. Bug: 35800981 This reverts commit 178dce79220c16e6f0061bcd12e9e9683ec045ee. Change-Id: I25ae8d0d2830eb8412c52f61736bac7b16281c11
* Stop interpreter from accessing code items of compiled code.Jeff Hao2017-05-161-2/+2
| | | | | | | | | | | | | | | The ArtInterpreterToCompiledCodeBridge accesses the code item in a number of places to handle argument marshalling. However, the code item of a compiled method should have no need to be accessed by the runtime at all, since the code has been compiled. By removing these accesses, there is a drop in the memory footprint of the dex file, since these code items remain untouched by the runtime. Maps Vdex Memory Usage: 19.4/33.4MB -> 18.8/33.4MB Bug: 35800981 Test: mm test-art-host Change-Id: I147a9267ec022547b384374e1449d20bcab1ead2
* Revert "Stop interpreter from accessing code items of compiled code."Nicolas Geoffray2017-03-091-2/+2
| | | | | | | | Bug: 35800981 This reverts commit df79ddb545f0d6e71d6eebb9cb94aa6916351ee9. Change-Id: I04b1cb8d002ca330c0aa6e68b431c7f80c2779d6
* Stop interpreter from accessing code items of compiled code.Jeff Hao2017-03-091-2/+2
| | | | | | | | | | | | | The ArtInterpreterToCompiledCodeBridge accesses the code item in a number of places to handle argument marshalling. However, the code item of a compiled method should have no need to be accessed by the runtime at all, since the code has been compiled. By removing these accesses, there is a drop in the memory footprint of the dex file, since these code items remain untouched by the runtime. Bug: 35800981 Test: mm test-art-host Change-Id: Ib7d29c17e80b1690aa819d083f5b12739492ebd6
* ART: Make method handle runtime code callable from compiler.Orion Hodson2017-01-061-0/+199
Most of this change is moving the existing method handles code, but it also introduces a new header file, common_dex_operations.h, that has some operations taken from interpreter_common.{h,cc} that are also used by method handles (perform call, set field, get field). Bug: 30550796 Test: m test-art-host Change-Id: I2235e13770a5562950f2767f65a25ca273479150