Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: src/hydrogen.h

Issue 55933002: Inline array constructor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added comment to CreateArrayDispatchOneArgument Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 JSArrayBuilder(HGraphBuilder* builder, 1578 JSArrayBuilder(HGraphBuilder* builder,
1579 ElementsKind kind, 1579 ElementsKind kind,
1580 HValue* allocation_site_payload, 1580 HValue* allocation_site_payload,
1581 HValue* constructor_function, 1581 HValue* constructor_function,
1582 AllocationSiteOverrideMode override_mode); 1582 AllocationSiteOverrideMode override_mode);
1583 1583
1584 JSArrayBuilder(HGraphBuilder* builder, 1584 JSArrayBuilder(HGraphBuilder* builder,
1585 ElementsKind kind, 1585 ElementsKind kind,
1586 HValue* constructor_function); 1586 HValue* constructor_function);
1587 1587
1588 enum FillMode {
1589 DONT_FILL_WITH_HOLE,
1590 FILL_WITH_HOLE
1591 };
1592
1593 ElementsKind kind() { return kind_; }
1594
1588 HValue* AllocateEmptyArray(); 1595 HValue* AllocateEmptyArray();
1589 HValue* AllocateArray(HValue* capacity, HValue* length_field, 1596 HValue* AllocateArray(HValue* capacity, HValue* length_field,
1590 bool fill_with_hole); 1597 FillMode fill_mode = FILL_WITH_HOLE);
1591 HValue* GetElementsLocation() { return elements_location_; } 1598 HValue* GetElementsLocation() { return elements_location_; }
1592 1599
1593 private: 1600 private:
1594 Zone* zone() const { return builder_->zone(); } 1601 Zone* zone() const { return builder_->zone(); }
1595 int elements_size() const { 1602 int elements_size() const {
1596 return IsFastDoubleElementsKind(kind_) ? kDoubleSize : kPointerSize; 1603 return IsFastDoubleElementsKind(kind_) ? kDoubleSize : kPointerSize;
1597 } 1604 }
1598 HGraphBuilder* builder() { return builder_; } 1605 HGraphBuilder* builder() { return builder_; }
1599 HGraph* graph() { return builder_->graph(); } 1606 HGraph* graph() { return builder_->graph(); }
1600 int initial_capacity() { 1607 int initial_capacity() {
1601 STATIC_ASSERT(JSArray::kPreallocatedArrayElements > 0); 1608 STATIC_ASSERT(JSArray::kPreallocatedArrayElements > 0);
1602 return JSArray::kPreallocatedArrayElements; 1609 return JSArray::kPreallocatedArrayElements;
1603 } 1610 }
1604 1611
1605 HValue* EmitMapCode(); 1612 HValue* EmitMapCode();
1606 HValue* EmitInternalMapCode(); 1613 HValue* EmitInternalMapCode();
1607 HValue* EstablishEmptyArrayAllocationSize(); 1614 HValue* EstablishEmptyArrayAllocationSize();
1608 HValue* EstablishAllocationSize(HValue* length_node); 1615 HValue* EstablishAllocationSize(HValue* length_node);
1609 HValue* AllocateArray(HValue* size_in_bytes, HValue* capacity, 1616 HValue* AllocateArray(HValue* size_in_bytes, HValue* capacity,
1610 HValue* length_field, bool fill_with_hole); 1617 HValue* length_field,
1618 FillMode fill_mode = FILL_WITH_HOLE);
1611 1619
1612 HGraphBuilder* builder_; 1620 HGraphBuilder* builder_;
1613 ElementsKind kind_; 1621 ElementsKind kind_;
1614 AllocationSiteMode mode_; 1622 AllocationSiteMode mode_;
1615 HValue* allocation_site_payload_; 1623 HValue* allocation_site_payload_;
1616 HValue* constructor_function_; 1624 HValue* constructor_function_;
1617 HInnerAllocatedObject* elements_location_; 1625 HInnerAllocatedObject* elements_location_;
1618 }; 1626 };
1619 1627
1628 HValue* BuildAllocateArrayFromLength(JSArrayBuilder* array_builder,
1629 HValue* length_argument);
1630
1620 HValue* BuildAllocateElements(ElementsKind kind, 1631 HValue* BuildAllocateElements(ElementsKind kind,
1621 HValue* capacity); 1632 HValue* capacity);
1622 1633
1623 void BuildInitializeElementsHeader(HValue* elements, 1634 void BuildInitializeElementsHeader(HValue* elements,
1624 ElementsKind kind, 1635 ElementsKind kind,
1625 HValue* capacity); 1636 HValue* capacity);
1626 1637
1627 HValue* BuildAllocateElementsAndInitializeElementsHeader(ElementsKind kind, 1638 HValue* BuildAllocateElementsAndInitializeElementsHeader(ElementsKind kind,
1628 HValue* capacity); 1639 HValue* capacity);
1629 1640
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
2094 BailoutId ast_id); 2105 BailoutId ast_id);
2095 2106
2096 void HandlePropertyAssignment(Assignment* expr); 2107 void HandlePropertyAssignment(Assignment* expr);
2097 void HandleCompoundAssignment(Assignment* expr); 2108 void HandleCompoundAssignment(Assignment* expr);
2098 void HandlePolymorphicLoadNamedField(BailoutId ast_id, 2109 void HandlePolymorphicLoadNamedField(BailoutId ast_id,
2099 BailoutId return_id, 2110 BailoutId return_id,
2100 HValue* object, 2111 HValue* object,
2101 SmallMapList* types, 2112 SmallMapList* types,
2102 Handle<String> name); 2113 Handle<String> name);
2103 2114
2115 bool IsCallNewArrayInlineable(CallNew* expr);
2116 void BuildInlinedCallNewArray(CallNew* expr);
2117
2104 class PropertyAccessInfo { 2118 class PropertyAccessInfo {
2105 public: 2119 public:
2106 PropertyAccessInfo(Isolate* isolate, Handle<Map> map, Handle<String> name) 2120 PropertyAccessInfo(Isolate* isolate, Handle<Map> map, Handle<String> name)
2107 : lookup_(isolate), 2121 : lookup_(isolate),
2108 map_(map), 2122 map_(map),
2109 name_(name), 2123 name_(name),
2110 access_(HObjectAccess::ForMap()) { } 2124 access_(HObjectAccess::ForMap()) { }
2111 2125
2112 // Checkes whether this PropertyAccessInfo can be handled as a monomorphic 2126 // Checkes whether this PropertyAccessInfo can be handled as a monomorphic
2113 // load named. It additionally fills in the fields necessary to generate the 2127 // load named. It additionally fills in the fields necessary to generate the
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
2522 } 2536 }
2523 2537
2524 private: 2538 private:
2525 HGraphBuilder* builder_; 2539 HGraphBuilder* builder_;
2526 }; 2540 };
2527 2541
2528 2542
2529 } } // namespace v8::internal 2543 } } // namespace v8::internal
2530 2544
2531 #endif // V8_HYDROGEN_H_ 2545 #endif // V8_HYDROGEN_H_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698