Index: src/contexts.h |
diff --git a/src/contexts.h b/src/contexts.h |
index 77d3e7009b8ca9311d97bbbc79c13eb4b8370810..00fdfedcff42796fac7a6fe7c5aba1c9386e1b40 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) \ |
@@ -557,6 +558,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); |