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 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 | 1133 |
1134 void BytecodeGraphBuilder::VisitDec() { | 1134 void BytecodeGraphBuilder::VisitDec() { |
1135 FrameStateBeforeAndAfter states(this); | 1135 FrameStateBeforeAndAfter states(this); |
1136 const Operator* js_op = javascript()->Subtract(BinaryOperationHints::Any()); | 1136 const Operator* js_op = javascript()->Subtract(BinaryOperationHints::Any()); |
1137 Node* node = NewNode(js_op, environment()->LookupAccumulator(), | 1137 Node* node = NewNode(js_op, environment()->LookupAccumulator(), |
1138 jsgraph()->OneConstant()); | 1138 jsgraph()->OneConstant()); |
1139 environment()->BindAccumulator(node, &states); | 1139 environment()->BindAccumulator(node, &states); |
1140 } | 1140 } |
1141 | 1141 |
1142 void BytecodeGraphBuilder::VisitLogicalNot() { | 1142 void BytecodeGraphBuilder::VisitLogicalNot() { |
| 1143 Node* value = environment()->LookupAccumulator(); |
| 1144 Node* node = NewNode(common()->Select(MachineRepresentation::kTagged), value, |
| 1145 jsgraph()->FalseConstant(), jsgraph()->TrueConstant()); |
| 1146 environment()->BindAccumulator(node); |
| 1147 } |
| 1148 |
| 1149 void BytecodeGraphBuilder::VisitToBooleanLogicalNot() { |
1143 Node* value = NewNode(javascript()->ToBoolean(ToBooleanHint::kAny), | 1150 Node* value = NewNode(javascript()->ToBoolean(ToBooleanHint::kAny), |
1144 environment()->LookupAccumulator()); | 1151 environment()->LookupAccumulator()); |
1145 Node* node = NewNode(common()->Select(MachineRepresentation::kTagged), value, | 1152 Node* node = NewNode(common()->Select(MachineRepresentation::kTagged), value, |
1146 jsgraph()->FalseConstant(), jsgraph()->TrueConstant()); | 1153 jsgraph()->FalseConstant(), jsgraph()->TrueConstant()); |
1147 environment()->BindAccumulator(node); | 1154 environment()->BindAccumulator(node); |
1148 } | 1155 } |
1149 | 1156 |
1150 void BytecodeGraphBuilder::VisitTypeOf() { | 1157 void BytecodeGraphBuilder::VisitTypeOf() { |
1151 Node* node = | 1158 Node* node = |
1152 NewNode(javascript()->TypeOf(), environment()->LookupAccumulator()); | 1159 NewNode(javascript()->TypeOf(), environment()->LookupAccumulator()); |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1690 // Phi does not exist yet, introduce one. | 1697 // Phi does not exist yet, introduce one. |
1691 value = NewPhi(inputs, value, control); | 1698 value = NewPhi(inputs, value, control); |
1692 value->ReplaceInput(inputs - 1, other); | 1699 value->ReplaceInput(inputs - 1, other); |
1693 } | 1700 } |
1694 return value; | 1701 return value; |
1695 } | 1702 } |
1696 | 1703 |
1697 } // namespace compiler | 1704 } // namespace compiler |
1698 } // namespace internal | 1705 } // namespace internal |
1699 } // namespace v8 | 1706 } // namespace v8 |
OLD | NEW |