diff options
author | Andy McFadden <fadden@android.com> | 2009-05-08 16:50:17 -0700 |
---|---|---|
committer | Andy McFadden <fadden@android.com> | 2009-05-18 07:34:57 -0700 |
commit | b51ea11c70602918c42764bfafe92a997d3b1803 (patch) | |
tree | 76e78f3d21cf0af1c2f6a822998752f0508d99d4 /libdex/DexFile.h | |
parent | d575a886761b5ddc56819cc29d3778fc5116ea88 (diff) | |
download | android_dalvik-b51ea11c70602918c42764bfafe92a997d3b1803.tar.gz android_dalvik-b51ea11c70602918c42764bfafe92a997d3b1803.tar.bz2 android_dalvik-b51ea11c70602918c42764bfafe92a997d3b1803.zip |
Defer reporting of certain verifier failures.
The verifier currently reports all failures immediately. Certain failures,
such as the failure to resolve a method, or the determination that access
to a field is not allowed, are supposed to deferred until the first time
that executing code does something that could cause the resolution.
With this change, several kinds of verification failures are deferred.
This is done by making a writable copy of the bytecode and replacing the
failing instruction with an "always throw" opcode.
Gory details:
- Added throw-verification-error instruction. Implemented in "portable"
and ARM interpreters. x86 uses portable form through stub.
- Added a function that creates a copy of a DexCode area and makes the
bytecodes writable.
- Added code that replaces a single instruction with an "always throw".
- Replaced runtime check for abstract/interface in new-instance with a
check at verification time.
- Added a test to exercise the deferred error mechanism.
- Minor cleanups (replaced tab, bad valgrind command, ...).
Diffstat (limited to 'libdex/DexFile.h')
-rw-r--r-- | libdex/DexFile.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libdex/DexFile.h b/libdex/DexFile.h index 4d8d15183..4b5fe7c1d 100644 --- a/libdex/DexFile.h +++ b/libdex/DexFile.h @@ -735,6 +735,9 @@ DEX_INLINE const char* dexGetSourceFile( return dexStringById(pDexFile, pClassDef->sourceFileIdx); } +/* get the size, in bytes, of a DexCode */ +size_t dexGetDexCodeSize(const DexCode* pCode); + /* Get the list of "tries" for the given DexCode. */ DEX_INLINE const DexTry* dexGetTries(const DexCode* pCode) { const u2* insnsEnd = &pCode->insns[pCode->insnsSize]; @@ -753,6 +756,7 @@ DEX_INLINE const u1* dexGetCatchHandlerData(const DexCode* pCode) { return (const u1*) &pTries[pCode->triesSize]; } +/* get a pointer to the start of the debugging data */ DEX_INLINE const u1* dexGetDebugInfoStream(const DexFile* pDexFile, const DexCode* pCode) { |