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

Unified Diff: src/hydrogen.h

Issue 12385014: Hydrogen stubs for array constructors (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: More efficient code when number of arguments is known Created 7 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap.h ('k') | src/hydrogen.cc » ('j') | src/hydrogen.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « src/heap.h ('k') | src/hydrogen.cc » ('j') | src/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698