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 | 10 |
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 } | 931 } |
932 | 932 |
933 | 933 |
934 void BytecodeGraphBuilder::VisitDeletePropertySloppy( | 934 void BytecodeGraphBuilder::VisitDeletePropertySloppy( |
935 const interpreter::BytecodeArrayIterator& iterator) { | 935 const interpreter::BytecodeArrayIterator& iterator) { |
936 DCHECK(is_sloppy(language_mode())); | 936 DCHECK(is_sloppy(language_mode())); |
937 BuildDelete(iterator); | 937 BuildDelete(iterator); |
938 } | 938 } |
939 | 939 |
940 | 940 |
| 941 void BytecodeGraphBuilder::BuildCompareOp( |
| 942 const Operator* js_op, const interpreter::BytecodeArrayIterator& iterator) { |
| 943 Node* left = environment()->LookupRegister(iterator.GetRegisterOperand(0)); |
| 944 Node* right = environment()->LookupAccumulator(); |
| 945 Node* node = NewNode(js_op, left, right); |
| 946 |
| 947 AddEmptyFrameStateInputs(node); |
| 948 environment()->BindAccumulator(node); |
| 949 } |
| 950 |
| 951 |
941 void BytecodeGraphBuilder::VisitTestEqual( | 952 void BytecodeGraphBuilder::VisitTestEqual( |
942 const interpreter::BytecodeArrayIterator& iterator) { | 953 const interpreter::BytecodeArrayIterator& iterator) { |
943 UNIMPLEMENTED(); | 954 BuildCompareOp(javascript()->Equal(), iterator); |
944 } | 955 } |
945 | 956 |
946 | 957 |
947 void BytecodeGraphBuilder::VisitTestNotEqual( | 958 void BytecodeGraphBuilder::VisitTestNotEqual( |
948 const interpreter::BytecodeArrayIterator& iterator) { | 959 const interpreter::BytecodeArrayIterator& iterator) { |
949 UNIMPLEMENTED(); | 960 BuildCompareOp(javascript()->NotEqual(), iterator); |
950 } | 961 } |
951 | 962 |
952 | 963 |
953 void BytecodeGraphBuilder::VisitTestEqualStrict( | 964 void BytecodeGraphBuilder::VisitTestEqualStrict( |
954 const interpreter::BytecodeArrayIterator& iterator) { | 965 const interpreter::BytecodeArrayIterator& iterator) { |
955 UNIMPLEMENTED(); | 966 BuildCompareOp(javascript()->StrictEqual(), iterator); |
956 } | 967 } |
957 | 968 |
958 | 969 |
959 void BytecodeGraphBuilder::VisitTestNotEqualStrict( | 970 void BytecodeGraphBuilder::VisitTestNotEqualStrict( |
960 const interpreter::BytecodeArrayIterator& iterator) { | 971 const interpreter::BytecodeArrayIterator& iterator) { |
961 UNIMPLEMENTED(); | 972 BuildCompareOp(javascript()->StrictNotEqual(), iterator); |
962 } | 973 } |
963 | 974 |
964 | 975 |
965 void BytecodeGraphBuilder::VisitTestLessThan( | 976 void BytecodeGraphBuilder::VisitTestLessThan( |
966 const interpreter::BytecodeArrayIterator& iterator) { | 977 const interpreter::BytecodeArrayIterator& iterator) { |
967 UNIMPLEMENTED(); | 978 BuildCompareOp(javascript()->LessThan(language_mode()), iterator); |
968 } | 979 } |
969 | 980 |
970 | 981 |
971 void BytecodeGraphBuilder::VisitTestGreaterThan( | 982 void BytecodeGraphBuilder::VisitTestGreaterThan( |
972 const interpreter::BytecodeArrayIterator& iterator) { | 983 const interpreter::BytecodeArrayIterator& iterator) { |
973 UNIMPLEMENTED(); | 984 BuildCompareOp(javascript()->GreaterThan(language_mode()), iterator); |
974 } | 985 } |
975 | 986 |
976 | 987 |
977 void BytecodeGraphBuilder::VisitTestLessThanOrEqual( | 988 void BytecodeGraphBuilder::VisitTestLessThanOrEqual( |
978 const interpreter::BytecodeArrayIterator& iterator) { | 989 const interpreter::BytecodeArrayIterator& iterator) { |
979 UNIMPLEMENTED(); | 990 BuildCompareOp(javascript()->LessThanOrEqual(language_mode()), iterator); |
980 } | 991 } |
981 | 992 |
982 | 993 |
983 void BytecodeGraphBuilder::VisitTestGreaterThanOrEqual( | 994 void BytecodeGraphBuilder::VisitTestGreaterThanOrEqual( |
984 const interpreter::BytecodeArrayIterator& iterator) { | 995 const interpreter::BytecodeArrayIterator& iterator) { |
985 UNIMPLEMENTED(); | 996 BuildCompareOp(javascript()->GreaterThanOrEqual(language_mode()), iterator); |
986 } | 997 } |
987 | 998 |
988 | 999 |
989 void BytecodeGraphBuilder::VisitTestIn( | 1000 void BytecodeGraphBuilder::VisitTestIn( |
990 const interpreter::BytecodeArrayIterator& iterator) { | 1001 const interpreter::BytecodeArrayIterator& iterator) { |
991 UNIMPLEMENTED(); | 1002 BuildCompareOp(javascript()->HasProperty(), iterator); |
992 } | 1003 } |
993 | 1004 |
994 | 1005 |
995 void BytecodeGraphBuilder::VisitTestInstanceOf( | 1006 void BytecodeGraphBuilder::VisitTestInstanceOf( |
996 const interpreter::BytecodeArrayIterator& iterator) { | 1007 const interpreter::BytecodeArrayIterator& iterator) { |
997 UNIMPLEMENTED(); | 1008 BuildCompareOp(javascript()->InstanceOf(), iterator); |
998 } | 1009 } |
999 | 1010 |
1000 | 1011 |
1001 void BytecodeGraphBuilder::VisitToBoolean( | 1012 void BytecodeGraphBuilder::VisitToBoolean( |
1002 const interpreter::BytecodeArrayIterator& iterator) { | 1013 const interpreter::BytecodeArrayIterator& iterator) { |
1003 UNIMPLEMENTED(); | 1014 UNIMPLEMENTED(); |
1004 } | 1015 } |
1005 | 1016 |
1006 | 1017 |
1007 void BytecodeGraphBuilder::VisitToName( | 1018 void BytecodeGraphBuilder::VisitToName( |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1228 | 1239 |
1229 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 1240 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
1230 if (environment()->IsMarkedAsUnreachable()) return; | 1241 if (environment()->IsMarkedAsUnreachable()) return; |
1231 environment()->MarkAsUnreachable(); | 1242 environment()->MarkAsUnreachable(); |
1232 exit_controls_.push_back(exit); | 1243 exit_controls_.push_back(exit); |
1233 } | 1244 } |
1234 | 1245 |
1235 } // namespace compiler | 1246 } // namespace compiler |
1236 } // namespace internal | 1247 } // namespace internal |
1237 } // namespace v8 | 1248 } // namespace v8 |
OLD | NEW |