OSDN Git Service

android-x86/art.git
9 years agoMerge "Fix java_lang_Class newInstance for strings; also quick entrypoints."
Jeff Hao [Tue, 28 Apr 2015 03:57:53 +0000 (03:57 +0000)]
Merge "Fix java_lang_Class newInstance for strings; also quick entrypoints."

9 years agoFix java_lang_Class newInstance for strings; also quick entrypoints.
Jeff Hao [Tue, 28 Apr 2015 03:54:07 +0000 (20:54 -0700)]
Fix java_lang_Class newInstance for strings; also quick entrypoints.

Change-Id: I35fd23c5a9051e1ffda0ecc2cbafb5d318c7b5e6

9 years agoMerge "ART: Fix constructor access checking"
Andreas Gampe [Tue, 28 Apr 2015 02:42:25 +0000 (02:42 +0000)]
Merge "ART: Fix constructor access checking"

9 years agoART: Fix constructor access checking
Andreas Gampe [Tue, 28 Apr 2015 00:26:37 +0000 (17:26 -0700)]
ART: Fix constructor access checking

Constructor access must be checked.

(cherry picked from commit 0dd76cd3f09f495a1b9a0e4f8712c09ff885c6fd)

Bug: 20639158
Change-Id: I3c586e9572a748d208bea43aa2349c3ef52a2ee5

9 years agoMerge "Replace String CharArray with internal uint16_t array."
Jeff Hao [Tue, 28 Apr 2015 02:04:09 +0000 (02:04 +0000)]
Merge "Replace String CharArray with internal uint16_t array."

9 years agoReplace String CharArray with internal uint16_t array.
Jeff Hao [Wed, 15 Jan 2014 21:49:50 +0000 (13:49 -0800)]
Replace String CharArray with internal uint16_t array.

Summary of high level changes:
  - Adds compiler inliner support to identify string init methods
  - Adds compiler support (quick & optimizing) with new invoke code path
    that calls method off the thread pointer
  - Adds thread entrypoints for all string init methods
  - Adds map to verifier to log when receiver of string init has been
    copied to other registers. used by compiler and interpreter

Change-Id: I797b992a8feb566f9ad73060011ab6f51eb7ce01

9 years agoMerge "Switch the default read barrier type to a Baker one."
Hiroshi Yamauchi [Tue, 28 Apr 2015 01:07:17 +0000 (01:07 +0000)]
Merge "Switch the default read barrier type to a Baker one."

9 years agoSwitch the default read barrier type to a Baker one.
Hiroshi Yamauchi [Tue, 28 Apr 2015 00:58:51 +0000 (17:58 -0700)]
Switch the default read barrier type to a Baker one.

For automated testing.

Bug: 12687968
Change-Id: I831d6e45e4729f0dd3cf178d02af511a32cc9777

9 years agoMerge "Fix mismatched malloc/free delete/new."
Christopher Ferris [Mon, 27 Apr 2015 19:05:36 +0000 (19:05 +0000)]
Merge "Fix mismatched malloc/free delete/new."

9 years agoFix mismatched malloc/free delete/new.
Christopher Ferris [Sat, 25 Apr 2015 00:23:53 +0000 (17:23 -0700)]
Fix mismatched malloc/free delete/new.

Modify the monitor code to override the delete operator. The problem
is the new operator is overloaded to return a pointer returned by
posix_memalign, but then it's freed with a delete, not a free call.

Also, fix the debugger code to use the [] for a std::unique_ptr to
match how the value is actually allocated.

Both problems found by ASAN.

Bug: 18202869

Change-Id: I2f3a2c02a7f35399b7ba6717b08a035089fab00d

9 years agoMerge "Use the lock word bits for Baker-style read barrier."
Hiroshi Yamauchi [Mon, 27 Apr 2015 18:10:18 +0000 (18:10 +0000)]
Merge "Use the lock word bits for Baker-style read barrier."

9 years agoMerge "Fix clean-oat"
Mathieu Chartier [Mon, 27 Apr 2015 18:01:13 +0000 (18:01 +0000)]
Merge "Fix clean-oat"

9 years agoFix clean-oat
Mathieu Chartier [Mon, 27 Apr 2015 17:46:39 +0000 (10:46 -0700)]
Fix clean-oat

Change to use adb shell sh -c <cmd>.

Also fixed other phony targets, deleted smart mode and added
verify-at-runtime mode.

Change-Id: I562117774eaa153e66b46d6f173fe993931018b7

9 years agoMerge "Dissociate uses with environment uses."
Nicolas Geoffray [Mon, 27 Apr 2015 17:12:10 +0000 (17:12 +0000)]
Merge "Dissociate uses with environment uses."

9 years agoMerge "Quick: Rely on inferred types in GVN/LVN/DCE."
Vladimir Marko [Mon, 27 Apr 2015 16:53:25 +0000 (16:53 +0000)]
Merge "Quick: Rely on inferred types in GVN/LVN/DCE."

9 years agoDissociate uses with environment uses.
Nicolas Geoffray [Mon, 27 Apr 2015 15:58:06 +0000 (16:58 +0100)]
Dissociate uses with environment uses.

They are most of the times in the way when iterating. They
also complicate the logic of (future) back edge uses.

Change-Id: I152595d9913073fe901b267ca623fa0fe7432484

9 years agoMerge "ART: Simplify Ifs with BooleanNot condition"
David Brazdil [Mon, 27 Apr 2015 16:02:02 +0000 (16:02 +0000)]
Merge "ART: Simplify Ifs with BooleanNot condition"

9 years agoART: Simplify Ifs with BooleanNot condition
David Brazdil [Mon, 27 Apr 2015 12:54:09 +0000 (13:54 +0100)]
ART: Simplify Ifs with BooleanNot condition

If statements with negated condition can be simplified by removing the
negation and swapping the true and false branches.

Change-Id: I197afbc79fb7344d73b7b85d3611e7ca2519717f

9 years agoMerge "Add support for caching float and double constants."
Nicolas Geoffray [Mon, 27 Apr 2015 14:12:24 +0000 (14:12 +0000)]
Merge "Add support for caching float and double constants."

9 years agoAdd support for caching float and double constants.
Nicolas Geoffray [Mon, 27 Apr 2015 08:53:46 +0000 (08:53 +0000)]
Add support for caching float and double constants.

Change-Id: Ib5205bad1006bc5e3c9cc86bc82a6b4b1ce9bef9

9 years agoMerge "ART: Fix removing a Phi with RemoveInstruction"
David Brazdil [Mon, 27 Apr 2015 12:42:59 +0000 (12:42 +0000)]
Merge "ART: Fix removing a Phi with RemoveInstruction"

9 years agoART: Fix removing a Phi with RemoveInstruction
David Brazdil [Mon, 27 Apr 2015 12:28:57 +0000 (13:28 +0100)]
ART: Fix removing a Phi with RemoveInstruction

Boolean simplifier might attempt to remove a Phi from the Instruction
list.

Change-Id: I698cc616549bd88dac96395cb2e5d09b5433d157

9 years agoQuick: Rely on inferred types in GVN/LVN/DCE.
Vladimir Marko [Fri, 24 Apr 2015 18:03:51 +0000 (19:03 +0100)]
Quick: Rely on inferred types in GVN/LVN/DCE.

Fix LVN::GetEndingVregValueNumberImpl() to check whether
the requested wideness matches the SSA register type as
recorded in MIRGraph::reg_location_.

Add DCHECKs that the wideness matches when getting/setting
sreg values, update Phi handling in LVN/DCE to use the type
from MIRGraph::reg_location_ instead of determining it from
the sreg value maps which would now trigger the DCHECKs.
Update tests to initialize MIRGraph::reg_location_.

Reenable DCE.

Bug: 20572509
Change-Id: I1a4d4e32cd57807ca8b56d2f3ed5e1288660b82e

9 years agoMerge "BCE: don't add deoptimization if the loop has early exit."
Mingyao Yang [Mon, 27 Apr 2015 01:41:58 +0000 (01:41 +0000)]
Merge "BCE: don't add deoptimization if the loop has early exit."

9 years agoBCE: don't add deoptimization if the loop has early exit.
Mingyao Yang [Mon, 27 Apr 2015 01:15:30 +0000 (18:15 -0700)]
BCE: don't add deoptimization if the loop has early exit.

Also make the way to detect loop_body_successor to be
more accurate.

Change-Id: I29680f93396383c478a8f40ad28735e4f3f07c1b

9 years agoMerge "Deoptimization-based BCE for unknown loop bounds."
Mingyao Yang [Sun, 26 Apr 2015 18:23:01 +0000 (18:23 +0000)]
Merge "Deoptimization-based BCE for unknown loop bounds."

9 years agoDeoptimization-based BCE for unknown loop bounds.
Mingyao Yang [Mon, 13 Apr 2015 23:46:28 +0000 (16:46 -0700)]
Deoptimization-based BCE for unknown loop bounds.

