OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1173 | 1173 |
1174 // Fast case: Do the store, could be either Object or double. | 1174 // Fast case: Do the store, could be either Object or double. |
1175 __ bind(fast_object); | 1175 __ bind(fast_object); |
1176 Register scratch_value = t0; | 1176 Register scratch_value = t0; |
1177 Register address = t1; | 1177 Register address = t1; |
1178 if (check_map == kCheckMap) { | 1178 if (check_map == kCheckMap) { |
1179 __ lw(elements_map, FieldMemOperand(elements, HeapObject::kMapOffset)); | 1179 __ lw(elements_map, FieldMemOperand(elements, HeapObject::kMapOffset)); |
1180 __ Branch(fast_double, ne, elements_map, | 1180 __ Branch(fast_double, ne, elements_map, |
1181 Operand(masm->isolate()->factory()->fixed_array_map())); | 1181 Operand(masm->isolate()->factory()->fixed_array_map())); |
1182 } | 1182 } |
| 1183 |
| 1184 // HOLECHECK: guards "A[i] = V" |
| 1185 // We have to go to the runtime if the current value is the hole because |
| 1186 // there may be a callback on the element. |
| 1187 Label holecheck_passed1; |
| 1188 __ Addu(address, elements, FixedArray::kHeaderSize - kHeapObjectTag); |
| 1189 __ sll(at, key, kPointerSizeLog2 - kSmiTagSize); |
| 1190 __ addu(address, address, at); |
| 1191 __ lw(scratch_value, MemOperand(address)); |
| 1192 __ Branch(&holecheck_passed1, ne, scratch_value, |
| 1193 Operand(masm->isolate()->factory()->the_hole_value())); |
| 1194 __ JumpIfDictionaryInPrototypeChain(receiver, elements_map, scratch_value, |
| 1195 slow); |
| 1196 |
| 1197 __ bind(&holecheck_passed1); |
| 1198 |
1183 // Smi stores don't require further checks. | 1199 // Smi stores don't require further checks. |
1184 Label non_smi_value; | 1200 Label non_smi_value; |
1185 __ JumpIfNotSmi(value, &non_smi_value); | 1201 __ JumpIfNotSmi(value, &non_smi_value); |
1186 | 1202 |
1187 if (increment_length == kIncrementLength) { | 1203 if (increment_length == kIncrementLength) { |
1188 // Add 1 to receiver->length. | 1204 // Add 1 to receiver->length. |
1189 __ Addu(scratch_value, key, Operand(Smi::FromInt(1))); | 1205 __ Addu(scratch_value, key, Operand(Smi::FromInt(1))); |
1190 __ sw(scratch_value, FieldMemOperand(receiver, JSArray::kLengthOffset)); | 1206 __ sw(scratch_value, FieldMemOperand(receiver, JSArray::kLengthOffset)); |
1191 } | 1207 } |
1192 // It's irrelevant whether array is smi-only or not when writing a smi. | 1208 // It's irrelevant whether array is smi-only or not when writing a smi. |
(...skipping 30 matching lines...) Expand all Loading... |
1223 OMIT_SMI_CHECK); | 1239 OMIT_SMI_CHECK); |
1224 __ Ret(); | 1240 __ Ret(); |
1225 | 1241 |
1226 __ bind(fast_double); | 1242 __ bind(fast_double); |
1227 if (check_map == kCheckMap) { | 1243 if (check_map == kCheckMap) { |
1228 // Check for fast double array case. If this fails, call through to the | 1244 // Check for fast double array case. If this fails, call through to the |
1229 // runtime. | 1245 // runtime. |
1230 __ LoadRoot(at, Heap::kFixedDoubleArrayMapRootIndex); | 1246 __ LoadRoot(at, Heap::kFixedDoubleArrayMapRootIndex); |
1231 __ Branch(slow, ne, elements_map, Operand(at)); | 1247 __ Branch(slow, ne, elements_map, Operand(at)); |
1232 } | 1248 } |
| 1249 |
| 1250 // HOLECHECK: guards "A[i] double hole?" |
| 1251 // We have to see if the double version of the hole is present. If so |
| 1252 // go to the runtime. |
| 1253 __ Addu(address, elements, |
| 1254 Operand(FixedDoubleArray::kHeaderSize + sizeof(kHoleNanLower32) |
| 1255 - kHeapObjectTag)); |
| 1256 __ sll(at, key, kPointerSizeLog2); |
| 1257 __ addu(address, address, at); |
| 1258 __ lw(scratch_value, MemOperand(address)); |
| 1259 __ Branch(&fast_double_without_map_check, ne, scratch_value, |
| 1260 Operand(kHoleNanUpper32)); |
| 1261 __ JumpIfDictionaryInPrototypeChain(receiver, elements_map, scratch_value, |
| 1262 slow); |
| 1263 |
1233 __ bind(&fast_double_without_map_check); | 1264 __ bind(&fast_double_without_map_check); |
1234 __ StoreNumberToDoubleElements(value, | 1265 __ StoreNumberToDoubleElements(value, |
1235 key, | 1266 key, |
1236 elements, // Overwritten. | 1267 elements, // Overwritten. |
1237 a3, // Scratch regs... | 1268 a3, // Scratch regs... |
1238 t0, | 1269 t0, |
1239 t1, | 1270 t1, |
1240 &transition_double_elements); | 1271 &transition_double_elements); |
1241 if (increment_length == kIncrementLength) { | 1272 if (increment_length == kIncrementLength) { |
1242 // Add 1 to receiver->length. | 1273 // Add 1 to receiver->length. |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1658 } else { | 1689 } else { |
1659 ASSERT(Assembler::IsBne(branch_instr)); | 1690 ASSERT(Assembler::IsBne(branch_instr)); |
1660 patcher.ChangeBranchCondition(eq); | 1691 patcher.ChangeBranchCondition(eq); |
1661 } | 1692 } |
1662 } | 1693 } |
1663 | 1694 |
1664 | 1695 |
1665 } } // namespace v8::internal | 1696 } } // namespace v8::internal |
1666 | 1697 |
1667 #endif // V8_TARGET_ARCH_MIPS | 1698 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |