| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/state-values-utils.h" | 5 #include "src/compiler/state-values-utils.h" |
| 6 | 6 |
| 7 namespace v8 { | 7 namespace v8 { |
| 8 namespace internal { | 8 namespace internal { |
| 9 namespace compiler { | 9 namespace compiler { |
| 10 | 10 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 Node* StateValuesCache::GetEmptyStateValues() { | 74 Node* StateValuesCache::GetEmptyStateValues() { |
| 75 if (empty_state_values_ == nullptr) { | 75 if (empty_state_values_ == nullptr) { |
| 76 empty_state_values_ = graph()->NewNode(common()->StateValues(0)); | 76 empty_state_values_ = graph()->NewNode(common()->StateValues(0)); |
| 77 } | 77 } |
| 78 return empty_state_values_; | 78 return empty_state_values_; |
| 79 } | 79 } |
| 80 | 80 |
| 81 | 81 |
| 82 NodeVector* StateValuesCache::GetWorkingSpace(size_t level) { | 82 NodeVector* StateValuesCache::GetWorkingSpace(size_t level) { |
| 83 while (working_space_.size() <= level) { | 83 while (working_space_.size() <= level) { |
| 84 void* space = zone()->New(sizeof(NodeVector)); | 84 working_space_.push_back(new (zone()) |
| 85 working_space_.push_back(new (space) | |
| 86 NodeVector(kMaxInputCount, nullptr, zone())); | 85 NodeVector(kMaxInputCount, nullptr, zone())); |
| 87 } | 86 } |
| 88 return working_space_[level]; | 87 return working_space_[level]; |
| 89 } | 88 } |
| 90 | 89 |
| 91 namespace { | 90 namespace { |
| 92 | 91 |
| 93 int StateValuesHashKey(Node** nodes, size_t count) { | 92 int StateValuesHashKey(Node** nodes, size_t count) { |
| 94 size_t hash = count; | 93 size_t hash = count; |
| 95 for (size_t i = 0; i < count; i++) { | 94 for (size_t i = 0; i < count; i++) { |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 } else { | 307 } else { |
| 309 count++; | 308 count++; |
| 310 } | 309 } |
| 311 } | 310 } |
| 312 return count; | 311 return count; |
| 313 } | 312 } |
| 314 | 313 |
| 315 } // namespace compiler | 314 } // namespace compiler |
| 316 } // namespace internal | 315 } // namespace internal |
| 317 } // namespace v8 | 316 } // namespace v8 |
| OLD | NEW |