| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1453 __ lea(rdx, FieldOperand(rbx, | 1453 __ lea(rdx, FieldOperand(rbx, |
| 1454 rax, times_pointer_size, | 1454 rax, times_pointer_size, |
| 1455 FixedArray::kHeaderSize - argc * kPointerSize)); | 1455 FixedArray::kHeaderSize - argc * kPointerSize)); |
| 1456 __ movq(Operand(rdx, 0), rcx); | 1456 __ movq(Operand(rdx, 0), rcx); |
| 1457 | 1457 |
| 1458 __ Integer32ToSmi(rax, rax); // Return new length as smi. | 1458 __ Integer32ToSmi(rax, rax); // Return new length as smi. |
| 1459 __ ret((argc + 1) * kPointerSize); | 1459 __ ret((argc + 1) * kPointerSize); |
| 1460 | 1460 |
| 1461 __ bind(&with_write_barrier); | 1461 __ bind(&with_write_barrier); |
| 1462 | 1462 |
| 1463 if (FLAG_smi_only_arrays) { | 1463 __ movq(rdi, FieldOperand(rdx, HeapObject::kMapOffset)); |
| 1464 __ movq(rdi, FieldOperand(rdx, HeapObject::kMapOffset)); | 1464 __ CheckFastObjectElements(rdi, &call_builtin); |
| 1465 __ CheckFastObjectElements(rdi, &call_builtin); | |
| 1466 } | |
| 1467 | 1465 |
| 1468 // Save new length. | 1466 // Save new length. |
| 1469 __ Integer32ToSmiField(FieldOperand(rdx, JSArray::kLengthOffset), rax); | 1467 __ Integer32ToSmiField(FieldOperand(rdx, JSArray::kLengthOffset), rax); |
| 1470 | 1468 |
| 1471 // Push the element. | 1469 // Push the element. |
| 1472 __ lea(rdx, FieldOperand(rbx, | 1470 __ lea(rdx, FieldOperand(rbx, |
| 1473 rax, times_pointer_size, | 1471 rax, times_pointer_size, |
| 1474 FixedArray::kHeaderSize - argc * kPointerSize)); | 1472 FixedArray::kHeaderSize - argc * kPointerSize)); |
| 1475 __ movq(Operand(rdx, 0), rcx); | 1473 __ movq(Operand(rdx, 0), rcx); |
| 1476 | 1474 |
| 1477 __ RecordWrite( | 1475 __ RecordWrite( |
| 1478 rbx, rdx, rcx, kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | 1476 rbx, rdx, rcx, kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
| 1479 | 1477 |
| 1480 __ Integer32ToSmi(rax, rax); // Return new length as smi. | 1478 __ Integer32ToSmi(rax, rax); // Return new length as smi. |
| 1481 __ ret((argc + 1) * kPointerSize); | 1479 __ ret((argc + 1) * kPointerSize); |
| 1482 | 1480 |
| 1483 __ bind(&attempt_to_grow_elements); | 1481 __ bind(&attempt_to_grow_elements); |
| 1484 if (!FLAG_inline_new) { | 1482 if (!FLAG_inline_new) { |
| 1485 __ jmp(&call_builtin); | 1483 __ jmp(&call_builtin); |
| 1486 } | 1484 } |
| 1487 | 1485 |
| 1488 __ movq(rdi, Operand(rsp, argc * kPointerSize)); | 1486 __ movq(rdi, Operand(rsp, argc * kPointerSize)); |
| 1489 if (FLAG_smi_only_arrays) { | 1487 // Growing elements that are SMI-only requires special handling in case |
| 1490 // Growing elements that are SMI-only requires special handling in case | 1488 // the new element is non-Smi. For now, delegate to the builtin. |
| 1491 // the new element is non-Smi. For now, delegate to the builtin. | 1489 Label no_fast_elements_check; |
| 1492 Label no_fast_elements_check; | 1490 __ JumpIfSmi(rdi, &no_fast_elements_check); |
| 1493 __ JumpIfSmi(rdi, &no_fast_elements_check); | 1491 __ movq(rsi, FieldOperand(rdx, HeapObject::kMapOffset)); |
| 1494 __ movq(rsi, FieldOperand(rdx, HeapObject::kMapOffset)); | 1492 __ CheckFastObjectElements(rsi, &call_builtin, Label::kFar); |
| 1495 __ CheckFastObjectElements(rsi, &call_builtin, Label::kFar); | 1493 __ bind(&no_fast_elements_check); |
| 1496 __ bind(&no_fast_elements_check); | |
| 1497 } | |
| 1498 | 1494 |
| 1499 ExternalReference new_space_allocation_top = | 1495 ExternalReference new_space_allocation_top = |
| 1500 ExternalReference::new_space_allocation_top_address(isolate()); | 1496 ExternalReference::new_space_allocation_top_address(isolate()); |
| 1501 ExternalReference new_space_allocation_limit = | 1497 ExternalReference new_space_allocation_limit = |
| 1502 ExternalReference::new_space_allocation_limit_address(isolate()); | 1498 ExternalReference::new_space_allocation_limit_address(isolate()); |
| 1503 | 1499 |
| 1504 const int kAllocationDelta = 4; | 1500 const int kAllocationDelta = 4; |
| 1505 // Load top. | 1501 // Load top. |
| 1506 __ Load(rcx, new_space_allocation_top); | 1502 __ Load(rcx, new_space_allocation_top); |
| 1507 | 1503 |
| (...skipping 2281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3789 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); | 3785 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); |
| 3790 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); | 3786 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); |
| 3791 } | 3787 } |
| 3792 | 3788 |
| 3793 | 3789 |
| 3794 #undef __ | 3790 #undef __ |
| 3795 | 3791 |
| 3796 } } // namespace v8::internal | 3792 } } // namespace v8::internal |
| 3797 | 3793 |
| 3798 #endif // V8_TARGET_ARCH_X64 | 3794 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |