OSDN Git Service

android-x86/dalvik.git
13 years agoam 5945bc11: Merge "Optimize Class.getMethod() by loading only one method."
Jesse Wilson [Wed, 23 Feb 2011 21:44:21 +0000 (13:44 -0800)]
am 5945bc11: Merge "Optimize Class.getMethod() by loading only one method."

* commit '5945bc11f354083d24f952992dc579a1fd77dba8':
  Optimize Class.getMethod() by loading only one method.

13 years agoMerge "Factor out class names from throw statements." into dalvik-dev
Dan Bornstein [Wed, 23 Feb 2011 21:42:15 +0000 (13:42 -0800)]
Merge "Factor out class names from throw statements." into dalvik-dev

13 years agoFactor out class names from throw statements.
Dan Bornstein [Wed, 23 Feb 2011 21:07:07 +0000 (13:07 -0800)]
Factor out class names from throw statements.

Most exception throwing now happens via purpose-built wrapper
functions, each of which encapsulates the actual exception class name,
reducing one source of error (examples of which I fixed during this
exercise) and generally tidying things up.

This change doesn't fix all uses of exception class names, nor even
all throws, because (a) there were classes I didn't get to; (b)
because I didn't make wrappers for all the possible throw function
variants (e.g. the one that takes a cause, the one that takes varargs
for string formatting, etc.); and (c) there are uses of exception
classes in contexts other than throwing. But this change at least makes
a dent in the problem.

Change-Id: I6586ddd3e66ac0fc32c23181b17600ded0b914b2

13 years agoMerge "Optimize Class.getMethod() by loading only one method."
Jesse Wilson [Wed, 23 Feb 2011 21:32:57 +0000 (13:32 -0800)]
Merge "Optimize Class.getMethod() by loading only one method."

13 years agoOptimize Class.getMethod() by loading only one method.
Jesse Wilson [Wed, 23 Feb 2011 04:20:36 +0000 (20:20 -0800)]
Optimize Class.getMethod() by loading only one method.

Change-Id: Ia2cd776c0a14914264e8d94e978d55854ed75623
http://b/3431686

13 years agoam 636ed3eb: Bump Dalvik version.
Andy McFadden [Wed, 23 Feb 2011 05:33:24 +0000 (21:33 -0800)]
am 636ed3eb: Bump Dalvik version.

* commit '636ed3eba9e28d9630c8d8177b2ae601e7990f0e':
  Bump Dalvik version.

13 years agoRemove a comment about cloning partially initialized objects.
Carl Shapiro [Wed, 23 Feb 2011 00:51:27 +0000 (16:51 -0800)]
Remove a comment about cloning partially initialized objects.

The compiler and verifier should make this situation impossible.

Change-Id: I0be561108ff7ed221ab98172919c59e80a0365b7

13 years agoMerge "Added flags to dvmCloneObject" into dalvik-dev
Andy McFadden [Tue, 22 Feb 2011 22:26:27 +0000 (14:26 -0800)]
Merge "Added flags to dvmCloneObject" into dalvik-dev

13 years agoBump Dalvik version.
Andy McFadden [Tue, 22 Feb 2011 22:09:19 +0000 (14:09 -0800)]
Bump Dalvik version.

Minor increase to differentiate HC MR1 from HC.

Change-Id: I2ccd57d4952c19c2df2fe948ce60c476819450d4

13 years agoFix for 3477749 WITH_TRACKREF_CHECKS
buzbee [Tue, 22 Feb 2011 22:01:46 +0000 (14:01 -0800)]
Fix for 3477749 WITH_TRACKREF_CHECKS

Failed to specify grouping struct on access to debugTrackedRefStart
in recent InterpState/Thread consolidation.  Fixed.

Change-Id: Ib996b96fa1f322e3c433377bea79293eb984fca9

13 years agoAdded flags to dvmCloneObject
Andy McFadden [Tue, 22 Feb 2011 21:56:47 +0000 (13:56 -0800)]
Added flags to dvmCloneObject

Updated the call site to use "don't track".

Change-Id: Ibd4b5a9d93b0043c3906ad86b9ae19d1bf70541d

13 years agoMerge "Retain annotations when merging dex files." into dalvik-dev
Jesse Wilson [Tue, 22 Feb 2011 03:16:46 +0000 (19:16 -0800)]
Merge "Retain annotations when merging dex files." into dalvik-dev

13 years agoMerge "Interpreter restructuring: eliminate InterpState" into dalvik-dev
buzbee [Sun, 20 Feb 2011 17:41:25 +0000 (09:41 -0800)]
Merge "Interpreter restructuring: eliminate InterpState" into dalvik-dev

13 years agoInterpreter restructuring: eliminate InterpState
buzbee [Sat, 12 Feb 2011 01:48:20 +0000 (17:48 -0800)]
Interpreter restructuring: eliminate InterpState

The key datastructure for the interpreter is InterpState.
This change eliminates it, merging its data with the Thread structure.

Here's why:

In principio creavit Fadden Thread et InterpState.  And it was good.

Thread holds thread-private state, while InterpState captures data
associated with a Dalvik interpreter activation.  Because JNI calls
can result in nested interpreter invocations, we can have more than one
InterpState for each actual thread.  InterpState was relatively small,
and it all worked well.  It was used enough that in the Arm version
a register (rGLUE) was dedicated to it.

Then, along came the JIT guys, who saw InterpState as a convenient place
to dump all sorts of useful data that they wanted quick access to through
that dedicated register.  InterpState grew and grew.  In terms of
space, this wasn't a big problem - but it did mean that the initialization
cost of each interpreter activation grew as well.  For applications
that do a lot of callbacks from native code into Dalvik, this is
measurable.  It's also mostly useless cost because much of the JIT-related
InterpState initialization was setting up useful constants - things that
don't need to be saved and restored all the time.

The biggest problem, though, deals with thread control.  When something
interesting is happening that needs all threads to be stopped (such as
GC and debugger attach), we have access to all of the Thread structures,
but we don't have access to all of the InterpState structures (which
may be buried/nested on the native stack).  As a result, polling for
thread suspension is done via a one-indirection pointer chase.  InterpState
itself can't hold the stop bits because we can't always find it, so
instead it holds a pointer to the global or thread-specific stop control.

Yuck.

With this change, we eliminate InterpState and merge all needed data
into Thread.  Further, we replace the decidated rGLUE register with a
pointer to the Thread structure (rSELF).  The small subset of state
data that needs to be saved and restored across nested interpreter
activations is collected into a record that is saved to the interpreter
frame, and restored on exit.  Further, these small records are linked
together to allow tracebacks to show nested activations.  Old InterpState
variables that simply contain useful constants are initialized once at
thread creation time.

This CL is large enough by itself that the new ability to streamline
suspend checks is not done here - that will happen in a future CL.  Here
we just focus on consolidation.

Change-Id: Ide6b2fb85716fea454ac113f5611263a96687356

13 years agoRetain annotations when merging dex files.
Jesse Wilson [Sat, 19 Feb 2011 20:03:49 +0000 (12:03 -0800)]
Retain annotations when merging dex files.

This change has one major limitation: it doesn't deduplicate
equal annotation directories or annotation sets across dex
files. That will result in unnecessarily large dex files.

Change-Id: If63273d16eba1d989c6b5695d102b378d4047119
http://b/3447216

13 years agoam 6c360b86: Fix prelink for libdvm.
Ying Wang [Sat, 19 Feb 2011 01:25:54 +0000 (17:25 -0800)]
am 6c360b86: Fix prelink for libdvm.

* commit '6c360b86f5774376140636ff60ad4af3814fef21':
  Fix prelink for libdvm.

13 years agoFix an off-by-one error.
Elliott Hughes [Sat, 19 Feb 2011 01:09:20 +0000 (17:09 -0800)]
Fix an off-by-one error.

I can't believe I wrote this, but I can't find an original that would let me
pass this off as a copy & paste of someone else's bug.

Bug: 3471497
Change-Id: I40a33f62a1551147adaf8e3bdf0e796ab1918398

13 years agoFix prelink for libdvm.
Ying Wang [Sat, 19 Feb 2011 00:56:41 +0000 (16:56 -0800)]
Fix prelink for libdvm.

Change-Id: If91f46f80c1b1947683720e8187cecb0f7077b94
Bug: 3470019

13 years agoMerge "Remove system properties that are now handled in libcore." into dalvik-dev
Elliott Hughes [Fri, 18 Feb 2011 21:52:48 +0000 (13:52 -0800)]
Merge "Remove system properties that are now handled in libcore." into dalvik-dev

13 years agoMerge "Defer marking of objects as finalizable" into dalvik-dev
Andy McFadden [Fri, 18 Feb 2011 21:47:56 +0000 (13:47 -0800)]
Merge "Defer marking of objects as finalizable" into dalvik-dev

13 years agoDefer marking of objects as finalizable
Andy McFadden [Thu, 17 Feb 2011 00:50:40 +0000 (16:50 -0800)]
Defer marking of objects as finalizable

