Commit 7e6bde90 authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

Delete TypeFeedbackVectorInfo

Bug: v8:7109
Change-Id: I16759ac5c9e09a9df4117d84ae6de26cc2410faf
Reviewed-on: https://chromium-review.googlesource.com/803483Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49801}
parent e0447f99
......@@ -337,14 +337,6 @@ Handle<AccessorPair> Factory::NewAccessorPair() {
}
Handle<TypeFeedbackInfo> Factory::NewTypeFeedbackInfo() {
Handle<TypeFeedbackInfo> info =
Handle<TypeFeedbackInfo>::cast(NewStruct(TUPLE3_TYPE, TENURED));
info->initialize_storage();
return info;
}
// Internalized strings are created in the old generation (data space).
Handle<String> Factory::InternalizeUtf8String(Vector<const char> string) {
Utf8StringKey key(string, isolate()->heap()->HashSeed());
......
......@@ -168,9 +168,6 @@ class V8_EXPORT_PRIVATE Factory final {
// Create a pre-tenured empty AccessorPair.
Handle<AccessorPair> NewAccessorPair();
// Create an empty TypeFeedbackInfo.
Handle<TypeFeedbackInfo> NewTypeFeedbackInfo();
// Finds the internalized copy for string in the string table.
// If not found, a new string is added to the table and returned.
Handle<String> InternalizeUtf8String(Vector<const char> str);
......
......@@ -114,7 +114,6 @@ TYPE_CHECKER(SourcePositionTableWithFrameCache, TUPLE2_TYPE)
TYPE_CHECKER(TemplateMap, HASH_TABLE_TYPE)
TYPE_CHECKER(TemplateObjectDescription, TUPLE3_TYPE)
TYPE_CHECKER(TransitionArray, TRANSITION_ARRAY_TYPE)
TYPE_CHECKER(TypeFeedbackInfo, TUPLE3_TYPE)
TYPE_CHECKER(WasmInstanceObject, WASM_INSTANCE_TYPE)
TYPE_CHECKER(WasmMemoryObject, WASM_MEMORY_TYPE)
TYPE_CHECKER(WasmModuleObject, WASM_MODULE_TYPE)
......@@ -603,7 +602,6 @@ CAST_ACCESSOR(TemplateMap)
CAST_ACCESSOR(TemplateObjectDescription)
CAST_ACCESSOR(Tuple2)
CAST_ACCESSOR(Tuple3)
CAST_ACCESSOR(TypeFeedbackInfo)
CAST_ACCESSOR(WeakCell)
CAST_ACCESSOR(WeakHashTable)
......@@ -3407,100 +3405,6 @@ int WeakHashTableShape::GetMapRootIndex() {
return Heap::kWeakHashTableMapRootIndex;
}
int TypeFeedbackInfo::ic_total_count() {
int current = Smi::ToInt(READ_FIELD(this, kStorage1Offset));
return ICTotalCountField::decode(current);
}
void TypeFeedbackInfo::set_ic_total_count(int count) {
int value = Smi::ToInt(READ_FIELD(this, kStorage1Offset));
value = ICTotalCountField::update(value,
ICTotalCountField::decode(count));
WRITE_FIELD(this, kStorage1Offset, Smi::FromInt(value));
}
int TypeFeedbackInfo::ic_with_type_info_count() {
int current = Smi::ToInt(READ_FIELD(this, kStorage2Offset));
return ICsWithTypeInfoCountField::decode(current);
}
void TypeFeedbackInfo::change_ic_with_type_info_count(int delta) {
if (delta == 0) return;
int value = Smi::ToInt(READ_FIELD(this, kStorage2Offset));
int new_count = ICsWithTypeInfoCountField::decode(value) + delta;
// We can get negative count here when the type-feedback info is
// shared between two code objects. The can only happen when
// the debugger made a shallow copy of code object (see Heap::CopyCode).
// Since we do not optimize when the debugger is active, we can skip
// this counter update.
if (new_count >= 0) {
new_count &= ICsWithTypeInfoCountField::kMask;
value = ICsWithTypeInfoCountField::update(value, new_count);
WRITE_FIELD(this, kStorage2Offset, Smi::FromInt(value));
}
}
int TypeFeedbackInfo::ic_generic_count() {
return Smi::ToInt(READ_FIELD(this, kStorage3Offset));
}
void TypeFeedbackInfo::change_ic_generic_count(int delta) {
if (delta == 0) return;
int new_count = ic_generic_count() + delta;
if (new_count >= 0) {
new_count &= ~Smi::kMinValue;
WRITE_FIELD(this, kStorage3Offset, Smi::FromInt(new_count));
}
}
void TypeFeedbackInfo::initialize_storage() {
WRITE_FIELD(this, kStorage1Offset, Smi::kZero);
WRITE_FIELD(this, kStorage2Offset, Smi::kZero);
WRITE_FIELD(this, kStorage3Offset, Smi::kZero);
}
void TypeFeedbackInfo::change_own_type_change_checksum() {
int value = Smi::ToInt(READ_FIELD(this, kStorage1Offset));
int checksum = OwnTypeChangeChecksum::decode(value);
checksum = (checksum + 1) % (1 << kTypeChangeChecksumBits);
value = OwnTypeChangeChecksum::update(value, checksum);
// Ensure packed bit field is in Smi range.
if (value > Smi::kMaxValue) value |= Smi::kMinValue;
if (value < Smi::kMinValue) value &= ~Smi::kMinValue;
WRITE_FIELD(this, kStorage1Offset, Smi::FromInt(value));
}
void TypeFeedbackInfo::set_inlined_type_change_checksum(int checksum) {
int value = Smi::ToInt(READ_FIELD(this, kStorage2Offset));
int mask = (1 << kTypeChangeChecksumBits) - 1;
value = InlinedTypeChangeChecksum::update(value, checksum & mask);
// Ensure packed bit field is in Smi range.
if (value > Smi::kMaxValue) value |= Smi::kMinValue;
if (value < Smi::kMinValue) value &= ~Smi::kMinValue;
WRITE_FIELD(this, kStorage2Offset, Smi::FromInt(value));
}
int TypeFeedbackInfo::own_type_change_checksum() {
int value = Smi::ToInt(READ_FIELD(this, kStorage1Offset));
return OwnTypeChangeChecksum::decode(value);
}
bool TypeFeedbackInfo::matches_inlined_type_change_checksum(int checksum) {
int value = Smi::ToInt(READ_FIELD(this, kStorage2Offset));
int mask = (1 << kTypeChangeChecksumBits) - 1;
return InlinedTypeChangeChecksum::decode(value) == (checksum & mask);
}
Relocatable::Relocatable(Isolate* isolate) {
isolate_ = isolate;
prev_ = isolate->relocatable_top();
......
......@@ -896,7 +896,6 @@ class RootVisitor;
class SafepointEntry;
class SharedFunctionInfo;
class StringStream;
class TypeFeedbackInfo;
class FeedbackMetadata;
class FeedbackVector;
class WeakCell;
......@@ -1057,7 +1056,6 @@ template <class C> inline bool Is(Object* obj);
V(TemplateObjectDescription) \
V(ThinString) \
V(TransitionArray) \
V(TypeFeedbackInfo) \
V(Undetectable) \
V(UniqueName) \
V(WasmInstanceObject) \
......@@ -3881,48 +3879,6 @@ class JSPromise : public JSObject {
STATIC_ASSERT(v8::Promise::kRejected == 2);
};
class TypeFeedbackInfo : public Tuple3 {
public:
inline int ic_total_count();
inline void set_ic_total_count(int count);
inline int ic_with_type_info_count();
inline void change_ic_with_type_info_count(int delta);
inline int ic_generic_count();
inline void change_ic_generic_count(int delta);
inline void initialize_storage();
inline void change_own_type_change_checksum();
inline int own_type_change_checksum();
inline void set_inlined_type_change_checksum(int checksum);
inline bool matches_inlined_type_change_checksum(int checksum);
DECL_CAST(TypeFeedbackInfo)
static const int kStorage1Offset = kValue1Offset;
static const int kStorage2Offset = kValue2Offset;
static const int kStorage3Offset = kValue3Offset;
private:
static const int kTypeChangeChecksumBits = 7;
class ICTotalCountField: public BitField<int, 0,
kSmiValueSize - kTypeChangeChecksumBits> {}; // NOLINT
class OwnTypeChangeChecksum: public BitField<int,
kSmiValueSize - kTypeChangeChecksumBits,
kTypeChangeChecksumBits> {}; // NOLINT
class ICsWithTypeInfoCountField: public BitField<int, 0,
kSmiValueSize - kTypeChangeChecksumBits> {}; // NOLINT
class InlinedTypeChangeChecksum: public BitField<int,
kSmiValueSize - kTypeChangeChecksumBits,
kTypeChangeChecksumBits> {}; // NOLINT
DISALLOW_IMPLICIT_CONSTRUCTORS(TypeFeedbackInfo);
};
class AllocationSite: public Struct {
public:
static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment