| Index: src/compiler/ast-graph-builder.h
|
| diff --git a/src/compiler/ast-graph-builder.h b/src/compiler/ast-graph-builder.h
|
| index f851a3003665bb85f1f1e343e664352dbcb415d3..45f7451652da34fb40d3d18c6cc49d860ecc832d 100644
|
| --- a/src/compiler/ast-graph-builder.h
|
| +++ b/src/compiler/ast-graph-builder.h
|
| @@ -384,6 +384,7 @@ class AstGraphBuilder::Environment : public ZoneObject {
|
|
|
| int parameters_count() const { return parameters_count_; }
|
| int locals_count() const { return locals_count_; }
|
| + int context_chain_length() { return static_cast<int>(contexts_.size()); }
|
| int stack_height() {
|
| return static_cast<int>(values()->size()) - parameters_count_ -
|
| locals_count_;
|
| @@ -394,9 +395,13 @@ class AstGraphBuilder::Environment : public ZoneObject {
|
| Node* Lookup(Variable* variable);
|
| void MarkAllLocalsLive();
|
|
|
| + // Operations on the context chain.
|
| Node* Context() const { return contexts_.back(); }
|
| void PushContext(Node* context) { contexts()->push_back(context); }
|
| void PopContext() { contexts()->pop_back(); }
|
| + void TrimContextChain(int trim_to_length) {
|
| + contexts()->resize(trim_to_length);
|
| + }
|
|
|
| // Operations on the operand stack.
|
| void Push(Node* node) {
|
| @@ -428,7 +433,7 @@ class AstGraphBuilder::Environment : public ZoneObject {
|
| DCHECK(depth >= 0 && depth <= stack_height());
|
| values()->erase(values()->end() - depth, values()->end());
|
| }
|
| - void Trim(int trim_to_height) {
|
| + void TrimStack(int trim_to_height) {
|
| int depth = stack_height() - trim_to_height;
|
| DCHECK(depth >= 0 && depth <= stack_height());
|
| values()->erase(values()->end() - depth, values()->end());
|
| @@ -478,8 +483,6 @@ class AstGraphBuilder::Environment : public ZoneObject {
|
| return CopyAndShareLiveness();
|
| }
|
|
|
| - int ContextStackDepth() { return static_cast<int>(contexts_.size()); }
|
| -
|
| private:
|
| AstGraphBuilder* builder_;
|
| int parameters_count_;
|
|
|