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 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1340 &transition_double_elements); | 1340 &transition_double_elements); |
1341 __ Ret(USE_DELAY_SLOT); | 1341 __ Ret(USE_DELAY_SLOT); |
1342 __ mov(v0, value); | 1342 __ mov(v0, value); |
1343 | 1343 |
1344 __ bind(&transition_smi_elements); | 1344 __ bind(&transition_smi_elements); |
1345 // Transition the array appropriately depending on the value type. | 1345 // Transition the array appropriately depending on the value type. |
1346 __ lw(t0, FieldMemOperand(value, HeapObject::kMapOffset)); | 1346 __ lw(t0, FieldMemOperand(value, HeapObject::kMapOffset)); |
1347 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); | 1347 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
1348 __ Branch(&non_double_value, ne, t0, Operand(at)); | 1348 __ Branch(&non_double_value, ne, t0, Operand(at)); |
1349 | 1349 |
1350 // Value is a double. Transition FAST_SMI_ONLY_ELEMENTS -> | 1350 // Value is a double. Transition Smi -> Double and complete the store. |
1351 // FAST_DOUBLE_ELEMENTS and complete the store. | 1351 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, |
1352 __ LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS, | |
1353 FAST_DOUBLE_ELEMENTS, | 1352 FAST_DOUBLE_ELEMENTS, |
1354 receiver_map, | 1353 receiver_map, |
1355 t0, | 1354 t0, |
1356 &slow); | 1355 &slow); |
1357 ASSERT(receiver_map.is(a3)); // Transition code expects map in a3 | 1356 ASSERT(receiver_map.is(a3)); // Transition code expects map in a3 |
1358 ElementsTransitionGenerator::GenerateSmiOnlyToDouble(masm, &slow); | 1357 ElementsTransitionGenerator::GenerateSmiOnlyToDouble(masm, &slow); |
1359 __ lw(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 1358 __ lw(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
1360 __ jmp(&fast_double_without_map_check); | 1359 __ jmp(&fast_double_without_map_check); |
1361 | 1360 |
1362 __ bind(&non_double_value); | 1361 __ bind(&non_double_value); |
1363 // Value is not a double, FAST_SMI_ONLY_ELEMENTS -> FAST_ELEMENTS | 1362 // Value is not a double, Smi -> Object elements |
1364 __ LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS, | 1363 __ LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS, |
1365 FAST_ELEMENTS, | 1364 FAST_ELEMENTS, |
1366 receiver_map, | 1365 receiver_map, |
1367 t0, | 1366 t0, |
1368 &slow); | 1367 &slow); |
1369 ASSERT(receiver_map.is(a3)); // Transition code expects map in a3 | 1368 ASSERT(receiver_map.is(a3)); // Transition code expects map in a3 |
1370 ElementsTransitionGenerator::GenerateSmiOnlyToObject(masm); | 1369 ElementsTransitionGenerator::GenerateMapChangeElementTransition(masm); |
1371 __ lw(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 1370 __ lw(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
1372 __ jmp(&finish_object_store); | 1371 __ jmp(&finish_object_store); |
1373 | 1372 |
1374 __ bind(&transition_double_elements); | 1373 __ bind(&transition_double_elements); |
1375 // Elements are FAST_DOUBLE_ELEMENTS, but value is an Object that's not a | 1374 // Elements are double, but value is an Object that's not a HeapNumber. Make |
1376 // HeapNumber. Make sure that the receiver is a Array with FAST_ELEMENTS and | 1375 // sure that the receiver is a Array with Object elements and transition array |
1377 // transition array from FAST_DOUBLE_ELEMENTS to FAST_ELEMENTS | 1376 // from double elements to Object elements. |
1378 __ LoadTransitionedArrayMapConditional(FAST_DOUBLE_ELEMENTS, | 1377 __ LoadTransitionedArrayMapConditional(FAST_DOUBLE_ELEMENTS, |
1379 FAST_ELEMENTS, | 1378 FAST_ELEMENTS, |
1380 receiver_map, | 1379 receiver_map, |
1381 t0, | 1380 t0, |
1382 &slow); | 1381 &slow); |
1383 ASSERT(receiver_map.is(a3)); // Transition code expects map in a3 | 1382 ASSERT(receiver_map.is(a3)); // Transition code expects map in a3 |
1384 ElementsTransitionGenerator::GenerateDoubleToObject(masm, &slow); | 1383 ElementsTransitionGenerator::GenerateDoubleToObject(masm, &slow); |
1385 __ lw(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 1384 __ lw(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
1386 __ jmp(&finish_object_store); | 1385 __ jmp(&finish_object_store); |
1387 } | 1386 } |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1752 } else { | 1751 } else { |
1753 ASSERT(Assembler::IsBne(branch_instr)); | 1752 ASSERT(Assembler::IsBne(branch_instr)); |
1754 patcher.ChangeBranchCondition(eq); | 1753 patcher.ChangeBranchCondition(eq); |
1755 } | 1754 } |
1756 } | 1755 } |
1757 | 1756 |
1758 | 1757 |
1759 } } // namespace v8::internal | 1758 } } // namespace v8::internal |
1760 | 1759 |
1761 #endif // V8_TARGET_ARCH_MIPS | 1760 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |