OSDN Git Service

android-x86/art.git
8 years agoMerge "Revert "Revert "Optimizing: Better invoke-static/-direct dispatch."""
Vladimir Marko [Wed, 19 Aug 2015 18:05:46 +0000 (18:05 +0000)]
Merge "Revert "Revert "Optimizing: Better invoke-static/-direct dispatch."""

8 years agoRevert "Revert "Optimizing: Better invoke-static/-direct dispatch.""
Vladimir Marko [Wed, 19 Aug 2015 12:49:41 +0000 (12:49 +0000)]
Revert "Revert "Optimizing: Better invoke-static/-direct dispatch.""

Fixed kCallArtMethod to use correct callee location for
kRecursive. This combination is used when compiling with
debuggable flag set.

This reverts commit b2c431e80e92eb6437788cc544cee6c88c3156df.

Change-Id: Idee0f2a794199ebdf24892c60f8a5dcf057db01c

8 years agoMerge "ART: Refactor try/catch block info, store exception type"
David Brazdil [Wed, 19 Aug 2015 17:12:48 +0000 (17:12 +0000)]
Merge "ART: Refactor try/catch block info, store exception type"

8 years agoART: Refactor try/catch block info, store exception type
David Brazdil [Wed, 19 Aug 2015 14:04:01 +0000 (15:04 +0100)]
ART: Refactor try/catch block info, store exception type

This patch replaces HBasicBlock fields storing try/catch info with a
single TryCatchInformation data structure, saving memory for the
majority of non-try/catch blocks. It also changes builder to store
the exception type for catch blocks.

Change-Id: Ib3e43f7db247e6915d67c267fc62410420e230c9

8 years agoMerge "Put in place the ARM64 instruction simplification framework."
Calin Juravle [Wed, 19 Aug 2015 15:56:11 +0000 (15:56 +0000)]
Merge "Put in place the ARM64 instruction simplification framework."

8 years agoMerge "Manually unrelocate odex files generated for test."
Richard Uhler [Wed, 19 Aug 2015 15:19:31 +0000 (15:19 +0000)]
Merge "Manually unrelocate odex files generated for test."

8 years agoPut in place the ARM64 instruction simplification framework.
Alexandre Rames [Wed, 19 Aug 2015 14:39:06 +0000 (15:39 +0100)]
Put in place the ARM64 instruction simplification framework.

This commit introduces and runs the empty InstructionSimplifierArm64
pass. Further commits will introduce arm64-specific transformations in
that pass.

Change-Id: I458f8a2b15470297b87fc1f7ff85bd52155d93ef

8 years agoMerge "ART: Revisit users in phi elimination"
David Brazdil [Wed, 19 Aug 2015 13:38:28 +0000 (13:38 +0000)]
Merge "ART: Revisit users in phi elimination"

8 years agoART: Revisit users in phi elimination
David Brazdil [Wed, 19 Aug 2015 13:17:31 +0000 (14:17 +0100)]
ART: Revisit users in phi elimination

SSA phi elimination visits phis in post order so that loop phis are
visited after their inputs. This prevents elimination of phis with
other phi inputs, exacerbated by the fact that the SSA builder does
create catch phis even if all inputs are the same (unlike with normal
phis). This patch revisits phi users of eliminated phis until no more
phis can be removed.

Change-Id: I403614dd46a8e6f0a5b9dd9e8ddc8832617521eb

8 years agoMerge "JDWP: remove suspend count check on invoke"
Sebastien Hertz [Wed, 19 Aug 2015 12:53:38 +0000 (12:53 +0000)]
Merge "JDWP: remove suspend count check on invoke"

8 years agoMerge "Revert "Optimizing: Better invoke-static/-direct dispatch.""
Vladimir Marko [Wed, 19 Aug 2015 12:46:09 +0000 (12:46 +0000)]
Merge "Revert "Optimizing: Better invoke-static/-direct dispatch.""

8 years agoRevert "Optimizing: Better invoke-static/-direct dispatch."
Vladimir Marko [Wed, 19 Aug 2015 12:45:42 +0000 (12:45 +0000)]
Revert "Optimizing: Better invoke-static/-direct dispatch."

Reverting due to failing ndebug tests.

This reverts commit 9b688a095afbae21112df5d495487ac5231b12d0.

Change-Id: Ie4f69da6609df3b7c8443412b6cf7f5c43c2c5d9

8 years agoMerge "Optimizing: Better invoke-static/-direct dispatch."
Vladimir Marko [Wed, 19 Aug 2015 11:27:57 +0000 (11:27 +0000)]
Merge "Optimizing: Better invoke-static/-direct dispatch."

