Index: src/compiler/ast-graph-builder.h |
diff --git a/src/compiler/ast-graph-builder.h b/src/compiler/ast-graph-builder.h |
index 43a2d65c84382dc649ea8818fe26fc86db5e0c1c..b65c0ed62091ed5688e0d096c22959e44cbbe566 100644 |
--- a/src/compiler/ast-graph-builder.h |
+++ b/src/compiler/ast-graph-builder.h |
@@ -77,6 +77,8 @@ class AstGraphBuilder : public AstVisitor { |
Environment* environment_; |
AstContext* ast_context_; |
+ bool CreateGraphBody(); |
Michael Starzinger
2015/02/17 10:34:37
nit: Please move this down to below all the fields
|
+ |
// List of global declarations for functions and variables. |
ZoneVector<Handle<Object>> globals_; |
@@ -88,7 +90,7 @@ class AstGraphBuilder : public AstVisitor { |
// Nodes representing values in the activation record. |
SetOncePointer<Node> function_closure_; |
- SetOncePointer<Node> function_context_; |
+ Node* function_context_; |
// Temporary storage for building node input lists. |
int input_buffer_size_; |
@@ -108,7 +110,7 @@ class AstGraphBuilder : public AstVisitor { |
static const int kInputBufferSizeIncrement = 64; |
Zone* local_zone() const { return local_zone_; } |
- Environment* environment() { return environment_; } |
+ Environment* environment() const { return environment_; } |
AstContext* ast_context() const { return ast_context_; } |
ControlScope* execution_control() const { return execution_control_; } |
ContextScope* execution_context() const { return execution_context_; } |
@@ -176,6 +178,9 @@ class AstGraphBuilder : public AstVisitor { |
Node* NewPhi(int count, Node* input, Node* control); |
Node* NewEffectPhi(int count, Node* input, Node* control); |
+ Node* NewOuterContextParam(); |
+ Node* NewCurrentContextOsrValue(); |
+ |
// Helpers for merging control, effect or value dependencies. |
Node* MergeControl(Node* control, Node* other); |
Node* MergeEffect(Node* value, Node* other, Node* control); |
@@ -362,6 +367,10 @@ class AstGraphBuilder::Environment : public ZoneObject { |
} |
} |
+ Node* Context() const { return contexts_[contexts_.size() - 1]; } |
Michael Starzinger
2015/02/17 10:34:37
Can use contexts()->back() here instead.
titzer
2015/02/17 10:44:17
Done.
|
+ void PushContext(Node* context) { contexts()->push_back(context); } |
+ void PopContext() { contexts()->pop_back(); } |
+ |
// Operations on the operand stack. |
void Push(Node* node) { |
values()->push_back(node); |
@@ -436,11 +445,14 @@ class AstGraphBuilder::Environment : public ZoneObject { |
return Copy(); |
} |
+ int ContextStackDepth() { return static_cast<int>(contexts_.size()); } |
+ |
private: |
AstGraphBuilder* builder_; |
int parameters_count_; |
int locals_count_; |
NodeVector values_; |
+ NodeVector contexts_; |
Node* control_dependency_; |
Node* effect_dependency_; |
Node* parameters_node_; |
@@ -455,6 +467,7 @@ class AstGraphBuilder::Environment : public ZoneObject { |
AstGraphBuilder* builder() const { return builder_; } |
CommonOperatorBuilder* common() { return builder_->common(); } |
NodeVector* values() { return &values_; } |
+ NodeVector* contexts() { return &contexts_; } |
// Prepare environment to be used as loop header. |
void PrepareForLoop(BitVector* assigned, bool is_osr = false); |