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

Unified Diff: src/objects.h

Issue 1205783003: Simplify interface to optimized code map lookup. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_opt-code-map-1
Patch Set: Created 5 years, 6 months 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/objects.h
diff --git a/src/objects.h b/src/objects.h
index 785fa987b71fda3665c638c524f59a7edfc37fc3..20a50d450ff3827d9a5db1842e5032fe91e37181 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -6558,6 +6558,14 @@ enum BuiltinFunctionId {
};
+// Result of searching in an optimized code map of a SharedFunctionInfo. Note
+// that {code == nullptr} indicates that no entry has been found.
+struct CodeAndLiterals {
+ Code* code; // Cached optimized code.
+ FixedArray* literals; // Cached literals array.
+};
+
+
// SharedFunctionInfo describes the JSFunction information that can be
// shared by multiple instances of the function.
class SharedFunctionInfo: public HeapObject {
@@ -6573,16 +6581,10 @@ class SharedFunctionInfo: public HeapObject {
// and a shared literals array or Smi(0) if none.
DECL_ACCESSORS(optimized_code_map, Object)
- // Returns index i of the entry with the specified context and OSR entry.
- // At position i - 1 is the context, position i the code, and i + 1 the
- // literals array. Returns -1 when no matching entry is found.
- int SearchOptimizedCodeMap(Context* native_context, BailoutId osr_ast_id);
-
- // Installs optimized code from the code map on the given closure. The
- // index has to be consistent with a search result as defined above.
- FixedArray* GetLiteralsFromOptimizedCodeMap(int index);
-
- Code* GetCodeFromOptimizedCodeMap(int index);
+ // Returns entry from optimized code map for specified context and OSR entry.
+ // Note that {code == nullptr} indicates no matching entry has been found.
+ CodeAndLiterals SearchOptimizedCodeMap(Context* native_context,
+ BailoutId osr_ast_id);
// Clear optimized code map.
void ClearOptimizedCodeMap();

Powered by Google App Engine
This is Rietveld 408576698