diff options
author | buzbee <buzbee@google.com> | 2010-08-04 15:25:06 -0700 |
---|---|---|
committer | buzbee <buzbee@google.com> | 2010-08-04 15:59:55 -0700 |
commit | bff121aa3e5d3c34caf837227cb00a46bf3f1966 (patch) | |
tree | 749877c971544c3518c00428c76d2028d7ee2402 /vm/compiler/CompilerIR.h | |
parent | 4a41958266fb432629dea30832f4b3194667ba99 (diff) | |
download | android_dalvik-bff121aa3e5d3c34caf837227cb00a46bf3f1966.tar.gz android_dalvik-bff121aa3e5d3c34caf837227cb00a46bf3f1966.tar.bz2 android_dalvik-bff121aa3e5d3c34caf837227cb00a46bf3f1966.zip |
JIT: Reworked the assembler to be smarter about short instruction forms
Previously, the JIT wasn't generating short-form compare and branch on
zero/not zero instructions for Thumb2. The reason was that these only
allow a 1-byte displacement, and when they didn't reach the assembler would
abort the trace, split it in half and try again. This change re-enables
cbz, cbnz generation and introduces a relatively lightweight retry
mechanism.
Also includes changes for Thumb2 to always generate large displacement
literal loads and conditional branches to minimize the number of retry
attempts.
Change-Id: Icf066836fad203f5c0fcbbb2ae8e1aa73d1cf816
Diffstat (limited to 'vm/compiler/CompilerIR.h')
-rw-r--r-- | vm/compiler/CompilerIR.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/vm/compiler/CompilerIR.h b/vm/compiler/CompilerIR.h index 21aadec3a..82b97e5ba 100644 --- a/vm/compiler/CompilerIR.h +++ b/vm/compiler/CompilerIR.h @@ -152,6 +152,12 @@ typedef struct BasicBlock { struct LoopAnalysis; struct RegisterPool; +typedef enum AssemblerStatus { + kSuccess, + kRetryAll, + kRetryHalve +} AssemblerStatus; + typedef struct CompilationUnit { int numInsts; int numBlocks; @@ -166,11 +172,12 @@ typedef struct CompilationUnit { int headerSize; // bytes before the first code ptr int dataOffset; // starting offset of literal pool int totalSize; // header + code size + AssemblerStatus assemblerStatus; // Success or fix and retry + int assemblerRetries; // How many times tried to fix assembly unsigned char *codeBuffer; void *baseAddr; bool printMe; bool allSingleStep; - bool halveInstCount; bool executionCount; // Add code to count trace executions bool hasLoop; // Contains a loop bool hasInvoke; // Contains an invoke instruction |