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_H_ | 5 #ifndef V8_AST_H_ |
6 #define V8_AST_H_ | 6 #define V8_AST_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
(...skipping 1642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1653 void set_is_resolved() { | 1653 void set_is_resolved() { |
1654 bit_field_ = IsResolvedField::update(bit_field_, true); | 1654 bit_field_ = IsResolvedField::update(bit_field_, true); |
1655 } | 1655 } |
1656 | 1656 |
1657 int end_position() const { return end_position_; } | 1657 int end_position() const { return end_position_; } |
1658 | 1658 |
1659 // Bind this proxy to the variable var. | 1659 // Bind this proxy to the variable var. |
1660 void BindTo(Variable* var); | 1660 void BindTo(Variable* var); |
1661 | 1661 |
1662 bool UsesVariableFeedbackSlot() const { | 1662 bool UsesVariableFeedbackSlot() const { |
1663 return var()->IsUnallocated() || var()->IsLookupSlot(); | 1663 return var()->IsUnallocatedOrGlobalSlot() || var()->IsLookupSlot(); |
1664 } | 1664 } |
1665 | 1665 |
1666 virtual FeedbackVectorRequirements ComputeFeedbackRequirements( | 1666 virtual FeedbackVectorRequirements ComputeFeedbackRequirements( |
1667 Isolate* isolate, const ICSlotCache* cache) override; | 1667 Isolate* isolate, const ICSlotCache* cache) override; |
1668 | 1668 |
1669 void SetFirstFeedbackICSlot(FeedbackVectorICSlot slot, | 1669 void SetFirstFeedbackICSlot(FeedbackVectorICSlot slot, |
1670 ICSlotCache* cache) override; | 1670 ICSlotCache* cache) override; |
1671 Code::Kind FeedbackICSlotKind(int index) override { return Code::LOAD_IC; } | 1671 Code::Kind FeedbackICSlotKind(int index) override { return Code::LOAD_IC; } |
1672 FeedbackVectorICSlot VariableFeedbackSlot() { | 1672 FeedbackVectorICSlot VariableFeedbackSlot() { |
1673 DCHECK(!UsesVariableFeedbackSlot() || !variable_feedback_slot_.IsInvalid()); | 1673 DCHECK(!UsesVariableFeedbackSlot() || !variable_feedback_slot_.IsInvalid()); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1846 | 1846 |
1847 bool IsMonomorphic() override { | 1847 bool IsMonomorphic() override { |
1848 if (expression()->IsProperty()) { | 1848 if (expression()->IsProperty()) { |
1849 return expression()->AsProperty()->IsMonomorphic(); | 1849 return expression()->AsProperty()->IsMonomorphic(); |
1850 } | 1850 } |
1851 return !target_.is_null(); | 1851 return !target_.is_null(); |
1852 } | 1852 } |
1853 | 1853 |
1854 bool global_call() const { | 1854 bool global_call() const { |
1855 VariableProxy* proxy = expression_->AsVariableProxy(); | 1855 VariableProxy* proxy = expression_->AsVariableProxy(); |
1856 return proxy != NULL && proxy->var()->IsUnallocated(); | 1856 return proxy != NULL && proxy->var()->IsUnallocatedOrGlobalSlot(); |
1857 } | 1857 } |
1858 | 1858 |
1859 bool known_global_function() const { | 1859 bool known_global_function() const { |
1860 return global_call() && !target_.is_null(); | 1860 return global_call() && !target_.is_null(); |
1861 } | 1861 } |
1862 | 1862 |
1863 Handle<JSFunction> target() { return target_; } | 1863 Handle<JSFunction> target() { return target_; } |
1864 | 1864 |
1865 Handle<AllocationSite> allocation_site() { return allocation_site_; } | 1865 Handle<AllocationSite> allocation_site() { return allocation_site_; } |
1866 | 1866 |
(...skipping 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3606 | 3606 |
3607 private: | 3607 private: |
3608 Zone* zone_; | 3608 Zone* zone_; |
3609 AstValueFactory* ast_value_factory_; | 3609 AstValueFactory* ast_value_factory_; |
3610 }; | 3610 }; |
3611 | 3611 |
3612 | 3612 |
3613 } } // namespace v8::internal | 3613 } } // namespace v8::internal |
3614 | 3614 |
3615 #endif // V8_AST_H_ | 3615 #endif // V8_AST_H_ |
OLD | NEW |