Index: src/hydrogen.h |
diff --git a/src/hydrogen.h b/src/hydrogen.h |
index f4f3752c83002d418e7534d65b349a991f3fb83a..1d4b978c6d183b1d9cb3eb266250fa1bb52ea664 100644 |
--- a/src/hydrogen.h |
+++ b/src/hydrogen.h |
@@ -36,6 +36,7 @@ |
#include "hydrogen-instructions.h" |
#include "type-info.h" |
#include "zone.h" |
+#include "scopes.h" |
namespace v8 { |
namespace internal { |
@@ -882,6 +883,10 @@ class HGraphBuilder { |
HGraph* CreateGraph(); |
+ // Bailout environment manipulation. |
+ void Push(HValue* value) { environment()->Push(value); } |
+ HValue* Pop() { return environment()->Pop(); } |
+ |
// Adding instructions. |
HInstruction* AddInstruction(HInstruction* instr); |
void AddSimulate(BailoutId id, |
@@ -1063,6 +1068,48 @@ class HGraphBuilder { |
void BuildNewSpaceArrayCheck(HValue* length, |
ElementsKind kind); |
+ class JSArrayBuilder { |
+ public: |
+ JSArrayBuilder(HGraphBuilder* builder, |
+ ElementsKind kind, |
+ HValue* allocation_site_payload); |
+ |
+ HValue* AllocateEmptyArray(); |
+ |
+ HValue* EstablishAllocationSize(HValue* length_node); |
+ HValue* AllocateArray(HValue* size_in_bytes, HValue* capacity, |
+ HValue* length_field, bool fill_with_hole); |
+ HValue* GetElementsLocation() { return elements_location_; } |
+ |
+ private: |
+ Zone* zone() const { return builder_->zone(); } |
+ int elements_size() const { |
+ return IsFastDoubleElementsKind(kind_) ? kDoubleSize : kPointerSize; |
+ } |
+ HInstruction* AddInstruction(HInstruction* instr) { |
+ return builder_->AddInstruction(instr); |
+ } |
+ void AddSimulate(RemovableSimulate removable = FIXED_SIMULATE) { |
+ builder_->AddSimulate(BailoutId::StubEntry(), removable); |
+ } |
+ HGraphBuilder* builder() { return builder_; } |
+ HGraph* graph() { return builder_->graph(); } |
+ int initial_capacity() { |
+ STATIC_ASSERT(JSArray::kPreallocatedArrayElements > 0); |
+ return JSArray::kPreallocatedArrayElements; |
+ } |
+ |
+ HValue* EmitMapCode(HValue* context); |
+ HValue* EstablishEmptyArrayAllocationSize(); |
+ void FillWithHole(HValue* capacity, bool nominally_empty); |
+ |
+ HGraphBuilder* builder_; |
+ ElementsKind kind_; |
+ AllocationSiteMode mode_; |
+ HValue* allocation_site_payload_; |
+ HInnerAllocatedObject* elements_location_; |
+ }; |
+ |
HValue* BuildAllocateElements(HValue* context, |
ElementsKind kind, |
HValue* capacity); |
@@ -1180,10 +1227,6 @@ class HOptimizedGraphBuilder: public HGraphBuilder, public AstVisitor { |
void AddSoftDeoptimize(); |
- // Bailout environment manipulation. |
- void Push(HValue* value) { environment()->Push(value); } |
- HValue* Pop() { return environment()->Pop(); } |
- |
void Bailout(const char* reason); |
HBasicBlock* CreateJoin(HBasicBlock* first, |