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 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1479 // Push the element. | 1479 // Push the element. |
1480 __ lea(edx, FieldOperand(ebx, | 1480 __ lea(edx, FieldOperand(ebx, |
1481 eax, times_half_pointer_size, | 1481 eax, times_half_pointer_size, |
1482 FixedArray::kHeaderSize - argc * kPointerSize)); | 1482 FixedArray::kHeaderSize - argc * kPointerSize)); |
1483 __ mov(Operand(edx, 0), ecx); | 1483 __ mov(Operand(edx, 0), ecx); |
1484 | 1484 |
1485 __ ret((argc + 1) * kPointerSize); | 1485 __ ret((argc + 1) * kPointerSize); |
1486 | 1486 |
1487 __ bind(&with_write_barrier); | 1487 __ bind(&with_write_barrier); |
1488 | 1488 |
1489 if (FLAG_smi_only_arrays) { | 1489 __ mov(edi, FieldOperand(edx, HeapObject::kMapOffset)); |
1490 __ mov(edi, FieldOperand(edx, HeapObject::kMapOffset)); | 1490 __ CheckFastObjectElements(edi, &call_builtin); |
1491 __ CheckFastObjectElements(edi, &call_builtin); | |
1492 } | |
1493 | 1491 |
1494 // Save new length. | 1492 // Save new length. |
1495 __ mov(FieldOperand(edx, JSArray::kLengthOffset), eax); | 1493 __ mov(FieldOperand(edx, JSArray::kLengthOffset), eax); |
1496 | 1494 |
1497 // Push the element. | 1495 // Push the element. |
1498 __ lea(edx, FieldOperand(ebx, | 1496 __ lea(edx, FieldOperand(ebx, |
1499 eax, times_half_pointer_size, | 1497 eax, times_half_pointer_size, |
1500 FixedArray::kHeaderSize - argc * kPointerSize)); | 1498 FixedArray::kHeaderSize - argc * kPointerSize)); |
1501 __ mov(Operand(edx, 0), ecx); | 1499 __ mov(Operand(edx, 0), ecx); |
1502 | 1500 |
1503 __ RecordWrite( | 1501 __ RecordWrite( |
1504 ebx, edx, ecx, kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | 1502 ebx, edx, ecx, kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
1505 | 1503 |
1506 __ ret((argc + 1) * kPointerSize); | 1504 __ ret((argc + 1) * kPointerSize); |
1507 | 1505 |
1508 __ bind(&attempt_to_grow_elements); | 1506 __ bind(&attempt_to_grow_elements); |
1509 if (!FLAG_inline_new) { | 1507 if (!FLAG_inline_new) { |
1510 __ jmp(&call_builtin); | 1508 __ jmp(&call_builtin); |
1511 } | 1509 } |
1512 | 1510 |
1513 __ mov(edi, Operand(esp, argc * kPointerSize)); | 1511 __ mov(edi, Operand(esp, argc * kPointerSize)); |
1514 if (FLAG_smi_only_arrays) { | 1512 // Growing elements that are SMI-only requires special handling in case |
1515 // Growing elements that are SMI-only requires special handling in case | 1513 // the new element is non-Smi. For now, delegate to the builtin. |
1516 // the new element is non-Smi. For now, delegate to the builtin. | 1514 Label no_fast_elements_check; |
1517 Label no_fast_elements_check; | 1515 __ JumpIfSmi(edi, &no_fast_elements_check); |
1518 __ JumpIfSmi(edi, &no_fast_elements_check); | 1516 __ mov(esi, FieldOperand(edx, HeapObject::kMapOffset)); |
1519 __ mov(esi, FieldOperand(edx, HeapObject::kMapOffset)); | 1517 __ CheckFastObjectElements(esi, &call_builtin, Label::kFar); |
1520 __ CheckFastObjectElements(esi, &call_builtin, Label::kFar); | 1518 __ bind(&no_fast_elements_check); |
1521 __ bind(&no_fast_elements_check); | |
1522 } | |
1523 | 1519 |
1524 // We could be lucky and the elements array could be at the top of | 1520 // We could be lucky and the elements array could be at the top of |
1525 // new-space. In this case we can just grow it in place by moving the | 1521 // new-space. In this case we can just grow it in place by moving the |
1526 // allocation pointer up. | 1522 // allocation pointer up. |
1527 | 1523 |
1528 ExternalReference new_space_allocation_top = | 1524 ExternalReference new_space_allocation_top = |
1529 ExternalReference::new_space_allocation_top_address(isolate()); | 1525 ExternalReference::new_space_allocation_top_address(isolate()); |
1530 ExternalReference new_space_allocation_limit = | 1526 ExternalReference new_space_allocation_limit = |
1531 ExternalReference::new_space_allocation_limit_address(isolate()); | 1527 ExternalReference::new_space_allocation_limit_address(isolate()); |
1532 | 1528 |
(...skipping 2480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4013 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); | 4009 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); |
4014 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); | 4010 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); |
4015 } | 4011 } |
4016 | 4012 |
4017 | 4013 |
4018 #undef __ | 4014 #undef __ |
4019 | 4015 |
4020 } } // namespace v8::internal | 4016 } } // namespace v8::internal |
4021 | 4017 |
4022 #endif // V8_TARGET_ARCH_IA32 | 4018 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |