OSDN Git Service

android-x86/dalvik.git
13 years agoCompile libdex as C++.
Dan Bornstein [Thu, 14 Apr 2011 20:08:06 +0000 (13:08 -0700)]
Compile libdex as C++.

The major-looking code changes were all just to unravel some gotos.

Change-Id: I86f98a48b160f357ce93c87446bad5d705d5f05b

13 years agoAdd a class flag CLASS_ISCLASS.
Dan Bornstein [Tue, 12 Apr 2011 00:08:20 +0000 (17:08 -0700)]
Add a class flag CLASS_ISCLASS.

This flag is only turned on for the unique class Class, and it is
meant to make it possible to quickly test objects for "classiness" as
well as trivially figure out if one is looking at the class Class
itself.

Bonus: Made a few places that directly set class->accessFlags use
the prescribed macro for doing same.

Change-Id: I89fce708c407b597f28ce610b778123f5dcaecf6

13 years agoMerge "Move the reflection code into C++." into dalvik-dev
Carl Shapiro [Wed, 13 Apr 2011 22:40:58 +0000 (15:40 -0700)]
Merge "Move the reflection code into C++." into dalvik-dev

13 years agoam e7147462: Fix debugger performance regression
buzbee [Wed, 13 Apr 2011 22:39:45 +0000 (15:39 -0700)]
am e7147462: Fix debugger performance regression

* commit 'e71474621b968a9bc649d067155d31213f5764a9':
  Fix debugger performance regression

13 years agoMove the reflection code into C++.
Carl Shapiro [Wed, 13 Apr 2011 22:15:55 +0000 (15:15 -0700)]
Move the reflection code into C++.

Smart pointers would make dvmGenerateProxyClass cleaner.  This code should
be revisited once those interfaces come into existence.

Change-Id: If25abb87e22d658ad88f997324c35703b23f623c

13 years agoFix debugger performance regression
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

13 years agoConvert the internal and in-line natives to C++.
Carl Shapiro [Wed, 13 Apr 2011 02:14:06 +0000 (19:14 -0700)]
Convert the internal and in-line natives to C++.

Change-Id: I2ece682bc3b4d3b55ab27c60fd84a0b3243d7ca6

13 years agoMerge "Add additional asserts and combine declarations with definitions." into dalvik-dev
Carl Shapiro [Mon, 11 Apr 2011 22:29:57 +0000 (15:29 -0700)]
Merge "Add additional asserts and combine declarations with definitions." into dalvik-dev

13 years agoAdd additional asserts and combine declarations with definitions.
Carl Shapiro [Mon, 11 Apr 2011 22:09:05 +0000 (15:09 -0700)]
Add additional asserts and combine declarations with definitions.

Change-Id: Ibdc37f3d7eb6385da1059d5525727b090626ec4c

13 years agoam 0161e158: Merge "Add missing JUMBO opcodes to volatile rewriting"
buzbee [Mon, 11 Apr 2011 21:24:19 +0000 (14:24 -0700)]
am 0161e158: Merge "Add missing JUMBO opcodes to volatile rewriting"

* commit '0161e1582b13173cc5a125cf504fd7714c9c82b2':
  Add missing JUMBO opcodes to volatile rewriting

13 years agoMerge "Add missing JUMBO opcodes to volatile rewriting"
buzbee [Mon, 11 Apr 2011 21:20:45 +0000 (14:20 -0700)]
Merge "Add missing JUMBO opcodes to volatile rewriting"

13 years agoam 5867bea1: [JIT] Close code cache race window
buzbee [Mon, 11 Apr 2011 21:19:06 +0000 (14:19 -0700)]
am 5867bea1: [JIT] Close code cache race window

* commit '5867bea193779ff3009738513bae9bc84f4a34aa':
  [JIT] Close code cache race window

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

13 years ago[JIT] Close code cache race window
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

13 years agoDx block dumper no longer fails on abstract and native methods.
jeffhao [Mon, 11 Apr 2011 19:52:55 +0000 (12:52 -0700)]
Dx block dumper no longer fails on abstract and native methods.

Change-Id: I3bad07a1621c0ef4bc495816b2438cab9401a828

13 years agoam 8d6291cc: Merge "[JIT] Fix volatile test"
buzbee [Sat, 9 Apr 2011 01:03:48 +0000 (18:03 -0700)]
am 8d6291cc: Merge "[JIT] Fix volatile test"

* commit '8d6291cce6ff3c9a3010f3725563983847370df7':
  [JIT] Fix volatile test

13 years agoMerge "[JIT] Fix volatile test"
buzbee [Sat, 9 Apr 2011 01:01:17 +0000 (18:01 -0700)]
Merge "[JIT] Fix volatile test"

13 years ago[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

13 years agoam 2336a395: Merge "Add jniThrowExceptionFmt."
Elliott Hughes [Sat, 9 Apr 2011 00:29:11 +0000 (17:29 -0700)]
am 2336a395: Merge "Add jniThrowExceptionFmt."

* commit '2336a3953305b2fe3e59b850d2e5804c86e818dd':
  Add jniThrowExceptionFmt.

13 years agoMerge "Add jniThrowExceptionFmt."
Elliott Hughes [Sat, 9 Apr 2011 00:20:54 +0000 (17:20 -0700)]
Merge "Add jniThrowExceptionFmt."

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

13 years agoMerge "Fix for loops and eliminate some other undesirable idioms." into dalvik-dev
Carl Shapiro [Fri, 8 Apr 2011 23:44:40 +0000 (16:44 -0700)]
Merge "Fix for loops and eliminate some other undesirable idioms." into dalvik-dev

13 years agoFix for loops and eliminate some other undesirable idioms.
Carl Shapiro [Fri, 8 Apr 2011 23:40:54 +0000 (16:40 -0700)]
Fix for loops and eliminate some other undesirable idioms.

Previously, we were using a non-standard C dialect which did not permit
the nicer variable scoping in loops.  Now that we are using C++ in the
collector we can guarantee that feature is available.  This change also
rearranges some of the surrounding code to take advantage of the more
flexible scoping rules.

Change-Id: I9be35794cc12bcbc0d5299fe387d4bc406481075

13 years agoam f1b53179: Merge "Fix method profiling [issue 4260697]"
buzbee [Fri, 8 Apr 2011 22:48:46 +0000 (15:48 -0700)]
am f1b53179: Merge "Fix method profiling [issue 4260697]"

* commit 'f1b531793e65fda22818d8dca8b17f94f618ad64':
  Fix method profiling [issue 4260697]

13 years agoMerge "Fix method profiling [issue 4260697]"
buzbee [Fri, 8 Apr 2011 22:45:13 +0000 (15:45 -0700)]
Merge "Fix method profiling [issue 4260697]"

13 years agoam 80d118ae: Revert "[JIT] Fix volatile test" - breaks build
Joe Onorato [Fri, 8 Apr 2011 22:36:31 +0000 (15:36 -0700)]
am 80d118ae: Revert "[JIT] Fix volatile test" - breaks build

* commit '80d118aefbba31b7658299bf19f5ca72473390cd':
  Revert "[JIT] Fix volatile test" - breaks build

13 years agoMerge "Updated dx to emit rsub instructions whenever it can." into dalvik-dev
jeffhao [Fri, 8 Apr 2011 22:33:36 +0000 (15:33 -0700)]
Merge "Updated dx to emit rsub instructions whenever it can." into dalvik-dev

13 years agoRevert "[JIT] Fix volatile test" - breaks build
Joe Onorato [Fri, 8 Apr 2011 22:32:34 +0000 (15:32 -0700)]
Revert "[JIT] Fix volatile test" - breaks build

This reverts commit 11fb99d598ebe640719743a0d3bd7ed091e5be03.

13 years agoFix method profiling [issue 4260697]
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

13 years agoUpdated dx to emit rsub instructions whenever it can.
jeffhao [Fri, 8 Apr 2011 22:18:26 +0000 (15:18 -0700)]
Updated dx to emit rsub instructions whenever it can.

Change-Id: I148c03fdc19dde8aece448e288d3c963490c9d0f

13 years agoam 11fb99d5: [JIT] Fix volatile test
buzbee [Fri, 8 Apr 2011 22:06:03 +0000 (15:06 -0700)]
am 11fb99d5: [JIT] Fix volatile test

* commit '11fb99d598ebe640719743a0d3bd7ed091e5be03':
  [JIT] Fix volatile test

13 years ago[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: If485875c5abbf0147c3ef4b6d557faa89ed85426

13 years agoam 9688de1e: Bug fix for rsubs being improperly generated.
jeffhao [Fri, 8 Apr 2011 21:24:13 +0000 (14:24 -0700)]
am 9688de1e: Bug fix for rsubs being improperly generated.

* commit '9688de1ebc68f4f865a827709298390a72dff698':
  Bug fix for rsubs being improperly generated.

13 years agoBug fix for rsubs being improperly generated.
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

13 years agoMerge "Bug fix for rsubs being improperly generated." into dalvik-dev
jeffhao [Fri, 8 Apr 2011 20:28:33 +0000 (13:28 -0700)]
Merge "Bug fix for rsubs being improperly generated." into dalvik-dev

13 years agoCompile the garbage collector and heap profiler as C++.
Carl Shapiro [Fri, 8 Apr 2011 20:11:58 +0000 (13:11 -0700)]
Compile the garbage collector and heap profiler as C++.

Change-Id: I25d8fa821987a3dd6d7109d07fd42dbf2fe0e589

13 years agoBug fix for rsubs being improperly generated.
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.

Change-Id: I6dd2c7a5bb82294ee5f88ba41191e473133ed847

13 years agoam 2f5e3cb2: Merge "Scale the card count by bits per byte to derive a bit vector...
Carl Shapiro [Thu, 7 Apr 2011 23:41:38 +0000 (16:41 -0700)]
am 2f5e3cb2: Merge "Scale the card count by bits per byte to derive a bit vector length."

* commit '2f5e3cb20ed3fa00e474fb4813f2c1f46d04afd4':
  Scale the card count by bits per byte to derive a bit vector length.

13 years agoMerge "Scale the card count by bits per byte to derive a bit vector length."
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."

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

13 years agoam feeceefb: Merge "Improve JNI indirect ref diagnostics"
Andy McFadden [Thu, 7 Apr 2011 22:14:59 +0000 (15:14 -0700)]
am feeceefb: Merge "Improve JNI indirect ref diagnostics"

* commit 'feeceefbbe44a53e3d02812a126f93d3ef8ec37b':
  Improve JNI indirect ref diagnostics

13 years agoMerge "Improve JNI indirect ref diagnostics"
Andy McFadden [Thu, 7 Apr 2011 21:45:06 +0000 (14:45 -0700)]
Merge "Improve JNI indirect ref diagnostics"

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

13 years agoam afe002d1: Update the interpretation of --target-api.
Dan Bornstein [Thu, 7 Apr 2011 18:07:23 +0000 (11:07 -0700)]
am afe002d1: Update the interpretation of --target-api.

* commit 'afe002d1474d7c2ef2ac80de32f21f1949af2a41':
  Update the interpretation of --target-api.

13 years agoUpdate the interpretation of --target-api.
Dan Bornstein [Thu, 7 Apr 2011 17:41:09 +0000 (10:41 -0700)]
Update the interpretation of --target-api.

Change-Id: I4ab158384d09470d84097d944ae1ddadeb2ad045

13 years agoMerge "Fix some stale docs references." into dalvik-dev
Dan Bornstein [Tue, 5 Apr 2011 22:18:51 +0000 (15:18 -0700)]
Merge "Fix some stale docs references." into dalvik-dev

13 years agoFix some stale docs references.
Dan Bornstein [Tue, 5 Apr 2011 22:17:25 +0000 (15:17 -0700)]
Fix some stale docs references.

Change-Id: I3b58dfd05a63671cf315698247d88e67528e118d

13 years agoam a4a19037: Fix x86 fast interpreter
buzbee [Tue, 5 Apr 2011 18:10:41 +0000 (11:10 -0700)]
am a4a19037: Fix x86 fast interpreter

* commit 'a4a19037f75e0e3c85fb5f3c7fa31732f8475719':
  Fix x86 fast interpreter

13 years agoFix x86 fast interpreter
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

13 years agoNormalize loop exit condition before checking counted loops
Ben Cheng [Mon, 4 Apr 2011 23:06:22 +0000 (16:06 -0700)]
Normalize loop exit condition before checking counted loops

The loop exit condition for a simple one like "for (i=0; i<10; i++)"
can be done as
    - i<10
    - 10>i
    - !(i>=10)
    - !(10<=i)

This change normalizes the loop exit condition as if the exit path
is always on the taken direction of the branch. Doing so enables the
discovery of more counted loops without complicating the detecton logic.

Change-Id: I06f428334d4f1ca00d229fe76c282c6f161e8912

13 years agoMerge "Stop logging a couple of messages" into dalvik-dev
Andy McFadden [Mon, 4 Apr 2011 20:33:37 +0000 (13:33 -0700)]
Merge "Stop logging a couple of messages" into dalvik-dev

13 years agoStop logging a couple of messages
Andy McFadden [Mon, 4 Apr 2011 20:25:49 +0000 (13:25 -0700)]
Stop logging a couple of messages

These used to be uncommon, now they're not.

Change-Id: Ibab0c94b183cf969836277e6bc29b0ef3eba3a86

13 years agoMerge "Fix JNI GetStaticFieldID" into dalvik-dev
Andy McFadden [Mon, 4 Apr 2011 19:59:22 +0000 (12:59 -0700)]
Merge "Fix JNI GetStaticFieldID" into dalvik-dev

13 years agoam 8b94be1f: [JIT] Rely on the opcode only to determine volatile
buzbee [Mon, 4 Apr 2011 19:40:13 +0000 (12:40 -0700)]
am 8b94be1f: [JIT] Rely on the opcode only to determine volatile

* commit '8b94be1f80b135e7a5c1f542861f3e80c4c52823':
  [JIT] Rely on the opcode only to determine volatile

13 years agoFix JNI GetStaticFieldID
Andy McFadden [Mon, 4 Apr 2011 19:27:38 +0000 (12:27 -0700)]
Fix JNI GetStaticFieldID

GetStaticFieldID wasn't searching into the superclasses.

Bug 4205860

Change-Id: Ide89b61ad8ed42c10c160968f5cce745d9f0eefe

13 years ago[JIT] Rely on the opcode only to determine volatile
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

13 years agoam 1d41040a: Merge "Do not emit the write barrier when storing to primitive volatile...
Bill Buzbee [Mon, 4 Apr 2011 19:18:12 +0000 (12:18 -0700)]
am 1d41040a: Merge "Do not emit the write barrier when storing to primitive volatile fields."

* commit '1d41040ad8175f89f1c19a4dfbaf6ae47baf7947':
  Do not emit the write barrier when storing to primitive volatile fields.

13 years agoam c26cd1ae: Merge "Fix sizing of the modunion table on small heaps"
Brian Carlstrom [Mon, 4 Apr 2011 19:15:17 +0000 (12:15 -0700)]
am c26cd1ae: Merge "Fix sizing of the modunion table on small heaps"

* commit 'c26cd1ae75aa947b452ebe208b1ceaa06f292378':
  Fix sizing of the modunion table on small heaps

13 years agoMerge "Do not emit the write barrier when storing to primitive volatile fields."
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."

13 years agoMerge "Fix sizing of the modunion table on small heaps"
Brian Carlstrom [Mon, 4 Apr 2011 19:09:03 +0000 (12:09 -0700)]
Merge "Fix sizing of the modunion table on small heaps"

13 years agoam 552cacb8: Include strings.h for the ffs prototype.
Carl Shapiro [Mon, 4 Apr 2011 19:08:56 +0000 (12:08 -0700)]
am 552cacb8: Include strings.h for the ffs prototype.

* commit '552cacb8aef667fec06196e6d33d2d81177a61fb':
  Include strings.h for the ffs prototype.

13 years agoDo not emit the write barrier when storing to primitive volatile fields.
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

13 years agoFix sizing of the modunion table on small heaps
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

13 years agoInclude strings.h for the ffs prototype.
Carl Shapiro [Mon, 4 Apr 2011 18:33:00 +0000 (11:33 -0700)]
Include strings.h for the ffs prototype.

Change-Id: I70a4dc5c8d9015cfc069611b7eba0860bb37a8d7

13 years agoMerge "Size the jni local references table to avoid resizing at startup." into dalvik-dev
Carl Shapiro [Mon, 4 Apr 2011 18:16:53 +0000 (11:16 -0700)]
Merge "Size the jni local references table to avoid resizing at startup." into dalvik-dev

13 years agoMerge "Do not emit the write barrier when storing to primitive volatile fields."...
Bill Buzbee [Mon, 4 Apr 2011 17:51:28 +0000 (10:51 -0700)]
Merge "Do not emit the write barrier when storing to primitive volatile fields." into dalvik-dev

13 years agoSize the jni local references table to avoid resizing at startup.
Carl Shapiro [Mon, 4 Apr 2011 17:43:02 +0000 (10:43 -0700)]
Size the jni local references table to avoid resizing at startup.

Change-Id: Ief382b9acb0fa6ce1e0371ecbb7d86f7059102d8

13 years agoDo not emit the write barrier when storing to primitive volatile fields.
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: I7700523250d8f63f0b9aa153d0f5f42fdbf3d64f

13 years agoUse x86 variant in dalvik for TARGET_ARCH_VARIANT=x86-atom
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

13 years agoMerge remote branch 'goog/dalvik-dev' into dalvik-dev-to-master
Brian Carlstrom [Fri, 1 Apr 2011 22:05:18 +0000 (15:05 -0700)]
Merge remote branch 'goog/dalvik-dev' into dalvik-dev-to-master

13 years agoChange the tread state before acquiring the code cache lock.
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

13 years agoMerge "[JIT] Clear inCodeCacheFlag on extended singlestep" into dalvik-dev
buzbee [Thu, 31 Mar 2011 22:44:23 +0000 (15:44 -0700)]
Merge "[JIT] Clear inCodeCacheFlag on extended singlestep" into dalvik-dev

13 years ago[JIT] Clear inCodeCacheFlag on extended singlestep
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

13 years agoMerge "Generate code for loops formed with the new builder" into dalvik-dev
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

13 years agoMerge "Delegate the queuing of cleared references to managed code." 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

13 years agoGenerate code for loops formed with the new builder
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

13 years agoMerge "Add missing JUMBO ops [fixed]" into dalvik-dev
buzbee [Thu, 31 Mar 2011 18:20:47 +0000 (11:20 -0700)]
Merge "Add missing JUMBO ops [fixed]" into dalvik-dev

13 years agoAdd missing JUMBO ops [fixed]
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

13 years agoMerge "Improve diagnostics when non-String passed as a jstring." into dalvik-dev
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

13 years agoImprove diagnostics when non-String passed as a jstring.
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)

13 years agoMerge "Add missing JUMBO ops to JIT" into dalvik-dev
buzbee [Thu, 31 Mar 2011 18:03:07 +0000 (11:03 -0700)]
Merge "Add missing JUMBO ops to JIT" into dalvik-dev

13 years agoAdd missing JUMBO ops to JIT
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

13 years agoAdd missing jumbo opcodes to the self verification exclusion list
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

13 years agoDelegate the queuing of cleared references to managed code.
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

13 years agoMerge "Update a test to handle a different anonymous class name." into dalvik-dev
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

13 years agoUpdate a test to handle a different anonymous class name.
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

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