Tear down the code cache when it is full and restart from scratch.
Because the code cache may be wiped out after safe points now the patching of
inline cache for predicted chains is done through the compiler thread's work
queue.
diff --git a/vm/compiler/Compiler.h b/vm/compiler/Compiler.h
index 06367a6..c66d562 100644
--- a/vm/compiler/Compiler.h
+++ b/vm/compiler/Compiler.h
@@ -38,7 +38,7 @@
typedef struct JitTranslationInfo {
void *codeAddress;
JitInstructionSetType instructionSet;
- bool discardResult; // Used for debugging divergence
+ bool discardResult; // Used for debugging divergence and IC patching
} JitTranslationInfo;
typedef enum WorkOrderKind {
@@ -46,6 +46,7 @@
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 {