OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_AST_AST_H_ | 5 #ifndef V8_AST_AST_H_ |
6 #define V8_AST_AST_H_ | 6 #define V8_AST_AST_H_ |
7 | 7 |
8 #include "src/ast/ast-types.h" | 8 #include "src/ast/ast-types.h" |
9 #include "src/ast/ast-value-factory.h" | 9 #include "src/ast/ast-value-factory.h" |
10 #include "src/ast/modules.h" | 10 #include "src/ast/modules.h" |
(...skipping 2422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2433 bit_field_ = KeyTypeField::update(bit_field_, key_type); | 2433 bit_field_ = KeyTypeField::update(bit_field_, key_type); |
2434 } | 2434 } |
2435 void set_store_mode(KeyedAccessStoreMode mode) { | 2435 void set_store_mode(KeyedAccessStoreMode mode) { |
2436 bit_field_ = StoreModeField::update(bit_field_, mode); | 2436 bit_field_ = StoreModeField::update(bit_field_, mode); |
2437 } | 2437 } |
2438 | 2438 |
2439 void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode, | 2439 void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode, |
2440 FeedbackSlotCache* cache); | 2440 FeedbackSlotCache* cache); |
2441 FeedbackSlot AssignmentSlot() const { return slot_; } | 2441 FeedbackSlot AssignmentSlot() const { return slot_; } |
2442 | 2442 |
| 2443 FeedbackSlot CollectTypeProfileSlot() const { |
| 2444 return collect_type_profile_slot_; |
| 2445 } |
| 2446 |
2443 private: | 2447 private: |
2444 friend class AstNodeFactory; | 2448 friend class AstNodeFactory; |
2445 | 2449 |
2446 Assignment(Token::Value op, Expression* target, Expression* value, int pos); | 2450 Assignment(Token::Value op, Expression* target, Expression* value, int pos); |
2447 | 2451 |
2448 static int parent_num_ids() { return Expression::num_ids(); } | 2452 static int parent_num_ids() { return Expression::num_ids(); } |
2449 int local_id(int n) const { return base_id() + parent_num_ids() + n; } | 2453 int local_id(int n) const { return base_id() + parent_num_ids() + n; } |
2450 | 2454 |
2451 class IsUninitializedField | 2455 class IsUninitializedField |
2452 : public BitField<bool, Expression::kNextBitFieldIndex, 1> {}; | 2456 : public BitField<bool, Expression::kNextBitFieldIndex, 1> {}; |
2453 class KeyTypeField | 2457 class KeyTypeField |
2454 : public BitField<IcCheckType, IsUninitializedField::kNext, 1> {}; | 2458 : public BitField<IcCheckType, IsUninitializedField::kNext, 1> {}; |
2455 class StoreModeField | 2459 class StoreModeField |
2456 : public BitField<KeyedAccessStoreMode, KeyTypeField::kNext, 3> {}; | 2460 : public BitField<KeyedAccessStoreMode, KeyTypeField::kNext, 3> {}; |
2457 class TokenField : public BitField<Token::Value, StoreModeField::kNext, 7> {}; | 2461 class TokenField : public BitField<Token::Value, StoreModeField::kNext, 7> {}; |
2458 | 2462 |
2459 FeedbackSlot slot_; | 2463 FeedbackSlot slot_; |
| 2464 FeedbackSlot collect_type_profile_slot_; |
2460 Expression* target_; | 2465 Expression* target_; |
2461 Expression* value_; | 2466 Expression* value_; |
2462 BinaryOperation* binary_operation_; | 2467 BinaryOperation* binary_operation_; |
2463 SmallMapList receiver_types_; | 2468 SmallMapList receiver_types_; |
2464 }; | 2469 }; |
2465 | 2470 |
2466 | 2471 |
2467 // The RewritableExpression class is a wrapper for AST nodes that wait | 2472 // The RewritableExpression class is a wrapper for AST nodes that wait |
2468 // for some potential rewriting. However, even if such nodes are indeed | 2473 // for some potential rewriting. However, even if such nodes are indeed |
2469 // rewritten, the RewritableExpression wrapper nodes will survive in the | 2474 // rewritten, the RewritableExpression wrapper nodes will survive in the |
(...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3665 : NULL; \ | 3670 : NULL; \ |
3666 } | 3671 } |
3667 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3672 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
3668 #undef DECLARE_NODE_FUNCTIONS | 3673 #undef DECLARE_NODE_FUNCTIONS |
3669 | 3674 |
3670 | 3675 |
3671 } // namespace internal | 3676 } // namespace internal |
3672 } // namespace v8 | 3677 } // namespace v8 |
3673 | 3678 |
3674 #endif // V8_AST_AST_H_ | 3679 #endif // V8_AST_AST_H_ |
OLD | NEW |