For loop like:
  for (int i = start; i < end; i++) {
    array[i] = 1;
  }
We add the following to the loop pre-header:
  if (start < 0) deoptimize();
  if (end > array.length) deoptimize();
Then we can eliminate bounds-check of array[i] inside the loop.

We also take care of indexing with induction variable plus some offsets,
like array[i - 1]/array[i + 1] inside the loop, and adjust the condition
for deoptimization accordingly.

Change-Id: I9e24c6b5e134ff95eff5b5605ff8f95d6546616f

9 years agoMerge "Revert "[optimizing] Replace FP divide by power of 2""
Nicolas Geoffray [Sun, 26 Apr 2015 16:43:18 +0000 (16:43 +0000)]
Merge "Revert "[optimizing] Replace FP divide by power of 2""

9 years agoRevert "[optimizing] Replace FP divide by power of 2"
Nicolas Geoffray [Sun, 26 Apr 2015 16:43:00 +0000 (16:43 +0000)]
Revert "[optimizing] Replace FP divide by power of 2"

Fails compiling docs.

This reverts commit b0bd8915cb257cdaf46ba663c450a6543bca75af.

Change-Id: I47d32525c83a73118e2163eb58c68bbb7a28bb38

9 years agoMerge "[optimizing] Replace FP divide by power of 2"
Nicolas Geoffray [Sun, 26 Apr 2015 15:05:28 +0000 (15:05 +0000)]
Merge "[optimizing] Replace FP divide by power of 2"

9 years agoMerge "ART: Fix Trace types, check minimum buf size"
Andreas Gampe [Sun, 26 Apr 2015 00:41:53 +0000 (00:41 +0000)]
Merge "ART: Fix Trace types, check minimum buf size"

9 years agoMerge "ART: Fix addpd opcode, add Quick x86 assembler test"
Andreas Gampe [Sun, 26 Apr 2015 00:39:03 +0000 (00:39 +0000)]
Merge "ART: Fix addpd opcode, add Quick x86 assembler test"

9 years agoART: Fix Trace types, check minimum buf size
Andreas Gampe [Sat, 25 Apr 2015 21:44:29 +0000 (14:44 -0700)]
ART: Fix Trace types, check minimum buf size

Also make streaming mode adhere to the given buffer (and fix the
case where the buffer is too small for a packet). This is important
to not lose too much tracing information when the runtime is destroyed
with an unflushed buffer.

Change-Id: I6525fe4326ac5c3d7c9cda41c54a2a911ca889b7

9 years agoART: Fix addpd opcode, add Quick x86 assembler test
Chao-ying Fu [Wed, 22 Apr 2015 17:51:21 +0000 (10:51 -0700)]
ART: Fix addpd opcode, add Quick x86 assembler test

This patch fixes the addpd opcode that may be used by vectorizations,
and adds an assembler test for the Quick x86 assembler, currently
lightly testing addpd, subpd and mulpd.

Change-Id: I29455a86212829c75fd75737679280f167da7b5b
Signed-off-by: Chao-ying Fu <chao-ying.fu@intel.com>
9 years agoMerge "ART: Test for GVN skipping"
Andreas Gampe [Sat, 25 Apr 2015 22:59:23 +0000 (22:59 +0000)]
Merge "ART: Test for GVN skipping"

9 years agoART: Test for GVN skipping
Andreas Gampe [Sat, 25 Apr 2015 22:27:38 +0000 (15:27 -0700)]
ART: Test for GVN skipping

Add a deeply nested loop to test 090 that will make the GVN skip.

Change-Id: I7c160293e76fd858c550f792b357eaaccdde77a9

9 years agoMerge "Move Class.newInstance to native"
Mathieu Chartier [Sat, 25 Apr 2015 22:36:26 +0000 (22:36 +0000)]
Merge "Move Class.newInstance to native"

9 years agoMerge "ART: Fix missing dependency between GVN and other passes"
Andreas Gampe [Sat, 25 Apr 2015 22:18:23 +0000 (22:18 +0000)]
Merge "ART: Fix missing dependency between GVN and other passes"

9 years agoART: Fix missing dependency between GVN and other passes
Andreas Gampe [Sat, 25 Apr 2015 21:47:31 +0000 (14:47 -0700)]
ART: Fix missing dependency between GVN and other passes

The GVN may be turned off completely, or skip running when the
method is too complex. Turn off DCE in that case.

The dependent cleanup pass is not an optimization pass, so can't be
turned off that way. Check whether the GVN skipped in the gate function.

A possible follow-up is proper dependencies between passes.

Change-Id: I5b7951ecd6c74ebbfa5b23726a3d2f3ea1a23a47

9 years agoMove Class.newInstance to native
Mathieu Chartier [Fri, 24 Apr 2015 23:55:16 +0000 (16:55 -0700)]
Move Class.newInstance to native

Avoids 1 allocation and several JNI transitions.

Before:
Class_classNewInstance: 4462.39 ns; σ=39.42 ns @ 3 trials

After:
Class_classNewInstance: 1073.39 ns; σ=24.14 ns @ 10 trials

Bug: 20269715
Bug: 20566996
Change-Id: Icd52155ce79a978a4d869855bfdfd7735abd8187

9 years agoMerge "ART: Refactor utils/assembler test"
Andreas Gampe [Sat, 25 Apr 2015 19:38:39 +0000 (19:38 +0000)]
Merge "ART: Refactor utils/assembler test"

9 years agoMerge "Disable Quick's GVN-based dead code elimination."
Vladimir Marko [Sat, 25 Apr 2015 14:20:53 +0000 (14:20 +0000)]
Merge "Disable Quick's GVN-based dead code elimination."

9 years agoDisable Quick's GVN-based dead code elimination.
Roland Levillain [Sat, 25 Apr 2015 11:17:24 +0000 (12:17 +0100)]
Disable Quick's GVN-based dead code elimination.

Quick's GVN/DCE seems to trouble the builds.

Bug: 20572509
Change-Id: I1e315b4eee4443f04c7cb2cef953d8e4eff619ce

9 years agoMerge "Mark the test as failing while investigating."
Nicolas Geoffray [Sat, 25 Apr 2015 13:41:55 +0000 (13:41 +0000)]
Merge "Mark the test as failing while investigating."

9 years agoMark the test as failing while investigating.
Nicolas Geoffray [Sat, 25 Apr 2015 13:39:59 +0000 (14:39 +0100)]
Mark the test as failing while investigating.

Recent linker changes required to increase the scope
of our chroot-like environment on devices. There is however just this
test failing.

Change-Id: I496be04693b6cebefe68a0ac04947ed238b53e0d

9 years agoART: Refactor utils/assembler test
Andreas Gampe [Sat, 25 Apr 2015 04:41:45 +0000 (21:41 -0700)]
ART: Refactor utils/assembler test

Split out the part that compares a buffer with the product of a
host assembler. That will allow to reuse this for the Quick
assemblers.

Change-Id: Ie15777cb0a22f7532d8a8ea35403db0f229cd26f

9 years agoMerge "ART: Fix DBG_START_LOCAL verification."
Andreas Gampe [Sat, 25 Apr 2015 03:51:07 +0000 (03:51 +0000)]
Merge "ART: Fix DBG_START_LOCAL verification."

9 years agoART: Fix DBG_START_LOCAL verification.
Logan Chien [Sun, 19 Apr 2015 15:27:52 +0000 (23:27 +0800)]
ART: Fix DBG_START_LOCAL verification.

The third ULEB128 of DBG_START_LOCAL and DBG_START_LOCAL_EXTENDED
entries should be interpreted as type_idx instead.

see also. dalvik/dx/src/com/android/dx/dex/file/DebugInfoEncoder.java

Change-Id: Ic0d52ed20cc2614acb9fa54b61095d1bd64f73fe

9 years agoMerge "[optimizing] Rename HasArrayAccesses and check it"
Andreas Gampe [Sat, 25 Apr 2015 03:38:14 +0000 (03:38 +0000)]
Merge "[optimizing] Rename HasArrayAccesses and check it"

9 years agoMerge "[optimizing] Handle x86 const length BoundsCheck"
Andreas Gampe [Sat, 25 Apr 2015 03:25:43 +0000 (03:25 +0000)]
Merge "[optimizing] Handle x86 const length BoundsCheck"

9 years agoMerge "ART: Duplicate-classes cleanup"
Andreas Gampe [Sat, 25 Apr 2015 03:23:30 +0000 (03:23 +0000)]
Merge "ART: Duplicate-classes cleanup"

9 years agoART: Duplicate-classes cleanup
Andreas Gampe [Sat, 25 Apr 2015 03:22:06 +0000 (20:22 -0700)]
ART: Duplicate-classes cleanup

Disable old test. Improve collision warning message. Add a comment
about the algorithm.

Change-Id: Ibd29d79565732162150aebd7fe08d0895ccf3d79

