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

Unified Diff: src/objects.h

Issue 1906823002: Move of the type feedback vector to the closure. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Created 4 years, 7 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
« no previous file with comments | « src/mips64/macro-assembler-mips64.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 440768152d45f70996e8bbfe1eae31c545143338..24436f735ce89141de45a18086f18b1d4c646d67 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -856,6 +856,7 @@ class SafepointEntry;
class SharedFunctionInfo;
class StringStream;
class TypeFeedbackInfo;
+class TypeFeedbackMetadata;
class TypeFeedbackVector;
class WeakCell;
class TransitionArray;
@@ -4736,17 +4737,18 @@ class LiteralsArray : public FixedArray {
public:
static const int kVectorIndex = 0;
static const int kFirstLiteralIndex = 1;
- static const int kOffsetToFirstLiteral =
- FixedArray::kHeaderSize + kPointerSize;
+ static const int kFeedbackVectorOffset;
+ static const int kOffsetToFirstLiteral;
static int OffsetOfLiteralAt(int index) {
- return SizeFor(index + kFirstLiteralIndex);
+ return OffsetOfElementAt(index + kFirstLiteralIndex);
}
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);
inline int literals_count() const;
static Handle<LiteralsArray> New(Isolate* isolate,
@@ -6625,6 +6627,9 @@ class SharedFunctionInfo: public HeapObject {
// Clear optimized code map.
void ClearOptimizedCodeMap();
+ // Like ClearOptimizedCodeMap, but preserves literals.
+ void ClearCodeFromOptimizedCodeMap();
+
// We have a special root FixedArray with the right shape and values
// to represent the cleared optimized code map. This predicate checks
// if that root is installed.
@@ -6638,6 +6643,9 @@ class SharedFunctionInfo: public HeapObject {
// Trims the optimized code map after entries have been removed.
void TrimOptimizedCodeMap(int shrink_by);
+ static Handle<LiteralsArray> FindOrCreateLiterals(
+ Handle<SharedFunctionInfo> shared, Handle<Context> native_context);
+
// Add or update entry in the optimized code map for context-independent code.
static void AddSharedCodeToOptimizedCodeMap(Handle<SharedFunctionInfo> shared,
Handle<Code> code);
@@ -6707,16 +6715,10 @@ class SharedFunctionInfo: public HeapObject {
inline int expected_nof_properties() const;
inline void set_expected_nof_properties(int value);
- // [feedback_vector] - accumulates ast node feedback from full-codegen and
+ // [feedback_metadata] - describes ast node feedback from full-codegen and
// (increasingly) from crankshafted code where sufficient feedback isn't
// available.
- DECL_ACCESSORS(feedback_vector, TypeFeedbackVector)
-
- // Unconditionally clear the type feedback vector (including vector ICs).
- void ClearTypeFeedbackInfo();
-
- // Clear the type feedback vector with a more subtle policy at GC time.
- void ClearTypeFeedbackInfoAtGCTime();
+ DECL_ACCESSORS(feedback_metadata, TypeFeedbackMetadata)
#if TRACE_MAPS
// [unique_id] - For --trace-maps purposes, an identifier that's persistent
@@ -7035,15 +7037,15 @@ class SharedFunctionInfo: public HeapObject {
static const int kScriptOffset = kFunctionDataOffset + kPointerSize;
static const int kDebugInfoOffset = kScriptOffset + kPointerSize;
static const int kFunctionIdentifierOffset = kDebugInfoOffset + kPointerSize;
- static const int kFeedbackVectorOffset =
+ static const int kFeedbackMetadataOffset =
kFunctionIdentifierOffset + kPointerSize;
#if TRACE_MAPS
- static const int kUniqueIdOffset = kFeedbackVectorOffset + kPointerSize;
+ static const int kUniqueIdOffset = kFeedbackMetadataOffset + kPointerSize;
static const int kLastPointerFieldOffset = kUniqueIdOffset;
#else
// Just to not break the postmortrem support with conditional offsets
- static const int kUniqueIdOffset = kFeedbackVectorOffset;
- static const int kLastPointerFieldOffset = kFeedbackVectorOffset;
+ static const int kUniqueIdOffset = kFeedbackMetadataOffset;
+ static const int kLastPointerFieldOffset = kFeedbackMetadataOffset;
#endif
#if V8_HOST_ARCH_32_BIT
@@ -7493,6 +7495,15 @@ class JSFunction: public JSObject {
// access to.
DECL_ACCESSORS(literals, LiteralsArray)
+ static void EnsureLiterals(Handle<JSFunction> function);
+ inline TypeFeedbackVector* feedback_vector();
+
+ // Unconditionally clear the type feedback vector (including vector ICs).
+ void ClearTypeFeedbackInfo();
+
+ // Clear the type feedback vector with a more subtle policy at GC time.
+ void ClearTypeFeedbackInfoAtGCTime();
+
// The initial map for an object created by this constructor.
inline Map* initial_map();
static void SetInitialMap(Handle<JSFunction> function, Handle<Map> map,
« no previous file with comments | « src/mips64/macro-assembler-mips64.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698