summaryrefslogtreecommitdiffstats
path: root/runtime/runtime.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement a simple count based boot marker.Narayan Kamath2015-02-211-1/+4
| | | | | | | | | | | | | We write the number of failed boots to the marker and only prune the dalvik cache if the number of consecutive failed boots is higher than a predefined threshold. Note that the code is forgiving of errors related to boot markers; we continue the boot process even if we're unable to create / write or flush the boot marker. bug: 19360096 Change-Id: Ia17c3b783318ddf43c9199d0f7f09c54a4176667
* Make UseTLAB a bool flag.Hiroshi Yamauchi2015-02-201-1/+1
| | | | | | This would make it easier to override its default value at build time. Change-Id: I643fe1afaf492f0443dc01df0c9a62bb3fa025d9
* Follow up 129144Sebastien Hertz2015-02-171-9/+3
| | | | | | | | | | Passes JDWP options to debugger on runtime init so we no longer need to keep them on the heap. Updates ParseJdwpOption to return Result for consistency. Bug: 19275792 Change-Id: I68b7e58908164d3e4cf9e3fbcc3dfab6ce0579a5
* Merge "Handle variable size of methods properly between 32 and 64 bit."Jeff Hao2015-02-101-4/+8
|\
| * Handle variable size of methods properly between 32 and 64 bit.Jeff Hao2015-02-051-4/+8
| | | | | | | | | | Bug: 19100762 Change-Id: I62358905fa882284d0201ed3c1e97e1286ccec5f
* | Read JDWP options from runtimeSebastien Hertz2015-02-051-2/+12
|/ | | | | | | | | | | | Allocates JDWP::JdwpOptions on the heap and copies parsed options to avoid the need to include jdwp/jdwp.h into runtime.h file. Also does some minor cleanup and removes the old JDWP options parsing code that became dead code after we move it to the new command-line parser. Bug: 19275792 Change-Id: I71901c89fbf2cc3c1901a089e2a98b4326c6ee70
* Merge "Fix transaction aborting"Sebastien Hertz2015-02-051-0/+25
|\
| * Fix transaction abortingSebastien Hertz2015-02-051-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During compilation, a java.lang.InternalError is used to indicate that class initialization failed and the enclosing transaction should be aborted and the changes rolled back. However there is nothing preventing the code executed from a class initializer from catching that exception (like catching Throwable and ignore it). Therefore we may return from the class initializer with no pending exception, even if the transaction was aborted, and not rollback the changes properly. To fix this, we now rely on the new Transaction::aborted_ field to know whether a transaction aborted. When returning from the class initializer without pending exception, we now check wether we aborted the enclosing transaction. If that's the case, we set the status of the class to kStatusError and throw a new java.lang.InternalError with the original abort message. This CL also contains some cleanup: - Renames Transaction::Abort to Transaction::Rollback which is less ambiguous and more reflect what is done. - Moves the code throwing the java.lang.InternalError exception into the Transaction::ThrowInternalError method so we do not duplicate code. Now we may abort transaction more than once (because we may have caught the java.lang.InternalError then execute code causing new transaction abort), we only keep the first abort message to throw the exception. - Updates transaction_test with more cases and more checks. - Bumps oat version to force recompilation with this fix. Bug: 19202032 Change-Id: Iedc6969528a68bbdf3123146e990df4dbc57834b
* | art: Try to fix parsed_options_test on the build serverIgor Murashkin2015-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | (It works fine locally because environment variables are defined differently) Also some minor cleanup elsewhere pointed out in the previous code review. Change-Id: I80650d2be6ce467b838db85eb130a0020d7c1480
* | art: Refactor RuntimeOptions/ParsedOptionsIgor Murashkin2015-02-041-71/+108
|/ | | | | | | | | | | | | Refactor the RuntimeOptions to be a type-safe map (VariantMap, see runtime_options.h) and the ParsedOptions to delegate the parsing to CmdlineParser (see cmdline/cmdline_parser.h). This is the start of a command line parsing refactor, and may include more in the future (dex2oat, patchoat, etc). For more details of the command line parsing generator usage see cmdline/README.md Change-Id: Ic67c6bca5e1f33bf2ec60e2e3ff8c366bab91563
* Remove some unused cutils/properties.h referencesBrian Carlstrom2015-01-301-19/+14
| | | | | | Also remove an obsolete include workaround Change-Id: Ie17387280285b969c4e9b5334bafde8239b9faf6
* More of the concurrent copying collector.Hiroshi Yamauchi2015-01-231-3/+24
| | | | | Bug: 12687968 Change-Id: I62f70274d47df6d6cab714df95c518b750ce3105
* Print more info in MarkSweep::VerifyRootMathieu Chartier2015-01-151-26/+8
| | | | | | | | | | | | | | | | | | | | | | | Refactored old root callback to use a new class called RootInfo. RootInfo contains all the relevant info related to the root associated with the callback. The MarkSweep::VerifyRoot function now uses this info to print the StackVisitor's described location if the GC root is of the type kRootJavaFrame. Some other cleanup. Example output: E/art (12167): Tried to mark 0x123 not contained by any spaces E/art (12167): Attempting see if it's a bad root E/art (12167): Found invalid root: 0x123 with type RootJavaFrame E/art (12167): Location=Visiting method 'void java.lang.Runtime.gc()' at dex PC 0xffffffff (native PC 0x0) vreg=0 (cherry picked from commit 12f7423a2bb4bfab76700d84eb6d4338d211983a) Bug: 18588862 Change-Id: Ic5a2781f704e931265ffb3621c2eab4b2e25f60f
* ART: Allow to compile interpret-only mips64 filesAndreas Gampe2015-01-151-0/+7
| | | | | | | | | | | | Include enough infrastructure to allow cross-compiling for mips64, interpret-only. This includes the instruction-set-features, frame size info and utils assembler. Also add a disassembler for oatdump, and support in patchoat. Note: the runtime cannot run mips64, yet. Change-Id: Id106581fa76b478984741c62a8a03be0f370d992
* Merge "Use unique_ptr to track ownership of dex files."Richard Uhler2015-01-141-9/+11
|\
| * Use unique_ptr to track ownership of dex files.Richard Uhler2015-01-131-9/+11
| | | | | | | | | | Bug: 18809837 Change-Id: Ie571eae8fc19ee9207390cff5c7e2a38071b126a
* | Fix bootclasspath string initializationSebastien Hertz2015-01-131-0/+10
|/ | | | | | | | | | | | | When running the runtime with an image without explicitly specifying the bootclasspath (with the -Xbootclasspath option), we construct it from the location of DEX files loaded from the image. This allows to fix the JDWP test ClassPathsTest#testClassPaths001 on the host where the bootclasspath is not explicitly specified on the command line. Bug: 18812378 Change-Id: I726eafd8b9e59dc9513beeb7082cf086fe89c4b1
* Remove back-door bootclasspath option from RuntimeRichard Uhler2015-01-081-16/+14
| | | | | | | | | | | | | | | | | The 'bootclasspath' option allowed users of the Runtime to load their own boot class path DexFiles and pass them directly to the Runtime as an option. This obscures the fact that the Runtime must take ownership of the boot class path DexFiles. This change removes the use of the bootclasspath option by dex2oat and the common runtime tests. For dex2oat, we use the existing -Xbootclasspath option instead, and introduce a new -Xbootclasspath-locations option to override the dex locations for the loaded boot class path dex files. For the common runtime tests, we simply use -Xbootclasspath. Bug: 18809837 Change-Id: Idfcd4885390bf0f3dc350993756dd337220def73
* Fix valgrind imgdiag test failure / memory leak in runtimeIgor Murashkin2015-01-071-0/+10
| | | | | Bug: 18907700 Change-Id: I399a6a64a743d3fac86b8bb5bf0eef1f23b95dc4
* Don't add or remove verifiers if abortingMathieu Chartier2014-12-151-0/+6
| | | | | | | | | | Prevents deadlock if marking verifier roots fails when we attempt to dump the stack traces. The deadlock occurs from FindLocksAtDexPC since this allocates a new verifier then adds / removes it from the method_verifiers_ array. Bug: 18651054 Change-Id: Ia9b9470ce5e4ac20bfbb39bef0283974cf487765
* Remove a dependency on AndroidConfig.h.Elliott Hughes2014-12-121-3/+2
| | | | Change-Id: I3fad347d49eb51f7a0f6d0ba9223d096a23f74a0
* Remove portable.Elliott Hughes2014-12-121-5/+0
| | | | Change-Id: I3bf3250fa866fd2265f1b115d52fa5dedc48a7fc
* Stop daemon threads in runtime shutdownMathieu Chartier2014-12-101-0/+17
| | | | | | | | | | | | Ensure that daemons are stopped and joins before bringing down the runtime. This fixes bugs related to native code still running when we shutdown the runtime. Also changed the mutex destructor to allow contenders if we are deleting a monitor lock level mutex. Bug: 18577101 Change-Id: I6457b35fd69c6997b9003b5f15f39861749843a9
* Revert "Tidy gAborting."Nicolas Geoffray2014-12-091-29/+27
| | | | | | | | Creates infinite loop: b/18674776. This reverts commit 015b137efb434528173779bc3ec8d72494456254. Change-Id: I67fe310d2e95ee2ec37bec842be06fb1123b6f4e
* Tidy gAborting.Ian Rogers2014-12-041-27/+29
| | | | | | | Reduce scope to Runtime::Abort and short-cut recursive case earlier. gAborting remains global to avoid two fatal errors in thread and the verifier. Change-Id: Ibc893f891ffee9a763c65cde9507d99083d47b3f
* Change IsZygote test to !IsCompilerMathieu Chartier2014-11-171-1/+2
| | | | | | Enables test coverage through run test 118. Change-Id: I21ce32e83629eb507b8440cebdd721d29171a984
* Don't call AddImageStringsToTable or MoveImageClassesToClassTable if running ↵Mathieu Chartier2014-11-171-2/+5
| | | | | | | | | | | | | | | imageless If we fail to create the image we use imageless running, this was breaking AddImageStringsToTable since we didn't check for this case. Added a check which avoids calling AddImageStringsToTable and MoveImageClassesToClassTable if we don't have an image. Bug: 18412472 (cherry picked from commit ab1953f35880f94752e1fcde3f6b3f0d3532125b) Change-Id: Ida18e1fcd04d752d55923e65c3122c0ac0bde728
* Instruction set features for ARM64, MIPS and X86.Ian Rogers2014-11-131-0/+1
| | | | | | | | | | | | | Also, refactor how feature strings are handled so they are additive or subtractive. Make MIPS have features for FPU 32-bit and MIPS v2. Use in the quick compiler rather than #ifdefs that wouldn't have worked in cross-compilation. Add SIMD features for x86/x86-64 proposed in: https://android-review.googlesource.com/#/c/112370/ Bug: 18056890 Change-Id: Ic88ff84a714926bd277beb74a430c5c7d5ed7666
* Add hash setMathieu Chartier2014-11-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | More memory efficient than libcxx since we do not box the values. Change intern table to use new hash set. Clean up intern table by removing const casts and deleting unnecessary code. Changed the class linker to use a hash set, also added a pre-zygote class table. 5 samples of: adb shell stop && adb shell start && sleep 60 && adb shell dumpsys meminfo Before: 165929 kB: Native 175859 kB: Native 168434 kB: Native 166559 kB: Native 169958 kB: Native After: 160972 kB: Native 159439 kB: Native 157204 kB: Native 165093 kB: Native 163039 kB: Native TODO: Add HashTable which is implemented by using a HashSet. TODO: Use for DexFile::find_class_def_misses_. TODO: Investigate using mem maps instead of native heap. Bug: 17808975 Change-Id: I93e376cf6eb9628cf52f4aefdadb6157acfb799a (cherry picked from commit e05d1d5fd86867afc7513b1c546375dba11eee50)
* ART: More warningsAndreas Gampe2014-11-041-32/+54
| | | | | | | Enable -Wno-conversion-null, -Wredundant-decls and -Wshadow in general, and -Wunused-but-set-parameter for GCC builds. Change-Id: I81bbdd762213444673c65d85edae594a523836e5
* Remove -Wno-unused-parameter and -Wno-sign-promo from base cflags.Ian Rogers2014-11-031-6/+4
| | | | | | | | | | | Fix associated errors about unused paramenters and implict sign conversions. For sign conversion this was largely in the area of enums, so add ostream operators for the effected enums and fix tools/generate-operator-out.py. Tidy arena allocation code and arena allocated data types, rather than fixing new and delete operators. Remove dead code. Change-Id: I5b433e722d2f75baacfacae4d32aef4a828bfe1b
* Add image strings to intern tableMathieu Chartier2014-11-031-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we create the runtime, we now add the image strings to the intern table if we are the zygote. This caused some memory bloat, so I added an extra unordered set to the intern table. There is now two unordered sets (hash talbe). One for pre-zygote interns and one for post-zygote interns. This helps since the pre-zygote hash table doesn't get dirtied. Even with adding the image strings, we get total memory savings of around 5-7 MB native PSS after device boot. FB launch Before: 2.20% art::DexFile::FindStringId(char const*) const TotalTime: 2069 TotalTime: 1985 TotalTime: 2088 TotalTime: 2003 TotalTime: 2034 TotalTime: 2049 After boot native PSS: 175585 kB: Native After: 0.27% art::DexFile::FindStringId(char const*) const TotalTime: 1682 TotalTime: 1756 TotalTime: 1825 TotalTime: 1751 TotalTime: 1666 TotalTime: 1813 After boot native PSS: 167089 kB: Native Bug: 18054905 Bug: 16828525 Bug: 17808975 (cherry picked from commit b6e292bf7eac9d73c6b79b1e9b7b87beb02436c9) Change-Id: Ie367f3222f8c4db409ec49c3845276908b51e9c9
* Optimize method linkingMathieu Chartier2014-10-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added more inlining, removed imt array allocation and replaced it with a handle scope. Removed some un-necessary handle scopes. Added logic to base interface method tables from the superclass so that we dont need to reconstruct for every interface (large win). Facebook launch Dalvik KK MR2: TotalTime: 3165 TotalTime: 3652 TotalTime: 3143 TotalTime: 3298 TotalTime: 3212 TotalTime: 3211 Facebook launch TOT before: WaitTime: 3702 WaitTime: 3616 WaitTime: 3616 WaitTime: 3687 WaitTime: 3742 WaitTime: 3767 After optimizations: WaitTime: 2903 WaitTime: 2953 WaitTime: 2918 WaitTime: 2940 WaitTime: 2879 WaitTime: 2792 LinkInterfaceMethods no longer one of the hottest methods, new list: 4.73% art::ClassLinker::LinkVirtualMethods(art::Thread*, art::Handle<art::mirror::Class>) 3.07% art::DexFile::FindClassDef(char const*) const 2.94% art::mirror::Class::FindDeclaredStaticField(art::mirror::DexCache const*, unsigned int) 2.90% art::DexFile::FindStringId(char const*) const Bug: 18054905 Bug: 16828525 (cherry picked from commit 1fb463e42cf1d67595cff66d19c0f99e3046f4c4) Change-Id: I27cc70178fd3655fbe5a3178887fcba189d21321
* Merge "[native bridge] Make sure we always unload the native bridge"Calin Juravle2014-10-231-14/+19
|\
| * [native bridge] Make sure we always unload the native bridgeCalin Juravle2014-10-231-14/+19
| | | | | | | | | | | | | | | | | | libnativebridge may allocate some resources during loading and intialization and de-allocate them when unloading. This makes sure that we don't leak anything. Bug: 18097480 Change-Id: I901f2d3c2ab1efb2875388f99e8c5c111ce82d5a
* | Tidy up logging.Ian Rogers2014-10-221-3/+4
|/ | | | | | | | | | | | | | | | | Move gVerboseMethods to CompilerOptions. Now "--verbose-methods=" option to dex2oat rather than runtime argument "-verbose-methods:". Move ToStr and Dumpable out of logging.h, move LogMessageData into logging.cc except for a forward declaration. Remove ConstDumpable as Dump methods are all const (and make this so if not currently true). Make LogSeverity an enum and improve compile time assertions and type checking. Remove log_severity.h that's only used in logging.h. With system headers gone from logging.h, go add to .cc files missing system header includes. Also, make operator new in ValueObject private for compile time instantiation checking. Change-Id: I3228f614500ccc9b14b49c72b9821c8b0db3d641
* Merge "Clarify a confusing error message."Elliott Hughes2014-10-211-2/+2
|\
| * Clarify a confusing error message.Elliott Hughes2014-10-211-2/+2
| | | | | | | | | | | | | | | | We didn't run out of stack; we ran out of heap so there's no stack trace in the pre-allocated exception we're throwing. Bug: 17975886 Change-Id: I406f84d7580a28451b232eba323f9c9978e678e6
* | Merge "Shut down FaultManager after shutting down threads."Vladimir Marko2014-10-211-3/+4
|\ \ | |/ |/|
| * Shut down FaultManager after shutting down threads.Vladimir Marko2014-10-201-3/+4
| | | | | | | | | | Bug: 17703163 Change-Id: I7a8454b61e887376d019af601f3a416d18bc0760
* | Refactor quick entrypointsIan Rogers2014-10-201-1/+3
|/ | | | | | | | | | | Remove FinishCalleeSaveFrameSetup. Assembly routines write down anchor into TLS as well as placing runtime method in callee save frame. Simplify artSet64InstanceFromCode by not computing the referrer from the stack in the C++ code. Move assembly offset tests next to constant declaration and tidy arch_test. Change-Id: Iededeebc05e54a1e2bb7bb3572b8ba012cffa1c8
* Merge "Stop using |instance_| in Runtime::InitNativeMethods."Piotr Jastrzebski2014-10-171-1/+1
|\
| * Stop using |instance_| in Runtime::InitNativeMethods.Piotr Jastrzebski2014-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Runtime::InitNativeMethods is a member function so we don't need to use |instance_| to call Runtime methods there. I believe that this call uses |instance_| instead of |this| because it was originally in a static Runtime::Create method. It was originally called 'instance_->InitLibraries();' and was moved to Runtime::Start which is a member function here: http://ag/#/c/133053/6/src/runtime.cc and since then it was further moved and renamed but it kept using |instance_| even though use of |this| seems more appropriate. Change-Id: I79b9d23873272ba2f124e285602f1b2683c2f27f
* | Some code clean-up.Ian Rogers2014-10-161-0/+1
| | | | | | | | Change-Id: I4b745fd5298cd61c793e3b57514b48347bd66c0e
* | Make ART compile with GCC -O0 again.Ian Rogers2014-10-161-11/+12
|/ | | | | | | | | | | | | Tidy up InstructionSetFeatures so that it has a type hierarchy dependent on architecture. Add to instruction_set_test to warn when InstructionSetFeatures don't agree with ones from system properties, AT_HWCAP and /proc/cpuinfo. Clean-up class linker entry point logic to not return entry points but to test whether the passed code is the particular entrypoint. This works around image trampolines that replicate entrypoints. Bug: 17993736 Change-Id: I5f4b49e88c3b02a79f9bee04f83395146ed7be23
* Change MemMap::maps_ to not be global variableMathieu Chartier2014-10-141-0/+3
| | | | | | | | Runtime.exit() was causing globals to get destructed at the same time that another thread was using it for allocating a new mem map. Bug: 17962201 Change-Id: I400cb7b8141d858f3c08a6fe59a02838c04c6962
* Disable kEnableJavaStackTraceHandlerBrian Carlstrom2014-10-081-1/+1
| | | | | | | | Bug: 17890306 (cherry picked from commit b6404fe0bb782cbbccda88903901fe0096a741d5) Change-Id: Ie13d6af1d384c6ebf87e8f055120609e2bff3338
* Add VMRuntime.isBootClassPathOnDiskBrian Carlstrom2014-09-301-0/+1
| | | | | | | | Bug: 17679443 (cherry picked from commit 95a935415d44903b28326424beb4db5c013ef089) Change-Id: Iba40291dead3f0b6715903c986370fd0cf1e41e1
* Fix broken runtime SetStatsEnabled logicMathieu Chartier2014-09-261-5/+9
| | | | | | | | | | | | | | | Previously, Runtime::SetStatsEnabled wouldn't take stats_enabled_ into account when deciding whether or not to increment / decrement teh stats enabled counter. This resulted in counter underflows and other errors which caused some CTS tests to fail. Also added some locking to prevent race conditions. Bug: 17360878 (cherry picked from commit a98ffd745bbecb2e84a492194950c0b94966546b) Change-Id: I21d241a58d35bd6a607aa2305c6da81720bd0886
* Merge "ART: Update for split native bridge initialization"Andreas Gampe2014-09-241-12/+13
|\