Index: src/objects.h |
diff --git a/src/objects.h b/src/objects.h |
index 7cbc0f4593dacb1e5fc450ca50c0174619b48dc4..c0085e3773f7f6b7f55564b1042f61ed43bdcb32 100644 |
--- a/src/objects.h |
+++ b/src/objects.h |
@@ -4997,11 +4997,8 @@ |
return OffsetOfElementAt(index + kFirstLiteralIndex); |
} |
- // Returns true if the vector isn't yet installed. |
- inline bool needs_feedback_vector() const; |
inline TypeFeedbackVector* feedback_vector() const; |
inline void set_feedback_vector(TypeFeedbackVector* vector); |
- |
inline Object* literal(int literal_index) const; |
inline void set_literal(int literal_index, Object* literal); |
inline void set_literal_undefined(int literal_index); |
@@ -7128,6 +7125,14 @@ |
}; |
+// Result of searching in an optimized code map of a SharedFunctionInfo. Note |
+// that both {code} and {literals} can be NULL to pass search result status. |
+struct CodeAndLiterals { |
+ Code* code; // Cached optimized code. |
+ LiteralsArray* literals; // Cached literals array. |
+}; |
+ |
+ |
// SharedFunctionInfo describes the JSFunction information that can be |
// shared by multiple instances of the function. |
class SharedFunctionInfo: public HeapObject { |
@@ -7158,7 +7163,11 @@ |
DECL_ACCESSORS(optimized_code_map, FixedArray) |
// Returns entry from optimized code map for specified context and OSR entry. |
- Code* SearchOptimizedCodeMap(Context* native_context, BailoutId osr_ast_id); |
+ // Note that {code == nullptr, literals == nullptr} indicates no matching |
+ // entry has been found, whereas {code, literals == nullptr} indicates that |
+ // code is context-independent. |
+ CodeAndLiterals SearchOptimizedCodeMap(Context* native_context, |
+ BailoutId osr_ast_id); |
// Clear optimized code map. |
void ClearOptimizedCodeMap(); |
@@ -7184,6 +7193,7 @@ |
static void AddToOptimizedCodeMap(Handle<SharedFunctionInfo> shared, |
Handle<Context> native_context, |
MaybeHandle<Code> code, |
+ Handle<LiteralsArray> literals, |
BailoutId osr_ast_id); |
// Set up the link between shared function info and the script. The shared |
@@ -7195,7 +7205,8 @@ |
static const int kEntriesStart = 0; |
static const int kContextOffset = 0; |
static const int kCachedCodeOffset = 1; |
- static const int kEntryLength = 2; |
+ static const int kLiteralsOffset = 2; |
+ static const int kEntryLength = 3; |
static const int kInitialLength = kEntriesStart + kEntryLength; |
static const int kNotFound = -1; |
@@ -7207,6 +7218,8 @@ |
static const int kOffsetToPreviousCachedCode = |
FixedArray::kHeaderSize + |
kPointerSize * (kCachedCodeOffset - kEntryLength); |
+ static const int kOffsetToPreviousLiterals = |
+ FixedArray::kHeaderSize + kPointerSize * (kLiteralsOffset - kEntryLength); |
// [scope_info]: Scope info. |
DECL_ACCESSORS(scope_info, ScopeInfo) |
@@ -8353,8 +8366,6 @@ |
static const int kSize = kNextFunctionLinkOffset + kPointerSize; |
private: |
- inline bool needs_literals_array() const; |
- |
DISALLOW_IMPLICIT_CONSTRUCTORS(JSFunction); |
}; |