OSDN Git Service
Mathieu Chartier [Fri, 19 Jun 2015 20:55:27 +0000 (13:55 -0700)]
Fix GC map generation edge case
Previously we checked the number of bits, but then rounded up to a
byte boundary. If ref_bitmap_bits was 65535, it would pass the check
but not actually fit in the 13 bits for ref_bitmap_bytes since we
rounded up to 8192 bytes.
Regression test infeasible due to smali limitations.
Bug:
21888453
Change-Id: If4b769431f27ecca14fe7852d017bcde01b3e146
Vladimir Marko [Fri, 19 Jun 2015 13:56:38 +0000 (14:56 +0100)]
Quick: Handle total high/low register overlap on arm/mips.
OpRegCopyWide() in arm and mips backends didn't handle the
total register overlap when the registers holding the source
and destination pairs are the same but in reverse order.
Bug:
21897012
(cherry picked from commit
8958f7f8702327e713264d0538ab5dec586f3738)
Change-Id: I20afce6cc3213e7f7b3edaef91f3ec29c469f877
Vladimir Marko [Fri, 19 Jun 2015 11:58:22 +0000 (12:58 +0100)]
Quick: Fix optimizations for empty if blocks.
If a block ending with if-eqz or if-nez has the same "taken"
and "fallthrough", we cannot assume that the value has been
checked against zero in one of the succesors. This affects
the null check elimination pass as well as GVN. Refactor all
those checks to a single function in BasicBlock and check
that the "taken" and "falthrough" are different when needed.
Bug:
21614284
(cherry picked from commit
f11c420c448baffac6a70ac0884d481ab347e257)
Change-Id: I062e0042de3470ce8680b586487b9c7acbd206bc
David Brazdil [Thu, 18 Jun 2015 11:40:01 +0000 (12:40 +0100)]
ART: Remove old DCHECK that trips Baseline
Codegen verified that the entry block always falls through to the next
block. While this is the case with Optimizing, it doesn't hold for
Baseline but it doesn't need to since codegen handles it fine.
Bug:
21913514
Change-Id: I751ef227e6cf103af3e7fc35fca4b01c663385a1
(cherry picked from commit
015c7e63604c038e866d7af3850c557403cddc8b)
Jeff Hao [Fri, 19 Jun 2015 04:19:08 +0000 (04:19 +0000)]
Merge "Fix StringChange for optimizing compiler." into mnc-dev
Jeff Hao [Fri, 19 Jun 2015 04:16:08 +0000 (21:16 -0700)]
Fix StringChange for optimizing compiler.
Uses optimizing compiler more and fixes x86_64 invoke codegen.
Bug:
21902634
Change-Id: Ia2a87d013c4746b107014a04a22a0a37269cfdb2
Mathieu Chartier [Thu, 18 Jun 2015 23:48:52 +0000 (16:48 -0700)]
Fix moving GC bug in DoFilledNewArray
Previously we read from componentClass after allocating the array.
Bug:
21783443
(cherry picked from commit
52ea33b10370d60d4ce877aec529626537b7813b)
Change-Id: I5283982edab479434e27416509e1436b4176fe01
Mathieu Chartier [Thu, 18 Jun 2015 17:17:26 +0000 (10:17 -0700)]
Fix moving GC bugs in proxy stub for X86/X86_64
Needed to restore the refs.
(cherry picked from commit
9346ff0cfad6344d0bf4eaa69362dbe1987ac054)
Bug:
21907554
Change-Id: I562906dff07dcaa78dfb39646ba9ab35a5f56c6c
Sebastien Hertz [Tue, 9 Jun 2015 12:09:14 +0000 (14:09 +0200)]
Follow up on CL 151605
- Fixes return type of StackedShadowFrameRecord::GetType
- Makes StackedShadowFrameType an enum class (scoped enum)
- Moves DeoptimizationReturnValueRecord and StackedShadowFrameRecord
to thread.cc file and use forward declaration in thread.h header
- Fixes tools/generate-operator-out.py for scoped enum classes.
Bug:
20845490
(cherry picked from commit
f795869da0a1fa006fdcdacd8afb6149a63fc1a7)
Change-Id: I6b67e288b1db563699161e58ec2e2330d42dd8f5
Mingyao Yang [Mon, 18 May 2015 19:12:50 +0000 (12:12 -0700)]
Fix nested deoptimization.
Handle nested deoptimization cases. Create a stacked shadow frame
records to keep track of deoptimization shadow frames. Shadow frames
under construction can be tracked in the same stack.
Bug:
20845490
(cherry picked from commit
1f2d3ba6af52cf6f566deb38b7e07735c9a08fb6)
Change-Id: I768285792c29e7c3cfcd21e7a2600802506024d8
Vladimir Marko [Thu, 18 Jun 2015 16:40:00 +0000 (17:40 +0100)]
Quick: Don't expect move-exception in every catch block.
The dalvik bytecode doesn't require a move-exception in
a catch handler that ignores the exception.
Bug:
21873167
(cherry picked from commit
2d1a0a408fd148f7b2a2d670e6942ec3d920f875)
Change-Id: Ia00e5791fabdd1b88e9a63b741600ed63d918703
Mathieu Chartier [Wed, 17 Jun 2015 23:11:12 +0000 (16:11 -0700)]
Fix some java_lang_Class related moving GC bugs
There was some missing handles around mirror::Class*.
(cherry picked from commit
05b7226787f1470ad93f6f632fed60f70bc8631e
Bug:
21898408
Change-Id: Icb754074dfb469473101d20d6873a5bc3274abc5
David Brazdil [Thu, 18 Jun 2015 16:13:16 +0000 (16:13 +0000)]
Merge "ART: Allow PackedSwitch instructions with zero targets" into mnc-dev
David Brazdil [Wed, 17 Jun 2015 17:20:52 +0000 (18:20 +0100)]
ART: Allow PackedSwitch instructions with zero targets
Optimizing and the interpreter wrongly assumed that a PackedSwitch
always has at least one target. This patch removes the corresponding
DCHECKs and adds a regression test case.
This is a resubmission of CL I32b7033ed38de6f1d1a6ee5d5bf12f3a47c9b37e
Bug:
21863783
Change-Id: I04e6e124bdd16591ba27c79490e6ce183c36b691
(cherry picked from commit
2ef645ba50544b879a82ea30e606f18c9af98917)
Vladimir Marko [Wed, 17 Jun 2015 21:00:09 +0000 (22:00 +0100)]
Quick: Fix marking unused registers in DCE.
Bug:
21702651
(cherry picked from commit
511d408909b7fe9be3c95e032cc7f426f4a01e6e)
Change-Id: I059e0b841543334cd08a27431e0ea853b42e4f35
Vladimir Marko [Mon, 15 Jun 2015 17:52:54 +0000 (18:52 +0100)]
ART: Fix reporting initialized classes by CompilerDriver.
Fix a bug where the CompilerDriver was erroneously reporting
classes as initialized during AOT compilation when they were
not guaranteed to be initialized at runtime.
This fix prevents the Quick compiler from inlining calls to
static methods in classes that are not guaranteed to be
initialized, so that the runtime performs the initialization
required for correctness.
Bug:
21847756
(cherry picked from commit
07785bb98dc8bbe192970e0f4c2cafd338a8dc68)
Change-Id: I60c7361cb6e8f51be20a3cbfcae19f3240bdfbed
Nicolas Geoffray [Thu, 18 Jun 2015 09:05:21 +0000 (09:05 +0000)]
Merge "Add support for inlining already sharpened interface calls. DO NOT MERGE ANYWHERE" into mnc-dev
Nicolas Geoffray [Tue, 9 Jun 2015 14:43:38 +0000 (15:43 +0100)]
Add support for inlining already sharpened interface calls. DO NOT MERGE ANYWHERE
bug:
21867144
Test had to change a bit because it was using some features from
aosp not present in mnc-dev.
(cherry picked from commit
3507105caea0d209c66a95d5ec5d739949105c5d)
Change-Id: If12ea9a5c64e86b5bd3a5fd4a943bff60fe49762
Nicolas Geoffray [Mon, 15 Jun 2015 08:01:08 +0000 (09:01 +0100)]
Fix reference comparison after redundant phi elimination.
Otherwise, the graph could remain mistyped.
bug:
21776173
(cherry picked from commit
51d400d4ebd41b9fb4d67ac3179f8fb66a090fdd)
Change-Id: Iff36dfa4e79b14a9dd85c37e0fbb9e1080dd0364
Mathieu Chartier [Wed, 17 Jun 2015 21:14:36 +0000 (14:14 -0700)]
Add missing EndAssertNoThreadSuspension
Bug:
21872507
Change-Id: I20f9920e4a12511ce498c252bca955d82a4f4102
Oleksiy Vyalov [Sun, 14 Jun 2015 22:17:26 +0000 (15:17 -0700)]
Set default visibility on art_sigsegv_fault.
libart.so is built with flag -fvisibility=protected
which complicates setting breakpoints on art_sigsegv_fault.
According to the GCC manual "Protected visibility indicates
that the symbol will be placed in the dynamic symbol table,
but that references within the defining module will bind
to the local symbol.". This implies that a breakpoint on
a protected symbol will not be hit.
Without this change gdbclient with ART debugging enabled
doesn't break at art_sigsegv_fault as expected.
Bonus build fix included (commit
c37769b6) :
Fix lint error.
Blank line at the start of a code block.
(cherry picked from commit
f775bab533cd385c00ee30b56bdcb6f962fc5239)
(cherry picked from commit
c37769b63faf7b120a6ed80f5cfb92667f5090c4)
bug:
21893559
Change-Id: Ie388f027f717a7bd2351a0163a38e50d3acbba8f
Mathieu Chartier [Sat, 13 Jun 2015 00:18:37 +0000 (00:18 +0000)]
Merge "Change mips64 lwu to ld for loading caller ArtMethod*" into mnc-dev
Mathieu Chartier [Fri, 12 Jun 2015 23:05:54 +0000 (16:05 -0700)]
Change mips64 lwu to ld for loading caller ArtMethod*
Bug:
21815962
Change-Id: Id589f4a49349d817d3dc9128109048292fe0ed33
Sebastien Hertz [Thu, 11 Jun 2015 16:42:58 +0000 (18:42 +0200)]
JDWP: update handling of 8-bit and 16-bit fields
We must use special getter/setter for types smaller than int:
boolean, byte, char and short. However, JDWP still requires to treat:
- int and float as 32-bit values
- long and double as 64-bit values
Bug:
21746739
(cherry picked from commit
05c26b30843dd8283c703356e75d51726e8b8e3a)
Change-Id: I2d667291974e191f2c9b10311ce02435b902dd0c
Sebastien Hertz [Mon, 1 Jun 2015 15:33:12 +0000 (17:33 +0200)]
JDWP: asynchronous invoke command handling
The JDWP thread used to wait for the result of a method invocation
running in an event thread. But doing that prevents the JDWP thread
from processing incoming commands from the debugger if the event
thread gets suspended by a debug event occurring in another thread.
In Android Studio (or another IDE), this leads to the debugger being
blocked (with the famous message "Waiting until last debugger command
completes" of Android Studio / IntelliJ) because it is actually
waiting for the reply of its latest command while the JDWP thread
cannot process it.
This CL changes the way invoke commands (ClassType.InvokeCommand,
ClassType.NewInstance and ObjectReference.InvokeCommand) are handled
in the ART runtime.
The JDWP thread no longer waits for the event thread to complete the
method invocation. It now simply waits for the next JDWP command to
process. This means it does not send any reply for invoke commands,
except if the information given by the debugger is wrong. In this
case, it still sends a reply with the appropriate error code.
The event thread is now responsible for sending the reply (containing
the result and the exception object of the invoked method) before
going back to the suspended state.
In other words, we add special handling for invoke commands so they
are handled asynchronously while other commands remained handled
synchronously. In the future, we may want to handle all commands
asynchronously (using a queue of reply/event for instance) to remove
the special handling code this CL is adding.
Now the JDWP thread can process commands while a thread is invoking
a method, it is possible for the debugger to detach (by sending a
VirtualMachine.Dispose command) before the invocation completes. In
that situation, we must not suspend threads again (including the
event thread that executed the method) because they would all remain
suspended forever.
Also minor cleanup of the use of JDWP constants and update comments.
Bug:
21515842
Bug:
18899981
(cherry picked from commit
cbc5064ff05179b97b416f00ca579c55e38cd7d9)
Change-Id: I8d31006043468913ee8453212e6d16e11fcfe4ea
Tim Murray [Fri, 12 Jun 2015 00:21:24 +0000 (00:21 +0000)]
Merge "Add cortex-a53 as a valid instruction set variant for arm64." into mnc-dev
Tim Murray [Fri, 12 Jun 2015 00:09:18 +0000 (17:09 -0700)]
Add cortex-a53 as a valid instruction set variant for arm64.
Change-Id: I720e2cc4acd94e367dae4a21c13aa90a3e30b7cc
Mathieu Chartier [Thu, 11 Jun 2015 23:21:42 +0000 (16:21 -0700)]
Fix compaction bug in Class_getDeclaredMethodsUnchecked
Added handle to fix the bug.
Bug:
21638351
Change-Id: I1c3abea33aa825d3a28c1fc5cb415508686ad93e
Dmitriy Ivanov [Thu, 11 Jun 2015 21:54:53 +0000 (21:54 +0000)]
Merge "Let classloader provide correct LD_LIBRARY_PATH" into mnc-dev
Mathieu Chartier [Thu, 11 Jun 2015 21:45:53 +0000 (21:45 +0000)]
Merge "Move image intern table into image" into mnc-dev
Mathieu Chartier [Wed, 10 Jun 2015 00:50:29 +0000 (17:50 -0700)]
Move image intern table into image
Previously we recreated this intern table during runtime startup.
This added 50-100ms of boot time.
Fixed bug where we didn't copy over hashcodes into the image.
Deleted some stale code.
Bug:
20727525
Bug:
19569780
Change-Id: I08959e9aa2a73cedb52f393033e2ffea3a26e76b
Hiroshi Yamauchi [Thu, 11 Jun 2015 00:46:10 +0000 (00:46 +0000)]
Merge "Reset GC performance stats at zygote fork." into mnc-dev
Lazar Trsic [Wed, 10 Jun 2015 14:05:46 +0000 (16:05 +0200)]
[MIPS] Fix method tracing for mips64
Reg $v0 is being clobbered on using
SETUP_REFS_ONLY_CALLEE_SAVE_FRAME inside instrumentation_exit()
trampoline, when falling through from instrumentation_entry().
To fix, use $t1 for ArtMethod* fetching inside SETUP_ macros.
Also fix some unrelated comment errors.
Bug:
21555893
(cherry picked from commit
84bc06e30ba12c3ff07e577c52b63b9df162af7e)
Change-Id: I4ab169f75988c4f0d924416a30196f21c1a043a3
Hiroshi Yamauchi [Thu, 11 Jun 2015 00:20:54 +0000 (17:20 -0700)]
Reset GC performance stats at zygote fork.
So GCs before a zygote fork won't be attributed to an app.
Bug:
21491908
Change-Id: Ib37bc587e0f039ef8faeabe63dec19de49501863
Dmitriy Ivanov [Fri, 5 Jun 2015 20:01:52 +0000 (13:01 -0700)]
Let classloader provide correct LD_LIBRARY_PATH
Rely on BaseDexClassLoader to provide correct LD_LIBRARY_PATH
Bug: http://b/
21647354
Bug: http://b/
21667767
Bug: http://b/
8076853
Change-Id: I8c690a2578d5de43be9da964fa5a4c0246aa6eec
Vladimir Marko [Mon, 8 Jun 2015 15:39:02 +0000 (16:39 +0100)]
Quick: Fix LoopRepeatingTopologicalSortIterator.
Always push the loop head on the loop head stack. This fixes
a bug where we failed to return to an unnatural loop head to
recalculate its GVN data.
Bug:
17410955
(cherry picked from commit
67c8c942e9dfcabd548351db75e6d3b8b5165afa)
Change-Id: I44b9a17cbcd7307d1cc70ac564b99e29803723c5
Mathieu Chartier [Mon, 8 Jun 2015 18:33:25 +0000 (18:33 +0000)]
Merge "More LOW_4G optimizations" into mnc-dev
Andreas Gampe [Sun, 7 Jun 2015 21:35:46 +0000 (21:35 +0000)]
Merge "Revert "Revert "Turn off duplicate-classes checking""" into mnc-dev
Andreas Gampe [Sat, 6 Jun 2015 03:53:37 +0000 (03:53 +0000)]
Merge "ART: Add SetSpecialSignalHandlerFn to version-script.txt" into mnc-dev
Andreas Gampe [Sat, 6 Jun 2015 03:45:31 +0000 (20:45 -0700)]
ART: Add SetSpecialSignalHandlerFn to version-script.txt
Expose the new function from the sigchainlib implementation.
Bug:
20217701
(cherry picked from commit
e089920eb0abc10eca708dbf5993134aa7e8d9b0)
Change-Id: I7d21025595775e057ea703236ca88ceb07173136
Vladimir Marko [Sat, 6 Jun 2015 00:06:18 +0000 (00:06 +0000)]
am
b8154d5c: resolved conflicts for merge of
e8a4b652 to lmp-mr1-ub-dev
* commit '
b8154d5cc707921fadf92fedc65a66a3e8901126':
Revert "Quick: Create GC map based on compiler data. DO NOT MERGE"
Vladimir Marko [Sat, 6 Jun 2015 00:06:16 +0000 (00:06 +0000)]
am
5d3acebd: resolved conflicts for merge of
c8d000a1 to lmp-mr1-ub-dev
* commit '
5d3acebd1fe859cbf6fb3831815eb7f3c1f3e442':
Revert "Quick: Fix "select" pattern to update data used for GC maps. DO NOT MERGE"
Vladimir Marko [Sat, 6 Jun 2015 00:06:13 +0000 (00:06 +0000)]
am
e279c0c4: resolved conflicts for merge of
fad2cbf9 to lmp-mr1-ub-dev
* commit '
e279c0c4e9ecc464ab10c9d9cd3404c3b0ed6845':
Quick: Fix "select" pattern to update data used for GC maps. DO NOT MERGE
Vladimir Marko [Sat, 6 Jun 2015 00:06:12 +0000 (00:06 +0000)]
am
fb695b34: resolved conflicts for merge of
7cc8f9aa to lmp-mr1-ub-dev
* commit '
fb695b34268bb7f9270f07ecaac554e49b5b6a92':
Quick: Create GC map based on compiler data. DO NOT MERGE
Mathieu Chartier [Fri, 5 Jun 2015 20:21:05 +0000 (13:21 -0700)]
Use runFinalizationWithTimeout for native allocations
Prevents deadlocks by not waiting longer than 250ms for finalizers
to complete.
Bug:
21544853
Change-Id: I57b2f7ae8b74185922eb3c15ba0ab71a4d2348aa
Mathieu Chartier [Thu, 4 Jun 2015 23:22:41 +0000 (16:22 -0700)]
More LOW_4G optimizations
Eagerly try to map at an address when it doesn't overlap with
the ART known maps.
Reduces time spent creating the heap on N9 from ~100ms to ~10ms.
Bug:
20727525
Change-Id: Ie8982ca9d1f3158104b2b53b992c3a28841fc443
Richard Uhler [Tue, 7 Apr 2015 17:56:50 +0000 (10:56 -0700)]
Add atrace calls to runtime start and heap create
Bug:
20727525
Change-Id: I91a74b793fb9eda8ed580244a6a5fd313ef2eb27
Mathieu Chartier [Thu, 4 Jun 2015 20:42:14 +0000 (13:42 -0700)]
Add optimization for LOW_4G allocator
The optimization uses the maps_ field to skip over regions which we
know wont be large enough for the request.
Reduces time to create heap from 500-700ms to 100ms on N9.
Bug:
20727525
Change-Id: I4fa92d58c2e135ba31a03ababff46669089bb542
Vladimir Marko [Thu, 4 Jun 2015 10:14:23 +0000 (11:14 +0100)]
resolved conflicts for merge of
e8a4b652 to lmp-mr1-ub-dev
Vladimir Marko [Thu, 4 Jun 2015 10:04:05 +0000 (11:04 +0100)]
resolved conflicts for merge of
c8d000a1 to lmp-mr1-ub-dev
Vladimir Marko [Thu, 4 Jun 2015 09:59:53 +0000 (10:59 +0100)]
resolved conflicts for merge of
fad2cbf9 to lmp-mr1-ub-dev
Vladimir Marko [Thu, 4 Jun 2015 09:53:59 +0000 (10:53 +0100)]
resolved conflicts for merge of
7cc8f9aa to lmp-mr1-ub-dev
Change-Id: I6203b6d8be029440f635b9575559ba6add9a46d6
Vladimir Marko [Thu, 4 Jun 2015 09:48:26 +0000 (09:48 +0000)]
Merge "Revert "Quick: Create GC map based on compiler data. DO NOT MERGE"" into cw-d-mr1-dev
Vladimir Marko [Thu, 4 Jun 2015 09:47:47 +0000 (09:47 +0000)]
Revert "Quick: Create GC map based on compiler data. DO NOT MERGE"
This reverts commit
7cc8f9aa1349fd6cb0814a653ee2d1164a7fb9f7.
Change-Id: Iadb4462bf8e834c6a847c01ee6eb332a325de22c
Vladimir Marko [Thu, 4 Jun 2015 09:47:21 +0000 (09:47 +0000)]
Revert "Quick: Fix "select" pattern to update data used for GC maps. DO NOT MERGE"
This reverts commit
fad2cbf97c71b9742ccd88cc1a5ba13fa918e677.
Change-Id: I175dd9e49014b71a300d987678032bd624a99cf1
Mathieu Chartier [Thu, 4 Jun 2015 00:32:42 +0000 (17:32 -0700)]
Fix valgrind large_object_space_test
Also some cleanup.
Change-Id: I9c1a8093e6356f1b52e332009429b77fa5c1d448
Andreas Gampe [Wed, 3 Jun 2015 22:43:16 +0000 (15:43 -0700)]
Revert "Revert "Turn off duplicate-classes checking""
This reverts commit
18a1827a159f1b235f3fcc934f428059185f550e.
Bug:
21333911
Change-Id: I8cb96efbf7151b238f3ee137a938b20ddfaf0ebc
Mathieu Chartier [Wed, 3 Jun 2015 20:32:15 +0000 (13:32 -0700)]
Add a way to determine if a large object is a zygote object
Also fix a slight memory leak in LargeObjectMapSpace.
Bug:
20674158
Change-Id: I2416df484e5b84a8c5cc0b5664c8cb102dc235f6
Andreas Gampe [Wed, 3 Jun 2015 20:27:44 +0000 (20:27 +0000)]
Merge "ART: Refactor Thread::Init" into mnc-dev
Andreas Gampe [Tue, 2 Jun 2015 05:29:51 +0000 (22:29 -0700)]
ART: Refactor Thread::Init
This refactor allows the parent thread to allocate the JNIEnvExt
for the child (with a fallback in place in Init). This allows to
throw an OOME in CreateNativeThread instead of aborting in the
child.
Bug:
21291279
Change-Id: Iccc1a5c202999f5bfacec706d9833e53135ba2fa
Vladimir Marko [Wed, 25 Mar 2015 11:13:39 +0000 (11:13 +0000)]
Quick: Fix "select" pattern to update data used for GC maps. DO NOT MERGE
Follow-up to
https://android-review.googlesource.com/143222
(cherry picked from commit
6e07183e822a32856da9eb60006989496e06a9cc)
Change-Id: I916743c845d9568063cd6a4b2ef71e9cbc43dee8
Vladimir Marko [Fri, 20 Mar 2015 12:47:30 +0000 (12:47 +0000)]
Quick: Create GC map based on compiler data. DO NOT MERGE
The Quick compiler and verifier sometimes disagree on dalvik
register types (fp/core/ref) for 0/null constants and merged
registers involving 0/null constants. Since the verifier is
more lenient it can mark a register as a reference for GC
where Quick considers it a floating point register or a dead
register (which would have a ref/fp conflict if not dead).
If the compiler used an fp register to hold the zero value,
the core register or stack location used by GC based on the
verifier data can hold an invalid value.
Previously, as a workaround we stored the fp zero value also
in the stack location or core register where GC would look
for it. This wasn't precise and may have missed some cases.
To fix this properly, we now generate GC maps based on the
compiler's notion of references if register promotion is
enabled.
Bug: https://code.google.com/p/android/issues/detail?id=147187
(cherry picked from commit
767c752fddc64e280dba507457e4f06002b5f678)
Change-Id: Id75428fd0a2f6bdd2ccb20ce75cdeab01150e455
Mathieu Chartier [Wed, 3 Jun 2015 18:08:22 +0000 (18:08 +0000)]
Merge "Emit instance fields for java.lang.Object in hprof" into mnc-dev
Mathieu Chartier [Wed, 3 Jun 2015 17:51:13 +0000 (10:51 -0700)]
Emit instance fields for java.lang.Object in hprof
Previously we omitted these fields.
Bug:
20726205
Change-Id: I81c55919a4bd015bc0a4e7259a41a05dab534e11
Andreas Gampe [Wed, 3 Jun 2015 04:01:45 +0000 (21:01 -0700)]
ART: Prune FindArrayClass cache in image writer
The ClassLinker cache speeds up FindArrayClass requests, but all
entries are roots. It is possible that an entry is a non-image
class when creating the boot image, artificially keeping the
class around.
Bug:
21596650
Change-Id: Ief9b439945d0e293a3cb5dcddfeb189b5e174f06
Mathieu Chartier [Wed, 3 Jun 2015 00:16:33 +0000 (00:16 +0000)]
Merge "Add a way to SuspendAll for a long duration" into mnc-dev
Mathieu Chartier [Tue, 2 Jun 2015 23:38:29 +0000 (16:38 -0700)]
Fix tracing
Move back to 32 bit method IDs, add a bijective map for method IDs.
Also some cleanup.
Bug:
19264997
Change-Id: Icdd36591df53ff975d30b9000cfe67d3ae8c51d5
Mathieu Chartier [Tue, 2 Jun 2015 20:40:12 +0000 (13:40 -0700)]
Add more info for attempting to delete non-JNI local reference
Now we print the stack trace of the method which tried to remove the
non-JNI local reference.
Added test, example output:
Attempt to remove non-JNI local reference, dumping thread
"main" prio=5 tid=1 Runnable
| group="main" sCount=0 dsCount=0 obj=0x12c2b400 self=0xf878af28
| sysTid=32662 nice=0 cgrp=default sched=0/0 handle=0xf73df700
| state=R schedstat=(
154297228 636505 121 ) utm=5 stm=10 core=11 HZ=100
| stack=0xff6f2000-0xff6f4000 stackSize=7MB
| held mutexes= "mutator lock"(shared held)
native: #00 pc
00455a7f /out/host/linux-x86/lib/libartd.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::ArtMethod*, void*)+191)
native: #01 pc
00425d79 /out/host/linux-x86/lib/libartd.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+473)
native: #02 pc
0028c555 /out/host/linux-x86/lib/libartd.so (art::IndirectReferenceTable::Remove(unsigned int, void*)+421)
native: #03 pc
003319c8 /out/host/linux-x86/lib/libartd.so (art::JNI::DeleteLocalRef(_JNIEnv*, _jobject*)+56)
native: #04 pc
0012db14 /out/host/linux-x86/lib/libartd.so (art::CheckJNI::DeleteRef(char const*, _JNIEnv*, _jobject*, art::IndirectRefKind)+292)
native: #05 pc
00122176 /out/host/linux-x86/lib/libartd.so (art::CheckJNI::DeleteLocalRef(_JNIEnv*, _jobject*)+54)
native: #06 pc
00005724 /out/host/linux-x86/lib/libarttest.so (Java_Main_removeLocalObject+36)
native: #07 pc
00004d6e /tmp/test-32506/dalvik-cache/x86/tmp@mathieuc@test-32506@004-JniTest.jar@classes.dex (void Main.removeLocalObject(java.lang.Object)+130)
at Main.removeLocalObject(Native method)
at Main.testRemoveLocalObject(Main.java:118)
at Main.main(Main.java:37)
Bug:
20683465
Change-Id: I56b99c77ae7020cabf1aaeb1d5317b1d5ba940e5
Mathieu Chartier [Tue, 2 Jun 2015 18:42:18 +0000 (11:42 -0700)]
Add a way to SuspendAll for a long duration
Hprof uses this mode to not cause thread suspend timeouts if GC tries
while the hprof dump is running.
Bug:
21063989
Change-Id: Ic6304620afd1489719a7e0e4299f829c90fe27cc
Mathieu Chartier [Tue, 2 Jun 2015 02:12:36 +0000 (19:12 -0700)]
Add clear cache for JIT
(cherry picked from commit
5783a74163878095475596fabc0b9cb04bec467b)
Bug:
21572270
Change-Id: I711a9ee2d9688a8e4b59380c401f10f42c6c068e
Mathieu Chartier [Tue, 2 Jun 2015 16:56:04 +0000 (09:56 -0700)]
Update IMT for stale miranda methods
Fixes occasional crash in dex2oat.
Bug:
19264997
Change-Id: Icb1a323d8c44fa40309486e17aec56d2c2588e67
Mathieu Chartier [Tue, 2 Jun 2015 16:44:43 +0000 (16:44 +0000)]
Merge "Move mirror::ArtMethod to native" into mnc-dev
Mathieu Chartier [Wed, 22 Apr 2015 20:56:20 +0000 (13:56 -0700)]
Move mirror::ArtMethod to native
Optimizing + quick tests are passing, devices boot.
TODO: Test and fix bugs in mips64.
Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS.
Some of the savings are from removal of virtual methods and direct
methods object arrays.
Bug:
19264997
(cherry picked from commit
e401d146407d61eeb99f8d6176b2ac13c4df1e33)
Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d
Fix some ArtMethod related bugs
Added root visiting for runtime methods, not currently required
since the GcRoots in these methods are null.
Added missing GetInterfaceMethodIfProxy in GetMethodLine, fixes
--trace run-tests 005, 044.
Fixed optimizing compiler bug where we used a normal stack location
instead of double on ARM64, this fixes the debuggable tests.
TODO: Fix JDWP tests.
Bug:
19264997
Change-Id: I7c55f69c61d1b45351fd0dc7185ffe5efad82bd3
ART: Fix casts for 64-bit pointers on 32-bit compiler.
Bug:
19264997
Change-Id: Ief45cdd4bae5a43fc8bfdfa7cf744e2c57529457
Fix JDWP tests after ArtMethod change
Fixes Throwable::GetStackDepth for exception event detection after
internal stack trace representation change.
Adds missing ArtMethod::GetInterfaceMethodIfProxy call in case of
proxy method.
Bug:
19264997
Change-Id: I363e293796848c3ec491c963813f62d868da44d2
Fix accidental IMT and root marking regression
Was always using the conflict trampoline. Also included fix for
regression in GC time caused by extra roots. Most of the regression
was IMT.
Fixed bug in DumpGcPerformanceInfo where we would get SIGABRT due to
detached thread.
EvaluateAndApplyChanges:
From ~2500 -> ~1980
GC time: 8.2s -> 7.2s due to 1s less of MarkConcurrentRoots
Bug:
19264997
Change-Id: I4333e80a8268c2ed1284f87f25b9f113d4f2c7e0
Fix bogus image test assert
Previously we were comparing the size of the non moving space to
size of the image file.
Now we properly compare the size of the image space against the size
of the image file.
Bug:
19264997
Change-Id: I7359f1f73ae3df60c5147245935a24431c04808a
[MIPS64] Fix art_quick_invoke_stub argument offsets.
ArtMethod reference's size got bigger, so we need to move other args
and leave enough space for ArtMethod* and 'this' pointer.
This fixes mips64 boot.
Bug:
19264997
Change-Id: I47198d5f39a4caab30b3b77479d5eedaad5006ab
Nicolas Geoffray [Tue, 2 Jun 2015 10:25:09 +0000 (11:25 +0100)]
Fix another source of undeterministic inlining.
Needing an environment and throwing might depend in which
caller first tries to inline. HLoadClass has such logic. Therefore,
do not cache the non-inlineable flag for those cases.
Does not apply to aosp, as this code has been removed.
bug:
20037935
Change-Id: I5e3d36ffb832fb3c3f3c604c79cdbf4f37c749e1
Nicolas Geoffray [Mon, 1 Jun 2015 17:13:34 +0000 (17:13 +0000)]
Merge "Fix another source of undeterministic inlining." into mnc-dev
Andreas Gampe [Mon, 1 Jun 2015 15:28:37 +0000 (15:28 +0000)]
Merge "ART: Fix wrong hard-failure handling in verifier" into mnc-dev
Andreas Gampe [Mon, 1 Jun 2015 15:23:43 +0000 (15:23 +0000)]
Merge changes I3eee8df3,I78cc01fb into mnc-dev
* changes:
Fix test 115-native-bridge for Mips.
ART: Add support for special handlers in sigchainlib
Andreas Gampe [Mon, 1 Jun 2015 15:23:39 +0000 (15:23 +0000)]
Merge "ART: Use v2 version of NativeBridge struct" into mnc-dev
Nicolas Geoffray [Wed, 27 May 2015 11:53:36 +0000 (12:53 +0100)]
Fix another source of undeterministic inlining.
bug:
20037935
(cherry picked from commit
5ae1325048f3d2143f62735ed41acebf28ee6742)
Change-Id: I4bbec76988cfd3061084055c16d2d9ef46845f0a
Nicolas Geoffray [Mon, 1 Jun 2015 07:58:14 +0000 (07:58 +0000)]
Merge "Make inlining deterministic." into mnc-dev
Douglas Leung [Sat, 30 May 2015 02:50:02 +0000 (19:50 -0700)]
Fix test 115-native-bridge for Mips.
(cherry picked from commit
d0af5479d61013362e43ae15cb69c9f8da915e08)
Change-Id: I3eee8df39e774d233f11c43a5578f407bfdebca1
Andreas Gampe [Sat, 23 May 2015 01:31:50 +0000 (18:31 -0700)]
ART: Add support for special handlers in sigchainlib
Add support for a special managed handler in sigchainlib that
will be called as the first user handler.
Use this support for native bridge v2. Extend test 115-native-bridge
to test the functionality.
Bug:
20217701
(cherry picked from commit
03c2cc89428914adf52229d6a3867eef6127911a)
Change-Id: I78cc01fbdabe169154ff6b94c9f3ddb95b5c7448
Andreas Gampe [Thu, 21 May 2015 01:01:30 +0000 (18:01 -0700)]
ART: Use v2 version of NativeBridge struct
Update the struct to the new version, but without implementation.
Bug:
20217701
(cherry picked from commit
540cc3d49c858e670591d8c00fcd87576cdbede6)
Change-Id: Ic23a60b949f119c7d8b0e7cb27a61e6c16532a23
Jeff Hao [Fri, 29 May 2015 17:53:17 +0000 (10:53 -0700)]
Add unstarted runtime test for String.<init>.
Bug:
21173514
Change-Id: I369806644879fffc01bdc123d81a551e6eedf465
Vladimir Marko [Fri, 8 May 2015 11:26:59 +0000 (12:26 +0100)]
Fix double-exception in super-class method validation.
Bug:
19333589
(cherry picked from commit
d5e5a0e61b5b1fe0aaa7edc25a08adebd5a92353)
Change-Id: If394a678ef6271c1119dac3f959773f23e789c56
Andreas Gampe [Fri, 29 May 2015 00:49:39 +0000 (00:49 +0000)]
Merge "ART: Add Mips o32 callee-save registers to SaveAll frame" into mnc-dev
Andreas Gampe [Thu, 28 May 2015 01:31:42 +0000 (18:31 -0700)]
ART: Add Mips o32 callee-save registers to SaveAll frame
The floating point registers f20-f31 are callee-save in the Mips
ABI. While the managed code does not touch them, they need to be
saved when throwing an exception, so that they will be correctly
restored and not smashed.
Bug:
21266656
(cherry picked from commit
a4e0e67611f54180694e0807d6599c1132269b6c)
Change-Id: Ia96d52ce7fb41bf604da1797ce4d7a703e292415
Jeff Hao [Thu, 28 May 2015 21:32:07 +0000 (14:32 -0700)]
Add JNI String.<init> test for global and weak global refs.
Test for change:
https://googleplex-android-review.git.corp.google.com/#/c/698642/
Change-Id: I3e1182d42f9e24448d8616000de58ebfe1e50fb8
Sebastien Hertz [Thu, 28 May 2015 09:00:57 +0000 (11:00 +0200)]
Fix single-step in native thread
If we attempt to single-step in a thread that is not running Java
code, there is no current method on the stack. So we need to check
for null before trying to decode debug info.
Bug:
21320157
(cherry picked from commit
52f5f93873ec244320e05b033243c5c7a3ae40e2)
Change-Id: I961108071dd58a23f6327370b00c35a4cabe0aa7
Jeff Hao [Thu, 28 May 2015 02:46:01 +0000 (02:46 +0000)]
Merge "Fix updating of JNI references for String.<init>." into mnc-dev
Jeff Hao [Thu, 28 May 2015 02:29:29 +0000 (19:29 -0700)]
Fix updating of JNI references for String.<init>.
Was missing updates to globals and weak globals.
Bug:
21288130
Bug:
21440428
Change-Id: I5f801f68b61f6b066b441b92ace367e6ba434789
Dmitriy Ivanov [Wed, 27 May 2015 22:34:38 +0000 (15:34 -0700)]
Fix valgrind includes
external/valgrind structure has been changed
to reflect upstream projects struture.
Making corresponding changes to art includes.
Bug: http://b/
21471495
Change-Id: I2434a270f88502528df82c4820afedb002b65b8d
(cherry picked from commit
6130f739d8f35e01037ba5c3ec5e5a1057900479)
Dmitriy Ivanov [Sat, 23 May 2015 01:03:34 +0000 (18:03 -0700)]
Reset libc targetSdkVersion
This will let libc/linker know which sdk version
is targeted by the app. This is needed to work around
incorrect DT_NEEDED entries in old apps.
Bug: http://b/
21364029
Change-Id: I2f2907104106aac6c8831381ca171dc0302e6a9d
(cherry picked from commit
15efde2badd80b8b124f8e1444165e4afbac17f0)
Andreas Gampe [Tue, 26 May 2015 20:35:39 +0000 (13:35 -0700)]
ART: Fix wrong hard-failure handling in verifier
Correctly return null for the method when a hard failure is
encountered. Also improve logging for order failures. Add a
regression test.
Bug:
20224106
Change-Id: I6e08202617147378b204af169308b67fc69f92c6
Vladimir Marko [Wed, 27 May 2015 13:07:08 +0000 (14:07 +0100)]
ART: Use kBadFprBase on mips64 and arm64.
Fix incorrect usage of kBadGprBase to avoid misleading and
ambiguous data in crash investigations.
Bug:
21266656
(cherry picked from commit
5b09ea0af468d9232cf725ac7f7e73c145892c5c)
Change-Id: Ia4fc60a5d61471c7a6c8fd0545a897ace43d90be
Mathieu Chartier [Wed, 27 May 2015 02:48:16 +0000 (19:48 -0700)]
Add missing oatdump test dependency
(cherry picked from commit
ea216b3abf96d4121a96e8fdab5ce97d7f4d1c2b)
Bug:
18000316
Change-Id: Ic828e8be8e5d3ef7e112facd0db57013740d449a
Mathieu Chartier [Tue, 26 May 2015 21:44:35 +0000 (14:44 -0700)]
Add oatdump test
(cherry picked from commit
19510f02b011e545665f6219e6144c8e47aed5f0)
Bug:
18000316
Change-Id: Ic22d63dc64a9b7a492b5e6bfbd4c75f30c35dfd5
Vladimir Marko [Tue, 26 May 2015 19:42:30 +0000 (20:42 +0100)]
Fix mac build: cast fpr callee save addresses.
Bring back reinterpret_cast<>s removed by
https://android-review.googlesource.com/151309 .
They are needed for mac builds.
Bug :
13925192
(cherry picked from commit
0eb42511405f3919572a480a009426dfb776cfb5)
Change-Id: If6e0cdbadcc84a046abe03d7eca5cccd0a50d141
Vladimir Marko [Tue, 26 May 2015 18:57:30 +0000 (19:57 +0100)]
Fix mac build: include <sys/time.h> in time_utils.cc .
Required for gettimeofday(). Not needed in utils.cc .
Bug:
13925192
(cherry picked from commit
ce39200492e2715a94d96fbd39fa42b46115c255)
Change-Id: If40694965b84605819cac11a7937821aa74db82b
Vladimir Marko [Tue, 19 May 2015 17:08:00 +0000 (18:08 +0100)]
ART: Clean up arm64 kNumberOfXRegisters usage.
Avoid undefined behavior for arm64 stemming from 1u << 32 in
loops with upper bound kNumberOfXRegisters.
Create iterators for enumerating bits in an integer either
from high to low or from low to high and use them for
<arch>Context::FillCalleeSaves() on all architectures.
Refactor runtime/utils.{h,cc} by moving all bit-fiddling
functions to runtime/base/bit_utils.{h,cc} (together with
the new bit iterators) and all time-related functions to
runtime/base/time_utils.{h,cc}. Improve test coverage and
fix some corner cases for the bit-fiddling functions.
Bug:
13925192
(cherry picked from commit
80afd02024d20e60b197d3adfbb43cc303cf29e0)
Change-Id: I905257a21de90b5860ebe1e39563758f721eab82