8 years agoOptimizing: Better invoke-static/-direct dispatch.
Vladimir Marko [Wed, 6 May 2015 13:12:42 +0000 (14:12 +0100)]
Optimizing: Better invoke-static/-direct dispatch.

Add framework for different types of loading ArtMethod*
and code pointer retrieval. Implement invoke-static and
invoke-direct calls the same way as Quick. Document the
dispatch kinds in HInvokeStaticOrDirect's new enumerations
MethodLoadKind and CodePtrLocation.

PC-relative loads from dex cache arrays are used only for
x86-64 and arm64. The implementation for other architectures
will be done in separate CLs.

Change-Id: I468ca4d422dbd14748e1ba6b45289f0d31734d94

8 years agoMerge "Remove extra calls to `RecordPcInfo()`."
Nicolas Geoffray [Wed, 19 Aug 2015 10:52:30 +0000 (10:52 +0000)]
Merge "Remove extra calls to `RecordPcInfo()`."

8 years agoRemove extra calls to `RecordPcInfo()`.
Alexandre Rames [Wed, 19 Aug 2015 10:33:36 +0000 (11:33 +0100)]
Remove extra calls to `RecordPcInfo()`.

Some calls to `RecordPcInfo()` were mistakingly left in the x86/x86_64
code after we started using the `InvokeRuntime()` helper.

Change-Id: I8a902fee9db2dfb85020167289a786f965cb3fe9

8 years agoMerge "ART: Revert storing of exceptional predecessors"
David Brazdil [Wed, 19 Aug 2015 10:08:36 +0000 (10:08 +0000)]
Merge "ART: Revert storing of exceptional predecessors"

8 years agoMerge "Implement CountLeadingZeros for x86"
Roland Levillain [Wed, 19 Aug 2015 08:50:42 +0000 (08:50 +0000)]
Merge "Implement CountLeadingZeros for x86"

8 years agoMerge "Always visit object class from VisitReferences"
Mathieu Chartier [Tue, 18 Aug 2015 23:58:07 +0000 (23:58 +0000)]
Merge "Always visit object class from VisitReferences"

8 years agoMerge "Revert "Introduce support for hardware simulators, starting with ARM64""
Alex Light [Tue, 18 Aug 2015 23:27:43 +0000 (23:27 +0000)]
Merge "Revert "Introduce support for hardware simulators, starting with ARM64""

8 years agoRevert "Introduce support for hardware simulators, starting with ARM64"
Alex Light [Tue, 18 Aug 2015 23:03:42 +0000 (23:03 +0000)]
Revert "Introduce support for hardware simulators, starting with ARM64"

This reverts commit c2e1a5edc438274159c6ef8e65455ac73723a8f1.

This breaks the build for x86_64 targets. This is because on target the libvixl is not included as a
library for the libart.so target build. The build of non-x86_64 targets only works because the
compilers removes the dead-code that contains the libvixl symbols.

Bug: 23321940
Change-Id: I39e93ff05b887665c47fb0986867f1d13ca65b9b

8 years agoAlways visit object class from VisitReferences
Mathieu Chartier [Tue, 18 Aug 2015 20:54:21 +0000 (13:54 -0700)]
Always visit object class from VisitReferences

We don't want to unload classes which have instances.

Slight increase in CMS GC time from ~6.5s to ~7.3s on
EvaluateAndApplyChanges.

Bug: 22720414
Change-Id: I467ff9c9d55163d2a90b999aef3bdd7b3f648bac

8 years agoMerge "Svelter libart-compiler"
Alex Light [Tue, 18 Aug 2015 21:43:44 +0000 (21:43 +0000)]
Merge "Svelter libart-compiler"

8 years agoMerge "Guard thread exited message by try-catch in ThreadStress"
Mathieu Chartier [Tue, 18 Aug 2015 20:48:30 +0000 (20:48 +0000)]
Merge "Guard thread exited message by try-catch in ThreadStress"

8 years agoGuard thread exited message by try-catch in ThreadStress
Mathieu Chartier [Tue, 18 Aug 2015 18:42:03 +0000 (11:42 -0700)]
Guard thread exited message by try-catch in ThreadStress

Bug: 18577101
Change-Id: I1c3cbbfad09b88f4d913dc86bb6a89bf5b5269a8

8 years agoSvelter libart-compiler
Alex Light [Mon, 10 Aug 2015 22:30:07 +0000 (15:30 -0700)]
Svelter libart-compiler

Added new environment variable ART_{TARGET,HOST}_CODEGEN_ARCHS which
may be set to 'all', 'svelte' or a space separated list of architectures.

When compiled with ART_{TARGET,HOST}_CODEGEN_ARCHS='all' (the default
value) dex2oat will be able to generate output for all supported
architectures.

