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

Unified Diff: src/type-info.cc

Issue 755513003: Hydrogen: fix keyed loads with string keys (Closed) Base URL: gh:v8/v8@master
Patch Set: better fix Created 6 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
« src/ic/ic-state.h ('K') | « 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 2c033b020061bb8479d638d59aea41674075dc9f..0a7ed460dfcb4cff20fc796d156f128721b5d61b 100644
--- a/src/type-info.cc
+++ b/src/type-info.cc
@@ -130,6 +130,21 @@ 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 = KeyedLoadICState::GetKeyType(extra_ic_state);
+ return;
+ }
+ }
+ *key_type = ELEMENT;
+}
+
+
Handle<JSFunction> TypeFeedbackOracle::GetCallTarget(
FeedbackVectorICSlot slot) {
Handle<Object> info = GetInfo(slot);
@@ -270,7 +285,10 @@ void TypeFeedbackOracle::PropertyReceiverTypes(TypeFeedbackId id,
void TypeFeedbackOracle::KeyedPropertyReceiverTypes(
- TypeFeedbackId id, SmallMapList* receiver_types, bool* is_string) {
+ TypeFeedbackId id,
+ SmallMapList* receiver_types,
+ bool* is_string,
+ IcCheckType* key_type) {
receiver_types->Clear();
CollectReceiverTypes(id, receiver_types);
@@ -280,6 +298,8 @@ void TypeFeedbackOracle::KeyedPropertyReceiverTypes(
all_strings &= receiver_types->at(i)->IsStringMap();
}
*is_string = all_strings;
+
+ GetLoadKeyType(id, key_type);
}
« src/ic/ic-state.h ('K') | « src/type-info.h ('k') | src/typing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698