| 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_HYDROGEN_H_ | 5 #ifndef V8_HYDROGEN_H_ |
| 6 #define V8_HYDROGEN_H_ | 6 #define V8_HYDROGEN_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
| (...skipping 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1740 ElementsKind kind, | 1740 ElementsKind kind, |
| 1741 HValue* constructor_function = NULL); | 1741 HValue* constructor_function = NULL); |
| 1742 | 1742 |
| 1743 enum FillMode { | 1743 enum FillMode { |
| 1744 DONT_FILL_WITH_HOLE, | 1744 DONT_FILL_WITH_HOLE, |
| 1745 FILL_WITH_HOLE | 1745 FILL_WITH_HOLE |
| 1746 }; | 1746 }; |
| 1747 | 1747 |
| 1748 ElementsKind kind() { return kind_; } | 1748 ElementsKind kind() { return kind_; } |
| 1749 HAllocate* elements_location() { return elements_location_; } | 1749 HAllocate* elements_location() { return elements_location_; } |
| 1750 HValue* allocation_site() { return allocation_site_payload_; } |
| 1750 | 1751 |
| 1751 HAllocate* AllocateEmptyArray(); | 1752 HAllocate* AllocateEmptyArray(); |
| 1752 HAllocate* AllocateArray(HValue* capacity, | 1753 HAllocate* AllocateArray(HValue* capacity, |
| 1753 HValue* length_field, | 1754 HValue* length_field, |
| 1754 FillMode fill_mode = FILL_WITH_HOLE); | 1755 FillMode fill_mode = FILL_WITH_HOLE); |
| 1755 // Use these allocators when capacity could be unknown at compile time | 1756 // Use these allocators when capacity could be unknown at compile time |
| 1756 // but its limit is known. For constant |capacity| the value of | 1757 // but its limit is known. For constant |capacity| the value of |
| 1757 // |capacity_upper_bound| is ignored and the actual |capacity| | 1758 // |capacity_upper_bound| is ignored and the actual |capacity| |
| 1758 // value is used as an upper bound. | 1759 // value is used as an upper bound. |
| 1759 HAllocate* AllocateArray(HValue* capacity, | 1760 HAllocate* AllocateArray(HValue* capacity, |
| 1760 int capacity_upper_bound, | 1761 int capacity_upper_bound, |
| 1761 HValue* length_field, | 1762 HValue* length_field, |
| 1762 FillMode fill_mode = FILL_WITH_HOLE); | 1763 FillMode fill_mode = FILL_WITH_HOLE); |
| 1763 HAllocate* AllocateArray(HValue* capacity, | 1764 HAllocate* AllocateArray(HValue* capacity, |
| 1764 HConstant* capacity_upper_bound, | 1765 HConstant* capacity_upper_bound, |
| 1765 HValue* length_field, | 1766 HValue* length_field, |
| 1766 FillMode fill_mode = FILL_WITH_HOLE); | 1767 FillMode fill_mode = FILL_WITH_HOLE); |
| 1767 HValue* GetElementsLocation() { return elements_location_; } | 1768 HValue* GetElementsLocation() { return elements_location_; } |
| 1768 HValue* EmitMapCode(); | 1769 HValue* EmitMapCode(); |
| 1769 | 1770 |
| 1770 private: | 1771 private: |
| 1771 Zone* zone() const { return builder_->zone(); } | 1772 Zone* zone() const { return builder_->zone(); } |
| 1772 int elements_size() const { | 1773 int elements_size() const { |
| 1773 return IsFastDoubleElementsKind(kind_) ? kDoubleSize : kPointerSize; | 1774 return IsFastDoubleElementsKind(kind_) ? kDoubleSize : kPointerSize; |
| 1774 } | 1775 } |
| 1775 HGraphBuilder* builder() { return builder_; } | 1776 HGraphBuilder* builder() { return builder_; } |
| 1776 HGraph* graph() { return builder_->graph(); } | 1777 HGraph* graph() { return builder_->graph(); } |
| 1777 int initial_capacity() { | 1778 HConstant* initial_capacity(); |
| 1778 STATIC_ASSERT(JSArray::kPreallocatedArrayElements > 0); | |
| 1779 return JSArray::kPreallocatedArrayElements; | |
| 1780 } | |
| 1781 | 1779 |
| 1782 HValue* EmitInternalMapCode(); | 1780 HValue* EmitInternalMapCode(); |
| 1783 | 1781 |
| 1784 HGraphBuilder* builder_; | 1782 HGraphBuilder* builder_; |
| 1785 ElementsKind kind_; | 1783 ElementsKind kind_; |
| 1786 AllocationSiteMode mode_; | 1784 AllocationSiteMode mode_; |
| 1787 HValue* allocation_site_payload_; | 1785 HValue* allocation_site_payload_; |
| 1788 HValue* constructor_function_; | 1786 HValue* constructor_function_; |
| 1789 HAllocate* elements_location_; | 1787 HAllocate* elements_location_; |
| 1790 }; | 1788 }; |
| (...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2905 } | 2903 } |
| 2906 | 2904 |
| 2907 private: | 2905 private: |
| 2908 HGraphBuilder* builder_; | 2906 HGraphBuilder* builder_; |
| 2909 }; | 2907 }; |
| 2910 | 2908 |
| 2911 | 2909 |
| 2912 } } // namespace v8::internal | 2910 } } // namespace v8::internal |
| 2913 | 2911 |
| 2914 #endif // V8_HYDROGEN_H_ | 2912 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |