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/linkage.h" | 7 #include "src/compiler/linkage.h" |
8 #include "src/compiler/operator-properties.h" | 8 #include "src/compiler/operator-properties.h" |
9 #include "src/interpreter/bytecode-array-iterator.h" | 9 #include "src/interpreter/bytecode-array-iterator.h" |
10 #include "src/interpreter/bytecodes.h" | 10 #include "src/interpreter/bytecodes.h" |
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 | 952 |
953 | 953 |
954 void BytecodeGraphBuilder::VisitDec( | 954 void BytecodeGraphBuilder::VisitDec( |
955 const interpreter::BytecodeArrayIterator& iterator) { | 955 const interpreter::BytecodeArrayIterator& iterator) { |
956 UNIMPLEMENTED(); | 956 UNIMPLEMENTED(); |
957 } | 957 } |
958 | 958 |
959 | 959 |
960 void BytecodeGraphBuilder::VisitLogicalNot( | 960 void BytecodeGraphBuilder::VisitLogicalNot( |
961 const interpreter::BytecodeArrayIterator& iterator) { | 961 const interpreter::BytecodeArrayIterator& iterator) { |
962 Node* value = | 962 Node* value = NewNode(javascript()->ToBoolean(ToBooleanHint::kAny), |
963 NewNode(javascript()->ToBoolean(), environment()->LookupAccumulator()); | 963 environment()->LookupAccumulator()); |
964 Node* node = NewNode(common()->Select(kMachAnyTagged), value, | 964 Node* node = NewNode(common()->Select(kMachAnyTagged), value, |
965 jsgraph()->FalseConstant(), jsgraph()->TrueConstant()); | 965 jsgraph()->FalseConstant(), jsgraph()->TrueConstant()); |
966 environment()->BindAccumulator(node); | 966 environment()->BindAccumulator(node); |
967 } | 967 } |
968 | 968 |
969 | 969 |
970 void BytecodeGraphBuilder::VisitTypeOf( | 970 void BytecodeGraphBuilder::VisitTypeOf( |
971 const interpreter::BytecodeArrayIterator& iterator) { | 971 const interpreter::BytecodeArrayIterator& iterator) { |
972 Node* node = | 972 Node* node = |
973 NewNode(javascript()->TypeOf(), environment()->LookupAccumulator()); | 973 NewNode(javascript()->TypeOf(), environment()->LookupAccumulator()); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 void BytecodeGraphBuilder::BuildCastOperator( | 1075 void BytecodeGraphBuilder::BuildCastOperator( |
1076 const Operator* js_op, const interpreter::BytecodeArrayIterator& iterator) { | 1076 const Operator* js_op, const interpreter::BytecodeArrayIterator& iterator) { |
1077 Node* node = NewNode(js_op, environment()->LookupAccumulator()); | 1077 Node* node = NewNode(js_op, environment()->LookupAccumulator()); |
1078 AddEmptyFrameStateInputs(node); | 1078 AddEmptyFrameStateInputs(node); |
1079 environment()->BindAccumulator(node); | 1079 environment()->BindAccumulator(node); |
1080 } | 1080 } |
1081 | 1081 |
1082 | 1082 |
1083 void BytecodeGraphBuilder::VisitToBoolean( | 1083 void BytecodeGraphBuilder::VisitToBoolean( |
1084 const interpreter::BytecodeArrayIterator& iterator) { | 1084 const interpreter::BytecodeArrayIterator& iterator) { |
1085 BuildCastOperator(javascript()->ToBoolean(), iterator); | 1085 BuildCastOperator(javascript()->ToBoolean(ToBooleanHint::kAny), iterator); |
1086 } | 1086 } |
1087 | 1087 |
1088 | 1088 |
1089 void BytecodeGraphBuilder::VisitToName( | 1089 void BytecodeGraphBuilder::VisitToName( |
1090 const interpreter::BytecodeArrayIterator& iterator) { | 1090 const interpreter::BytecodeArrayIterator& iterator) { |
1091 BuildCastOperator(javascript()->ToName(), iterator); | 1091 BuildCastOperator(javascript()->ToName(), iterator); |
1092 } | 1092 } |
1093 | 1093 |
1094 | 1094 |
1095 void BytecodeGraphBuilder::VisitToNumber( | 1095 void BytecodeGraphBuilder::VisitToNumber( |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 | 1310 |
1311 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 1311 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
1312 if (environment()->IsMarkedAsUnreachable()) return; | 1312 if (environment()->IsMarkedAsUnreachable()) return; |
1313 environment()->MarkAsUnreachable(); | 1313 environment()->MarkAsUnreachable(); |
1314 exit_controls_.push_back(exit); | 1314 exit_controls_.push_back(exit); |
1315 } | 1315 } |
1316 | 1316 |
1317 } // namespace compiler | 1317 } // namespace compiler |
1318 } // namespace internal | 1318 } // namespace internal |
1319 } // namespace v8 | 1319 } // namespace v8 |
OLD | NEW |