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 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1597 } | 1597 } |
1598 HGraphBuilder* builder() { return builder_; } | 1598 HGraphBuilder* builder() { return builder_; } |
1599 HGraph* graph() { return builder_->graph(); } | 1599 HGraph* graph() { return builder_->graph(); } |
1600 int initial_capacity() { | 1600 int initial_capacity() { |
1601 STATIC_ASSERT(JSArray::kPreallocatedArrayElements > 0); | 1601 STATIC_ASSERT(JSArray::kPreallocatedArrayElements > 0); |
1602 return JSArray::kPreallocatedArrayElements; | 1602 return JSArray::kPreallocatedArrayElements; |
1603 } | 1603 } |
1604 | 1604 |
1605 HValue* EmitMapCode(); | 1605 HValue* EmitMapCode(); |
1606 HValue* EmitInternalMapCode(); | 1606 HValue* EmitInternalMapCode(); |
1607 HValue* EstablishEmptyArrayAllocationSize(); | 1607 HValue* EstablishHeaderAllocationSize(); |
1608 HValue* EstablishAllocationSize(HValue* length_node); | |
1609 HValue* AllocateArray(HValue* size_in_bytes, HValue* capacity, | 1608 HValue* AllocateArray(HValue* size_in_bytes, HValue* capacity, |
1610 HValue* length_field, bool fill_with_hole); | 1609 HValue* length_field, bool fill_with_hole); |
1611 | 1610 |
1612 HGraphBuilder* builder_; | 1611 HGraphBuilder* builder_; |
1613 ElementsKind kind_; | 1612 ElementsKind kind_; |
1614 AllocationSiteMode mode_; | 1613 AllocationSiteMode mode_; |
1615 HValue* allocation_site_payload_; | 1614 HValue* allocation_site_payload_; |
1616 HValue* constructor_function_; | 1615 HValue* constructor_function_; |
1617 HInnerAllocatedObject* elements_location_; | 1616 HValue* elements_location_; |
1618 }; | 1617 }; |
1619 | 1618 |
| 1619 HValue* BuildCalculateElementsSize(ElementsKind kind, |
| 1620 HValue* capacity); |
| 1621 |
1620 HValue* BuildAllocateElements(ElementsKind kind, | 1622 HValue* BuildAllocateElements(ElementsKind kind, |
1621 HValue* capacity); | 1623 HValue* size_in_bytes, |
| 1624 PretenureFlag pretenure); |
1622 | 1625 |
1623 void BuildInitializeElementsHeader(HValue* elements, | 1626 void BuildInitializeElementsHeader(HValue* elements, |
1624 ElementsKind kind, | 1627 ElementsKind kind, |
1625 HValue* capacity); | 1628 HValue* capacity); |
1626 | 1629 |
1627 HValue* BuildAllocateElementsAndInitializeElementsHeader(ElementsKind kind, | 1630 HValue* BuildAllocateElementsAndInitializeElementsHeader(ElementsKind kind, |
1628 HValue* capacity); | 1631 HValue* capacity); |
1629 | 1632 |
1630 // array must have been allocated with enough room for | 1633 // array must have been allocated with enough room for |
1631 // 1) the JSArray, 2) a AllocationMemento if mode requires it, | 1634 // 1) the JSArray, 2) a AllocationMemento if mode requires it. |
1632 // 3) a FixedArray or FixedDoubleArray. | 1635 // Initially the array elements storage is initialized with empty array. |
1633 // A pointer to the Fixed(Double)Array is returned. | 1636 void BuildJSArrayHeader(HValue* array, |
1634 HInnerAllocatedObject* BuildJSArrayHeader(HValue* array, | 1637 HValue* array_map, |
1635 HValue* array_map, | 1638 AllocationSiteMode mode, |
1636 AllocationSiteMode mode, | 1639 ElementsKind elements_kind, |
1637 ElementsKind elements_kind, | 1640 HValue* allocation_site_payload, |
1638 HValue* allocation_site_payload, | 1641 HValue* length_field); |
1639 HValue* length_field); | |
1640 | 1642 |
1641 HValue* BuildGrowElementsCapacity(HValue* object, | 1643 HValue* BuildGrowElementsCapacity(HValue* object, |
1642 HValue* elements, | 1644 HValue* elements, |
1643 ElementsKind kind, | 1645 ElementsKind kind, |
1644 ElementsKind new_kind, | 1646 ElementsKind new_kind, |
1645 HValue* length, | 1647 HValue* length, |
1646 HValue* new_capacity); | 1648 HValue* new_capacity); |
1647 | 1649 |
1648 void BuildFillElementsWithHole(HValue* elements, | 1650 void BuildFillElementsWithHole(HValue* elements, |
1649 ElementsKind elements_kind, | 1651 ElementsKind elements_kind, |
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2522 } | 2524 } |
2523 | 2525 |
2524 private: | 2526 private: |
2525 HGraphBuilder* builder_; | 2527 HGraphBuilder* builder_; |
2526 }; | 2528 }; |
2527 | 2529 |
2528 | 2530 |
2529 } } // namespace v8::internal | 2531 } } // namespace v8::internal |
2530 | 2532 |
2531 #endif // V8_HYDROGEN_H_ | 2533 #endif // V8_HYDROGEN_H_ |
OLD | NEW |