Chromium Code Reviews| 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 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1533 | 1533 |
| 1534 void BuildNewSpaceArrayCheck(HValue* length, | 1534 void BuildNewSpaceArrayCheck(HValue* length, |
| 1535 ElementsKind kind); | 1535 ElementsKind kind); |
| 1536 | 1536 |
| 1537 class JSArrayBuilder V8_FINAL { | 1537 class JSArrayBuilder V8_FINAL { |
| 1538 public: | 1538 public: |
| 1539 JSArrayBuilder(HGraphBuilder* builder, | 1539 JSArrayBuilder(HGraphBuilder* builder, |
| 1540 ElementsKind kind, | 1540 ElementsKind kind, |
| 1541 HValue* allocation_site_payload, | 1541 HValue* allocation_site_payload, |
| 1542 HValue* constructor_function, | 1542 HValue* constructor_function, |
| 1543 AllocationSiteOverrideMode override_mode); | 1543 AllocationSiteOverrideMode override_mode, |
| 1544 bool is_inlined = false); | |
|
Toon Verwaest
2013/11/11 13:59:28
Please make this an enum.
mvstanton
2013/11/13 14:12:52
Removed per your other feedback.
| |
| 1544 | 1545 |
| 1545 JSArrayBuilder(HGraphBuilder* builder, | 1546 JSArrayBuilder(HGraphBuilder* builder, |
| 1546 ElementsKind kind, | 1547 ElementsKind kind, |
| 1547 HValue* constructor_function); | 1548 HValue* constructor_function); |
| 1548 | 1549 |
| 1550 enum FillMode { | |
| 1551 DONT_FILL_WITH_HOLE, | |
| 1552 FILL_WITH_HOLE | |
| 1553 }; | |
| 1554 | |
| 1549 HValue* AllocateEmptyArray(); | 1555 HValue* AllocateEmptyArray(); |
| 1550 HValue* AllocateArray(HValue* capacity, HValue* length_field, | 1556 HValue* AllocateArray(HValue* capacity, HValue* length_field, |
| 1551 bool fill_with_hole); | 1557 FillMode fill_mode = FILL_WITH_HOLE); |
| 1552 HValue* GetElementsLocation() { return elements_location_; } | 1558 HValue* GetElementsLocation() { return elements_location_; } |
| 1553 | 1559 |
| 1554 private: | 1560 private: |
| 1555 Zone* zone() const { return builder_->zone(); } | 1561 Zone* zone() const { return builder_->zone(); } |
| 1556 int elements_size() const { | 1562 int elements_size() const { |
| 1557 return IsFastDoubleElementsKind(kind_) ? kDoubleSize : kPointerSize; | 1563 return IsFastDoubleElementsKind(kind_) ? kDoubleSize : kPointerSize; |
| 1558 } | 1564 } |
| 1559 HGraphBuilder* builder() { return builder_; } | 1565 HGraphBuilder* builder() { return builder_; } |
| 1560 HGraph* graph() { return builder_->graph(); } | 1566 HGraph* graph() { return builder_->graph(); } |
| 1561 int initial_capacity() { | 1567 int initial_capacity() { |
| 1562 STATIC_ASSERT(JSArray::kPreallocatedArrayElements > 0); | 1568 STATIC_ASSERT(JSArray::kPreallocatedArrayElements > 0); |
| 1563 return JSArray::kPreallocatedArrayElements; | 1569 return JSArray::kPreallocatedArrayElements; |
| 1564 } | 1570 } |
| 1565 | 1571 |
| 1566 HValue* EmitMapCode(); | 1572 HValue* EmitMapCode(); |
| 1567 HValue* EmitInternalMapCode(); | 1573 HValue* EmitInternalMapCode(); |
| 1568 HValue* EstablishEmptyArrayAllocationSize(); | 1574 HValue* EstablishEmptyArrayAllocationSize(); |
| 1569 HValue* EstablishAllocationSize(HValue* length_node); | 1575 HValue* EstablishAllocationSize(HValue* length_node); |
| 1570 HValue* AllocateArray(HValue* size_in_bytes, HValue* capacity, | 1576 HValue* AllocateArray(HValue* size_in_bytes, HValue* capacity, |
| 1571 HValue* length_field, bool fill_with_hole); | 1577 HValue* length_field, |
| 1578 FillMode fill_mode = FILL_WITH_HOLE); | |
| 1572 | 1579 |
| 1573 HGraphBuilder* builder_; | 1580 HGraphBuilder* builder_; |
| 1574 ElementsKind kind_; | 1581 ElementsKind kind_; |
| 1575 AllocationSiteMode mode_; | 1582 AllocationSiteMode mode_; |
| 1576 HValue* allocation_site_payload_; | 1583 HValue* allocation_site_payload_; |
| 1577 HValue* constructor_function_; | 1584 HValue* constructor_function_; |
| 1578 HInnerAllocatedObject* elements_location_; | 1585 HInnerAllocatedObject* elements_location_; |
| 1586 bool is_inlined_; | |
|
Toon Verwaest
2013/11/11 13:59:28
enum
mvstanton
2013/11/13 14:12:52
Removed the member.
| |
| 1579 }; | 1587 }; |
| 1580 | 1588 |
| 1589 HValue* BuildAllocateArrayFromLength(JSArrayBuilder* array_builder, | |
| 1590 HValue* length_argument); | |
| 1591 | |
| 1581 HValue* BuildAllocateElements(ElementsKind kind, | 1592 HValue* BuildAllocateElements(ElementsKind kind, |
| 1582 HValue* capacity); | 1593 HValue* capacity); |
| 1583 | 1594 |
| 1584 void BuildInitializeElementsHeader(HValue* elements, | 1595 void BuildInitializeElementsHeader(HValue* elements, |
| 1585 ElementsKind kind, | 1596 ElementsKind kind, |
| 1586 HValue* capacity); | 1597 HValue* capacity); |
| 1587 | 1598 |
| 1588 HValue* BuildAllocateElementsAndInitializeElementsHeader(ElementsKind kind, | 1599 HValue* BuildAllocateElementsAndInitializeElementsHeader(ElementsKind kind, |
| 1589 HValue* capacity); | 1600 HValue* capacity); |
| 1590 | 1601 |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2055 BailoutId ast_id); | 2066 BailoutId ast_id); |
| 2056 | 2067 |
| 2057 void HandlePropertyAssignment(Assignment* expr); | 2068 void HandlePropertyAssignment(Assignment* expr); |
| 2058 void HandleCompoundAssignment(Assignment* expr); | 2069 void HandleCompoundAssignment(Assignment* expr); |
| 2059 void HandlePolymorphicLoadNamedField(BailoutId ast_id, | 2070 void HandlePolymorphicLoadNamedField(BailoutId ast_id, |
| 2060 BailoutId return_id, | 2071 BailoutId return_id, |
| 2061 HValue* object, | 2072 HValue* object, |
| 2062 SmallMapList* types, | 2073 SmallMapList* types, |
| 2063 Handle<String> name); | 2074 Handle<String> name); |
| 2064 | 2075 |
| 2076 bool IsCallNewArrayInlineable(CallNew* expr); | |
| 2077 void BuildInlinedCallNewArray(CallNew* expr); | |
| 2078 | |
| 2065 class PropertyAccessInfo { | 2079 class PropertyAccessInfo { |
| 2066 public: | 2080 public: |
| 2067 PropertyAccessInfo(Isolate* isolate, Handle<Map> map, Handle<String> name) | 2081 PropertyAccessInfo(Isolate* isolate, Handle<Map> map, Handle<String> name) |
| 2068 : lookup_(isolate), | 2082 : lookup_(isolate), |
| 2069 map_(map), | 2083 map_(map), |
| 2070 name_(name), | 2084 name_(name), |
| 2071 access_(HObjectAccess::ForMap()) { } | 2085 access_(HObjectAccess::ForMap()) { } |
| 2072 | 2086 |
| 2073 // Checkes whether this PropertyAccessInfo can be handled as a monomorphic | 2087 // Checkes whether this PropertyAccessInfo can be handled as a monomorphic |
| 2074 // load named. It additionally fills in the fields necessary to generate the | 2088 // load named. It additionally fills in the fields necessary to generate the |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2483 } | 2497 } |
| 2484 | 2498 |
| 2485 private: | 2499 private: |
| 2486 HGraphBuilder* builder_; | 2500 HGraphBuilder* builder_; |
| 2487 }; | 2501 }; |
| 2488 | 2502 |
| 2489 | 2503 |
| 2490 } } // namespace v8::internal | 2504 } } // namespace v8::internal |
| 2491 | 2505 |
| 2492 #endif // V8_HYDROGEN_H_ | 2506 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |