OSDN Git Service
Brian Carlstrom [Mon, 2 May 2011 04:03:33 +0000 (21:03 -0700)]
Remove javax.net.ssl.trustStore from dalvik script
Change-Id: Ia1cfc2f066a965f659b3a46d655b78232e5bba2b
jeffhao [Fri, 29 Apr 2011 01:14:40 +0000 (18:14 -0700)]
Bugfix for constant propagation of float/double division/modulo.
Change-Id: Ifde0d0b07b35e1357ba403b3fad9ace567fff01e
Ben Cheng [Tue, 26 Apr 2011 17:00:22 +0000 (10:00 -0700)]
Bug fixes for ld/st elimination.
1) Only optimize each block once. Strictly speaking this is not a
correctness issue however it triggers the subsequent problem.
2) Ignore dead instructions.
1: ldr r2, [r5, #8]
2: ldr r3, [r5, #8](nop)
3: str r3, [r5, #4]
4: movs r3, r2
When using instruction 1 to initiate redundant ld/st eliminations, if
instruction 2 (which is already dead) is not ignored, it will be turned
into a "mov r3, r2" and that will clobber r3 used by the str.
Change-Id: I8eecd13eeb30e4a67ecf1f8fbad925b1e6e91fc8
jeffhao [Mon, 25 Apr 2011 22:15:08 +0000 (15:15 -0700)]
Bug fix for SCCP improperly handling phis with some constant sources.
Change-Id: Ib6e2ab17b50c90d7d83658c69dfba1d065a42155
Ben Cheng [Thu, 14 Apr 2011 00:08:29 +0000 (17:08 -0700)]
Fix self-verification with backward branches or invokes.
Bug:
4282508
Change-Id: Iae9d33fd3dc97e88a465fa3128f5108c877470e9
Ben Cheng [Fri, 22 Apr 2011 06:09:39 +0000 (23:09 -0700)]
Set "needFallThroughBranch" flag during block split.
Bonus changes:
* Add a undefined Thumb instruction between the last code block and the
beginning of PC reconstruction cell to capture such codegen problem on
the spot.
* Fix a loop formation problem to exclude nested loops.
Bug:
4320840
Change-Id: I49d3fbba0073d8c2d4a0b241258239cb952c6bdd
buzbee [Thu, 21 Apr 2011 18:19:27 +0000 (11:19 -0700)]
Kill stale assert, fix for
4310384
There was an old assert in dvmPopFrame that did a sanity check on
the JNI local reference table it was popping. In the asserting case,
we had internal native method calls and no JNI - and thus no sane
local reference table. Further, the localRefTable code has changed enough
that this particular sanity check is no longer useful. Assert deleted,
along with another related (and previously-commented out) assert.
Change-Id: I3a806838fa2b5909c3e3b3ad27aeed29e3e467ab
Carl Shapiro [Wed, 20 Apr 2011 15:24:59 +0000 (08:24 -0700)]
am
6892cab9: am
e4195e1c: Fix a type error in the allocation of non-moving arrays.
* commit '
6892cab90362639344373ce6d71c8fdd9903ae22':
Fix a type error in the allocation of non-moving arrays.
Carl Shapiro [Wed, 20 Apr 2011 14:46:59 +0000 (07:46 -0700)]
am
e4195e1c: Fix a type error in the allocation of non-moving arrays.
* commit '
e4195e1c91f4ea3c6192070fd3c9b9e4e6d429ae':
Fix a type error in the allocation of non-moving arrays.
Carl Shapiro [Mon, 18 Apr 2011 22:08:21 +0000 (15:08 -0700)]
Fix a type error in the allocation of non-moving arrays.
Originally, non-moving arrays were allocated with dvmAllocObjectArray.
However, dvmAllocObjectArray does not respect the width of the user
supplied element class and substitutes a hard coded value of 4 bytes.
This change replaces dvmAllocObjectArray with dvmAllocArrayByClass.
dvmAllocArrayByClass consults the element class for its width when
computing the storage size for the array being allocated.
Bug:
4309030
Sriram Raman [Tue, 19 Apr 2011 21:36:54 +0000 (14:36 -0700)]
am
024b7b9d: am
a0739ea3: am
af242824: Revert "Fix a type error in the allocation of non-moving arrays." per Ryan\'s request
* commit '
024b7b9d9bed86522bfdec95973008e0e3c2f19b':
Revert "Fix a type error in the allocation of non-moving arrays." per Ryan's request
Sriram Raman [Tue, 19 Apr 2011 21:34:29 +0000 (14:34 -0700)]
am
a0739ea3: am
af242824: Revert "Fix a type error in the allocation of non-moving arrays." per Ryan\'s request
* commit '
a0739ea3040b578a53de817688ab5e9f17c0ce72':
Revert "Fix a type error in the allocation of non-moving arrays." per Ryan's request
Sriram Raman [Tue, 19 Apr 2011 21:29:47 +0000 (14:29 -0700)]
am
af242824: Revert "Fix a type error in the allocation of non-moving arrays." per Ryan\'s request
* commit '
af242824dcedbbe39c92b49d148e7ff50267e47f':
Revert "Fix a type error in the allocation of non-moving arrays." per Ryan's request
Sriram Raman [Tue, 19 Apr 2011 21:17:27 +0000 (17:17 -0400)]
Revert "Fix a type error in the allocation of non-moving arrays." per Ryan's request
This reverts commit
bdd06aadab6214d2378b7d5078f92bfb14e7e3dc.
Change-Id: Ifbb4bd7941fe4f2e9d02ca2b7d77186edae4dd55
Carl Shapiro [Tue, 19 Apr 2011 19:11:33 +0000 (12:11 -0700)]
am
8bfb6dec: am
bb8c2f35: am
bdd06aad: Fix a type error in the allocation of non-moving arrays.
* commit '
8bfb6dec87783ee5d80a043d6a30abbf200a553b':
Fix a type error in the allocation of non-moving arrays.
Carl Shapiro [Tue, 19 Apr 2011 19:07:46 +0000 (12:07 -0700)]
am
bb8c2f35: am
bdd06aad: Fix a type error in the allocation of non-moving arrays.
* commit '
bb8c2f35e2155b6eec92e692666df8c67810ded6':
Fix a type error in the allocation of non-moving arrays.
Carl Shapiro [Tue, 19 Apr 2011 18:43:46 +0000 (11:43 -0700)]
am
bdd06aad: Fix a type error in the allocation of non-moving arrays.
* commit '
bdd06aadab6214d2378b7d5078f92bfb14e7e3dc':
Fix a type error in the allocation of non-moving arrays.
Carl Shapiro [Mon, 18 Apr 2011 22:08:21 +0000 (15:08 -0700)]
Fix a type error in the allocation of non-moving arrays.
Originally, non-moving arrays were allocated with dvmAllocObjectArray.
However, dvmAllocObjectArray does not respect the width of the user
supplied element class and substitutes a hard coded value of 4 bytes.
This change replaces dvmAllocObjectArray with dvmAllocArrayByClass.
dvmAllocArrayByClass consults the element class for its width when
computing the storage size for the array being allocated.
Bug:
4309030
Change-Id: I9cfe1b62ea61f03e46f44ad2be0d1cce1bef7cdd
Nick Kralevich [Thu, 14 Apr 2011 18:37:24 +0000 (11:37 -0700)]
make dvmOpenCachedDexFile resistant to umask changes.
Change-Id: I61734941bd94a013a82c1dd0ebeac43fefa680e1
Elliott Hughes [Thu, 14 Apr 2011 18:52:03 +0000 (11:52 -0700)]
The jni-tips documentation has moved to frameworks/base.
Change-Id: I77fbc3ed593c51f61de9590beaadaa52f08387f8
buzbee [Wed, 13 Apr 2011 21:10:04 +0000 (14:10 -0700)]
Fix debugger performance regression
http://b/issue?id=
4282910
The interpreter was reporting every instruction as a method entry point,
causing significant performance degradation in the debugger.
Change-Id: If6fb092d6ade7fc3d74be3c7f806bf2d6923a063
buzbee [Mon, 11 Apr 2011 21:20:45 +0000 (14:20 -0700)]
Merge "Add missing JUMBO opcodes to volatile rewriting"
buzbee [Mon, 11 Apr 2011 21:07:34 +0000 (14:07 -0700)]
Add missing JUMBO opcodes to volatile rewriting
The boolean/byte/char/short variants of iget/iput/sget/sput were not
being correctly converted to _VOLATILE opcodes for SMP builds.
Change-Id: Ic81d75f9c927325d54a98465c146b6d43ea204f4
buzbee [Sat, 9 Apr 2011 21:47:32 +0000 (14:47 -0700)]
[JIT] Close code cache race window
See http://b/issue?id=
4271784 for details.
Three fixes:
1. Verify the code cache version hasn't changed between completion
of the translation and registering it in JitTable
2. When code cache full detected during translating a trace, mark
the "discard" flag on the work order.
3. [The actual cause of the bug] When doing a code cache flush,
traverse the thread least and cancel any trace selections in
progress.
Change-Id: Ifea70416d7d91637fb742fc8de11044a89358caa
buzbee [Sat, 9 Apr 2011 01:01:17 +0000 (18:01 -0700)]
Merge "[JIT] Fix volatile test"
buzbee [Thu, 7 Apr 2011 22:22:06 +0000 (15:22 -0700)]
[JIT] Fix volatile test
On SMP systems, Dalvik opcodes referencing volatile fields will be
rewritten to their _VOLATILE variant. On non-SMP systems, though,
this rewriting is not done. The JIT, however, needs to know about
volatility for all systems in order to avoid performing unsafe
optimizations. This change fixes the JIT's volatility test to be
either _VOLATILE opcode or the volatile flag in the field access bits
depending on SMP type.
Change-Id: I2edde58dc25f22cba88f62c5f1a2d125473309e6
Elliott Hughes [Sat, 9 Apr 2011 00:20:54 +0000 (17:20 -0700)]
Merge "Add jniThrowExceptionFmt."
Elliott Hughes [Sat, 9 Apr 2011 00:15:16 +0000 (17:15 -0700)]
Add jniThrowExceptionFmt.
I still think you should be doing checks and throwing exceptions in Java,
and your native code should just crash if you lie to it, but this will
ease the translation of frameworks/base code over to using JNI more correctly.
Change-Id: I9f2512e2349452b82360b375911c814ab00db23b
buzbee [Fri, 8 Apr 2011 22:45:13 +0000 (15:45 -0700)]
Merge "Fix method profiling [issue
4260697]"
Joe Onorato [Fri, 8 Apr 2011 22:32:34 +0000 (15:32 -0700)]
Revert "[JIT] Fix volatile test" - breaks build
This reverts commit
11fb99d598ebe640719743a0d3bd7ed091e5be03.
buzbee [Fri, 8 Apr 2011 22:25:13 +0000 (15:25 -0700)]
Fix method profiling [issue
4260697]
In the new interpreter control mechanism, method tracing invoke
events are generated at the call site, whereas debug entry events
happen prior to the interpretation of the first instruction of a
method. Because we were failing to check for active profiling
on entry to a new interpreter instance, we would miss the profile
event for the first method interpreted. We subsequently (and correctly)
recorded the return event, and ended up with a mismatch causing traceview
to complain and die.
Change-Id: Ibd93dfcd16c2f1fc62f6a86626a902eaf5d4b160
buzbee [Thu, 7 Apr 2011 22:22:06 +0000 (15:22 -0700)]
[JIT] Fix volatile test
On SMP systems, Dalvik opcodes referencing volatile fields will be
rewritten to their _VOLATILE variant. On non-SMP systems, though,
this rewriting is not done. The JIT, however, needs to know about
volatility for all systems in order to avoid performing unsafe
optimizations. This change fixes the JIT's volatility test to be
either _VOLATILE opcode or the volatile flag in the field access bits
depending on SMP type.
Change-Id: If485875c5abbf0147c3ef4b6d557faa89ed85426
jeffhao [Fri, 8 Apr 2011 19:14:27 +0000 (12:14 -0700)]
Bug fix for rsubs being improperly generated.
This will miss some opportunities to generate rsubs, and has been marked
by a TODO note where code needs to be added.
Cherry-picked frmo dalvik-dev.
Change-Id: Iac272f16b78ab6d985b5aabef6bd360d36a5c7ce
Carl Shapiro [Thu, 7 Apr 2011 23:37:30 +0000 (16:37 -0700)]
Merge "Scale the card count by bits per byte to derive a bit vector length."
Carl Shapiro [Thu, 7 Apr 2011 23:02:54 +0000 (16:02 -0700)]
Scale the card count by bits per byte to derive a bit vector length.
Change-Id: If3177d924193cd665f12758ce83f3be4cc5a66c8
Andy McFadden [Thu, 7 Apr 2011 21:45:06 +0000 (14:45 -0700)]
Merge "Improve JNI indirect ref diagnostics"
Andy McFadden [Thu, 7 Apr 2011 17:36:56 +0000 (10:36 -0700)]
Improve JNI indirect ref diagnostics
Improved CheckJNI problem detection and failure reporting. Also,
the indirect reference table data structure now responds to invalid
requests with a magic bogus object instead of NULL, so that failures
are immediate and obvious.
The extended checks in the indirect ref implementation are still on,
mostly so that bad code fails in an obvious way even when CheckJNI
is not enabled.
This change also includes a hack to allow weak globals to work.
Returning non-NULL for invalid refs turned a rarely-fails-weirdly
issue into an always-fails-loudly, which is good, but we need to
paper over it until the WGR fix is in place. This will need to be
removed later.
Also, reduced some log levels.
Bug
4184721
Change-Id: Iaec75c71dbc85934366be2e717329b635d0fa49e
Dan Bornstein [Thu, 7 Apr 2011 17:41:09 +0000 (10:41 -0700)]
Update the interpretation of --target-api.
Change-Id: I4ab158384d09470d84097d944ae1ddadeb2ad045
buzbee [Tue, 5 Apr 2011 17:55:21 +0000 (10:55 -0700)]
Fix x86 fast interpreter
Was passing wrong value to dvmResolveField() in OP_IGET_WIDE_JUMBO
Change-Id: I7773fd0932d7d032fce30dc57b33ef6a8fbc7afb
buzbee [Mon, 4 Apr 2011 19:25:57 +0000 (12:25 -0700)]
[JIT] Rely on the opcode only to determine volatile
In the past, it was possible to have a volatile field with a
non-volatile opcode. This is no longer the case, so this change
eliminates the volatile field flag check.
Change-Id: I1cface4e813144634b2f90732c76b0a16f08c304
Bill Buzbee [Mon, 4 Apr 2011 19:10:09 +0000 (12:10 -0700)]
Merge "Do not emit the write barrier when storing to primitive volatile fields."
Brian Carlstrom [Mon, 4 Apr 2011 19:09:03 +0000 (12:09 -0700)]
Merge "Fix sizing of the modunion table on small heaps"
Carl Shapiro [Mon, 4 Apr 2011 17:20:43 +0000 (10:20 -0700)]
Do not emit the write barrier when storing to primitive volatile fields.
Change-Id: I79cdac62baa40582bba160a04cbd4c8b2c9151a5
Brian Carlstrom [Mon, 4 Apr 2011 19:06:15 +0000 (12:06 -0700)]
Fix sizing of the modunion table on small heaps
Change-Id: I8696fb2f6d408049ec39609db34238edee171f79
Carl Shapiro [Mon, 4 Apr 2011 18:33:00 +0000 (11:33 -0700)]
Include strings.h for the ffs prototype.
Change-Id: I70a4dc5c8d9015cfc069611b7eba0860bb37a8d7
Brian Carlstrom [Sun, 3 Apr 2011 05:19:15 +0000 (22:19 -0700)]
Use x86 variant in dalvik for TARGET_ARCH_VARIANT=x86-atom
Change-Id: I1f7968a5bf8e24f3a3feb5f5a40ee2c21294a0c3
Brian Carlstrom [Fri, 1 Apr 2011 22:05:18 +0000 (15:05 -0700)]
Merge remote branch 'goog/dalvik-dev' into dalvik-dev-to-master
Ben Cheng [Fri, 1 Apr 2011 04:07:55 +0000 (21:07 -0700)]
Change the tread state before acquiring the code cache lock.
Fix a deadlock situation.
Bug:
4192964
Change-Id: I27f869d90d58f67e675a65444ebed6fdf2a5f518
buzbee [Thu, 31 Mar 2011 22:44:23 +0000 (15:44 -0700)]
Merge "[JIT] Clear inCodeCacheFlag on extended singlestep" into dalvik-dev
buzbee [Thu, 31 Mar 2011 22:38:34 +0000 (15:38 -0700)]
[JIT] Clear inCodeCacheFlag on extended singlestep
The inJitCodeCache flag was not being reset if an extended
singlestep prevented a return to an existing translation.
Change-Id: I84f9e4053e3dc713a5ff994df9ecd2ab54e7fe56
Ben Cheng [Thu, 31 Mar 2011 21:54:06 +0000 (14:54 -0700)]
Merge "Generate code for loops formed with the new builder" into dalvik-dev
Carl Shapiro [Thu, 31 Mar 2011 20:38:28 +0000 (13:38 -0700)]
Merge "Delegate the queuing of cleared references to managed code." into dalvik-dev
Ben Cheng [Tue, 22 Mar 2011 21:09:09 +0000 (14:09 -0700)]
Generate code for loops formed with the new builder
Adapt the existing counted loop analysis and range/null check
elimination code to work with the new loop building heuristics.
Cleaned up the old ad-hoc loop builder.
Suspend polling is enabled by default for loops. The backward chaining
cell will be used in self-verification and profiling mode.
If the loop includes accesses to resolved fields/classes, abort code
generation for now and revert to the basic acyclic trace. Added
tests/090-loop-formation to make sure the JIT won't choke on such
instructions.
Change-Id: Idbc57df0a745be3b692f68c1acb6d4861c537f75
buzbee [Thu, 31 Mar 2011 18:20:47 +0000 (11:20 -0700)]
Merge "Add missing JUMBO ops [fixed]" into dalvik-dev
buzbee [Thu, 31 Mar 2011 18:18:28 +0000 (11:18 -0700)]
Add missing JUMBO ops [fixed]
Neglected to git-add the most recent version in Change I0c0b6d17.
Change-Id: I5f9e630f652edcf70ab893ade6f559056ed31f8f
Elliott Hughes [Thu, 31 Mar 2011 18:14:41 +0000 (11:14 -0700)]
Merge "Improve diagnostics when non-String passed as a jstring." into dalvik-dev
Elliott Hughes [Thu, 31 Mar 2011 18:06:36 +0000 (11:06 -0700)]
Improve diagnostics when non-String passed as a jstring.
For my particular bug, the cause was obvious by inspection of the calling
code, but this might be useful in harder cases.
Before:
W(17868) JNI WARNING: jstring 0x3600001 points to non-string object (Check_GetStringUTFChars) (dalvikvm)
Change-Id: I883a99936b8c2cd79c5a691f7c335245ff50b34f
After:
W(19680) JNI WARNING: jstring 0x3600001 points to object of type Llibcore/io/Posix; (Check_GetStringUTFChars) (dalvikvm)
buzbee [Thu, 31 Mar 2011 18:03:07 +0000 (11:03 -0700)]
Merge "Add missing JUMBO ops to JIT" into dalvik-dev
buzbee [Thu, 31 Mar 2011 17:55:04 +0000 (10:55 -0700)]
Add missing JUMBO ops to JIT
We were missing a dozen or so of the new jumbo ops in the JIT's
code generator. Interestingly, our compiler error recovery mechanism was
good enough that we didn't notice (we die on an assert build,
but silently recover and continue on a production build).
Change-Id: I0c0b6d1704c47e81b39c7dcf7d1172dbdcd29856
Ben Cheng [Thu, 31 Mar 2011 17:44:44 +0000 (10:44 -0700)]
Add missing jumbo opcodes to the self verification exclusion list
Change-Id: If38ce20b2ac30488118259e3b3bdfbc9f068e5c3
Carl Shapiro [Thu, 31 Mar 2011 02:35:34 +0000 (19:35 -0700)]
Delegate the queuing of cleared references to managed code.
Previously, the garbage collector would pass each cleared reference to
the heap worker thread for queuing. The heap worker thread would then
perform a callback into managed code for each cleared reference which
assigned the reference to its reference queue.
With this change, the garbage collector instead links together all of
the cleared references and calls back into managed code exactly once
to hand off the references for processing. This change makes the heap
worker thread and its data structures obsolete.
Change-Id: I28e02638f0877a7fd2ac96b9c3f5597a38541ebb
Jesse Wilson [Wed, 30 Mar 2011 23:40:25 +0000 (16:40 -0700)]
Merge "Update a test to handle a different anonymous class name." into dalvik-dev
Jesse Wilson [Wed, 30 Mar 2011 23:30:18 +0000 (16:30 -0700)]
Update a test to handle a different anonymous class name.
Change-Id: Ie39f76b9aa7478c39e10165eba122e3aa2834461
buzbee [Wed, 30 Mar 2011 21:51:28 +0000 (14:51 -0700)]
Merge "Fix interpreter debug attach" into dalvik-dev
buzbee [Tue, 29 Mar 2011 17:26:07 +0000 (10:26 -0700)]
Fix interpreter debug attach
Fix a few miscellaneous bugs from the interpreter restructuring that were
causing a segfault on debugger attach.
Added a sanity checking routine for debugging.
Fixed a problem in which the JIT's threshold and on/off switch
wouldn't get initialized properly on thread creation.
Renamed dvmCompilerStateRefresh() to dvmCompilerUpdateGlobalState() to
better reflect its function.
Change-Id: I5b8af1ce2175e3c6f53cda19dd8e052a5f355587
Brian Carlstrom [Wed, 30 Mar 2011 05:53:15 +0000 (22:53 -0700)]
am
3a2e2a73: Merge "SamplingProfilerIntegration and SamplingProfiler improvements (1/3)"
* commit '
3a2e2a73b687ba68d879e49b465778c4d589cff1':
SamplingProfilerIntegration and SamplingProfiler improvements (1/3)
Brian Carlstrom [Wed, 30 Mar 2011 05:35:12 +0000 (22:35 -0700)]
Merge "SamplingProfilerIntegration and SamplingProfiler improvements (1/3)"
Brian Carlstrom [Mon, 28 Mar 2011 07:12:36 +0000 (00:12 -0700)]
SamplingProfilerIntegration and SamplingProfiler improvements (1/3)
Summary:
frameworks/base
- fix profiling to collect data beyond the first snapshot
- avoid many small files, accumulate data over process lifetime
libcore:
- add support for VM specific sampling, trying to cut down overhead
- added support for converting snapshot files to text format
- fixed race in profiler when stopping
dalvik
- added VMStack.setThreadStackTrace interface for filling a stack
trace into an existing StackTraceElement[]
Details:
frameworks/base
Changed snapshots from text to binary hprof format (bumping version to 3)
Changed from one file per snapshot to one file per process lifetime.
Restart profiling after snapshot.
core/java/com/android/internal/os/SamplingProfilerIntegration.java
Add quick test in maybeSnapshot to avoid doing work when the
SamplingProfilerIntegration is disabled. Make maybeSnapshot
private. Remove unneeded memory allocation in handleLowMemory.
core/java/android/app/ActivityThread.java
libcore
Added ThreadSampler interface. This allows VM specific thread
sampling optimizations. The portable version continues to use
Thread.getStackTrace().
dalvik/src/main/java/dalvik/system/profiler/ThreadSampler.java
dalvik/src/main/java/dalvik/system/profiler/PortableThreadSampler.java
dalvik/src/main/java/dalvik/system/profiler/SamplingProfiler.java
Add VMStack.setThreadStackTrace and use in new DalvikThreadSampler
to avoid allocating a full stack trace when only a limited depth
is desired.
dalvik/src/main/java/dalvik/system/profiler/DalvikThreadSampler.java
dalvik/src/main/java/dalvik/system/VMStack.java
Refactored BinaryHprof.readMagic out of BinaryHprofReader so it
can be used by HprofBinaryToAscii converter to probing file
types. Added magic number constant to be shared between readMagic
and BinaryHprofWriter.
dalvik/src/main/java/dalvik/system/profiler/BinaryHprof.java
dalvik/src/main/java/dalvik/system/profiler/BinaryHprofReader.java
dalvik/src/main/java/dalvik/system/profiler/BinaryHprofWriter.java
dalvik/src/main/java/dalvik/system/profiler/HprofBinaryToAscii.java
Removed unneeded HprofWriter interface. Changed to simpler static
interface to write HprofData to binary and text formats.
dalvik/src/main/java/dalvik/system/profiler/HprofWriter.java
dalvik/src/main/java/dalvik/system/profiler/AsciiHprofWriter.java
dalvik/src/main/java/dalvik/system/profiler/BinaryHprofWriter.java
dalvik/src/test/java/dalvik/system/profiler/SamplingProfilerTest.java
Added support for reading snapshot files created by
SamplingProfilerIntegration by stripping the text header to allow
easier conversion to the text format.
dalvik/src/main/java/dalvik/system/profiler/HprofBinaryToAscii.java
Fixed race between Sampler and
SamplingProfiler.stop. SamplingProfiler.stop previously simply
called the Sampler's TimerTask.cancel method, but this does not
wait for a currently running Sampler to finish. The TimerTask
documentation says the only reliable way to do this is to have the
run() cancel itself, so that is what is now done, with new code to
ensure that SamplingProfiler.stop does not return until the
Sampler has been terminated.
dalvik/src/main/java/dalvik/system/profiler/SamplingProfiler.java
dalvik
Refactored VMStack_getThreadStackTrace to create helper getTraceBuf
used to implement new VMStack_setThreadStackTrace. The new version
interface fills an existing StackTraceElement[], avoid allocating
unnecessary StackTraceElements.
vm/native/dalvik_system_VMStack.c
Refactor dvmGetStackTraceRaw to create dvmSetStackTraceRaw which
fills in an existing, potentially smaller, StackTraceElement[].
vm/Exception.c
vm/Exception.h
Change stack depths to be size_t to avoid signed/unsigned comparison warnings.
vm/Ddm.c
vm/Exception.c
vm/Exception.h
Change-Id: Ie88a3f9e069f6984d790ee61c6f7ac5ed47d3388
Elliott Hughes [Tue, 29 Mar 2011 21:59:02 +0000 (14:59 -0700)]
Merge "Improve diagnostics when RegisterNatives fails." into dalvik-dev
Elliott Hughes [Tue, 29 Mar 2011 21:06:24 +0000 (14:06 -0700)]
Improve diagnostics when RegisterNatives fails.
This assumes that people spell the method name correctly, but make mistakes
in the signature (which seems to be true in practice).
Before:
W( 7757) ERROR: Unable to find decl for native Llibcore/io/Posix;.sendfile:(Ljava/io/FileDescriptor;Ljava/io/FileDescriptor;Llibcore/util/MutableInt;J)J (dalvikvm)
E( 7757) RegisterNatives failed for 'libcore/io/Posix', aborting (JNIHelp)
After:
E(23966) ERROR: couldn't find native method (dalvikvm)
E(23966) Requested: Llibcore/io/Posix;.sendfile:(Ljava/io/FileDescriptor;Ljava/io/FileDescriptor;Llibcore/util/MutableLong;J)Z (dalvikvm)
E(23966) Candidate: Llibcore/io/Posix;.sendfile:(Ljava/io/FileDescriptor;Ljava/io/FileDescriptor;Llibcore/util/MutableLong;J)J (dalvikvm)
E(23966) RegisterNatives failed for 'libcore/io/Posix', aborting (JNIHelp)
Change-Id: I434aee679bd7c2760404b7790b996f7f86ed9b44
Andy McFadden [Tue, 29 Mar 2011 16:58:27 +0000 (09:58 -0700)]
Init classes used by DDMS
Not all call paths ensure class initialization.
Change-Id: Ic12ac5c59f3ffa2d7c04e84ea37264f65a7630be
buzbee [Tue, 29 Mar 2011 01:12:30 +0000 (18:12 -0700)]
Merge "Add safepoint callback for gc" into dalvik-dev
buzbee [Thu, 24 Mar 2011 23:41:03 +0000 (16:41 -0700)]
Add safepoint callback for gc
This change adds a safepoint callback registration mechanism.
On a per-thread (or all-thread) basis, you pass in a function to be
called at the next safe point by the target thread. That if that
function returns 0, it will be automatically disarmed. If not,
the callback will stay in effect and the function will be called
on all subsequent safe points.
GC is the expected customer of this feature.
Change-Id: Icd3b93128b1fd547e142d047a12df7ae8ee646e3
Jesse Wilson [Mon, 28 Mar 2011 23:05:04 +0000 (16:05 -0700)]
Remove unused security manager code.
Change-Id: Iecc602b8235eb3feeac31e198bdaf61c65dd9fbf
http://b/
4087759
Jesse Wilson [Mon, 28 Mar 2011 22:57:58 +0000 (15:57 -0700)]
Merge "Support reflective lookup of single fields." into dalvik-dev
Andy McFadden [Mon, 28 Mar 2011 22:48:27 +0000 (15:48 -0700)]
Merge "Prep DDMS stuff in InitRefs" into dalvik-dev
Andy McFadden [Mon, 28 Mar 2011 22:03:21 +0000 (15:03 -0700)]
Prep DDMS stuff in InitRefs
Find some methods and field offsets.
Also removed a duplicate entry.
Change-Id: I4c23af6cfe6e7d4f5e8767c5a9a30d3b441ad425
Andy McFadden [Mon, 28 Mar 2011 22:32:34 +0000 (15:32 -0700)]
Merge "Fix a couple of asserts" into dalvik-dev
Andy McFadden [Mon, 28 Mar 2011 22:23:23 +0000 (15:23 -0700)]
Fix a couple of asserts
Polarity was reversed.
Change-Id: I15af89267a703210ae5d08a9cca529b2f0cd48c6
buzbee [Mon, 28 Mar 2011 21:50:04 +0000 (14:50 -0700)]
resolved conflicts for merge of
ac815100 to dalvik-dev
Change-Id: I724cce041f14f91aec9ec5ca6cc535ede6d94f70
Jesse Wilson [Mon, 28 Mar 2011 21:26:34 +0000 (14:26 -0700)]
Support reflective lookup of single fields.
Change-Id: Ie7058fa9de8212b0f52d5d9b0ec7d46242a851fc
http://b/
4087759
buzbee [Mon, 28 Mar 2011 20:51:38 +0000 (13:51 -0700)]
Fix x86-atom build
Fix an apparent merge problem in the x86-atom build. The
handler table still had a reference to the unused 0xF1 opcode
rather than the new OP_RETURN_VOID_BARRIER.
Change-Id: Iaa6329c15f7891fd793846a2d19979679aed9af2
Andy McFadden [Mon, 28 Mar 2011 17:05:39 +0000 (10:05 -0700)]
Merge "Yet more InitRefs-ing" into dalvik-dev
Andy McFadden [Fri, 25 Mar 2011 14:37:31 +0000 (07:37 -0700)]
Yet more InitRefs-ing
Fix up some early initialization stuff.
Also, stop pretending that the top of non-main-thread stacks is a
Runnable.
Change-Id: I3e89c6320351c160cfa0bea3cf6bbfd26a5b7c12
Elliott Hughes [Fri, 25 Mar 2011 21:19:15 +0000 (14:19 -0700)]
Merge "Try a bit harder to look like gdb(1)." into dalvik-dev
Jesse Wilson [Fri, 25 Mar 2011 20:56:40 +0000 (13:56 -0700)]
Merge "Native code to fast path annotation lookups." into dalvik-dev
Elliott Hughes [Fri, 25 Mar 2011 20:53:43 +0000 (13:53 -0700)]
Try a bit harder to look like gdb(1).
Before:
W(27206) #9 ...
W(27206) #10 ...
After:
W(30066) #9 ...
W(30066) #10 ...
Bug: http://b/
4176271
Change-Id: If75b4f0bc9553bce0747a818718f5a8873c30565
Elliott Hughes [Fri, 25 Mar 2011 20:38:13 +0000 (13:38 -0700)]
Merge "Automatically dump stack traces in dvmAbort on the host." into dalvik-dev
Elliott Hughes [Fri, 25 Mar 2011 18:58:52 +0000 (11:58 -0700)]
Automatically dump stack traces in dvmAbort on the host.
Before:
E(25569) VM aborting (dalvikvm)
After:
E( 9806) VM aborting (dalvikvm)
W( 9806) Obtained 7 stack frames. (dalvikvm)
W( 9806) #0 /usr/local/google/home/enh/dd4/out/host/linux-x86/bin/../lib/libdvm.so(dvmPrintNativeBackTrace+0x3f) [0xf7678f2f] (dalvikvm)
W( 9806) #1 /usr/local/google/home/enh/dd4/out/host/linux-x86/bin/../lib/libdvm.so(dvmAbort+0x52) [0xf7679072] (dalvikvm)
W( 9806) #2 /usr/local/google/home/enh/dd4/out/host/linux-x86/bin/../lib/libdvm.so(dvmStartup+0x67f) [0xf767a45f] (dalvikvm)
W( 9806) #3 /usr/local/google/home/enh/dd4/out/host/linux-x86/bin/../lib/libdvm.so(JNI_CreateJavaVM+0x1ee) [0xf768152e] (dalvikvm)
W( 9806) #4 /usr/local/google/home/enh/dd4/out/host/linux-x86/bin/dalvikvm() [0x8048ae3] (dalvikvm)
W( 9806) #5 /lib32/libc.so.6(__libc_start_main+0xe6) [0xf6ed5bd6] (dalvikvm)
W( 9806) #6 /usr/local/google/home/enh/dd4/out/host/linux-x86/bin/dalvikvm() [0x8048761] (dalvikvm)
This makes continuous build crashes more directly useful, and saves having to
switch to the device/break out gdb when doing simple debugging.
Bug:
4176271
Change-Id: I49b40fd56e6aa89d1ddc7c7f299314761456fc28
Jesse Wilson [Fri, 25 Mar 2011 17:44:15 +0000 (10:44 -0700)]
Native code to fast path annotation lookups.
This also removes duplication between Method and Constructor.
Change-Id: I19cdcfdfe5cc3ce28a9be401a1bc58a5a6e8ec81
http://code.google.com/p/android/issues/detail?id=7811
Andy McFadden [Fri, 25 Mar 2011 14:35:48 +0000 (07:35 -0700)]
Merge "Some more InitRefs-ing" into dalvik-dev
Jesse Wilson [Thu, 24 Mar 2011 23:43:50 +0000 (16:43 -0700)]
Optimize annotations.
See libcore change I5912b526dfa87a61a95fbe7b7efc48d0dca3ad38
Change-Id: I89ed0be331eea3d9c0d02bebeaa719b686d532ca
http://code.google.com/p/android/issues/detail?id=7811
Andy McFadden [Thu, 24 Mar 2011 20:45:14 +0000 (13:45 -0700)]
Some more InitRefs-ing
Uncaught exception handling and FileDescriptor.descriptor.
Change-Id: Ia7429417a47e9a3e3d327b246c3ad33c6c77dfa0
jeffhao [Thu, 24 Mar 2011 21:29:49 +0000 (14:29 -0700)]
Merge "Various dx fixes to make it preserve locals and debug info." into dalvik-dev
jeffhao [Thu, 24 Mar 2011 21:01:25 +0000 (14:01 -0700)]
Various dx fixes to make it preserve locals and debug info.
The SCCP pass checks if a register has associated local info before
attepting to prune branches or replace values with constants. Also, the
register allocator reserves a register for each local in a method. This
could be later improved by only reserving registers for the lengths of
their lifetimes as specified by the local info table.
Change-Id: I654ac014a9aac530f1db0db7d5cdef7535ff49bf
buzbee [Thu, 24 Mar 2011 19:56:41 +0000 (12:56 -0700)]
Interpreter fix - limit suspend checks
Register maps are generated only for a subset of instructions (to
limit memory consumption). The previous interpreter restructuring
was doing suspend checks at locations that had no register maps.
This CL limits suspend checks to instructions that have register
maps, and also expands that set to include foward as well as
backwards branches.
Change-Id: Ia2b2e1096efe524fdb2a5fd4be171a4216b6a3b4
Ben Cheng [Thu, 24 Mar 2011 19:08:12 +0000 (12:08 -0700)]
Merge "Dump the current code stream when the assembler fails on size issues." into dalvik-dev
Ben Cheng [Wed, 23 Mar 2011 21:37:40 +0000 (14:37 -0700)]
Dump the current code stream when the assembler fails on size issues.
Since the assembler is very robust and will recover from such problems,
adding the verbose/noisy mode will make it easier to detect overly
aggressive optimizations that don't actually work.
Example:
D/dalvikvm( 2348): Assembler abort #1 on 1
D/dalvikvm( 2348): kThumbBCond@16: delta=260
:
Instruction at 0x16 is a conditional branch:
D/dalvikvm( 2348): 0x16 (0016): beq 0x0000001a (L0xb6c0c)
:
Label at L0xb6c0c is a PC reconstruction cell:
D/dalvikvm( 2348): L0xb6c0c:
D/dalvikvm( 2348): -------- reconstruct dalvik PC : 0x401854d6 @ +0x002b
D/dalvikvm( 2348): 0x11e (011e): ldr r0, [r15pc, #0]
D/dalvikvm( 2348): 0x122 (0122): b 0x00000126 (L0xb685c)
where 0x11e - 0x16 - 4 = 260
Change-Id: Icbc3dae581949f5976722e24e38f04ec882c7d79
Andy McFadden [Thu, 24 Mar 2011 18:28:50 +0000 (11:28 -0700)]
Merge "Various JDWP updates" into dalvik-dev
Andy McFadden [Wed, 23 Mar 2011 23:15:36 +0000 (16:15 -0700)]
Various JDWP updates
More tweaks to JDWP support:
- Mask off access flags not defined by the Java programming language
from fields and methods.
- Use InitRefs to look up ThreadGroup fields.
- Use memcpy() for some 64-bit accesses.
Change-Id: I4ff9f28ad7e6f1519a2befa557ddb5cf41e0f4cf