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

Unified Diff: src/type-feedback-vector-inl.h

Issue 650073002: vector-based ICs did not update type feedback counts correctly. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed problematic field TypeFeedbackInfo::feedback_vector(). Created 6 years, 2 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-feedback-vector.cc ('k') | src/type-info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/type-feedback-vector-inl.h
diff --git a/src/type-feedback-vector-inl.h b/src/type-feedback-vector-inl.h
index 43e768ee5df86601fe070ff05e102b4798b78bb1..39c3826acafcfbc4b838e4971bb461f057539040 100644
--- a/src/type-feedback-vector-inl.h
+++ b/src/type-feedback-vector-inl.h
@@ -10,6 +10,93 @@
namespace v8 {
namespace internal {
+int TypeFeedbackVector::ic_with_type_info_count() {
+ return length() > 0 ? Smi::cast(get(kWithTypesIndex))->value() : 0;
+}
+
+
+void TypeFeedbackVector::change_ic_with_type_info_count(int delta) {
+ if (delta == 0) return;
+ int value = ic_with_type_info_count() + delta;
+ // Could go negative because of the debugger.
+ if (value >= 0) {
+ set(kWithTypesIndex, Smi::FromInt(value));
+ }
+}
+
+
+int TypeFeedbackVector::ic_generic_count() {
+ return length() > 0 ? Smi::cast(get(kGenericCountIndex))->value() : 0;
+}
+
+
+void TypeFeedbackVector::change_ic_generic_count(int delta) {
+ if (delta == 0) return;
+ int value = ic_generic_count() + delta;
+ if (value >= 0) {
+ set(kGenericCountIndex, Smi::FromInt(value));
+ }
+}
+
+
+int TypeFeedbackVector::Slots() {
+ if (length() == 0) return 0;
+ return Max(0, first_ic_slot_index() - kReservedIndexCount);
+}
+
+
+int TypeFeedbackVector::ICSlots() {
+ if (length() == 0) return 0;
+ return length() - first_ic_slot_index();
+}
+
+
+int TypeFeedbackVector::GetIndex(FeedbackVectorSlot slot) {
+ return kReservedIndexCount + slot.ToInt();
+}
+
+
+int TypeFeedbackVector::GetIndex(FeedbackVectorICSlot slot) {
+ int first_ic_slot = first_ic_slot_index();
+ DCHECK(slot.ToInt() < ICSlots());
+ return first_ic_slot + slot.ToInt();
+}
+
+
+FeedbackVectorSlot TypeFeedbackVector::ToSlot(int index) {
+ DCHECK(index >= kReservedIndexCount && index < first_ic_slot_index());
+ return FeedbackVectorSlot(index - kReservedIndexCount);
+}
+
+
+FeedbackVectorICSlot TypeFeedbackVector::ToICSlot(int index) {
+ DCHECK(index >= first_ic_slot_index() && index < length());
+ return FeedbackVectorICSlot(index - first_ic_slot_index());
+}
+
+
+Object* TypeFeedbackVector::Get(FeedbackVectorSlot slot) {
+ return get(GetIndex(slot));
+}
+
+
+void TypeFeedbackVector::Set(FeedbackVectorSlot slot, Object* value,
+ WriteBarrierMode mode) {
+ set(GetIndex(slot), value, mode);
+}
+
+
+Object* TypeFeedbackVector::Get(FeedbackVectorICSlot slot) {
+ return get(GetIndex(slot));
+}
+
+
+void TypeFeedbackVector::Set(FeedbackVectorICSlot slot, Object* value,
+ WriteBarrierMode mode) {
+ set(GetIndex(slot), value, mode);
+}
mvstanton 2014/10/20 07:57:44 I've moved these out of -inl.h back to .h. They do
+
+
Handle<Object> TypeFeedbackVector::UninitializedSentinel(Isolate* isolate) {
return isolate->factory()->uninitialized_symbol();
}
@@ -21,7 +108,7 @@ Handle<Object> TypeFeedbackVector::MegamorphicSentinel(Isolate* isolate) {
Handle<Object> TypeFeedbackVector::PremonomorphicSentinel(Isolate* isolate) {
- return isolate->factory()->megamorphic_symbol();
+ return isolate->factory()->premonomorphic_symbol();
}
« no previous file with comments | « src/type-feedback-vector.cc ('k') | src/type-info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698