Index: src/contexts.h |
diff --git a/src/contexts.h b/src/contexts.h |
index 0ad9d4cb2f79ab210ab10e5beba2e931a78c2a9a..4de630eb7f6146e79f5173582e3eec6313a0affb 100644 |
--- a/src/contexts.h |
+++ b/src/contexts.h |
@@ -282,6 +282,7 @@ enum ContextLookupFlags { |
V(OBJECT_FUNCTION_INDEX, JSFunction, object_function) \ |
V(OBJECT_FUNCTION_PROTOTYPE_MAP_INDEX, Map, object_function_prototype_map) \ |
V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \ |
+ V(OSR_CODE_TABLE_INDEX, FixedArray, osr_code_table) \ |
V(PROXY_CALLABLE_MAP_INDEX, Map, proxy_callable_map) \ |
V(PROXY_CONSTRUCTOR_MAP_INDEX, Map, proxy_constructor_map) \ |
V(PROXY_FUNCTION_INDEX, JSFunction, proxy_function) \ |
@@ -558,6 +559,27 @@ class Context: public FixedArray { |
inline bool HasSameSecurityTokenAs(Context* that); |
+ // Removes a specific optimized code object from the optimized code map. |
+ // In case of non-OSR the code reference is cleared from the cache entry but |
+ // the entry itself is left in the map in order to proceed sharing literals. |
+ void EvictFromOptimizedCodeMap(Code* optimized_code, const char* reason); |
+ |
+ // Clear optimized code map. |
+ void ClearOptimizedCodeMap(); |
+ |
+ // A native context keeps track of all osrd optimized functions. |
+ inline bool OptimizedCodeMapIsCleared(); |
+ void SearchOptimizedCodeMap(SharedFunctionInfo* shared, BailoutId osr_ast_id, |
+ Code** pcode, LiteralsArray** pliterals); |
+ int SearchOptimizedCodeMapEntry(SharedFunctionInfo* shared, |
+ BailoutId osr_ast_id); |
+ |
+ static void AddToOptimizedCodeMap(Handle<Context> native_context, |
+ Handle<SharedFunctionInfo> shared, |
+ Handle<Code> code, |
+ Handle<LiteralsArray> literals, |
+ BailoutId osr_ast_id); |
+ |
// A native context holds a list of all functions with optimized code. |
void AddOptimizedFunction(JSFunction* function); |
void RemoveOptimizedFunction(JSFunction* function); |