When compiled with ART_TARGET_CODEGEN_ARCHS='svelte'
only the architectures of the TARGET will be included. When
ART_HOST_CODEGEN_ARCHS='svelte' all architectures the target includes
and the host architectures will be included on the host dex2oat.

If a list of architectures is given only those will be included.

Change-Id: I87f4ad0131ab1b37544d8799e947ce4733b6daec

8 years agoMerge "Fix some global constructors and destructors"
Mathieu Chartier [Tue, 18 Aug 2015 18:14:12 +0000 (18:14 +0000)]
Merge "Fix some global constructors and destructors"

8 years agoFix some global constructors and destructors
Mathieu Chartier [Tue, 18 Aug 2015 17:41:39 +0000 (10:41 -0700)]
Fix some global constructors and destructors

Bug: 17994073

Change-Id: Ib4da5ac25812460b3dcee26024d1a3415a21257b

8 years agoMerge "Fix codegen_test."
Roland Levillain [Tue, 18 Aug 2015 17:43:29 +0000 (17:43 +0000)]
Merge "Fix codegen_test."

8 years agoFix codegen_test.
Roland Levillain [Tue, 18 Aug 2015 17:36:20 +0000 (18:36 +0100)]
Fix codegen_test.

Allow the execution of Thumb-2 code on ARM32 hardware.

Change-Id: I2fec71e39d538249569ffa88435f3198e8c28c01

8 years agoManually unrelocate odex files generated for test.
Richard Uhler [Mon, 10 Aug 2015 21:47:41 +0000 (14:47 -0700)]
Manually unrelocate odex files generated for test.

With this change, the oat file assistant test will work properly in
the case where the image happens to be randomly relocated by a delta
of 0.

Bug: 22599792
Change-Id: Id17bf7ef7644e7bc7980c120c0aa9b6e57673ec6

8 years agoART: Revert storing of exceptional predecessors
David Brazdil [Tue, 18 Aug 2015 16:17:38 +0000 (17:17 +0100)]
ART: Revert storing of exceptional predecessors

After change of the approach for try/catch register allocation, it is
no longer necessary to record instructions which might throw into a
catch block.

Change-Id: I7ef12ed06c49a35280029810975fa2a50fe4a424

8 years agoMerge "Introduce support for hardware simulators, starting with ARM64"
Roland Levillain [Tue, 18 Aug 2015 13:28:20 +0000 (13:28 +0000)]
Merge "Introduce support for hardware simulators, starting with ARM64"

8 years agoIntroduce support for hardware simulators, starting with ARM64
Phil Wang [Wed, 29 Jul 2015 07:14:09 +0000 (15:14 +0800)]
Introduce support for hardware simulators, starting with ARM64

Simulator support for ARM64 is implemented with VIXL.
Now codegen_test will also run on all supported hardware simulators.

Change-Id: Idc740f566175d1a23c373ea9292b8fc5ba526d00

8 years agoMerge "Fix and improve reference cache mod-union table"
Mathieu Chartier [Tue, 18 Aug 2015 00:40:27 +0000 (00:40 +0000)]
Merge "Fix and improve reference cache mod-union table"

8 years agoFix and improve reference cache mod-union table
Mathieu Chartier [Sun, 16 Aug 2015 21:37:04 +0000 (14:37 -0700)]
Fix and improve reference cache mod-union table

Improvements:
Remove cards that only contain null references, this can save memory
in some cases.

Fixes:
Fix a bug where the mod-union table didn't properly handle class
loaders in the boot image. This was cause by not adding the new
classes as references. The fix is to leave these cards dirty.

Bug: 23203999
Change-Id: Ib1f1f74154df976dd8abaf2430c6dabd4cae2dbe

8 years agoMerge "ART: Some header cleaning around bit-utils"
Andreas Gampe [Mon, 17 Aug 2015 22:59:27 +0000 (22:59 +0000)]
Merge "ART: Some header cleaning around bit-utils"

8 years agoART: Some header cleaning around bit-utils
Andreas Gampe [Fri, 14 Aug 2015 15:22:54 +0000 (08:22 -0700)]
ART: Some header cleaning around bit-utils

Try to remove dependencies where they are not necessary.

Change-Id: I5ff35cb17aea369bed3725b1610b50d7eb05b81e

8 years agoMerge "Correct for 115-native-bridge hard-coded x86/x86_64 signal handling values"
Andreas Gampe [Mon, 17 Aug 2015 22:24:30 +0000 (22:24 +0000)]
Merge "Correct for 115-native-bridge hard-coded x86/x86_64 signal handling values"

8 years agoMerge "ART: Follow-up fixes"
Andreas Gampe [Mon, 17 Aug 2015 21:19:23 +0000 (21:19 +0000)]
Merge "ART: Follow-up fixes"

8 years agoMerge "ART: Dex2oat lint fix"
Andreas Gampe [Mon, 17 Aug 2015 21:15:15 +0000 (21:15 +0000)]
Merge "ART: Dex2oat lint fix"

8 years agoART: Dex2oat lint fix
Andreas Gampe [Mon, 17 Aug 2015 21:14:25 +0000 (14:14 -0700)]
ART: Dex2oat lint fix

Lint fix.

Change-Id: Id45bc246645715afaca58c145a70c3b319e5d673

8 years agoCorrect for 115-native-bridge hard-coded x86/x86_64 signal handling values
Agi Csaki [Mon, 17 Aug 2015 20:40:45 +0000 (13:40 -0700)]
Correct for 115-native-bridge hard-coded x86/x86_64 signal handling values

Added inline assembly to ensure that the instruction causing a segfault
in x86/x86_64 for the 115-native-bridge test always has a size of 3 bytes,
in response to a bug that caused the test to fail when this instruction
had variable sizes.

Bug: 22876261
Change-Id: I296e623f170fd1925919bedf913c569a6563e3dc

8 years agoMerge "Revert "Revert "ART: DCHECK zero case for CLZ/CTZ"""
Andreas Gampe [Mon, 17 Aug 2015 20:52:26 +0000 (20:52 +0000)]
Merge "Revert "Revert "ART: DCHECK zero case for CLZ/CTZ"""

8 years agoRevert "Revert "ART: DCHECK zero case for CLZ/CTZ""
Andreas Gampe [Fri, 14 Aug 2015 23:01:49 +0000 (23:01 +0000)]
Revert "Revert "ART: DCHECK zero case for CLZ/CTZ""

This reverts commit 4318d91ea4be673d4deba39d33ac4718d77986a7.

Fix up the lit=-1 case in the arm32 Quick backend; add test case.

Change-Id: I8d0861133db950090ee959f532ede1448683dfa9

8 years agoART: Follow-up fixes
Andreas Gampe [Mon, 17 Aug 2015 20:43:55 +0000 (13:43 -0700)]
ART: Follow-up fixes

Addressing comments for CL 166499, commit
5073fedd553afeb6ccdb49c1a1ab2cc2947c0870.

Change-Id: I359e5a4c026d58d75cb62b90c495796855302b94

8 years agoMerge "Only apply aarch64 clang WAR to the target."
Dan Albert [Mon, 17 Aug 2015 20:31:27 +0000 (20:31 +0000)]
Merge "Only apply aarch64 clang WAR to the target."

8 years agoOnly apply aarch64 clang WAR to the target.
Dan Albert [Mon, 17 Aug 2015 17:14:51 +0000 (10:14 -0700)]
Only apply aarch64 clang WAR to the target.

Note that the ART_TARGET_CLANG_CFLAGS_$(arch) was actually broken over a
year ago. This patch fixes that and drops the no longer needed
-DNVALGRIND for clang aarch64.

Bug: http://b/23256622
Change-Id: I749db286c0fd533aeb50744b323c1faddf951d79

8 years agoMerge "Refactor art::Dex2Oat::ParseArg."
Dan Albert [Mon, 17 Aug 2015 20:25:39 +0000 (20:25 +0000)]
Merge "Refactor art::Dex2Oat::ParseArg."

8 years agoRefactor art::Dex2Oat::ParseArg.
Roland Levillain [Mon, 17 Aug 2015 19:18:41 +0000 (20:18 +0100)]
Refactor art::Dex2Oat::ParseArg.

Split up art::Dex2Oat::ParseArg to allow
`clang++ -01 -Werror -Wframe-larger-than=1728` to compile
dex2oat.cc.

Change-Id: I0b45f394568765ccd849c87a7cf910507291e65d

8 years agoMerge "Make patchoat match offset when given a patched image"
Alex Light [Mon, 17 Aug 2015 17:20:46 +0000 (17:20 +0000)]
Merge "Make patchoat match offset when given a patched image"

8 years agoMerge "ART: Rename ArtMethod's size and alignment methods."
Vladimir Marko [Mon, 17 Aug 2015 15:57:24 +0000 (15:57 +0000)]
Merge "ART: Rename ArtMethod's size and alignment methods."

8 years agoART: Rename ArtMethod's size and alignment methods.
Vladimir Marko [Mon, 17 Aug 2015 11:07:23 +0000 (12:07 +0100)]
ART: Rename ArtMethod's size and alignment methods.

Remove the historical prefix "Object" to avoid confusion
with Java objects.

Change-Id: Ib36422c9a24878d8d4bd757977d99cbf66b3d567

