| 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 | 406 |
| 407 // Create the loop exit node. | 407 // Create the loop exit node. |
| 408 Node* loop_exit = graph()->NewNode(common()->LoopExit(), control, loop); | 408 Node* loop_exit = graph()->NewNode(common()->LoopExit(), control, loop); |
| 409 UpdateControlDependency(loop_exit); | 409 UpdateControlDependency(loop_exit); |
| 410 | 410 |
| 411 // Rename the effect. | 411 // Rename the effect. |
| 412 Node* effect_rename = graph()->NewNode(common()->LoopExitEffect(), | 412 Node* effect_rename = graph()->NewNode(common()->LoopExitEffect(), |
| 413 GetEffectDependency(), loop_exit); | 413 GetEffectDependency(), loop_exit); |
| 414 UpdateEffectDependency(effect_rename); | 414 UpdateEffectDependency(effect_rename); |
| 415 | 415 |
| 416 // Rename the current context. | 416 // TODO(jarin) We should also rename context here. However, uncoditional |
| 417 context_ = graph()->NewNode(common()->LoopExitValue(), context_, loop_exit); | 417 // renaming confuses global object and native context specialization. |
| 418 // We should only rename if the context is assigned in the loop. |
| 418 | 419 |
| 419 // Rename the environmnent values. | 420 // Rename the environmnent values. |
| 420 for (size_t i = 0; i < values_.size(); i++) { | 421 for (size_t i = 0; i < values_.size(); i++) { |
| 421 Node* rename = | 422 Node* rename = |
| 422 graph()->NewNode(common()->LoopExitValue(), values_[i], loop_exit); | 423 graph()->NewNode(common()->LoopExitValue(), values_[i], loop_exit); |
| 423 values_[i] = rename; | 424 values_[i] = rename; |
| 424 } | 425 } |
| 425 } | 426 } |
| 426 | 427 |
| 427 void BytecodeGraphBuilder::Environment::UpdateStateValues(Node** state_values, | 428 void BytecodeGraphBuilder::Environment::UpdateStateValues(Node** state_values, |
| (...skipping 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1891 // Phi does not exist yet, introduce one. | 1892 // Phi does not exist yet, introduce one. |
| 1892 value = NewPhi(inputs, value, control); | 1893 value = NewPhi(inputs, value, control); |
| 1893 value->ReplaceInput(inputs - 1, other); | 1894 value->ReplaceInput(inputs - 1, other); |
| 1894 } | 1895 } |
| 1895 return value; | 1896 return value; |
| 1896 } | 1897 } |
| 1897 | 1898 |
| 1898 } // namespace compiler | 1899 } // namespace compiler |
| 1899 } // namespace internal | 1900 } // namespace internal |
| 1900 } // namespace v8 | 1901 } // namespace v8 |
| OLD | NEW |