Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/code-stubs.h" | 5 #include "src/code-stubs.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 742 } | 742 } |
| 743 | 743 |
| 744 assembler->Bind(&if_rhsisnotnumber); | 744 assembler->Bind(&if_rhsisnotnumber); |
| 745 { | 745 { |
| 746 // Load the instance type of {rhs}. | 746 // Load the instance type of {rhs}. |
| 747 Node* rhs_instance_type = assembler->LoadMapInstanceType(rhs_map); | 747 Node* rhs_instance_type = assembler->LoadMapInstanceType(rhs_map); |
| 748 | 748 |
| 749 // Check if the {rhs} is a String. | 749 // Check if the {rhs} is a String. |
| 750 Label if_rhsisstring(assembler, Label::kDeferred), | 750 Label if_rhsisstring(assembler, Label::kDeferred), |
| 751 if_rhsisnotstring(assembler, Label::kDeferred); | 751 if_rhsisnotstring(assembler, Label::kDeferred); |
| 752 assembler->Branch(assembler->Int32LessThan( | 752 assembler->Branch(assembler->IsStringInstanceType(rhs_instance_type), |
| 753 rhs_instance_type, | |
| 754 assembler->Int32Constant(FIRST_NONSTRING_TYPE)), | |
| 755 &if_rhsisstring, &if_rhsisnotstring); | 753 &if_rhsisstring, &if_rhsisnotstring); |
| 756 | 754 |
| 757 assembler->Bind(&if_rhsisstring); | 755 assembler->Bind(&if_rhsisstring); |
| 758 { | 756 { |
| 759 var_lhs.Bind(lhs); | 757 var_lhs.Bind(lhs); |
| 760 var_rhs.Bind(rhs); | 758 var_rhs.Bind(rhs); |
| 761 assembler->Goto(&string_add_convert_left); | 759 assembler->Goto(&string_add_convert_left); |
| 762 } | 760 } |
| 763 | 761 |
| 764 assembler->Bind(&if_rhsisnotstring); | 762 assembler->Bind(&if_rhsisnotstring); |
| 765 { | 763 { |
| 766 // Check if {rhs} is a JSReceiver. | 764 // Check if {rhs} is a JSReceiver. |
| 767 Label if_rhsisreceiver(assembler, Label::kDeferred), | 765 Label if_rhsisreceiver(assembler, Label::kDeferred), |
| 768 if_rhsisnotreceiver(assembler, Label::kDeferred); | 766 if_rhsisnotreceiver(assembler, Label::kDeferred); |
| 769 assembler->Branch( | 767 assembler->Branch( |
| 770 assembler->Int32LessThanOrEqual( | 768 assembler->IsJSReceiverInstanceType(rhs_instance_type), |
|
jgruber
2016/10/04 13:35:54
This is an (oft-repeated) example of previously br
Igor Sheludko
2016/10/05 08:02:27
The old logic is also ok, it's just the order of a
jgruber
2016/10/05 08:39:38
Ah, right - that makes more sense.
| |
| 771 assembler->Int32Constant(FIRST_JS_RECEIVER_TYPE), | |
| 772 rhs_instance_type), | |
| 773 &if_rhsisreceiver, &if_rhsisnotreceiver); | 769 &if_rhsisreceiver, &if_rhsisnotreceiver); |
| 774 | 770 |
| 775 assembler->Bind(&if_rhsisreceiver); | 771 assembler->Bind(&if_rhsisreceiver); |
| 776 { | 772 { |
| 777 // Convert {rhs} to a primitive first passing no hint. | 773 // Convert {rhs} to a primitive first passing no hint. |
| 778 Callable callable = | 774 Callable callable = |
| 779 CodeFactory::NonPrimitiveToPrimitive(assembler->isolate()); | 775 CodeFactory::NonPrimitiveToPrimitive(assembler->isolate()); |
| 780 var_rhs.Bind(assembler->CallStub(callable, context, rhs)); | 776 var_rhs.Bind(assembler->CallStub(callable, context, rhs)); |
| 781 assembler->Goto(&loop); | 777 assembler->Goto(&loop); |
| 782 } | 778 } |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 794 } | 790 } |
| 795 } | 791 } |
| 796 | 792 |
| 797 assembler->Bind(&if_lhsisnotsmi); | 793 assembler->Bind(&if_lhsisnotsmi); |
| 798 { | 794 { |
| 799 // Load the map and instance type of {lhs}. | 795 // Load the map and instance type of {lhs}. |
| 800 Node* lhs_instance_type = assembler->LoadInstanceType(lhs); | 796 Node* lhs_instance_type = assembler->LoadInstanceType(lhs); |
| 801 | 797 |
| 802 // Check if {lhs} is a String. | 798 // Check if {lhs} is a String. |
| 803 Label if_lhsisstring(assembler), if_lhsisnotstring(assembler); | 799 Label if_lhsisstring(assembler), if_lhsisnotstring(assembler); |
| 804 assembler->Branch(assembler->Int32LessThan( | 800 assembler->Branch(assembler->IsStringInstanceType(lhs_instance_type), |
| 805 lhs_instance_type, | |
| 806 assembler->Int32Constant(FIRST_NONSTRING_TYPE)), | |
| 807 &if_lhsisstring, &if_lhsisnotstring); | 801 &if_lhsisstring, &if_lhsisnotstring); |
| 808 | 802 |
| 809 assembler->Bind(&if_lhsisstring); | 803 assembler->Bind(&if_lhsisstring); |
| 810 { | 804 { |
| 811 var_lhs.Bind(lhs); | 805 var_lhs.Bind(lhs); |
| 812 var_rhs.Bind(rhs); | 806 var_rhs.Bind(rhs); |
| 813 assembler->Goto(&string_add_convert_right); | 807 assembler->Goto(&string_add_convert_right); |
| 814 } | 808 } |
| 815 | 809 |
| 816 assembler->Bind(&if_lhsisnotstring); | 810 assembler->Bind(&if_lhsisnotstring); |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 838 assembler->Goto(&do_fadd); | 832 assembler->Goto(&do_fadd); |
| 839 } | 833 } |
| 840 | 834 |
| 841 assembler->Bind(&if_lhsisnotnumber); | 835 assembler->Bind(&if_lhsisnotnumber); |
| 842 { | 836 { |
| 843 // The {lhs} is neither a Number nor a String, and the {rhs} is a | 837 // The {lhs} is neither a Number nor a String, and the {rhs} is a |
| 844 // Smi. | 838 // Smi. |
| 845 Label if_lhsisreceiver(assembler, Label::kDeferred), | 839 Label if_lhsisreceiver(assembler, Label::kDeferred), |
| 846 if_lhsisnotreceiver(assembler, Label::kDeferred); | 840 if_lhsisnotreceiver(assembler, Label::kDeferred); |
| 847 assembler->Branch( | 841 assembler->Branch( |
| 848 assembler->Int32LessThanOrEqual( | 842 assembler->IsJSReceiverInstanceType(lhs_instance_type), |
| 849 assembler->Int32Constant(FIRST_JS_RECEIVER_TYPE), | |
| 850 lhs_instance_type), | |
| 851 &if_lhsisreceiver, &if_lhsisnotreceiver); | 843 &if_lhsisreceiver, &if_lhsisnotreceiver); |
| 852 | 844 |
| 853 assembler->Bind(&if_lhsisreceiver); | 845 assembler->Bind(&if_lhsisreceiver); |
| 854 { | 846 { |
| 855 // Convert {lhs} to a primitive first passing no hint. | 847 // Convert {lhs} to a primitive first passing no hint. |
| 856 Callable callable = | 848 Callable callable = |
| 857 CodeFactory::NonPrimitiveToPrimitive(assembler->isolate()); | 849 CodeFactory::NonPrimitiveToPrimitive(assembler->isolate()); |
| 858 var_lhs.Bind(assembler->CallStub(callable, context, lhs)); | 850 var_lhs.Bind(assembler->CallStub(callable, context, lhs)); |
| 859 assembler->Goto(&loop); | 851 assembler->Goto(&loop); |
| 860 } | 852 } |
| 861 | 853 |
| 862 assembler->Bind(&if_lhsisnotreceiver); | 854 assembler->Bind(&if_lhsisnotreceiver); |
| 863 { | 855 { |
| 864 // Convert {lhs} to a Number first. | 856 // Convert {lhs} to a Number first. |
| 865 Callable callable = | 857 Callable callable = |
| 866 CodeFactory::NonNumberToNumber(assembler->isolate()); | 858 CodeFactory::NonNumberToNumber(assembler->isolate()); |
| 867 var_lhs.Bind(assembler->CallStub(callable, context, lhs)); | 859 var_lhs.Bind(assembler->CallStub(callable, context, lhs)); |
| 868 assembler->Goto(&loop); | 860 assembler->Goto(&loop); |
| 869 } | 861 } |
| 870 } | 862 } |
| 871 } | 863 } |
| 872 | 864 |
| 873 assembler->Bind(&if_rhsisnotsmi); | 865 assembler->Bind(&if_rhsisnotsmi); |
| 874 { | 866 { |
| 875 // Load the instance type of {rhs}. | 867 // Load the instance type of {rhs}. |
| 876 Node* rhs_instance_type = assembler->LoadInstanceType(rhs); | 868 Node* rhs_instance_type = assembler->LoadInstanceType(rhs); |
| 877 | 869 |
| 878 // Check if {rhs} is a String. | 870 // Check if {rhs} is a String. |
| 879 Label if_rhsisstring(assembler), if_rhsisnotstring(assembler); | 871 Label if_rhsisstring(assembler), if_rhsisnotstring(assembler); |
| 880 assembler->Branch(assembler->Int32LessThan( | 872 assembler->Branch(assembler->IsStringInstanceType(rhs_instance_type), |
| 881 rhs_instance_type, | |
| 882 assembler->Int32Constant(FIRST_NONSTRING_TYPE)), | |
| 883 &if_rhsisstring, &if_rhsisnotstring); | 873 &if_rhsisstring, &if_rhsisnotstring); |
| 884 | 874 |
| 885 assembler->Bind(&if_rhsisstring); | 875 assembler->Bind(&if_rhsisstring); |
| 886 { | 876 { |
| 887 var_lhs.Bind(lhs); | 877 var_lhs.Bind(lhs); |
| 888 var_rhs.Bind(rhs); | 878 var_rhs.Bind(rhs); |
| 889 assembler->Goto(&string_add_convert_left); | 879 assembler->Goto(&string_add_convert_left); |
| 890 } | 880 } |
| 891 | 881 |
| 892 assembler->Bind(&if_rhsisnotstring); | 882 assembler->Bind(&if_rhsisnotstring); |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 915 var_fadd_rhs.Bind(assembler->LoadHeapNumberValue(rhs)); | 905 var_fadd_rhs.Bind(assembler->LoadHeapNumberValue(rhs)); |
| 916 assembler->Goto(&do_fadd); | 906 assembler->Goto(&do_fadd); |
| 917 } | 907 } |
| 918 | 908 |
| 919 assembler->Bind(&if_rhsisnotnumber); | 909 assembler->Bind(&if_rhsisnotnumber); |
| 920 { | 910 { |
| 921 // Check if {rhs} is a JSReceiver. | 911 // Check if {rhs} is a JSReceiver. |
| 922 Label if_rhsisreceiver(assembler, Label::kDeferred), | 912 Label if_rhsisreceiver(assembler, Label::kDeferred), |
| 923 if_rhsisnotreceiver(assembler, Label::kDeferred); | 913 if_rhsisnotreceiver(assembler, Label::kDeferred); |
| 924 assembler->Branch( | 914 assembler->Branch( |
| 925 assembler->Int32LessThanOrEqual( | 915 assembler->IsJSReceiverInstanceType(rhs_instance_type), |
| 926 assembler->Int32Constant(FIRST_JS_RECEIVER_TYPE), | |
| 927 rhs_instance_type), | |
| 928 &if_rhsisreceiver, &if_rhsisnotreceiver); | 916 &if_rhsisreceiver, &if_rhsisnotreceiver); |
| 929 | 917 |
| 930 assembler->Bind(&if_rhsisreceiver); | 918 assembler->Bind(&if_rhsisreceiver); |
| 931 { | 919 { |
| 932 // Convert {rhs} to a primitive first passing no hint. | 920 // Convert {rhs} to a primitive first passing no hint. |
| 933 Callable callable = CodeFactory::NonPrimitiveToPrimitive( | 921 Callable callable = CodeFactory::NonPrimitiveToPrimitive( |
| 934 assembler->isolate()); | 922 assembler->isolate()); |
| 935 var_rhs.Bind(assembler->CallStub(callable, context, rhs)); | 923 var_rhs.Bind(assembler->CallStub(callable, context, rhs)); |
| 936 assembler->Goto(&loop); | 924 assembler->Goto(&loop); |
| 937 } | 925 } |
| 938 | 926 |
| 939 assembler->Bind(&if_rhsisnotreceiver); | 927 assembler->Bind(&if_rhsisnotreceiver); |
| 940 { | 928 { |
| 941 // Convert {rhs} to a Number first. | 929 // Convert {rhs} to a Number first. |
| 942 Callable callable = | 930 Callable callable = |
| 943 CodeFactory::NonNumberToNumber(assembler->isolate()); | 931 CodeFactory::NonNumberToNumber(assembler->isolate()); |
| 944 var_rhs.Bind(assembler->CallStub(callable, context, rhs)); | 932 var_rhs.Bind(assembler->CallStub(callable, context, rhs)); |
| 945 assembler->Goto(&loop); | 933 assembler->Goto(&loop); |
| 946 } | 934 } |
| 947 } | 935 } |
| 948 } | 936 } |
| 949 | 937 |
| 950 assembler->Bind(&if_lhsisnotnumber); | 938 assembler->Bind(&if_lhsisnotnumber); |
| 951 { | 939 { |
| 952 // Check if {lhs} is a JSReceiver. | 940 // Check if {lhs} is a JSReceiver. |
| 953 Label if_lhsisreceiver(assembler, Label::kDeferred), | 941 Label if_lhsisreceiver(assembler, Label::kDeferred), |
| 954 if_lhsisnotreceiver(assembler); | 942 if_lhsisnotreceiver(assembler); |
| 955 assembler->Branch( | 943 assembler->Branch( |
| 956 assembler->Int32LessThanOrEqual( | 944 assembler->IsJSReceiverInstanceType(lhs_instance_type), |
| 957 assembler->Int32Constant(FIRST_JS_RECEIVER_TYPE), | |
| 958 lhs_instance_type), | |
| 959 &if_lhsisreceiver, &if_lhsisnotreceiver); | 945 &if_lhsisreceiver, &if_lhsisnotreceiver); |
| 960 | 946 |
| 961 assembler->Bind(&if_lhsisreceiver); | 947 assembler->Bind(&if_lhsisreceiver); |
| 962 { | 948 { |
| 963 // Convert {lhs} to a primitive first passing no hint. | 949 // Convert {lhs} to a primitive first passing no hint. |
| 964 Callable callable = | 950 Callable callable = |
| 965 CodeFactory::NonPrimitiveToPrimitive(assembler->isolate()); | 951 CodeFactory::NonPrimitiveToPrimitive(assembler->isolate()); |
| 966 var_lhs.Bind(assembler->CallStub(callable, context, lhs)); | 952 var_lhs.Bind(assembler->CallStub(callable, context, lhs)); |
| 967 assembler->Goto(&loop); | 953 assembler->Goto(&loop); |
| 968 } | 954 } |
| 969 | 955 |
| 970 assembler->Bind(&if_lhsisnotreceiver); | 956 assembler->Bind(&if_lhsisnotreceiver); |
| 971 { | 957 { |
| 972 // Check if {rhs} is a JSReceiver. | 958 // Check if {rhs} is a JSReceiver. |
| 973 Label if_rhsisreceiver(assembler, Label::kDeferred), | 959 Label if_rhsisreceiver(assembler, Label::kDeferred), |
| 974 if_rhsisnotreceiver(assembler, Label::kDeferred); | 960 if_rhsisnotreceiver(assembler, Label::kDeferred); |
| 975 assembler->Branch( | 961 assembler->Branch( |
| 976 assembler->Int32LessThanOrEqual( | 962 assembler->IsJSReceiverInstanceType(rhs_instance_type), |
| 977 assembler->Int32Constant(FIRST_JS_RECEIVER_TYPE), | |
| 978 rhs_instance_type), | |
| 979 &if_rhsisreceiver, &if_rhsisnotreceiver); | 963 &if_rhsisreceiver, &if_rhsisnotreceiver); |
| 980 | 964 |
| 981 assembler->Bind(&if_rhsisreceiver); | 965 assembler->Bind(&if_rhsisreceiver); |
| 982 { | 966 { |
| 983 // Convert {rhs} to a primitive first passing no hint. | 967 // Convert {rhs} to a primitive first passing no hint. |
| 984 Callable callable = CodeFactory::NonPrimitiveToPrimitive( | 968 Callable callable = CodeFactory::NonPrimitiveToPrimitive( |
| 985 assembler->isolate()); | 969 assembler->isolate()); |
| 986 var_rhs.Bind(assembler->CallStub(callable, context, rhs)); | 970 var_rhs.Bind(assembler->CallStub(callable, context, rhs)); |
| 987 assembler->Goto(&loop); | 971 assembler->Goto(&loop); |
| 988 } | 972 } |
| (...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2734 MachineType::PointerRepresentation()); | 2718 MachineType::PointerRepresentation()); |
| 2735 | 2719 |
| 2736 assembler->Branch(assembler->WordIsSmi(object), &if_number, &if_notsmi); | 2720 assembler->Branch(assembler->WordIsSmi(object), &if_number, &if_notsmi); |
| 2737 | 2721 |
| 2738 assembler->Bind(&if_notsmi); | 2722 assembler->Bind(&if_notsmi); |
| 2739 Node* map = assembler->LoadMap(object); | 2723 Node* map = assembler->LoadMap(object); |
| 2740 | 2724 |
| 2741 assembler->GotoIf(assembler->IsHeapNumberMap(map), &if_number); | 2725 assembler->GotoIf(assembler->IsHeapNumberMap(map), &if_number); |
| 2742 | 2726 |
| 2743 Node* instance_type = assembler->LoadMapInstanceType(map); | 2727 Node* instance_type = assembler->LoadMapInstanceType(map); |
| 2744 assembler->GotoIf( | 2728 assembler->GotoIf(assembler->IsJSReceiverInstanceType(instance_type), |
| 2745 assembler->Int32GreaterThanOrEqual( | 2729 &if_jsreceiver); |
| 2746 instance_type, assembler->Int32Constant(FIRST_JS_RECEIVER_TYPE)), | |
| 2747 &if_jsreceiver); | |
| 2748 | 2730 |
| 2749 Node* constructor_function_index = | 2731 Node* constructor_function_index = |
| 2750 assembler->LoadMapConstructorFunctionIndex(map); | 2732 assembler->LoadMapConstructorFunctionIndex(map); |
| 2751 assembler->GotoIf(assembler->WordEqual(constructor_function_index, | 2733 assembler->GotoIf(assembler->WordEqual(constructor_function_index, |
| 2752 assembler->IntPtrConstant( | 2734 assembler->IntPtrConstant( |
| 2753 Map::kNoConstructorFunctionIndex)), | 2735 Map::kNoConstructorFunctionIndex)), |
| 2754 &if_noconstructor); | 2736 &if_noconstructor); |
| 2755 constructor_function_index_var.Bind(constructor_function_index); | 2737 constructor_function_index_var.Bind(constructor_function_index); |
| 2756 assembler->Goto(&if_wrapjsvalue); | 2738 assembler->Goto(&if_wrapjsvalue); |
| 2757 | 2739 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2821 | 2803 |
| 2822 assembler->GotoIf( | 2804 assembler->GotoIf( |
| 2823 assembler->Word32Equal(callable_or_undetectable_mask, | 2805 assembler->Word32Equal(callable_or_undetectable_mask, |
| 2824 assembler->Int32Constant(1 << Map::kIsCallable)), | 2806 assembler->Int32Constant(1 << Map::kIsCallable)), |
| 2825 &return_function); | 2807 &return_function); |
| 2826 | 2808 |
| 2827 assembler->GotoUnless(assembler->Word32Equal(callable_or_undetectable_mask, | 2809 assembler->GotoUnless(assembler->Word32Equal(callable_or_undetectable_mask, |
| 2828 assembler->Int32Constant(0)), | 2810 assembler->Int32Constant(0)), |
| 2829 &return_undefined); | 2811 &return_undefined); |
| 2830 | 2812 |
| 2831 assembler->GotoIf( | 2813 assembler->GotoIf(assembler->IsJSReceiverInstanceType(instance_type), |
| 2832 assembler->Int32GreaterThanOrEqual( | 2814 &return_object); |
| 2833 instance_type, assembler->Int32Constant(FIRST_JS_RECEIVER_TYPE)), | |
| 2834 &return_object); | |
| 2835 | 2815 |
| 2836 assembler->GotoIf( | 2816 assembler->GotoIf(assembler->IsStringInstanceType(instance_type), |
| 2837 assembler->Int32LessThan(instance_type, | 2817 &return_string); |
| 2838 assembler->Int32Constant(FIRST_NONSTRING_TYPE)), | |
| 2839 &return_string); | |
| 2840 | 2818 |
| 2841 #define SIMD128_BRANCH(TYPE, Type, type, lane_count, lane_type) \ | 2819 #define SIMD128_BRANCH(TYPE, Type, type, lane_count, lane_type) \ |
| 2842 Label return_##type(assembler); \ | 2820 Label return_##type(assembler); \ |
| 2843 Node* type##_map = \ | 2821 Node* type##_map = \ |
| 2844 assembler->HeapConstant(assembler->factory()->type##_map()); \ | 2822 assembler->HeapConstant(assembler->factory()->type##_map()); \ |
| 2845 assembler->GotoIf(assembler->WordEqual(map, type##_map), &return_##type); | 2823 assembler->GotoIf(assembler->WordEqual(map, type##_map), &return_##type); |
| 2846 SIMD128_TYPES(SIMD128_BRANCH) | 2824 SIMD128_TYPES(SIMD128_BRANCH) |
| 2847 #undef SIMD128_BRANCH | 2825 #undef SIMD128_BRANCH |
| 2848 | 2826 |
| 2849 assembler->Assert(assembler->Word32Equal( | 2827 assembler->Assert(assembler->Word32Equal( |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3145 } | 3123 } |
| 3146 | 3124 |
| 3147 assembler->Bind(&if_lhsisnotnumber); | 3125 assembler->Bind(&if_lhsisnotnumber); |
| 3148 { | 3126 { |
| 3149 // Load the instance type of {lhs}. | 3127 // Load the instance type of {lhs}. |
| 3150 Node* lhs_instance_type = assembler->LoadMapInstanceType(lhs_map); | 3128 Node* lhs_instance_type = assembler->LoadMapInstanceType(lhs_map); |
| 3151 | 3129 |
| 3152 // Check if {lhs} is a String. | 3130 // Check if {lhs} is a String. |
| 3153 Label if_lhsisstring(assembler), | 3131 Label if_lhsisstring(assembler), |
| 3154 if_lhsisnotstring(assembler, Label::kDeferred); | 3132 if_lhsisnotstring(assembler, Label::kDeferred); |
| 3155 assembler->Branch(assembler->Int32LessThan( | 3133 assembler->Branch(assembler->IsStringInstanceType(lhs_instance_type), |
| 3156 lhs_instance_type, | |
| 3157 assembler->Int32Constant(FIRST_NONSTRING_TYPE)), | |
| 3158 &if_lhsisstring, &if_lhsisnotstring); | 3134 &if_lhsisstring, &if_lhsisnotstring); |
| 3159 | 3135 |
| 3160 assembler->Bind(&if_lhsisstring); | 3136 assembler->Bind(&if_lhsisstring); |
| 3161 { | 3137 { |
| 3162 // Load the instance type of {rhs}. | 3138 // Load the instance type of {rhs}. |
| 3163 Node* rhs_instance_type = assembler->LoadMapInstanceType(rhs_map); | 3139 Node* rhs_instance_type = assembler->LoadMapInstanceType(rhs_map); |
| 3164 | 3140 |
| 3165 // Check if {rhs} is also a String. | 3141 // Check if {rhs} is also a String. |
| 3166 Label if_rhsisstring(assembler, Label::kDeferred), | 3142 Label if_rhsisstring(assembler, Label::kDeferred), |
| 3167 if_rhsisnotstring(assembler, Label::kDeferred); | 3143 if_rhsisnotstring(assembler, Label::kDeferred); |
| 3168 assembler->Branch(assembler->Int32LessThan( | 3144 assembler->Branch( |
| 3169 rhs_instance_type, assembler->Int32Constant( | 3145 assembler->IsStringInstanceType(rhs_instance_type), |
| 3170 FIRST_NONSTRING_TYPE)), | 3146 &if_rhsisstring, &if_rhsisnotstring); |
| 3171 &if_rhsisstring, &if_rhsisnotstring); | |
| 3172 | 3147 |
| 3173 assembler->Bind(&if_rhsisstring); | 3148 assembler->Bind(&if_rhsisstring); |
| 3174 { | 3149 { |
| 3175 // Both {lhs} and {rhs} are strings. | 3150 // Both {lhs} and {rhs} are strings. |
| 3176 switch (mode) { | 3151 switch (mode) { |
| 3177 case kLessThan: | 3152 case kLessThan: |
| 3178 result.Bind(assembler->CallStub( | 3153 result.Bind(assembler->CallStub( |
| 3179 CodeFactory::StringLessThan(assembler->isolate()), | 3154 CodeFactory::StringLessThan(assembler->isolate()), |
| 3180 context, lhs, rhs)); | 3155 context, lhs, rhs)); |
| 3181 assembler->Goto(&end); | 3156 assembler->Goto(&end); |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 3205 assembler->Bind(&if_rhsisnotstring); | 3180 assembler->Bind(&if_rhsisnotstring); |
| 3206 { | 3181 { |
| 3207 // The {lhs} is a String, while {rhs} is neither a Number nor a | 3182 // The {lhs} is a String, while {rhs} is neither a Number nor a |
| 3208 // String, so we need to call ToPrimitive(rhs, hint Number) if | 3183 // String, so we need to call ToPrimitive(rhs, hint Number) if |
| 3209 // {rhs} is a receiver or ToNumber(lhs) and ToNumber(rhs) in the | 3184 // {rhs} is a receiver or ToNumber(lhs) and ToNumber(rhs) in the |
| 3210 // other cases. | 3185 // other cases. |
| 3211 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); | 3186 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
| 3212 Label if_rhsisreceiver(assembler, Label::kDeferred), | 3187 Label if_rhsisreceiver(assembler, Label::kDeferred), |
| 3213 if_rhsisnotreceiver(assembler, Label::kDeferred); | 3188 if_rhsisnotreceiver(assembler, Label::kDeferred); |
| 3214 assembler->Branch( | 3189 assembler->Branch( |
| 3215 assembler->Int32LessThanOrEqual( | 3190 assembler->IsJSReceiverInstanceType(rhs_instance_type), |
| 3216 assembler->Int32Constant(FIRST_JS_RECEIVER_TYPE), | |
| 3217 rhs_instance_type), | |
| 3218 &if_rhsisreceiver, &if_rhsisnotreceiver); | 3191 &if_rhsisreceiver, &if_rhsisnotreceiver); |
| 3219 | 3192 |
| 3220 assembler->Bind(&if_rhsisreceiver); | 3193 assembler->Bind(&if_rhsisreceiver); |
| 3221 { | 3194 { |
| 3222 // Convert {rhs} to a primitive first passing Number hint. | 3195 // Convert {rhs} to a primitive first passing Number hint. |
| 3223 Callable callable = CodeFactory::NonPrimitiveToPrimitive( | 3196 Callable callable = CodeFactory::NonPrimitiveToPrimitive( |
| 3224 assembler->isolate(), ToPrimitiveHint::kNumber); | 3197 assembler->isolate(), ToPrimitiveHint::kNumber); |
| 3225 var_rhs.Bind(assembler->CallStub(callable, context, rhs)); | 3198 var_rhs.Bind(assembler->CallStub(callable, context, rhs)); |
| 3226 assembler->Goto(&loop); | 3199 assembler->Goto(&loop); |
| 3227 } | 3200 } |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 3239 | 3212 |
| 3240 assembler->Bind(&if_lhsisnotstring); | 3213 assembler->Bind(&if_lhsisnotstring); |
| 3241 { | 3214 { |
| 3242 // The {lhs} is neither a Number nor a String, so we need to call | 3215 // The {lhs} is neither a Number nor a String, so we need to call |
| 3243 // ToPrimitive(lhs, hint Number) if {lhs} is a receiver or | 3216 // ToPrimitive(lhs, hint Number) if {lhs} is a receiver or |
| 3244 // ToNumber(lhs) and ToNumber(rhs) in the other cases. | 3217 // ToNumber(lhs) and ToNumber(rhs) in the other cases. |
| 3245 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); | 3218 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
| 3246 Label if_lhsisreceiver(assembler, Label::kDeferred), | 3219 Label if_lhsisreceiver(assembler, Label::kDeferred), |
| 3247 if_lhsisnotreceiver(assembler, Label::kDeferred); | 3220 if_lhsisnotreceiver(assembler, Label::kDeferred); |
| 3248 assembler->Branch( | 3221 assembler->Branch( |
| 3249 assembler->Int32LessThanOrEqual( | 3222 assembler->IsJSReceiverInstanceType(lhs_instance_type), |
| 3250 assembler->Int32Constant(FIRST_JS_RECEIVER_TYPE), | |
| 3251 lhs_instance_type), | |
| 3252 &if_lhsisreceiver, &if_lhsisnotreceiver); | 3223 &if_lhsisreceiver, &if_lhsisnotreceiver); |
| 3253 | 3224 |
| 3254 assembler->Bind(&if_lhsisreceiver); | 3225 assembler->Bind(&if_lhsisreceiver); |
| 3255 { | 3226 { |
| 3256 // Convert {lhs} to a primitive first passing Number hint. | 3227 // Convert {lhs} to a primitive first passing Number hint. |
| 3257 Callable callable = CodeFactory::NonPrimitiveToPrimitive( | 3228 Callable callable = CodeFactory::NonPrimitiveToPrimitive( |
| 3258 assembler->isolate(), ToPrimitiveHint::kNumber); | 3229 assembler->isolate(), ToPrimitiveHint::kNumber); |
| 3259 var_lhs.Bind(assembler->CallStub(callable, context, lhs)); | 3230 var_lhs.Bind(assembler->CallStub(callable, context, lhs)); |
| 3260 assembler->Goto(&loop); | 3231 assembler->Goto(&loop); |
| 3261 } | 3232 } |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3458 } | 3429 } |
| 3459 | 3430 |
| 3460 assembler->Bind(&if_rhsisnotnumber); | 3431 assembler->Bind(&if_rhsisnotnumber); |
| 3461 { | 3432 { |
| 3462 // Load the instance type of the {rhs}. | 3433 // Load the instance type of the {rhs}. |
| 3463 Node* rhs_instance_type = assembler->LoadMapInstanceType(rhs_map); | 3434 Node* rhs_instance_type = assembler->LoadMapInstanceType(rhs_map); |
| 3464 | 3435 |
| 3465 // Check if the {rhs} is a String. | 3436 // Check if the {rhs} is a String. |
| 3466 Label if_rhsisstring(assembler, Label::kDeferred), | 3437 Label if_rhsisstring(assembler, Label::kDeferred), |
| 3467 if_rhsisnotstring(assembler); | 3438 if_rhsisnotstring(assembler); |
| 3468 assembler->Branch(assembler->Int32LessThan( | 3439 assembler->Branch( |
| 3469 rhs_instance_type, assembler->Int32Constant( | 3440 assembler->IsStringInstanceType(rhs_instance_type), |
| 3470 FIRST_NONSTRING_TYPE)), | 3441 &if_rhsisstring, &if_rhsisnotstring); |
| 3471 &if_rhsisstring, &if_rhsisnotstring); | |
| 3472 | 3442 |
| 3473 assembler->Bind(&if_rhsisstring); | 3443 assembler->Bind(&if_rhsisstring); |
| 3474 { | 3444 { |
| 3475 // The {rhs} is a String and the {lhs} is a Smi; we need | 3445 // The {rhs} is a String and the {lhs} is a Smi; we need |
| 3476 // to convert the {rhs} to a Number and compare the output to | 3446 // to convert the {rhs} to a Number and compare the output to |
| 3477 // the Number on the {lhs}. | 3447 // the Number on the {lhs}. |
| 3478 assembler->Goto(&do_rhsstringtonumber); | 3448 assembler->Goto(&do_rhsstringtonumber); |
| 3479 } | 3449 } |
| 3480 | 3450 |
| 3481 assembler->Bind(&if_rhsisnotstring); | 3451 assembler->Bind(&if_rhsisnotstring); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 3493 assembler->Goto(&loop); | 3463 assembler->Goto(&loop); |
| 3494 } | 3464 } |
| 3495 | 3465 |
| 3496 assembler->Bind(&if_rhsisnotboolean); | 3466 assembler->Bind(&if_rhsisnotboolean); |
| 3497 { | 3467 { |
| 3498 // Check if the {rhs} is a Receiver. | 3468 // Check if the {rhs} is a Receiver. |
| 3499 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); | 3469 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
| 3500 Label if_rhsisreceiver(assembler, Label::kDeferred), | 3470 Label if_rhsisreceiver(assembler, Label::kDeferred), |
| 3501 if_rhsisnotreceiver(assembler); | 3471 if_rhsisnotreceiver(assembler); |
| 3502 assembler->Branch( | 3472 assembler->Branch( |
| 3503 assembler->Int32LessThanOrEqual( | 3473 assembler->IsJSReceiverInstanceType(rhs_instance_type), |
| 3504 assembler->Int32Constant(FIRST_JS_RECEIVER_TYPE), | |
| 3505 rhs_instance_type), | |
| 3506 &if_rhsisreceiver, &if_rhsisnotreceiver); | 3474 &if_rhsisreceiver, &if_rhsisnotreceiver); |
| 3507 | 3475 |
| 3508 assembler->Bind(&if_rhsisreceiver); | 3476 assembler->Bind(&if_rhsisreceiver); |
| 3509 { | 3477 { |
| 3510 // Convert {rhs} to a primitive first (passing no hint). | 3478 // Convert {rhs} to a primitive first (passing no hint). |
| 3511 Callable callable = CodeFactory::NonPrimitiveToPrimitive( | 3479 Callable callable = CodeFactory::NonPrimitiveToPrimitive( |
| 3512 assembler->isolate()); | 3480 assembler->isolate()); |
| 3513 var_rhs.Bind(assembler->CallStub(callable, context, rhs)); | 3481 var_rhs.Bind(assembler->CallStub(callable, context, rhs)); |
| 3514 assembler->Goto(&loop); | 3482 assembler->Goto(&loop); |
| 3515 } | 3483 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3577 assembler->Bind(case_labels[i]); | 3545 assembler->Bind(case_labels[i]); |
| 3578 assembler->Goto(&if_lhsisstring); | 3546 assembler->Goto(&if_lhsisstring); |
| 3579 delete case_labels[i]; | 3547 delete case_labels[i]; |
| 3580 } | 3548 } |
| 3581 | 3549 |
| 3582 assembler->Bind(&if_lhsisstring); | 3550 assembler->Bind(&if_lhsisstring); |
| 3583 { | 3551 { |
| 3584 // Check if {rhs} is also a String. | 3552 // Check if {rhs} is also a String. |
| 3585 Label if_rhsisstring(assembler, Label::kDeferred), | 3553 Label if_rhsisstring(assembler, Label::kDeferred), |
| 3586 if_rhsisnotstring(assembler); | 3554 if_rhsisnotstring(assembler); |
| 3587 assembler->Branch(assembler->Int32LessThan( | 3555 assembler->Branch( |
| 3588 rhs_instance_type, assembler->Int32Constant( | 3556 assembler->IsStringInstanceType(rhs_instance_type), |
| 3589 FIRST_NONSTRING_TYPE)), | 3557 &if_rhsisstring, &if_rhsisnotstring); |
| 3590 &if_rhsisstring, &if_rhsisnotstring); | |
| 3591 | 3558 |
| 3592 assembler->Bind(&if_rhsisstring); | 3559 assembler->Bind(&if_rhsisstring); |
| 3593 { | 3560 { |
| 3594 // Both {lhs} and {rhs} are of type String, just do the | 3561 // Both {lhs} and {rhs} are of type String, just do the |
| 3595 // string comparison then. | 3562 // string comparison then. |
| 3596 Callable callable = | 3563 Callable callable = |
| 3597 (mode == kDontNegateResult) | 3564 (mode == kDontNegateResult) |
| 3598 ? CodeFactory::StringEqual(assembler->isolate()) | 3565 ? CodeFactory::StringEqual(assembler->isolate()) |
| 3599 : CodeFactory::StringNotEqual(assembler->isolate()); | 3566 : CodeFactory::StringNotEqual(assembler->isolate()); |
| 3600 result.Bind(assembler->CallStub(callable, context, lhs, rhs)); | 3567 result.Bind(assembler->CallStub(callable, context, lhs, rhs)); |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 3629 var_fcmp_rhs.Bind(assembler->LoadHeapNumberValue(rhs)); | 3596 var_fcmp_rhs.Bind(assembler->LoadHeapNumberValue(rhs)); |
| 3630 assembler->Goto(&do_fcmp); | 3597 assembler->Goto(&do_fcmp); |
| 3631 } | 3598 } |
| 3632 | 3599 |
| 3633 assembler->Bind(&if_rhsisnotnumber); | 3600 assembler->Bind(&if_rhsisnotnumber); |
| 3634 { | 3601 { |
| 3635 // The {lhs} is a Number, the {rhs} is some other HeapObject. | 3602 // The {lhs} is a Number, the {rhs} is some other HeapObject. |
| 3636 Label if_rhsisstring(assembler, Label::kDeferred), | 3603 Label if_rhsisstring(assembler, Label::kDeferred), |
| 3637 if_rhsisnotstring(assembler); | 3604 if_rhsisnotstring(assembler); |
| 3638 assembler->Branch( | 3605 assembler->Branch( |
| 3639 assembler->Int32LessThan( | 3606 assembler->IsStringInstanceType(rhs_instance_type), |
| 3640 rhs_instance_type, | |
| 3641 assembler->Int32Constant(FIRST_NONSTRING_TYPE)), | |
| 3642 &if_rhsisstring, &if_rhsisnotstring); | 3607 &if_rhsisstring, &if_rhsisnotstring); |
| 3643 | 3608 |
| 3644 assembler->Bind(&if_rhsisstring); | 3609 assembler->Bind(&if_rhsisstring); |
| 3645 { | 3610 { |
| 3646 // The {rhs} is a String and the {lhs} is a HeapNumber; we need | 3611 // The {rhs} is a String and the {lhs} is a HeapNumber; we need |
| 3647 // to convert the {rhs} to a Number and compare the output to | 3612 // to convert the {rhs} to a Number and compare the output to |
| 3648 // the Number on the {lhs}. | 3613 // the Number on the {lhs}. |
| 3649 assembler->Goto(&do_rhsstringtonumber); | 3614 assembler->Goto(&do_rhsstringtonumber); |
| 3650 } | 3615 } |
| 3651 | 3616 |
| 3652 assembler->Bind(&if_rhsisnotstring); | 3617 assembler->Bind(&if_rhsisnotstring); |
| 3653 { | 3618 { |
| 3654 // Check if the {rhs} is a JSReceiver. | 3619 // Check if the {rhs} is a JSReceiver. |
| 3655 Label if_rhsisreceiver(assembler), | 3620 Label if_rhsisreceiver(assembler), |
| 3656 if_rhsisnotreceiver(assembler); | 3621 if_rhsisnotreceiver(assembler); |
| 3657 STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE); | 3622 STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE); |
| 3658 assembler->Branch( | 3623 assembler->Branch( |
| 3659 assembler->Int32LessThanOrEqual( | 3624 assembler->IsJSReceiverInstanceType(rhs_instance_type), |
| 3660 assembler->Int32Constant(FIRST_JS_RECEIVER_TYPE), | |
| 3661 rhs_instance_type), | |
| 3662 &if_rhsisreceiver, &if_rhsisnotreceiver); | 3625 &if_rhsisreceiver, &if_rhsisnotreceiver); |
| 3663 | 3626 |
| 3664 assembler->Bind(&if_rhsisreceiver); | 3627 assembler->Bind(&if_rhsisreceiver); |
| 3665 { | 3628 { |
| 3666 // The {lhs} is a Primitive and the {rhs} is a JSReceiver. | 3629 // The {lhs} is a Primitive and the {rhs} is a JSReceiver. |
| 3667 // Swapping {lhs} and {rhs} is not observable and doesn't | 3630 // Swapping {lhs} and {rhs} is not observable and doesn't |
| 3668 // matter for the result, so we can just swap them and use | 3631 // matter for the result, so we can just swap them and use |
| 3669 // the JSReceiver handling below (for {lhs} being a | 3632 // the JSReceiver handling below (for {lhs} being a |
| 3670 // JSReceiver). | 3633 // JSReceiver). |
| 3671 var_lhs.Bind(rhs); | 3634 var_lhs.Bind(rhs); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3739 assembler->Int32Constant(0), &if_notequal, &if_equal); | 3702 assembler->Int32Constant(0), &if_notequal, &if_equal); |
| 3740 } | 3703 } |
| 3741 } | 3704 } |
| 3742 | 3705 |
| 3743 assembler->Bind(&if_lhsissymbol); | 3706 assembler->Bind(&if_lhsissymbol); |
| 3744 { | 3707 { |
| 3745 // Check if the {rhs} is a JSReceiver. | 3708 // Check if the {rhs} is a JSReceiver. |
| 3746 Label if_rhsisreceiver(assembler), if_rhsisnotreceiver(assembler); | 3709 Label if_rhsisreceiver(assembler), if_rhsisnotreceiver(assembler); |
| 3747 STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE); | 3710 STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE); |
| 3748 assembler->Branch( | 3711 assembler->Branch( |
| 3749 assembler->Int32LessThanOrEqual( | 3712 assembler->IsJSReceiverInstanceType(rhs_instance_type), |
| 3750 assembler->Int32Constant(FIRST_JS_RECEIVER_TYPE), | |
| 3751 rhs_instance_type), | |
| 3752 &if_rhsisreceiver, &if_rhsisnotreceiver); | 3713 &if_rhsisreceiver, &if_rhsisnotreceiver); |
| 3753 | 3714 |
| 3754 assembler->Bind(&if_rhsisreceiver); | 3715 assembler->Bind(&if_rhsisreceiver); |
| 3755 { | 3716 { |
| 3756 // The {lhs} is a Primitive and the {rhs} is a JSReceiver. | 3717 // The {lhs} is a Primitive and the {rhs} is a JSReceiver. |
| 3757 // Swapping {lhs} and {rhs} is not observable and doesn't | 3718 // Swapping {lhs} and {rhs} is not observable and doesn't |
| 3758 // matter for the result, so we can just swap them and use | 3719 // matter for the result, so we can just swap them and use |
| 3759 // the JSReceiver handling below (for {lhs} being a JSReceiver). | 3720 // the JSReceiver handling below (for {lhs} being a JSReceiver). |
| 3760 var_lhs.Bind(rhs); | 3721 var_lhs.Bind(rhs); |
| 3761 var_rhs.Bind(lhs); | 3722 var_rhs.Bind(lhs); |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 3786 rhs, rhs_map, &if_equal, | 3747 rhs, rhs_map, &if_equal, |
| 3787 &if_notequal); | 3748 &if_notequal); |
| 3788 } | 3749 } |
| 3789 | 3750 |
| 3790 assembler->Bind(&if_rhsisnotsimd128value); | 3751 assembler->Bind(&if_rhsisnotsimd128value); |
| 3791 { | 3752 { |
| 3792 // Check if the {rhs} is a JSReceiver. | 3753 // Check if the {rhs} is a JSReceiver. |
| 3793 Label if_rhsisreceiver(assembler), if_rhsisnotreceiver(assembler); | 3754 Label if_rhsisreceiver(assembler), if_rhsisnotreceiver(assembler); |
| 3794 STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE); | 3755 STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE); |
| 3795 assembler->Branch( | 3756 assembler->Branch( |
| 3796 assembler->Int32LessThanOrEqual( | 3757 assembler->IsJSReceiverInstanceType(rhs_instance_type), |
| 3797 assembler->Int32Constant(FIRST_JS_RECEIVER_TYPE), | |
| 3798 rhs_instance_type), | |
| 3799 &if_rhsisreceiver, &if_rhsisnotreceiver); | 3758 &if_rhsisreceiver, &if_rhsisnotreceiver); |
| 3800 | 3759 |
| 3801 assembler->Bind(&if_rhsisreceiver); | 3760 assembler->Bind(&if_rhsisreceiver); |
| 3802 { | 3761 { |
| 3803 // The {lhs} is a Primitive and the {rhs} is a JSReceiver. | 3762 // The {lhs} is a Primitive and the {rhs} is a JSReceiver. |
| 3804 // Swapping {lhs} and {rhs} is not observable and doesn't | 3763 // Swapping {lhs} and {rhs} is not observable and doesn't |
| 3805 // matter for the result, so we can just swap them and use | 3764 // matter for the result, so we can just swap them and use |
| 3806 // the JSReceiver handling below (for {lhs} being a JSReceiver). | 3765 // the JSReceiver handling below (for {lhs} being a JSReceiver). |
| 3807 var_lhs.Bind(rhs); | 3766 var_lhs.Bind(rhs); |
| 3808 var_rhs.Bind(lhs); | 3767 var_rhs.Bind(lhs); |
| 3809 assembler->Goto(&loop); | 3768 assembler->Goto(&loop); |
| 3810 } | 3769 } |
| 3811 | 3770 |
| 3812 assembler->Bind(&if_rhsisnotreceiver); | 3771 assembler->Bind(&if_rhsisnotreceiver); |
| 3813 { | 3772 { |
| 3814 // The {rhs} is some other Primitive. | 3773 // The {rhs} is some other Primitive. |
| 3815 assembler->Goto(&if_notequal); | 3774 assembler->Goto(&if_notequal); |
| 3816 } | 3775 } |
| 3817 } | 3776 } |
| 3818 } | 3777 } |
| 3819 | 3778 |
| 3820 assembler->Bind(&if_lhsisreceiver); | 3779 assembler->Bind(&if_lhsisreceiver); |
| 3821 { | 3780 { |
| 3822 // Check if the {rhs} is also a JSReceiver. | 3781 // Check if the {rhs} is also a JSReceiver. |
| 3823 Label if_rhsisreceiver(assembler), if_rhsisnotreceiver(assembler); | 3782 Label if_rhsisreceiver(assembler), if_rhsisnotreceiver(assembler); |
| 3824 STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE); | 3783 STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE); |
| 3825 assembler->Branch( | 3784 assembler->Branch( |
| 3826 assembler->Int32LessThanOrEqual( | 3785 assembler->IsJSReceiverInstanceType(rhs_instance_type), |
| 3827 assembler->Int32Constant(FIRST_JS_RECEIVER_TYPE), | |
| 3828 rhs_instance_type), | |
| 3829 &if_rhsisreceiver, &if_rhsisnotreceiver); | 3786 &if_rhsisreceiver, &if_rhsisnotreceiver); |
| 3830 | 3787 |
| 3831 assembler->Bind(&if_rhsisreceiver); | 3788 assembler->Bind(&if_rhsisreceiver); |
| 3832 { | 3789 { |
| 3833 // Both {lhs} and {rhs} are different JSReceiver references, so | 3790 // Both {lhs} and {rhs} are different JSReceiver references, so |
| 3834 // this cannot be considered equal. | 3791 // this cannot be considered equal. |
| 3835 assembler->Goto(&if_notequal); | 3792 assembler->Goto(&if_notequal); |
| 3836 } | 3793 } |
| 3837 | 3794 |
| 3838 assembler->Bind(&if_rhsisnotreceiver); | 3795 assembler->Bind(&if_rhsisnotreceiver); |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4054 assembler->Bind(&if_rhsissmi); | 4011 assembler->Bind(&if_rhsissmi); |
| 4055 assembler->Goto(&if_notequal); | 4012 assembler->Goto(&if_notequal); |
| 4056 | 4013 |
| 4057 assembler->Bind(&if_rhsisnotsmi); | 4014 assembler->Bind(&if_rhsisnotsmi); |
| 4058 { | 4015 { |
| 4059 // Load the instance type of {lhs}. | 4016 // Load the instance type of {lhs}. |
| 4060 Node* lhs_instance_type = assembler->LoadMapInstanceType(lhs_map); | 4017 Node* lhs_instance_type = assembler->LoadMapInstanceType(lhs_map); |
| 4061 | 4018 |
| 4062 // Check if {lhs} is a String. | 4019 // Check if {lhs} is a String. |
| 4063 Label if_lhsisstring(assembler), if_lhsisnotstring(assembler); | 4020 Label if_lhsisstring(assembler), if_lhsisnotstring(assembler); |
| 4064 assembler->Branch(assembler->Int32LessThan( | 4021 assembler->Branch(assembler->IsStringInstanceType(lhs_instance_type), |
| 4065 lhs_instance_type, | |
| 4066 assembler->Int32Constant(FIRST_NONSTRING_TYPE)), | |
| 4067 &if_lhsisstring, &if_lhsisnotstring); | 4022 &if_lhsisstring, &if_lhsisnotstring); |
| 4068 | 4023 |
| 4069 assembler->Bind(&if_lhsisstring); | 4024 assembler->Bind(&if_lhsisstring); |
| 4070 { | 4025 { |
| 4071 // Load the instance type of {rhs}. | 4026 // Load the instance type of {rhs}. |
| 4072 Node* rhs_instance_type = assembler->LoadInstanceType(rhs); | 4027 Node* rhs_instance_type = assembler->LoadInstanceType(rhs); |
| 4073 | 4028 |
| 4074 // Check if {rhs} is also a String. | 4029 // Check if {rhs} is also a String. |
| 4075 Label if_rhsisstring(assembler, Label::kDeferred), | 4030 Label if_rhsisstring(assembler, Label::kDeferred), |
| 4076 if_rhsisnotstring(assembler); | 4031 if_rhsisnotstring(assembler); |
| 4077 assembler->Branch(assembler->Int32LessThan( | 4032 assembler->Branch( |
| 4078 rhs_instance_type, assembler->Int32Constant( | 4033 assembler->IsStringInstanceType(rhs_instance_type), |
| 4079 FIRST_NONSTRING_TYPE)), | 4034 &if_rhsisstring, &if_rhsisnotstring); |
| 4080 &if_rhsisstring, &if_rhsisnotstring); | |
| 4081 | 4035 |
| 4082 assembler->Bind(&if_rhsisstring); | 4036 assembler->Bind(&if_rhsisstring); |
| 4083 { | 4037 { |
| 4084 Callable callable = | 4038 Callable callable = |
| 4085 (mode == kDontNegateResult) | 4039 (mode == kDontNegateResult) |
| 4086 ? CodeFactory::StringEqual(assembler->isolate()) | 4040 ? CodeFactory::StringEqual(assembler->isolate()) |
| 4087 : CodeFactory::StringNotEqual(assembler->isolate()); | 4041 : CodeFactory::StringNotEqual(assembler->isolate()); |
| 4088 result.Bind(assembler->CallStub(callable, context, lhs, rhs)); | 4042 result.Bind(assembler->CallStub(callable, context, lhs, rhs)); |
| 4089 assembler->Goto(&end); | 4043 assembler->Goto(&end); |
| 4090 } | 4044 } |
| (...skipping 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5872 | 5826 |
| 5873 if (type == MachineType::Pointer()) { | 5827 if (type == MachineType::Pointer()) { |
| 5874 return Representation::External(); | 5828 return Representation::External(); |
| 5875 } | 5829 } |
| 5876 | 5830 |
| 5877 return Representation::Tagged(); | 5831 return Representation::Tagged(); |
| 5878 } | 5832 } |
| 5879 | 5833 |
| 5880 } // namespace internal | 5834 } // namespace internal |
| 5881 } // namespace v8 | 5835 } // namespace v8 |
| OLD | NEW |