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

Side by Side Diff: src/ast/ast.h

Issue 2707873002: Collect type profile for DevTools. (Closed)
Patch Set: Add documentation and sprinkle consts around. Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/ast/ast.cc » ('j') | src/compiler.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2396 matching lines...) Expand 10 before | Expand all | Expand 10 after
2407 bit_field_ = IsUninitializedField::update(bit_field_, b); 2407 bit_field_ = IsUninitializedField::update(bit_field_, b);
2408 } 2408 }
2409 void set_key_type(IcCheckType key_type) { 2409 void set_key_type(IcCheckType key_type) {
2410 bit_field_ = KeyTypeField::update(bit_field_, key_type); 2410 bit_field_ = KeyTypeField::update(bit_field_, key_type);
2411 } 2411 }
2412 void set_store_mode(KeyedAccessStoreMode mode) { 2412 void set_store_mode(KeyedAccessStoreMode mode) {
2413 bit_field_ = StoreModeField::update(bit_field_, mode); 2413 bit_field_ = StoreModeField::update(bit_field_, mode);
2414 } 2414 }
2415 2415
2416 void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode, 2416 void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode,
2417 FeedbackSlotCache* cache); 2417 FeedbackSlotCache* cache,
2418 bool collect_type_profile = false);
2418 FeedbackSlot AssignmentSlot() const { return slot_; } 2419 FeedbackSlot AssignmentSlot() const { return slot_; }
2419 2420
2421 FeedbackSlot CollectTypeProfileSlot() const {
Yang 2017/03/09 10:28:27 CollectTypeProfileSlot sounds like an action. Can
Franzi 2017/03/10 12:14:28 Done.
2422 DCHECK(HasCollectTypeProfileSlot());
2423 return collect_type_profile_slot_;
2424 }
2425
2426 bool HasCollectTypeProfileSlot() const {
2427 return CollectTypeProfileSlotField::decode(bit_field_);
Yang 2017/03/09 10:28:27 Do we really need this bit in the bit field? Can w
Franzi 2017/03/10 12:14:28 Done.
2428 }
2429
2420 private: 2430 private:
2421 friend class AstNodeFactory; 2431 friend class AstNodeFactory;
2422 2432
2423 Assignment(Token::Value op, Expression* target, Expression* value, int pos); 2433 Assignment(Token::Value op, Expression* target, Expression* value, int pos);
2424 2434
2425 static int parent_num_ids() { return Expression::num_ids(); } 2435 static int parent_num_ids() { return Expression::num_ids(); }
2426 int local_id(int n) const { return base_id() + parent_num_ids() + n; } 2436 int local_id(int n) const { return base_id() + parent_num_ids() + n; }
2427 2437
2428 class IsUninitializedField 2438 class IsUninitializedField
2429 : public BitField<bool, Expression::kNextBitFieldIndex, 1> {}; 2439 : public BitField<bool, Expression::kNextBitFieldIndex, 1> {};
2430 class KeyTypeField 2440 class KeyTypeField
2431 : public BitField<IcCheckType, IsUninitializedField::kNext, 1> {}; 2441 : public BitField<IcCheckType, IsUninitializedField::kNext, 1> {};
2432 class StoreModeField 2442 class StoreModeField
2433 : public BitField<KeyedAccessStoreMode, KeyTypeField::kNext, 3> {}; 2443 : public BitField<KeyedAccessStoreMode, KeyTypeField::kNext, 3> {};
2434 class TokenField : public BitField<Token::Value, StoreModeField::kNext, 7> {}; 2444 class TokenField : public BitField<Token::Value, StoreModeField::kNext, 7> {};
2445 class CollectTypeProfileSlotField
2446 : public BitField<bool, TokenField::kNext, 1> {};
2435 2447
2436 FeedbackSlot slot_; 2448 FeedbackSlot slot_;
2437 Expression* target_; 2449 Expression* target_;
2438 Expression* value_; 2450 Expression* value_;
2439 BinaryOperation* binary_operation_; 2451 BinaryOperation* binary_operation_;
2440 SmallMapList receiver_types_; 2452 SmallMapList receiver_types_;
2453
2454 FeedbackSlot collect_type_profile_slot_;
2441 }; 2455 };
2442 2456
2443 2457
2444 // The RewritableExpression class is a wrapper for AST nodes that wait 2458 // The RewritableExpression class is a wrapper for AST nodes that wait
2445 // for some potential rewriting. However, even if such nodes are indeed 2459 // for some potential rewriting. However, even if such nodes are indeed
2446 // rewritten, the RewritableExpression wrapper nodes will survive in the 2460 // rewritten, the RewritableExpression wrapper nodes will survive in the
2447 // final AST and should be just ignored, i.e., they should be treated as 2461 // final AST and should be just ignored, i.e., they should be treated as
2448 // equivalent to the wrapped nodes. For this reason and to simplify later 2462 // equivalent to the wrapped nodes. For this reason and to simplify later
2449 // phases, RewritableExpressions are considered as exceptions of AST nodes 2463 // phases, RewritableExpressions are considered as exceptions of AST nodes
2450 // in the following sense: 2464 // in the following sense:
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after
3637 : NULL; \ 3651 : NULL; \
3638 } 3652 }
3639 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) 3653 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS)
3640 #undef DECLARE_NODE_FUNCTIONS 3654 #undef DECLARE_NODE_FUNCTIONS
3641 3655
3642 3656
3643 } // namespace internal 3657 } // namespace internal
3644 } // namespace v8 3658 } // namespace v8
3645 3659
3646 #endif // V8_AST_AST_H_ 3660 #endif // V8_AST_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/ast/ast.cc » ('j') | src/compiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698