| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| Ben Cheng | 3367245 | 2010-01-12 14:59:30 -0800 | [diff] [blame] | 17 | #include <Thread.h> |
| Bill Buzbee | fc519dc | 2010-03-06 23:30:57 -0800 | [diff] [blame] | 18 | #include <setjmp.h> |
| Ben Cheng | 3367245 | 2010-01-12 14:59:30 -0800 | [diff] [blame] | 19 | |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 20 | #ifndef _DALVIK_VM_COMPILER |
| 21 | #define _DALVIK_VM_COMPILER |
| 22 | |
| Ben Cheng | dca7143 | 2010-03-16 16:04:11 -0700 | [diff] [blame] | 23 | /* |
| 24 | * Uncomment the following to enable JIT signature breakpoint |
| 25 | * #define SIGNATURE_BREAKPOINT |
| 26 | */ |
| 27 | |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 28 | #define MAX_JIT_RUN_LEN 64 |
| 29 | #define COMPILER_WORK_QUEUE_SIZE 100 |
| Ben Cheng | c3b92b2 | 2010-01-26 16:46:15 -0800 | [diff] [blame] | 30 | #define COMPILER_IC_PATCH_QUEUE_SIZE 64 |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 31 | |
| Ben Cheng | b88ec3c | 2010-05-17 12:50:33 -0700 | [diff] [blame] | 32 | /* Architectural-independent parameters for predicted chains */ |
| 33 | #define PREDICTED_CHAIN_CLAZZ_INIT 0 |
| 34 | #define PREDICTED_CHAIN_METHOD_INIT 0 |
| 35 | #define PREDICTED_CHAIN_COUNTER_INIT 0 |
| 36 | /* A fake value which will avoid initialization and won't match any class */ |
| 37 | #define PREDICTED_CHAIN_FAKE_CLAZZ 0xdeadc001 |
| 38 | /* Has to be positive */ |
| 39 | #define PREDICTED_CHAIN_COUNTER_AVOID 0x7fffffff |
| 40 | /* Rechain after this many misses - shared globally and has to be positive */ |
| 41 | #define PREDICTED_CHAIN_COUNTER_RECHAIN 8192 |
| 42 | |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 43 | #define COMPILER_TRACED(X) |
| 44 | #define COMPILER_TRACEE(X) |
| 45 | #define COMPILER_TRACE_CHAINING(X) |
| 46 | |
| Ben Cheng | b88ec3c | 2010-05-17 12:50:33 -0700 | [diff] [blame] | 47 | /* Macro to change the permissions applied to a chunk of the code cache */ |
| Ben Cheng | b88ec3c | 2010-05-17 12:50:33 -0700 | [diff] [blame] | 48 | #define PROTECT_CODE_CACHE_ATTRS (PROT_READ | PROT_EXEC) |
| 49 | #define UNPROTECT_CODE_CACHE_ATTRS (PROT_READ | PROT_EXEC | PROT_WRITE) |
| Ben Cheng | b88ec3c | 2010-05-17 12:50:33 -0700 | [diff] [blame] | 50 | |
| 51 | /* Acquire the lock before removing PROT_WRITE from the specified mem region */ |
| 52 | #define UNPROTECT_CODE_CACHE(addr, size) \ |
| 53 | { \ |
| 54 | dvmLockMutex(&gDvmJit.codeCacheProtectionLock); \ |
| 55 | mprotect((void *) (((intptr_t) (addr)) & ~gDvmJit.pageSizeMask), \ |
| 56 | (size) + (((intptr_t) (addr)) & gDvmJit.pageSizeMask), \ |
| 57 | (UNPROTECT_CODE_CACHE_ATTRS)); \ |
| 58 | } |
| 59 | |
| 60 | /* Add the PROT_WRITE to the specified memory region then release the lock */ |
| 61 | #define PROTECT_CODE_CACHE(addr, size) \ |
| 62 | { \ |
| 63 | mprotect((void *) (((intptr_t) (addr)) & ~gDvmJit.pageSizeMask), \ |
| 64 | (size) + (((intptr_t) (addr)) & gDvmJit.pageSizeMask), \ |
| 65 | (PROTECT_CODE_CACHE_ATTRS)); \ |
| 66 | dvmUnlockMutex(&gDvmJit.codeCacheProtectionLock); \ |
| 67 | } |
| 68 | |
| Ben Cheng | 34dc796 | 2010-08-26 14:56:31 -0700 | [diff] [blame] | 69 | #define SINGLE_STEP_OP(opcode) \ |
| 70 | (gDvmJit.includeSelectedOp != \ |
| 71 | ((gDvmJit.opList[opcode >> 3] & (1 << (opcode & 0x7))) != 0)) |
| 72 | |
| Bill Buzbee | 716f120 | 2009-07-23 13:22:09 -0700 | [diff] [blame] | 73 | typedef enum JitInstructionSetType { |
| 74 | DALVIK_JIT_NONE = 0, |
| 75 | DALVIK_JIT_ARM, |
| 76 | DALVIK_JIT_THUMB, |
| 77 | DALVIK_JIT_THUMB2, |
| Bill Buzbee | 9bc3df3 | 2009-07-30 10:52:29 -0700 | [diff] [blame] | 78 | DALVIK_JIT_THUMB2EE, |
| buzbee | 7520ee7 | 2010-09-17 16:01:49 -0700 | [diff] [blame] | 79 | DALVIK_JIT_IA32 |
| Bill Buzbee | 716f120 | 2009-07-23 13:22:09 -0700 | [diff] [blame] | 80 | } JitInstructionSetType; |
| 81 | |
| 82 | /* Description of a compiled trace. */ |
| 83 | typedef struct JitTranslationInfo { |
| Ben Cheng | ccd6c01 | 2009-10-15 14:52:45 -0700 | [diff] [blame] | 84 | void *codeAddress; |
| Bill Buzbee | 716f120 | 2009-07-23 13:22:09 -0700 | [diff] [blame] | 85 | JitInstructionSetType instructionSet; |
| buzbee | 2e152ba | 2010-12-15 16:32:35 -0800 | [diff] [blame] | 86 | int profileCodeSize; |
| Ben Cheng | 60c24f4 | 2010-01-04 12:29:56 -0800 | [diff] [blame] | 87 | bool discardResult; // Used for debugging divergence and IC patching |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 88 | bool methodCompilationAborted; // Cannot compile the whole method |
| Ben Cheng | 3367245 | 2010-01-12 14:59:30 -0800 | [diff] [blame] | 89 | Thread *requestingThread; // For debugging purpose |
| Bill Buzbee | 716f120 | 2009-07-23 13:22:09 -0700 | [diff] [blame] | 90 | } JitTranslationInfo; |
| 91 | |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 92 | typedef enum WorkOrderKind { |
| 93 | kWorkOrderInvalid = 0, // Should never see by the backend |
| 94 | kWorkOrderMethod = 1, // Work is to compile a whole method |
| 95 | kWorkOrderTrace = 2, // Work is to compile code fragment(s) |
| Ben Cheng | ccd6c01 | 2009-10-15 14:52:45 -0700 | [diff] [blame] | 96 | kWorkOrderTraceDebug = 3, // Work is to compile/debug code fragment(s) |
| buzbee | 2e152ba | 2010-12-15 16:32:35 -0800 | [diff] [blame] | 97 | kWorkOrderProfileMode = 4, // Change profiling mode |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 98 | } WorkOrderKind; |
| 99 | |
| 100 | typedef struct CompilerWorkOrder { |
| 101 | const u2* pc; |
| 102 | WorkOrderKind kind; |
| 103 | void* info; |
| Bill Buzbee | 716f120 | 2009-07-23 13:22:09 -0700 | [diff] [blame] | 104 | JitTranslationInfo result; |
| Bill Buzbee | fc519dc | 2010-03-06 23:30:57 -0800 | [diff] [blame] | 105 | jmp_buf *bailPtr; |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 106 | } CompilerWorkOrder; |
| 107 | |
| Ben Cheng | c3b92b2 | 2010-01-26 16:46:15 -0800 | [diff] [blame] | 108 | /* Chain cell for predicted method invocation */ |
| 109 | typedef struct PredictedChainingCell { |
| 110 | u4 branch; /* Branch to chained destination */ |
| Ben Cheng | b88ec3c | 2010-05-17 12:50:33 -0700 | [diff] [blame] | 111 | const ClassObject *clazz; /* key for prediction */ |
| 112 | const Method *method; /* to lookup native PC from dalvik PC */ |
| 113 | const ClassObject *stagedClazz; /* possible next key for prediction */ |
| Ben Cheng | c3b92b2 | 2010-01-26 16:46:15 -0800 | [diff] [blame] | 114 | } PredictedChainingCell; |
| 115 | |
| 116 | /* Work order for inline cache patching */ |
| 117 | typedef struct ICPatchWorkOrder { |
| 118 | PredictedChainingCell *cellAddr; /* Address to be patched */ |
| 119 | PredictedChainingCell cellContent; /* content of the new cell */ |
| 120 | } ICPatchWorkOrder; |
| 121 | |
| Ben Cheng | a497359 | 2010-03-31 11:59:18 -0700 | [diff] [blame] | 122 | /* States of the dbg interpreter when serving a JIT-related request */ |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 123 | typedef enum JitState { |
| Ben Cheng | a497359 | 2010-03-31 11:59:18 -0700 | [diff] [blame] | 124 | /* Entering states in the debug interpreter */ |
| 125 | kJitNot = 0, // Non-JIT related reasons */ |
| 126 | kJitTSelectRequest = 1, // Request a trace (subject to filtering) |
| 127 | kJitTSelectRequestHot = 2, // Request a hot trace (bypass the filter) |
| 128 | kJitSelfVerification = 3, // Self Verification Mode |
| 129 | |
| 130 | /* Operational states in the debug interpreter */ |
| 131 | kJitTSelect = 4, // Actively selecting a trace |
| 132 | kJitTSelectEnd = 5, // Done with the trace - wrap it up |
| 133 | kJitSingleStep = 6, // Single step interpretation |
| 134 | kJitSingleStepEnd = 7, // Done with single step, ready return to mterp |
| 135 | kJitDone = 8, // Ready to leave the debug interpreter |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 136 | } JitState; |
| 137 | |
| Jeff Hao | 97319a8 | 2009-08-12 16:57:15 -0700 | [diff] [blame] | 138 | #if defined(WITH_SELF_VERIFICATION) |
| 139 | typedef enum SelfVerificationState { |
| 140 | kSVSIdle = 0, // Idle |
| 141 | kSVSStart = 1, // Shadow space set up, running compiled code |
| 142 | kSVSPunt = 2, // Exiting compiled code by punting |
| 143 | kSVSSingleStep = 3, // Exiting compiled code by single stepping |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 144 | kSVSNoProfile = 4, // Exiting compiled code and don't collect profiles |
| 145 | kSVSTraceSelect = 5, // Exiting compiled code and compile the next pc |
| Ben Cheng | 40094c1 | 2010-02-24 20:58:44 -0800 | [diff] [blame] | 146 | kSVSNormal = 6, // Exiting compiled code normally |
| 147 | kSVSNoChain = 7, // Exiting compiled code by no chain |
| 148 | kSVSBackwardBranch = 8, // Exiting compiled code with backward branch trace |
| 149 | kSVSDebugInterp = 9, // Normal state restored, running debug interpreter |
| Jeff Hao | 97319a8 | 2009-08-12 16:57:15 -0700 | [diff] [blame] | 150 | } SelfVerificationState; |
| 151 | #endif |
| 152 | |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 153 | typedef enum JitHint { |
| 154 | kJitHintNone = 0, |
| 155 | kJitHintTaken = 1, // Last inst in run was taken branch |
| 156 | kJitHintNotTaken = 2, // Last inst in run was not taken branch |
| 157 | kJitHintNoBias = 3, // Last inst in run was unbiased branch |
| 158 | } jitHint; |
| 159 | |
| 160 | /* |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 161 | * Element of a Jit trace description. If the isCode bit is set, it describes |
| 162 | * a contiguous sequence of Dalvik byte codes. |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 163 | */ |
| 164 | typedef struct { |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 165 | unsigned isCode:1; // If set denotes code fragments |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 166 | unsigned numInsts:8; // Number of Byte codes in run |
| 167 | unsigned runEnd:1; // Run ends with last byte code |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 168 | jitHint hint:6; // Hint to apply to final code of run |
| 169 | u2 startOffset; // Starting offset for trace run |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 170 | } JitCodeDesc; |
| 171 | |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 172 | /* |
| 173 | * A complete list of trace runs passed to the compiler looks like the |
| 174 | * following: |
| 175 | * frag1 |
| 176 | * frag2 |
| 177 | * frag3 |
| 178 | * meta1 |
| 179 | * meta2 |
| 180 | * frag4 |
| 181 | * |
| 182 | * frags 1-4 have the "isCode" field set, and metas 1-2 are plain pointers or |
| 183 | * pointers to auxiliary data structures as long as the LSB is null. |
| 184 | * The meaning of the meta content is loosely defined. It is usually the code |
| 185 | * fragment right before the first meta field (frag3 in this case) to |
| 186 | * understand and parse them. Frag4 could be a dummy one with 0 "numInsts" but |
| 187 | * the "runEnd" field set. |
| 188 | * |
| 189 | * For example, if a trace run contains a method inlining target, the class |
| 190 | * type of "this" and the currently resolved method pointer are two instances |
| 191 | * of meta information stored there. |
| 192 | */ |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 193 | typedef union { |
| 194 | JitCodeDesc frag; |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 195 | void* meta; |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 196 | } JitTraceRun; |
| 197 | |
| 198 | /* |
| 199 | * Trace description as will appear in the translation cache. Note |
| 200 | * flexible array at end, as these will be of variable size. To |
| 201 | * conserve space in the translation cache, total length of JitTraceRun |
| 202 | * array must be recomputed via seqential scan if needed. |
| 203 | */ |
| 204 | typedef struct { |
| 205 | const Method* method; |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 206 | JitTraceRun trace[0]; // Variable-length trace descriptors |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 207 | } JitTraceDescription; |
| 208 | |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 209 | typedef enum JitMethodAttributes { |
| 210 | kIsCallee = 0, /* Code is part of a callee (invoked by a hot trace) */ |
| 211 | kIsHot, /* Code is part of a hot trace */ |
| 212 | kIsLeaf, /* Method is leaf */ |
| 213 | kIsEmpty, /* Method is empty */ |
| 214 | kIsThrowFree, /* Method doesn't throw */ |
| 215 | kIsGetter, /* Method fits the getter pattern */ |
| 216 | kIsSetter, /* Method fits the setter pattern */ |
| 217 | } JitMethodAttributes; |
| 218 | |
| 219 | #define METHOD_IS_CALLEE (1 << kIsCallee) |
| 220 | #define METHOD_IS_HOT (1 << kIsHot) |
| 221 | #define METHOD_IS_LEAF (1 << kIsLeaf) |
| 222 | #define METHOD_IS_EMPTY (1 << kIsEmpty) |
| 223 | #define METHOD_IS_THROW_FREE (1 << kIsThrowFree) |
| 224 | #define METHOD_IS_GETTER (1 << kIsGetter) |
| 225 | #define METHOD_IS_SETTER (1 << kIsSetter) |
| 226 | |
| Ben Cheng | 4a41958 | 2010-08-04 13:23:09 -0700 | [diff] [blame] | 227 | /* Vectors to provide optimization hints */ |
| 228 | typedef enum JitOptimizationHints { |
| 229 | kJitOptNoLoop = 0, // Disable loop formation/optimization |
| 230 | } JitOptimizationHints; |
| 231 | |
| 232 | #define JIT_OPT_NO_LOOP (1 << kJitOptNoLoop) |
| 233 | |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame] | 234 | /* Customized node traversal orders for different needs */ |
| 235 | typedef enum DataFlowAnalysisMode { |
| 236 | kAllNodes = 0, // All nodes |
| 237 | kReachableNodes, // All reachable nodes |
| 238 | kPreOrderDFSTraversal, // Depth-First-Search / Pre-Order |
| 239 | kPostOrderDFSTraversal, // Depth-First-Search / Post-Order |
| 240 | kPostOrderDOMTraversal, // Dominator tree / Post-Order |
| 241 | } DataFlowAnalysisMode; |
| 242 | |
| Ben Cheng | 8b258bf | 2009-06-24 17:27:07 -0700 | [diff] [blame] | 243 | typedef struct CompilerMethodStats { |
| 244 | const Method *method; // Used as hash entry signature |
| 245 | int dalvikSize; // # of bytes for dalvik bytecodes |
| 246 | int compiledDalvikSize; // # of compiled dalvik bytecodes |
| 247 | int nativeSize; // # of bytes for produced native code |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 248 | int attributes; // attribute vector |
| Ben Cheng | 8b258bf | 2009-06-24 17:27:07 -0700 | [diff] [blame] | 249 | } CompilerMethodStats; |
| 250 | |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 251 | struct CompilationUnit; |
| 252 | struct BasicBlock; |
| 253 | struct SSARepresentation; |
| 254 | struct GrowableList; |
| 255 | struct JitEntry; |
| 256 | struct MIR; |
| 257 | |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 258 | bool dvmCompilerSetupCodeCache(void); |
| 259 | bool dvmCompilerArchInit(void); |
| 260 | void dvmCompilerArchDump(void); |
| 261 | bool dvmCompilerStartup(void); |
| 262 | void dvmCompilerShutdown(void); |
| 263 | bool dvmCompilerWorkEnqueue(const u2* pc, WorkOrderKind kind, void* info); |
| 264 | void *dvmCheckCodeCache(void *method); |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 265 | CompilerMethodStats *dvmCompilerAnalyzeMethodBody(const Method *method, |
| 266 | bool isCallee); |
| 267 | bool dvmCompilerCanIncludeThisInstruction(const Method *method, |
| 268 | const DecodedInstruction *insn); |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame] | 269 | bool dvmCompileMethod(const Method *method); |
| Bill Buzbee | 716f120 | 2009-07-23 13:22:09 -0700 | [diff] [blame] | 270 | bool dvmCompileTrace(JitTraceDescription *trace, int numMaxInsts, |
| Ben Cheng | 4a41958 | 2010-08-04 13:23:09 -0700 | [diff] [blame] | 271 | JitTranslationInfo *info, jmp_buf *bailPtr, int optHints); |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 272 | void dvmCompilerDumpStats(void); |
| 273 | void dvmCompilerDrainQueue(void); |
| Bill Buzbee | 46cd5b6 | 2009-06-05 15:36:06 -0700 | [diff] [blame] | 274 | void dvmJitUnchainAll(void); |
| Bill Buzbee | 716f120 | 2009-07-23 13:22:09 -0700 | [diff] [blame] | 275 | void dvmCompilerSortAndPrintTraceProfiles(void); |
| Carl Shapiro | 3f349af | 2010-02-25 15:47:08 -0800 | [diff] [blame] | 276 | void dvmCompilerPerformSafePointChecks(void); |
| Ben Cheng | 7a2697d | 2010-06-07 13:44:23 -0700 | [diff] [blame] | 277 | void dvmCompilerInlineMIR(struct CompilationUnit *cUnit); |
| Ben Cheng | 4238ec2 | 2009-08-24 16:32:22 -0700 | [diff] [blame] | 278 | void dvmInitializeSSAConversion(struct CompilationUnit *cUnit); |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame] | 279 | int dvmConvertSSARegToDalvik(const struct CompilationUnit *cUnit, int ssaReg); |
| Ben Cheng | 4a41958 | 2010-08-04 13:23:09 -0700 | [diff] [blame] | 280 | bool dvmCompilerLoopOpt(struct CompilationUnit *cUnit); |
| Ben Cheng | 4238ec2 | 2009-08-24 16:32:22 -0700 | [diff] [blame] | 281 | void dvmCompilerNonLoopAnalysis(struct CompilationUnit *cUnit); |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame] | 282 | bool dvmCompilerFindLocalLiveIn(struct CompilationUnit *cUnit, |
| Ben Cheng | 4238ec2 | 2009-08-24 16:32:22 -0700 | [diff] [blame] | 283 | struct BasicBlock *bb); |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame] | 284 | bool dvmCompilerDoSSAConversion(struct CompilationUnit *cUnit, |
| 285 | struct BasicBlock *bb); |
| 286 | bool dvmCompilerDoConstantPropagation(struct CompilationUnit *cUnit, |
| Ben Cheng | 4238ec2 | 2009-08-24 16:32:22 -0700 | [diff] [blame] | 287 | struct BasicBlock *bb); |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame] | 288 | bool dvmCompilerFindInductionVariables(struct CompilationUnit *cUnit, |
| Ben Cheng | 4238ec2 | 2009-08-24 16:32:22 -0700 | [diff] [blame] | 289 | struct BasicBlock *bb); |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame] | 290 | /* Clear the visited flag for each BB */ |
| 291 | bool dvmCompilerClearVisitedFlag(struct CompilationUnit *cUnit, |
| 292 | struct BasicBlock *bb); |
| 293 | char *dvmCompilerGetDalvikDisassembly(const DecodedInstruction *insn, |
| 294 | char *note); |
| 295 | char *dvmCompilerFullDisassembler(const struct CompilationUnit *cUnit, |
| 296 | const struct MIR *mir); |
| Ben Cheng | 4238ec2 | 2009-08-24 16:32:22 -0700 | [diff] [blame] | 297 | char *dvmCompilerGetSSAString(struct CompilationUnit *cUnit, |
| 298 | struct SSARepresentation *ssaRep); |
| 299 | void dvmCompilerDataFlowAnalysisDispatcher(struct CompilationUnit *cUnit, |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame] | 300 | bool (*func)(struct CompilationUnit *, struct BasicBlock *), |
| 301 | DataFlowAnalysisMode dfaMode, |
| 302 | bool isIterative); |
| 303 | void dvmCompilerMethodSSATransformation(struct CompilationUnit *cUnit); |
| Bill Buzbee | 06bb839 | 2010-01-31 18:53:15 -0800 | [diff] [blame] | 304 | void dvmCompilerStateRefresh(void); |
| Ben Cheng | 88a0f97 | 2010-02-24 15:00:40 -0800 | [diff] [blame] | 305 | JitTraceDescription *dvmCopyTraceDescriptor(const u2 *pc, |
| 306 | const struct JitEntry *desc); |
| Bill Buzbee | bd04724 | 2010-05-13 13:02:53 -0700 | [diff] [blame] | 307 | void *dvmCompilerGetInterpretTemplate(); |
| Ben Cheng | ba4fc8b | 2009-06-01 13:00:29 -0700 | [diff] [blame] | 308 | #endif /* _DALVIK_VM_COMPILER */ |