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

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

Issue 2411873004: [ignition] Eliminate hole checks where statically possible for loads and stores (Closed)
Patch Set: Rebased Created 4 years, 2 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') | no next file with comments »
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 1653 matching lines...) Expand 10 before | Expand all | Expand 10 after
1664 bool is_resolved() const { return IsResolvedField::decode(bit_field_); } 1664 bool is_resolved() const { return IsResolvedField::decode(bit_field_); }
1665 void set_is_resolved() { 1665 void set_is_resolved() {
1666 bit_field_ = IsResolvedField::update(bit_field_, true); 1666 bit_field_ = IsResolvedField::update(bit_field_, true);
1667 } 1667 }
1668 1668
1669 bool is_new_target() const { return IsNewTargetField::decode(bit_field_); } 1669 bool is_new_target() const { return IsNewTargetField::decode(bit_field_); }
1670 void set_is_new_target() { 1670 void set_is_new_target() {
1671 bit_field_ = IsNewTargetField::update(bit_field_, true); 1671 bit_field_ = IsNewTargetField::update(bit_field_, true);
1672 } 1672 }
1673 1673
1674 bool needs_hole_check() const {
1675 return NeedsHoleCheckField::decode(bit_field_);
1676 }
1677 void set_needs_hole_check() {
1678 bit_field_ = NeedsHoleCheckField::update(bit_field_, true);
1679 }
1680
1674 int end_position() const { return end_position_; } 1681 int end_position() const { return end_position_; }
1675 1682
1676 // Bind this proxy to the variable var. 1683 // Bind this proxy to the variable var.
1677 void BindTo(Variable* var); 1684 void BindTo(Variable* var);
1678 1685
1679 bool UsesVariableFeedbackSlot() const { 1686 bool UsesVariableFeedbackSlot() const {
1680 return var()->IsUnallocated() || var()->IsLookupSlot(); 1687 return var()->IsUnallocated() || var()->IsLookupSlot();
1681 } 1688 }
1682 1689
1683 void AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec, 1690 void AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec,
(...skipping 15 matching lines...) Expand all
1699 explicit VariableProxy(const VariableProxy* copy_from); 1706 explicit VariableProxy(const VariableProxy* copy_from);
1700 1707
1701 static int parent_num_ids() { return Expression::num_ids(); } 1708 static int parent_num_ids() { return Expression::num_ids(); }
1702 int local_id(int n) const { return base_id() + parent_num_ids() + n; } 1709 int local_id(int n) const { return base_id() + parent_num_ids() + n; }
1703 1710
1704 class IsThisField : public BitField<bool, Expression::kNextBitFieldIndex, 1> { 1711 class IsThisField : public BitField<bool, Expression::kNextBitFieldIndex, 1> {
1705 }; 1712 };
1706 class IsAssignedField : public BitField<bool, IsThisField::kNext, 1> {}; 1713 class IsAssignedField : public BitField<bool, IsThisField::kNext, 1> {};
1707 class IsResolvedField : public BitField<bool, IsAssignedField::kNext, 1> {}; 1714 class IsResolvedField : public BitField<bool, IsAssignedField::kNext, 1> {};
1708 class IsNewTargetField : public BitField<bool, IsResolvedField::kNext, 1> {}; 1715 class IsNewTargetField : public BitField<bool, IsResolvedField::kNext, 1> {};
1716 class NeedsHoleCheckField
1717 : public BitField<bool, IsNewTargetField::kNext, 1> {};
1709 1718
1710 // Position is stored in the AstNode superclass, but VariableProxy needs to 1719 // Position is stored in the AstNode superclass, but VariableProxy needs to
1711 // know its end position too (for error messages). It cannot be inferred from 1720 // know its end position too (for error messages). It cannot be inferred from
1712 // the variable name length because it can contain escapes. 1721 // the variable name length because it can contain escapes.
1713 int end_position_; 1722 int end_position_;
1714 FeedbackVectorSlot variable_feedback_slot_; 1723 FeedbackVectorSlot variable_feedback_slot_;
1715 union { 1724 union {
1716 const AstRawString* raw_name_; // if !is_resolved_ 1725 const AstRawString* raw_name_; // if !is_resolved_
1717 Variable* var_; // if is_resolved_ 1726 Variable* var_; // if is_resolved_
1718 }; 1727 };
(...skipping 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after
3593 : NULL; \ 3602 : NULL; \
3594 } 3603 }
3595 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) 3604 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS)
3596 #undef DECLARE_NODE_FUNCTIONS 3605 #undef DECLARE_NODE_FUNCTIONS
3597 3606
3598 3607
3599 } // namespace internal 3608 } // namespace internal
3600 } // namespace v8 3609 } // namespace v8
3601 3610
3602 #endif // V8_AST_AST_H_ 3611 #endif // V8_AST_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/ast/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698