diff options
author | Bill Buzbee <buzbee@google.com> | 2010-03-06 23:30:57 -0800 |
---|---|---|
committer | Bill Buzbee <buzbee@google.com> | 2010-03-07 08:24:00 -0800 |
commit | fc519dc8f4444f6d93806ec15ce7445b322070fd (patch) | |
tree | 7128bbc741b5125cbe85300e1cd264ab3aca6bde /vm/compiler/Utility.c | |
parent | 164d1279b67ec13061e473cb453b1ff24189e0e0 (diff) | |
download | android_dalvik-fc519dc8f4444f6d93806ec15ce7445b322070fd.tar.gz android_dalvik-fc519dc8f4444f6d93806ec15ce7445b322070fd.tar.bz2 android_dalvik-fc519dc8f4444f6d93806ec15ce7445b322070fd.zip |
Jit: Make most Jit compile failures non-fatal; just abort offending translation
Issue 2175597 Jit compile failures should abort translation, but not the VM
Added new dvmCompileAbort() to replace uses of dvmAbort() when something goes
wrong during the compliation of a trace. In that case, we'll abort the translation
and set it's head to the interpret-only "translation".
Diffstat (limited to 'vm/compiler/Utility.c')
-rw-r--r-- | vm/compiler/Utility.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/vm/compiler/Utility.c b/vm/compiler/Utility.c index 26bb3d082..83caab745 100644 --- a/vm/compiler/Utility.c +++ b/vm/compiler/Utility.c @@ -66,11 +66,7 @@ retry: * could go above the limit we need to enhance the allocation * mechanism. */ - if (size > ARENA_DEFAULT_SIZE) { - LOGE("Requesting %d bytes which exceed the maximal size allowed\n", - size); - dvmAbort(); - } + assert(size <= ARENA_DEFAULT_SIZE); /* Time to allocate a new arena */ ArenaMemBlock *newArena = (ArenaMemBlock *) malloc(sizeof(ArenaMemBlock) + ARENA_DEFAULT_SIZE); @@ -281,3 +277,15 @@ void dvmDebugBitVector(char *msg, const BitVector *bv, int length) } } } + +void dvmCompilerAbort(CompilationUnit *cUnit) +{ + LOGE("Jit: aborting trace compilation, reverting to interpreter"); + /* Force a traceback in debug builds */ + assert(0); + /* + * Abort translation and force to interpret-only for this trace + * Matching setjmp in compiler thread work loop in Compiler.c. + */ + longjmp(*cUnit->bailPtr, 1); +} |