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

Unified Diff: src/type-info.cc

Issue 1262803002: Stop overallocating feedback vector slots. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed nit. Created 5 years, 5 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/ast-numbering.cc ('k') | test/cctest/test-feedback-vector.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 a813311bf149c2888d0533c7a70d1851d63c0726..1b7bc8e8b614407d9acf0bd426f3ef830e5eccec 100644
--- a/src/type-info.cc
+++ b/src/type-info.cc
@@ -106,13 +106,15 @@ InlineCacheState TypeFeedbackOracle::LoadInlineCacheState(TypeFeedbackId id) {
InlineCacheState TypeFeedbackOracle::LoadInlineCacheState(
FeedbackVectorICSlot slot) {
- Code::Kind kind = feedback_vector_->GetKind(slot);
- if (kind == Code::LOAD_IC) {
- LoadICNexus nexus(feedback_vector_, slot);
- return nexus.StateFromFeedback();
- } else if (kind == Code::KEYED_LOAD_IC) {
- KeyedLoadICNexus nexus(feedback_vector_, slot);
- return nexus.StateFromFeedback();
+ if (!slot.IsInvalid()) {
+ Code::Kind kind = feedback_vector_->GetKind(slot);
+ if (kind == Code::LOAD_IC) {
+ LoadICNexus nexus(feedback_vector_, slot);
+ return nexus.StateFromFeedback();
+ } else if (kind == Code::KEYED_LOAD_IC) {
+ KeyedLoadICNexus nexus(feedback_vector_, slot);
+ return nexus.StateFromFeedback();
+ }
}
// If we can't find an IC, assume we've seen *something*, but we don't know
@@ -331,9 +333,11 @@ void TypeFeedbackOracle::PropertyReceiverTypes(FeedbackVectorICSlot slot,
Handle<Name> name,
SmallMapList* receiver_types) {
receiver_types->Clear();
- LoadICNexus nexus(feedback_vector_, slot);
- Code::Flags flags = Code::ComputeHandlerFlags(Code::LOAD_IC);
- CollectReceiverTypes(&nexus, name, flags, receiver_types);
+ if (!slot.IsInvalid()) {
+ LoadICNexus nexus(feedback_vector_, slot);
+ Code::Flags flags = Code::ComputeHandlerFlags(Code::LOAD_IC);
+ CollectReceiverTypes(&nexus, name, flags, receiver_types);
+ }
}
@@ -341,10 +345,15 @@ void TypeFeedbackOracle::KeyedPropertyReceiverTypes(
FeedbackVectorICSlot slot, SmallMapList* receiver_types, bool* is_string,
IcCheckType* key_type) {
receiver_types->Clear();
- KeyedLoadICNexus nexus(feedback_vector_, slot);
- CollectReceiverTypes<FeedbackNexus>(&nexus, receiver_types);
- *is_string = HasOnlyStringMaps(receiver_types);
- *key_type = nexus.FindFirstName() != NULL ? PROPERTY : ELEMENT;
+ if (slot.IsInvalid()) {
+ *is_string = false;
+ *key_type = ELEMENT;
+ } else {
+ KeyedLoadICNexus nexus(feedback_vector_, slot);
+ CollectReceiverTypes<FeedbackNexus>(&nexus, receiver_types);
+ *is_string = HasOnlyStringMaps(receiver_types);
+ *key_type = nexus.FindFirstName() != NULL ? PROPERTY : ELEMENT;
+ }
}
« no previous file with comments | « src/ast-numbering.cc ('k') | test/cctest/test-feedback-vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698