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

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

Issue 1080023002: [turbofan] Clean up cached nodes in JSGraph. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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-reducer.cc ('k') | src/compiler/js-graph.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-graph.h
diff --git a/src/compiler/js-graph.h b/src/compiler/js-graph.h
index fe9b9f7b7ccdd0aa8e7e436128c64a3ea1d399f5..13dc367d4dd6cab8440fcd0074e6947d430a0644 100644
--- a/src/compiler/js-graph.h
+++ b/src/compiler/js-graph.h
@@ -30,7 +30,9 @@ class JSGraph : public ZoneObject {
common_(common),
javascript_(javascript),
machine_(machine),
- cache_(zone()) {}
+ cache_(zone()) {
+ for (int i = 0; i < kNumCachedNodes; i++) cached_nodes_[i] = nullptr;
+ }
// Canonicalized global constants.
Node* CEntryStubConstant(int result_size);
@@ -128,26 +130,28 @@ class JSGraph : public ZoneObject {
void GetCachedNodes(NodeVector* nodes);
private:
+ enum CachedNode {
+ kCEntryStubConstant,
+ kUndefinedConstant,
+ kTheHoleConstant,
+ kTrueConstant,
+ kFalseConstant,
+ kNullConstant,
+ kZeroConstant,
+ kOneConstant,
+ kNaNConstant,
+ kEmptyFrameState,
+ kDeadControl,
+ kNumCachedNodes // Must remain last.
+ };
+
Isolate* isolate_;
Graph* graph_;
CommonOperatorBuilder* common_;
JSOperatorBuilder* javascript_;
MachineOperatorBuilder* machine_;
-
- // TODO(titzer): make this into a simple array.
- SetOncePointer<Node> c_entry_stub_constant_;
- SetOncePointer<Node> undefined_constant_;
- SetOncePointer<Node> the_hole_constant_;
- SetOncePointer<Node> true_constant_;
- SetOncePointer<Node> false_constant_;
- SetOncePointer<Node> null_constant_;
- SetOncePointer<Node> zero_constant_;
- SetOncePointer<Node> one_constant_;
- SetOncePointer<Node> nan_constant_;
- SetOncePointer<Node> empty_frame_state_;
- SetOncePointer<Node> dead_control_;
-
CommonNodeCache cache_;
+ Node* cached_nodes_[kNumCachedNodes];
Node* ImmovableHeapConstant(Handle<HeapObject> value);
Node* NumberConstant(double value);
« no previous file with comments | « src/compiler/control-reducer.cc ('k') | src/compiler/js-graph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698