summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_builder.cc
AgeCommit message (Collapse)Author
2016-09-27Cleanup String.<init> handling.Nicolas Geoffray
Move everything to one place (currently well_known_classes.cc, but no strong preference) and define a macro to easily handle the list of affected methods. test: m test-art-host test: m test-art-target Change-Id: Ib8372d130d5458516a1f1ae31014afc76037fc34
2016-09-26Compensate in compiler for verifier shortcomings.Nicolas Geoffray
The verifier does not differentiate zero and null, so a move-object of zero can be used as a non-object later on. Change the compiler to ignore the object conversion when the input is zero or a phi (which might just hold zeros). The type propagation will then do proper inferencing of the types. Also remove some stalled comments in ssa_builder.cc. bug:31313170 test: dex2oat b31313170.apk test: run-test 800 test: m test-art-host-run-test Change-Id: I579d667415a7decf8ff2c2238dae4c13eec5d0e0
2016-09-23Clean-up sharpening and compiler driver.Nicolas Geoffray
Remove dependency on compiler driver for sharpening and dex2dex (the methods called on the compiler driver were doing unnecessary work), and remove the now unused methods in compiler driver. Also remove test that is now invalid, as sharpening always succeeds. test: m test-art-host m test-art-target Change-Id: I54e91c6839bd5b0b86182f2f43ba5d2c112ef908
2016-09-07Avoid read barrier for image HLoadClassMathieu Chartier
Concurrent copying baker: X86_64 core-optimizing-pic.oat: 28583112 -> 27906824 (2.4% smaller) Around 0.4% of 2.4% is from re-enabling kBootImageLinkTimeAddress, kBootImageLinkTimePcRelative, and kBootImageAddress. N6P boot.oat 32: 73042140 -> 71891956 (1.57% smaller) N6P boot.oat 64: 83831608 -> 82531456 (1.55% smaller) EAAC: 1252 -> 1245 (32 samples) Bug: 29516974 Test: test-art-host CC baker, N6P booting Change-Id: I9a196cf0157058836981c43c93872e9f0c4919aa
2016-09-06Optimizing: Fix handling empty fill-array-data.Vladimir Marko
Test: m test-art-host-run-test-412-new-array Bug: 31300081 Change-Id: Id0512fc95a96c37de2ceab481666688435fa30f6
2016-08-30ART: SHARED_REQUIRES to REQUIRES_SHAREDAndreas Gampe
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
2016-07-27ART: Delete old compiler_enums.hAndreas Gampe
Holdover from the Quick days. Move the two enums that are still used closer to the actual users (and prune no longer used cases). Test: m test-art-host Change-Id: I88aa49961a54635788cafac570ddc3125aa38262
2016-07-19Revert "Revert "Refactor GetIMTIndex""Matthew Gharrity
Originally reverted in order to revert https://android-review.googlesource.com/#/c/244190/ but can now be merged again. This reverts commit d4ceecc85a5aab2ec23ea1bd010692ba8c8aaa0c. Test: m test-art-host Change-Id: Id9205f2b77a378fc0f06088e78c66e81a49f712d
2016-06-29Merge "Revert "Refactor GetIMTIndex""Nicolas Geoffray
2016-06-29Revert "Refactor GetIMTIndex"Nicolas Geoffray
I need to revert this to get https://android-review.googlesource.com/#/c/244190/ to cleanly revert. Matthew, do you mind rewriting it? This reverts commit 50706437d8216e41f0fea1e413cda7891324d397. Change-Id: I5c1435f5dffb46dbb5b613b22adb88c7770304f2
2016-06-21Improve HLoadClass code generation.Vladimir Marko
For classes in the boot image, use either direct pointers or PC-relative addresses. For other classes, use PC-relative access to the dex cache arrays for AOT and direct address of the type's dex cache slot for JIT. For aosp_flounder-userdebug: - 32-bit boot.oat: -252KiB (-0.3%) - 64-bit boot.oat: -412KiB (-0.4%) - 32-bit dalvik cache total: -392KiB (-0.4%) - 64-bit dalvik-cache total: -2312KiB (-1.0%) (contains more files than the 32-bit dalvik cache) For aosp_flounder-userdebug forced to compile PIC: - 32-bit boot.oat: -124KiB (-0.2%) - 64-bit boot.oat: -420KiB (-0.5%) - 32-bit dalvik cache total: -136KiB (-0.1%) - 64-bit dalvik-cache total: -1136KiB (-0.5%) (contains more files than the 32-bit dalvik cache) Bug: 27950288 Change-Id: I4da991a4b7e53c63c92558b97923d18092acf139
2016-06-15Refactor GetIMTIndexMatthew Gharrity
This allows us to more easily maintain and experiment with interface method table indexing and hashing. Change-Id: I719920fae7490dcedcda7c1c36db225c2b8b16df
2016-06-08Do not place null check on unresolved method calls.Aart Bik
Rationale: These invokes drop through the runtime anyway where various checks are done, including null check. A few of these checks need to occur before the null check. With fail-before/pass-after smali test. BUG=29068831 Change-Id: I260715e742365433a323598d97f7fdab321e8512
2016-06-07Do not hide instance field hard failure with soft failureAart Bik
Rationale: Yet another verifier inaccuracy found with fuzz testing. Instance field verification should proceed testing instance field access after soft failures in cases where hard failures could still follow. Failure to do so resulted in a compiler crash (now made bit friendly with DCHECK as well). With crash-before/pass-after test. BUG=29126870 Change-Id: I8674d6171158eaa2aeb0492b35dfafea76416cac
2016-06-03Do not place null check from unresolved field access.Aart Bik
Rationale: These accesses go though the runtime anyway where various checks are done, including null check. Since particular checks, like access checks, need to occur prior to the null check (to ensure link errors are not masked by a null reference), the explicit null check should not occur in the HIR. BUG=29068831 Change-Id: I30fc9cb8cf4993e4176e235ceba3a38aef98d503
2016-05-06Workaround invokesuper underspecified behavior.Aart Bik
The verifier allows invokesuper on a class unrelated to the referring class. However, the runtime uses the vtable of the super class of the referring class to lookup the ArtMethod. Since the receiver has no relation to the referring class, this lead to either jumping to a wrong method, or "luckily" throw a NoSuchMethodError if the vtable index is out of bounds of the super class of the referring class. This changes the runtime behavior to always throw NoSuchMethodError when hitting such invokesuper. Also, we make the verifier consistent with the runtime by treating such calls unresolved. bug=27627004 Change-Id: I68486501a9625f91679078c5a980b39974ddbf1c
2016-04-25Merge "Make sure the referring class is in the dex cache."Treehugger Robot
2016-04-25Make sure the referring class is in the dex cache.Nicolas Geoffray
The method CanAccessResolvedMethod expects the referring class in the dex file is already in the dex cache, which is true during AOT, but not necessarilly during JIT. bug:28295348 Change-Id: I58739903f0dff3867b920a7444f53b99ecf86e85
2016-04-22ART: Naive NullCheck elimination in InstructionBuilderDavid Brazdil
Save a little bit of memory by not generating trivially redundant HNullCheck instructions. This patch builds on the fact that the InstructionBuilder now directly generates SSA form and looks at the input of the NullCheck. For obvious cases, such as NewInstance/Array or `this`, the NullCheck generation is completely avoided. Bug: 28173563 Change-Id: I1fdf3b096c7a939f7b8586c02a2a6b44dfa43443
2016-04-15Enable allocation elimination as part of LSEMingyao Yang
After load-store elimination, an allocation may not be used any more and may be eliminated. Change-Id: I7fcaaefa9d6ec2c611e46119c5799293770a917c
2016-04-14Use dex cache from compilation unit in HInstructionBuilder.Vladimir Marko
Avoid calling costly ClassLinker::FindDexCache() from HInstructionBuilder, the dex cache is already available in the compilation unit. Compiling Nexus 5 boot image on host under perf(1) shows that the time spent in FindDexCache() is reduced from about 2% to well under 0.2%, 90% of the remaining hits coming from ReferenceTypePropagation which doesn't have access to the compilation unit. Change-Id: Id9df61c79db9a67e3f12c857f32a4ca80e5420c3
2016-04-08Store precice set of which constructors require barriersMathieu Chartier
Fixes bugs where things in the boot image might not have been calculated even though resolved_clases was true. This only occured for app and test compiles though. Fixes test 476-checker-ctor-memory-barrier which was failing due to inlining something in the boot class path and getting a unexpected barrier since the barrier defaults to enabled. No measurable increase in RAM usage. Bug: 28005874 Change-Id: I4a417819aa129c95f4a83c38df1a66eb77824ea9
2016-04-07Revert "Revert "Refactor HGraphBuilder and SsaBuilder to remove HLocals""David Brazdil
This patch merges the instruction-building phases from HGraphBuilder and SsaBuilder into a single HInstructionBuilder class. As a result, it is not necessary to generate HLocal, HLoadLocal and HStoreLocal instructions any more, as the builder produces SSA form directly. Saves 5-15% of arena-allocated memory (see bug for more data): GMS 20.46MB => 19.26MB (-5.86%) Maps 24.12MB => 21.47MB (-10.98%) YouTube 28.60MB => 26.01MB (-9.05%) This CL fixed an issue with parsing quickened instructions. Bug: 27894376 Bug: 27998571 Bug: 27995065 Change-Id: I20dbe1bf2d0fe296377478db98cb86cba695e694
2016-04-04Revert "Refactor HGraphBuilder and SsaBuilder to remove HLocals"David Brazdil
Bug: 27995065 This reverts commit e3ff7b293be2a6791fe9d135d660c0cffe4bd73f. Change-Id: I5363c7ce18f47fd422c15eed5423a345a57249d8
2016-04-04Refactor HGraphBuilder and SsaBuilder to remove HLocalsDavid Brazdil
This patch merges the instruction-building phases from HGraphBuilder and SsaBuilder into a single HInstructionBuilder class. As a result, it is not necessary to generate HLocal, HLoadLocal and HStoreLocal instructions any more, as the builder produces SSA form directly. Saves 5-15% of arena-allocated memory (see bug for more data): GMS 20.46MB => 19.26MB (-5.86%) Maps 24.12MB => 21.47MB (-10.98%) YouTube 28.60MB => 26.01MB (-9.05%) Bug: 27894376 Change-Id: Iefe28d40600c169c5d306fd2c77034ae19476d90