Chromium Code Reviews| Index: src/ast.h |
| diff --git a/src/ast.h b/src/ast.h |
| index 1a56b32c00e9d1ea96a6c31a58d82b135a133463..83691a2150f51d3182bf2ff728a2f5c7a5514b64 100644 |
| --- a/src/ast.h |
| +++ b/src/ast.h |
| @@ -1399,7 +1399,18 @@ class ObjectLiteralProperty final : public ZoneObject { |
| bool is_static() const { return is_static_; } |
| bool is_computed_name() const { return is_computed_name_; } |
| + FeedbackVectorICSlot GetSlot(int offset = 0) const { |
| + DCHECK(!FLAG_vector_stores || (offset < ic_slot_count_)); |
| + if (ic_slot_.IsInvalid()) return ic_slot_; |
| + return FeedbackVectorICSlot(ic_slot_.ToInt() + offset); |
| + } |
| + |
| + int ic_slot_count() const { return ic_slot_count_; } |
| + |
| void set_receiver_type(Handle<Map> map) { receiver_type_ = map; } |
| + void set_ic_slot_count(int count) { ic_slot_count_ = count; } |
| + |
| + void set_base_slot(int slot) { ic_slot_ = FeedbackVectorICSlot(slot); } |
| protected: |
| friend class AstNodeFactory; |
| @@ -1414,6 +1425,8 @@ class ObjectLiteralProperty final : public ZoneObject { |
| Expression* key_; |
| Expression* value_; |
| Kind kind_; |
| + FeedbackVectorICSlot ic_slot_; |
| + int ic_slot_count_; |
|
Michael Starzinger
2015/09/07 08:31:13
As discussed offline, please move these fields eit
mvstanton
2015/09/07 13:36:09
Excellent. I've reduced the two new words to one,
|
| bool emit_store_; |
| bool is_static_; |
| bool is_computed_name_; |
| @@ -1477,8 +1490,10 @@ class ObjectLiteral final : public MaterializedLiteral { |
| struct Accessors: public ZoneObject { |
| Accessors() : getter(NULL), setter(NULL) {} |
| - Expression* getter; |
| - Expression* setter; |
| + // Expression* getter; |
|
Michael Starzinger
2015/09/07 08:31:13
nit: Looks like a left-over.
|
| + // Expression* setter; |
| + ObjectLiteralProperty* getter; |
| + ObjectLiteralProperty* setter; |
| }; |
| BailoutId CreateLiteralId() const { return BailoutId(local_id(0)); } |
| @@ -1499,18 +1514,10 @@ class ObjectLiteral final : public MaterializedLiteral { |
| slot_ = slot; |
| } |
| Code::Kind FeedbackICSlotKind(int index) override { return Code::STORE_IC; } |
| - FeedbackVectorICSlot GetNthSlot(int n) const { |
| - return FeedbackVectorICSlot(slot_.ToInt() + n); |
| - } |
| - // If value needs a home object, returns a valid feedback vector ic slot |
| - // given by slot_index, and increments slot_index. |
| - FeedbackVectorICSlot SlotForHomeObject(Expression* value, |
| - int* slot_index) const; |
| - |
| -#ifdef DEBUG |
| - int slot_count() const { return slot_count_; } |
| -#endif |
| + // After feedback slots were assigned, propagate information to the properties |
| + // which need it. |
| + void LayoutFeedbackSlots(); |
| protected: |
| ObjectLiteral(Zone* zone, ZoneList<Property*>* properties, int literal_index, |
| @@ -1523,9 +1530,6 @@ class ObjectLiteral final : public MaterializedLiteral { |
| has_elements_(false), |
| may_store_doubles_(false), |
| has_function_(has_function), |
| -#ifdef DEBUG |
| - slot_count_(0), |
| -#endif |
| slot_(FeedbackVectorICSlot::Invalid()) { |
| } |
| static int parent_num_ids() { return MaterializedLiteral::num_ids(); } |
| @@ -1539,11 +1543,6 @@ class ObjectLiteral final : public MaterializedLiteral { |
| bool has_elements_; |
| bool may_store_doubles_; |
| bool has_function_; |
| -#ifdef DEBUG |
| - // slot_count_ helps validate that the logic to allocate ic slots and the |
| - // logic to use them are in sync. |
| - int slot_count_; |
| -#endif |
| FeedbackVectorICSlot slot_; |
| }; |
| @@ -2714,18 +2713,17 @@ class ClassLiteral final : public Expression { |
| slot_ = slot; |
| } |
| Code::Kind FeedbackICSlotKind(int index) override { return Code::STORE_IC; } |
| - FeedbackVectorICSlot GetNthSlot(int n) const { |
| - return FeedbackVectorICSlot(slot_.ToInt() + n); |
| + |
| + bool NeedsProxySlot() const { |
| + return FLAG_vector_stores && scope() != NULL && |
| + class_variable_proxy()->var()->IsUnallocated(); |
| } |
| - // If value needs a home object, returns a valid feedback vector ic slot |
| - // given by slot_index, and increments slot_index. |
| - FeedbackVectorICSlot SlotForHomeObject(Expression* value, |
| - int* slot_index) const; |
| + FeedbackVectorICSlot ProxySlot() const { return slot_; } |
| -#ifdef DEBUG |
| - int slot_count() const { return slot_count_; } |
| -#endif |
| + // After feedback slots were assigned, propagate information to the properties |
| + // which need it. |
| + void LayoutFeedbackSlots(); |
| protected: |
| ClassLiteral(Zone* zone, const AstRawString* name, Scope* scope, |
| @@ -2740,9 +2738,6 @@ class ClassLiteral final : public Expression { |
| constructor_(constructor), |
| properties_(properties), |
| end_position_(end_position), |
| -#ifdef DEBUG |
| - slot_count_(0), |
| -#endif |
| slot_(FeedbackVectorICSlot::Invalid()) { |
| } |
| @@ -2758,11 +2753,6 @@ class ClassLiteral final : public Expression { |
| FunctionLiteral* constructor_; |
| ZoneList<Property*>* properties_; |
| int end_position_; |
| -#ifdef DEBUG |
| - // slot_count_ helps validate that the logic to allocate ic slots and the |
| - // logic to use them are in sync. |
| - int slot_count_; |
| -#endif |
| FeedbackVectorICSlot slot_; |
| }; |