9 years agoMerge "ART: Check for duplicate classes when loading oat files"
Andreas Gampe [Sat, 25 Apr 2015 01:35:00 +0000 (01:35 +0000)]
Merge "ART: Check for duplicate classes when loading oat files"

9 years agoMerge "ART: Add GENERATE_CFI to the ZygoteHooks debug flags"
Andreas Gampe [Sat, 25 Apr 2015 00:48:45 +0000 (00:48 +0000)]
Merge "ART: Add GENERATE_CFI to the ZygoteHooks debug flags"

9 years ago[optimizing] Handle x86 const length BoundsCheck
Mark Mendell [Wed, 22 Apr 2015 20:18:52 +0000 (16:18 -0400)]
[optimizing] Handle x86 const length BoundsCheck

Allow a constant length for BoundsCheck.

Change-Id: I2c7adc6e733cf8ce6997aba76aa763d0835bd2d6
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
9 years agoART: Add GENERATE_CFI to the ZygoteHooks debug flags
Andreas Gampe [Fri, 24 Apr 2015 23:33:43 +0000 (16:33 -0700)]
ART: Add GENERATE_CFI to the ZygoteHooks debug flags

Add code to understand the implications of the debug.gencfi system
property that forces generation of CFI data.

Change-Id: Ida66f8c1567634d05cfdbba1a982be3684e94369

9 years agoMerge "ART: Do not log non-swap usage"
Andreas Gampe [Fri, 24 Apr 2015 23:30:18 +0000 (23:30 +0000)]
Merge "ART: Do not log non-swap usage"

9 years ago[optimizing] Rename HasArrayAccesses and check it
Mark Mendell [Fri, 24 Apr 2015 21:06:35 +0000 (17:06 -0400)]
[optimizing] Rename HasArrayAccesses and check it

Since the flag is only used to see if there is a HBoundsCheck, rename
HasArrayAccesses() to HasBoundsChecks().

Add a check in graph_checker to see that the flag is set if we see a
HBoundsCheck instruction.

Change-Id: I10fe92897374fb247082152dd75c3611cc40ff30
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
9 years agoART: Do not log non-swap usage
Andreas Gampe [Fri, 24 Apr 2015 23:22:18 +0000 (16:22 -0700)]
ART: Do not log non-swap usage

Reduce logcat noise.

Bug: 20501758
Change-Id: I5cbc28614d4be9e7fd120b7ccb97ca489e341f54

9 years agoMerge "Guard against name == null in ShortDump"
Mathieu Chartier [Fri, 24 Apr 2015 23:02:39 +0000 (23:02 +0000)]
Merge "Guard against name == null in ShortDump"

9 years agoMerge "Fix DCHECKs about clinit checks in Optimizing's code generators."
Roland Levillain [Fri, 24 Apr 2015 22:35:49 +0000 (22:35 +0000)]
Merge "Fix DCHECKs about clinit checks in Optimizing's code generators."

9 years agoFix DCHECKs about clinit checks in Optimizing's code generators.
Roland Levillain [Fri, 24 Apr 2015 22:01:24 +0000 (23:01 +0100)]
Fix DCHECKs about clinit checks in Optimizing's code generators.

These assertions are not true for the baseline compiler.  As
a temporary workaround, remove a clinit check as last input
of a static invoke if it is still present at the stage of
code generation.

Change-Id: I5655f4a0873e2e7ee7790b6a341c18b4b7b52af1

9 years agoGuard against name == null in ShortDump
Mathieu Chartier [Fri, 24 Apr 2015 22:28:36 +0000 (15:28 -0700)]
Guard against name == null in ShortDump

Bug: 20561804
Change-Id: If1e4adb74d5b936cf171f2402bf4525bf8c2d209

9 years agoMerge "[optimizing] Ensure FillNewArray sets array access"
Andreas Gampe [Fri, 24 Apr 2015 20:18:20 +0000 (20:18 +0000)]
Merge "[optimizing] Ensure FillNewArray sets array access"

9 years ago[optimizing] Ensure FillNewArray sets array access
Mark Mendell [Fri, 24 Apr 2015 18:39:42 +0000 (14:39 -0400)]
[optimizing] Ensure FillNewArray sets array access

A method that only used filled new like 'int[]{0,0}' didn't have the
array access flag set, so BCE didn't remove the checks.

Change-Id: Iedec50daf0d25b1cc3872eb1a4cfc7b8bb31e6bf
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
9 years agoMerge "Reduce the number of explicit clinit checks for static invokes."
Roland Levillain [Fri, 24 Apr 2015 18:20:53 +0000 (18:20 +0000)]
Merge "Reduce the number of explicit clinit checks for static invokes."

