aboutsummaryrefslogtreecommitdiff
path: root/vm/Exception.h
Commit message (Collapse)AuthorAgeFilesLines
* Tweak UnsatisfiedLinkErrorAndy McFadden2012-01-201-0/+1
| | | | | | | | | | | | | Change this: java.lang.UnsatisfiedLinkError: getSuperclass to this: java.lang.UnsatisfiedLinkError: Native method not found: java.lang.Class.getSuperclass:()Ljava/lang/Class; Change-Id: I23bd4350caf743ad9ba3524da0a10107c63af56a
* Normalize the include guard style.Carl Shapiro2011-06-141-3/+3
| | | | | | | | | | 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
* Get rid of uneeded extern, enum, typedef and struct qualifiers.Carl Shapiro2011-04-271-20/+11
| | | | Change-Id: I236c5a1553a51f82c9bc3eaaab042046c854d3b4
* Consolidate curFrame fields in thread storagebuzbee2011-04-221-1/+1
| | | | | | | We ended up with two locations in the Thread structure for saved Dalvik frame pointer. This change consolidates them. Change-Id: I78f288e4e57e232f29663be930101e775bfe370f
* Compile the garbage collector and heap profiler as C++.Carl Shapiro2011-04-081-0/+8
| | | | Change-Id: I25d8fa821987a3dd6d7109d07fd42dbf2fe0e589
* am 3a2e2a73: Merge "SamplingProfilerIntegration and SamplingProfiler ↵Brian Carlstrom2011-03-291-3/+4
|\ | | | | | | | | | | | | improvements (1/3)" * commit '3a2e2a73b687ba68d879e49b465778c4d589cff1': SamplingProfilerIntegration and SamplingProfiler improvements (1/3)
| * SamplingProfilerIntegration and SamplingProfiler improvements (1/3)Brian Carlstrom2011-03-291-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Clean up ArrayStoreException some more.Dan Bornstein2011-03-161-2/+27
| | | | | | | | | | | | | | | | | | | | Each of the four variants thrown by the VM now has a descriptively-named function defined in Exception.c, and the messages uniformly use human-oriented class names instead of the internal "[[Lfoo/bar/Baz;" forms. Bug: 3500987 Change-Id: I747315e36005c6d352116ce6a8af9d49c622f59a
* | Consistency in exception throws.Dan Bornstein2011-03-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the messages that consist of a series of values consistently use semicolons between the values, and make the call order for exception throws that take both "info about a thing" as well as "info about a use of that thing" take the "info about a thing" argument first. Practical upshot: Adding a second semicolon in the message for StringIndexOutOfBoundsException being thrown for a region, and switching the order of arguments of dvmThrowArrayIndexOutOfBoundsException(). Bug: 3500987 Change-Id: I97eb0046ab8997a68e2d6dfde5dbf3d02290c1f7
* | Rename some of the exception functions.Dan Bornstein2011-03-041-13/+13
| | | | | | | | | | | | | | | | Since the there is no longer a "ByClass" vs. not distinction, remove all the "ByClass"es. Bug: 3500987 Change-Id: I6bdaf5a31e8166b47c333dbbb394dc811f321c5d
* | Clean out now-unused exception code.Dan Bornstein2011-03-041-36/+21
| | | | | | | | | | | | | | | | We hereby wish a fond farewell to the throw functions that took a string name for the exception. Bug: 3500987 Change-Id: I869ddc2b4e45d3122859249d4010e452d790fa1f
* | More exception rework.Dan Bornstein2011-03-031-12/+19
| | | | | | | | | | | | | | | | | | This includes banishing dvmThrowExceptionWithClassMessage(), in favor of the "ByClass" version, as well as making the verification error throwing code use class objects. Bug: 3500987 Change-Id: I1d63cec0ffaf3a0ad17e9304ba6a21fe51072fc7
* | Set up a few more exceptions.Dan Bornstein2011-03-031-0/+12
| | | | | | | | | | | | | | I'm starting to scrape the bottom of the barrel. Bug: 3500987 Change-Id: If9c0f922506a94e78c504ea8c58176effe5fe00c
* | Yak-shaving in support of the exception cleanup.Dan Bornstein2011-03-021-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change restructures where early class initialization happens in the VM, moving a few chunks of it together into Init.c. The exception classes get moved here as well as the super-core classes needed particularly for dex optimization. This is all done to support a follow-up change that will put more of the verifier's required exceptions into the list. (Before this change, it would have been unsafe to do that.) This change also paves the way for further consolidation of class and member initialization, which I hope will make it easier to transition the whole mess into the new copying-gc world, when that arrives on the scene. Bug: 3500987 Change-Id: I0caae09432a05287af53aa36a6663997ab310985
* | Clean up a few more exceptions.Dan Bornstein2011-03-011-0/+8
| | | | | | | | | | Bug: 3500987 Change-Id: I9d6dcf429ca67a64a81e4489b1087948f9673e07
* | Clean up a few more exceptions.Dan Bornstein2011-03-011-2/+15
| | | | | | | | | | | | | | This includes a fix for ExceptionInInitializerError, which previously could have gotten thrown before itself being initialized. Change-Id: I3f27091f79b1a7e965c6261d3ff78109e0e4a23f
* | More exception cleanup.Dan Bornstein2011-02-281-2/+12
| | | | | | | | | | | | | | Most notable is that StringIndexOutOfBoundsException now gets two argument-specific helper functions. Change-Id: Ia4353589f1ee14ac337cdf637a66b89bca99a48a
* | More exception cleanup.Dan Bornstein2011-02-251-2/+2
| | | | | | | | | | | | | | | | | | Added a few more classes to the list and tweaked dvmThrowNegativeArraySizeException() to actually take the size as an argument. Still pending: Changing the assembly interp files to make better calls. Change-Id: I3a470f5fd4c9a1f7f55fc875900096c00c4ac010
* | More exception cleanup.Dan Bornstein2011-02-251-1/+22
| | | | | | | | | | | | | | | | | | | | I added a few more exception class objects, and migrated existing uses of those exceptions away from naming the class as a string. I left one TODO in the x86-atom interp, as there is nobody actively maintaining that codebase. Change-Id: I9226a2d81b0389a14f7a3770d978a9bbe98c2898
* | Round three of exception cleanup.Dan Bornstein2011-02-241-168/+174
| | | | | | | | | | | | | | | | I expanded AIOOBE since it was the odd one out, migrated the wrappers in Exception.h to the end of the file where they're less disruptive, and tweaked a couple other throws in the main vm code. Change-Id: Iae11fda2c47989ce7579483df226124ffeb2ac84
* | Round two.Dan Bornstein2011-02-231-0/+43
| | | | | | | | | | | | | | This gets most of the rest of the cases where a simple(ish) message is included with a throw. Change-Id: Id081966e5c505063c4d4dcf936037cf4d55fc8bf
* | Factor out class names from throw statements.Dan Bornstein2011-02-231-4/+143
|/ | | | | | | | | | | | | | | | | Most exception throwing now happens via purpose-built wrapper functions, each of which encapsulates the actual exception class name, reducing one source of error (examples of which I fixed during this exercise) and generally tidying things up. This change doesn't fix all uses of exception class names, nor even all throws, because (a) there were classes I didn't get to; (b) because I didn't make wrappers for all the possible throw function variants (e.g. the one that takes a cause, the one that takes varargs for string formatting, etc.); and (c) there are uses of exception classes in contexts other than throwing. But this change at least makes a dent in the problem. Change-Id: I6586ddd3e66ac0fc32c23181b17600ded0b914b2
* Better ArrayStoreException detail messages.Elliott Hughes2010-11-191-0/+5
| | | | | | | | This fixes the portable interpreter, ARM, and x86. System.arraycopy was already doing the right thing. Bug: 3216051 Change-Id: I8a675eb62d6e7fd53a009f53ce8e34f93799b18c
* Include both types in ClassCastException detail messages.Elliott Hughes2010-11-181-0/+6
| | | | | | | | | Along the lines of "java.lang.Exception cannot be cast to java.lang.String". This is ARM and portable interpreter only. x86 will come later. Bug: 3210374 Change-Id: I48719dbdb569bbc3be2a31d0e5507b8dc42101b3
* Better detail messages in ArrayIndexOutOfBoundExceptions.Elliott Hughes2010-10-211-0/+6
| | | | | | | | | | The RI only includes the index. We've traditionally included nothing. This patch fixes the portable interpreter to include both the index and the array length. Later patches will address the ARM- and x86-specific code. Change-Id: I9d0e6baacced4e1d33e6cd75965017a38571af67
* Added printf attribute to exception function.Andy McFadden2010-02-241-0/+6
|
* Add streaming method profiling support.Andy McFadden2010-01-271-0/+14
| | | | | | | | | | | | | | | | | | | | | | | The goal is to allow DDMS to start/stop method profiling in apps that don't have permission to write to /sdcard. Instead of writing the profiling data to disk and then pulling it off, we just blast the whole thing straight from memory. This includes: - New method tracing start call (startMethodTracingDdms). - Rearrangement of existing VMDebug method tracing calls for sanity. - Addition of "vector" chunk send function, with corresponding update to the JDWP transport function. - Reshuffled the method trace start interlock, which seemed racy. - Post new method-trace-profiling-streaming feature to DDMS. Also: - Added an internal exception-throw function that allows a printf format string, so we can put useful detail into exception messages. For bug 2160407.
* Correct handling of certain incompatible class changes.Andy McFadden2009-05-271-0/+7
| | | | | | | | | | | | | | | | | | | Tests 065 and 066 depened on the old behavior of the verifier. Updating them to the new behavior wasn't enough, though, because they weren't reporting the right error. The verifier's resolution code now examines the exception to see if the load failure was caused by an incompatible class change error. I also updated the description of test 071 to note that it will fail on the device if you don't have an sdcard. Added a method to get the exception "cause" field. It handles the "uninitialized" state, which I keep forgetting about. Spruced up dvmDumpObject, which hadn't been used in a while. Fixed a warning in Profile.c. For internal bug 1866729.
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+176
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-176/+0
|
* Code drop from //branches/cupcake/...@124589The Android Open Source Project2008-12-171-0/+14
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+162