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