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 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1506 void BytecodeGraphBuilder::VisitJumpIfUndefinedConstantWide() { | 1506 void BytecodeGraphBuilder::VisitJumpIfUndefinedConstantWide() { |
1507 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); | 1507 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); |
1508 } | 1508 } |
1509 | 1509 |
1510 void BytecodeGraphBuilder::VisitStackCheck() { | 1510 void BytecodeGraphBuilder::VisitStackCheck() { |
1511 FrameStateBeforeAndAfter states(this); | 1511 FrameStateBeforeAndAfter states(this); |
1512 Node* node = NewNode(javascript()->StackCheck()); | 1512 Node* node = NewNode(javascript()->StackCheck()); |
1513 environment()->RecordAfterState(node, &states); | 1513 environment()->RecordAfterState(node, &states); |
1514 } | 1514 } |
1515 | 1515 |
1516 void BytecodeGraphBuilder::VisitJumpIfHole() { | |
1517 BuildJumpIfEqual(jsgraph()->TheHoleConstant()); | |
1518 } | |
1519 | |
1520 void BytecodeGraphBuilder::VisitJumpIfNotHole() { | |
1521 Node* accumulator = environment()->LookupAccumulator(); | |
1522 Node* condition = NewNode(javascript()->StrictEqual(), accumulator, | |
Michael Starzinger
2016/02/08 11:54:08
Can we use javascript()->StrictNotEqual() here? Or
mythria
2016/02/08 13:22:33
StrictNotEqual causes an assert fail here: https:/
Michael Starzinger
2016/02/08 13:57:45
Acknowledged. Ah, yeah, I have seen this before. I
| |
1523 jsgraph()->TheHoleConstant()); | |
1524 Node* node = | |
1525 NewNode(common()->Select(MachineRepresentation::kTagged), condition, | |
1526 jsgraph()->FalseConstant(), jsgraph()->TrueConstant()); | |
1527 BuildConditionalJump(node); | |
1528 } | |
1529 | |
1516 void BytecodeGraphBuilder::VisitReturn() { | 1530 void BytecodeGraphBuilder::VisitReturn() { |
1517 Node* control = | 1531 Node* control = |
1518 NewNode(common()->Return(), environment()->LookupAccumulator()); | 1532 NewNode(common()->Return(), environment()->LookupAccumulator()); |
1519 MergeControlToLeaveFunction(control); | 1533 MergeControlToLeaveFunction(control); |
1520 } | 1534 } |
1521 | 1535 |
1522 void BytecodeGraphBuilder::VisitDebugger() { | 1536 void BytecodeGraphBuilder::VisitDebugger() { |
1523 FrameStateBeforeAndAfter states(this); | 1537 FrameStateBeforeAndAfter states(this); |
1524 Node* call = | 1538 Node* call = |
1525 NewNode(javascript()->CallRuntime(Runtime::kHandleDebuggerStatement)); | 1539 NewNode(javascript()->CallRuntime(Runtime::kHandleDebuggerStatement)); |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1831 // Phi does not exist yet, introduce one. | 1845 // Phi does not exist yet, introduce one. |
1832 value = NewPhi(inputs, value, control); | 1846 value = NewPhi(inputs, value, control); |
1833 value->ReplaceInput(inputs - 1, other); | 1847 value->ReplaceInput(inputs - 1, other); |
1834 } | 1848 } |
1835 return value; | 1849 return value; |
1836 } | 1850 } |
1837 | 1851 |
1838 } // namespace compiler | 1852 } // namespace compiler |
1839 } // namespace internal | 1853 } // namespace internal |
1840 } // namespace v8 | 1854 } // namespace v8 |
OLD | NEW |