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/bytecode-graph-builder.h" | 5 #include "src/compiler/bytecode-graph-builder.h" |
6 | 6 |
7 #include "src/compiler/bytecode-branch-analysis.h" | 7 #include "src/compiler/bytecode-branch-analysis.h" |
8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 #include "src/compiler/operator-properties.h" | 9 #include "src/compiler/operator-properties.h" |
10 #include "src/interpreter/bytecodes.h" | 10 #include "src/interpreter/bytecodes.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 | 243 |
244 // Connect to the loop end. | 244 // Connect to the loop end. |
245 Node* terminate = builder()->graph()->NewNode( | 245 Node* terminate = builder()->graph()->NewNode( |
246 builder()->common()->Terminate(), effect, control); | 246 builder()->common()->Terminate(), effect, control); |
247 builder()->exit_controls_.push_back(terminate); | 247 builder()->exit_controls_.push_back(terminate); |
248 } | 248 } |
249 | 249 |
250 | 250 |
251 bool BytecodeGraphBuilder::Environment::StateValuesRequireUpdate( | 251 bool BytecodeGraphBuilder::Environment::StateValuesRequireUpdate( |
252 Node** state_values, int offset, int count) { | 252 Node** state_values, int offset, int count) { |
253 Node** env_values = (count == 0) ? nullptr : &values()->at(offset); | 253 if (!builder()->info()->is_deoptimization_enabled()) { |
| 254 return false; |
| 255 } |
254 if (*state_values == nullptr) { | 256 if (*state_values == nullptr) { |
255 return true; | 257 return true; |
256 } else { | 258 } |
257 DCHECK_EQ((*state_values)->InputCount(), count); | 259 DCHECK_EQ((*state_values)->InputCount(), count); |
258 DCHECK_LE(static_cast<size_t>(offset + count), values()->size()); | 260 DCHECK_LE(static_cast<size_t>(offset + count), values()->size()); |
259 for (int i = 0; i < count; i++) { | 261 Node** env_values = (count == 0) ? nullptr : &values()->at(offset); |
260 if ((*state_values)->InputAt(i) != env_values[i]) { | 262 for (int i = 0; i < count; i++) { |
261 return true; | 263 if ((*state_values)->InputAt(i) != env_values[i]) { |
262 } | 264 return true; |
263 } | 265 } |
264 } | 266 } |
265 return false; | 267 return false; |
266 } | 268 } |
267 | 269 |
268 | 270 |
269 void BytecodeGraphBuilder::Environment::UpdateStateValues(Node** state_values, | 271 void BytecodeGraphBuilder::Environment::UpdateStateValues(Node** state_values, |
270 int offset, | 272 int offset, |
271 int count) { | 273 int count) { |
272 if (StateValuesRequireUpdate(state_values, offset, count)) { | 274 if (StateValuesRequireUpdate(state_values, offset, count)) { |
(...skipping 1580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1853 | 1855 |
1854 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 1856 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
1855 if (environment()->IsMarkedAsUnreachable()) return; | 1857 if (environment()->IsMarkedAsUnreachable()) return; |
1856 environment()->MarkAsUnreachable(); | 1858 environment()->MarkAsUnreachable(); |
1857 exit_controls_.push_back(exit); | 1859 exit_controls_.push_back(exit); |
1858 } | 1860 } |
1859 | 1861 |
1860 } // namespace compiler | 1862 } // namespace compiler |
1861 } // namespace internal | 1863 } // namespace internal |
1862 } // namespace v8 | 1864 } // namespace v8 |
OLD | NEW |