Index: src/ast.h |
diff --git a/src/ast.h b/src/ast.h |
index 25cfdf59b3b50b3d907970d1316254e8f1ac4fa7..9d876b8474e969cfc418019dc43863e36f078260 100644 |
--- a/src/ast.h |
+++ b/src/ast.h |
@@ -1698,16 +1698,21 @@ class VariableProxy FINAL : public Expression { |
// Bind this proxy to the variable var. Interfaces must match. |
void BindTo(Variable* var); |
+ bool UsesVariableFeedbackSlot() const { |
+ return FLAG_vector_ics && (var()->IsUnallocated() || var()->IsLookupSlot()); |
+ } |
+ |
virtual FeedbackVectorRequirements ComputeFeedbackRequirements( |
Isolate* isolate) OVERRIDE { |
- return FeedbackVectorRequirements(0, FLAG_vector_ics ? 1 : 0); |
+ return FeedbackVectorRequirements(0, UsesVariableFeedbackSlot() ? 1 : 0); |
} |
+ |
virtual void SetFirstFeedbackICSlot(FeedbackVectorICSlot slot) OVERRIDE { |
variable_feedback_slot_ = slot; |
} |
FeedbackVectorICSlot VariableFeedbackSlot() { |
- DCHECK(!FLAG_vector_ics || !variable_feedback_slot_.IsInvalid()); |
+ DCHECK(!UsesVariableFeedbackSlot() || !variable_feedback_slot_.IsInvalid()); |
return variable_feedback_slot_; |
} |
@@ -2009,17 +2014,19 @@ class CallRuntime FINAL : public Expression { |
bool is_jsruntime() const { return function_ == NULL; } |
// Type feedback information. |
+ bool HasCallRuntimeFeedbackSlot() const { |
+ return FLAG_vector_ics && is_jsruntime(); |
+ } |
virtual FeedbackVectorRequirements ComputeFeedbackRequirements( |
Isolate* isolate) OVERRIDE { |
- return FeedbackVectorRequirements( |
- 0, (FLAG_vector_ics && is_jsruntime()) ? 1 : 0); |
+ return FeedbackVectorRequirements(0, HasCallRuntimeFeedbackSlot() ? 1 : 0); |
} |
virtual void SetFirstFeedbackICSlot(FeedbackVectorICSlot slot) OVERRIDE { |
callruntime_feedback_slot_ = slot; |
} |
FeedbackVectorICSlot CallRuntimeFeedbackSlot() { |
- DCHECK(!(FLAG_vector_ics && is_jsruntime()) || |
+ DCHECK(!HasCallRuntimeFeedbackSlot() || |
!callruntime_feedback_slot_.IsInvalid()); |
return callruntime_feedback_slot_; |
} |
@@ -2389,17 +2396,19 @@ class Yield FINAL : public Expression { |
} |
// Type feedback information. |
+ bool HasFeedbackSlots() const { |
+ return FLAG_vector_ics && (yield_kind() == kDelegating); |
+ } |
virtual FeedbackVectorRequirements ComputeFeedbackRequirements( |
Isolate* isolate) OVERRIDE { |
- return FeedbackVectorRequirements( |
- 0, (FLAG_vector_ics && yield_kind() == kDelegating) ? 3 : 0); |
+ return FeedbackVectorRequirements(0, HasFeedbackSlots() ? 3 : 0); |
} |
virtual void SetFirstFeedbackICSlot(FeedbackVectorICSlot slot) OVERRIDE { |
yield_first_feedback_slot_ = slot; |
} |
FeedbackVectorICSlot KeyedLoadFeedbackSlot() { |
- DCHECK(!FLAG_vector_ics || !yield_first_feedback_slot_.IsInvalid()); |
+ DCHECK(!HasFeedbackSlots() || !yield_first_feedback_slot_.IsInvalid()); |
return yield_first_feedback_slot_; |
} |