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 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1536 } | 1536 } |
1537 | 1537 |
1538 void BytecodeGraphBuilder::VisitJumpIfUndefinedConstant() { | 1538 void BytecodeGraphBuilder::VisitJumpIfUndefinedConstant() { |
1539 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); | 1539 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); |
1540 } | 1540 } |
1541 | 1541 |
1542 void BytecodeGraphBuilder::VisitJumpIfUndefinedConstantWide() { | 1542 void BytecodeGraphBuilder::VisitJumpIfUndefinedConstantWide() { |
1543 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); | 1543 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); |
1544 } | 1544 } |
1545 | 1545 |
| 1546 void BytecodeGraphBuilder::VisitJumpIfHole() { |
| 1547 BuildJumpIfEqual(jsgraph()->TheHoleConstant()); |
| 1548 } |
| 1549 |
| 1550 void BytecodeGraphBuilder::VisitJumpIfNotHole() { |
| 1551 Node* accumulator = environment()->LookupAccumulator(); |
| 1552 Node* condition = NewNode(javascript()->StrictEqual(), accumulator, |
| 1553 jsgraph()->TheHoleConstant()); |
| 1554 Node* node = |
| 1555 NewNode(common()->Select(MachineRepresentation::kTagged), condition, |
| 1556 jsgraph()->FalseConstant(), jsgraph()->TrueConstant()); |
| 1557 BuildConditionalJump(node); |
| 1558 } |
| 1559 |
1546 void BytecodeGraphBuilder::VisitReturn() { | 1560 void BytecodeGraphBuilder::VisitReturn() { |
1547 Node* control = | 1561 Node* control = |
1548 NewNode(common()->Return(), environment()->LookupAccumulator()); | 1562 NewNode(common()->Return(), environment()->LookupAccumulator()); |
1549 UpdateControlDependencyToLeaveFunction(control); | 1563 UpdateControlDependencyToLeaveFunction(control); |
1550 set_environment(nullptr); | 1564 set_environment(nullptr); |
1551 } | 1565 } |
1552 | 1566 |
1553 void BytecodeGraphBuilder::BuildForInPrepare() { | 1567 void BytecodeGraphBuilder::BuildForInPrepare() { |
1554 FrameStateBeforeAndAfter states(this); | 1568 FrameStateBeforeAndAfter states(this); |
1555 Node* receiver = environment()->LookupAccumulator(); | 1569 Node* receiver = environment()->LookupAccumulator(); |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1862 | 1876 |
1863 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 1877 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
1864 if (environment()->IsMarkedAsUnreachable()) return; | 1878 if (environment()->IsMarkedAsUnreachable()) return; |
1865 environment()->MarkAsUnreachable(); | 1879 environment()->MarkAsUnreachable(); |
1866 exit_controls_.push_back(exit); | 1880 exit_controls_.push_back(exit); |
1867 } | 1881 } |
1868 | 1882 |
1869 } // namespace compiler | 1883 } // namespace compiler |
1870 } // namespace internal | 1884 } // namespace internal |
1871 } // namespace v8 | 1885 } // namespace v8 |
OLD | NEW |