9 years agoReduce the number of explicit clinit checks for static invokes.
Roland Levillain [Fri, 24 Apr 2015 18:14:22 +0000 (19:14 +0100)]
Reduce the number of explicit clinit checks for static invokes.

Do not generate explicit clinit checks for static invokes
when the class of the called method is a super class of the
caller method's class (referrer class).

Change-Id: I86ba18facef261fbb71f7ed20867756630ed3c53

9 years agoMerge "Ensure inlined static calls perform clinit checks in Optimizing."
Roland Levillain [Fri, 24 Apr 2015 18:17:40 +0000 (18:17 +0000)]
Merge "Ensure inlined static calls perform clinit checks in Optimizing."

9 years agoART: Check for duplicate classes when loading oat files
Andreas Gampe [Fri, 24 Apr 2015 05:23:47 +0000 (22:23 -0700)]
ART: Check for duplicate classes when loading oat files

Oat files are usually produced standalone, and the compilers take
advantage of any information they get. It is thus possible that
when compile-time and runtime class-path are not the same, classes
are resolved differently and optimized code is incorrect.

This is a very conservative check, scanning the complete class tables
of dex files. In case any duplicate class is found, the new oat file
will be rejected and the original dex files will be used in interpreted
mode.

A possible refinement to this is actual tracking of the compile-time
class-path instead. That is however significantly complicated by the
DexFile API and the non-standard uses it allows.

An alternative for both optimized code and correct resolution is
native multidex. Apps should switch to multidex and benefit from
the optimization as well as the shift of all compile time to install
time. Split APKs are currently compiled separately, but it is a goal
to change that install flow to simulated multidex.

Change-Id: Ib9e0db5091e060e3bb2c0e5e6c007430becbfc21

9 years agoMerge "Quick: Fix and enable DCE and improve GVN/DCE cleanup."
Vladimir Marko [Fri, 24 Apr 2015 18:11:10 +0000 (18:11 +0000)]
Merge "Quick: Fix and enable DCE and improve GVN/DCE cleanup."

9 years agoMerge "Remove ArtMethod* parameter from dex cache entry points."
Vladimir Marko [Fri, 24 Apr 2015 16:21:36 +0000 (16:21 +0000)]
Merge "Remove ArtMethod* parameter from dex cache entry points."

9 years agoMerge "ART: Fix gtests broken by dead block elimination"
David Brazdil [Fri, 24 Apr 2015 16:09:15 +0000 (16:09 +0000)]
Merge "ART: Fix gtests broken by dead block elimination"

9 years agoART: Fix gtests broken by dead block elimination
David Brazdil [Fri, 24 Apr 2015 16:04:38 +0000 (17:04 +0100)]
ART: Fix gtests broken by dead block elimination

Change-Id: If5de97f928f9e214d64871eabfbfb3f2d15451b7

9 years agoMerge "Minor improvements to 458-checker-instruction-simplification."
Roland Levillain [Fri, 24 Apr 2015 15:53:25 +0000 (15:53 +0000)]
Merge "Minor improvements to 458-checker-instruction-simplification."

9 years agoEnsure inlined static calls perform clinit checks in Optimizing.
Roland Levillain [Fri, 24 Apr 2015 15:43:49 +0000 (16:43 +0100)]
Ensure inlined static calls perform clinit checks in Optimizing.

Calls to static methods have implicit class initialization
(clinit) checks of the method's declaring class in
Optimizing.  However, when such a static call is inlined,
the implicit clinit check vanishes, possibly leading to an
incorrect behavior.

To ensure that inlining static methods does not change the
behavior of a program, add explicit class initialization
checks (art::HClinitCheck) as well as load class
instructions (art::HLoadClass) as last input of static
calls (art::HInvokeStaticOrDirect) in Optimizing' control
flow graphs, when the declaring class is reachable and not
known to be already initialized.  Then when considering the
inlining of a static method call, proceed only if the method
has no implicit clinit check requirement.

The added explicit clinit checks are already removed by the
art::PrepareForRegisterAllocation visitor.  This CL also
extends this visitor to turn explicit clinit checks from
static invokes into implicit ones after the inlining step,
by removing the added art::HLoadClass nodes mentioned
hereinbefore.

Change-Id: I9ba452b8bd09ae1fdd9a3797ef556e3e7e19c651

9 years agoMerge "ART: Dead block removal"
David Brazdil [Fri, 24 Apr 2015 15:20:27 +0000 (15:20 +0000)]
Merge "ART: Dead block removal"

9 years agoART: Dead block removal
David Brazdil [Mon, 20 Apr 2015 13:52:42 +0000 (14:52 +0100)]
ART: Dead block removal

Adds a new pass which finds all unreachable blocks, typically due to
simplifying an if-condition to a constant, and removes them from the
graph. The patch also slightly generalizes the graph-transforming
operations.

Change-Id: Iff7c97f1d10b52886f3cd7401689ebe1bfdbf456

9 years agoMerge "Debugger: Remove support for setting values in optimizing."
Nicolas Geoffray [Fri, 24 Apr 2015 14:18:19 +0000 (14:18 +0000)]
Merge "Debugger: Remove support for setting values in optimizing."

9 years agoDebugger: Remove support for setting values in optimizing.
Nicolas Geoffray [Fri, 24 Apr 2015 13:58:19 +0000 (14:58 +0100)]
Debugger: Remove support for setting values in optimizing.

bug:19944235
Change-Id: I3bcd56c7844847a7f0367f8ce6a72bddcd09d441

9 years agoMerge "Don't use 'sh' on the host."
Nicolas Geoffray [Fri, 24 Apr 2015 13:38:19 +0000 (13:38 +0000)]
Merge "Don't use 'sh' on the host."

9 years agoDon't use 'sh' on the host.
Nicolas Geoffray [Fri, 24 Apr 2015 13:37:29 +0000 (14:37 +0100)]
Don't use 'sh' on the host.

Change-Id: I319c08367d143443425bc01f4dda28ad46417c7e

9 years agoMerge "Use 'sh' explicitly when invoking the art script."
Nicolas Geoffray [Fri, 24 Apr 2015 12:45:28 +0000 (12:45 +0000)]
Merge "Use 'sh' explicitly when invoking the art script."

9 years agoUse 'sh' explicitly when invoking the art script.
Nicolas Geoffray [Fri, 24 Apr 2015 12:44:19 +0000 (13:44 +0100)]
Use 'sh' explicitly when invoking the art script.

Change-Id: I5e11483dd75f9ab4dd67f3bbbc45485726d01e34

9 years agoMerge "Make tests assume ANDROID_ROOT is not /system."
Nicolas Geoffray [Fri, 24 Apr 2015 12:43:34 +0000 (12:43 +0000)]
Merge "Make tests assume ANDROID_ROOT is not /system."

9 years agoMake tests assume ANDROID_ROOT is not /system.
Nicolas Geoffray [Fri, 24 Apr 2015 10:57:37 +0000 (11:57 +0100)]
Make tests assume ANDROID_ROOT is not /system.

This is to enable better chroot-like testing.

Change-Id: I943c68b0ebcdab2f107f808b466ac694085255aa

9 years agoRemove ArtMethod* parameter from dex cache entry points.
Vladimir Marko [Mon, 20 Apr 2015 19:11:30 +0000 (20:11 +0100)]
Remove ArtMethod* parameter from dex cache entry points.

Load the ArtMethod* using an optimized stack walk instead.
This reduces the size of the generated code.

Three of the entry points are called only from a slow-path
and the fourth (InitializeTypeAndVerifyAccess) is rare and
already slow enough that the one or two extra loads
(depending on whether we already have the ArtMethod* in a
register) are insignificant. And as we're starting to use
PC-relative addressing of the dex cache arrays (already
done by Quick for the boot image), having the ArtMethod* in
a register becomes less likely anyway.

Change-Id: Ib19b9d204e355e13bf386662a8b158178bf8ad28

9 years agoMerge "Cleanup and improve stack map stream"
Nicolas Geoffray [Fri, 24 Apr 2015 07:52:34 +0000 (07:52 +0000)]
Merge "Cleanup and improve stack map stream"

9 years agoUse the lock word bits for Baker-style read barrier.
Hiroshi Yamauchi [Thu, 23 Apr 2015 23:12:40 +0000 (16:12 -0700)]
Use the lock word bits for Baker-style read barrier.

This enables the standard object header to be used with the
Baker-style read barrier.

Bug: 19355854
Bug: 12687968

Change-Id: Ie552b6e1dfe30e96cb1d0895bd0dff25f9d7d015

9 years agoMerge "Fix reflection handling and test flakiness"
Mathieu Chartier [Fri, 24 Apr 2015 00:22:41 +0000 (00:22 +0000)]
Merge "Fix reflection handling and test flakiness"

9 years agoFix reflection handling and test flakiness
Mathieu Chartier [Thu, 23 Apr 2015 23:32:54 +0000 (16:32 -0700)]
Fix reflection handling and test flakiness

Fixed reflection invoke to handle exceptions which occur from
FindClass or NewObject by throwing these instead of
the expected InvocationTargetException.

Added test case to 080 for this reflection invoke.

Fixed println throwing OOM in 104-growth-limit.

Change-Id: I65766e7c3478e299da06fdc3a521fe3f3e8fdba9

9 years agoCleanup and improve stack map stream
Calin Juravle [Thu, 23 Apr 2015 17:47:21 +0000 (18:47 +0100)]
Cleanup and improve stack map stream

- transform AddStackMapEntry into BeginStackMapEntry/EndStackMapEntry.
This allows for nicer code and less assumptions when searching for equal
dex register maps.
- store the components sizes and their start positions as fields to
avoid re-computation.
- store the current stack map entry as a field to avoid the copy
semantic when updating its value in the stack maps array.
- remove redundant methods and fix visibility for the remaining ones.

Change-Id: Ica2d2969d7e15993bdbf8bc41d9df083cddafd24

9 years agoMerge "Quick: Fix out of temp regs in ArmMir2Lir::GenMulLong()."
Vladimir Marko [Thu, 23 Apr 2015 18:11:04 +0000 (18:11 +0000)]
Merge "Quick: Fix out of temp regs in ArmMir2Lir::GenMulLong()."

9 years agoQuick: Fix and enable DCE and improve GVN/DCE cleanup.
Vladimir Marko [Mon, 20 Apr 2015 09:48:13 +0000 (10:48 +0100)]
Quick: Fix and enable DCE and improve GVN/DCE cleanup.

When eliminating a move by renaming its source register,
check that it doesn't conflict with vreg usage by insns
between the defining insn and the move.

Improve the GVN/DCE cleanup so that it can handle cases
where GVN or DCE is individually disabled in the pass driver
but not in the disable_opt flags.

Bug: 19419671
Change-Id: I49bb67b81509f51fbaf90c6016c509962be43736

9 years agoMerge "Linear scan: split at better positions."
Nicolas Geoffray [Thu, 23 Apr 2015 17:28:35 +0000 (17:28 +0000)]
Merge "Linear scan: split at better  positions."

9 years agoLinear scan: split at better positions.
Nicolas Geoffray [Thu, 23 Apr 2015 14:14:36 +0000 (15:14 +0100)]
Linear scan: split at better  positions.

- Split at block entry to piggy back on control flow resolution.
- Split at the loop header, if the split position is within a loop.

Change-Id: I718299a58c02ee02a1b22bda589607c69a35f0e8

9 years agoMerge "Remove unnecessary null checks in CheckCast and InstanceOf"
Calin Juravle [Thu, 23 Apr 2015 17:19:34 +0000 (17:19 +0000)]
Merge "Remove unnecessary null checks in CheckCast and InstanceOf"

9 years agoMerge "ART: Run BooleanSimplifier after inlining"
David Brazdil [Thu, 23 Apr 2015 16:55:10 +0000 (16:55 +0000)]
Merge "ART: Run BooleanSimplifier after inlining"

9 years agoRemove unnecessary null checks in CheckCast and InstanceOf
Guillaume "Vermeille" Sanchez [Mon, 20 Apr 2015 13:41:30 +0000 (14:41 +0100)]
Remove unnecessary null checks in CheckCast and InstanceOf

Change-Id: I6fd81cabd8673be360f369e6318df0de8b18b634

9 years agoART: Run BooleanSimplifier after inlining
David Brazdil [Tue, 21 Apr 2015 14:13:31 +0000 (15:13 +0100)]
ART: Run BooleanSimplifier after inlining

Inlined methods are currently not simplified.

Change-Id: I075130c9df55e2f55032a2c81b08d42cb2cc01f6

9 years agoQuick: Fix out of temp regs in ArmMir2Lir::GenMulLong().
Vladimir Marko [Thu, 23 Apr 2015 16:00:40 +0000 (17:00 +0100)]
Quick: Fix out of temp regs in ArmMir2Lir::GenMulLong().

This fixes running out of temp registers for mul-long that
needs a temporary to store the result, i.e. when it's stored
to stack location [sp, #offset] with offset >= 1024. The bug
is currently not reproducible because ARM_R4_SUSPEND_FLAG is
off and thus we have the extra register available. However,
the code generation could be cleaned up and make use of that
extra register, so pre-emptively fix it anyway.

Bug: 20110806
Change-Id: I8362c349961dbe28fc3ec8a9299b66fd72f26779