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 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 | 1242 |
1243 void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) { | 1243 void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) { |
1244 // ---------- S t a t e -------------- | 1244 // ---------- S t a t e -------------- |
1245 // -- r2 : receiver | 1245 // -- r2 : receiver |
1246 // -- r3 : target map | 1246 // -- r3 : target map |
1247 // -- lr : return address | 1247 // -- lr : return address |
1248 // ----------------------------------- | 1248 // ----------------------------------- |
1249 // Must return the modified receiver in r0. | 1249 // Must return the modified receiver in r0. |
1250 if (!FLAG_trace_elements_transitions) { | 1250 if (!FLAG_trace_elements_transitions) { |
1251 Label fail; | 1251 Label fail; |
1252 ElementsTransitionGenerator::GenerateSmiToDouble(masm, &fail); | 1252 AllocationSiteMode mode = AllocationSiteInfo::GetMode(FAST_SMI_ELEMENTS, |
| 1253 FAST_DOUBLE_ELEMENTS); |
| 1254 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, &fail); |
1253 __ mov(r0, r2); | 1255 __ mov(r0, r2); |
1254 __ Ret(); | 1256 __ Ret(); |
1255 __ bind(&fail); | 1257 __ bind(&fail); |
1256 } | 1258 } |
1257 | 1259 |
1258 __ push(r2); | 1260 __ push(r2); |
1259 __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1); | 1261 __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1); |
1260 } | 1262 } |
1261 | 1263 |
1262 | 1264 |
1263 void KeyedStoreIC::GenerateTransitionElementsDoubleToObject( | 1265 void KeyedStoreIC::GenerateTransitionElementsDoubleToObject( |
1264 MacroAssembler* masm) { | 1266 MacroAssembler* masm) { |
1265 // ---------- S t a t e -------------- | 1267 // ---------- S t a t e -------------- |
1266 // -- r2 : receiver | 1268 // -- r2 : receiver |
1267 // -- r3 : target map | 1269 // -- r3 : target map |
1268 // -- lr : return address | 1270 // -- lr : return address |
1269 // ----------------------------------- | 1271 // ----------------------------------- |
1270 // Must return the modified receiver in r0. | 1272 // Must return the modified receiver in r0. |
1271 if (!FLAG_trace_elements_transitions) { | 1273 if (!FLAG_trace_elements_transitions) { |
1272 Label fail; | 1274 Label fail; |
1273 ElementsTransitionGenerator::GenerateDoubleToObject(masm, &fail); | 1275 AllocationSiteMode mode = AllocationSiteInfo::GetMode(FAST_DOUBLE_ELEMENTS, |
| 1276 FAST_ELEMENTS); |
| 1277 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, &fail); |
1274 __ mov(r0, r2); | 1278 __ mov(r0, r2); |
1275 __ Ret(); | 1279 __ Ret(); |
1276 __ bind(&fail); | 1280 __ bind(&fail); |
1277 } | 1281 } |
1278 | 1282 |
1279 __ push(r2); | 1283 __ push(r2); |
1280 __ TailCallRuntime(Runtime::kTransitionElementsDoubleToObject, 1, 1); | 1284 __ TailCallRuntime(Runtime::kTransitionElementsDoubleToObject, 1, 1); |
1281 } | 1285 } |
1282 | 1286 |
1283 | 1287 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1399 __ b(ne, &non_double_value); | 1403 __ b(ne, &non_double_value); |
1400 | 1404 |
1401 // Value is a double. Transition FAST_SMI_ELEMENTS -> | 1405 // Value is a double. Transition FAST_SMI_ELEMENTS -> |
1402 // FAST_DOUBLE_ELEMENTS and complete the store. | 1406 // FAST_DOUBLE_ELEMENTS and complete the store. |
1403 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, | 1407 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, |
1404 FAST_DOUBLE_ELEMENTS, | 1408 FAST_DOUBLE_ELEMENTS, |
1405 receiver_map, | 1409 receiver_map, |
1406 r4, | 1410 r4, |
1407 slow); | 1411 slow); |
1408 ASSERT(receiver_map.is(r3)); // Transition code expects map in r3 | 1412 ASSERT(receiver_map.is(r3)); // Transition code expects map in r3 |
1409 ElementsTransitionGenerator::GenerateSmiToDouble(masm, slow); | 1413 AllocationSiteMode mode = AllocationSiteInfo::GetMode(FAST_SMI_ELEMENTS, |
| 1414 FAST_DOUBLE_ELEMENTS); |
| 1415 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, slow); |
1410 __ ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 1416 __ ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
1411 __ jmp(&fast_double_without_map_check); | 1417 __ jmp(&fast_double_without_map_check); |
1412 | 1418 |
1413 __ bind(&non_double_value); | 1419 __ bind(&non_double_value); |
1414 // Value is not a double, FAST_SMI_ELEMENTS -> FAST_ELEMENTS | 1420 // Value is not a double, FAST_SMI_ELEMENTS -> FAST_ELEMENTS |
1415 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, | 1421 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, |
1416 FAST_ELEMENTS, | 1422 FAST_ELEMENTS, |
1417 receiver_map, | 1423 receiver_map, |
1418 r4, | 1424 r4, |
1419 slow); | 1425 slow); |
1420 ASSERT(receiver_map.is(r3)); // Transition code expects map in r3 | 1426 ASSERT(receiver_map.is(r3)); // Transition code expects map in r3 |
1421 ElementsTransitionGenerator::GenerateMapChangeElementsTransition(masm); | 1427 mode = AllocationSiteInfo::GetMode(FAST_SMI_ELEMENTS, FAST_ELEMENTS); |
| 1428 ElementsTransitionGenerator::GenerateMapChangeElementsTransition(masm, mode, |
| 1429 slow); |
1422 __ ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 1430 __ ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
1423 __ jmp(&finish_object_store); | 1431 __ jmp(&finish_object_store); |
1424 | 1432 |
1425 __ bind(&transition_double_elements); | 1433 __ bind(&transition_double_elements); |
1426 // Elements are FAST_DOUBLE_ELEMENTS, but value is an Object that's not a | 1434 // Elements are FAST_DOUBLE_ELEMENTS, but value is an Object that's not a |
1427 // HeapNumber. Make sure that the receiver is a Array with FAST_ELEMENTS and | 1435 // HeapNumber. Make sure that the receiver is a Array with FAST_ELEMENTS and |
1428 // transition array from FAST_DOUBLE_ELEMENTS to FAST_ELEMENTS | 1436 // transition array from FAST_DOUBLE_ELEMENTS to FAST_ELEMENTS |
1429 __ LoadTransitionedArrayMapConditional(FAST_DOUBLE_ELEMENTS, | 1437 __ LoadTransitionedArrayMapConditional(FAST_DOUBLE_ELEMENTS, |
1430 FAST_ELEMENTS, | 1438 FAST_ELEMENTS, |
1431 receiver_map, | 1439 receiver_map, |
1432 r4, | 1440 r4, |
1433 slow); | 1441 slow); |
1434 ASSERT(receiver_map.is(r3)); // Transition code expects map in r3 | 1442 ASSERT(receiver_map.is(r3)); // Transition code expects map in r3 |
1435 ElementsTransitionGenerator::GenerateDoubleToObject(masm, slow); | 1443 mode = AllocationSiteInfo::GetMode(FAST_DOUBLE_ELEMENTS, FAST_ELEMENTS); |
| 1444 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, slow); |
1436 __ ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 1445 __ ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
1437 __ jmp(&finish_object_store); | 1446 __ jmp(&finish_object_store); |
1438 } | 1447 } |
1439 | 1448 |
1440 | 1449 |
1441 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, | 1450 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, |
1442 StrictModeFlag strict_mode) { | 1451 StrictModeFlag strict_mode) { |
1443 // ---------- S t a t e -------------- | 1452 // ---------- S t a t e -------------- |
1444 // -- r0 : value | 1453 // -- r0 : value |
1445 // -- r1 : key | 1454 // -- r1 : key |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1770 } else { | 1779 } else { |
1771 ASSERT(Assembler::GetCondition(branch_instr) == ne); | 1780 ASSERT(Assembler::GetCondition(branch_instr) == ne); |
1772 patcher.EmitCondition(eq); | 1781 patcher.EmitCondition(eq); |
1773 } | 1782 } |
1774 } | 1783 } |
1775 | 1784 |
1776 | 1785 |
1777 } } // namespace v8::internal | 1786 } } // namespace v8::internal |
1778 | 1787 |
1779 #endif // V8_TARGET_ARCH_ARM | 1788 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |