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 "v8.h" | 8 #include "v8.h" |
9 | 9 |
10 #include "assembler.h" | 10 #include "assembler.h" |
(...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1755 return NULL; | 1755 return NULL; |
1756 } | 1756 } |
1757 | 1757 |
1758 virtual bool IsMonomorphic() V8_OVERRIDE { | 1758 virtual bool IsMonomorphic() V8_OVERRIDE { |
1759 if (expression()->IsProperty()) { | 1759 if (expression()->IsProperty()) { |
1760 return expression()->AsProperty()->IsMonomorphic(); | 1760 return expression()->AsProperty()->IsMonomorphic(); |
1761 } | 1761 } |
1762 return !target_.is_null(); | 1762 return !target_.is_null(); |
1763 } | 1763 } |
1764 | 1764 |
1765 bool global_call() const { | |
1766 VariableProxy* proxy = expression_->AsVariableProxy(); | |
1767 return proxy != NULL && proxy->var()->IsUnallocated(); | |
1768 } | |
1769 | |
1770 bool known_global_function() const { | |
1771 return global_call() && !target_.is_null(); | |
1772 } | |
1773 | |
1774 Handle<JSFunction> target() { return target_; } | 1765 Handle<JSFunction> target() { return target_; } |
1775 | 1766 |
1776 Handle<Cell> cell() { return cell_; } | 1767 Handle<Cell> cell() { return cell_; } |
1777 | 1768 |
1778 Handle<AllocationSite> allocation_site() { return allocation_site_; } | |
1779 | |
1780 void set_target(Handle<JSFunction> target) { target_ = target; } | 1769 void set_target(Handle<JSFunction> target) { target_ = target; } |
1781 void set_allocation_site(Handle<AllocationSite> site) { | |
1782 allocation_site_ = site; | |
1783 } | |
1784 bool ComputeGlobalTarget(Handle<GlobalObject> global, LookupResult* lookup); | 1770 bool ComputeGlobalTarget(Handle<GlobalObject> global, LookupResult* lookup); |
1785 | 1771 |
1786 BailoutId ReturnId() const { return return_id_; } | 1772 BailoutId ReturnId() const { return return_id_; } |
1787 | 1773 |
1788 enum CallType { | 1774 enum CallType { |
1789 POSSIBLY_EVAL_CALL, | 1775 POSSIBLY_EVAL_CALL, |
1790 GLOBAL_CALL, | 1776 GLOBAL_CALL, |
1791 LOOKUP_SLOT_CALL, | 1777 LOOKUP_SLOT_CALL, |
1792 PROPERTY_CALL, | 1778 PROPERTY_CALL, |
1793 OTHER_CALL | 1779 OTHER_CALL |
(...skipping 22 matching lines...) Expand all Loading... |
1816 expression->AsProperty()->mark_for_call(); | 1802 expression->AsProperty()->mark_for_call(); |
1817 } | 1803 } |
1818 } | 1804 } |
1819 | 1805 |
1820 private: | 1806 private: |
1821 Expression* expression_; | 1807 Expression* expression_; |
1822 ZoneList<Expression*>* arguments_; | 1808 ZoneList<Expression*>* arguments_; |
1823 | 1809 |
1824 Handle<JSFunction> target_; | 1810 Handle<JSFunction> target_; |
1825 Handle<Cell> cell_; | 1811 Handle<Cell> cell_; |
1826 Handle<AllocationSite> allocation_site_; | |
1827 int call_feedback_slot_; | 1812 int call_feedback_slot_; |
1828 | 1813 |
1829 const BailoutId return_id_; | 1814 const BailoutId return_id_; |
1830 }; | 1815 }; |
1831 | 1816 |
1832 | 1817 |
1833 class CallNew V8_FINAL : public Expression, public FeedbackSlotInterface { | 1818 class CallNew V8_FINAL : public Expression, public FeedbackSlotInterface { |
1834 public: | 1819 public: |
1835 DECLARE_NODE_TYPE(CallNew) | 1820 DECLARE_NODE_TYPE(CallNew) |
1836 | 1821 |
(...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3348 | 3333 |
3349 private: | 3334 private: |
3350 Zone* zone_; | 3335 Zone* zone_; |
3351 Visitor visitor_; | 3336 Visitor visitor_; |
3352 }; | 3337 }; |
3353 | 3338 |
3354 | 3339 |
3355 } } // namespace v8::internal | 3340 } } // namespace v8::internal |
3356 | 3341 |
3357 #endif // V8_AST_H_ | 3342 #endif // V8_AST_H_ |
OLD | NEW |