OSDN Git Service

android-x86/dalvik.git
13 years agoMerge "Fix interpreter debug attach" into dalvik-dev
buzbee [Wed, 30 Mar 2011 21:51:28 +0000 (14:51 -0700)]
Merge "Fix interpreter debug attach" into dalvik-dev

13 years agoFix interpreter debug attach
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

13 years agoam 3a2e2a73: Merge "SamplingProfilerIntegration and SamplingProfiler improvements...
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)

13 years agoMerge "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)"

13 years agoSamplingProfilerIntegration 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

13 years agoMerge "Improve diagnostics when RegisterNatives fails." into dalvik-dev
Elliott Hughes [Tue, 29 Mar 2011 21:59:02 +0000 (14:59 -0700)]
Merge "Improve diagnostics when RegisterNatives fails." into dalvik-dev

13 years agoImprove diagnostics when RegisterNatives fails.
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

13 years agoInit classes used by DDMS
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

13 years agoMerge "Add safepoint callback for gc" into dalvik-dev
buzbee [Tue, 29 Mar 2011 01:12:30 +0000 (18:12 -0700)]
Merge "Add safepoint callback for gc" into dalvik-dev

13 years agoAdd safepoint callback for gc
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

13 years agoRemove unused security manager code.
Jesse Wilson [Mon, 28 Mar 2011 23:05:04 +0000 (16:05 -0700)]
Remove unused security manager code.

Change-Id: Iecc602b8235eb3feeac31e198bdaf61c65dd9fbf
http://b/4087759

13 years agoMerge "Support reflective lookup of single fields." into dalvik-dev
Jesse Wilson [Mon, 28 Mar 2011 22:57:58 +0000 (15:57 -0700)]
Merge "Support reflective lookup of single fields." into dalvik-dev

13 years agoMerge "Prep DDMS stuff in InitRefs" 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

13 years agoPrep DDMS stuff in InitRefs
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

13 years agoMerge "Fix a couple of asserts" into dalvik-dev
Andy McFadden [Mon, 28 Mar 2011 22:32:34 +0000 (15:32 -0700)]
Merge "Fix a couple of asserts" into dalvik-dev

13 years agoFix a couple of asserts
Andy McFadden [Mon, 28 Mar 2011 22:23:23 +0000 (15:23 -0700)]
Fix a couple of asserts

Polarity was reversed.

Change-Id: I15af89267a703210ae5d08a9cca529b2f0cd48c6

13 years agoresolved conflicts for merge of ac815100 to dalvik-dev
buzbee [Mon, 28 Mar 2011 21:50:04 +0000 (14:50 -0700)]
resolved conflicts for merge of ac815100 to dalvik-dev

Change-Id: I724cce041f14f91aec9ec5ca6cc535ede6d94f70

13 years agoSupport reflective lookup of single fields.
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

13 years agoFix x86-atom build
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

13 years agoMerge "Yet more InitRefs-ing" into dalvik-dev
Andy McFadden [Mon, 28 Mar 2011 17:05:39 +0000 (10:05 -0700)]
Merge "Yet more InitRefs-ing" into dalvik-dev

13 years agoYet more InitRefs-ing
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

13 years agoMerge "Try a bit harder to look like gdb(1)." into dalvik-dev
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

13 years agoMerge "Native code to fast path annotation lookups." 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

13 years agoTry a bit harder to look like gdb(1).
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

13 years agoMerge "Automatically dump stack traces in dvmAbort on the host." into dalvik-dev
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

13 years agoAutomatically dump stack traces in dvmAbort on the host.
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

13 years agoNative code to fast path annotation lookups.
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

13 years agoMerge "Some more InitRefs-ing" into dalvik-dev
Andy McFadden [Fri, 25 Mar 2011 14:35:48 +0000 (07:35 -0700)]
Merge "Some more InitRefs-ing" into dalvik-dev

13 years agoOptimize annotations.
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

13 years agoSome more InitRefs-ing
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

13 years agoMerge "Various dx fixes to make it preserve locals and debug info." into dalvik-dev
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

13 years agoVarious dx fixes to make it preserve locals and debug info.
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

13 years agoInterpreter fix - limit suspend checks
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

13 years agoMerge "Dump the current code stream when the assembler fails on size issues." into...
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

13 years agoDump the current code stream when the assembler fails on size issues.
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

13 years agoMerge "Various JDWP updates" into dalvik-dev
Andy McFadden [Thu, 24 Mar 2011 18:28:50 +0000 (11:28 -0700)]
Merge "Various JDWP updates" into dalvik-dev

13 years agoVarious JDWP updates
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

13 years agoam 4624f350: am 17aff091: am b1101e84: am 486ac3c0: Removing inaccurate and unmaintai...
Dan Bornstein [Thu, 24 Mar 2011 01:24:12 +0000 (18:24 -0700)]
am 4624f350: am 17aff091: am b1101e84: am 486ac3c0: Removing inaccurate and unmaintained docs.

* commit '4624f350313daaae52068c5d1d12b88859d43e54':
  Removing inaccurate and unmaintained docs.

13 years agoam 17aff091: am b1101e84: am 486ac3c0: Removing inaccurate and unmaintained docs.
Dan Bornstein [Thu, 24 Mar 2011 00:58:34 +0000 (17:58 -0700)]
am 17aff091: am b1101e84: am 486ac3c0: Removing inaccurate and unmaintained docs.

* commit '17aff091bad641b81e2609cfce69739986597d40':
  Removing inaccurate and unmaintained docs.

13 years agoam b1101e84: am 486ac3c0: Removing inaccurate and unmaintained docs.
Dan Bornstein [Thu, 24 Mar 2011 00:56:38 +0000 (17:56 -0700)]
am b1101e84: am 486ac3c0: Removing inaccurate and unmaintained docs.

* commit 'b1101e847312da8ee98a26e25058f93ba381f1ac':
  Removing inaccurate and unmaintained docs.

13 years agoam 486ac3c0: Removing inaccurate and unmaintained docs.
Dan Bornstein [Thu, 24 Mar 2011 00:53:04 +0000 (17:53 -0700)]
am 486ac3c0: Removing inaccurate and unmaintained docs.

* commit '486ac3c0a90b05be5af4b82801ef325e83241057':
  Removing inaccurate and unmaintained docs.

13 years agoMerge "Use PrintWriter rather than PrintStream in dex analysis tools." into dalvik-dev
Jesse Wilson [Wed, 23 Mar 2011 23:46:04 +0000 (16:46 -0700)]
Merge "Use PrintWriter rather than PrintStream in dex analysis tools." into dalvik-dev

13 years agoUse PrintWriter rather than PrintStream in dex analysis tools.
Jesse Wilson [Wed, 23 Mar 2011 23:21:01 +0000 (16:21 -0700)]
Use PrintWriter rather than PrintStream in dex analysis tools.

Writers make it easier to create strings, useful when these
tools are used as building blocks for other tools.

Change-Id: I8eac49719b130551df216f42eaafb942203da0d0

13 years agoRemoving inaccurate and unmaintained docs.
Dan Bornstein [Wed, 23 Mar 2011 22:26:58 +0000 (15:26 -0700)]
Removing inaccurate and unmaintained docs.

Change-Id: Ifef37063e844e4eb9ccc8111a1f1263fe26bd517

13 years agoMerge "Kill off code, and leave a note." into dalvik-dev
Dan Bornstein [Wed, 23 Mar 2011 19:49:26 +0000 (12:49 -0700)]
Merge "Kill off code, and leave a note." into dalvik-dev

13 years agoKill off code, and leave a note.
Dan Bornstein [Wed, 23 Mar 2011 19:00:20 +0000 (12:00 -0700)]
Kill off code, and leave a note.

Based on discussion yesterday, the code in Copying.c was already
superfluous. I'm leaving dvmForEachRequiredReference(), except with a
note, just in case it ends up being needed. If by the time I'm done
with the next round of VM changes, it turns out not to be needed, then
I'll just go ahead and axe it.

Change-Id: Ib7cf06ba75851c7ffd98108c4c73cddee9259ddf

13 years agoInterpreter restructuring
buzbee [Wed, 2 Mar 2011 23:43:48 +0000 (15:43 -0800)]
Interpreter restructuring

This is a restructuring of the Dalvik ARM and x86 interpreters:

  o Combine the old portstd and portdbg interpreters into a single
    portable interpreter.
  o Add debug/profiling support to the fast (mterp) interpreters.
  o Delete old mechansim of switching between interpreters.  Now, once
    you choose an interpreter at startup, you stick with it.
  o Allow JIT to co-exist with profiling & debugging (necessary for
    first-class support of debugging with the JIT active).
  o Adds single-step capability to the fast assembly interpreters without
    slowing them down (and, in fact, measurably improves their performance).
  o Remove old "polling for safe point" mechanism.  Breakouts now achieved
    via modifying base of interpreter handler table.
  o Simplify interpeter control mechanism.
  o Allow thread-granularity control for profiling & debugging

The primary motivation behind this change was to improve the responsiveness
of debugging and profiling and to make it easier to add new debugging and
profiling capabilities in the future.  Instead of always bailing out to the
slow debug portable interpreter, we can now stay in the fast interpreter.

A nice side effect of the change is that the fast interpreters
got a healthy speed boost because we were able to replace the
polling safepoint check that involved a dozen or so instructions
with a single table-base reload.  When combined with the two earlier CLs
related to this restructuring, we show a 5.6% performance improvement
using libdvm_interp.so on the Checkers benchmark relative to Honeycomb.

Change-Id: I8d37e866b3618def4e582fc73f1cf69ffe428f3c

13 years agoMerge "Fix some exception issues" into dalvik-dev
Andy McFadden [Wed, 23 Mar 2011 14:45:33 +0000 (07:45 -0700)]
Merge "Fix some exception issues" into dalvik-dev

13 years agoMerge "Get rid of some inconsistent formatting." into dalvik-dev
Carl Shapiro [Wed, 23 Mar 2011 02:44:12 +0000 (19:44 -0700)]
Merge "Get rid of some inconsistent formatting." into dalvik-dev

13 years agoGet rid of some inconsistent formatting.
Carl Shapiro [Wed, 23 Mar 2011 01:19:05 +0000 (18:19 -0700)]
Get rid of some inconsistent formatting.

Change-Id: I5d5130702e17bb95c835b9ccc3ec0aa86eda9dea

13 years agoLeft a note for future editors.
Dan Bornstein [Tue, 22 Mar 2011 23:49:41 +0000 (16:49 -0700)]
Left a note for future editors.

Change-Id: Ic96f58baabdf0d1a694b51efc991de5caef66a38

13 years agoPull the globals iteration into InitRefs.
Dan Bornstein [Tue, 22 Mar 2011 21:47:44 +0000 (14:47 -0700)]
Pull the globals iteration into InitRefs.

This gives the new GC a way to iterate over the global object refs
defined in Globals.h, without having to have detailed knowledge of the
list of such refs. However, this change doesn't actually modify the GC
code in question, since it is not currently in a working state anyway.

InitRefs.c probably wants a slightly different name. Suggestions welcome.

Bonus: Cleaned up a vaguely-related clause in Class.c.

Change-Id: I406987c56ddf310c61d877574071c46f3717fc72

13 years agoFix some exception issues
Andy McFadden [Tue, 22 Mar 2011 23:17:09 +0000 (16:17 -0700)]
Fix some exception issues

The function that obtained an exception's message string was making a
bad assumption.  This has been corrected.

Also, in the invoke-object-init functions, we now test for a pending
exception after the call to dvmSetFinalizable().

Also, make the test for pending exception at the end of VM startup
an error rather than an assert.

Bug 4121213

Change-Id: I6912e5c79d63e8dda1a1dc2e788c7a8edcf487aa

13 years agoMerge "Fix dalvik test 089" into dalvik-dev
Andy McFadden [Tue, 22 Mar 2011 22:10:10 +0000 (15:10 -0700)]
Merge "Fix dalvik test 089" into dalvik-dev

13 years agoFix dalvik test 089
Andy McFadden [Tue, 22 Mar 2011 22:04:52 +0000 (15:04 -0700)]
Fix dalvik test 089

The local variable used to hold the field reference was a u2.

Also, removed the "don't include debug info" options from the build
script.

Change-Id: I14b0fd4ae5af8dcd52f4b22e6b8fe9f68fd7bc89

13 years agoRemove more dead SecurityManager cruft.
Elliott Hughes [Tue, 22 Mar 2011 20:34:40 +0000 (13:34 -0700)]
Remove more dead SecurityManager cruft.

(Requires corresponding libcore change.)

Change-Id: I86aac9dda6708173fd2b5a1c660ef20ea11fca03

13 years agoMerge "Fix up some JDWP stuff" into dalvik-dev
Andy McFadden [Tue, 22 Mar 2011 20:04:08 +0000 (13:04 -0700)]
Merge "Fix up some JDWP stuff" into dalvik-dev

13 years agoFix up some JDWP stuff
Andy McFadden [Fri, 18 Mar 2011 21:27:06 +0000 (14:27 -0700)]
Fix up some JDWP stuff

Notably:
- Claim to know about synthetic attributes (canGetSyntheticAttribute).
  Set an appropriate flag in the access flags of fields and methods.
  (Makes no difference that I can see in Eclipse.)
- Stop making copies of descriptor strings.  That ceased to be necessary
  after they were normalized in DEX (pre-1.0).
- Correct object type determination, especially w.r.t. the specially-
  tagged types (strings, threads, classloaders, etc).
- Handle a FIELD_ONLY mod (not tested).
- Added a bit of debugging stuff.

Change-Id: I5651b5b76d904a9edbd051e039423795faaa1650

13 years agoMerge "Use the more pervasive /bin/sh instead." into dalvik-dev
Carl Shapiro [Tue, 22 Mar 2011 18:43:26 +0000 (11:43 -0700)]
Merge "Use the more pervasive /bin/sh instead." into dalvik-dev

13 years agoMerge "Make sure both options objects get created." into dalvik-dev
Dan Bornstein [Tue, 22 Mar 2011 03:54:32 +0000 (20:54 -0700)]
Merge "Make sure both options objects get created." into dalvik-dev

13 years agoMake sure both options objects get created.
Dan Bornstein [Tue, 22 Mar 2011 03:51:47 +0000 (20:51 -0700)]
Make sure both options objects get created.

Previously, the new DexOptions object would only get created when
calling dx as a command directly, but not when it was used as a
library (via a call to Main.run()).

Change-Id: Ie4f37ff9140539a4f2c7af50228ac6eaf6bebe05

13 years agoUse the more pervasive /bin/sh instead.
Carl Shapiro [Tue, 22 Mar 2011 03:09:32 +0000 (20:09 -0700)]
Use the more pervasive /bin/sh instead.

Because there is nothing bash specific in this file there is no
reason to specify that bash be used.

Change-Id: I41cdf4bcfa883d13bb75fffc61ad982252c936bc

13 years agoMerge "Add a missing strings.h include for strcasecmp." into dalvik-dev
Carl Shapiro [Tue, 22 Mar 2011 00:26:35 +0000 (17:26 -0700)]
Merge "Add a missing strings.h include for strcasecmp." into dalvik-dev

13 years agoAdd a missing strings.h include for strcasecmp.
Carl Shapiro [Tue, 22 Mar 2011 00:23:56 +0000 (17:23 -0700)]
Add a missing strings.h include for strcasecmp.

Change-Id: I06949c34d8ce0f48fa905d3a03d87de81e47e2f9

13 years agoMerge "Remove HeapWorker.h from Dalvik.h." into dalvik-dev
Carl Shapiro [Mon, 21 Mar 2011 23:47:54 +0000 (16:47 -0700)]
Merge "Remove HeapWorker.h from Dalvik.h." into dalvik-dev

13 years agoMerge "Remove TEST_VM_IN_ECLAIR." into dalvik-dev
Carl Shapiro [Mon, 21 Mar 2011 23:32:12 +0000 (16:32 -0700)]
Merge "Remove TEST_VM_IN_ECLAIR." into dalvik-dev

13 years agoRemove TEST_VM_IN_ECLAIR.
Carl Shapiro [Mon, 21 Mar 2011 23:25:34 +0000 (16:25 -0700)]
Remove TEST_VM_IN_ECLAIR.

Change-Id: I819a15680a50ea2d53fce6f8ebae01bc7d88fecb

13 years agoRemove HeapWorker.h from Dalvik.h.
Carl Shapiro [Mon, 21 Mar 2011 22:57:35 +0000 (15:57 -0700)]
Remove HeapWorker.h from Dalvik.h.

This is no longer a public interface.

Change-Id: I4830be24d5042d841796da14ea402a369c97a2e2

13 years agoMerge "Update version number." into dalvik-dev
Dan Bornstein [Mon, 21 Mar 2011 22:38:51 +0000 (15:38 -0700)]
Merge "Update version number." into dalvik-dev

13 years agoUpdate version number.
Dan Bornstein [Mon, 21 Mar 2011 22:33:59 +0000 (15:33 -0700)]
Update version number.

Change-Id: Id000377c913927e56a7e9e1732ff24f52bc25970

13 years agoMerge "Clarify the comments some more." into dalvik-dev
Dan Bornstein [Mon, 21 Mar 2011 22:31:30 +0000 (15:31 -0700)]
Merge "Clarify the comments some more." into dalvik-dev

13 years agoClarify the comments some more.
Dan Bornstein [Mon, 21 Mar 2011 22:31:04 +0000 (15:31 -0700)]
Clarify the comments some more.

Change-Id: I39e10b20e38f1792efa5dc4458c5cf0e8614f731

13 years agoMerge "Clarify / correct comments." into dalvik-dev
Dan Bornstein [Mon, 21 Mar 2011 22:19:45 +0000 (15:19 -0700)]
Merge "Clarify / correct comments." into dalvik-dev

13 years agoClarify / correct comments.
Dan Bornstein [Mon, 21 Mar 2011 22:19:11 +0000 (15:19 -0700)]
Clarify / correct comments.

Change-Id: I67861a0253a97a462be42cbd1b3c7ac02f8e5352

13 years agoMerge "Move finalization out of the VM." into dalvik-dev
Carl Shapiro [Mon, 21 Mar 2011 20:58:59 +0000 (13:58 -0700)]
Merge "Move finalization out of the VM." into dalvik-dev

13 years agoMove finalization out of the VM.
Carl Shapiro [Mon, 21 Mar 2011 20:35:24 +0000 (13:35 -0700)]
Move finalization out of the VM.

This change introduces a new reference class whose referent
points to instances requiring finalization.  This makes the
finalization of objects possible using a reference queue and
a dedicated thread which removes objects from the queue.

Change-Id: I0ff6dd272f00ca08c6ed3aa667bf766a039a944e

13 years agoAdd opcode-emission backward compatibility.
Dan Bornstein [Thu, 17 Mar 2011 01:00:19 +0000 (18:00 -0700)]
Add opcode-emission backward compatibility.

This makes it so that when you pass dx --target-api=N, where N is an
API level representing Honeycomb or earlier, dx will not emit any of
the new extended opcodes.

N is currently baked into the code as 12 or larger being
post-Honeycomb, but it is subject to change if there are more revs of
the API under the Honeycomb umbrella (which wouldn't be surprising).

Bug: 4094709
Change-Id: Iaf5177f179b22586bcf806ecb53de20b6e989777

13 years agoMerge "Extend a trace with a backward branch into a loop." into dalvik-dev
Ben Cheng [Sun, 20 Mar 2011 02:22:31 +0000 (19:22 -0700)]
Merge "Extend a trace with a backward branch into a loop." into dalvik-dev

13 years agoresolved conflicts for merge of 9553565f to dalvik-dev
buzbee [Sat, 19 Mar 2011 18:26:41 +0000 (11:26 -0700)]
resolved conflicts for merge of 9553565f to dalvik-dev

Change-Id: Id2bc916aa838d21f4d248206e5182b00bcd19791

13 years agoMerge "x86: restore standard stack frame layout and fix stack alignment."
Bill Buzbee [Sat, 19 Mar 2011 17:16:14 +0000 (10:16 -0700)]
Merge "x86: restore standard stack frame layout and fix stack alignment."

13 years agoExtend a trace with a backward branch into a loop.
Ben Cheng [Thu, 17 Mar 2011 00:19:06 +0000 (17:19 -0700)]
Extend a trace with a backward branch into a loop.

When seeing a trace that ends with a backward branch, exhaust all code
blocks reachable from that trace and try to identify if there exists a
non-nested loop. If the derived loop is found to be too complex or only
acyclic code is seen, revert to the original compilation mechanism to
translate a simple trace.

This CL uses the whole-method parser/dataflow analysis framework to
identify such loops. No optimization/codegen are performed yet.

Bug: 4086718

Change-Id: I19ed3ee53ea1cbda33940c533de8e9220e647156

13 years agoRemove an unused DalvikNativeMethod.
Elliott Hughes [Fri, 18 Mar 2011 17:57:13 +0000 (10:57 -0700)]
Remove an unused DalvikNativeMethod.

Bug: 3107501
Change-Id: I9aa3f8b87d7d6d7a4d02e2a4a75b539864c2d4eb

13 years agoam b4bb7f73: Add a \'dalvik\' shell script to launch dalvikvm on the host.
Jesse Wilson [Fri, 18 Mar 2011 00:31:21 +0000 (17:31 -0700)]
am b4bb7f73: Add a \'dalvik\' shell script to launch dalvikvm on the host.

* commit 'b4bb7f73210fef6c3e252e25970d7fdff1b04286':
  Add a 'dalvik' shell script to launch dalvikvm on the host.

13 years agoBug fix for dominance frontier calculation in SSA transformation.
Ben Cheng [Fri, 18 Mar 2011 00:17:42 +0000 (17:17 -0700)]
Bug fix for dominance frontier calculation in SSA transformation.

The comparison should be based on the immediate dominator instead of
the whole dominator set.

Change-Id: Id5130051f5dd13c3b486200c520fdc64d207c10e

13 years agoAdd a 'dalvik' shell script to launch dalvikvm on the host.
Jesse Wilson [Thu, 17 Mar 2011 23:58:18 +0000 (16:58 -0700)]
Add a 'dalvik' shell script to launch dalvikvm on the host.

Change-Id: I44ba2752b593a92c62872318cd8ac17185f52871
http://b/4128077

13 years agoMerge "Fix the order in which natives are registered." into dalvik-dev
Elliott Hughes [Thu, 17 Mar 2011 23:08:22 +0000 (16:08 -0700)]
Merge "Fix the order in which natives are registered." into dalvik-dev

13 years agoFix the order in which natives are registered.
Elliott Hughes [Thu, 17 Mar 2011 22:42:53 +0000 (15:42 -0700)]
Fix the order in which natives are registered.

All the core libraries want from JniHelp during registration is
jniRegisterNativeMethods. JniHelp, though, wants java.io.FileDescriptor from
the core libraries. So we should get to go first.

Bug: 3107501
Change-Id: I9604a3a04343c78577610aa7adf40a1f7d82eeeb

13 years agoMerge "Register allocator uses single reg for each local when possible." into dalvik-dev
jeffhao [Thu, 17 Mar 2011 20:26:43 +0000 (13:26 -0700)]
Merge "Register allocator uses single reg for each local when possible." into dalvik-dev

13 years agoAdd support for pre-dexed libraries to dx.
Jesse Wilson [Thu, 17 Mar 2011 02:38:47 +0000 (19:38 -0700)]
Add support for pre-dexed libraries to dx.

http://b/4090053

Change-Id: Ifb8b9230939cb2a72a767128f79cbfbd042e95a6

13 years agoRegister allocator uses single reg for each local when possible.
jeffhao [Thu, 17 Mar 2011 01:16:52 +0000 (18:16 -0700)]
Register allocator uses single reg for each local when possible.

Changes the register allocator to try much harder to map all SSA regs
associated with a local variable to the same register. Also, the
register allocator won't try to reuse parameter space for locals
like it used to, which would often lead to many unnecessary moves.

Change-Id: Ie012072015993204ef4b3f4e74a0eb94fdb10bc1

13 years agoMerge "Don't emit multiple copies of annotations when merging dex files." into dalvik-dev
Jesse Wilson [Thu, 17 Mar 2011 00:49:10 +0000 (17:49 -0700)]
Merge "Don't emit multiple copies of annotations when merging dex files." into dalvik-dev

13 years agoDon't emit multiple copies of annotations when merging dex files.
Jesse Wilson [Wed, 16 Mar 2011 21:22:51 +0000 (14:22 -0700)]
Don't emit multiple copies of annotations when merging dex files.

This change requires all annotations to be loaded into memory
so they can be sorted. There does not appear to be a required
order to the annotations in .dex files. Loading annotations also
requires loading encoded values, which makes this into a large
refactoring.

Change-Id: Ib7e2656c595018be4e9936eb84a22f1c1de56750
http://b/4090053

13 years agoMerge "Add --target-api=N option to dx." into dalvik-dev
Dan Bornstein [Wed, 16 Mar 2011 23:57:36 +0000 (16:57 -0700)]
Merge "Add --target-api=N option to dx." into dalvik-dev

13 years agoAdd --target-api=N option to dx.
Dan Bornstein [Wed, 16 Mar 2011 23:32:31 +0000 (16:32 -0700)]
Add --target-api=N option to dx.

This change adds the option and plumbs it into where it
needs to go, but doesn't add any code to take action on it.
That will come in a follow-up.

Bug: 4094709
Change-Id: I9c796e176e125b0bcee18af56d9e6da802dfa081

13 years agoMerge "Clean up ArrayStoreException some more." into dalvik-dev
Dan Bornstein [Wed, 16 Mar 2011 21:26:26 +0000 (14:26 -0700)]
Merge "Clean up ArrayStoreException some more." into dalvik-dev

13 years agoClean up ArrayStoreException some more.
Dan Bornstein [Wed, 16 Mar 2011 19:10:17 +0000 (12:10 -0700)]
Clean up ArrayStoreException some more.

Each of the four variants thrown by the VM now has a
descriptively-named function defined in Exception.c, and the messages
uniformly use human-oriented class names instead of the internal
"[[Lfoo/bar/Baz;" forms.

Bug: 3500987
Change-Id: I747315e36005c6d352116ce6a8af9d49c622f59a

13 years agoMerge "Update CheckJNI implementation" into dalvik-dev
Andy McFadden [Wed, 16 Mar 2011 19:03:35 +0000 (12:03 -0700)]
Merge "Update CheckJNI implementation" into dalvik-dev

13 years agoUpdate CheckJNI implementation
Andy McFadden [Wed, 16 Mar 2011 18:19:55 +0000 (11:19 -0700)]
Update CheckJNI implementation

This implements a couple of "TODO" items that affect CheckJNI and
indirect references.  It also adds guards that were missing around
some tests that examine objects on the heap.

Change-Id: If80d19dafb3043aa1a1d287a660ae48c86c4baa0

13 years agoCorrect the reported index.
Dan Bornstein [Wed, 16 Mar 2011 18:23:57 +0000 (11:23 -0700)]
Correct the reported index.

When asked to copy an incompatible reference, System.arraycopy() would
complain about the nth element it was to copy, and not the absolute
index of that element.

Change-Id: I0f4a159b96fbedf083c3add57d2e20ee750d70fe

13 years agoMerge "Clean up dvmFindReferenceMembers()." into dalvik-dev
Dan Bornstein [Wed, 16 Mar 2011 16:53:14 +0000 (09:53 -0700)]
Merge "Clean up dvmFindReferenceMembers()." into dalvik-dev