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

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

Issue 640423005: Use phase-local zone in the graph builder. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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/compiler/control-builders.h ('k') | src/compiler/graph-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/graph-builder.h
diff --git a/src/compiler/graph-builder.h b/src/compiler/graph-builder.h
index c966c299b98265be53a59a46569892b11debe0be..95e09bbfaf5820bef502986895ec4be5a9e38d6d 100644
--- a/src/compiler/graph-builder.h
+++ b/src/compiler/graph-builder.h
@@ -122,9 +122,9 @@ class StructuredGraphBuilder : public GraphBuilder {
Node* dead_control();
- // TODO(mstarzinger): Use phase-local zone instead!
- Zone* zone() const { return graph()->zone(); }
- Isolate* isolate() const { return zone()->isolate(); }
+ Zone* graph_zone() const { return graph()->zone(); }
+ Zone* local_zone() { return &local_zone_; }
+ Isolate* isolate() const { return graph_zone()->isolate(); }
CommonOperatorBuilder* common() const { return common_; }
// Helper to wrap a Handle<T> into a Unique<T>.
@@ -144,6 +144,9 @@ class StructuredGraphBuilder : public GraphBuilder {
CommonOperatorBuilder* common_;
Environment* environment_;
+ // Zone local to the builder for data not leaking into the graph.
+ Zone local_zone_;
+
// Node representing the control dependency for dead code.
SetOncePointer<Node> dead_control_;
@@ -207,8 +210,7 @@ class StructuredGraphBuilder::Environment : public ZoneObject {
Node* GetContext() { return builder_->current_context(); }
protected:
- // TODO(mstarzinger): Use phase-local zone instead!
- Zone* zone() const { return graph()->zone(); }
+ Zone* zone() const { return builder_->local_zone(); }
Graph* graph() const { return builder_->graph(); }
StructuredGraphBuilder* builder() const { return builder_; }
CommonOperatorBuilder* common() { return builder_->common(); }
« no previous file with comments | « src/compiler/control-builders.h ('k') | src/compiler/graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698