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 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1514 } | 1514 } |
1515 | 1515 |
1516 void BytecodeGraphBuilder::VisitJumpIfUndefinedConstant() { | 1516 void BytecodeGraphBuilder::VisitJumpIfUndefinedConstant() { |
1517 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); | 1517 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); |
1518 } | 1518 } |
1519 | 1519 |
1520 void BytecodeGraphBuilder::VisitJumpIfUndefinedConstantWide() { | 1520 void BytecodeGraphBuilder::VisitJumpIfUndefinedConstantWide() { |
1521 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); | 1521 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); |
1522 } | 1522 } |
1523 | 1523 |
| 1524 void BytecodeGraphBuilder::VisitJumpIfHole() { |
| 1525 BuildJumpIfEqual(jsgraph()->TheHoleConstant()); |
| 1526 } |
| 1527 |
| 1528 void BytecodeGraphBuilder::VisitJumpIfNotHole() { |
| 1529 Node* accumulator = environment()->LookupAccumulator(); |
| 1530 Node* condition = NewNode(javascript()->StrictEqual(), accumulator, |
| 1531 jsgraph()->TheHoleConstant()); |
| 1532 Node* node = |
| 1533 NewNode(common()->Select(MachineRepresentation::kTagged), condition, |
| 1534 jsgraph()->FalseConstant(), jsgraph()->TrueConstant()); |
| 1535 BuildConditionalJump(node); |
| 1536 } |
| 1537 |
1524 void BytecodeGraphBuilder::VisitReturn() { | 1538 void BytecodeGraphBuilder::VisitReturn() { |
1525 Node* control = | 1539 Node* control = |
1526 NewNode(common()->Return(), environment()->LookupAccumulator()); | 1540 NewNode(common()->Return(), environment()->LookupAccumulator()); |
1527 MergeControlToLeaveFunction(control); | 1541 MergeControlToLeaveFunction(control); |
1528 } | 1542 } |
1529 | 1543 |
1530 void BytecodeGraphBuilder::BuildForInPrepare() { | 1544 void BytecodeGraphBuilder::BuildForInPrepare() { |
1531 FrameStateBeforeAndAfter states(this); | 1545 FrameStateBeforeAndAfter states(this); |
1532 Node* receiver = environment()->LookupAccumulator(); | 1546 Node* receiver = environment()->LookupAccumulator(); |
1533 Node* prepare = NewNode(javascript()->ForInPrepare(), receiver); | 1547 Node* prepare = NewNode(javascript()->ForInPrepare(), receiver); |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1834 // Phi does not exist yet, introduce one. | 1848 // Phi does not exist yet, introduce one. |
1835 value = NewPhi(inputs, value, control); | 1849 value = NewPhi(inputs, value, control); |
1836 value->ReplaceInput(inputs - 1, other); | 1850 value->ReplaceInput(inputs - 1, other); |
1837 } | 1851 } |
1838 return value; | 1852 return value; |
1839 } | 1853 } |
1840 | 1854 |
1841 } // namespace compiler | 1855 } // namespace compiler |
1842 } // namespace internal | 1856 } // namespace internal |
1843 } // namespace v8 | 1857 } // namespace v8 |
OLD | NEW |