summaryrefslogtreecommitdiff
path: root/runtime/stack.h
Commit message (Collapse)AuthorAgeFilesLines
* Do not create HandleScope for JNI transitions.Vladimir Marko2021-02-231-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We previously crated a HandleScope in the JNI transition frame to hold references passed as jobject (jclass, etc.) to the native function and these references were actually spilled twice during the transition. We now construct the jobject as a pointer to the reference spilled in the reserved out vreg area in the caller's frame. And the jclass for static methods is just a pointer to the method's declaring class. This reduces the amount of work required in the JNI transition, both on entry (in compiled stubs) and exit (in JniMethodEnd*). Some additional work is required when GC visits references of a native method as we need to walk over the method's shorty which was unnecessary for a HandleScope. Also fix Thread::InitStackHwm() to calculate correct stack size needed by the new Thread::IsJniTransitionReference(). The results for StringToBytesBenchmark on blueline little cores running at fixed frequency 1420800 are approximately arm64 (medians from 3 runs) before after timeGetBytesAscii EMPTY 447.33 436.86 timeGetBytesIso88591 EMPTY 440.52 431.13 timeGetBytesUtf8 EMPTY 432.31 409.82 arm (medians from 3 runs) before after timeGetBytesAscii EMPTY 500.53 490.87 timeGetBytesIso88591 EMPTY 496.45 495.30 timeGetBytesUtf8 EMPTY 488.84 472.68 Test: m test-art-host-gtest Test: testrunner.py --host Test: testrunner.py --host --gcstress Test: testrunner.py --host --jit-on-first-use Test: testrunner.py --host --jit-on-first-use --gcstress Test: run-gtests.sh Test: testrunner.py --target --optimizing Test: boots. Bug: 172332525 Change-Id: I658f9d87071587b3e89f31c65feca976a11e9cc2
* Fix bug in StackVisitor::GetVReg.Nicolas Geoffray2020-09-021-9/+12
| | | | | | | | | | Floats can be stored in core registers within compiled code, so use the representation returned by the stack maps to know which register to read a value. Bug: 147572335 Test: 457-regs Change-Id: Ibe6642f2fae8206f2c230006ae85d73b47501c3b
* Inclusive language fixesOrion Hodson2020-07-281-1/+1
| | | | | | | | | | | | Based on: https://source.android.com/setup/contribute/respectful-code #inclusivefixit Bug: 161336379 Bug: 161896447 Test: art/test.py --host --64 Change-Id: I02c96aa477c4be6af8384222f1f111cc7ae1eeac
* Clean up generated operator<<(os, enum).Vladimir Marko2020-06-111-1/+1
| | | | | | | | | | | | | | | | | Pass enums by value instead of const reference. Do not generate operator<< sources for headers that have no enums or no declarations of operator<<. Do not define the operator<< for flag enums; these were unused anyway. Add generated operator<< for some enums in nodes.h . Change the operator<< for ComparisonBias so that the graph visualizer can use it but do not use the generated operator<< yet as that would require changing checker tests. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Ifd4c455c2fa921a9668c966a13068d43b9c6e173
* Replace instrumention id with stack pointers.Nicolas Geoffray2020-01-311-0/+1
| | | | | | | | | | | | | | | | | Replace instrumentation ids for instrumentation frames, which are inherently broken (see b/72608560), and use stack addresses instead to properly identify which frames to pop / unwind. Bug: 72608560 Bug: 148166031 Test: ./art/test/testrunner/testrunner.py --trace --debuggable --ndebuggable --optimizing --interpreter --jit --debug --ndebug -j32 Test: run-libjdwp-tests.sh Test: 2011-stack-walk-concurrent-instrument Test: ./art/test/run-test --host --dev --runtime-option -verbose:deopt,plugin --prebuild --compact-dex-level fast --jit --no-relocate --create-runner --runtime-option -Xcheck:jni 1965-get-set-local-primitive-no-tables art/tools/parallel_run.py -j80 /tmp/path/to/runit.sh --out failure.txt Change-Id: I71f6e55b9da608796cd3142b147f7b50bbd292ec
* Revert "Fix stack-walking race"Alex Light2020-01-221-6/+0
| | | | | | | | | | | | | This reverts commit 721e40283793649b4750c05da4fe972bd372f7f9. Reason for revert: Wanted more discussion. Test: none Bug: 72608560 Bug: 29259363 Bug: 148166031 Change-Id: Id0fb201018a0d0bdca11d51ec156a41d6d7fe4ae
* Fix stack-walking raceAlex Light2020-01-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During stack walking it was possible for a walking thread to race with the InstrumentationInstallStack. In this case the stack changes made by InstrumentationInstallStack could cause the other thread to incorrectly parse the stack data-structures, leading to failures/crashes. To fix this we increment an ID whenever instrumentation changes the instrumentation stack. Other stack-walkers then check this id and restart whenever it changes. Note that although the stack-walk restarts we keep track of how many java frames we've visited already and refrain from calling VisitFrame until we are at the same position again. This means that as far as the Visitor writers are concerned the stack-walk is only done once, just like always. Added a test (2011) that forces the race to occur. Also Disabled Dex2oatSwapUseTest#CheckSwapUsage. It seems that the increase in Thread* size has caused it to fail. Disable while we investigate. See b/29259363 Bug: 72608560 Bug: 29259363 Bug: 148166031 Test: ./test.py --host Test: ./test/run-test --host --dev --runtime-option -verbose:deopt,plugin --prebuild --compact-dex-level fast --jit --no-relocate --create-runner --runtime-option -Xcheck:jni 1965-get-set-local-primitive-no-tables parallel_run.py Change-Id: I77349dfc6fa860b7f007dee485e9fea1d8658090
* Add fast path for exception vreg copying.David Srbecky2019-07-221-1/+9
| | | | | | | | It is not necessary to decode CodeInfo in GetVReg since the caller already did it. Test: ./art/test.py -b --host --64 --interpreter Change-Id: I0f8941f43acdc0f2c43b78ef87d3e796e320c959
* Stack walk: Cache CodeInfo and StackMap for current PC.David Srbecky2019-06-251-1/+9
| | | | | | | This speeds maps startup by 0.15%. Test: test.py -b --host --64 --optimizing Change-Id: Ic37eeba727148b877f21fdfacfa9f55558db88a7
* Partially ObjPtr<>-ify HandleScope.Vladimir Marko2019-05-241-1/+1
| | | | | | | Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --interpreter Bug: 31113334 Change-Id: I560683b5345bda9df4b22903d032b593d6c2dd4f
* Add StackVisitor::SetVRegReference().Vladimir Marko2019-05-081-0/+9
| | | | | | | | | | | Avoid converting ObjPtr<>s to uint32_t and back. Test: m test-art-host-gtest Test: testrunner.py --host --interpreter Test: run-jdwp-tests.sh --mode=host --variant=X64 Test: run-jdwp-tests.sh --mode=host --variant=X64 --debug Bug: 31113334 Change-Id: I4e5c1577930de58772b35179aa4281ae4bbca300
* Extend lifetime of CodeInfo in StackVisitor.David Srbecky2019-01-171-0/+1
| | | | | | | | Users of the visitor may use the API after WalkStack is finished. Test: test.py -b --host Bug: 120844051 Change-Id: Ia445d3b4c5c338402c92f1d29b522a33cd5baa14
* 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 "ART: Add StackVisitor accepting a lambda"Andreas Gampe2018-11-191-0/+30
| | | | | | | | | | This reverts commit ec43a01e0ac948c59d5b1f9c3812f2901b48942a. Reason for revert: Added missing code. Bug: 115837065 Test: m test-art-host Change-Id: Id30ccdf9aa9a6e56a914254793e399f2712c882d
* Revert "Revert^2 "ART: Add StackVisitor accepting a lambda""Nicolas Geoffray2018-11-171-30/+0
| | | | | | | | | | This reverts commit 3d477f3a3eea757a49ca621cc579f711f22fccdd. Bug: 115837065 Reason for revert: Breaks jdwp tests. Change-Id: I09249331798970751a20c6b41675c3efef72adfb
* Revert^2 "ART: Add StackVisitor accepting a lambda"Andreas Gampe2018-11-161-0/+30
| | | | | | | | | | This reverts commit 8248490f24e8582ce2ead8cd878d8a2c38310a48. Reason for revert: Fixed instrumentation.cc Bug: 115837065 Test: m test-art-host Change-Id: I484833f4712c835fcaf3452dca4cae5b031d5a7d
* Revert "ART: Add StackVisitor accepting a lambda"Andreas Gampe2018-11-161-30/+0
| | | | | | | | | | This reverts commit 36f8d22c672498753b9edc66ba11acc9816b2a17. Reason for revert: Seems to be breaking test 687 Bug: 115837065 Change-Id: I83bb1a9d76cc701c3d582778e5047ebd5dab5d29 Test: TreeHugger
* ART: Add StackVisitor accepting a lambdaAndreas Gampe2018-11-021-0/+30
| | | | | | | | | | To simplify implementation of visitors. Rewrite some visitors. Bug: 115837065 Test: mmma art Test: m test-art-host Change-Id: I04172d7626b702c1d69c63eba65526378935a25d
* Use iterators to access stack map data.David Srbecky2018-07-041-6/+7
| | | | | | | Try to simplify the code using the recently added iterators. Test: test-art-host-gtest-stack_map_test Change-Id: I0b9f54df01749ee6ec3a67cfb07ba636a2489c89
* Revert^4 "JIT JNI stubs."Vladimir Marko2017-11-301-2/+1
| | | | | | | | | | | | | | | | | | | | The original CL, https://android-review.googlesource.com/513417 , has a bug fixed in the Revert^2, https://android-review.googlesource.com/550579 , and this Revert^4 adds two more fixes: - fix obsolete native method getting interpreter entrypoint in 980-redefine-object, - fix random JIT GC flakiness in 667-jit-jni-stub. Test: testrunner.py --host --prebuild --no-relocate \ --no-image --jit -t 980-redefine-object Bug: 65574695 Bug: 69843562 This reverts commit 056d7756152bb3ced81dd57781be5028428ce2bd. Change-Id: Ic778686168b90e29816fd526e23141dcbe5ea880
* Revert "Revert "Revert "JIT JNI stubs."""Nicolas Geoffray2017-11-301-1/+2
| | | | | | | | | | | Still seeing occasional failures on 667-jit-jni-stub Bug: 65574695 Bug: 69843562 This reverts commit e7441631a11e2e07ce863255a59ee4de29c6a56f. Change-Id: I3db751679ef7bdf31c933208aaffe4fac749a14b
* Revert "Revert "JIT JNI stubs.""Vladimir Marko2017-11-291-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | The original CL, https://android-review.googlesource.com/513417 , had a bug for class unloading where a read barrier was executed at the wrong time from ConcurrentCopying::MarkingPhase() -> ClassLinker::CleanupClassLoaders() -> ClassLinker::DeleteClassLoader() -> JitCodeCache::RemoveMethodsIn() -> JitCodeCache::JniStubKey::UpdateShorty() -> ArtMethod::GetShorty(). This has been fixed by removing sources of the read barrier from ArtMethod::GetShorty(). Test: testrunner.py --host --prebuild --jit --no-relocate \ --no-image -t 998-redefine-use-after-free Bug: 65574695 Bug: 69843562 This reverts commit 47d31853e16a95393d760e6be2ffeeb0193f94a1. Change-Id: I06e7a15b09d9ff11cde15a7d1529644bfeca15e0
* Revert "JIT JNI stubs."Vladimir Marko2017-11-281-1/+2
| | | | | | | | | | | | Seems to break 998-redefine-use-after-free in some --no-image configuration. Bug: 65574695 Bug: 69843562 This reverts commit 3417eaefe4e714c489a6fb0cb89b4810d81bdf4d. Change-Id: I2dd157b931c17c791522ea2544c1982ed3519b86
* JIT JNI stubs.Vladimir Marko2017-11-281-2/+1
| | | | | | | | | | | | | Allow the JIT compiler to compile JNI stubs and make sure they can be collected once they are not in use anymore. Test: 667-jit-jni-stub Test: Pixel 2 XL boots. Test: m test-art-host-gtest Test: testrunner.py --host --jit Test: testrunner.py --target --jit Bug: 65574695 Change-Id: Idf81f50bcfa68c0c403ad2b49058be62b21b7b1f
* cpplint: Cleanup errorsIgor Murashkin2017-11-081-1/+1
| | | | | | | | | 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
* ART: Refactor stack.hAndreas Gampe2017-06-191-525/+49
| | | | | | | | | Factor out LockCountData, ShadowFrame and JavaFrameRootInfo and leave stack.h for the StackVisitor. Move single-use function to user to remove DexFile dependency. Test: m test-art-host Change-Id: I53d2880917bdf6782856fd2b16f38a0293f3aefc
* ART: Refactor GetStackTraceVisitorAndreas Gampe2017-06-131-0/+2
| | | | | | | | | Use a template to collect the stack frames. In preparation for a fast-path avoiding the vector. Bug: 62065987 Test: m test-art-host Change-Id: Ib41cd07c30607393f3be33563c2c4003f002ce5b
* ART: Clean up thread.h and thread_list.hAndreas Gampe2017-06-011-80/+0
| | | | | | | | | Remove dependency on stack.h and gc_root.h. Remove unused object callbacks include. Factor out ManagedStack into its own set of files. Fix up users of transitive includes. Test: m test-art-host Change-Id: I01286c43d8c7710948c161b1348faabb05922e59
* ART: Clean up field initializationAndreas Gampe2017-03-271-2/+9
| | | | | | | | Add explicit field initialization to default value where necessary. Also clean up interpreter intrinsics header. Test: m Change-Id: I7a850ac30dcccfb523a5569fb8400b9ac892c8e5
* ART: Bit intrinsics for Mterp interpreterbuzbee2017-03-161-0/+5
| | | | | | | | | | | | | | | | | | | | | | | Another batch of interpreter intrinisics, mostly around bit manipulation. Also some formatting changes and inclusion of a comprehensive list of recognized intrinisics (to assist with telling what's left to do). Bug: 30933338 Benchmarks: 20% Improvement for Reversi 10% Improvement for Scimark2 3% Improvement for ChessBench Test: ART_TEST_INTERPRETER=true m test-art-host Test: art/tools/run-libcore-tests --host (edited for force -Xint) Note: Added intrinsics have existing test coverage via 082-inline-execute, 123-inline-execute2, 565-checker-rotate, 564-checker-bitcount, 566-checker-signum & 567-checker-compare Change-Id: I29f0386e28eddba37c44f9ced44e7d5f8206bb47
* Force stack dump to diagnose empty checkpoint timeout (2).Hiroshi Yamauchi2017-02-061-2/+10
| | | | | | | | | Bug: 33006388 Bug: 12687968 Test: test-art-host Test: Thread dumping in a simulated empty checkpoint timeout. Change-Id: I06641396b8f3d7a1a98366a01807aab2e6f31bd5
* Revert "Revert "Revert "Revert "Basic obsolete methods support""""Alex Light2016-12-211-0/+10
| | | | | | | | | | | | | | | | | | | | | A GetDeclaringClass()->GetDexCache() got inserted during the merge/review process meaning that we would try to access incorrect dex-cache in obsolete methods in some situations. Also when using tracing we would loop forever (or at least until an OOM error) in test 916 due to tracing forcing InterpretOnly mode meaning methods would never be jitted. Bug: 32369913 Bug: 33630159 Test: ART_TEST_TRACE=true \ ART_TEST_JIT=true \ ART_TEST_INTERPRETER=true mma -j40 test-art-host This reverts commit f6abcda293b115a9d7d8a26376ea2dcf2d1dc510. Change-Id: I0773bfcba52e3cd51a83be815c6a50c189558f48
* Revert "Revert "Revert "Basic obsolete methods support"""Nicolas Geoffray2016-12-211-10/+0
| | | | | | | | | | | Fails in tracing mode Bug: 32369913 Bug: 33630159 This reverts commit ce77fc0e7f60a15354bb20c356537cbf8b53b722. Change-Id: I1bdcf6ad467f2e31f9c5d0c3c987b90a4f5efc69
* Revert "Revert "Basic obsolete methods support""Alex Light2016-12-191-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b81a9840b44480bfeacd74b8d9f51e06f295411d. There were 2 issues with the original CL's test 916-obsolete-jit that caused it to sporadically fail. First, when checking if we had jitted the function under test in 916-obsolete-jit we failed to check to see if the function 'doCall', which is used to work-around bugs in our deoptimization & compilation systems, had also been jitted. In the case where the 'sayHi' function had been jitted but the 'doCall' function had not we would (correctly) fail to redefine the 'Transform' class since we would not be able to deoptimize the 'sayHi' function since it is under a quick_to_interpreter_bridge (runtime) frame. Secondly, the function Main.isInterpretedFunction was incorrect and would always return false, regardless of the actual state of the function. This would cause the test to fail as the quick_to_interpreter_bridge frame prevented deoptimization of the obsoleted function. Usually the warm-up period was enough to make sure the methods were jitted anyway but this was not guaranteed. Both of these problems become more likely to occur on systems with more cpu contention such as the buildbots. Test: stress --cpu 60 &; while ./test/run-test --host --jit 916; do ; done Reason for revert: Fixed bug in test that was causing failures. Original Tests: Test: ./test/run-test --host 914 Test: ./test/run-test --host 915 Test: ./test/run-test --host 916 Test: mma -j40 test-art-host Test: ART_TEST_JIT=true \ ART_TEST_INTERPRETER=true mma -j40 test-art-host Test: ./art/tools/run-jdwp-tests.sh --mode=host --variant=X64 Test: ./art/tools/run-jdwp-tests.sh --mode=host --variant=X64 --no-jit Bug: 32369913 Bug: 33630159 Change-Id: If1a92e47b90965a7dc21c5826185debe62bd1554
* Revert "Basic obsolete methods support"Alex Light2016-12-151-10/+0
| | | | | | | | This reverts commit d8936da27b792d1ca02e59c92456a1a53c7b9905. Reason for revert: Some sort of race in JIT Change-Id: Ibb4e520bb0721d6d7aa2c841a52eb5baff07740e
* Basic obsolete methods supportAlex Light2016-12-141-0/+10
| | | | | | | | | | | | | | | | | | | | | | | Add support for executing obsolete methods following redefinitions. This support includes methods that have been jitted. This does not add any additional validity checks to our redefinition functions. Note using work-arounds to ensure 916 works pending some fixes to the compiler, deoptimizer, or both. Test: ./test/run-test --host 914 Test: ./test/run-test --host 915 Test: ./test/run-test --host 916 Test: mma -j40 test-art-host Test: ART_TEST_JIT=true \ ART_TEST_INTERPRETER=true mma -j40 test-art-host Test: ./art/tools/run-jdwp-tests.sh --mode=host --variant=X64 Test: ./art/tools/run-jdwp-tests.sh --mode=host --variant=X64 --no-jit Bug: 32369913 Bug: 33630159 Change-Id: I78ef95f484146f1fb93c37fc50f56575bdab2432
* ART: Add precise root visitingAndreas Gampe2016-12-121-0/+6
| | | | | | | | | | | | | Add VisitRootFlags::kVisitRootFlagPrecise to signal a request for precise RootInfo objects. Move VisitRootFlags to gc_root.h. Refactor VisitRoot functions to pass flags. Add code in Thread visiting to decode vregs in compiled code. Bug: 31385354 Test: m test-art-host Change-Id: I8e7280f0ab682871f729f2a1c6b18670cf2dbf82
* Class Hierarchy Analysis (CHA)Mingyao Yang2016-12-011-0/+5
| | | | | | | | | | | | | | | | | | | The class linker now tracks whether a method has a single implementation and if so, the JIT compiler will try to devirtualize a virtual call for the method into a direct call. If the single-implementation assumption is violated due to additional class linking, compiled code that makes the assumption is invalidated. Deoptimization is triggered for compiled code live on stack. Instead of patching return pc's on stack, a CHA guard is added which checks a hidden should_deoptimize flag for deoptimization. This approach limits the number of deoptimization points. This CL does not devirtualize abstract/interface method invocation. Slides on CHA: https://docs.google.com/a/google.com/presentation/d/1Ax6cabP1vM44aLOaJU3B26n5fTE9w5YU-1CRevIDsBc/edit?usp=sharing Change-Id: I18bf716a601b6413b46312e925a6ad9e4008efa4 Test: ART_TEST_JIT=true m test-art-host/target-run-test test-art-host-gtest
* ART: Remove duplicate StackVisitor method.Andreas Gampe2016-11-291-4/+0
| | | | | | | | | | Remove method that is the same as the older IsShadowFrame and only used in tests. Test: m ART_TEST_JIT=true ART_TEST_INTERPRETER=true test-art-host-run-test-454-get-vreg Test: m ART_TEST_JIT=true ART_TEST_INTERPRETER=true test-art-host-run-test-457-regs Test: m ART_TEST_JIT=true ART_TEST_INTERPRETER=true test-art-host-run-test-570-checker-osr Change-Id: Id222d25d5345790b6c500ec8120880a3b9d79986
* ART: Expose vreg and visitor in RootInfoAndreas Gampe2016-11-091-3/+10
| | | | | | | | | | | Expose the register and visitor in JavaFrameRootInfo, to be able to investigate a root programmatically. Also mark StackVisitor::GetFrameDepth() as a const function. Bug: 31385354 Test: m test-art-host Change-Id: Ie05d2cfe3f4e9def89311bb18bd0c0bbf1a45625
* ART: Add GetStackTrace supportAndreas Gampe2016-10-281-2/+1
| | | | | | | | Add support for getting a stack trace. Bug: 31684812 Test: m test-art-host Change-Id: Ifa5818ebca38caafb09616ffd7df30186eb8a06f
* Clean up some includes.Vladimir Marko2016-09-021-6/+2
| | | | | | | | | | Remove some unnecessary includes from header files, replace others with forward references and add includes to source files as needed. Reduce dependency on stack.h by pulling StackReference<> out to its own file. Test: m test-art-host Change-Id: I0fb182145e328870cbd918b0ef6ae2950223c1b2
* ART: SHARED_REQUIRES to REQUIRES_SHAREDAndreas Gampe2016-08-301-42/+42
| | | | | | | | | 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
* ART: Remove vestiges of GCCAndreas Gampe2016-08-231-4/+0
| | | | | | | We no longer support GCC. Change-Id: I869ac6e5dcb166747e45236a0d313c7672bbf2de Test: m test-art-host
* ART: Convert pointer size to enumAndreas Gampe2016-08-011-1/+1
| | | | | | | | | Move away from size_t to dedicated enum (class). Bug: 30373134 Bug: 30419309 Test: m test-art-host Change-Id: Id453c330f1065012e7d4f9fc24ac477cc9bb9269
* Revert "Revert "ART: Add Mterp export pc poison testing mode""Bill Buzbee2016-07-071-0/+8
| | | | | | | | | | | | This reverts commit d7af522c0f03cd926b13bbef7c21a8a504969f36. Fixes mips assembly typo: "mov" -> "move" TEST: Previously tested arm/arm64/x86/x86_64 via test-art-host, test-art-target plus injected error. Neglected to test mips builds. Now those tested as well. Change-Id: If2f9fb06973f8c1220a7d7699d79e6b9f1ce3197
* Merge "Revert "ART: Add Mterp export pc poison testing mode""Bill Buzbee2016-07-061-8/+0
|\
| * Revert "ART: Add Mterp export pc poison testing mode"Bill Buzbee2016-07-061-8/+0
| | | | | | | | | | | | This reverts commit e664cfef4d373a037dcf18637bea6b41e0624302. Change-Id: I521dfccd6c829946c93290163bf817b8a2c368e9
* | Merge "ART: Add Mterp export pc poison testing mode"Bill Buzbee2016-07-061-0/+8
|\|
| * ART: Add Mterp export pc poison testing modebuzbee2016-07-061-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the optimizations of the Mterp assembly interpreter is that it attempts to limit the number of times it updates the saved dex_pc_ value stored in the shadow frame. Instead, it maintains a pointer to the current dex instruction in a dedicated register. However, whenever execution flow exits the immediate mterp environment and some other part of the runtime needs to know the current dex pc (for example - exception throws), mterp must save - or "export" the dex_pc back into it's home location in the shadow frame. Forgetting to do this is a typical bug when developing mterp instruction handlers. And, the failures show up in odd and sometimes hard to track down ways. This CL adds a testing mode that poisons the saved dex_pc prior to each instruction interpretation. Thus, if any individual handler neglects to properly export the current dex pc and then goes on to use it we'll segfault out with an identifiable fault address: 0xdead00ff. TEST: test-art-target (Nexus 5x, Nexus 6p), test-art-host. Verified expected failure by artificially neglecting an EXPORT_PC. Bug: 26572899 Change-Id: I704fbb8ece693b94341aed0ffbb51a6acfb89697