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

Unified Diff: src/type-info.cc

Issue 755513003: Hydrogen: fix keyed loads with string keys (Closed) Base URL: gh:v8/v8@master
Patch Set: rebase again 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
« no previous file with comments | « src/type-info.h ('k') | src/typing.cc » ('j') | src/typing.cc » ('J')
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 ed6d7b74e1385c4ad3a72a57569e44aac1687f3c..a18c65b12a76b680fdb86bf0b4f3f796b9e2aae6 100644
--- a/src/type-info.cc
+++ b/src/type-info.cc
@@ -156,6 +156,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 = KeyedLoadIC::GetKeyType(extra_ic_state);
+ return;
+ }
+ }
+ *key_type = ELEMENT;
+}
+
+
Handle<JSFunction> TypeFeedbackOracle::GetCallTarget(
FeedbackVectorICSlot slot) {
Handle<Object> info = GetInfo(slot);
@@ -305,10 +320,14 @@ bool TypeFeedbackOracle::HasOnlyStringMaps(SmallMapList* receiver_types) {
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);
*is_string = HasOnlyStringMaps(receiver_types);
+ GetLoadKeyType(id, key_type);
}
« no previous file with comments | « src/type-info.h ('k') | src/typing.cc » ('j') | src/typing.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698