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 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 Node* right = environment()->LookupAccumulator(); | 825 Node* right = environment()->LookupAccumulator(); |
826 Node* node = NewNode(js_op, left, right); | 826 Node* node = NewNode(js_op, left, right); |
827 | 827 |
828 AddEmptyFrameStateInputs(node); | 828 AddEmptyFrameStateInputs(node); |
829 environment()->BindAccumulator(node); | 829 environment()->BindAccumulator(node); |
830 } | 830 } |
831 | 831 |
832 | 832 |
833 void BytecodeGraphBuilder::VisitAdd( | 833 void BytecodeGraphBuilder::VisitAdd( |
834 const interpreter::BytecodeArrayIterator& iterator) { | 834 const interpreter::BytecodeArrayIterator& iterator) { |
835 BuildBinaryOp(javascript()->Add(language_mode()), iterator); | 835 BinaryOperationHints hints = BinaryOperationHints::Any(); |
| 836 BuildBinaryOp(javascript()->Add(language_mode(), hints), iterator); |
836 } | 837 } |
837 | 838 |
838 | 839 |
839 void BytecodeGraphBuilder::VisitSub( | 840 void BytecodeGraphBuilder::VisitSub( |
840 const interpreter::BytecodeArrayIterator& iterator) { | 841 const interpreter::BytecodeArrayIterator& iterator) { |
841 BuildBinaryOp(javascript()->Subtract(language_mode()), iterator); | 842 BinaryOperationHints hints = BinaryOperationHints::Any(); |
| 843 BuildBinaryOp(javascript()->Subtract(language_mode(), hints), iterator); |
842 } | 844 } |
843 | 845 |
844 | 846 |
845 void BytecodeGraphBuilder::VisitMul( | 847 void BytecodeGraphBuilder::VisitMul( |
846 const interpreter::BytecodeArrayIterator& iterator) { | 848 const interpreter::BytecodeArrayIterator& iterator) { |
847 BuildBinaryOp(javascript()->Multiply(language_mode()), iterator); | 849 BinaryOperationHints hints = BinaryOperationHints::Any(); |
| 850 BuildBinaryOp(javascript()->Multiply(language_mode(), hints), iterator); |
848 } | 851 } |
849 | 852 |
850 | 853 |
851 void BytecodeGraphBuilder::VisitDiv( | 854 void BytecodeGraphBuilder::VisitDiv( |
852 const interpreter::BytecodeArrayIterator& iterator) { | 855 const interpreter::BytecodeArrayIterator& iterator) { |
853 BuildBinaryOp(javascript()->Divide(language_mode()), iterator); | 856 BinaryOperationHints hints = BinaryOperationHints::Any(); |
| 857 BuildBinaryOp(javascript()->Divide(language_mode(), hints), iterator); |
854 } | 858 } |
855 | 859 |
856 | 860 |
857 void BytecodeGraphBuilder::VisitMod( | 861 void BytecodeGraphBuilder::VisitMod( |
858 const interpreter::BytecodeArrayIterator& iterator) { | 862 const interpreter::BytecodeArrayIterator& iterator) { |
859 BuildBinaryOp(javascript()->Modulus(language_mode()), iterator); | 863 BinaryOperationHints hints = BinaryOperationHints::Any(); |
| 864 BuildBinaryOp(javascript()->Modulus(language_mode(), hints), iterator); |
860 } | 865 } |
861 | 866 |
862 | 867 |
863 void BytecodeGraphBuilder::VisitBitwiseOr( | 868 void BytecodeGraphBuilder::VisitBitwiseOr( |
864 const interpreter::BytecodeArrayIterator& iterator) { | 869 const interpreter::BytecodeArrayIterator& iterator) { |
865 BuildBinaryOp(javascript()->BitwiseOr(language_mode()), iterator); | 870 BinaryOperationHints hints = BinaryOperationHints::Any(); |
| 871 BuildBinaryOp(javascript()->BitwiseOr(language_mode(), hints), iterator); |
866 } | 872 } |
867 | 873 |
868 | 874 |
869 void BytecodeGraphBuilder::VisitBitwiseXor( | 875 void BytecodeGraphBuilder::VisitBitwiseXor( |
870 const interpreter::BytecodeArrayIterator& iterator) { | 876 const interpreter::BytecodeArrayIterator& iterator) { |
871 BuildBinaryOp(javascript()->BitwiseXor(language_mode()), iterator); | 877 BinaryOperationHints hints = BinaryOperationHints::Any(); |
| 878 BuildBinaryOp(javascript()->BitwiseXor(language_mode(), hints), iterator); |
872 } | 879 } |
873 | 880 |
874 | 881 |
875 void BytecodeGraphBuilder::VisitBitwiseAnd( | 882 void BytecodeGraphBuilder::VisitBitwiseAnd( |
876 const interpreter::BytecodeArrayIterator& iterator) { | 883 const interpreter::BytecodeArrayIterator& iterator) { |
877 BuildBinaryOp(javascript()->BitwiseAnd(language_mode()), iterator); | 884 BinaryOperationHints hints = BinaryOperationHints::Any(); |
| 885 BuildBinaryOp(javascript()->BitwiseAnd(language_mode(), hints), iterator); |
878 } | 886 } |
879 | 887 |
880 | 888 |
881 void BytecodeGraphBuilder::VisitShiftLeft( | 889 void BytecodeGraphBuilder::VisitShiftLeft( |
882 const interpreter::BytecodeArrayIterator& iterator) { | 890 const interpreter::BytecodeArrayIterator& iterator) { |
883 BuildBinaryOp(javascript()->ShiftLeft(language_mode()), iterator); | 891 BinaryOperationHints hints = BinaryOperationHints::Any(); |
| 892 BuildBinaryOp(javascript()->ShiftLeft(language_mode(), hints), iterator); |
884 } | 893 } |
885 | 894 |
886 | 895 |
887 void BytecodeGraphBuilder::VisitShiftRight( | 896 void BytecodeGraphBuilder::VisitShiftRight( |
888 const interpreter::BytecodeArrayIterator& iterator) { | 897 const interpreter::BytecodeArrayIterator& iterator) { |
889 BuildBinaryOp(javascript()->ShiftRight(language_mode()), iterator); | 898 BinaryOperationHints hints = BinaryOperationHints::Any(); |
| 899 BuildBinaryOp(javascript()->ShiftRight(language_mode(), hints), iterator); |
890 } | 900 } |
891 | 901 |
892 | 902 |
893 void BytecodeGraphBuilder::VisitShiftRightLogical( | 903 void BytecodeGraphBuilder::VisitShiftRightLogical( |
894 const interpreter::BytecodeArrayIterator& iterator) { | 904 const interpreter::BytecodeArrayIterator& iterator) { |
895 BuildBinaryOp(javascript()->ShiftRightLogical(language_mode()), iterator); | 905 BinaryOperationHints hints = BinaryOperationHints::Any(); |
| 906 BuildBinaryOp(javascript()->ShiftRightLogical(language_mode(), hints), |
| 907 iterator); |
896 } | 908 } |
897 | 909 |
898 | 910 |
899 void BytecodeGraphBuilder::VisitInc( | 911 void BytecodeGraphBuilder::VisitInc( |
900 const interpreter::BytecodeArrayIterator& iterator) { | 912 const interpreter::BytecodeArrayIterator& iterator) { |
901 UNIMPLEMENTED(); | 913 UNIMPLEMENTED(); |
902 } | 914 } |
903 | 915 |
904 | 916 |
905 void BytecodeGraphBuilder::VisitDec( | 917 void BytecodeGraphBuilder::VisitDec( |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1259 | 1271 |
1260 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 1272 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
1261 if (environment()->IsMarkedAsUnreachable()) return; | 1273 if (environment()->IsMarkedAsUnreachable()) return; |
1262 environment()->MarkAsUnreachable(); | 1274 environment()->MarkAsUnreachable(); |
1263 exit_controls_.push_back(exit); | 1275 exit_controls_.push_back(exit); |
1264 } | 1276 } |
1265 | 1277 |
1266 } // namespace compiler | 1278 } // namespace compiler |
1267 } // namespace internal | 1279 } // namespace internal |
1268 } // namespace v8 | 1280 } // namespace v8 |
OLD | NEW |