summaryrefslogtreecommitdiff
path: root/runtime/quick_exception_handler.cc
AgeCommit message (Collapse)Author
2020-09-02Fix bug in StackVisitor::GetVReg.Nicolas Geoffray
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
2020-03-03Check vreg count on debuggableAlex Light
Previously we were only performing a check that we got the correct number of vregs on deoptimization when kIsDebugBuild. Extend this check to also occur when the runtime is JavaDebuggable. Bug: 144947842 Test: none Change-Id: I7d240008391a1499c159e478b59a509e2362e99f
2020-02-05Code cleanup around exception handling and stack walking.Nicolas Geoffray
- Remove unused code setting the method and dex pc below an upcall. - Clear cur_oat_quick_method_header when stack walking to be consistent in having a runtime method and a null oat method header. Test: test.py Change-Id: I87672d193eb2e62add3ae7b8a42f2202e8eb927c
2020-01-31Replace instrumention id with stack pointers.Nicolas Geoffray
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
2019-12-18Add an implementation of Nterp for x64.Nicolas Geoffray
And enable it on x64 when runtime and ArtMethod requirements are met (see nterp.cc). Test: test.py Bug: 112676029 Change-Id: I772cd20a20fdc0ff99529df7495801d773091584
2019-12-17Introduce the notion of an nterp frame.Nicolas Geoffray
See comments in nterp_helpers.cc. An nterp frame follows the calling conventions and exception handling of the compiler. There are no ManagedStack transitions, and the compiler and interpreter can just call each other directly. For the stack walker, an nterp frame looks like a compiled frame. This CL introduces an nterp frame, another CL will contain an implementation for x64. Bug: 119800099 Test: test.py Change-Id: Ie9b691f58908b7f283b4cd63b84b651526155d27
2019-07-22Add fast path for exception vreg copying.David Srbecky
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
2019-07-15ART: Introduce stackmap with no DexRegInfo.Artem Serov
Some of safepoints don't need to have DexRegisterMap info; this will decrease the stackmap size. .oat file size reduction: - boot.oat: -233 kb (-5.4%) - boot-framework.oat: -704 kb (-4.9%) Test: 461-get-reference-vreg, 466-get-live-vreg. Test: 543-env-long-ref, 616-cha*. Test: test-art-target, +gc-stress. Change-Id: Idbad355770e30a30dcf14127642e03ee666878b8
2019-01-08Put the deoptimized method in the trace tag.Nicolas Geoffray
Useful when debugging with a trace. Test: m Change-Id: I59cb5d6810acdeb7cdd40604f8b123cb42aa8be7
2018-11-29Merge "Use ArtMethod::GetDex{File,Cache}() more."Treehugger Robot
2018-11-29Use ArtMethod::GetDex{File,Cache}() more.Vladimir Marko
Do not go through the declaring class when it can cause a DexFile or DexCache mismatch for obsolete methods. Also fix similar potential mismatch in hiddenapi. This is a follow-up to https://android-review.googlesource.com/834082 , https://android-review.googlesource.com/836008 . Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 119830111 Change-Id: I3fdf1aa1bc7bab816d5d8034b107506a32438b77
2018-11-19Revert^4 "ART: Add StackVisitor accepting a lambda"Andreas Gampe
This reverts commit ec43a01e0ac948c59d5b1f9c3812f2901b48942a. Reason for revert: Added missing code. Bug: 115837065 Test: m test-art-host Change-Id: Id30ccdf9aa9a6e56a914254793e399f2712c882d
2018-11-17Revert "Revert^2 "ART: Add StackVisitor accepting a lambda""Nicolas Geoffray
This reverts commit 3d477f3a3eea757a49ca621cc579f711f22fccdd. Bug: 115837065 Reason for revert: Breaks jdwp tests. Change-Id: I09249331798970751a20c6b41675c3efef72adfb
2018-11-16Revert^2 "ART: Add StackVisitor accepting a lambda"Andreas Gampe
This reverts commit 8248490f24e8582ce2ead8cd878d8a2c38310a48. Reason for revert: Fixed instrumentation.cc Bug: 115837065 Test: m test-art-host Change-Id: I484833f4712c835fcaf3452dca4cae5b031d5a7d
2018-11-16Revert "ART: Add StackVisitor accepting a lambda"Andreas Gampe
This reverts commit 36f8d22c672498753b9edc66ba11acc9816b2a17. Reason for revert: Seems to be breaking test 687 Bug: 115837065 Change-Id: I83bb1a9d76cc701c3d582778e5047ebd5dab5d29 Test: TreeHugger
2018-11-02ART: Add StackVisitor accepting a lambdaAndreas Gampe
To simplify implementation of visitors. Rewrite some visitors. Bug: 115837065 Test: mmma art Test: m test-art-host Change-Id: I04172d7626b702c1d69c63eba65526378935a25d
2018-10-23ART: Refactor for bugprone-argument-commentAndreas Gampe
Handles runtime. Bug: 116054210 Test: WITH_TIDY=1 mmma art Change-Id: Ibc0d5086809d647f0ce4df5452eb84442d27ecf0
2018-10-11Revert^4 "JVMTI PopFrame support"Alex Light
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
2018-09-07ART: Continue adding override annotationsAndreas Gampe
Use Clang-tidy's modernize-use-override to add more annotations. Ignore inferred annotations on destructors. Bug: 32619234 Test: mmma art Change-Id: Ic432c928e398d44df9171e42db04ee19946e6887
2018-08-28Use 'final' and 'override' specifiers directly in ART.Roland Levillain
Remove all uses of macros 'FINAL' and 'OVERRIDE' and replace them with 'final' and 'override' specifiers. Remove all definitions of these macros as well, which were located in these files: - libartbase/base/macros.h - test/913-heaps/heaps.cc - test/ti-agent/ti_macros.h ART is now using C++14; the 'final' and 'override' specifiers have been introduced in C++11. Test: mmma art Change-Id: I256c7758155a71a2940ef2574925a44076feeebf
2018-07-10Correctly send MethodExit events from exception handlersAlex Light
Due to the way that exceptions are handled it was possible for a MethodExit event to be sent multiple times for the same exception. This fixes that issue by correctly keeping track of which exception events have already been sent and correctly tracking the current exception being thrown. Test: ./test/testrunner/testrunner.py --host --runtime-option=-Xplugin:libtracefast-trampolined.so Test: ./test.py --host Change-Id: I7fa09f0f3f82181430b18805da5ba8daf68d4b89
2018-07-05Merge "Use iterators to access stack map data."David Srbecky
2018-07-04Use iterators to access stack map data.David Srbecky
Try to simplify the code using the recently added iterators. Test: test-art-host-gtest-stack_map_test Change-Id: I0b9f54df01749ee6ec3a67cfb07ba636a2489c89
2018-07-03ART: Do not use std::<container>::at().Vladimir Marko
These functions are specified as throwing std::out_of_range and we do not use exceptions. Test: m Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I67c365ed6d779c101a18b9f386c751c48ca76e16
2018-06-14Move some helper methods to DexRegisterLocation.David Srbecky
Test: test-art-host-gtest-stack_map_test Change-Id: I0abab008159db023d531df69214cd3bb8c0639bd
2018-06-07Remove unused GetDexRegisterMap arguments.David Srbecky
They are no longer needed in the new encoding. I reuse the local variables in most places to DCHECK the size of the decoded register map. This has one catch though: We sometimes omit all dex registers, so the DCHECK should be done only after checking if the map is empty (if applicable). Test: test-art-host-gtest-stack_map_test Change-Id: I94b67029842374bc8eb7c9e5eac76fc93a651f24
2018-06-05Remove depth argument from InlineInfo accessors in stack maps.David Srbecky
The InlineInfo class actually represented a list of inlining information for a given stack map, and the depth argument was used everywhere to select to desired element from the list. This was verbose and inconsistent with the other classes. Change the InlineInfo class to represent a single inlining, and select the desired depth when getting it from CodeInfo. Test: test-art-host-gtest-stack_map_test Change-Id: I35b73e6704854f0203f51d4dbdbed5b1d1cd5a3b
2018-06-01Rewrite dex register map encoding in stackmaps.David Srbecky
Simplify code by encoding dex register maps using BitTables. The overall design is unchanged (bitmask+indices+catalogue). This CL saves ~0.4% of .oat file size. The dex register map decoding is factor of 3 faster now (based on the time to verify the register maps on Arm). This is not too surprising as the old version was O(n^2). It also reduces compiler arena memory usage by 11% since the BitTableBuilder is more memory efficient, we store less intermediate data, and we deduplicate most data on the fly. Test: test-art-host-gtest-stack_map_test Change-Id: Ib703a5ddf7f581280522d589e4a2bfebe53c26a9
2018-05-30Simplify DexRegisterMap API.David Srbecky
Store some of the needed decoding state explicitly to avoid passing it around all the time. The DexRegisterMap class is rewritten in next CL. Test: test-art-host-gtest-stack_map_test Change-Id: Ie268dff2a1c1da2e08f0e6799ae51c30e11f350b
2018-05-30Revert^2 "Optimize register mask and stack mask in stack maps."David Srbecky
This reverts commit 8b20b5c1f5b454b2f8b8bff492c88724b5002600. Reason for revert: Retry submit unmodified after fixing the test. Use BitTable to store the masks as well and move the deduplication responsibility to the BitTable builders. Don't generate entries for masks which are all zeros. This saves 0.2% of .oat file size on both Arm64 and Arm. Encode registers as (value+shift) due to tailing zeros. This saves 1.0% of .oat file size on Arm64 and 0.2% on Arm. Test: test-art-target-gtest-exception_test Test: test-art-host-gtest-bit_table_test Test: test-art-host-gtest-stack_map_test Change-Id: Ib643776dbec3f051cc29cd13ff39e453fab5fae9
2018-05-29Revert "Optimize register mask and stack mask in stack maps."Vladimir Marko
This reverts commit ffaf87a429766ed80e6afee5bebea93db539620b. Reason for revert: Breaks exception_test32 on target for CMS and heap poisoning configs. Change-Id: I127c17f693e28211a799f73a50e73105edee7e4c
2018-05-28Optimize register mask and stack mask in stack maps.David Srbecky
Use BitTable to store the masks as well and move the deduplication responsibility to the BitTable builders. Don't generate entries for masks which are all zeros. This saves 0.2% of .oat file size on both Arm64 and Arm. Encode registers as (value+shift) due to tailing zeros. This saves 1.0% of .oat file size on Arm64 and 0.2% on Arm. Test: test-art-host-gtest Change-Id: I636b7edd49e10e8afc9f2aa385b5980f7ee0e1f1
2018-05-23Merge "ObjPtr<>-ify UnstartedRuntime, fix 2 stale reference uses."Vladimir Marko
2018-05-23ObjPtr<>-ify UnstartedRuntime, fix 2 stale reference uses.Vladimir Marko
Test: Rely on TreeHugger. Bug: 31113334 Change-Id: I35f76c3e3b94dfca18dbe67aba065a1270f4e5ee
2018-05-21Rewrite stackmap encoding code.David Srbecky
Remove most of the code related to handling of bit encodings. The design is still same; the encodings are just more implicit. Most of the complexity is replaced with a single BitTable class, which is a generic purpose table of tightly bit-packed integers. It has its own header which stores the bit-encoding of columns, and that removes the need to handle the encodings explicitly. Other classes, like StackMap, are accessors into the BitTable, with named getter methods for the individual columns. This CL saves ~1% of .oat file size (~4% of stackmap size). Test: test-art-host-gtest Change-Id: I7e92683753b0cc376300e3b23d892feac3670890
2018-03-14Fix delivering async exception while in compiled code.Vladimir Marko
Change artInstrumentationMethodExitFromCode() to check for async exceptions. Also fix kDebugExceptionDelivery = true causing stale ObjPtr<> use. Test: run-test --jit -runtime-option -Xjitthreshold:0 \ 1934-jvmti-signal-thread Test: Repeat with kDebugExceptionDelivery = true. Bug: 74583459 Change-Id: Ia2e777cc3ccef4eba549aa290f8bc12608eafe44
2018-01-31Revert "Revert "Make libdexfile build independent of runtime dir""David Sehr
This reverts commit 787784f9effb126b5d0d3dc97d544c4a477b5daf. Reason for revert: Bot configuration issue. Change-Id: I6a10bb4a9571f89c7e4dd095f9157e830a44e2de Bug: 22322814 Test: make -j 50 checkbuild
2018-01-30Revert "Make libdexfile build independent of runtime dir"David Sehr
This reverts commit b40b7e73469339a6b667b4a2e2b8690112a74dc9. Reason for revert: on device libdexfile.so missing Change-Id: I9bd61a98bef870400580e8c991cb061d3f57fa72
2018-01-30Make libdexfile build independent of runtime dirDavid Sehr
Remove libdexfile's dependency on utils.cc and move utf.cc into /dex. Remove libdexfile's constituent sources from libart and use libdexfile wherever libart is. Also remove some ART-specific interfaces. Libdexfile's tests remain to be converted, plus moving the files to a new directory peer to runtime/. Bug: 22322814 Test: make -j 50 test-art-host Change-Id: Ifaf695216e4a0e43d3aa377984d933f7a2a243c2
2018-01-05Create dex subdirectoryDavid Sehr
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
2017-12-22Make CodeItem fields privateMathieu Chartier
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
2017-12-07ART: Remove base/logging from heap-inl.hAndreas Gampe
Hide the single uncommon VLOG and remove the include. Fix up transitive includes. Test: m Change-Id: I917df597cb62c57040c1fb0e0079df4d95e5a658
2017-09-28Check the to-space invariant on a delivered exception.Roland Levillain
Test: art/test/testrunner/testrunner.py Bug: 62339341 Bug: 12687968 Change-Id: Ida5e91031cd94429a72fcc9d4d1333d21dd07421
2017-09-18ART: Move kDexNoIndex to dex_file_types.hAndreas Gampe
Define the constant with the types to allow lowering the dependency on DexFile. Test: m Change-Id: I3c61421db45be96d2057e01b1a7825883d8bd178
2017-08-09Move deopt and jit logs from LOG(INFO) to VLOG(jit).Nicolas Geoffray
They served their purposes. Now stop spamming logcat. Test: test.py Change-Id: I53c961a6ad95ea891f2f09b7e11e7535da4fdaff
2017-05-10Add runtime reasons for deopt.Nicolas Geoffray
Currently to help investigate. Also: 1) Log when deoptimization happens (which method and what reason) 2) Trace when deoptimization happens (to make it visible in systrace) bug:37655083 Test: test-art-host test-art-target Change-Id: I0c2d87b40db09e8e475cf97a7c784a034c585e97
2017-04-24ART: More header cleanup - method_verifier.hAndreas Gampe
Move enumerations to own header. Move the compiler interface (of what the compiler can tolerate) into its own header. Replace or remove method_verifier.h where possible. Test: mmma art Change-Id: I075fcb10b02b6c1c760daad31cb18eaa42067b6d
2017-02-08Clean up code info table layoutMathieu Chartier
Previously: Table layout was computed multiple places like stack_map_stream, and getters. This made it difficult to add new stack map tables and made the code hard to understand. This change makes the table layout specified all inside of the code info. Updating the layout only requires changing ComputeTableOffsets. Changed the stack map inline info offset to be an index, so that it is not require the inline infos are directly after the dex register table. Oat file size for a large app: 94459576 -> 93882040 (-0.61%) Updated oatdump and fixed a bug that was incorrectly computing the register mask bytes. Bug: 34621054 Test: test-art-host Change-Id: I3a7f141e09d5a18bce2bc6c9439835244a22016e
2017-02-01Deduplicate register masksMathieu Chartier
Data is commonly shared between different stack maps. The register masks are stored after the stack masks. Oat size for a large app: 96722288 -> 94485872 (-2.31%) Average oat size reduction according to golem -3.193%. Bug: 34621054 Test: test-art-host Change-Id: I5eacf668992e866d11ddba0c01675038a16cdfb4
2017-01-31Deduplicate stack masksDavid Srbecky
The stack masks repeat often enough so that it is worth deduplicating them. Oat size for a large app: 98143600 -> 96722288 (-1.44%) Bug: 34621054 Test: test-art-host Change-Id: If73d51e46066357049d5be2e406ae9a32b7ff1f4