summaryrefslogtreecommitdiff
path: root/runtime/oat_quick_method_header.h
Commit message (Collapse)AuthorAgeFilesLines
* Inline CodeInfo::DecodeCodeSizeDavid Srbecky2021-04-101-7/+9
| | | | | | | | Micro-optimization. This is not expected to make any difference (but it also certainly should not cause any harm to performance). Bug: 183547619 Change-Id: If1d493822f1bb49f9cf332a88b373f1d01195ca6
* Move code size from OatQuickMethodHeader to CodeInfo.David Srbecky2021-03-091-48/+28
| | | | | | | | | | | This saves 0.5% of oat file size. (0.8% saving from this CL minus 0.3% due to go/aog/1614482) Bug: 123510633 Test: m dump-oat Test: m test-art-host-gtest Test: ./art/test.py -b -r --host Change-Id: I035b54a47b300a5808aa8c2992f87eae009fd245
* Add code size to CodeInfo.David Srbecky2021-03-051-1/+5
| | | | | | | | | This is in preparation of removing it from OatQuickMethodHeader. Bug: 123510633 Test: m test-art-host-gtest Test: ./art/test.py -b -r --host Change-Id: I5c5adb4c040e329b81c1393aa1b80ee017729c8a
* HWASan fixes for ART testsDavid Srbecky2020-05-201-1/+2
| | | | | | | Bug: 156593692 Test: SANITIZE_TARGET=hwaddress art/tools/run-gtests.sh Test: SANITIZE_TARGET=hwaddress art/test.py -r --target --64 Change-Id: I24c5afdb4fed5ac94ce3a7b54a10c592f529191f
* Introduce the notion of an nterp frame.Nicolas Geoffray2019-12-171-1/+7
| | | | | | | | | | | | | | | | 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
* Helpers and refactorings to prepare for interpreter optimizations (x64)Nicolas Geoffray2019-12-041-2/+4
| | | | | | | | | | | | - Add data structure offsets that will be used in assembly code. - Be explicit about a stack overflow in a fault handler. - Move assembly helper code in asm_support so interpreter can use it. - Support putting literals in InterpreterCache. - Fix artHandleFillArrayDataFromCode for x64. Bug: 119800099 Test: test.py Change-Id: I2729f87fe5d09c04ae2e7081636f0cd89ac14c21
* Revert^2 "JIT: Separate code allocation and initialization."David Srbecky2019-10-101-0/+4
| | | | | | | | This reverts commit 63b0c26aae3e7237166dd781eb7a15fbc7c091c2. Test: ./art/test.py -b -r --host --all-gc -t 708 Reason for revert: Reland after bug fix. Change-Id: Ic13e2799bf4bdd8ca468f72cc0f3b72f224f2b08
* Revert "JIT: Separate code allocation and initialization."Nicolas Geoffray2019-10-091-4/+0
| | | | | | | | | This reverts commit e1b36f09cb478a39ba443f6acb11cd1901c01c1d. Reason for revert: Crashes in art::jit::JitMemoryRegion::FreeCode https://logs.chromium.org/logs/art/buildbucket/cr-buildbucket.appspot.com/8900060997388741808/+/steps/test_libcore/0/stdout Change-Id: I40259baec9acbb7889732548f8b31e0a48651cd9
* JIT: Separate code allocation and initialization.David Srbecky2019-10-091-0/+4
| | | | | | | | | | | Allocate(reserve) both code and data first, and then initialise(commit) both of them. This is useful since we know the address sooner for the purpose of debug info generation. Test: ./art/test.py -b -r --jit --host --64 Change-Id: I4971a8801004efbc6c2b27884834dda775b72664
* Prefix entrypoints with 0xFF so we can do extra checks.David Srbecky2019-04-161-0/+4
| | | | | | | | | | Add check to ensure we do not read method header from libart.so Bug: 123510633 Test: m -j40 cts && cts-tradefed run cts \ --test android.jvmti.cts.JvmtiHostTest1927#testJvmti \ --module CtsJvmtiRunTest1927HostTestCases Change-Id: Ic3e42e3bd4fbda3b11c7e265ed114770139151b9
* Revert "Revert^2 "Add code size to CodeInfo""Nicolas Geoffray2019-03-061-8/+2
| | | | | | | | | | | This reverts commit e1412dacbf1d2a809bd1fca658cc8cb8f61f8ee6. Bug: 123510633 Bug: 127305289 Reason for revert: b/127305289 Change-Id: I54557b05a44777f1fa2c15bde4fa648980f42eed
* Revert "Remove code size from OatQuickMethodHeader"Nicolas Geoffray2019-03-051-21/+33
| | | | | | | | | | | This reverts commit 131f23a4c2c34b689c07e6efd05cea74190f0113. Bug: 123510633 Bug: 127305289 Reason for revert: b/127305289 Change-Id: I59905779fe8c7d7551c0fa6c8693fb64eb6760b2
* Remove code size from OatQuickMethodHeaderDavid Srbecky2019-02-141-33/+21
| | | | | | | This saves from 0.75% from oat file size. Bug: 123510633 Change-Id: Ibf0d45d5d84057ee45a3584a4b69a7c0487443bf
* Revert^2 "Add code size to CodeInfo"David Srbecky2019-02-141-2/+8
| | | | | | | | | | | | | This temporarily adds 0.25% to oat file size. The space will be reclaimed back in follow-up CL. This reverts commit 8f20a23a35fa6fbe4dcb4ff70268a24dc7fb2a24. Reason for revert: Reland as-is after CL/903819 Bug: 123510633 Test: DCHECK compare the two stored code sizes. Change-Id: Ia3ab31c208948f4996188764fcdcba13d9977d19
* Revert "Add code size to CodeInfo"David Srbecky2019-02-121-8/+2
| | | | | | | | This reverts commit 68efa7b1128486e08ae60cd27181645b27bbd2e4. Reason for revert: Breaks tests Change-Id: I28fb143990f58e0d5f0b106bea9d9a159f19297e
* Add code size to CodeInfoDavid Srbecky2019-02-111-2/+8
| | | | | | | | | This temporarily adds 0.25% to oat file size. The space will be reclaimed back in follow-up CL. Bug: 123510633 Test: DCHECK compare the two stored code sizes. Change-Id: I15340824ca637fd075a4cef87771b06cb96bb9f4
* Move MethodInfo to CodeInfo.David Srbecky2018-08-011-34/+0
| | | | | | | | | | There is no need to treat it specially any more, because of the de-duplication at BitTable level. This saves 0.6% of oat file size. Test: test-art-host-gtest Change-Id: Ife7927d736243879a41d6f325d49ebf6930a63f6
* Remove frame info from OatQuickMethodHeader.David Srbecky2018-07-271-14/+9
| | | | | | | | | | | The information has been moved to CodeInfo, where it is stored in much more compact way. The old CL which added the data to CodeInfo cost 0.7%. This CL saves 2.5% of .oat file size so a win overall. Test: test-art-host-gtest Change-Id: I07fcf6f2776c96218f995ba3b57a1e6ccbf5e317
* Revert^2 "Use frame info from CodeInfo."David Srbecky2018-07-121-3/+9
| | | | | | This reverts commit cba94faf17f9446f57e1ad2848703944970e51da. Change-Id: I15eae55987a8c56400282da08b4ad282dddc8af9
* Revert "Use frame info from CodeInfo."Yohei Yukawa2018-07-051-9/+3
| | | | | | | | | | This reverts commit 691124fa1bbd0636225afda657712b649ab4d2ba. Reason for revert: Multiple build failures due to check failure oat_quick_method_header.h:162 Check failed: IsOptimized() Change-Id: I45f6f765a2067cbb13f28a2d0b783b020ac3432d
* Use frame info from CodeInfo.David Srbecky2018-07-041-3/+9
| | | | | | | Still keep the other copy around for verification. Test: test-art-host-gtest Change-Id: Iae4672e52d7ff3006d8f2b6238aecfac6101a1d8
* ART: Ensure OatQuickMethodHeader is trivially copyableAndreas Gampe2018-06-201-2/+0
| | | | | | | Remove empty constructor. Test: mmma art Change-Id: Ie58721299a6675797e9a525f4eb7e6df82abed50
* Rewrite stackmap encoding code.David Srbecky2018-05-211-5/+0
| | | | | | | | | | | | | | | | | 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
* Move most of runtime/base to libartbase/baseDavid Sehr2018-03-051-1/+1
| | | | | | | | | | | | | | Enforce the layering that code in runtime/base should not depend on runtime by separating it into libartbase. Some of the code in runtime/base depends on the Runtime class, so it cannot be moved yet. Also, some of the tests depend on CommonRuntimeTest, which itself needs to be factored (in a subsequent CL). Bug: 22322814 Test: make -j 50 checkbuild make -j 50 test-art-host Change-Id: I8b096c1e2542f829eb456b4b057c71421b77d7e2
* ART: Make InstructionSet an enum class and add kLast.Vladimir Marko2017-11-021-4/+4
| | | | | | | | | | | | | | Adding InstructionSet::kLast shall make it easier to encode the InstructionSet in fewer bits using BitField<>. However, introducing `kLast` into the `art` namespace is not a good idea, so we change the InstructionSet to an enum class. This also uncovered a case of InstructionSet::kNone being erroneously used instead of vixl32::Condition::None(), so it's good to remove `kNone` from the `art` namespace. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I6fa6168dfba4ed6da86d021a69c80224f09997a6
* ART: Include cleanupAndreas Gampe2017-07-241-1/+1
| | | | | | | | | | | | | | | | | | | Let clang-format reorder the header includes. Derived with: * .clang-format: BasedOnStyle: Google IncludeIsMainRegex: '(_test|-inl)?$' * Steps: find . -name '*.cc' -o -name '*.h' | xargs sed -i.bak -e 's/^#include/ #include/' ; git commit -a -m 'ART: Include cleanup' git-clang-format -style=file HEAD^ manual inspection git commit -a --amend Test: mmma art Change-Id: Ia963a8ce3ce5f96b5e78acd587e26908c7a70d02
* Add explicit default copy constructorYi Kong2017-05-101-0/+1
| | | | | | | | | | Definition of implicit copy constructor is deprecated if it has a user-declared destructor. This triggers -Wdeprecated compiler warning and breaks the build in latest Clang update. Test: Build Bug: 37752547 Change-Id: I9827e09d0ef846369917192c50db2bb80a0bd0bb
* Delete SrcMapMathieu Chartier2017-03-161-1/+0
| | | | | | | | | | No longer used. SrcMapElem is still used by elf_debug_line_writer.h. Address previous comments from aog/351387. Test: make Change-Id: Ib1525168b14889abbdc78ba20c64f3223b140a51
* Add method info to oat filesMathieu Chartier2017-03-161-9/+43
| | | | | | | | | | | | | | | | | | | | The method info data is stored separately from the code info to reduce oat size by improving deduplication of stack maps. To reduce code size, this moves the invoke info and inline info method indices to this table. Oat size for a large app (arm64): 77746816 -> 74023552 (-4.8%) Average oat size reduction for golem (arm64): 2% Repurposed unused SrcMapElem deduping to be for MethodInfo. TODO: Delete SrcMapElem in a follow up CL. Bug: 36124906 Test: clean-oat-host && test-art-host-run-test Change-Id: I2241362e728389030b959f42161ce817cf6e2009
* Class Hierarchy Analysis (CHA)Mingyao Yang2016-12-011-4/+34
| | | | | | | | | | | | | | | | | | | 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
* Revert "Revert "Revert "Revert "JIT root tables.""""Nicolas Geoffray2016-11-181-0/+5
| | | | | | | | | | Test: 626-set-resolved-string, test-art-host, test-art-target Test: run-libcore-tests.sh Test: phone boots and runs This reverts commit 3395fbc20bcd20948bec8958db91b304c17cacd8. Change-Id: I104b73d093e3eb6a271d564cfdb9ab09c1c8cf24
* Revert "Revert "Revert "JIT root tables."""Nicolas Geoffray2016-11-141-5/+0
| | | | | | | | | libcore failures: dalvikvm32 F 11-14 03:04:06 14870 14870 jit_code_cache.cc:310] Check failed: new_string != nullptr This reverts commit 75afcdd3503a8a8518e5b23d21b6e73306ce39ce. Change-Id: I5a6b6b48aa79a763d1ff1ba4d85d63811254787d
* Revert "Revert "JIT root tables.""Nicolas Geoffray2016-11-111-0/+5
| | | | | | | | | | | Also contains Revert "Support kJitTableAddress in x86/arm/arm64." This reverts commit 4acd03638fcdb4e5d1666f8eec7eb3bf6d6be035. This reverts commit 997d1217830c0a18b70faeabd53c04700a87d7d9. Test: ART_USE_READ_BARRIER=true/false test-art-host test-art-target Change-Id: I77cb1e9bf8f1b4c58b72d3cf5ca31ced2aaa1ea3
* Revert "JIT root tables."Nicolas Geoffray2016-11-091-5/+0
| | | | | | | | May be the offender for jit-gcstress failure of 902. This reverts commit ac3ebc3150760425ed00abd56da48f9a6e0666bc. Change-Id: I9ea6c9236fd1729fed7d1868dd8a111172932308
* JIT root tables.Nicolas Geoffray2016-11-081-0/+5
| | | | | | | | | | | | | Implement root tables for the JIT. Each JIT compiled method gets a table allocated before the stack maps. The table gets visited through Runtime::SweepSystemWeaks. Implement String roots for x86_64 as an example. Test: test-art-host test-art-target Change-Id: Id3d5bc67479e08b52dd4b253e970201203a0f0d2
* Fix google-explicit-constructor warnings in art.Chih-Hung Hsieh2016-09-151-5/+5
| | | | | | | | | * Add explicit keyword to conversion constructors, or NOLINT for implicit converters. Bug: 28341362 Test: build with WITH_TIDY=1 Change-Id: I1e1ee2661812944904fedadeff97b620506db47d
* Clean up OatQuickMethodHeader after Quick removal.Vladimir Marko2016-04-041-16/+2
| | | | | | | | | | | | | This reduces the size of the pre-header by 8 bytes, reducing oat file size and mmapped .text section size. The memory needed to store a CompiledMethod by dex2oat is also reduced, for 32-bit dex2oat by 8B and for 64-bit dex2oat by 16B. The aosp_flounder-userdebug 32-bit and 64-bit boot.oat are each about 1.1MiB smaller. Disable the broken StubTest.IMT, b/27991555 . Change-Id: I05fe45c28c8ffb7a0fa8b1117b969786748b1039
* Fix DCHECK in OatQuickMethodHeader::GetFrameSizeInBytes()David Srbecky2016-03-111-1/+1
| | | | | | We should check whether the frame is divisible by kStackAlignment. Change-Id: I5936a6e90b38c09775b4c3a8212641e639c4181c
* Symbolize native debug information for AOTed methods in boot.oat.David Srbecky2016-03-111-2/+10
| | | | | | | | | | | | The oatdump symbolizer will produce all DWARF information now, not just the symtab. This allows us to recover almost all native debug information after the fact, even for non-debuggable oat files. The main drawback is that non-debuggable oat files do not have enough stackmaps to provide reasonable line stepping experience. We might also be missing inlined methods from backtraces. Change-Id: I73ff6f43a3a0e5a0907af353f74f04e9b0129590
* Revert "Revert "Implement on-stack replacement for arm/arm64/x86/x86_64.""Nicolas Geoffray2016-02-051-1/+1
| | | | | | This reverts commit bd89a5c556324062b7d841843b039392e84cfaf4. Change-Id: I08d190431520baa7fcec8fbdb444519f25ac8d44
* Dex2oat support for multiple oat file and image file outputs.Jeff Hao2015-12-231-1/+2
| | | | | | | | Multiple changes to dex2oat and the runtime to support a --multi-image option. This generates a separate oat file and image file output for each dex file input. Change-Id: Ie1d6f0b8afa8aed5790065b8c2eb177990c60129
* Revert "Remove DCHECK that does not work for gtests."Vladimir Marko2015-10-271-0/+2
| | | | | | | | And fix the code alignment in gtests. This reverts commit 7d32dbc02beac2cb0217d52b61f2b3ef9974ffa6. Change-Id: I68813c36d1493f2746ceb129b30a649350d6bc13
* Remove DCHECK that does not work for gtests.Nicolas Geoffray2015-10-271-2/+0
| | | | Change-Id: I12e11fd2faffa2e53771a0dd988447f9d72b554b
* Support garbage collection of JITted code.Nicolas Geoffray2015-10-261-0/+18
| | | | Change-Id: I9afc544460ae4fb31149644b6196ac7f5182c784
* Remove ArtCode.Nicolas Geoffray2015-10-201-0/+127
- Instead use OatQuickMethodHeader. - Various cleanups now that we don't have all those ArtMethod -> ArtCode -> OatQuickMethodHeader indirections. As a consequence of this cleanup, exception handling got a bit faster. ParserCombinators benchmark (exception intensive) on x64: (lower is better) Before: ParserCombinators(RunTime): 1062500.0 us. After: ParserCombinators(RunTime): 833000.0 us. Change-Id: Idac917b6f1b0dc254ad68fb3781cd61bccadb0f3