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

Unified Diff: src/compiler/ast-graph-builder.h

Issue 1045703003: [turbofan] Keep AstGraphBuilder context chain length in sync. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 5 years, 9 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 | « no previous file | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « no previous file | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698