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 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1641 return IsFastDoubleElementsKind(kind_) ? kDoubleSize : kPointerSize; | 1641 return IsFastDoubleElementsKind(kind_) ? kDoubleSize : kPointerSize; |
1642 } | 1642 } |
1643 HGraphBuilder* builder() { return builder_; } | 1643 HGraphBuilder* builder() { return builder_; } |
1644 HGraph* graph() { return builder_->graph(); } | 1644 HGraph* graph() { return builder_->graph(); } |
1645 int initial_capacity() { | 1645 int initial_capacity() { |
1646 STATIC_ASSERT(JSArray::kPreallocatedArrayElements > 0); | 1646 STATIC_ASSERT(JSArray::kPreallocatedArrayElements > 0); |
1647 return JSArray::kPreallocatedArrayElements; | 1647 return JSArray::kPreallocatedArrayElements; |
1648 } | 1648 } |
1649 | 1649 |
1650 HValue* EmitInternalMapCode(); | 1650 HValue* EmitInternalMapCode(); |
1651 HValue* EstablishEmptyArrayAllocationSize(); | |
1652 HValue* EstablishAllocationSize(HValue* length_node); | |
1653 HValue* AllocateArray(HValue* size_in_bytes, HValue* capacity, | |
1654 HValue* length_field, | |
1655 FillMode fill_mode = FILL_WITH_HOLE); | |
1656 | 1651 |
1657 HGraphBuilder* builder_; | 1652 HGraphBuilder* builder_; |
1658 ElementsKind kind_; | 1653 ElementsKind kind_; |
1659 AllocationSiteMode mode_; | 1654 AllocationSiteMode mode_; |
1660 HValue* allocation_site_payload_; | 1655 HValue* allocation_site_payload_; |
1661 HValue* constructor_function_; | 1656 HValue* constructor_function_; |
1662 HInnerAllocatedObject* elements_location_; | 1657 HAllocate* elements_location_; |
1663 }; | 1658 }; |
1664 | 1659 |
1665 HValue* BuildAllocateArrayFromLength(JSArrayBuilder* array_builder, | 1660 HValue* BuildAllocateArrayFromLength(JSArrayBuilder* array_builder, |
1666 HValue* length_argument); | 1661 HValue* length_argument); |
| 1662 HValue* BuildCalculateElementsSize(ElementsKind kind, |
| 1663 HValue* capacity); |
| 1664 HConstant* EstablishHeaderAllocationSize(AllocationSiteMode mode); |
| 1665 HConstant* EstablishElementsAllocationSize(ElementsKind kind, int capacity); |
1667 | 1666 |
1668 HValue* BuildAllocateElements(ElementsKind kind, | 1667 HAllocate* BuildAllocateElements(ElementsKind kind, |
1669 HValue* capacity); | 1668 HValue* size_in_bytes, |
| 1669 PretenureFlag pretenure); |
1670 | 1670 |
1671 void BuildInitializeElementsHeader(HValue* elements, | 1671 void BuildInitializeElementsHeader(HValue* elements, |
1672 ElementsKind kind, | 1672 ElementsKind kind, |
1673 HValue* capacity); | 1673 HValue* capacity); |
1674 | 1674 |
1675 HValue* BuildAllocateElementsAndInitializeElementsHeader(ElementsKind kind, | 1675 HValue* BuildAllocateElementsAndInitializeElementsHeader(ElementsKind kind, |
1676 HValue* capacity); | 1676 HValue* capacity); |
1677 | 1677 |
1678 // array must have been allocated with enough room for | 1678 // Array must have been allocated with enough room for |
1679 // 1) the JSArray, 2) a AllocationMemento if mode requires it, | 1679 // 1) the JSArray and 2) an AllocationMemento if mode requires it. |
1680 // 3) a FixedArray or FixedDoubleArray. | 1680 // Initially the array elements storage is initialized with empty array. |
1681 // A pointer to the Fixed(Double)Array is returned. | 1681 void BuildJSArrayHeader(HValue* array, |
1682 HInnerAllocatedObject* BuildJSArrayHeader(HValue* array, | 1682 HValue* array_map, |
1683 HValue* array_map, | 1683 AllocationSiteMode mode, |
1684 AllocationSiteMode mode, | 1684 ElementsKind elements_kind, |
1685 ElementsKind elements_kind, | 1685 HValue* allocation_site_payload, |
1686 HValue* allocation_site_payload, | 1686 HValue* length_field); |
1687 HValue* length_field); | |
1688 | 1687 |
1689 HValue* BuildGrowElementsCapacity(HValue* object, | 1688 HValue* BuildGrowElementsCapacity(HValue* object, |
1690 HValue* elements, | 1689 HValue* elements, |
1691 ElementsKind kind, | 1690 ElementsKind kind, |
1692 ElementsKind new_kind, | 1691 ElementsKind new_kind, |
1693 HValue* length, | 1692 HValue* length, |
1694 HValue* new_capacity); | 1693 HValue* new_capacity); |
1695 | 1694 |
1696 void BuildFillElementsWithHole(HValue* elements, | 1695 void BuildFillElementsWithHole(HValue* elements, |
1697 ElementsKind elements_kind, | 1696 ElementsKind elements_kind, |
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2629 } | 2628 } |
2630 | 2629 |
2631 private: | 2630 private: |
2632 HGraphBuilder* builder_; | 2631 HGraphBuilder* builder_; |
2633 }; | 2632 }; |
2634 | 2633 |
2635 | 2634 |
2636 } } // namespace v8::internal | 2635 } } // namespace v8::internal |
2637 | 2636 |
2638 #endif // V8_HYDROGEN_H_ | 2637 #endif // V8_HYDROGEN_H_ |
OLD | NEW |