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

Unified Diff: src/type-info.cc

Issue 1316953003: Vector ICs: Make the Oracle gather feedback for vector stores. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Slight update. Created 5 years, 4 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/type-info.h ('k') | src/typing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/type-info.cc
diff --git a/src/type-info.cc b/src/type-info.cc
index bffeccfbc19810e3742e185fe6e9b489edaf2f3a..15a64ef84510cddac13933d5d1fbd510980d96ee 100644
--- a/src/type-info.cc
+++ b/src/type-info.cc
@@ -131,6 +131,21 @@ bool TypeFeedbackOracle::StoreIsUninitialized(TypeFeedbackId ast_id) {
}
+bool TypeFeedbackOracle::StoreIsUninitialized(FeedbackVectorICSlot slot) {
+ if (!slot.IsInvalid()) {
+ Code::Kind kind = feedback_vector_->GetKind(slot);
+ if (kind == Code::STORE_IC) {
+ StoreICNexus nexus(feedback_vector_, slot);
+ return nexus.StateFromFeedback();
+ } else if (kind == Code::KEYED_STORE_IC) {
+ KeyedStoreICNexus nexus(feedback_vector_, slot);
+ return nexus.StateFromFeedback();
+ }
+ }
+ return true;
+}
+
+
bool TypeFeedbackOracle::CallIsUninitialized(FeedbackVectorICSlot slot) {
Handle<Object> value = GetInfo(slot);
return value->IsUndefined() ||
@@ -180,18 +195,17 @@ void TypeFeedbackOracle::GetStoreModeAndKeyType(
}
-void TypeFeedbackOracle::GetLoadKeyType(
- TypeFeedbackId ast_id, IcCheckType* key_type) {
- Handle<Object> maybe_code = GetInfo(ast_id);
- if (maybe_code->IsCode()) {
- Handle<Code> code = Handle<Code>::cast(maybe_code);
- if (code->kind() == Code::KEYED_LOAD_IC) {
- ExtraICState extra_ic_state = code->extra_ic_state();
- *key_type = KeyedLoadIC::GetKeyType(extra_ic_state);
- return;
- }
+void TypeFeedbackOracle::GetStoreModeAndKeyType(
+ FeedbackVectorICSlot slot, KeyedAccessStoreMode* store_mode,
+ IcCheckType* key_type) {
+ if (!slot.IsInvalid()) {
+ KeyedStoreICNexus nexus(feedback_vector_, slot);
+ *store_mode = nexus.GetKeyedAccessStoreMode();
+ *key_type = nexus.GetKeyType();
+ } else {
+ *store_mode = STANDARD_STORE;
+ *key_type = ELEMENT;
}
- *key_type = ELEMENT;
}
@@ -366,6 +380,15 @@ void TypeFeedbackOracle::AssignmentReceiverTypes(TypeFeedbackId id,
}
+void TypeFeedbackOracle::AssignmentReceiverTypes(FeedbackVectorICSlot slot,
+ Handle<Name> name,
+ SmallMapList* receiver_types) {
+ receiver_types->Clear();
+ Code::Flags flags = Code::ComputeHandlerFlags(Code::STORE_IC);
+ CollectReceiverTypes(slot, name, flags, receiver_types);
+}
+
+
void TypeFeedbackOracle::KeyedAssignmentReceiverTypes(
TypeFeedbackId id, SmallMapList* receiver_types,
KeyedAccessStoreMode* store_mode, IcCheckType* key_type) {
@@ -375,6 +398,15 @@ void TypeFeedbackOracle::KeyedAssignmentReceiverTypes(
}
+void TypeFeedbackOracle::KeyedAssignmentReceiverTypes(
+ FeedbackVectorICSlot slot, SmallMapList* receiver_types,
+ KeyedAccessStoreMode* store_mode, IcCheckType* key_type) {
+ receiver_types->Clear();
+ CollectReceiverTypes(slot, receiver_types);
+ GetStoreModeAndKeyType(slot, store_mode, key_type);
+}
+
+
void TypeFeedbackOracle::CountReceiverTypes(TypeFeedbackId id,
SmallMapList* receiver_types) {
receiver_types->Clear();
@@ -382,6 +414,15 @@ void TypeFeedbackOracle::CountReceiverTypes(TypeFeedbackId id,
}
+void TypeFeedbackOracle::CollectReceiverTypes(FeedbackVectorICSlot slot,
+ Handle<Name> name,
+ Code::Flags flags,
+ SmallMapList* types) {
+ StoreICNexus nexus(feedback_vector_, slot);
+ CollectReceiverTypes<FeedbackNexus>(&nexus, name, flags, types);
+}
+
+
void TypeFeedbackOracle::CollectReceiverTypes(TypeFeedbackId ast_id,
Handle<Name> name,
Code::Flags flags,
@@ -419,6 +460,13 @@ void TypeFeedbackOracle::CollectReceiverTypes(TypeFeedbackId ast_id,
}
+void TypeFeedbackOracle::CollectReceiverTypes(FeedbackVectorICSlot slot,
+ SmallMapList* types) {
+ KeyedStoreICNexus nexus(feedback_vector_, slot);
+ CollectReceiverTypes<FeedbackNexus>(&nexus, types);
+}
+
+
template <class T>
void TypeFeedbackOracle::CollectReceiverTypes(T* obj, SmallMapList* types) {
MapHandleList maps;
« no previous file with comments | « src/type-info.h ('k') | src/typing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698