| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1698 check_type_ = RECEIVER_MAP_CHECK; | 1698 check_type_ = RECEIVER_MAP_CHECK; |
| 1699 } | 1699 } |
| 1700 | 1700 |
| 1701 Handle<JSFunction> target() { return target_; } | 1701 Handle<JSFunction> target() { return target_; } |
| 1702 | 1702 |
| 1703 // A cache for the holder, set as a side effect of computing the target of the | 1703 // A cache for the holder, set as a side effect of computing the target of the |
| 1704 // call. Note that it contains the null handle when the receiver is the same | 1704 // call. Note that it contains the null handle when the receiver is the same |
| 1705 // as the holder! | 1705 // as the holder! |
| 1706 Handle<JSObject> holder() { return holder_; } | 1706 Handle<JSObject> holder() { return holder_; } |
| 1707 | 1707 |
| 1708 Handle<JSGlobalPropertyCell> cell() { return cell_; } | 1708 Handle<Cell> cell() { return cell_; } |
| 1709 | 1709 |
| 1710 bool ComputeTarget(Handle<Map> type, Handle<String> name); | 1710 bool ComputeTarget(Handle<Map> type, Handle<String> name); |
| 1711 bool ComputeGlobalTarget(Handle<GlobalObject> global, LookupResult* lookup); | 1711 bool ComputeGlobalTarget(Handle<GlobalObject> global, LookupResult* lookup); |
| 1712 | 1712 |
| 1713 BailoutId ReturnId() const { return return_id_; } | 1713 BailoutId ReturnId() const { return return_id_; } |
| 1714 | 1714 |
| 1715 // TODO(rossberg): this should really move somewhere else (and be merged with | 1715 // TODO(rossberg): this should really move somewhere else (and be merged with |
| 1716 // various similar methods in objets.cc), but for now... | 1716 // various similar methods in objets.cc), but for now... |
| 1717 static Handle<JSObject> GetPrototypeForPrimitiveCheck( | 1717 static Handle<JSObject> GetPrototypeForPrimitiveCheck( |
| 1718 CheckType check, Isolate* isolate); | 1718 CheckType check, Isolate* isolate); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1738 private: | 1738 private: |
| 1739 Expression* expression_; | 1739 Expression* expression_; |
| 1740 ZoneList<Expression*>* arguments_; | 1740 ZoneList<Expression*>* arguments_; |
| 1741 int pos_; | 1741 int pos_; |
| 1742 | 1742 |
| 1743 bool is_monomorphic_; | 1743 bool is_monomorphic_; |
| 1744 CheckType check_type_; | 1744 CheckType check_type_; |
| 1745 SmallMapList receiver_types_; | 1745 SmallMapList receiver_types_; |
| 1746 Handle<JSFunction> target_; | 1746 Handle<JSFunction> target_; |
| 1747 Handle<JSObject> holder_; | 1747 Handle<JSObject> holder_; |
| 1748 Handle<JSGlobalPropertyCell> cell_; | 1748 Handle<Cell> cell_; |
| 1749 | 1749 |
| 1750 const BailoutId return_id_; | 1750 const BailoutId return_id_; |
| 1751 }; | 1751 }; |
| 1752 | 1752 |
| 1753 | 1753 |
| 1754 class CallNew: public Expression { | 1754 class CallNew: public Expression { |
| 1755 public: | 1755 public: |
| 1756 DECLARE_NODE_TYPE(CallNew) | 1756 DECLARE_NODE_TYPE(CallNew) |
| 1757 | 1757 |
| 1758 Expression* expression() const { return expression_; } | 1758 Expression* expression() const { return expression_; } |
| 1759 ZoneList<Expression*>* arguments() const { return arguments_; } | 1759 ZoneList<Expression*>* arguments() const { return arguments_; } |
| 1760 virtual int position() const { return pos_; } | 1760 virtual int position() const { return pos_; } |
| 1761 | 1761 |
| 1762 // Type feedback information. | 1762 // Type feedback information. |
| 1763 TypeFeedbackId CallNewFeedbackId() const { return reuse(id()); } | 1763 TypeFeedbackId CallNewFeedbackId() const { return reuse(id()); } |
| 1764 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | 1764 void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
| 1765 virtual bool IsMonomorphic() { return is_monomorphic_; } | 1765 virtual bool IsMonomorphic() { return is_monomorphic_; } |
| 1766 Handle<JSFunction> target() const { return target_; } | 1766 Handle<JSFunction> target() const { return target_; } |
| 1767 ElementsKind elements_kind() const { return elements_kind_; } | 1767 ElementsKind elements_kind() const { return elements_kind_; } |
| 1768 Handle<JSGlobalPropertyCell> allocation_info_cell() const { | 1768 Handle<Cell> allocation_info_cell() const { |
| 1769 return allocation_info_cell_; | 1769 return allocation_info_cell_; |
| 1770 } | 1770 } |
| 1771 | 1771 |
| 1772 BailoutId ReturnId() const { return return_id_; } | 1772 BailoutId ReturnId() const { return return_id_; } |
| 1773 | 1773 |
| 1774 protected: | 1774 protected: |
| 1775 CallNew(Isolate* isolate, | 1775 CallNew(Isolate* isolate, |
| 1776 Expression* expression, | 1776 Expression* expression, |
| 1777 ZoneList<Expression*>* arguments, | 1777 ZoneList<Expression*>* arguments, |
| 1778 int pos) | 1778 int pos) |
| 1779 : Expression(isolate), | 1779 : Expression(isolate), |
| 1780 expression_(expression), | 1780 expression_(expression), |
| 1781 arguments_(arguments), | 1781 arguments_(arguments), |
| 1782 pos_(pos), | 1782 pos_(pos), |
| 1783 is_monomorphic_(false), | 1783 is_monomorphic_(false), |
| 1784 elements_kind_(GetInitialFastElementsKind()), | 1784 elements_kind_(GetInitialFastElementsKind()), |
| 1785 return_id_(GetNextId(isolate)) { } | 1785 return_id_(GetNextId(isolate)) { } |
| 1786 | 1786 |
| 1787 private: | 1787 private: |
| 1788 Expression* expression_; | 1788 Expression* expression_; |
| 1789 ZoneList<Expression*>* arguments_; | 1789 ZoneList<Expression*>* arguments_; |
| 1790 int pos_; | 1790 int pos_; |
| 1791 | 1791 |
| 1792 bool is_monomorphic_; | 1792 bool is_monomorphic_; |
| 1793 Handle<JSFunction> target_; | 1793 Handle<JSFunction> target_; |
| 1794 ElementsKind elements_kind_; | 1794 ElementsKind elements_kind_; |
| 1795 Handle<JSGlobalPropertyCell> allocation_info_cell_; | 1795 Handle<Cell> allocation_info_cell_; |
| 1796 | 1796 |
| 1797 const BailoutId return_id_; | 1797 const BailoutId return_id_; |
| 1798 }; | 1798 }; |
| 1799 | 1799 |
| 1800 | 1800 |
| 1801 // The CallRuntime class does not represent any official JavaScript | 1801 // The CallRuntime class does not represent any official JavaScript |
| 1802 // language construct. Instead it is used to call a C or JS function | 1802 // language construct. Instead it is used to call a C or JS function |
| 1803 // with a set of arguments. This is used from the builtins that are | 1803 // with a set of arguments. This is used from the builtins that are |
| 1804 // implemented in JavaScript (see "v8natives.js"). | 1804 // implemented in JavaScript (see "v8natives.js"). |
| 1805 class CallRuntime: public Expression { | 1805 class CallRuntime: public Expression { |
| (...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3228 private: | 3228 private: |
| 3229 Isolate* isolate_; | 3229 Isolate* isolate_; |
| 3230 Zone* zone_; | 3230 Zone* zone_; |
| 3231 Visitor visitor_; | 3231 Visitor visitor_; |
| 3232 }; | 3232 }; |
| 3233 | 3233 |
| 3234 | 3234 |
| 3235 } } // namespace v8::internal | 3235 } } // namespace v8::internal |
| 3236 | 3236 |
| 3237 #endif // V8_AST_H_ | 3237 #endif // V8_AST_H_ |
| OLD | NEW |