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 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1531 class JSArrayBuilder V8_FINAL { | 1531 class JSArrayBuilder V8_FINAL { |
1532 public: | 1532 public: |
1533 JSArrayBuilder(HGraphBuilder* builder, | 1533 JSArrayBuilder(HGraphBuilder* builder, |
1534 ElementsKind kind, | 1534 ElementsKind kind, |
1535 HValue* allocation_site_payload, | 1535 HValue* allocation_site_payload, |
1536 HValue* constructor_function, | 1536 HValue* constructor_function, |
1537 AllocationSiteOverrideMode override_mode); | 1537 AllocationSiteOverrideMode override_mode); |
1538 | 1538 |
1539 JSArrayBuilder(HGraphBuilder* builder, | 1539 JSArrayBuilder(HGraphBuilder* builder, |
1540 ElementsKind kind, | 1540 ElementsKind kind, |
1541 HValue* constructor_function); | 1541 HValue* constructor_function = NULL); |
1542 | 1542 |
1543 HValue* AllocateEmptyArray(); | 1543 HValue* AllocateEmptyArray(); |
1544 HValue* AllocateArray(HValue* capacity, HValue* length_field, | 1544 HValue* AllocateArray(HValue* capacity, HValue* length_field, |
1545 bool fill_with_hole); | 1545 bool fill_with_hole); |
1546 HValue* GetElementsLocation() { return elements_location_; } | 1546 HValue* GetElementsLocation() { return elements_location_; } |
| 1547 HValue* EmitMapCode(); |
1547 | 1548 |
1548 private: | 1549 private: |
1549 Zone* zone() const { return builder_->zone(); } | 1550 Zone* zone() const { return builder_->zone(); } |
1550 int elements_size() const { | 1551 int elements_size() const { |
1551 return IsFastDoubleElementsKind(kind_) ? kDoubleSize : kPointerSize; | 1552 return IsFastDoubleElementsKind(kind_) ? kDoubleSize : kPointerSize; |
1552 } | 1553 } |
1553 HGraphBuilder* builder() { return builder_; } | 1554 HGraphBuilder* builder() { return builder_; } |
1554 HGraph* graph() { return builder_->graph(); } | 1555 HGraph* graph() { return builder_->graph(); } |
1555 int initial_capacity() { | 1556 int initial_capacity() { |
1556 STATIC_ASSERT(JSArray::kPreallocatedArrayElements > 0); | 1557 STATIC_ASSERT(JSArray::kPreallocatedArrayElements > 0); |
1557 return JSArray::kPreallocatedArrayElements; | 1558 return JSArray::kPreallocatedArrayElements; |
1558 } | 1559 } |
1559 | 1560 |
1560 HValue* EmitMapCode(); | |
1561 HValue* EmitInternalMapCode(); | 1561 HValue* EmitInternalMapCode(); |
1562 HValue* EstablishEmptyArrayAllocationSize(); | 1562 HValue* EstablishEmptyArrayAllocationSize(); |
1563 HValue* EstablishAllocationSize(HValue* length_node); | 1563 HValue* EstablishAllocationSize(HValue* length_node); |
1564 HValue* AllocateArray(HValue* size_in_bytes, HValue* capacity, | 1564 HValue* AllocateArray(HValue* size_in_bytes, HValue* capacity, |
1565 HValue* length_field, bool fill_with_hole); | 1565 HValue* length_field, bool fill_with_hole); |
1566 | 1566 |
1567 HGraphBuilder* builder_; | 1567 HGraphBuilder* builder_; |
1568 ElementsKind kind_; | 1568 ElementsKind kind_; |
1569 AllocationSiteMode mode_; | 1569 AllocationSiteMode mode_; |
1570 HValue* allocation_site_payload_; | 1570 HValue* allocation_site_payload_; |
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2439 } | 2439 } |
2440 | 2440 |
2441 private: | 2441 private: |
2442 HGraphBuilder* builder_; | 2442 HGraphBuilder* builder_; |
2443 }; | 2443 }; |
2444 | 2444 |
2445 | 2445 |
2446 } } // namespace v8::internal | 2446 } } // namespace v8::internal |
2447 | 2447 |
2448 #endif // V8_HYDROGEN_H_ | 2448 #endif // V8_HYDROGEN_H_ |
OLD | NEW |