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 |
1351 // FAST_DOUBLE_ELEMENTS and complete the store. | 1351 // Value is a double. Transition FAST_SMI_ELEMENTS -> FAST_DOUBLE_ELEMENTS |
1352 __ LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS, | 1352 // and complete the store. |
| 1353 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, |
1353 FAST_DOUBLE_ELEMENTS, | 1354 FAST_DOUBLE_ELEMENTS, |
1354 receiver_map, | 1355 receiver_map, |
1355 t0, | 1356 t0, |
1356 &slow); | 1357 &slow); |
1357 ASSERT(receiver_map.is(a3)); // Transition code expects map in a3 | 1358 ASSERT(receiver_map.is(a3)); // Transition code expects map in a3 |
1358 ElementsTransitionGenerator::GenerateSmiOnlyToDouble(masm, &slow); | 1359 ElementsTransitionGenerator::GenerateSmiToDouble(masm, &slow); |
1359 __ lw(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 1360 __ lw(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
1360 __ jmp(&fast_double_without_map_check); | 1361 __ jmp(&fast_double_without_map_check); |
1361 | 1362 |
1362 __ bind(&non_double_value); | 1363 __ bind(&non_double_value); |
1363 // Value is not a double, FAST_SMI_ONLY_ELEMENTS -> FAST_ELEMENTS | 1364 // Value is not a double, FAST_SMI_ELEMENTS -> FAST_ELEMENTS |
1364 __ LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS, | 1365 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, |
1365 FAST_ELEMENTS, | 1366 FAST_ELEMENTS, |
1366 receiver_map, | 1367 receiver_map, |
1367 t0, | 1368 t0, |
1368 &slow); | 1369 &slow); |
1369 ASSERT(receiver_map.is(a3)); // Transition code expects map in a3 | 1370 ASSERT(receiver_map.is(a3)); // Transition code expects map in a3 |
1370 ElementsTransitionGenerator::GenerateSmiOnlyToObject(masm); | 1371 ElementsTransitionGenerator::GenerateMapChangeElementTransition(masm); |
1371 __ lw(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 1372 __ lw(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
1372 __ jmp(&finish_object_store); | 1373 __ jmp(&finish_object_store); |
1373 | 1374 |
1374 __ bind(&transition_double_elements); | 1375 __ bind(&transition_double_elements); |
1375 // Elements are FAST_DOUBLE_ELEMENTS, but value is an Object that's not a | 1376 // 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 | 1377 // sure that the receiver is a Array with Object elements and transition array |
1377 // transition array from FAST_DOUBLE_ELEMENTS to FAST_ELEMENTS | 1378 // from double elements to Object elements. |
1378 __ LoadTransitionedArrayMapConditional(FAST_DOUBLE_ELEMENTS, | 1379 __ LoadTransitionedArrayMapConditional(FAST_DOUBLE_ELEMENTS, |
1379 FAST_ELEMENTS, | 1380 FAST_ELEMENTS, |
1380 receiver_map, | 1381 receiver_map, |
1381 t0, | 1382 t0, |
1382 &slow); | 1383 &slow); |
1383 ASSERT(receiver_map.is(a3)); // Transition code expects map in a3 | 1384 ASSERT(receiver_map.is(a3)); // Transition code expects map in a3 |
1384 ElementsTransitionGenerator::GenerateDoubleToObject(masm, &slow); | 1385 ElementsTransitionGenerator::GenerateDoubleToObject(masm, &slow); |
1385 __ lw(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 1386 __ lw(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
1386 __ jmp(&finish_object_store); | 1387 __ jmp(&finish_object_store); |
1387 } | 1388 } |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1464 | 1465 |
1465 void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) { | 1466 void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) { |
1466 // ---------- S t a t e -------------- | 1467 // ---------- S t a t e -------------- |
1467 // -- a2 : receiver | 1468 // -- a2 : receiver |
1468 // -- a3 : target map | 1469 // -- a3 : target map |
1469 // -- ra : return address | 1470 // -- ra : return address |
1470 // ----------------------------------- | 1471 // ----------------------------------- |
1471 // Must return the modified receiver in v0. | 1472 // Must return the modified receiver in v0. |
1472 if (!FLAG_trace_elements_transitions) { | 1473 if (!FLAG_trace_elements_transitions) { |
1473 Label fail; | 1474 Label fail; |
1474 ElementsTransitionGenerator::GenerateSmiOnlyToDouble(masm, &fail); | 1475 ElementsTransitionGenerator::GenerateSmiToDouble(masm, &fail); |
1475 __ Ret(USE_DELAY_SLOT); | 1476 __ Ret(USE_DELAY_SLOT); |
1476 __ mov(v0, a2); | 1477 __ mov(v0, a2); |
1477 __ bind(&fail); | 1478 __ bind(&fail); |
1478 } | 1479 } |
1479 | 1480 |
1480 __ push(a2); | 1481 __ push(a2); |
1481 __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1); | 1482 __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1); |
1482 } | 1483 } |
1483 | 1484 |
1484 | 1485 |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1752 } else { | 1753 } else { |
1753 ASSERT(Assembler::IsBne(branch_instr)); | 1754 ASSERT(Assembler::IsBne(branch_instr)); |
1754 patcher.ChangeBranchCondition(eq); | 1755 patcher.ChangeBranchCondition(eq); |
1755 } | 1756 } |
1756 } | 1757 } |
1757 | 1758 |
1758 | 1759 |
1759 } } // namespace v8::internal | 1760 } } // namespace v8::internal |
1760 | 1761 |
1761 #endif // V8_TARGET_ARCH_MIPS | 1762 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |