Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit 9f640af99bebc6e96f6e1e9903557e2c8f567483
- Author: Jeff Brown <jeffbrown@android.com>
- Date: Tue Jul 19 19:01:05 2011 -0700
- Add a dual clock profiler tracing mode.
- Dalvik previously supported using either the thread-cpu clock
- or the real time clock as the timebase for profiler traces.
- This change adds a dual clock mode where both thread-cpu time
- and real time timestamps are collected.
- Using dual clock mode significantly improves TraceView ability
- to accurately reconstruct the global timeline of events,
- particularly on SMP systems.
- For now, thread-cpu mode remains the default.
- Dual clock mode can be enabled by running the following command
- and restarting the system server.
- adb shell setprop dalvik.vm.extra-opts -Xprofile:dualclock
- Change-Id: I14db2ae93325ac01efcc8ed02e8747cc0e834e29
- commit 949c3ec207a7720fb47f7b3ca1f84dfcfd70aaa9
- Author: Jeff Brown <jeffbrown@google.com>
- Date: Fri Jun 24 17:05:33 2011 -0700
- Add a dual clock profiler tracing mode.
- Dalvik previously supported using either the thread-cpu clock
- or the real time clock as the timebase for profiler traces.
- This change adds a dual clock mode where both thread-cpu time
- and real time timestamps are collected.
- Using dual clock mode significantly improves TraceView ability
- to accurately reconstruct the global timeline of events,
- particularly on SMP systems.
- For now, thread-cpu mode remains the default.
- Dual clock mode can be enabled by running the following command
- and restarting the system server.
- adb shell setprop dalvik.vm.extra-opts -Xprofile:dualclock
- Change-Id: I8c0d91a99aa6829dadea328e54dc1225d9827391
- commit 62fe4c1e9fc28254d357e9755cf4bd2138753c17
- Author: buzbee <buzbee@google.com>
- Date: Mon Apr 11 14:07:34 2011 -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
- commit e3c0b54b3f653eb9000116ec1fa18349e0f1ed9c
- Author: buzbee <buzbee@google.com>
- Date: Thu Apr 7 15:22:06 2011 -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
- commit 11fb99d598ebe640719743a0d3bd7ed091e5be03
- Author: buzbee <buzbee@google.com>
- Date: Thu Apr 7 15:22:06 2011 -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
- commit 9ef5ca666a214f2a96b16e0830e19d37742ab8ca
- Author: Andy McFadden <fadden@android.com>
- Date: Tue Oct 5 17:02:54 2010 -0700
- Change handling of edge case.
- Generally speaking, you can't create an instance of a class before
- the class is initialized. When you're talking about java.lang.Class
- itself, this doesn't apply. We were trying to sneak in a just-in-time
- initialization, but the recent addition of SMP-mandated opcode rewrites
- screwed things up a bit.
- Happily, the creation of the java.lang.Class class object now happens
- at a known time, which means we can explicitly initialize the class
- at the right time (when it's far enough along to be able to execute
- the class initializer, but before anything tries to use a virtual
- method or instance field in java.lang.Class).
- Also, changed a LOGE+abort to a simple assert. The test in question is
- performed earlier during linking, so this doesn't merit more than an
- assertion.
- Bug 3045762.
- Change-Id: Ifffb5083a3de108e1d91b3de7b75fd5e97705912
- commit 9ff5624e8dbd056d2373b3322da42c268d99e45b
- Merge: 790d7a4 6b2897b
- Author: Dan Bornstein <danfuzz@android.com>
- Date: Thu Sep 30 19:22:39 2010 -0700
- am 6b2897b6: am 2428d518: am f45b6cbe: Be explicit about both uniprocessor and SMP when calling dexopt.
- Merge commit '6b2897b60410c540ee5686a2e85eb46386f9f745' into dalvik-dev
- * commit '6b2897b60410c540ee5686a2e85eb46386f9f745':
- Be explicit about both uniprocessor and SMP when calling dexopt.
- commit 6b2897b60410c540ee5686a2e85eb46386f9f745
- Merge: 19e8f00 2428d51
- Author: Dan Bornstein <danfuzz@android.com>
- Date: Thu Sep 30 18:11:15 2010 -0700
- am 2428d518: am f45b6cbe: Be explicit about both uniprocessor and SMP when calling dexopt.
- Merge commit '2428d518efb9b5a62d74f44a267f3a6c18982549'
- * commit '2428d518efb9b5a62d74f44a267f3a6c18982549':
- Be explicit about both uniprocessor and SMP when calling dexopt.
- commit d8b5f50d0c6c9a0ce157e89df4ee1e8eb8b334c3
- Author: Andy McFadden <fadden@android.com>
- Date: Thu Sep 30 14:02:54 2010 -0700
- Correct dexopt for uniprocessors.
- The SMP flag was defaulting to "true" for dexopt, even on uniprocessors.
- With this change the VM now has three choices: dexopt for SMP, dexopt
- for uniprocessor, or dexopt for current system. The last is used for
- just-in-time dexopt (used by -eng and -userdebug builds on bootstrap DEX
- files) and installd dexopt (used for apps on all builds).
- The dexopt used by the build system during -user builds will either be
- explicitly SMP or explicitly uniprocessor, since "current system" has
- no meaning when you're cross-dexopting.
- Also, unified the dexopt control flags into a single enum.
- (cherry-pick from dalvik-dev)
- Change-Id: Id1d9c548ca8567585a28ef9ee911cc2ac6b116dd
- commit 2428d518efb9b5a62d74f44a267f3a6c18982549
- Merge: f37569d f45b6cb
- Author: Dan Bornstein <danfuzz@android.com>
- Date: Thu Sep 30 15:11:27 2010 -0700
- am f45b6cbe: Be explicit about both uniprocessor and SMP when calling dexopt.
- Merge commit 'f45b6cbed6ce7cb6a38746b5abe0213263106a71' into gingerbread-plus-aosp
- * commit 'f45b6cbed6ce7cb6a38746b5abe0213263106a71':
- Be explicit about both uniprocessor and SMP when calling dexopt.
- commit b91b37eb8b8746d1057dd86ed3835de824439e65
- Author: Andy McFadden <fadden@android.com>
- Date: Thu Sep 30 14:02:54 2010 -0700
- Correct dexopt for uniprocessors.
- The SMP flag was defaulting to "true" for dexopt, even on uniprocessors.
- With this change the VM now has three choices: dexopt for SMP, dexopt
- for uniprocessor, or dexopt for current system. The last is used for
- just-in-time dexopt (used by -eng and -userdebug builds on bootstrap DEX
- files) and installd dexopt (used for apps on all builds).
- The dexopt used by the build system during -user builds will either be
- explicitly SMP or explicitly uniprocessor, since "current system" has
- no meaning when you're cross-dexopting.
- Also, unified the dexopt control flags into a single enum.
- Change-Id: I02e22d53ccde2e8603cac8090ca3aae59f792f70
- commit f45b6cbed6ce7cb6a38746b5abe0213263106a71
- Author: Dan Bornstein <danfuzz@android.com>
- Date: Thu Sep 30 15:04:34 2010 -0700
- Be explicit about both uniprocessor and SMP when calling dexopt.
- Change-Id: Ic1b68dddf6822773041de6023c594a062e141325
- commit 70f9cc618a16272def098ed021bfd41798a2e3d2
- Merge: 434cc5e d53caae
- Author: Dan Bornstein <danfuzz@android.com>
- Date: Tue Sep 28 23:43:34 2010 -0700
- am d53caae3: am b3a94965: am 148283d7: Plumb SMP optimization control through to dexopt.
- Merge commit 'd53caae351e40f877a7bcf592a31594ac2be9691' into dalvik-dev
- * commit 'd53caae351e40f877a7bcf592a31594ac2be9691':
- Plumb SMP optimization control through to dexopt.
- commit 87f666172f55863d6a50762a1a07a31b67eb48f6
- Author: Dan Bornstein <danfuzz@android.com>
- Date: Tue Sep 28 18:53:28 2010 -0700
- Add --uniprocessor option to dex-preopt.
- This tells the preoptimizer to target a uniprocessor (unsurprisingly).
- By default, it targets SMP, which makes it do more changes than it has
- to for a uniprocessor (e.g. editing how non-wide volatile fields are
- accessed within bytecode). To be clear, when SMP-optimized code is run
- on a uniprocessor, it should still work. We're just aiming to only
- make truly necessary changes during optimization.
- While I was in the territory, I went ahead and cleaned up some single
- vs. double quote hygiene in the file.
- Change-Id: Ia45992939a436d0be6db8363c43d430de4acb80b
- commit d53caae351e40f877a7bcf592a31594ac2be9691
- Merge: 481c253 b3a9496
- Author: Dan Bornstein <danfuzz@android.com>
- Date: Tue Sep 28 18:40:01 2010 -0700
- am b3a94965: am 148283d7: Plumb SMP optimization control through to dexopt.
- Merge commit 'b3a949656a773953a44b148a6cdcba19f1c48e87'
- * commit 'b3a949656a773953a44b148a6cdcba19f1c48e87':
- Plumb SMP optimization control through to dexopt.
- commit b3a949656a773953a44b148a6cdcba19f1c48e87
- Merge: 6311482 148283d
- Author: Dan Bornstein <danfuzz@android.com>
- Date: Tue Sep 28 18:37:39 2010 -0700
- am 148283d7: Plumb SMP optimization control through to dexopt.
- Merge commit '148283d71a7e35b9b506cbb49294b6822719c25e' into gingerbread-plus-aosp
- * commit '148283d71a7e35b9b506cbb49294b6822719c25e':
- Plumb SMP optimization control through to dexopt.
- commit 148283d71a7e35b9b506cbb49294b6822719c25e
- Author: Dan Bornstein <danfuzz@android.com>
- Date: Tue Sep 28 15:46:54 2010 -0700
- Plumb SMP optimization control through to dexopt.
- Change-Id: I3bfaf6723e7b14d001f9de60cc1c1fd4f8e1ed99
- commit 1df319e3674d993a07bc0ff1f56a5915410b5903
- Author: Andy McFadden <fadden@android.com>
- Date: Wed Sep 15 13:40:01 2010 -0700
- Use store barrier instead of full barrier.
- Make use of ANDROID_MEMBAR_STORE when appropriate. In mterp, define a
- new SMP_DMB_ST macro that will (soon) expand into "dmb st" on ARMv7-A
- platforms configured for SMP.
- Bug 3003477.
- Change-Id: I03c09e93e1374d1c668588c9ad52f5c08d3d2435
- commit 52b31dfea16f5a7b7bffddf65b493336ef0befee
- Author: Andy McFadden <fadden@android.com>
- Date: Tue Sep 14 16:23:49 2010 -0700
- Stop cheating in reflective field access.
- The java.lang.reflect.Field get/set calls have been "cheating" by
- reading and writing 32-bit or 64-bit values without regard to the
- underlying field type. This worked fine until recently, when we
- developed three special cases:
- (1) writing to a reference field (must notify the GC)
- (2) reading/writing a volatile field (must emit barrier on SMP,
- and 64-bit accesses must be atomic on all platforms)
- (3) writing to a final field (must emit barrier on SMP)
- This replaces the old "get a pointer and do stuff" approach with a
- bunch of switch statements that call the ObjectInlines functions.
- Bug 2992610
- Change-Id: Ib30f043d325363743112e9b1bb170d9d232bca6b
- commit 3f4b63f47f50f200538e83fa3fac06947afa08b4
- Author: Andy McFadden <fadden@android.com>
- Date: Mon Sep 13 14:04:02 2010 -0700
- Emit return-void-barrier when appropriate.
- If SMP is enabled, and we're optimizing a constructor, and the
- class in question has final fields, we replace all occurrences of
- "return-void" with "return-void-barrier".
- This is an "essential" optimization for SMP, meaning it will be done
- regardless of the verification/optimization settings.
- Also, split the updateCode() helper function into two versions (one
- to update the whole 16-bit code unit, one to replace just the opcode).
- Also, make the presence of a duplicate class in the bootstrap class
- path a failure for optimization as well as verification. Otherwise,
- if you have "-Xdexopt:all", you could end up trying to optimize a
- class loaded from a bootstrap DEX file, which doesn't work well
- since those classes are mapped read-only in dexopt.
- Bug 2965743.
- Change-Id: I29e67133731b59beb6af5003f3cd69302c5c20f5
- commit 291758c5c4902900c6f86794ba8ab9cad9b26197
- Author: Andy McFadden <fadden@android.com>
- Date: Fri Sep 10 08:04:52 2010 -0700
- Add return-void-barrier instruction.
- This introduces the return-void-barrier instruction, which is identical
- to return-void on UP systems, but provides an additional store/store
- barrier on SMP. This is intended for use in constructors of objects
- with final fields.
- The assembler doesn't like "dmb st", and we don't have an
- ANDROID_MEMBAR_STORE barrier defined, so this currently uses full
- fences.
- This just defines the new instruction. It's not actually used yet.
- Also, removed some stale "unused" files from the x86 and x86-atom
- directories.
- Bug 2965743.
- Change-Id: I072e372fd2d57f2617a8d4fff5fd4b38bdda75d1
- commit f862759a5e82f3ddaeb5f32352b4d58c4b2312db
- Merge: a3096e3 fb12fb3
- Author: Andy McFadden <fadden@android.com>
- Date: Thu Sep 9 16:28:43 2010 -0700
- am fb12fb32: am fdc9cfa3: am 139bd978: Added "dexopt for SMP" flag.
- Merge commit 'fb12fb3242e8735e07e1a4583517f2e36a79b200' into dalvik-dev
- * commit 'fb12fb3242e8735e07e1a4583517f2e36a79b200':
- Added "dexopt for SMP" flag.
- commit fb12fb3242e8735e07e1a4583517f2e36a79b200
- Merge: 611f0c0 fdc9cfa
- Author: Andy McFadden <fadden@android.com>
- Date: Thu Sep 9 16:19:42 2010 -0700
- am fdc9cfa3: am 139bd978: Added "dexopt for SMP" flag.
- Merge commit 'fdc9cfa3bcf418d59c47a8d114ec84452b2f1d11'
- * commit 'fdc9cfa3bcf418d59c47a8d114ec84452b2f1d11':
- Added "dexopt for SMP" flag.
- commit fdc9cfa3bcf418d59c47a8d114ec84452b2f1d11
- Merge: 070fcec 139bd97
- Author: Andy McFadden <fadden@android.com>
- Date: Thu Sep 9 16:16:57 2010 -0700
- am 139bd978: Added "dexopt for SMP" flag.
- Merge commit '139bd97804a69634e7c4cecf06910a050a4ac093' into gingerbread-plus-aosp
- * commit '139bd97804a69634e7c4cecf06910a050a4ac093':
- Added "dexopt for SMP" flag.
- commit 139bd97804a69634e7c4cecf06910a050a4ac093
- Author: Andy McFadden <fadden@android.com>
- Date: Thu Sep 9 12:54:43 2010 -0700
- Added "dexopt for SMP" flag.
- Currently, dexopt always runs on the target device, which means that
- decisions about whether or not to convert certain opcodes to SMP-safe
- variants could be made based on #ifdefs.
- Since we are planning to run dexopt on the host, we need to be able
- to configure SMP-mode independently. This change adds a global variable
- that the dexopt code can check.
- There is currently no command-line argument to set this, since it will
- be set by "dexopt" rather than "dalvikvm", and the exact method of
- launching dexopt from the host build is still mildly TBD.
- Bug 2981136.
- (cherry-pick from dalvik-dev)
- Change-Id: I7474f79a25368223ecf1e491458f4a82e85db01f
- commit c58b9ef90319c4edad93300151c088434092e9e0
- Author: Andy McFadden <fadden@android.com>
- Date: Thu Sep 9 12:54:43 2010 -0700
- Added "dexopt for SMP" flag.
- Currently, dexopt always runs on the target device, which means that
- decisions about whether or not to convert certain opcodes to SMP-safe
- variants could be made based on #ifdefs.
- Since we are planning to run dexopt on the host, we need to be able
- to configure SMP-mode independently. This change adds a global variable
- that the dexopt code can check.
- There is currently no command-line argument to set this, since it will
- be set by "dexopt" rather than "dalvikvm", and the exact method of
- launching dexopt from the host build is still mildly TBD.
- Bug 2981136.
- Change-Id: If20aa6f513896fd8b35394388eaca6214f0449a7
- commit 042876deaa858c1087285366db0a4971917a431e
- Merge: a18a796 39796a6
- Author: Brian Carlstrom <bdc@google.com>
- Date: Tue Aug 24 09:03:08 2010 -0700
- am 39796a6a: am 30febfdf: Merge remote branch \'goog/dalvik-dev\' into dalvik-dev-to-gingerbread
- Merge commit '39796a6aa79f687ac0b1254f6a8be048ad1243d8'
- * commit '39796a6aa79f687ac0b1254f6a8be048ad1243d8': (26 commits)
- Remove an assertion that cannot be guaranteed.
- Always support debugging and profiling.
- Fix a critical space leak introduced by concurrent sweeping.
- Add a little bit of paranoia to the odex data reader.
- Nudge a couple of log messages.
- Fix build breakage caused by the countInstancesOfClass change.
- Add a method for counting the extant instances of a class.
- Added fsync call to dexopt.
- JIT: Fix for armv5te-VFP bug [Issue 2916682]
- Cast to a byte pointer before performing arithmetic.
- Limit scanning to cards within the committed region of the heap.
- Remove a malfunctioning predicate used only in assertions.
- Remove debugging code and stale comments from the sweep callback.
- Fix build breakage caused by a bad merge from master.
- JIT: Correct conversion of cb[n]z to cmp/cond_br pair
- Print callee information in the JIT profile outout
- JIT: Fix for lightweight assembler retry mechanism.
- JIT: Fix for 2898397 assert in JIT (chain cell offset)
- More SMP fixes.
- Fix some potential SMP issues.
- ...
- commit f16cfefc199d1416c5f83446c1d299786accc737
- Author: Andy McFadden <fadden@android.com>
- Date: Wed Aug 18 15:51:37 2010 -0700
- Properly handle volatile field accesses from JNI.
- For uniprocessors, we need to use the 64-bit quasiatomic functions. For
- SMP, we need to do that and also issue barriers on all operations.
- This was mostly a matter of adding a bunch of inline getter/setter
- functions and then calling the right one based on whether or not the
- field is declared volatile.
- Also, corrected the output for a failing CHECK_CLASS test in CheckJNI.
- Bug 2890631.
- (cherry-pick from dalvik-dev)
- Change-Id: I3da3b70c906eddd5934347caea83ab041d22cd68
- commit 9197746491686dd774d556d28a82c5b6e0ff7b09
- Author: Andy McFadden <fadden@android.com>
- Date: Wed Aug 18 15:51:37 2010 -0700
- Properly handle volatile field accesses from JNI.
- For uniprocessors, we need to use the 64-bit quasiatomic functions. For
- SMP, we need to do that and also issue barriers on all operations.
- This was mostly a matter of adding a bunch of inline getter/setter
- functions and then calling the right one based on whether or not the
- field is declared volatile.
- Also, corrected the output for a failing CHECK_CLASS test in CheckJNI.
- Bug 2890631.
- Change-Id: Ib18ed1ce136eef03120ae70cacc39aa33df1490a
- commit 77aa7adc7a9ac30351b8ee6f8d8162032f1ef61a
- Merge: 89c7943 3469a7e
- Author: Andy McFadden <fadden@android.com>
- Date: Fri Aug 6 11:26:45 2010 -0700
- Merge "Fix some potential SMP issues." into dalvik-dev
- commit fc3d31683a0120ba005f45f98dcbe1001064dafb
- Author: Andy McFadden <fadden@android.com>
- Date: Thu Aug 5 14:34:26 2010 -0700
- More SMP fixes.
- Convert some ANDROID_MEMBAR_FULL uses into equivalent atomic ops. A
- couple of "bool" had to convert to "int" since we don't have atomic
- ops for bools.
- Replaced a local implementation of atomic inc with a call to the
- atomic inc function.
- Change-Id: I948b8080d743552bde014d3a6e716ed2c30ebef8
- commit 3469a7e404591fe158a60b4d05b0f2c768bcfce2
- Author: Andy McFadden <fadden@android.com>
- Date: Wed Aug 4 16:09:10 2010 -0700
- Fix some potential SMP issues.
- Wandered through Thread.c looking for SMP trouble spots. Changed a
- couple of stores to android_atomic_release_store, and added some
- comments.
- Also, wrapped the self-suspend stuff that's in the thread status change
- code so it only happens if we're actually going to suspend the thread.
- Change-Id: I2d3feae7ce8937eada9111bd31928b61875a86d3
- commit 917cbaab38a29fb3e92682235c640c27fa4a41e8
- Merge: b67b034 35ff69b
- Author: buzbee <buzbee@google.com>
- Date: Thu Jul 29 14:34:33 2010 -0700
- am 35ff69be: JIT: temporarily disable the JIT and concurrent GC on SMP systems
- Merge commit '35ff69be47f3f2bd33f2a2d8562eaa2ac3dc9f1d' into dalvik-dev
- * commit '35ff69be47f3f2bd33f2a2d8562eaa2ac3dc9f1d':
- JIT: temporarily disable the JIT and concurrent GC on SMP systems
- commit 35ff69be47f3f2bd33f2a2d8562eaa2ac3dc9f1d
- Author: buzbee <buzbee@google.com>
- Date: Thu Jul 29 13:17:35 2010 -0700
- JIT: temporarily disable the JIT and concurrent GC on SMP systems
- Change-Id: If2d489b2aca39cd0297453f311a5c3ce80f577d9
- commit ecf8f6ede2c00350a36297dd7427afff9d9cb154
- Author: buzbee <buzbee@google.com>
- Date: Tue Jul 20 14:53:42 2010 -0700
- JIT: Support for Dalvik volatiles (issue 2781881)
- Also, on SMP systems generate memory barriers.
- Change-Id: If64f7c98a8de426930b8f36ac77913e53b7b2d7a
- commit 1e83b4d026199073c057edcb7836d06ae0716390
- Author: Andy McFadden <fadden@android.com>
- Date: Thu Jul 15 17:20:24 2010 -0700
- Implement JNI UnregisterNatives.
- This function is of limited use, but one of our partners found a need
- for it, so it's finally getting implemented. It clears all JNI native
- method bindings in a given class.
- It turns out there are some interesting potential races which can be
- avoided by treading lightly. The utility function that updates the
- Method struct has been modified appropriately.
- (There's a race on ARM SMP in the original implementation, in which
- we could still observe "insns" as NULL after nativeFunc is pointing at
- the JNI bridge. Handled in this change with an explicit full barrier,
- which is overkill. We can make it better as part of the general
- barrier-removal pass in bug 2781972 -- really wants an acquiring load
- on nativeFunc, though that's a waste for internal native calls.)
- Also, stifled an unnecessary warning about redefining a native method
- implementation (which is explicitly allowed). Limited the scope of
- an inappropriate "const" declaration.
- Bug 2697885.
- Change-Id: Ie406e25de3f77d00fe3e9130b406abcb45c3d60e
- commit 3be6164a73167d992ffd075162b458576a792375
- Merge: 903405d 139516e
- Author: Andy McFadden <fadden@android.com>
- Date: Wed Jul 7 14:41:04 2010 -0700
- Merge "Only emit cat1 volatile ops in SMP builds." into dalvik-dev
- commit 139516ee8f527aca18ae658087f28d825bfdf1c9
- Author: Andy McFadden <fadden@android.com>
- Date: Wed Jul 7 14:09:09 2010 -0700
- Only emit cat1 volatile ops in SMP builds.
- After consultation with the JITSquad, we no longer emit volatile
- field access instructions for category 1 values unless ANDROID_SMP
- is nonzero.
- See also bug 2781881.
- Change-Id: I58041572f6cf9308a8a125200dc419ce9d3d8d12
- commit fb119e6cf8b47d53f024cae889487a17eacbf19f
- Author: Andy McFadden <fadden@android.com>
- Date: Mon Jun 28 16:21:20 2010 -0700
- Emit volatile field access instructions.
- Easier said than done. The trick is that we need to ensure that the
- instruction replacement happens even if the verifier and optimizer
- are not enabled in dexopt.
- We're currently doing the -wide-volatile replacement during
- verification, but that's not so great, since we collapse things like
- iget-byte and iget-char into a single iget-volatile, losing the field
- width. We could recover it from the field declaration, but doing it
- during verification is really just sort of wrong to begin with.
- The substitution isn't technically an "optimization", but it's easiest
- to do it during the opt pass, and we already have a convenient "is
- optimized" flag that helps ensure that we do the replacement pass
- exactly once.
- Optimizing at run time means making a private copy of shared pages,
- because the pages are mapped shared/read-only out of the DEX file.
- We could use up a lot of physical memory if we applied all possible
- optimizations, so we need a notion of "essential" and "non-essential"
- optimizations. If we're not running in dexopt, we only do the
- essential ones, which should leave most methods untouched.
- Replacement of 32-bit instructions is only strictly necessary when
- we're building for SMP. On a uniprocessor, the 32-bit operations
- are inherently atomic, and memory barriers aren't required. However,
- the JIT may benefit from having volatile accesses identified by opcode.
- Since the current branch doesn't support any SMP products, I'm enabling
- the instruction generation for all platforms so that we can give it
- some exercise.
- While making this change I noticed that the exclusion mechanism for
- breakpoints and optimization/verification was only serving to avoid
- a data race (e.g. breakpoint being overwritten by an instruction
- rewrite). It wasn't guaranteed to prevent races when two threads
- toggled pages between read-write and read-only while making an update,
- since a 4K page can hold code for more than one class. This has been
- corrected by adding a mutex.
- This change:
- - Introduces the notion of essential vs. non-essential optimizations.
- - Adds generation of 32-bit *-volatile instructions for all platforms.
- - Moves generation of *-wide-volatile from the verifier to the optimizer.
- - Allows the optimizer to modify code at run time.
- - Tweaks optimizeMethod() for "best effort" rather than "fail early".
- - Adds a DEX-granularity mutex to the bytecode update functions.
- This also begins the removal of PROFILE_FIELD_ACCESS, which hasn't been
- used for much and is mostly just in the way.
- Change-Id: I4ac9fa5e1ac5f9a1d106c662c3deee90d62895aa
- commit 1640b00d461a974eed2c87be793c6bd2ace97899
- Merge: 357a687 0890e5b
- Author: Andy McFadden <fadden@android.com>
- Date: Mon Jun 21 11:14:49 2010 -0700
- Merge "Fiddle with SMP_DMB." into dalvik-dev
- commit 0890e5bf0b2a502ca1030e9773fabc16ef1b5981
- Author: Andy McFadden <fadden@android.com>
- Date: Fri Jun 18 14:04:12 2010 -0700
- Fiddle with SMP_DMB.
- This changes it from a macro that takes an argument to a simpler
- macro that is named explicitly by the 8 instructions that want it.
- Change-Id: Ie17a9722823d590851776b6b9b057eadf22fa6a8
- commit c35a2ef53d0cccd6f924eeba36633220ec67c32e
- Author: Andy McFadden <fadden@android.com>
- Date: Thu Jun 17 12:36:00 2010 -0700
- Add opcodes for volatile field accesses
- This adds instructions for {i,s}{get,put}{,-object}-volatile, for a
- total of eight new instructions.
- On SMP systems, these instructions will be substituted in for existing
- field access instructions, either by dexopt or during just-in-time
- verification. Unlike the wide-volatile instructions, these will not be
- used at all when the VM is not built for SMP.
- (Ideally we'd omit the volatile instruction implementations entirely on
- non-SMP builds, but that requires a little work in gen-mterp.py.)
- The change defines and implements the opcodes and support methods, but
- does not cause them to be used.
- Also, changed dvmQuasiAtomicRead64's argument to be const.
- Change-Id: I9e44fe881e87f27aa41f6c6e898ec4402cb5493e
- commit 54c91f8f33fc12d741aaa0dcdb375991e252c994
- Merge: 1f7f41f deeeeb2
- Author: Andy McFadden <fadden@android.com>
- Date: Fri Jun 18 09:54:31 2010 -0700
- Merge "Dalvik SMP update" into dalvik-dev
- commit deeeeb264fc6f4ab7f5cb6e01b9dd76f487ff914
- Author: Andy McFadden <fadden@android.com>
- Date: Wed Jun 16 08:32:04 2010 -0700
- Dalvik SMP update
- Fix some SMP correctness issues in the VM:
- - Correct AtomicCache implementation, inserting barriers where needed
- and correcting existing usage.
- - Emphasize that String startup isn't expected to be reentrant, and
- use atomic ops to ensure that we explode if anybody tries it.
- - Use 64-bit quasiatomic ops to manage the "last activity" timer in
- JDWP. (Also, provide some documented but unimplemented behavior.)
- - Updated the volatile operations in sun.misc.Unsafe to include
- appropriate barriers.
- (This does not purport to correct all SMP issues, just some of the
- more obvious ones.)
- Change-Id: I06957ebcf2724fe7a228b30d00194b9b4808fae0
- commit 797502e587808b30b9e0b170cfbca8d4cba10699
- Merge: fbdcfb9 ead3d06
- Author: Andy McFadden <fadden@android.com>
- Date: Sun May 30 21:20:47 2010 -0700
- am ead3d06b: am 67e82fb1: Merge "Atomic/SMP update, part 2." into kraken
- commit fb07cb6f8b31e8c56029c056f06b29705c0ca599
- Author: Andy McFadden <fadden@android.com>
- Date: Thu May 27 10:23:41 2010 -0700
- Atomic/SMP update, part 2. (manual to dalvik-dev)
- Updated "generic" quasiatomic implementation to use atomic release store
- instead of atomic swap when releasing the lock.
- Track change to name of memory barrier.
- Change-Id: I229fc2aec8996db07b84f2d1bcfbe4346a810d85
- commit ead3d06bca526d1a709786f73ad658a95f5927a2
- Merge: b129337 67e82fb
- Author: Andy McFadden <fadden@android.com>
- Date: Fri May 28 13:02:16 2010 -0700
- am 67e82fb1: Merge "Atomic/SMP update, part 2." into kraken
- commit 67e82fb113d18e77c0ee2f7c06e832f3b73649b1
- Merge: a02fe78 4dd7263
- Author: Andy McFadden <fadden@android.com>
- Date: Fri May 28 13:00:21 2010 -0700
- Merge "Atomic/SMP update, part 2." into kraken
- commit 4dd72631b5fcdcc4b21d096d27021801e2f8df1c
- Author: Andy McFadden <fadden@android.com>
- Date: Thu May 27 10:23:41 2010 -0700
- Atomic/SMP update, part 2.
- Updated "generic" quasiatomic implementation to use atomic release store
- instead of atomic swap when releasing the lock.
- Track change to name of memory barrier.
- Change-Id: Ie6ec37bca6984553f665bd25385210ea6c8e0943
- commit fc0dcfa2ea4325b1e2a5fc938b57f1b2a50d5f67
- Merge: 2725c3a f00de1b
- Author: Andy McFadden <fadden@android.com>
- Date: Fri May 21 12:08:06 2010 -0700
- am f00de1ba: am 6a877083: Atomic/SMP update.
- commit f00de1ba77f74ffae921ff2fa0d881d455d95b4c
- Merge: 7b30673 6a87708
- Author: Andy McFadden <fadden@android.com>
- Date: Fri May 21 12:06:30 2010 -0700
- am 6a877083: Atomic/SMP update.
- commit 6a877083893fb466ebb6ee6bcbdc5f1ca8609cb1
- Author: Andy McFadden <fadden@android.com>
- Date: Wed May 19 22:36:33 2010 -0700
- Atomic/SMP update.
- Moved quasiatomic 64-bit operations in here. They still need work.
- Use the new libcutils atomic-inline header for our memory barriers.
- Adjust makefiles to set SMP definition appropriately.
- Change-Id: Id2ab2123724bb0baeb32f862b5568392aba35a59
Add Comment
Please, Sign In to add comment