Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1174)

Unified Diff: src/contexts.h

Issue 2549753002: Store OSR'd optimized code on the native context. (Closed)
Patch Set: Improvements. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/contexts.h
diff --git a/src/contexts.h b/src/contexts.h
index e6df51053297ce5c5e0f160e61056a67097c84be..4d09f4ac7625779159271ddac1a3ecdef028427b 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(OSRD_OPTIMIZED_TABLE_INDEX, FixedArray, osrd_function_table) \
Michael Starzinger 2016/12/07 09:26:31 nit: The table stores code, not functions. How wou
mvstanton 2016/12/07 14:42:32 Good idea, thanks.
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) \
@@ -556,6 +557,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);
« no previous file with comments | « src/builtins/x64/builtins-x64.cc ('k') | src/contexts.cc » ('j') | src/contexts.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698