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 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1503 } | 1503 } |
1504 | 1504 |
1505 void BytecodeGraphBuilder::VisitJumpIfUndefinedConstant() { | 1505 void BytecodeGraphBuilder::VisitJumpIfUndefinedConstant() { |
1506 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); | 1506 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); |
1507 } | 1507 } |
1508 | 1508 |
1509 void BytecodeGraphBuilder::VisitJumpIfUndefinedConstantWide() { | 1509 void BytecodeGraphBuilder::VisitJumpIfUndefinedConstantWide() { |
1510 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); | 1510 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); |
1511 } | 1511 } |
1512 | 1512 |
| 1513 void BytecodeGraphBuilder::VisitJumpIfHole() { |
| 1514 BuildJumpIfEqual(jsgraph()->TheHoleConstant()); |
| 1515 } |
| 1516 |
| 1517 void BytecodeGraphBuilder::VisitJumpIfNotHole() { |
| 1518 Node* accumulator = environment()->LookupAccumulator(); |
| 1519 Node* condition = NewNode(javascript()->StrictEqual(), accumulator, |
| 1520 jsgraph()->TheHoleConstant()); |
| 1521 Node* node = |
| 1522 NewNode(common()->Select(MachineRepresentation::kTagged), condition, |
| 1523 jsgraph()->FalseConstant(), jsgraph()->TrueConstant()); |
| 1524 BuildConditionalJump(node); |
| 1525 } |
| 1526 |
1513 void BytecodeGraphBuilder::VisitStackCheck() { | 1527 void BytecodeGraphBuilder::VisitStackCheck() { |
1514 FrameStateBeforeAndAfter states(this); | 1528 FrameStateBeforeAndAfter states(this); |
1515 Node* node = NewNode(javascript()->StackCheck()); | 1529 Node* node = NewNode(javascript()->StackCheck()); |
1516 environment()->RecordAfterState(node, &states); | 1530 environment()->RecordAfterState(node, &states); |
1517 } | 1531 } |
1518 | 1532 |
1519 void BytecodeGraphBuilder::VisitReturn() { | 1533 void BytecodeGraphBuilder::VisitReturn() { |
1520 Node* control = | 1534 Node* control = |
1521 NewNode(common()->Return(), environment()->LookupAccumulator()); | 1535 NewNode(common()->Return(), environment()->LookupAccumulator()); |
1522 MergeControlToLeaveFunction(control); | 1536 MergeControlToLeaveFunction(control); |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1832 // Phi does not exist yet, introduce one. | 1846 // Phi does not exist yet, introduce one. |
1833 value = NewPhi(inputs, value, control); | 1847 value = NewPhi(inputs, value, control); |
1834 value->ReplaceInput(inputs - 1, other); | 1848 value->ReplaceInput(inputs - 1, other); |
1835 } | 1849 } |
1836 return value; | 1850 return value; |
1837 } | 1851 } |
1838 | 1852 |
1839 } // namespace compiler | 1853 } // namespace compiler |
1840 } // namespace internal | 1854 } // namespace internal |
1841 } // namespace v8 | 1855 } // namespace v8 |
OLD | NEW |