8 years agoImplement CountLeadingZeros for x86
Mark Mendell [Thu, 13 Aug 2015 01:16:41 +0000 (21:16 -0400)]
Implement CountLeadingZeros for x86

Generate Long and Integer numberOfLeadingZeros for x86 and x86_64. Uses
'bsr' instruction to find the first one bit, and then corrects the
result.

Added some more tests with constant values to test constant folding.
Also add a runtime test with 0 as the input.

Change-Id: I920b21bb00069bccf5f921f8f87a77e334114926
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
8 years agoMerge "ART: Compress LengthPrefixedArray on 32-bit targets."
Vladimir Marko [Mon, 17 Aug 2015 10:49:15 +0000 (10:49 +0000)]
Merge "ART: Compress LengthPrefixedArray on 32-bit targets."

8 years agoMerge "Add 'bsr' instruction to x86 and x86_64"
Roland Levillain [Mon, 17 Aug 2015 10:06:07 +0000 (10:06 +0000)]
Merge "Add 'bsr' instruction to x86 and x86_64"

8 years agoART: Compress LengthPrefixedArray on 32-bit targets.
Vladimir Marko [Wed, 12 Aug 2015 18:27:26 +0000 (19:27 +0100)]
ART: Compress LengthPrefixedArray on 32-bit targets.

Previously, the LengthPrefixedArray<ArtMethod> on 32-bit
targets contained a 64-bit length field followed by the
ArtMethod elements with size only a multiple of 4, not 8.
Consequently, an odd-length array broke the alignment for
the following array which would have the 64-bit length
placed at an unaligned address.

To fix that, we make the length field 32-bit and explicitly
pass the alignment information to the LengthPrefixedArray.
This also makes the 32-bit boot image a bit smaller.
On Nexus 5, AOSP, ToT, the field section is 11528B smaller
and the method section is 21036B smaller. 64-bit targets
should see the same savings for the field section but no
difference for the methods section.

Change-Id: I3e03e7b94129025c8a1c117c27645a34dec516d2

8 years agoMerge "Force Clang aarch64 builds to -O1."
Dan Albert [Sun, 16 Aug 2015 23:57:36 +0000 (23:57 +0000)]
Merge "Force Clang aarch64 builds to -O1."

8 years agoForce Clang aarch64 builds to -O1.
Dan Albert [Sun, 16 Aug 2015 23:49:29 +0000 (16:49 -0700)]
Force Clang aarch64 builds to -O1.

Bug: http://b/23256622
Change-Id: Icab87964576f12a671e255500dec901f3558e7ad

8 years agoMerge "Add -Wno-pessimizing-move to Clang flags"
Stephen Hines [Sat, 15 Aug 2015 02:04:56 +0000 (02:04 +0000)]
Merge "Add -Wno-pessimizing-move to Clang flags"

8 years agoMerge "Optimizing String.Equals as an intrinsic (x86_64)"
Andreas Gampe [Fri, 14 Aug 2015 23:49:45 +0000 (23:49 +0000)]
Merge "Optimizing String.Equals as an intrinsic (x86_64)"

8 years agoMerge "ART: Fix verifier dumping, add hard-fail dumping"
Andreas Gampe [Fri, 14 Aug 2015 22:47:09 +0000 (22:47 +0000)]
Merge "ART: Fix verifier dumping, add hard-fail dumping"

8 years agoART: Fix verifier dumping, add hard-fail dumping
Andreas Gampe [Fri, 14 Aug 2015 22:37:35 +0000 (15:37 -0700)]
ART: Fix verifier dumping, add hard-fail dumping

Fix the dumping code in the verifier.

Add an option to dump the verifier state on hard failure when
verbose:verifier.

Change-Id: Iccea92fcbcb2301356d86004ea0f5f3e5da84f3c

8 years agoMerge "ART: Relax verifier aput checking"
Andreas Gampe [Fri, 14 Aug 2015 21:32:53 +0000 (21:32 +0000)]
Merge "ART: Relax verifier aput checking"

8 years agoART: Relax verifier aput checking
Andreas Gampe [Fri, 14 Aug 2015 21:07:43 +0000 (14:07 -0700)]
ART: Relax verifier aput checking

When checking on a null array, the cases of aput and aput-wide are
shared between integral and floating point types. Be careful to not
reject a valid program.

Bug: 21867457
Bug: 23201502
Change-Id: I6c54a389c06e40a2dae00995aa16ff08a089e512

8 years agoMake patchoat match offset when given a patched image
Alex Light [Wed, 12 Aug 2015 01:03:47 +0000 (18:03 -0700)]
Make patchoat match offset when given a patched image

Previously if we gave patchoat a patched image and a already patched
(but improperly relocated) oat file it would not correctly patch the
oat file to the same offset as the image.

