summaryrefslogtreecommitdiffstats
path: root/vm/compiler/Compiler.h
diff options
context:
space:
mode:
Diffstat (limited to 'vm/compiler/Compiler.h')
-rw-r--r--vm/compiler/Compiler.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/vm/compiler/Compiler.h b/vm/compiler/Compiler.h
index 6b4d41424..153e84568 100644
--- a/vm/compiler/Compiler.h
+++ b/vm/compiler/Compiler.h
@@ -22,6 +22,7 @@
#define CODE_CACHE_SIZE 1024*1024
#define MAX_JIT_RUN_LEN 64
#define COMPILER_WORK_QUEUE_SIZE 100
+#define COMPILER_IC_PATCH_QUEUE_SIZE 64
#define COMPILER_TRACED(X)
#define COMPILER_TRACEE(X)
@@ -49,7 +50,6 @@ typedef enum WorkOrderKind {
kWorkOrderMethod = 1, // Work is to compile a whole method
kWorkOrderTrace = 2, // Work is to compile code fragment(s)
kWorkOrderTraceDebug = 3, // Work is to compile/debug code fragment(s)
- kWorkOrderICPatch = 4, // Work is to patch a polymorphic callsite
} WorkOrderKind;
typedef struct CompilerWorkOrder {
@@ -59,6 +59,20 @@ typedef struct CompilerWorkOrder {
JitTranslationInfo result;
} CompilerWorkOrder;
+/* Chain cell for predicted method invocation */
+typedef struct PredictedChainingCell {
+ u4 branch; /* Branch to chained destination */
+ const ClassObject *clazz; /* key #1 for prediction */
+ const Method *method; /* key #2 to lookup native PC from dalvik PC */
+ u4 counter; /* counter to patch the chaining cell */
+} PredictedChainingCell;
+
+/* Work order for inline cache patching */
+typedef struct ICPatchWorkOrder {
+ PredictedChainingCell *cellAddr; /* Address to be patched */
+ PredictedChainingCell cellContent; /* content of the new cell */
+} ICPatchWorkOrder;
+
typedef enum JitState {
kJitOff = 0,
kJitNormal = 1, // Profiling in mterp or running native