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

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

Issue 936343002: Simplify computation of environment stack delta. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_trycatch-3
Patch Set: Rebased and slightly better test. Created 5 years, 10 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 c79d9c37a2ea0e25c3af5cfcef0f9d2d14355726..aa874be5bdff7122b26fb78568d49b8536d6eaf3 100644
--- a/src/compiler/ast-graph-builder.h
+++ b/src/compiler/ast-graph-builder.h
@@ -290,7 +290,7 @@ class AstGraphBuilder : public AstVisitor {
void VisitForValues(ZoneList<Expression*>* exprs);
// Common for all IterationStatement bodies.
- void VisitIterationBody(IterationStatement* stmt, LoopBuilder* loop, int);
+ void VisitIterationBody(IterationStatement* stmt, LoopBuilder* loop);
// Dispatched from VisitCallRuntime.
void VisitCallJSRuntime(CallRuntime* expr);
@@ -400,6 +400,11 @@ class AstGraphBuilder::Environment : public ZoneObject {
DCHECK(depth >= 0 && depth <= stack_height());
values()->erase(values()->end() - depth, values()->end());
}
+ void Trim(int trim_to_height) {
+ int depth = stack_height() - trim_to_height;
+ DCHECK(depth >= 0 && depth <= stack_height());
+ values()->erase(values()->end() - depth, values()->end());
+ }
// Preserve a checkpoint of the environment for the IR graph. Any
// further mutation of the environment will not affect checkpoints.
« 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