Chromium Code Reviews| Index: src/compiler/js-graph.h | 
| diff --git a/src/compiler/js-graph.h b/src/compiler/js-graph.h | 
| index fe9b9f7b7ccdd0aa8e7e436128c64a3ea1d399f5..1f637646d24ee018dcff6e4b1a64b432d635f6f2 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()) { | 
| + memset(cached_nodes_, 0, sizeof(cached_nodes_)); | 
| 
 
Michael Starzinger
2015/04/13 16:01:34
remark: Not sure our C++ gurus would approve, but
 
 | 
| + } | 
| // 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 | 
| 
 
Michael Starzinger
2015/04/13 16:01:34
nit: Maybe add a comment or some other visual cue
 
 | 
| + }; | 
| + | 
| 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); |