| 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 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 __ mov(r3, r0); | 861 __ mov(r3, r0); |
| 862 __ Push(r3, r2); | 862 __ Push(r3, r2); |
| 863 | 863 |
| 864 // Perform tail call to the entry. | 864 // Perform tail call to the entry. |
| 865 ExternalReference ref = | 865 ExternalReference ref = |
| 866 ExternalReference(IC_Utility(kLoadIC_Miss), isolate); | 866 ExternalReference(IC_Utility(kLoadIC_Miss), isolate); |
| 867 __ TailCallExternalReference(ref, 2, 1); | 867 __ TailCallExternalReference(ref, 2, 1); |
| 868 } | 868 } |
| 869 | 869 |
| 870 | 870 |
| 871 Object* KeyedLoadIC_Miss(Arguments args); | 871 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, bool force_generic) { |
| 872 | |
| 873 | |
| 874 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | |
| 875 // ---------- S t a t e -------------- | 872 // ---------- S t a t e -------------- |
| 876 // -- lr : return address | 873 // -- lr : return address |
| 877 // -- r0 : key | 874 // -- r0 : key |
| 878 // -- r1 : receiver | 875 // -- r1 : receiver |
| 879 // ----------------------------------- | 876 // ----------------------------------- |
| 880 Isolate* isolate = masm->isolate(); | 877 Isolate* isolate = masm->isolate(); |
| 881 | 878 |
| 882 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, r3, r4); | 879 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, r3, r4); |
| 883 | 880 |
| 884 __ Push(r1, r0); | 881 __ Push(r1, r0); |
| 885 | 882 |
| 886 ExternalReference ref = | 883 // Perform tail call to the entry. |
| 887 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); | 884 ExternalReference ref = force_generic |
| 885 ? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric), isolate) |
| 886 : ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); |
| 887 |
| 888 __ TailCallExternalReference(ref, 2, 1); | 888 __ TailCallExternalReference(ref, 2, 1); |
| 889 } | 889 } |
| 890 | 890 |
| 891 | 891 |
| 892 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 892 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
| 893 // ---------- S t a t e -------------- | 893 // ---------- S t a t e -------------- |
| 894 // -- lr : return address | 894 // -- lr : return address |
| 895 // -- r0 : key | 895 // -- r0 : key |
| 896 // -- r1 : receiver | 896 // -- r1 : receiver |
| 897 // ----------------------------------- | 897 // ----------------------------------- |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1068 &miss, // When not a number. | 1068 &miss, // When not a number. |
| 1069 &miss, // When index out of range. | 1069 &miss, // When index out of range. |
| 1070 STRING_INDEX_IS_ARRAY_INDEX); | 1070 STRING_INDEX_IS_ARRAY_INDEX); |
| 1071 char_at_generator.GenerateFast(masm); | 1071 char_at_generator.GenerateFast(masm); |
| 1072 __ Ret(); | 1072 __ Ret(); |
| 1073 | 1073 |
| 1074 StubRuntimeCallHelper call_helper; | 1074 StubRuntimeCallHelper call_helper; |
| 1075 char_at_generator.GenerateSlow(masm, call_helper); | 1075 char_at_generator.GenerateSlow(masm, call_helper); |
| 1076 | 1076 |
| 1077 __ bind(&miss); | 1077 __ bind(&miss); |
| 1078 GenerateMiss(masm); | 1078 GenerateMiss(masm, false); |
| 1079 } | 1079 } |
| 1080 | 1080 |
| 1081 | 1081 |
| 1082 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { | 1082 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { |
| 1083 // ---------- S t a t e -------------- | 1083 // ---------- S t a t e -------------- |
| 1084 // -- lr : return address | 1084 // -- lr : return address |
| 1085 // -- r0 : key | 1085 // -- r0 : key |
| 1086 // -- r1 : receiver | 1086 // -- r1 : receiver |
| 1087 // ----------------------------------- | 1087 // ----------------------------------- |
| 1088 Label slow; | 1088 Label slow; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1108 __ Push(r1, r0); // Receiver, key. | 1108 __ Push(r1, r0); // Receiver, key. |
| 1109 | 1109 |
| 1110 // Perform tail call to the entry. | 1110 // Perform tail call to the entry. |
| 1111 __ TailCallExternalReference( | 1111 __ TailCallExternalReference( |
| 1112 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), | 1112 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), |
| 1113 masm->isolate()), | 1113 masm->isolate()), |
| 1114 2, | 1114 2, |
| 1115 1); | 1115 1); |
| 1116 | 1116 |
| 1117 __ bind(&slow); | 1117 __ bind(&slow); |
| 1118 GenerateMiss(masm); | 1118 GenerateMiss(masm, false); |
| 1119 } | 1119 } |
| 1120 | 1120 |
| 1121 | 1121 |
| 1122 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 1122 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm, bool force_generic) { |
| 1123 // ---------- S t a t e -------------- | 1123 // ---------- S t a t e -------------- |
| 1124 // -- r0 : value | 1124 // -- r0 : value |
| 1125 // -- r1 : key | 1125 // -- r1 : key |
| 1126 // -- r2 : receiver |
| 1127 // -- lr : return address |
| 1128 // ----------------------------------- |
| 1129 |
| 1130 // Push receiver, key and value for runtime call. |
| 1131 __ Push(r2, r1, r0); |
| 1132 |
| 1133 ExternalReference ref = force_generic |
| 1134 ? ExternalReference(IC_Utility(kKeyedStoreIC_MissForceGeneric), |
| 1135 masm->isolate()) |
| 1136 : ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); |
| 1137 __ TailCallExternalReference(ref, 3, 1); |
| 1138 } |
| 1139 |
| 1140 |
| 1141 void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) { |
| 1142 // ---------- S t a t e -------------- |
| 1143 // -- r0 : value |
| 1144 // -- r1 : key |
| 1126 // -- r2 : receiver | 1145 // -- r2 : receiver |
| 1127 // -- lr : return address | 1146 // -- lr : return address |
| 1128 // ----------------------------------- | 1147 // ----------------------------------- |
| 1129 | 1148 |
| 1130 // Push receiver, key and value for runtime call. | 1149 // Push receiver, key and value for runtime call. |
| 1131 __ Push(r2, r1, r0); | 1150 __ Push(r2, r1, r0); |
| 1132 | 1151 |
| 1152 // The slow case calls into the runtime to complete the store without causing |
| 1153 // an IC miss that would otherwise cause a transition to the generic stub. |
| 1133 ExternalReference ref = | 1154 ExternalReference ref = |
| 1134 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); | 1155 ExternalReference(IC_Utility(kKeyedStoreIC_Slow), masm->isolate()); |
| 1135 __ TailCallExternalReference(ref, 3, 1); | 1156 __ TailCallExternalReference(ref, 3, 1); |
| 1136 } | 1157 } |
| 1137 | 1158 |
| 1138 | 1159 |
| 1139 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, | 1160 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, |
| 1140 StrictModeFlag strict_mode) { | 1161 StrictModeFlag strict_mode) { |
| 1141 // ---------- S t a t e -------------- | 1162 // ---------- S t a t e -------------- |
| 1142 // -- r0 : value | 1163 // -- r0 : value |
| 1143 // -- r1 : key | 1164 // -- r1 : key |
| 1144 // -- r2 : receiver | 1165 // -- r2 : receiver |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1514 Register reg = Assembler::GetRn(instr_at_patch); | 1535 Register reg = Assembler::GetRn(instr_at_patch); |
| 1515 patcher.masm()->tst(reg, Operand(kSmiTagMask)); | 1536 patcher.masm()->tst(reg, Operand(kSmiTagMask)); |
| 1516 patcher.EmitCondition(eq); | 1537 patcher.EmitCondition(eq); |
| 1517 } | 1538 } |
| 1518 } | 1539 } |
| 1519 | 1540 |
| 1520 | 1541 |
| 1521 } } // namespace v8::internal | 1542 } } // namespace v8::internal |
| 1522 | 1543 |
| 1523 #endif // V8_TARGET_ARCH_ARM | 1544 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |