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

Unified Diff: src/objects.h

Issue 2504153002: [TypeFeedbackVector] Root literal arrays in function literals slots (Closed)
Patch Set: REBASE. 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/objects.h
diff --git a/src/objects.h b/src/objects.h
index dafd89df4b3ea650696777b455ff387e9eabb9fa..84f1130820d103cec12a216afb8aeadfe0105f4b 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -5310,8 +5310,11 @@ class LiteralsArray : public FixedArray {
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);
@@ -7404,14 +7407,6 @@ enum BuiltinFunctionId {
};
-// 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 {
@@ -7442,11 +7437,7 @@ class SharedFunctionInfo: public HeapObject {
DECL_ACCESSORS(optimized_code_map, FixedArray)
// Returns entry from optimized code map for specified context and OSR entry.
- // 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);
+ Code* SearchOptimizedCodeMap(Context* native_context, BailoutId osr_ast_id);
// Clear optimized code map.
void ClearOptimizedCodeMap();
@@ -7472,7 +7463,6 @@ class SharedFunctionInfo: public HeapObject {
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
@@ -7484,8 +7474,7 @@ class SharedFunctionInfo: public HeapObject {
static const int kEntriesStart = 0;
static const int kContextOffset = 0;
static const int kCachedCodeOffset = 1;
- static const int kLiteralsOffset = 2;
- static const int kEntryLength = 3;
+ static const int kEntryLength = 2;
static const int kInitialLength = kEntriesStart + kEntryLength;
static const int kNotFound = -1;
@@ -7497,8 +7486,6 @@ class SharedFunctionInfo: public HeapObject {
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)
@@ -8633,6 +8620,8 @@ class JSFunction: public JSObject {
static const int kSize = kNextFunctionLinkOffset + kPointerSize;
private:
+ inline bool needs_literals_array() const;
+
DISALLOW_IMPLICIT_CONSTRUCTORS(JSFunction);
};

Powered by Google App Engine
This is Rietveld 408576698