Chromium Code Reviews| 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()); | |
|
Mads Ager (chromium)
2011/05/10 13:38:06
Really funky indentation. ;-)
danno
2011/05/11 14:20:19
Done.
| |
| 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 |
| 1133 ExternalReference ref = | 1152 ExternalReference ref = |
| 1134 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); | 1153 ExternalReference(IC_Utility(kKeyedStoreIC_Slow), masm->isolate()); |
|
Mads Ager (chromium)
2011/05/10 13:38:06
What is the idea with the slow case here? Goes dir
danno
2011/05/11 14:20:19
Exactly. This happens in the external arrays stub
| |
| 1135 __ TailCallExternalReference(ref, 3, 1); | 1154 __ TailCallExternalReference(ref, 3, 1); |
| 1136 } | 1155 } |
| 1137 | 1156 |
| 1138 | 1157 |
| 1139 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, | 1158 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, |
| 1140 StrictModeFlag strict_mode) { | 1159 StrictModeFlag strict_mode) { |
| 1141 // ---------- S t a t e -------------- | 1160 // ---------- S t a t e -------------- |
| 1142 // -- r0 : value | 1161 // -- r0 : value |
| 1143 // -- r1 : key | 1162 // -- r1 : key |
| 1144 // -- r2 : receiver | 1163 // -- r2 : receiver |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1514 Register reg = Assembler::GetRn(instr_at_patch); | 1533 Register reg = Assembler::GetRn(instr_at_patch); |
| 1515 patcher.masm()->tst(reg, Operand(kSmiTagMask)); | 1534 patcher.masm()->tst(reg, Operand(kSmiTagMask)); |
| 1516 patcher.EmitCondition(eq); | 1535 patcher.EmitCondition(eq); |
| 1517 } | 1536 } |
| 1518 } | 1537 } |
| 1519 | 1538 |
| 1520 | 1539 |
| 1521 } } // namespace v8::internal | 1540 } } // namespace v8::internal |
| 1522 | 1541 |
| 1523 #endif // V8_TARGET_ARCH_ARM | 1542 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |