Index: src/ast.h |
diff --git a/src/ast.h b/src/ast.h |
index 97b6a60b3f5656d1a73a721866841b90c42f08d1..741b32fccba08d94a11276c0e9a01bcf045a3583 100644 |
--- a/src/ast.h |
+++ b/src/ast.h |
@@ -182,15 +182,21 @@ class AstProperties V8_FINAL BASE_EMBEDDED { |
public: |
class Flags : public EnumSet<AstPropertiesFlag, int> {}; |
- AstProperties() : node_count_(0) {} |
+AstProperties() : node_count_(0), feedback_slots_(0) {} |
Flags* flags() { return &flags_; } |
int node_count() { return node_count_; } |
void add_node_count(int count) { node_count_ += count; } |
+ int feedback_slots() const { return feedback_slots_; } |
+ void increase_feedback_slots(int count) { |
+ feedback_slots_ += count; |
+ } |
+ |
private: |
Flags flags_; |
int node_count_; |
+ int feedback_slots_; |
}; |
@@ -929,8 +935,7 @@ class ForInStatement V8_FINAL : public ForEachStatement, |
} |
// Type feedback information. |
- virtual ComputablePhase GetComputablePhase() { return DURING_PARSE; } |
- virtual int ComputeFeedbackSlotCount(Isolate* isolate) { return 1; } |
+ virtual int ComputeFeedbackSlotCount() { return 1; } |
virtual void SetFirstFeedbackSlot(int slot) { for_in_feedback_slot_ = slot; } |
int ForInFeedbackSlot() { |
@@ -1756,8 +1761,7 @@ class Call V8_FINAL : public Expression, public FeedbackSlotInterface { |
ZoneList<Expression*>* arguments() const { return arguments_; } |
// Type feedback information. |
- virtual ComputablePhase GetComputablePhase() { return AFTER_SCOPING; } |
- virtual int ComputeFeedbackSlotCount(Isolate* isolate); |
+ virtual int ComputeFeedbackSlotCount() { return 1; } |
virtual void SetFirstFeedbackSlot(int slot) { |
call_feedback_slot_ = slot; |
} |
@@ -1800,6 +1804,7 @@ class Call V8_FINAL : public Expression, public FeedbackSlotInterface { |
// Helpers to determine how to handle the call. |
CallType GetCallType(Isolate* isolate) const; |
+ bool IsUsingCallFeedbackSlot(Isolate* isolate) const; |
#ifdef DEBUG |
// Used to assert that the FullCodeGenerator records the return site. |
@@ -1841,8 +1846,7 @@ class CallNew V8_FINAL : public Expression, public FeedbackSlotInterface { |
ZoneList<Expression*>* arguments() const { return arguments_; } |
// Type feedback information. |
- virtual ComputablePhase GetComputablePhase() { return DURING_PARSE; } |
- virtual int ComputeFeedbackSlotCount(Isolate* isolate) { |
+ virtual int ComputeFeedbackSlotCount() { |
return FLAG_pretenuring_call_new ? 2 : 1; |
} |
virtual void SetFirstFeedbackSlot(int slot) { |
@@ -2378,14 +2382,8 @@ class FunctionLiteral V8_FINAL : public Expression { |
void set_ast_properties(AstProperties* ast_properties) { |
ast_properties_ = *ast_properties; |
} |
- void set_slot_processor(DeferredFeedbackSlotProcessor* slot_processor) { |
- slot_processor_ = *slot_processor; |
- } |
- void ProcessFeedbackSlots(Isolate* isolate) { |
- slot_processor_.ProcessFeedbackSlots(isolate); |
- } |
int slot_count() { |
- return slot_processor_.slot_count(); |
+ return ast_properties_.feedback_slots(); |
} |
bool dont_optimize() { return dont_optimize_reason_ != kNoReason; } |
BailoutReason dont_optimize_reason() { return dont_optimize_reason_; } |
@@ -2436,7 +2434,6 @@ class FunctionLiteral V8_FINAL : public Expression { |
ZoneList<Statement*>* body_; |
Handle<String> inferred_name_; |
AstProperties ast_properties_; |
- DeferredFeedbackSlotProcessor slot_processor_; |
BailoutReason dont_optimize_reason_; |
int materialized_literal_count_; |
@@ -2917,7 +2914,6 @@ class AstConstructionVisitor BASE_EMBEDDED { |
AstProperties* ast_properties() { return &properties_; } |
BailoutReason dont_optimize_reason() { return dont_optimize_reason_; } |
- DeferredFeedbackSlotProcessor* slot_processor() { return &slot_processor_; } |
private: |
template<class> friend class AstNodeFactory; |
@@ -2935,11 +2931,14 @@ class AstConstructionVisitor BASE_EMBEDDED { |
} |
void add_slot_node(FeedbackSlotInterface* slot_node) { |
- slot_processor_.add_slot_node(zone_, slot_node); |
+ int count = slot_node->ComputeFeedbackSlotCount(); |
+ if (count > 0) { |
+ slot_node->SetFirstFeedbackSlot(properties_.feedback_slots()); |
+ properties_.increase_feedback_slots(count); |
+ } |
} |
AstProperties properties_; |
- DeferredFeedbackSlotProcessor slot_processor_; |
BailoutReason dont_optimize_reason_; |
Zone* zone_; |
}; |