| 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 1747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1758 const interpreter::BytecodeArrayIterator& iterator) { | 1758 const interpreter::BytecodeArrayIterator& iterator) { |
| 1759 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); | 1759 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); |
| 1760 } | 1760 } |
| 1761 | 1761 |
| 1762 | 1762 |
| 1763 void BytecodeGraphBuilder::VisitJumpIfUndefinedConstantWide( | 1763 void BytecodeGraphBuilder::VisitJumpIfUndefinedConstantWide( |
| 1764 const interpreter::BytecodeArrayIterator& iterator) { | 1764 const interpreter::BytecodeArrayIterator& iterator) { |
| 1765 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); | 1765 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); |
| 1766 } | 1766 } |
| 1767 | 1767 |
| 1768 void BytecodeGraphBuilder::VisitJumpIfHole( |
| 1769 const interpreter::BytecodeArrayIterator& iterator) { |
| 1770 BuildJumpIfEqual(jsgraph()->TheHoleConstant()); |
| 1771 } |
| 1772 |
| 1773 void BytecodeGraphBuilder::VisitJumpIfNotHole( |
| 1774 const interpreter::BytecodeArrayIterator& iterator) { |
| 1775 Node* accumulator = environment()->LookupAccumulator(); |
| 1776 Node* condition = NewNode(javascript()->StrictEqual(), accumulator, |
| 1777 jsgraph()->TheHoleConstant()); |
| 1778 Node* node = |
| 1779 NewNode(common()->Select(MachineRepresentation::kTagged), condition, |
| 1780 jsgraph()->FalseConstant(), jsgraph()->TrueConstant()); |
| 1781 BuildConditionalJump(node); |
| 1782 } |
| 1768 | 1783 |
| 1769 void BytecodeGraphBuilder::VisitReturn( | 1784 void BytecodeGraphBuilder::VisitReturn( |
| 1770 const interpreter::BytecodeArrayIterator& iterator) { | 1785 const interpreter::BytecodeArrayIterator& iterator) { |
| 1771 Node* control = | 1786 Node* control = |
| 1772 NewNode(common()->Return(), environment()->LookupAccumulator()); | 1787 NewNode(common()->Return(), environment()->LookupAccumulator()); |
| 1773 UpdateControlDependencyToLeaveFunction(control); | 1788 UpdateControlDependencyToLeaveFunction(control); |
| 1774 set_environment(nullptr); | 1789 set_environment(nullptr); |
| 1775 } | 1790 } |
| 1776 | 1791 |
| 1777 | 1792 |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2102 | 2117 |
| 2103 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 2118 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
| 2104 if (environment()->IsMarkedAsUnreachable()) return; | 2119 if (environment()->IsMarkedAsUnreachable()) return; |
| 2105 environment()->MarkAsUnreachable(); | 2120 environment()->MarkAsUnreachable(); |
| 2106 exit_controls_.push_back(exit); | 2121 exit_controls_.push_back(exit); |
| 2107 } | 2122 } |
| 2108 | 2123 |
| 2109 } // namespace compiler | 2124 } // namespace compiler |
| 2110 } // namespace internal | 2125 } // namespace internal |
| 2111 } // namespace v8 | 2126 } // namespace v8 |
| OLD | NEW |