summaryrefslogtreecommitdiffstats
path: root/src/runtime.cc
Commit message (Collapse)AuthorAgeFilesLines
* user build support for art (2 of 3)Brian Carlstrom2012-02-161-14/+23
| | | | Change-Id: I4696fee58e43db48540e2442c4235fc4bb02d9e3
* Missing initializationIan Rogers2012-02-151-0/+1
| | | | Change-Id: Ib2a75f3fac032e19efb89119d5aabed1aed6b05a
* Reduce StringPiece usage a bit.Elliott Hughes2012-02-101-32/+31
| | | | | | | Various easy cases, in case we want to move towards making the StringPiece constructors explicit. Change-Id: I49e5efc5b787f847ab4cb12d66d1d16aed03fa67
* Remove old code to support multiple imagesBrian Carlstrom2012-02-041-6/+5
| | | | Change-Id: I29bc2f216361ac4ed0cc0fefb7e3c46ee64e0ae8
* Honor ANDROID_ROOT and ANDROID_DATABrian Carlstrom2012-02-041-1/+3
| | | | Change-Id: I8e43093830a734694bbf7308d08dd18527302270
* Make all FATAL-related output appear as 'F' log output.Elliott Hughes2012-02-031-1/+1
| | | | | | | Previously most of the spew belonging to a FATAL would be 'E' because Runtime::Abort() used LOG(ERROR) to avoid recursion. Change-Id: If8f62586c302c239e827c5235ed58ee8fe6e8f5e
* Improve debug-ability of native method registrationIan Rogers2012-02-031-1/+2
| | | | | | | | | If we fail to register a native we construct a stack trace which needs Throwable and stack trace support. Registering Throwable's natives first and making Throwable a root supports this. Previously we could only generate a stack trace when thread start up was complete. Change-Id: Icc7c1657988c7f36aceb1d4f3e61e7218f55e055
* Start parallelizing dex2oat.Elliott Hughes2012-02-031-4/+6
| | | | | | | | | | This is enough to perform type resolution and verification in parallel. There appears to be a bug in InitCpu --- if you start enough threads at once, the CHECK at the end starts to fail, with self_check == NULL; I've commented it out for now, but this will cause test failures until it's fixed. Change-Id: I4919682520bc01d3262c6b3d00c7bd2c2860a52e
* Simple heap trimming.Elliott Hughes2012-02-021-0/+1
| | | | Change-Id: I8a94b637e64c6b5586db3c41b6e9230e7c8250c8
* Support Runtime::Abort() before the runtime has started.Elliott Hughes2012-02-011-0/+4
| | | | | | | This lets you get useful diagnostics out of LOG(FATAL) and CHECK(FATAL) and so on even if the problem occurs really early on. Change-Id: I2bfd906191d8817de719c3d38e7fa5de844bebba
* Remove dex2oat warnings by providing "." class path defaulting only to JNI ↵Brian Carlstrom2012-02-011-4/+0
| | | | | | callers Change-Id: Ibc532b4a6e72ad92d7b537896447949a2a764166
* Fix copyright headers.Elliott Hughes2012-01-301-1/+15
| | | | Change-Id: I5b7bc76a370238d810d78522bd5531600746700f
* Only allow one thread to abort at a time.Elliott Hughes2012-01-271-0/+6
| | | | | | Found when looking to see if Google Earth had fixed their JNI bug yet. Change-Id: I8768248625869d344ba04ecf4fec06047f76c3ce
* Upgrade to latest dlmalloc. Refactor Heap and related APIs to use STL like ↵Ian Rogers2012-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | naming. We fail assertions in the existing heap code, as does Dalvik. This refactoring is to clean the heap and space APIs and to reduce duplication of data and thereby solve a failing assertion in the card table. This change also wires up clearing of soft references including before out-of-memory errors are reported. In doing this change it was made clear that mspaces are buggy (and violating invariants with the garbage collector). This change upgrades to an un-Android molested version of dlmalloc-2.8.5 and implements a version of the mspace morecore routine under ART control. run-test 061-out-of-memory is updated for current heap sizes. Change-Id: I377e83ab2a8c78afb9b1881f03356929e2c9dc64
* Include the thread name in Thread's operator<< output.Elliott Hughes2012-01-241-1/+5
| | | | | | | | For example: Thread[2,tid=1692,VmWait,Thread*=0x416914d0,"Signal Catcher"]: reacting to signal 3 Change-Id: I2b00e82af2ad0f09141dbf4e418bc0582e9b966d
* Mac runtime fixes.Elliott Hughes2012-01-201-2/+1
| | | | | | | | | | This is enough to let us run test-art-host on the Mac. The tests that don't start a runtime (and thus don't try to dlopen(3) libjavacore.dylib) succeed. The others fail, but I'm not sure how the Linux tests find libjavacore.so, so I'm not sure how to fix things for Mac OS. Change-Id: Idf489fc09f0a8f64fbb60dfcdbca9c3df2d4fdcb
* Fix the handful of leaks detectable in our tests.Elliott Hughes2012-01-181-0/+2
| | | | Change-Id: I74ad1a3831fbebad60ff24f0b3ac07cade823b7a
* Default java.class.path to "." Bug: 5878535Ian Rogers2012-01-171-2/+6
| | | | | | This makes ART's behavior the same as Dalvik's. Change-Id: I2096a4da09016662f6b7edbc9b54efc7b74c2634
* Make pthread_mutex_t destruction safer during shutdown.Elliott Hughes2012-01-131-0/+7
| | | | | | | | | If we have suspended daemon threads, they might be holding some of the mutexes we need to destroy, so we can't assert that we successfully destroyed them. We still want to assert success where possible, though. Bug: 5869254 Change-Id: Id4f3af3d40b10045958e7d692b3c9eebafec566d
* Minor fixes.Elliott Hughes2012-01-121-0/+2
| | | | | | | | | | | | | | Fix a crash when shutting down if a daemon thread suspended while holding the heap lock. For some reason, presumably involving extra daemon threads, CTS hits this a lot. Silently ignore a couple of dalvikvm options for backwards compatibility. This makes CTS less noisy. Remove redundant parentheses that would make it easy for us to introduce a ==/= bug. Change-Id: Id44eab29ce393a85585459c280ad47c5a5c749b9
* Changed tracer to use an instance to hold state instead of statics.jeffhao2011-12-191-1/+22
| | | | Change-Id: I2fdcf5de7fbc745273b1a33cb409d13e72d24ab4
* Adding newly required headersBrian Carlstrom2011-12-151-0/+2
| | | | Change-Id: I4c121eaf8fdade8b038fdc696df2d93309d78133
* Moving from libdvm to libart (1 of 5)Brian Carlstrom2011-12-141-1/+1
| | | | Change-Id: I6541802c5f403a4ba4424818084b94bebe71dfca
* Don't default-construct std::strings and then assign them.Elliott Hughes2011-12-131-1/+1
| | | | Change-Id: I8c994d1e6a8d2ebe52eaa4f0132e0deb2ecfa5f3
* Clean up verbose logging.Elliott Hughes2011-12-131-36/+37
| | | | Change-Id: I6b01980e7145c4f8d25a5b50f620903f61a1b427
* Detect over-long thread suspends and time out fatally.Elliott Hughes2011-12-071-0/+13
| | | | | Bug: 5726434 Change-Id: Ib7d4429c2b195f59133bb6dc7f9072b705c53e82
* Reduce meta-data object sizes, introduce meta-data helper classes.Ian Rogers2011-12-061-13/+2
| | | | Change-Id: Id14ad218f1c74c659701352fdf1a45bf6444daa3
* Remove some lint.Elliott Hughes2011-12-011-3/+3
| | | | Change-Id: Ieecd7c10e62bce27e2db38f96d5df9782ef0cff6
* Add --image-classes to dex2oatBrian Carlstrom2011-11-291-7/+10
| | | | Change-Id: Ia88f9d302e0f9cd72be2199ee46d212d99864c67
* Don't set the context class loader until it has been created.Jesse Wilson2011-11-221-0/+9
| | | | | | | | | We had a bug where we were setting the main thread's context class loader to null because we hadn't created it yet. This moves the setting of the context class loader to after it has been created. Change-Id: Ib4be1be646ade4c426dda3ced30ae1ba37ddd0f6
* Don't run managed code until the runtime has started.Jesse Wilson2011-11-141-7/+2
| | | | | | | | | | | | | | | | | | | | | Previously we ended up running managed code because JNI was triggering class initializers to run. This was triggered by both Thread::CreatePeer() and InitBoxingMethods(). When these initializers were prevented from running, other code broke: - Creating the peer for the main thread was relying on ThreadGroup.<clinit> to assign the built-in thread groups. - Creating the boxed methods caused class initialization of the primitive wrapper classes; these need to be initialized before Thread.<clinit> is run to avoid a crash in its own initializer. This change works around those breaks by splitting thread peer creation into two parts (allocation and running <init>) and by calling InitBoxingMethods() during runtime start. Change-Id: I44be7170ce08451adf876ee73cba0f1f66d5a59e
* Remove the use of Method from jni_compilerIan Rogers2011-11-141-3/+3
| | | | Change-Id: Ibf1c72a806e7f1ba7a2d83960c3d57f41937d336
* More SIGQUIT detail, earlier exit in AttachCurrentThread, handling recursive ↵Elliott Hughes2011-11-031-9/+16
| | | | | | aborts, and reporting debug/optimized builds. Change-Id: I932b49a8e92a91e340b4d98b8771dd4a41b61229
* Provide a convenience for logging types that don't have an operator<<.Elliott Hughes2011-10-281-15/+14
| | | | Change-Id: I650b852ded67576dc5ec7c8e57732cfb49f1ecd6
* Added support for -XX:HeapGrowthLimit switchjeffhao2011-10-281-0/+16
| | | | | | | | | | | Runtime can now take in a growth limit for the heap, which can be smaller than the maximum size of the heap, and will prevent the heap from growing beyond that size. The growth limit can also be cleared to increase the size of the heap to the specified maximum size. This gives apps some control of the size of the heap, but should be removed when we have better ways to resize the heap. Change-Id: I338655bccd20bfd32e2318365f0f3283dbaaab1e
* Better unresolved type support.Ian Rogers2011-10-261-1/+15
| | | | | | | | Also fix bug where miranda methods were changing their declaring class and thereby breaking their return type indices. Add support for dumping stacks on abort. Change-Id: I3782864736b12d1f81ab9aea4909213d3344ba13
* Makes objects known to the debugger GC roots, implements the THST message, ↵Elliott Hughes2011-10-261-0/+1
| | | | | | | | | and lets DDMS request stack traces. This fills out correct data in all columns of the "Threads" table, and double-clicking on a thread shows that thread's stack. Change-Id: I48f63c3612e12d35269158dc3a283f07db28c8e7
* Callers of SuspendAll should be in the kRunnable stateBrian Carlstrom2011-10-261-0/+6
| | | | Change-Id: I37996164a5fd56251134683f717e6e00541cab22
* Implement more DDMS support.Elliott Hughes2011-10-251-1/+1
| | | | | | You can now launch DDMS without killing running oatexec processes... Change-Id: I13e1d6df4f0cbd0c06b69471823a13e4e820b93b
* Make ResolveField not rely on Field::GetType resolutionBrian Carlstrom2011-10-251-1/+5
| | | | Change-Id: I10f4a874809ac9db2cd54e200cf10eb7c8979fce
* Wire up enough of the pieces that we can connect ddms or jdb.Elliott Hughes2011-10-241-2/+10
| | | | | | (And die with an UNIMPLEMENTED as soon as they connect, of course.) Change-Id: I9abb25d581384361c215b3cd96b8278c751e79ea
* Verifier clean up.Ian Rogers2011-10-241-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first part in trying to move to a more rigorous mode of asserting the validity of garbage collection maps. In the bring over of the verifier from Dalvik a large class had been created where all of the Dalvik/Dex functions were static methods of that class. This rewrite introduces 3 key classes, Verifier that orchestrates the verification of a method, RegisterLine which describes the types associated with registers for a particular PC and RegType which describes the current type of a register within a line. The functionality is brought over from Dalvik but cleaned up to not do things like goto. Failing within the verifier is also cleaned up. By virtue of having stateful objects the interfaces between different aspects of the verifier are greatly simplified. To save space, RegTypes are cached upto a maximum possible 2^16, and given an Id. As the number of RegTypes is typically small this means that we have a full OO implementation but at a lower space cost than the current convention that uses botched together enum values requiring 32bits of storage in a RegisterLine rather than 16bits (ie half the space requirement per register in a register line). To make use of this space more rigorous monitor verification is brought back, and ultimately I think we can work around bug 3215458 with richer RegTypes that are aware of literal objects. The code removes short cuts that had been added to Dalvik's verifier and appear illegitimate, it also fixes a large number of bugs in the description of the verifier. Where possible the spaghetti of code is replaced with straight line if-then-elsif.. code that clearly follows the ordering semantics of the specification. The code is also aiming toward having a more type rigorous description of the verification process, and when this isn't possible following the description convention of the specification. Change-Id: Id25b742018a2ad5ea95687973cca610d7e19513c
* Basic JDWP option parsing...Elliott Hughes2011-10-211-2/+9
| | | | | | | ...and just enough code to silence all the UNIMPLEMENTED warnings you get during normal usage. Change-Id: I56820ac971b88581c4cb1f462c13331d8fa04c43
* Add ThreadStress test to try and exercise corner casesBrian Carlstrom2011-10-211-0/+3
| | | | Change-Id: I8d151e9ba935b8c76406483c6c276cc26896aabf
* Reuse SIRT for C++ referencesBrian Carlstrom2011-10-201-2/+2
| | | | Change-Id: I8310e55da42f55f7ec60f6b17face436c77a979f
* Implement -Xstacktracefile.Elliott Hughes2011-10-181-1/+4
| | | | Change-Id: Ib6c73ddc6f0eaf8f8b731d450b87bda55589f857
* Implement -Xjnigreflimit.Elliott Hughes2011-10-181-1/+19
| | | | Change-Id: Iaa31cf4ea4f90fc76baa4472b67fe6c2cc0e0277
* Implement lock contention event logging.Elliott Hughes2011-10-171-1/+8
| | | | Change-Id: I88b30985590157bb5d04229a97f191b898f141bb
* Add internal compiler option to control defaulting of boot.artBrian Carlstrom2011-10-161-1/+7
| | | | Change-Id: I92a46cbd25cfc51c5c5d16fd8ae24c50195bf1d4
* Fix the double-OOME case again.Elliott Hughes2011-10-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The key ingredient to this change is that the NULL check on the NewStringUTF call in ClassLinker::FindClass was accidentally checking the input to the function (which we know isn't null) rather than the output (which will be if allocation fails). I've also fixed a bunch of places where we were missing null checks on allocation, but there's a lot more to do. I've stopped -Xcheck:jni from trying to dump pending OutOfMemoryError stacks because that's highly likely to go horribly wrong and just gets in the way of debugging the actual problem. (We could perhaps do better, so I've added a TODO.) In DexFile, we were always allocating java.lang.Strings for the names of each local variable, even if we were only parsing the debug info for the purposes of translating a line number. This was less of a problem in Dalvik where the names were just const char*s, but since we go straight to Strings, this was causing yet more OOME carnage (and is a lot of wasted effort). This fixes the regression we were seeing in 061. Change-Id: I6241602756db3070b214ccb35e3760b37e1e3d10