| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 __ bind(&fast_double_without_map_check); | 853 __ bind(&fast_double_without_map_check); |
| 854 // If the value is a number, store it as a double in the FastDoubleElements | 854 // If the value is a number, store it as a double in the FastDoubleElements |
| 855 // array. | 855 // array. |
| 856 __ StoreNumberToDoubleElements(eax, ebx, ecx, edx, xmm0, &slow, false); | 856 __ StoreNumberToDoubleElements(eax, ebx, ecx, edx, xmm0, &slow, false); |
| 857 __ ret(0); | 857 __ ret(0); |
| 858 } | 858 } |
| 859 | 859 |
| 860 | 860 |
| 861 // The generated code does not accept smi keys. | 861 // The generated code does not accept smi keys. |
| 862 // The generated code falls through if both probes miss. | 862 // The generated code falls through if both probes miss. |
| 863 static void GenerateMonomorphicCacheProbe(MacroAssembler* masm, | 863 void CallICBase::GenerateMonomorphicCacheProbe(MacroAssembler* masm, |
| 864 int argc, | 864 int argc, |
| 865 Code::Kind kind, | 865 Code::Kind kind, |
| 866 Code::ExtraICState extra_ic_state) { | 866 Code::ExtraICState extra_state) { |
| 867 // ----------- S t a t e ------------- | 867 // ----------- S t a t e ------------- |
| 868 // -- ecx : name | 868 // -- ecx : name |
| 869 // -- edx : receiver | 869 // -- edx : receiver |
| 870 // ----------------------------------- | 870 // ----------------------------------- |
| 871 Label number, non_number, non_string, boolean, probe, miss; | 871 Label number, non_number, non_string, boolean, probe, miss; |
| 872 | 872 |
| 873 // Probe the stub cache. | 873 // Probe the stub cache. |
| 874 Code::Flags flags = Code::ComputeFlags(kind, | 874 Code::Flags flags = Code::ComputeFlags(kind, |
| 875 MONOMORPHIC, | 875 MONOMORPHIC, |
| 876 extra_ic_state, | 876 extra_state, |
| 877 NORMAL, | 877 NORMAL, |
| 878 argc); | 878 argc); |
| 879 Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, edx, ecx, ebx, | 879 Isolate* isolate = masm->isolate(); |
| 880 eax); | 880 isolate->stub_cache()->GenerateProbe(masm, flags, edx, ecx, ebx, eax); |
| 881 | 881 |
| 882 // If the stub cache probing failed, the receiver might be a value. | 882 // If the stub cache probing failed, the receiver might be a value. |
| 883 // For value objects, we use the map of the prototype objects for | 883 // For value objects, we use the map of the prototype objects for |
| 884 // the corresponding JSValue for the cache and that is what we need | 884 // the corresponding JSValue for the cache and that is what we need |
| 885 // to probe. | 885 // to probe. |
| 886 // | 886 // |
| 887 // Check for number. | 887 // Check for number. |
| 888 __ JumpIfSmi(edx, &number); | 888 __ JumpIfSmi(edx, &number); |
| 889 __ CmpObjectType(edx, HEAP_NUMBER_TYPE, ebx); | 889 __ CmpObjectType(edx, HEAP_NUMBER_TYPE, ebx); |
| 890 __ j(not_equal, &non_number); | 890 __ j(not_equal, &non_number); |
| 891 __ bind(&number); | 891 __ bind(&number); |
| 892 StubCompiler::GenerateLoadGlobalFunctionPrototype( | 892 StubCompiler::GenerateLoadGlobalFunctionPrototype( |
| 893 masm, Context::NUMBER_FUNCTION_INDEX, edx); | 893 masm, Context::NUMBER_FUNCTION_INDEX, edx); |
| 894 __ jmp(&probe); | 894 __ jmp(&probe); |
| 895 | 895 |
| 896 // Check for string. | 896 // Check for string. |
| 897 __ bind(&non_number); | 897 __ bind(&non_number); |
| 898 __ CmpInstanceType(ebx, FIRST_NONSTRING_TYPE); | 898 __ CmpInstanceType(ebx, FIRST_NONSTRING_TYPE); |
| 899 __ j(above_equal, &non_string); | 899 __ j(above_equal, &non_string); |
| 900 StubCompiler::GenerateLoadGlobalFunctionPrototype( | 900 StubCompiler::GenerateLoadGlobalFunctionPrototype( |
| 901 masm, Context::STRING_FUNCTION_INDEX, edx); | 901 masm, Context::STRING_FUNCTION_INDEX, edx); |
| 902 __ jmp(&probe); | 902 __ jmp(&probe); |
| 903 | 903 |
| 904 // Check for boolean. | 904 // Check for boolean. |
| 905 __ bind(&non_string); | 905 __ bind(&non_string); |
| 906 __ cmp(edx, FACTORY->true_value()); | 906 __ cmp(edx, isolate->factory()->true_value()); |
| 907 __ j(equal, &boolean); | 907 __ j(equal, &boolean); |
| 908 __ cmp(edx, FACTORY->false_value()); | 908 __ cmp(edx, isolate->factory()->false_value()); |
| 909 __ j(not_equal, &miss); | 909 __ j(not_equal, &miss); |
| 910 __ bind(&boolean); | 910 __ bind(&boolean); |
| 911 StubCompiler::GenerateLoadGlobalFunctionPrototype( | 911 StubCompiler::GenerateLoadGlobalFunctionPrototype( |
| 912 masm, Context::BOOLEAN_FUNCTION_INDEX, edx); | 912 masm, Context::BOOLEAN_FUNCTION_INDEX, edx); |
| 913 | 913 |
| 914 // Probe the stub cache for the value object. | 914 // Probe the stub cache for the value object. |
| 915 __ bind(&probe); | 915 __ bind(&probe); |
| 916 Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, edx, ecx, ebx, | 916 isolate->stub_cache()->GenerateProbe(masm, flags, edx, ecx, ebx, no_reg); |
| 917 no_reg); | |
| 918 __ bind(&miss); | 917 __ bind(&miss); |
| 919 } | 918 } |
| 920 | 919 |
| 921 | 920 |
| 922 static void GenerateFunctionTailCall(MacroAssembler* masm, | 921 static void GenerateFunctionTailCall(MacroAssembler* masm, |
| 923 int argc, | 922 int argc, |
| 924 Label* miss) { | 923 Label* miss) { |
| 925 // ----------- S t a t e ------------- | 924 // ----------- S t a t e ------------- |
| 926 // -- ecx : name | 925 // -- ecx : name |
| 927 // -- edi : function | 926 // -- edi : function |
| 928 // -- esp[0] : return address | 927 // -- esp[0] : return address |
| 929 // -- esp[(argc - n) * 4] : arg[n] (zero-based) | 928 // -- esp[(argc - n) * 4] : arg[n] (zero-based) |
| 930 // -- ... | 929 // -- ... |
| 931 // -- esp[(argc + 1) * 4] : receiver | 930 // -- esp[(argc + 1) * 4] : receiver |
| 932 // ----------------------------------- | 931 // ----------------------------------- |
| 933 | 932 |
| 934 // Check that the result is not a smi. | 933 // Check that the result is not a smi. |
| 935 __ JumpIfSmi(edi, miss); | 934 __ JumpIfSmi(edi, miss); |
| 936 | 935 |
| 937 // Check that the value is a JavaScript function, fetching its map into eax. | 936 // Check that the value is a JavaScript function, fetching its map into eax. |
| 938 __ CmpObjectType(edi, JS_FUNCTION_TYPE, eax); | 937 __ CmpObjectType(edi, JS_FUNCTION_TYPE, eax); |
| 939 __ j(not_equal, miss); | 938 __ j(not_equal, miss); |
| 940 | 939 |
| 941 // Invoke the function. | 940 // Invoke the function. |
| 942 ParameterCount actual(argc); | 941 ParameterCount actual(argc); |
| 943 __ InvokeFunction(edi, actual, JUMP_FUNCTION, | 942 __ InvokeFunction(edi, actual, JUMP_FUNCTION, |
| 944 NullCallWrapper(), CALL_AS_METHOD); | 943 NullCallWrapper(), CALL_AS_METHOD); |
| 945 } | 944 } |
| 946 | 945 |
| 946 |
| 947 // The generated code falls through if the call should be handled by runtime. | 947 // The generated code falls through if the call should be handled by runtime. |
| 948 static void GenerateCallNormal(MacroAssembler* masm, int argc) { | 948 void CallICBase::GenerateNormal(MacroAssembler* masm, int argc) { |
| 949 // ----------- S t a t e ------------- | 949 // ----------- S t a t e ------------- |
| 950 // -- ecx : name | 950 // -- ecx : name |
| 951 // -- esp[0] : return address | 951 // -- esp[0] : return address |
| 952 // -- esp[(argc - n) * 4] : arg[n] (zero-based) | 952 // -- esp[(argc - n) * 4] : arg[n] (zero-based) |
| 953 // -- ... | 953 // -- ... |
| 954 // -- esp[(argc + 1) * 4] : receiver | 954 // -- esp[(argc + 1) * 4] : receiver |
| 955 // ----------------------------------- | 955 // ----------------------------------- |
| 956 Label miss; | 956 Label miss; |
| 957 | 957 |
| 958 // Get the receiver of the function from the stack; 1 ~ return address. | 958 // Get the receiver of the function from the stack; 1 ~ return address. |
| 959 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); | 959 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); |
| 960 | 960 |
| 961 GenerateStringDictionaryReceiverCheck(masm, edx, eax, ebx, &miss); | 961 GenerateStringDictionaryReceiverCheck(masm, edx, eax, ebx, &miss); |
| 962 | 962 |
| 963 // eax: elements | 963 // eax: elements |
| 964 // Search the dictionary placing the result in edi. | 964 // Search the dictionary placing the result in edi. |
| 965 GenerateDictionaryLoad(masm, &miss, eax, ecx, edi, ebx, edi); | 965 GenerateDictionaryLoad(masm, &miss, eax, ecx, edi, ebx, edi); |
| 966 GenerateFunctionTailCall(masm, argc, &miss); | 966 GenerateFunctionTailCall(masm, argc, &miss); |
| 967 | 967 |
| 968 __ bind(&miss); | 968 __ bind(&miss); |
| 969 } | 969 } |
| 970 | 970 |
| 971 | 971 |
| 972 static void GenerateCallMiss(MacroAssembler* masm, | 972 void CallICBase::GenerateMiss(MacroAssembler* masm, |
| 973 int argc, | 973 int argc, |
| 974 IC::UtilityId id, | 974 IC::UtilityId id, |
| 975 Code::ExtraICState extra_ic_state) { | 975 Code::ExtraICState extra_state) { |
| 976 // ----------- S t a t e ------------- | 976 // ----------- S t a t e ------------- |
| 977 // -- ecx : name | 977 // -- ecx : name |
| 978 // -- esp[0] : return address | 978 // -- esp[0] : return address |
| 979 // -- esp[(argc - n) * 4] : arg[n] (zero-based) | 979 // -- esp[(argc - n) * 4] : arg[n] (zero-based) |
| 980 // -- ... | 980 // -- ... |
| 981 // -- esp[(argc + 1) * 4] : receiver | 981 // -- esp[(argc + 1) * 4] : receiver |
| 982 // ----------------------------------- | 982 // ----------------------------------- |
| 983 | 983 |
| 984 Counters* counters = masm->isolate()->counters(); | 984 Counters* counters = masm->isolate()->counters(); |
| 985 if (id == IC::kCallIC_Miss) { | 985 if (id == IC::kCallIC_Miss) { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1022 __ j(not_equal, &invoke, Label::kNear); | 1022 __ j(not_equal, &invoke, Label::kNear); |
| 1023 | 1023 |
| 1024 // Patch the receiver on the stack. | 1024 // Patch the receiver on the stack. |
| 1025 __ bind(&global); | 1025 __ bind(&global); |
| 1026 __ mov(edx, FieldOperand(edx, GlobalObject::kGlobalReceiverOffset)); | 1026 __ mov(edx, FieldOperand(edx, GlobalObject::kGlobalReceiverOffset)); |
| 1027 __ mov(Operand(esp, (argc + 1) * kPointerSize), edx); | 1027 __ mov(Operand(esp, (argc + 1) * kPointerSize), edx); |
| 1028 __ bind(&invoke); | 1028 __ bind(&invoke); |
| 1029 } | 1029 } |
| 1030 | 1030 |
| 1031 // Invoke the function. | 1031 // Invoke the function. |
| 1032 CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state) | 1032 CallKind call_kind = CallICBase::Contextual::decode(extra_state) |
| 1033 ? CALL_AS_FUNCTION | 1033 ? CALL_AS_FUNCTION |
| 1034 : CALL_AS_METHOD; | 1034 : CALL_AS_METHOD; |
| 1035 ParameterCount actual(argc); | 1035 ParameterCount actual(argc); |
| 1036 __ InvokeFunction(edi, | 1036 __ InvokeFunction(edi, |
| 1037 actual, | 1037 actual, |
| 1038 JUMP_FUNCTION, | 1038 JUMP_FUNCTION, |
| 1039 NullCallWrapper(), | 1039 NullCallWrapper(), |
| 1040 call_kind); | 1040 call_kind); |
| 1041 } | 1041 } |
| 1042 | 1042 |
| 1043 | 1043 |
| 1044 void CallIC::GenerateMegamorphic(MacroAssembler* masm, | 1044 void CallIC::GenerateMegamorphic(MacroAssembler* masm, |
| 1045 int argc, | 1045 int argc, |
| 1046 Code::ExtraICState extra_ic_state) { | 1046 Code::ExtraICState extra_state) { |
| 1047 // ----------- S t a t e ------------- | 1047 // ----------- S t a t e ------------- |
| 1048 // -- ecx : name | 1048 // -- ecx : name |
| 1049 // -- esp[0] : return address | 1049 // -- esp[0] : return address |
| 1050 // -- esp[(argc - n) * 4] : arg[n] (zero-based) | 1050 // -- esp[(argc - n) * 4] : arg[n] (zero-based) |
| 1051 // -- ... | 1051 // -- ... |
| 1052 // -- esp[(argc + 1) * 4] : receiver | 1052 // -- esp[(argc + 1) * 4] : receiver |
| 1053 // ----------------------------------- | 1053 // ----------------------------------- |
| 1054 | 1054 |
| 1055 // Get the receiver of the function from the stack; 1 ~ return address. | 1055 // Get the receiver of the function from the stack; 1 ~ return address. |
| 1056 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); | 1056 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); |
| 1057 GenerateMonomorphicCacheProbe(masm, argc, Code::CALL_IC, extra_ic_state); | 1057 CallICBase::GenerateMonomorphicCacheProbe(masm, argc, Code::CALL_IC, |
| 1058 extra_state); |
| 1058 | 1059 |
| 1059 GenerateMiss(masm, argc, extra_ic_state); | 1060 GenerateMiss(masm, argc, extra_state); |
| 1060 } | |
| 1061 | |
| 1062 | |
| 1063 void CallIC::GenerateNormal(MacroAssembler* masm, int argc) { | |
| 1064 // ----------- S t a t e ------------- | |
| 1065 // -- ecx : name | |
| 1066 // -- esp[0] : return address | |
| 1067 // -- esp[(argc - n) * 4] : arg[n] (zero-based) | |
| 1068 // -- ... | |
| 1069 // -- esp[(argc + 1) * 4] : receiver | |
| 1070 // ----------------------------------- | |
| 1071 | |
| 1072 GenerateCallNormal(masm, argc); | |
| 1073 GenerateMiss(masm, argc, Code::kNoExtraICState); | |
| 1074 } | |
| 1075 | |
| 1076 | |
| 1077 void CallIC::GenerateMiss(MacroAssembler* masm, | |
| 1078 int argc, | |
| 1079 Code::ExtraICState extra_ic_state) { | |
| 1080 // ----------- S t a t e ------------- | |
| 1081 // -- ecx : name | |
| 1082 // -- esp[0] : return address | |
| 1083 // -- esp[(argc - n) * 4] : arg[n] (zero-based) | |
| 1084 // -- ... | |
| 1085 // -- esp[(argc + 1) * 4] : receiver | |
| 1086 // ----------------------------------- | |
| 1087 | |
| 1088 GenerateCallMiss(masm, argc, IC::kCallIC_Miss, extra_ic_state); | |
| 1089 } | 1061 } |
| 1090 | 1062 |
| 1091 | 1063 |
| 1092 void KeyedCallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) { | 1064 void KeyedCallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) { |
| 1093 // ----------- S t a t e ------------- | 1065 // ----------- S t a t e ------------- |
| 1094 // -- ecx : name | 1066 // -- ecx : name |
| 1095 // -- esp[0] : return address | 1067 // -- esp[0] : return address |
| 1096 // -- esp[(argc - n) * 4] : arg[n] (zero-based) | 1068 // -- esp[(argc - n) * 4] : arg[n] (zero-based) |
| 1097 // -- ... | 1069 // -- ... |
| 1098 // -- esp[(argc + 1) * 4] : receiver | 1070 // -- esp[(argc + 1) * 4] : receiver |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1180 isolate->factory()->hash_table_map(), | 1152 isolate->factory()->hash_table_map(), |
| 1181 &lookup_monomorphic_cache, | 1153 &lookup_monomorphic_cache, |
| 1182 DONT_DO_SMI_CHECK); | 1154 DONT_DO_SMI_CHECK); |
| 1183 | 1155 |
| 1184 GenerateDictionaryLoad(masm, &slow_load, ebx, ecx, eax, edi, edi); | 1156 GenerateDictionaryLoad(masm, &slow_load, ebx, ecx, eax, edi, edi); |
| 1185 __ IncrementCounter(counters->keyed_call_generic_lookup_dict(), 1); | 1157 __ IncrementCounter(counters->keyed_call_generic_lookup_dict(), 1); |
| 1186 __ jmp(&do_call); | 1158 __ jmp(&do_call); |
| 1187 | 1159 |
| 1188 __ bind(&lookup_monomorphic_cache); | 1160 __ bind(&lookup_monomorphic_cache); |
| 1189 __ IncrementCounter(counters->keyed_call_generic_lookup_cache(), 1); | 1161 __ IncrementCounter(counters->keyed_call_generic_lookup_cache(), 1); |
| 1190 GenerateMonomorphicCacheProbe(masm, | 1162 CallICBase::GenerateMonomorphicCacheProbe(masm, argc, Code::KEYED_CALL_IC, |
| 1191 argc, | 1163 Code::kNoExtraICState); |
| 1192 Code::KEYED_CALL_IC, | |
| 1193 Code::kNoExtraICState); | |
| 1194 // Fall through on miss. | 1164 // Fall through on miss. |
| 1195 | 1165 |
| 1196 __ bind(&slow_call); | 1166 __ bind(&slow_call); |
| 1197 // This branch is taken if: | 1167 // This branch is taken if: |
| 1198 // - the receiver requires boxing or access check, | 1168 // - the receiver requires boxing or access check, |
| 1199 // - the key is neither smi nor symbol, | 1169 // - the key is neither smi nor symbol, |
| 1200 // - the value loaded is not a function, | 1170 // - the value loaded is not a function, |
| 1201 // - there is hope that the runtime will create a monomorphic call stub | 1171 // - there is hope that the runtime will create a monomorphic call stub |
| 1202 // that will get fetched next time. | 1172 // that will get fetched next time. |
| 1203 __ IncrementCounter(counters->keyed_call_generic_slow(), 1); | 1173 __ IncrementCounter(counters->keyed_call_generic_slow(), 1); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1246 // -- esp[(argc - n) * 4] : arg[n] (zero-based) | 1216 // -- esp[(argc - n) * 4] : arg[n] (zero-based) |
| 1247 // -- ... | 1217 // -- ... |
| 1248 // -- esp[(argc + 1) * 4] : receiver | 1218 // -- esp[(argc + 1) * 4] : receiver |
| 1249 // ----------------------------------- | 1219 // ----------------------------------- |
| 1250 | 1220 |
| 1251 // Check if the name is a string. | 1221 // Check if the name is a string. |
| 1252 Label miss; | 1222 Label miss; |
| 1253 __ JumpIfSmi(ecx, &miss); | 1223 __ JumpIfSmi(ecx, &miss); |
| 1254 Condition cond = masm->IsObjectStringType(ecx, eax, eax); | 1224 Condition cond = masm->IsObjectStringType(ecx, eax, eax); |
| 1255 __ j(NegateCondition(cond), &miss); | 1225 __ j(NegateCondition(cond), &miss); |
| 1256 GenerateCallNormal(masm, argc); | 1226 CallICBase::GenerateNormal(masm, argc); |
| 1257 __ bind(&miss); | 1227 __ bind(&miss); |
| 1258 GenerateMiss(masm, argc); | 1228 GenerateMiss(masm, argc); |
| 1259 } | 1229 } |
| 1260 | 1230 |
| 1261 | 1231 |
| 1262 void KeyedCallIC::GenerateMiss(MacroAssembler* masm, int argc) { | |
| 1263 // ----------- S t a t e ------------- | |
| 1264 // -- ecx : name | |
| 1265 // -- esp[0] : return address | |
| 1266 // -- esp[(argc - n) * 4] : arg[n] (zero-based) | |
| 1267 // -- ... | |
| 1268 // -- esp[(argc + 1) * 4] : receiver | |
| 1269 // ----------------------------------- | |
| 1270 | |
| 1271 GenerateCallMiss(masm, argc, IC::kKeyedCallIC_Miss, Code::kNoExtraICState); | |
| 1272 } | |
| 1273 | |
| 1274 | |
| 1275 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { | 1232 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { |
| 1276 // ----------- S t a t e ------------- | 1233 // ----------- S t a t e ------------- |
| 1277 // -- eax : receiver | 1234 // -- eax : receiver |
| 1278 // -- ecx : name | 1235 // -- ecx : name |
| 1279 // -- esp[0] : return address | 1236 // -- esp[0] : return address |
| 1280 // ----------------------------------- | 1237 // ----------------------------------- |
| 1281 | 1238 |
| 1282 // Probe the stub cache. | 1239 // Probe the stub cache. |
| 1283 Code::Flags flags = Code::ComputeFlags(Code::LOAD_IC, MONOMORPHIC); | 1240 Code::Flags flags = Code::ComputeFlags(Code::LOAD_IC, MONOMORPHIC); |
| 1284 Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, eax, ecx, ebx, | 1241 Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, eax, ecx, ebx, |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1573 __ push(ecx); | 1530 __ push(ecx); |
| 1574 __ push(eax); | 1531 __ push(eax); |
| 1575 __ push(ebx); // return address | 1532 __ push(ebx); // return address |
| 1576 | 1533 |
| 1577 // Do tail-call to runtime routine. | 1534 // Do tail-call to runtime routine. |
| 1578 ExternalReference ref(IC_Utility(kKeyedStoreIC_Slow), masm->isolate()); | 1535 ExternalReference ref(IC_Utility(kKeyedStoreIC_Slow), masm->isolate()); |
| 1579 __ TailCallExternalReference(ref, 3, 1); | 1536 __ TailCallExternalReference(ref, 3, 1); |
| 1580 } | 1537 } |
| 1581 | 1538 |
| 1582 | 1539 |
| 1540 void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) { |
| 1541 // ----------- S t a t e ------------- |
| 1542 // -- ebx : target map |
| 1543 // -- edx : receiver |
| 1544 // -- esp[0] : return address |
| 1545 // ----------------------------------- |
| 1546 // Must return the modified receiver in eax. |
| 1547 if (!FLAG_trace_elements_transitions) { |
| 1548 Label fail; |
| 1549 ElementsTransitionGenerator::GenerateSmiOnlyToDouble(masm, &fail); |
| 1550 __ mov(eax, edx); |
| 1551 __ Ret(); |
| 1552 __ bind(&fail); |
| 1553 } |
| 1554 |
| 1555 __ pop(ebx); |
| 1556 __ push(edx); |
| 1557 __ push(ebx); // return address |
| 1558 __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1); |
| 1559 } |
| 1560 |
| 1561 |
| 1562 void KeyedStoreIC::GenerateTransitionElementsDoubleToObject( |
| 1563 MacroAssembler* masm) { |
| 1564 // ----------- S t a t e ------------- |
| 1565 // -- ebx : target map |
| 1566 // -- edx : receiver |
| 1567 // -- esp[0] : return address |
| 1568 // ----------------------------------- |
| 1569 // Must return the modified receiver in eax. |
| 1570 if (!FLAG_trace_elements_transitions) { |
| 1571 Label fail; |
| 1572 ElementsTransitionGenerator::GenerateDoubleToObject(masm, &fail); |
| 1573 __ mov(eax, edx); |
| 1574 __ Ret(); |
| 1575 __ bind(&fail); |
| 1576 } |
| 1577 |
| 1578 __ pop(ebx); |
| 1579 __ push(edx); |
| 1580 __ push(ebx); // return address |
| 1581 __ TailCallRuntime(Runtime::kTransitionElementsDoubleToObject, 1, 1); |
| 1582 } |
| 1583 |
| 1584 |
| 1583 #undef __ | 1585 #undef __ |
| 1584 | 1586 |
| 1585 | 1587 |
| 1586 Condition CompareIC::ComputeCondition(Token::Value op) { | 1588 Condition CompareIC::ComputeCondition(Token::Value op) { |
| 1587 switch (op) { | 1589 switch (op) { |
| 1588 case Token::EQ_STRICT: | 1590 case Token::EQ_STRICT: |
| 1589 case Token::EQ: | 1591 case Token::EQ: |
| 1590 return equal; | 1592 return equal; |
| 1591 case Token::LT: | 1593 case Token::LT: |
| 1592 return less; | 1594 return less; |
| 1593 case Token::GT: | 1595 case Token::GT: |
| 1594 // Reverse left and right operands to obtain ECMA-262 conversion order. | 1596 return greater; |
| 1595 return less; | |
| 1596 case Token::LTE: | 1597 case Token::LTE: |
| 1597 // Reverse left and right operands to obtain ECMA-262 conversion order. | 1598 return less_equal; |
| 1598 return greater_equal; | |
| 1599 case Token::GTE: | 1599 case Token::GTE: |
| 1600 return greater_equal; | 1600 return greater_equal; |
| 1601 default: | 1601 default: |
| 1602 UNREACHABLE(); | 1602 UNREACHABLE(); |
| 1603 return no_condition; | 1603 return no_condition; |
| 1604 } | 1604 } |
| 1605 } | 1605 } |
| 1606 | 1606 |
| 1607 | 1607 |
| 1608 static bool HasInlinedSmiCode(Address address) { | 1608 static bool HasInlinedSmiCode(Address address) { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1676 Condition cc = *jmp_address == Assembler::kJncShortOpcode | 1676 Condition cc = *jmp_address == Assembler::kJncShortOpcode |
| 1677 ? not_zero | 1677 ? not_zero |
| 1678 : zero; | 1678 : zero; |
| 1679 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1679 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
| 1680 } | 1680 } |
| 1681 | 1681 |
| 1682 | 1682 |
| 1683 } } // namespace v8::internal | 1683 } } // namespace v8::internal |
| 1684 | 1684 |
| 1685 #endif // V8_TARGET_ARCH_IA32 | 1685 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |