summaryrefslogtreecommitdiffstats
path: root/vm/alloc
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge "Don't use dvmIsValidObject outside the GC."Elliott Hughes2011-07-202-5/+5
|\
| * Don't use dvmIsValidObject outside the GC.Elliott Hughes2011-07-192-5/+5
| | | | | | | | | | | | | | | | Use dvmIsHeapPointer outside the GC. (This still isn't safe because there's no synchronization when dealing with the HeapSource.) Bug: 5049447 Change-Id: Ie0b325ef0a92687ea1eaf1491a4bb832298893c5
* | Trim the heap when idle after concurrent GC's.Jeff Brown2011-07-193-20/+30
|/ | | | | | | | | | | | Bug: 4984352 When applied system-wide, trimming the heap can help recover multiple megabytes worth of pages that are no longer used. This is especially useful for applications that periodically allocate large objects during initialization that they then discard when running in the background. Change-Id: Iafffd65a70ae62022f0c74f836a84a7afbe23c3c
* Fix the jweak implementation.Elliott Hughes2011-07-112-12/+11
| | | | | | | | | | | | | We need to distinguish between "cleared weak global" and "deleted weak global". Previously we used NULL for both. Now we add a magic value for cleared weak globals. I've also switched the GC over to using iterators, so IndirectRefTable itself becomes responsible for not showing bad pointers to the GC. I've also improved the reference table dumping to cope with the new scheme and to be a bit easier to read (through extra indentation). Bug: 4260055 Change-Id: I26af301fb2b46d014c6f6b0915a8f8a7fb6d7c5b
* Remove dead code/unused variables to avoid gcc-4.6 warnings.Doug Kwan2011-07-071-9/+2
| | | | Change-Id: I291fd42e91085c51772f560d424334874bef8add
* Merge "Clean up IndirectRefTable a bit." into dalvik-devElliott Hughes2011-06-212-2/+2
|\
| * Clean up IndirectRefTable a bit.Elliott Hughes2011-06-212-2/+2
| | | | | | | | | | | | | | The main purpose here was to have slightly less unclear warnings for JNI local reference abuse. Change-Id: I2c6378dd0a94d8afb96a8e409f7460205e3cd315
* | am 0c632a84: Merge "Add isDebuggerActive API for the finalizer watchdog."Jesse Wilson2011-06-201-13/+3
|\ \ | |/ |/| | | | | * commit '0c632a8484839ceeffc6fdf04c310c02c7531530': Add isDebuggerActive API for the finalizer watchdog.
| * Add isDebuggerActive API for the finalizer watchdog.Jesse Wilson2011-06-201-13/+3
| | | | | | | | | | Change-Id: Ib0afcd15327c0a3dd8c565036a8f010e318adc9e http://b/4144865
* | Break a dependency on frameworks/base when building a host VM.Elliott Hughes2011-06-151-60/+3
| | | | | | | | | | | | | | These aren't necessarily good abstractions, but they're no worse than what we had, and having them factored out is a step in the right direction. Change-Id: I5b839608317d2ca1ca54d8a38624fb686f2c37de
* | Normalize the include guard style.Carl Shapiro2011-06-1414-42/+42
| | | | | | | | | | | | | | | | | | | | An leading underscore followed by a capital letter is a reserved name space in C and C++. This change also moves any #include directives within the include guard in some of the compiler/codegen/arm header files. Change-Id: I9715e2c5301699d31886e61d0fe6e29483555a2a
* | Merge "Always grow the limit address of the a heap along with its size." ↵Carl Shapiro2011-06-101-0/+1
|\ \ | | | | | | | | | into dalvik-dev
| * | Always grow the limit address of the a heap along with its size.Carl Shapiro2011-06-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, clearing the growth limit only updated the maximumSize of the unlimited heap without updating the limit value. This caused any operations iterated over the extent of the heap to ignore allocations beyond the original heap size. With this change the limit is always kept in agreement with the maximumSize. Bug: 4539441 Change-Id: I08c8004e724549d196e1fd5d6ad22efc85b0c8d2
* | | Do not initiate a concurrent collection if one is already running.Carl Shapiro2011-06-091-3/+10
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is possible to cause a recursive garbage collection by writing a program that triggers a concurrent garbage collection and initiates a concurrent garbage collection before the garbage collection thread is scheduled. For example for (;;) { new byte[16 << 20]; System.gc(); } When this condition occurs a warning is logged although such warnings ought to be upgraded to fatal errors. With this change, when the garbage collection thread is scheduled it first checks to see if there is a running collection before calling down to start the collection. Change-Id: Ia7baf5eba245bbf3fe053d3bad3f90876cad2459
* | Merge "Favor Object* over void* for the heap bitmap interfaces." into dalvik-devCarl Shapiro2011-06-086-37/+29
|\ \
| * | Favor Object* over void* for the heap bitmap interfaces.Carl Shapiro2011-06-076-37/+29
| |/ | | | | | | Change-Id: I615dbff3e81a1128dc3ba43d6d426c370ae3abcf
* / Fix two issues with the card table.Carl Shapiro2011-06-072-4/+8
|/ | | | | | | | | | | | | | | | | | | | Several tricks are used to adjust the base of the card table to save instructions in the write barrier. This change corrects two situtations where the card table did not properly account for the effects of these tricks. First, the card table is over allocated to ensure that the start address can be magically aligned. When releasing the allocation these additional bytes were not supplied to munmap creating a potential leak. Second, the valid card check did not use the right base address for a containment check. The check used the allocation base which is may be lower than the actual starting address. This would cause valid cards at the high end of the heap to be considered invalid and invalid cards at the low end of the heap to be considered valid. Change-Id: I83bf4167b7c081c8626b6ff504342f42d0e776a2
* More LOG newline cleanup.Dan Bornstein2011-05-261-1/+1
| | | | | | | This changes all the places I could find where the log string was on the line after its LOG call. Change-Id: Iac6a9fcc64f46631fb093824ab60237dce1a5241
* Further conservation of newlines.Dan Bornstein2011-05-265-54/+54
| | | | | | Friends don't let friends end LOG() strings with newlines. Change-Id: I5a18c766c90c4ab5f03caa6acd601d34d91beb00
* Eliminate the dvmHeapSourceGetPtrFlag interface.Carl Shapiro2011-05-253-38/+18
| | | | | | | | | | | This routine served answering questions about object addresses. While it was private to the garbage collector, its remaining use was inside the heap profiler. Within the heap profiler, a single path was executed to tested a pointer for containment within the zygote. In its place, a new function, dvmIsZygoteObject, has been added to the GC interface superseding the only use of dvmHeapSourceGetPtrFlag. Change-Id: I347c9adb293bd6c196bbac3765015453133dc492
* Fix a comment and remove some horizontal white space.Carl Shapiro2011-05-111-15/+14
| | | | Change-Id: Id0a9c4f8ee073e8260571a0f48605ae1f9b04219
* Various code clean-ups.Carl Shapiro2011-05-111-134/+45
| | | | | | | | | | | | | | | | | | | | | * Combine definitions with initialization. This had to be foregone in two instances where that would have otherwise caused an unused variable warning. * Move the HS_BOILERPLATE macro to the top of the calling function. This macro checks that certain globals are initialized. It should be removed after the callers become members functions of a class. * A few cases of inconsistent function declaration styles have been brought in line with the rest of the file. These were overlooked in a previous clean-up. * The unused heap source debugging macros and tracing code have been removed. * One stale comments has been removed and another has been updated. Change-Id: I20bf4b78161096310b79d7dd294d7636e6bb6f48
* Normalize declaration style.Carl Shapiro2011-05-113-63/+34
| | | | Change-Id: Iae4e3d22bc185060b3a0b4c080eafaa2ec824ac2
* Explicitly initialize a condition variable in the VM globals.Carl Shapiro2011-05-101-1/+1
| | | | Change-Id: I3192d957ebace59a3b8f8330591f05d403280d1f
* Establish a subclass relationships among the field types.Carl Shapiro2011-05-062-6/+6
| | | | Change-Id: Id349b359489bb6b1bbb4ab78d29d85c0e6b33799
* Make interned strings non-movable.Carl Shapiro2011-05-052-0/+7
| | | | | | | | | | | | | | At present objects referenced from dex files must have stable reference values. With this change, only non-moving strings are interned. If a user interns a movable string a non-moving copy is made and the copy is added to the intern table. As part of this change, the internal string hash code access routine will update the hash code slot of a string object. In addition, StringObject has been made a subclass of Object eliminating various down-casts that would otherwise be explicitly required. Change-Id: I6b015b972aac44948470c0034ad17e5eef456aeb
* Merge "Refactor the garbage collection class initialization." into dalvik-devCarl Shapiro2011-04-281-32/+21
|\
| * Refactor the garbage collection class initialization.Carl Shapiro2011-04-271-32/+21
| | | | | | | | Change-Id: I977ee5045010a846098944d3e8048893ac550533
* | Merge "Add a non-moving option to dvmMalloc and make use of it." into dalvik-devCarl Shapiro2011-04-281-0/+1
|\ \
| * | Add a non-moving option to dvmMalloc and make use of it.Carl Shapiro2011-04-271-0/+1
| |/ | | | | | | | | | | | | | | | | At present, class objects, non-moving arrays, and interned strings have location dependencies in native code. Allocating non-moving is a no-op for the present heap, but this option will have an effect after the copying collector is integrated. Change-Id: I674f83a086ac65db303baab0599831f80f52a4a5
* / Get rid of uneeded extern, enum, typedef and struct qualifiers.Carl Shapiro2011-04-272-2/+2
|/ | | | Change-Id: I236c5a1553a51f82c9bc3eaaab042046c854d3b4
* Normalize some enumerations.Carl Shapiro2011-04-274-20/+22
| | | | | | | | This change pulls a few enumeration types to the top of their header file alongside other types. It also eliminates the use of the now redundant enum qualifier. Change-Id: I6f853bed09176cde9a83faccea7a76f595f60f2b
* Use C++ linkage in GC headers and remove unneeded typedefs.Carl Shapiro2011-04-2715-85/+29
| | | | | | | | Some interfaces in Alloc.h had to be left with C linkage as they are referenced by the interpreter assembler code. That dependency will be addressed in a future commit. Change-Id: I6b2097a2139ddf6b4b13e592710e241442e08488
* Consolidate curFrame fields in thread storagebuzbee2011-04-222-3/+3
| | | | | | | We ended up with two locations in the Thread structure for saved Dalvik frame pointer. This change consolidates them. Change-Id: I78f288e4e57e232f29663be930101e775bfe370f
* Remove DVM_LOCK_INIT and DVM_LOCK_INITIAL_THIN_VALUE.Carl Shapiro2011-04-201-10/+7
| | | | | | | | | | | | The original implementation for thin locks used a magic non-zero value to encode the initial thin lock state. This magic value was kept around in DVM_LOCK_INITIAL_THIN_VALUE and stored into the lock word of newly allocated objects. A later revision to the thin locking code made the initial thin lock value be 0. That change eliminated the requirement that lock words be explicitly initialized as the allocator always returns zero-filled memory. Change-Id: I34e0b43b4c4db0f45cf7cf524e15d4a6096c1365
* Remove unneeded void argument list declarations.Carl Shapiro2011-04-207-57/+57
| | | | Change-Id: Ica749f6defa890363ec531b29e25bc415dc2cbb9
* Improve the impossible allocation log message.Carl Shapiro2011-04-181-2/+2
| | | | Change-Id: Icf4c9b22c0f11159efb7cb43ab1158cc4f10c82f
* Add a class flag CLASS_ISCLASS.Dan Bornstein2011-04-135-6/+6
| | | | | | | | | | | | 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
* Add additional asserts and combine declarations with definitions.Carl Shapiro2011-04-111-63/+38
| | | | Change-Id: Ibdc37f3d7eb6385da1059d5525727b090626ec4c
* Fix for loops and eliminate some other undesirable idioms.Carl Shapiro2011-04-087-206/+103
| | | | | | | | | | 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
* Compile the garbage collector and heap profiler as C++.Carl Shapiro2011-04-0821-15/+76
| | | | Change-Id: I25d8fa821987a3dd6d7109d07fd42dbf2fe0e589
* Scale the card count by bits per byte to derive a bit vector length.Carl Shapiro2011-04-071-1/+1
| | | | Change-Id: If3177d924193cd665f12758ce83f3be4cc5a66c8
* Fix sizing of the modunion table on small heapsBrian Carlstrom2011-04-042-13/+15
| | | | Change-Id: I8696fb2f6d408049ec39609db34238edee171f79
* Delegate the queuing of cleared references to managed code.Carl Shapiro2011-03-3012-911/+81
| | | | | | | | | | | | | | 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
* Merge "Kill off code, and leave a note." into dalvik-devDan Bornstein2011-03-231-48/+2
|\
| * Kill off code, and leave a note.Dan Bornstein2011-03-231-48/+2
| | | | | | | | | | | | | | | | | | | | Based on discussion yesterday, the code in Copying.c was already superfluous. I'm leaving dvmForEachRequiredReference(), except with a note, just in case it ends up being needed. If by the time I'm done with the next round of VM changes, it turns out not to be needed, then I'll just go ahead and axe it. Change-Id: Ib7cf06ba75851c7ffd98108c4c73cddee9259ddf
* | Interpreter restructuringbuzbee2011-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a restructuring of the Dalvik ARM and x86 interpreters: o Combine the old portstd and portdbg interpreters into a single portable interpreter. o Add debug/profiling support to the fast (mterp) interpreters. o Delete old mechansim of switching between interpreters. Now, once you choose an interpreter at startup, you stick with it. o Allow JIT to co-exist with profiling & debugging (necessary for first-class support of debugging with the JIT active). o Adds single-step capability to the fast assembly interpreters without slowing them down (and, in fact, measurably improves their performance). o Remove old "polling for safe point" mechanism. Breakouts now achieved via modifying base of interpreter handler table. o Simplify interpeter control mechanism. o Allow thread-granularity control for profiling & debugging The primary motivation behind this change was to improve the responsiveness of debugging and profiling and to make it easier to add new debugging and profiling capabilities in the future. Instead of always bailing out to the slow debug portable interpreter, we can now stay in the fast interpreter. A nice side effect of the change is that the fast interpreters got a healthy speed boost because we were able to replace the polling safepoint check that involved a dozen or so instructions with a single table-base reload. When combined with the two earlier CLs related to this restructuring, we show a 5.6% performance improvement using libdvm_interp.so on the Checkers benchmark relative to Honeycomb. Change-Id: I8d37e866b3618def4e582fc73f1cf69ffe428f3c
* | Merge "Get rid of some inconsistent formatting." into dalvik-devCarl Shapiro2011-03-221-8/+8
|\ \ | |/ |/|
| * Get rid of some inconsistent formatting.Carl Shapiro2011-03-221-8/+8
| | | | | | | | Change-Id: I5d5130702e17bb95c835b9ccc3ec0aa86eda9dea
* | Left a note for future editors.Dan Bornstein2011-03-221-0/+6
| | | | | | | | Change-Id: Ic96f58baabdf0d1a694b51efc991de5caef66a38