Bug: 22599792
Bug: 23119724
Change-Id: I8773022bd75c2e0b7eb529893b147cbd8792bcad

8 years agoMerge "Revert "ART: DCHECK zero case for CLZ/CTZ""
Andreas Gampe [Fri, 14 Aug 2015 18:39:46 +0000 (18:39 +0000)]
Merge "Revert "ART: DCHECK zero case for CLZ/CTZ""

8 years agoRevert "ART: DCHECK zero case for CLZ/CTZ"
Andreas Gampe [Fri, 14 Aug 2015 18:39:30 +0000 (18:39 +0000)]
Revert "ART: DCHECK zero case for CLZ/CTZ"

This reverts commit 51db2c217052fd6881b81f3ac5162fe88c36dbf0.

Still breaks for arm32. :(

Change-Id: I5fe6fc0cc410cc1c5b6bd68028ce9bf835cb94d5

8 years agoMerge "Change SS to use MarkObjectIfNotInToSpace for roots"
Mathieu Chartier [Fri, 14 Aug 2015 17:54:21 +0000 (17:54 +0000)]
Merge "Change SS to use MarkObjectIfNotInToSpace for roots"

8 years agoMerge "ART: Add utility function to dump dex CFG"
Andreas Gampe [Fri, 14 Aug 2015 17:51:51 +0000 (17:51 +0000)]
Merge "ART: Add utility function to dump dex CFG"

8 years agoOptimizing String.Equals as an intrinsic (x86_64)
Agi Csaki [Fri, 14 Aug 2015 00:54:54 +0000 (17:54 -0700)]
Optimizing String.Equals as an intrinsic (x86_64)

The fourth implementation of String.Equals. I added an intrinsic
in x86_64 which is similar to the original java implementation
of String.equals: an instanceof check, null check,length check,
and reference equality check followed by a loop comparing strings
four characters at a time.

Interesting Benchmarking Values:

Optimizing Compiler on 64-bit Emulator
        Intrinsic 1-5 Character Strings: 48 ns
        Original 1-5 Character Strings: 56 ns
        Intrinsic 1000+ Character Strings: 4009 ns
        Original 1000+ Character Strings: 4704 ns
        Intrinsic Non-String Argument: 35 ns
        Original Non-String Argument: 42 ns

Bug: 21481923
Change-Id: I17d0d2e24a670a898ab1729669d3990403b9a853

8 years agoChange SS to use MarkObjectIfNotInToSpace for roots
Mathieu Chartier [Fri, 14 Aug 2015 17:37:28 +0000 (10:37 -0700)]
Change SS to use MarkObjectIfNotInToSpace for roots

The roots can be in the to-space since we may visit the declaring
class of an ArtMethod multiple times if it is on the call stack.

Fixes GSS/SS tests for a few test cases.

Change-Id: Iba354340289fc49987d06e70929dadb2f367734b

8 years agoAdd 'bsr' instruction to x86 and x86_64
Mark Mendell [Thu, 13 Aug 2015 01:16:41 +0000 (21:16 -0400)]
Add 'bsr' instruction to x86 and x86_64

Add support for 'bsr' instruction.  Add tests.

Change-Id: I1cd8b30d7f3f5ee7fbeef8124cc6a31bf8ce59d5
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
8 years agoMerge "Add rep movsw to x86 and x86_64 instructions."
Roland Levillain [Fri, 14 Aug 2015 16:07:50 +0000 (16:07 +0000)]
Merge "Add rep movsw to x86 and x86_64 instructions."

8 years agoMerge "Revert "Revert "Optimizing String.Equals as an intrinsic (x86)"""
Andreas Gampe [Fri, 14 Aug 2015 15:21:14 +0000 (15:21 +0000)]
Merge "Revert "Revert "Optimizing String.Equals as an intrinsic (x86)"""

8 years agoAdd rep movsw to x86 and x86_64 instructions.
Mark Mendell [Wed, 1 Jul 2015 18:26:52 +0000 (14:26 -0400)]
Add rep movsw to x86 and x86_64 instructions.

Add 'REP MOVSW' as a supported instruction for x86 32 and 64 bit.

Added tests.

Change-Id: I1c615ac1e7fa46c48983c90f791b92be0375c8b8
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
8 years agoMerge "ART: DCHECK zero case for CLZ/CTZ"
Andreas Gampe [Fri, 14 Aug 2015 15:06:46 +0000 (15:06 +0000)]
Merge "ART: DCHECK zero case for CLZ/CTZ"

8 years agoMerge "Fix a bug in the register allocator when allocating pairs."
Nicolas Geoffray [Fri, 14 Aug 2015 10:54:56 +0000 (10:54 +0000)]
Merge "Fix a bug in the register allocator when allocating pairs."

8 years agoART: DCHECK zero case for CLZ/CTZ
Andreas Gampe [Fri, 14 Aug 2015 03:55:31 +0000 (20:55 -0700)]
ART: DCHECK zero case for CLZ/CTZ

Add a DCHECK_CONSTEXPR. All current callers have an explicit
zero check before hand and so we should not trip this at the
moment. Remove the TODO.

Add the check for T being unsigned for CLZ (trivial fix for
leb128.h). We use CTZ with signed types.

Change-Id: I7bbf0b1699eed21715c6cc20dbfe22b7da403b1a

8 years agoMerge "Optimizing String.Equals as an intrinsic (ARM64)"
Andreas Gampe [Fri, 14 Aug 2015 03:00:37 +0000 (03:00 +0000)]
Merge "Optimizing String.Equals as an intrinsic (ARM64)"

8 years agoMerge "Visit declaring class of methods on call stack"
Mathieu Chartier [Fri, 14 Aug 2015 01:37:58 +0000 (01:37 +0000)]
Merge "Visit declaring class of methods on call stack"

8 years agoRevert "Revert "Optimizing String.Equals as an intrinsic (x86)""
Agi Csaki [Fri, 14 Aug 2015 00:46:44 +0000 (17:46 -0700)]
Revert "Revert "Optimizing String.Equals as an intrinsic (x86)""

This reverts commit aabdf8ad2e8d3de953d.
The third implementation of String.Equals. I added an intrinsic
in x86 which is similar to the original java implementation of
String.equals: an instanceof check, null check, length check, and
reference equality check followed by a loop comparing strings
character by character.

Interesting Benchmarking Values:

Optimizing Compiler on Nexus Player
        Intrinsic 15-30 Character Strings: 177 ns
        Original 15-30 Character Strings: 275 ns
        Intrinsic Null Argument: 59 ns
        Original Null Argument: 137 ns
        Intrinsic 100-1000 Character Strings: 1812 ns
        Original 100-1000 Character Strings: 6334 ns

Bug: 21481923
Change-Id: I93fa603c4bd22639143d29d0bfc7e773846f21d3

8 years agoVisit declaring class of methods on call stack
Mathieu Chartier [Thu, 13 Aug 2015 19:56:31 +0000 (12:56 -0700)]
Visit declaring class of methods on call stack

Bug: 22720414
Change-Id: Iab9727dde243d76fd9dfdb1db73899fedd1ab6ea

8 years agoOptimizing String.Equals as an intrinsic (ARM64)
Agi Csaki [Fri, 14 Aug 2015 00:51:19 +0000 (17:51 -0700)]
Optimizing String.Equals as an intrinsic (ARM64)

The fifth implementation of String.Equals.  I added an intrinsic
in ARM64 which is similar to the original java implementation
of String.equals: an instanceof check, null check, length check, and
reference equality check followed by a loop comparing strings four
characters at a time starting at the beginning of the string.

Interesting Benchmarking Values:

64 Bit Nexus 9:
Intrinsic Short (1-5 Character) Strings: 40 ns
Original Short (1-5 Character) Strings: 80 ns
Intrinsic Very Long (1000+ Character) Strings: 1556 ns
Original Very Long (1000+ Character) Strings: 4554 ns
Intrinsic Non-String Argument: 15 ns
Original Non-String Argument: 62 ns

Bug: 21481923
Change-Id: If37b399614c2250f52ac709a3b50c356419ca88a

8 years agoMerge "Ignore OOME in ThreadStress Daemon threads"
Mathieu Chartier [Thu, 13 Aug 2015 21:28:28 +0000 (21:28 +0000)]
Merge "Ignore OOME in ThreadStress Daemon threads"

8 years agoIgnore OOME in ThreadStress Daemon threads
Mathieu Chartier [Thu, 13 Aug 2015 20:02:01 +0000 (13:02 -0700)]
Ignore OOME in ThreadStress Daemon threads

When the runtime is shutting down we don't allow GC, this can cause
OOME in Daemon threads that are allocating. The OOME stack trace
printing can cause the test to fail.

Bug: 18577101
Change-Id: Iabbce3d75caada361dd06942f4b3be9907596091

8 years agoMerge "Adjust art::HTypeConversion's side effects for MIPS64."
Roland Levillain [Thu, 13 Aug 2015 16:25:52 +0000 (16:25 +0000)]
Merge "Adjust art::HTypeConversion's side effects for MIPS64."

8 years agoMerge "Small optimization improvements."
Nicolas Geoffray [Thu, 13 Aug 2015 15:16:40 +0000 (15:16 +0000)]
Merge "Small optimization improvements."

8 years agoAdjust art::HTypeConversion's side effects for MIPS64.
Roland Levillain [Thu, 13 Aug 2015 11:31:44 +0000 (12:31 +0100)]
Adjust art::HTypeConversion's side effects for MIPS64.

Also improve debugging information in
art::CodeGenerator::ValidateInvokeRuntime.

Change-Id: Icfcd1a5cfa5e5449a316251dc20547de6badecb5

8 years agoMerge "Remove unnecessary `explicit` qualifiers on constructors."
Roland Levillain [Thu, 13 Aug 2015 11:00:54 +0000 (11:00 +0000)]
Merge "Remove unnecessary `explicit` qualifiers on constructors."

8 years agoART: Add utility function to dump dex CFG
Andreas Gampe [Mon, 10 Aug 2015 18:40:25 +0000 (11:40 -0700)]
ART: Add utility function to dump dex CFG

Add a utility function in utils.h to dump the dex CFG of
a method.

Add an option ("-g") to dump CFGs of a dex file in dexdump2.

Change-Id: I380082f0abe8ed7eeb6a9186364a99425f69f55c

8 years agoMerge "Intrinsics recognizer returns kNone for MIPS, MIPS64 instruction sets"
Andreas Gampe [Thu, 13 Aug 2015 05:26:35 +0000 (05:26 +0000)]
Merge "Intrinsics recognizer returns kNone for MIPS, MIPS64 instruction sets"

8 years agoMerge "Structure for String.Equals intrinsic"
Andreas Gampe [Thu, 13 Aug 2015 05:13:11 +0000 (05:13 +0000)]
Merge "Structure for String.Equals intrinsic"

8 years agoStructure for String.Equals intrinsic
agicsaki [Thu, 13 Aug 2015 03:30:17 +0000 (20:30 -0700)]
Structure for String.Equals intrinsic

Added structure for implementing String.Equals intrinsics. There is no
functional change at this point- the intrinsic is marked as unimplemented
for all instruction sets and compilers.

Bug: 21481923
Change-Id: Ic2a1e22a113ff6091581126f12e926478c011340

8 years agoIntrinsics recognizer returns kNone for MIPS, MIPS64 instruction sets
agicsaki [Thu, 13 Aug 2015 04:20:43 +0000 (21:20 -0700)]
Intrinsics recognizer returns kNone for MIPS, MIPS64 instruction sets

Since no intrinsics are implemented in MIPS or MIPS64, the intrinsics
recognizer now does not mark methods as being intrinsified if the
current instruction set is either MIPS or MIPS64.

Change-Id: I9819ccd11d280e548623ad18add057eefefbf6d5

8 years agoMerge "Add support to indicate whether intrinsics require an environment"
Andreas Gampe [Thu, 13 Aug 2015 02:54:37 +0000 (02:54 +0000)]
Merge "Add support to indicate whether intrinsics require an environment"

8 years agoMerge "Wait for GC to finish in ThreadList::~ThreadList"
Mathieu Chartier [Thu, 13 Aug 2015 01:38:18 +0000 (01:38 +0000)]
Merge "Wait for GC to finish in ThreadList::~ThreadList"

8 years agoSmall optimization improvements.
Nicolas Geoffray [Thu, 13 Aug 2015 01:28:14 +0000 (18:28 -0700)]
Small optimization improvements.

- Tune CanBeNull for HBoundType.
- Remove LoadClass when we know the class is loaded.
- Tune CanBeNull for StringInit.

Change-Id: I564ed33a506d65e991a514342bdfd1610bed0cf5

8 years agoWait for GC to finish in ThreadList::~ThreadList
Mathieu Chartier [Wed, 12 Aug 2015 23:40:32 +0000 (16:40 -0700)]
Wait for GC to finish in ThreadList::~ThreadList

Added a DisableGC to the heap instead of using the runtime shutdown
boolean. The runtime shutting down boolean is set to true before the
non daemon threads have exited. These threads may still be doing
allocations and we don't want to throw OOME if unnecessary.

Bug: 18577101
Change-Id: Iceb7048e6bd799aa2716099459c54f8dc0fb8feb

8 years agoAdd support to indicate whether intrinsics require an environment
agicsaki [Wed, 12 Aug 2015 00:39:37 +0000 (17:39 -0700)]
Add support to indicate whether intrinsics require an environment

A structural change to indicate whether a given intrinsic requires
access to an environment. I added a field to HInvoke objects to indicate
if they need an environment whose default value is true and is only updated
if an intrinsic is marked as not requiring an environment. At this point
there is no functional change, as all intrinsics are marked as requiring
an environment. This change adds the structure for future inliner work
which will allow us to inline more intrinsified calls.

Change-Id: I2930e3cef7b785384bf95b95a542d34af442f3b9