This shifts responsibility for marking an object as "finalizable" from
object creation to object initialization.  We want to make the object
finalizable when Object.<init> completes.  For performance reasons we
skip the call to the Object constructor (which doesn't do anything)
and just take the opportunity to check the class flag.

Handling of clone()d object isn't quite right yet.

Also, fixed a minor glitch in stubdefs.

Bug 3342343

Change-Id: I5b7b819079e5862dc9cbd1830bb445a852dc63bf

13 years agoMerge "[JIT] Fix profile trace dump" into dalvik-dev
buzbee [Fri, 18 Feb 2011 19:19:01 +0000 (11:19 -0800)]
Merge "[JIT] Fix profile trace dump" into dalvik-dev

13 years ago[JIT] Fix profile trace dump
buzbee [Fri, 18 Feb 2011 19:13:56 +0000 (11:13 -0800)]
[JIT] Fix profile trace dump

The debugging profile mode prints out a list of the top ten traces,
followed by recompilations.  In some cases, it is possible that a trace
was requested, but did not finish compiling before the run ended.  If
so, that could cause the dump to fail.  This CL adds a check for null
codeAddress to detect those cases.

Change-Id: I415fd94d8fa9e270f75d5114fa5cc5d993bd6997

13 years agoRemove system properties that are now handled in libcore.
Elliott Hughes [Fri, 18 Feb 2011 18:49:24 +0000 (10:49 -0800)]
Remove system properties that are now handled in libcore.

Change-Id: Ifc954f422fd73e7bd8ebbcc69f890d041acbc2e2

13 years agoMerge "Return unsigned shorts in ShortArrayCodeInput." into dalvik-dev
Jesse Wilson [Fri, 18 Feb 2011 06:38:33 +0000 (22:38 -0800)]
Merge "Return unsigned shorts in ShortArrayCodeInput." into dalvik-dev

13 years agoReturn unsigned shorts in ShortArrayCodeInput.
Jesse Wilson [Fri, 18 Feb 2011 03:16:28 +0000 (19:16 -0800)]
Return unsigned shorts in ShortArrayCodeInput.

Follow up to I9a77541b994f184da0e389840e5cac728ad6c072
http://b/3447216

Change-Id: I0746ab58aa765d83274931a95ecea0b56c3581d7

13 years agoMerge "This test stopped being useful quite a while ago." into dalvik-dev
Dan Bornstein [Thu, 17 Feb 2011 22:22:55 +0000 (14:22 -0800)]
Merge "This test stopped being useful quite a while ago." into dalvik-dev

13 years agoThis test stopped being useful quite a while ago.
Dan Bornstein [Thu, 17 Feb 2011 22:20:55 +0000 (14:20 -0800)]
This test stopped being useful quite a while ago.

Change-Id: I2069770f9b7456e4f3cde692d9a6b929ec7fe067

13 years agoPerform a bit of spec hygiene.
Dan Bornstein [Thu, 17 Feb 2011 20:47:58 +0000 (12:47 -0800)]
Perform a bit of spec hygiene.

Change-Id: Iabb7fa8ff20155a018d40bd2e23b21f19d14de1e

13 years agoMerge "Ensure we always call inline natives." into dalvik-dev
Elliott Hughes [Thu, 17 Feb 2011 00:12:03 +0000 (16:12 -0800)]
Merge "Ensure we always call inline natives." into dalvik-dev

13 years agoMerge "Add support to do suspend polling on backward branches in JIT'ed code." into...
Ben Cheng [Thu, 17 Feb 2011 00:02:33 +0000 (16:02 -0800)]
Merge "Add support to do suspend polling on backward branches in JIT'ed code." into dalvik-dev

13 years agoMerge "Fix for complex jsr nesting causing NullPointerException." into dalvik-dev
jeffhao [Wed, 16 Feb 2011 23:55:26 +0000 (15:55 -0800)]
Merge "Fix for complex jsr nesting causing NullPointerException." into dalvik-dev

13 years agoAdd support to do suspend polling on backward branches in JIT'ed code.
Ben Cheng [Thu, 3 Feb 2011 22:02:06 +0000 (14:02 -0800)]
Add support to do suspend polling on backward branches in JIT'ed code.

The polling is expensive for now as it is done through three
instructions: ld/ld/branch. As a result, a bunch of bonus stuff has
been worked on to mitigate the extra overhead:

- Cleaned up resource flags for memory disambiguation.
- Rewrote load/store elimination and scheduler routines to hide
  the ld/ld latency for GC flag. Seperate the dependency checking into
  memory disambiguation part and resource conflict part.
- Allowed code motion for Dalvik/constant/non-aliasing loads to be
  hoisted above branches for null/range checks.
- Created extended basic blocks following goto instructions so that
  longer instruction streams can be optimized as a whole.

Without the bonus stuff, the performance dropped about ~5-10% on some
benchmarks because of the lack of headroom to hide the polling latency
in tight loops. With the bonus stuff, the performance delta is between
+/-5% with polling code generated. With the bonus stuff but disabling
polling, the new bonus stuff provides consistent performance
improvements:

CaffeineMark  3.6%
Linpack      11.1%
Scimark       9.7%
Sieve        33.0%
Checkers      6.0%

As a result, GC polling is disabled by default but can be turned on
through the -Xjitsuspendpoll flag for experimental purposes.

Change-Id: Ia81fc85de3e2b70e6cc93bc37c2b845892003cdb

13 years agoEnsure we always call inline natives.
Elliott Hughes [Wed, 16 Feb 2011 22:30:45 +0000 (14:30 -0800)]
Ensure we always call inline natives.

Even though execute-inline is now a mandatory optimization, you can't be sure
the inline natives will be invoked that way. There's reflection and JNI, for
example, and there's the special case of String.equals that might be invoked
as Object.equals. This patch adds a regular native method corresponding to
each inline native, so that a corresponding libcore patch can drop its
implementations. (For example, despite the fact that we all believed last week
that the Java implementation of String.equals is never used, that turned out
not to be true: every HashMap lookup will have used it. This pair of patches
brings reality in line with our existing belief.)

Change-Id: I19e64c23bea83e91696206ca40ce4e3faf853040

13 years agoam ce0503dc: Clean up use of HAVE_ANDROID_OS
Kenny Root [Wed, 16 Feb 2011 20:46:00 +0000 (12:46 -0800)]
am ce0503dc: Clean up use of HAVE_ANDROID_OS

* commit 'ce0503dc677442f37b04277d888599d2cdb50ad6':
  Clean up use of HAVE_ANDROID_OS

13 years agoMerge "Emit compact ouput .dex files." into dalvik-dev
Jesse Wilson [Wed, 16 Feb 2011 19:29:32 +0000 (11:29 -0800)]
Merge "Emit compact ouput .dex files." into dalvik-dev

13 years agoEmit compact ouput .dex files.
Jesse Wilson [Wed, 16 Feb 2011 02:28:53 +0000 (18:28 -0800)]
Emit compact ouput .dex files.

Change-Id: I69ca23b53a542db7e7a18d819795e795bf0822c0
http://b/3447216

13 years agoClean up use of HAVE_ANDROID_OS
Kenny Root [Wed, 16 Feb 2011 18:15:52 +0000 (10:15 -0800)]
Clean up use of HAVE_ANDROID_OS

HAVE_ANDROID_OS was defined as "1" for targets, but never defined as "0"
for non-targets. Changing them to #ifdef should be safe and matches all
the other uses of HAVE_ANDROID_OS throughout the system.

Change-Id: I077aee39b08ce82327a571d9aca0cae422a0ebb5

13 years agoMerge "Barrier after construction of finalizable object" into dalvik-dev
Andy McFadden [Wed, 16 Feb 2011 15:54:43 +0000 (07:54 -0800)]
Merge "Barrier after construction of finalizable object" into dalvik-dev

13 years agoMerge "Fix some asm .size directives" into dalvik-dev
Andy McFadden [Wed, 16 Feb 2011 15:54:17 +0000 (07:54 -0800)]
Merge "Fix some asm .size directives" into dalvik-dev

13 years agoFix some asm .size directives
Andy McFadden [Tue, 15 Feb 2011 23:46:36 +0000 (15:46 -0800)]
Fix some asm .size directives

We were missing a .size directive for dvmPlatformInvoke, and the
directive for the mterp handlers wasn't being handled right.  Threw
in a bonus directive for the entry point and the "assist debugger"
stuff that wraps method calls.

Bug 3456786

Change-Id: Ideee64a496e54eb09008410e9e9eba652b59f403

13 years agoMerge "Use memchr to scan the card table." into dalvik-dev
Carl Shapiro [Tue, 15 Feb 2011 23:37:02 +0000 (15:37 -0800)]
Merge "Use memchr to scan the card table." into dalvik-dev

13 years agoUse memchr to scan the card table.
Carl Shapiro [Tue, 15 Feb 2011 23:19:13 +0000 (15:19 -0800)]
Use memchr to scan the card table.

Change-Id: I8066b2818d360d3f383d1b90bbbea0b2983d4519

13 years agoBarrier after construction of finalizable object
Andy McFadden [Tue, 15 Feb 2011 15:48:05 +0000 (07:48 -0800)]
Barrier after construction of finalizable object

If thread 1 creates an object, and thread 2 executes the finalizer,
then thread 2 must be guaranteed to see a fully-constructed object.
To this end, we need to emit a store/store barrier before returning
from the object's constructor.

We already do this for objects with final fields, so this is a
minor tweak.

While working on this I noticed that Enum overrides finalize()
(for the explicit purpose of making sure that no subclass can do
so), which the VM was taking as a signal that all enumerated types
are finalizable.  In practice this doesn't matter, since the only
instances are the enum elements themselves, and we'd only GC them
if the enum class itself went away.  However, setting it correctly
means less work for dexopt and has no measurable impact on class
loading time.

Bug 3403518

Change-Id: Ifa890b5e7ef1cda2a554ba54f25c4148272c3537

13 years agoFix for complex jsr nesting causing NullPointerException.
jeffhao [Tue, 15 Feb 2011 22:41:45 +0000 (14:41 -0800)]
Fix for complex jsr nesting causing NullPointerException.

Happens when one jsr calls another that ultimates throws an exception.
The subroutine inliner assumes the return block of the first jsr is
reachable when it's not, causing access to a null field.  Fixed by
checking the field for null before accessing it.

Change-Id: Id1fb376c9f14ffebc77cdbd253a713eb6d949c1f

13 years agoDeduplicate type lists on merged .dex files.
Jesse Wilson [Tue, 15 Feb 2011 22:21:05 +0000 (14:21 -0800)]
Deduplicate type lists on merged .dex files.

Change-Id: Ic089fecebb66544dfdb422421cce47a6f203a31a
http://b/3447216

13 years agoMerge "Fix some bugs in the new dx instruction code." into dalvik-dev
Jesse Wilson [Tue, 15 Feb 2011 19:10:13 +0000 (11:10 -0800)]
Merge "Fix some bugs in the new dx instruction code." into dalvik-dev

13 years agoFix some bugs in the new dx instruction code.
Jesse Wilson [Tue, 15 Feb 2011 03:01:34 +0000 (19:01 -0800)]
Fix some bugs in the new dx instruction code.

http://b/3447216

Change-Id: I9a77541b994f184da0e389840e5cac728ad6c072

13 years agoMerge "Remove spurious code from bad merge/pilot error" into dalvik-dev
buzbee [Tue, 15 Feb 2011 18:40:49 +0000 (10:40 -0800)]
Merge "Remove spurious code from bad merge/pilot error" into dalvik-dev

13 years agoRemove spurious code from bad merge/pilot error
buzbee [Tue, 15 Feb 2011 18:29:38 +0000 (10:29 -0800)]
Remove spurious code from bad merge/pilot error

Looks like I spuriously duplicated two lines of assembly code in
footer.S around a call to method profiling.  Removed.

Change-Id: I0b10656e15eba0d16af8784ae9ca09c33b5096c0

13 years agoresolved conflicts for merge of 6e2af6d2 to dalvik-dev
Andy McFadden [Mon, 14 Feb 2011 22:44:35 +0000 (14:44 -0800)]
resolved conflicts for merge of 6e2af6d2 to dalvik-dev

Change-Id: Ib5ec0912c0c5d7041b794351fcca10c41c4294ec

13 years agoFix "all stubs" interpreter
Andy McFadden [Mon, 14 Feb 2011 22:04:42 +0000 (14:04 -0800)]
Fix "all stubs" interpreter

The "all stubs" interpreter is the recommended starting point for
anyone creating a "fast" interpreter on a new CPU.  This cleans
up some minor bit rot in the code and documentation.

Bug 3452689

Change-Id: I6bc3b0b5da11955d842d5fc5f16cb1a2209d4a89

13 years agoMerge "Remove gclog.py" into dalvik-dev
Andy McFadden [Mon, 14 Feb 2011 21:02:19 +0000 (13:02 -0800)]
Merge "Remove gclog.py" into dalvik-dev

13 years agoRemove gclog.py
Andy McFadden [Mon, 14 Feb 2011 20:29:38 +0000 (12:29 -0800)]
Remove gclog.py

The GC event log entries are no longer generated, so we no longer
need this.

Change-Id: I247bbc44d628ac5e54dfe031d09eb14edbff8d4d

13 years agoMerge "Add scheduling barrier at the end of IT blocks for FP comparisons." into dalvi...
Ben Cheng [Mon, 14 Feb 2011 18:02:04 +0000 (10:02 -0800)]
Merge "Add scheduling barrier at the end of IT blocks for FP comparisons." into dalvik-dev

13 years agoFix to allow SCCP to correctly propagate division and remainer ops.
jeffhao [Fri, 11 Feb 2011 23:43:07 +0000 (15:43 -0800)]
Fix to allow SCCP to correctly propagate division and remainer ops.

Also updated expected values for the const collector test.

Change-Id: Iedcf17d776c60cb6174f7a7c9f75be84d2c38020

13 years agoAdd scheduling barrier at the end of IT blocks for FP comparisons.
Ben Cheng [Sat, 12 Feb 2011 01:01:08 +0000 (17:01 -0800)]
Add scheduling barrier at the end of IT blocks for FP comparisons.

Bug: 3448446
Change-Id: I98e2bbc4886443ba3c27c2963d7540fcee5790bb

13 years agoMerge "Rename invoke-direct-empty to invoke-object-init" into dalvik-dev
Andy McFadden [Sat, 12 Feb 2011 00:00:54 +0000 (16:00 -0800)]
Merge "Rename invoke-direct-empty to invoke-object-init" into dalvik-dev

13 years agoRename invoke-direct-empty to invoke-object-init
Andy McFadden [Fri, 11 Feb 2011 23:26:10 +0000 (15:26 -0800)]
Rename invoke-direct-empty to invoke-object-init

The invoke-direct-empty instruction was introduced to remove the
overhead of calling the empty Object constructor.  We now need it
to do some extra work on behalf of object construction, so it's
appropriate to change the instruction name to match the role it
fills rather than the more general role it was hoped to fill.

No functional changes.

Bug 3342343

Change-Id: I65dd6a2c00c99581c9a19b16fe193b70642c8fbb

13 years agoFast fail impossible allocations.
Carl Shapiro [Fri, 11 Feb 2011 00:46:55 +0000 (16:46 -0800)]
Fast fail impossible allocations.

If the size_t type cannot be used to represent any component of an
array size the allocation is be rejected.  With this change, overflow
is checked for in the element size computation and total array size
computation.  More preconditions are checked by asserts.  Misleading
comments have been removed.

Change-Id: I067869c3404b9da591939555c6f9904f52ca7bd7

13 years agoEnsure a dalvik-cache directory exists before running dalvik.
Carl Shapiro [Fri, 11 Feb 2011 20:06:33 +0000 (12:06 -0800)]
Ensure a dalvik-cache directory exists before running dalvik.

The dalvik tests require a dalvik-cache directory otherwise dalvikvm
will fail with an unhelpful error message.  On the device it is safe
to assume a dalvik-cache directory exists but this is not a safe
assumption on the host.  With this change the script tries to create a
dalvik-cache directory on the host if it does not exist.

Change-Id: Ie0c69ff8dcd68b6b04a763f06861edd308406f69

13 years agoMerge "Fix an out-of-date comment." into dalvik-dev
Elliott Hughes [Thu, 10 Feb 2011 23:47:58 +0000 (15:47 -0800)]
Merge "Fix an out-of-date comment." into dalvik-dev

13 years agoMerge "Tweak the 64-bit load/store code" into dalvik-dev
Andy McFadden [Thu, 10 Feb 2011 23:47:57 +0000 (15:47 -0800)]
Merge "Tweak the 64-bit load/store code" into dalvik-dev

13 years agoTweak the 64-bit load/store code
Andy McFadden [Thu, 10 Feb 2011 23:32:16 +0000 (15:32 -0800)]
Tweak the 64-bit load/store code

The old version would either move data through a union, call memcpy(),
or just cast the pointer to a wider type and dereference it.  The
latter turns out to be an aliasing violation, and it recently started
causing test failures on the "host" build.

We now use memcpy() for x86 and unions for ARM.

Bug 3431820

Change-Id: I302a7f49f7ae88ac96b8f7fef3d9260ac64d631b

13 years agoFix an out-of-date comment.
Elliott Hughes [Thu, 10 Feb 2011 23:25:04 +0000 (15:25 -0800)]
Fix an out-of-date comment.

Change-Id: Ie3a93604533e9dab59e892506e2c0258d046837b

13 years agoMerge "Move more system propery handling into managed code." into dalvik-dev
Elliott Hughes [Thu, 10 Feb 2011 22:21:44 +0000 (14:21 -0800)]
Merge "Move more system propery handling into managed code." into dalvik-dev

13 years agoMove more system propery handling into managed code.
Elliott Hughes [Thu, 10 Feb 2011 20:03:34 +0000 (12:03 -0800)]
Move more system propery handling into managed code.

Bug: 3413364
Change-Id: I044ed1b11e919bb1c589c626b613faf85157fb64

13 years agoMerge "Reverting SCCP change to division because the system doesn't start." into...
jeffhao [Thu, 10 Feb 2011 21:02:51 +0000 (13:02 -0800)]
Merge "Reverting SCCP change to division because the system doesn't start." into dalvik-dev

13 years agoReverting SCCP change to division because the system doesn't start.
jeffhao [Thu, 10 Feb 2011 20:46:14 +0000 (12:46 -0800)]
Reverting SCCP change to division because the system doesn't start.

Temporarily reverting change to allow the system to boot while the
root cause is determined.

Change-Id: Ife1fb6fc99fead9eb72fff8415969fc4955ff7cd

13 years agoMerge "Added support for integer division to SCCP." into dalvik-dev
jeffhao [Thu, 10 Feb 2011 17:52:00 +0000 (09:52 -0800)]
Merge "Added support for integer division to SCCP." into dalvik-dev

13 years agoAdded support for integer division to SCCP.
jeffhao [Thu, 10 Feb 2011 02:29:00 +0000 (18:29 -0800)]
Added support for integer division to SCCP.

Division generates a result that must be fetched with a
move-result-pseudo instruction. SCCP originally had no way of tying the
division with the result it generates. This change should allow proper
constant propagation when division of integers is involved.

Change-Id: Ib7c5d2dd26eea3ab6545b613a540f0161a8e1642

13 years agoMerge "Move more system property handling into managed code." into dalvik-dev
Elliott Hughes [Thu, 10 Feb 2011 01:29:30 +0000 (17:29 -0800)]
Merge "Move more system property handling into managed code." into dalvik-dev

13 years agoMove more system property handling into managed code.
Elliott Hughes [Thu, 10 Feb 2011 00:52:36 +0000 (16:52 -0800)]
Move more system property handling into managed code.

Bug: 3413364
Change-Id: I0f22ea9ed5327e4fef9d4395025173a839ea9ce2

13 years agoMerge "Split addNewHeap into separate definitions." into dalvik-dev
Carl Shapiro [Thu, 10 Feb 2011 00:41:57 +0000 (16:41 -0800)]
Merge "Split addNewHeap into separate definitions." into dalvik-dev

13 years agoSplit addNewHeap into separate definitions.
Carl Shapiro [Thu, 10 Feb 2011 00:36:12 +0000 (16:36 -0800)]
Split addNewHeap into separate definitions.

Change-Id: I47c4edb8dddf1e8c256ff2def7045fa236b5b1fd

13 years agoMerge "Remove the unused argument to dvmCollectGarbage." into dalvik-dev
Carl Shapiro [Wed, 9 Feb 2011 23:35:43 +0000 (15:35 -0800)]
Merge "Remove the unused argument to dvmCollectGarbage." into dalvik-dev

13 years agoMerge "SCCP propagates more constants and prunes unexecuted paths from branches....
jeffhao [Wed, 9 Feb 2011 22:44:40 +0000 (14:44 -0800)]
Merge "SCCP propagates more constants and prunes unexecuted paths from branches." into dalvik-dev

13 years agoSCCP propagates more constants and prunes unexecuted paths from branches.
jeffhao [Tue, 8 Feb 2011 01:48:13 +0000 (17:48 -0800)]
SCCP propagates more constants and prunes unexecuted paths from branches.

The SCCP pass now more aggressively propagates constant values through
the code.  Combined with changes to the LiteralOpUpgrader, instructions
with known constant results will be replaced with a simple const
instruction.

In addition, the SCCP pass can now find branches with constant conditions
and remove the branch path that never ends up being executed. Because of
the way finally blocks end up being replicated, this tends to prune away
error handling when no exception occurs, and hard code error handling
when an exception happens.

Change-Id: I6f3330151ec387c8a1e7ce098ff6cdb8d0ce5606

13 years agoRemove the unused argument to dvmCollectGarbage.
Carl Shapiro [Wed, 9 Feb 2011 22:20:14 +0000 (14:20 -0800)]
Remove the unused argument to dvmCollectGarbage.

Change-Id: Id7bf60b99b33cb8f058f9a500dc63cfe01b8e3c2

13 years agoRemove the private CLZ implementation in the GC.
Carl Shapiro [Wed, 9 Feb 2011 03:54:55 +0000 (19:54 -0800)]
Remove the private CLZ implementation in the GC.

This was a hold over from a time when the compiler did not properly
support the CLZ intrinsic.

Change-Id: I224481868c8d6fd3e0382d9cde3a2ffd02cfd39c

13 years agoMerge "Move the duplicated alignment macros to a common location." into dalvik-dev
Carl Shapiro [Wed, 9 Feb 2011 21:30:40 +0000 (13:30 -0800)]
Merge "Move the duplicated alignment macros to a common location." into dalvik-dev

13 years agoMerge "Replace dvmValidateObject with ordinary null pointer checks." into dalvik-dev
Carl Shapiro [Wed, 9 Feb 2011 21:30:24 +0000 (13:30 -0800)]
Merge "Replace dvmValidateObject with ordinary null pointer checks." into dalvik-dev

13 years agoMerge "Let tryMalloc field over-sized allocation errors." into dalvik-dev
Carl Shapiro [Wed, 9 Feb 2011 21:28:42 +0000 (13:28 -0800)]
Merge "Let tryMalloc field over-sized allocation errors." into dalvik-dev

13 years agoMerge "Add huge-array OOM test" into dalvik-dev
Andy McFadden [Wed, 9 Feb 2011 21:21:26 +0000 (13:21 -0800)]
Merge "Add huge-array OOM test" into dalvik-dev

13 years agoAdd huge-array OOM test
Andy McFadden [Wed, 9 Feb 2011 21:12:36 +0000 (13:12 -0800)]
Add huge-array OOM test

Added a regression test for allocation of 4GB+ arrays.

Change-Id: Ibac82bbba9ef25b0850386a35e0f5b8554abbaa3

13 years agoMerge "Misc goodies in the JIT in preparation for more aggressive code motion." into...
Ben Cheng [Wed, 9 Feb 2011 18:04:12 +0000 (10:04 -0800)]
Merge "Misc goodies in the JIT in preparation for more aggressive code motion." into dalvik-dev

13 years agoam 6f562a3a: Merge "Make Release(JNI_COMMIT) faster"
Andy McFadden [Wed, 9 Feb 2011 16:24:13 +0000 (08:24 -0800)]
am 6f562a3a: Merge "Make Release(JNI_COMMIT) faster"

* commit '6f562a3aee2b866d1f8a8a5773d81e0593069b3e':
  Make Release(JNI_COMMIT) faster

13 years agoam 81abf28f: Remove JNI_FORCE_C
Andy McFadden [Wed, 9 Feb 2011 16:24:07 +0000 (08:24 -0800)]
am 81abf28f: Remove JNI_FORCE_C

* commit '81abf28f00ba97fdf6b085d1d91a5e73f9a1e799':
  Remove JNI_FORCE_C

13 years agoMerge "Make Release(JNI_COMMIT) faster"
Andy McFadden [Wed, 9 Feb 2011 16:10:49 +0000 (08:10 -0800)]
Merge "Make Release(JNI_COMMIT) faster"

13 years agoLet tryMalloc field over-sized allocation errors.
Carl Shapiro [Wed, 9 Feb 2011 04:41:28 +0000 (20:41 -0800)]
Let tryMalloc field over-sized allocation errors.

Change-Id: I691b8eeca74b7e018f86753b00b7f117d5872916

13 years agoReplace dvmValidateObject with ordinary null pointer checks.
Carl Shapiro [Wed, 9 Feb 2011 04:19:17 +0000 (20:19 -0800)]
Replace dvmValidateObject with ordinary null pointer checks.

Change-Id: I8eddca7fac83e014d591bdd06ce2df634672243f

13 years agoMove the duplicated alignment macros to a common location.
Carl Shapiro [Wed, 9 Feb 2011 04:10:56 +0000 (20:10 -0800)]
Move the duplicated alignment macros to a common location.

Change-Id: I11cb1c3034a3a4e7d8e8c0793f5c85fa623155b2

13 years agoMerge "Relocate the always in-lined functions from HeapBitmap.h." into dalvik-dev
Carl Shapiro [Wed, 9 Feb 2011 02:16:51 +0000 (18:16 -0800)]
Merge "Relocate the always in-lined functions from HeapBitmap.h." into dalvik-dev

13 years agoRelocate the always in-lined functions from HeapBitmap.h.
Carl Shapiro [Wed, 9 Feb 2011 01:43:43 +0000 (17:43 -0800)]
Relocate the always in-lined functions from HeapBitmap.h.

The three essential bitmap access methods have been moved to the new
HeapBitmapInlines.h header file.  All other bitmap methods have been
moved into HeapBitmap.c.  As an added bonus, source indexing and cross
reference tools should correctly locate all heap bitmap definitions.

Change-Id: I35703403f4f79d121c9c3f411b7d7110d92739d0

13 years agoMisc goodies in the JIT in preparation for more aggressive code motion.
Ben Cheng [Wed, 9 Feb 2011 01:09:25 +0000 (17:09 -0800)]
Misc goodies in the JIT in preparation for more aggressive code motion.

- Set up resource masks correctly for Thumb push/pop when LR/PC are involved.
- Preserve LR around simulated heap references under self-verification mode.
- Compact a few simple flags in ArmLIR into bit fields.
- Minor performance tuning in TEMPLATE_MEM_OP_DECODE

Change-Id: Id73edac837c5bb37dfd21f372d6fa21c238cf42a

13 years agoMake Release(JNI_COMMIT) faster
Andy McFadden [Wed, 9 Feb 2011 00:24:34 +0000 (16:24 -0800)]
Make Release(JNI_COMMIT) faster

The Release<primitive>ArrayElements and ReleasePrimitiveArrayCritical
calls take a "mode" argument.  If you pass in JNI_COMMIT, the storage
isn't actually released; instead, the buffer contents are flushed to
the backing storage.  If the VM has handed you a pointer to the raw
data rather than a copy, the call is a no-op.

In its present incarnation, it's a no-op that changes the thread state,
adding overhead and the possibility of suspension.  This change moves
the test for JNI_COMMIT outside the enter/exit macros.

Bug 3430203

Change-Id: I8426647ee02b2336c5c90146028fc207cfbacc3a

13 years agoRemove JNI_FORCE_C
Andy McFadden [Wed, 9 Feb 2011 00:12:33 +0000 (16:12 -0800)]
Remove JNI_FORCE_C

This hasn't been useful in a really long time.

Change-Id: Ieea01f5d051bc8fc671f7414af3bed626ece75f1

13 years agoam 1fbcc3ad: Merge "Added JNI hack to support JNI hack"
Andy McFadden [Wed, 9 Feb 2011 00:05:45 +0000 (16:05 -0800)]
am 1fbcc3ad: Merge "Added JNI hack to support JNI hack"

* commit '1fbcc3ad1344f6997f34db0ab8296b0867c84b71':
  Added JNI hack to support JNI hack

13 years agoMerge "Added JNI hack to support JNI hack"
Andy McFadden [Wed, 9 Feb 2011 00:03:05 +0000 (16:03 -0800)]
Merge "Added JNI hack to support JNI hack"

13 years agoAdded JNI hack to support JNI hack
Andy McFadden [Tue, 8 Feb 2011 20:07:32 +0000 (12:07 -0800)]
Added JNI hack to support JNI hack

Some of our graphics code wants to get a pointer, release it, and then
continue to use it.  The "forcecopy" mode of CheckJNI was designed
to find any code that does this.  It succeeded.

To support the behavior, we provide a JNI helper function that does
the dirty work.  It passes a magic value into the Get and Release calls
that causes "forcecopy" to skip the copy.  When forcecopy is not
enabled, the values are simply ignored.

To avoid any possibility of the function getting published in the NDK,
the function is not described in JNIHelp.h.

Bug 3409356

Change-Id: Ibd20d12ba6d3d3236ebf5760f7ccaa8c557e3774