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 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1459 if (FLAG_smi_only_arrays && !FLAG_trace_elements_transitions) { | 1459 if (FLAG_smi_only_arrays && !FLAG_trace_elements_transitions) { |
1460 Label fast_object, not_fast_object; | 1460 Label fast_object, not_fast_object; |
1461 __ CheckFastObjectElements(ebx, ¬_fast_object, Label::kNear); | 1461 __ CheckFastObjectElements(ebx, ¬_fast_object, Label::kNear); |
1462 __ jmp(&fast_object); | 1462 __ jmp(&fast_object); |
1463 // In case of fast smi-only, convert to fast object, otherwise bail out. | 1463 // In case of fast smi-only, convert to fast object, otherwise bail out. |
1464 __ bind(¬_fast_object); | 1464 __ bind(¬_fast_object); |
1465 __ CheckFastSmiOnlyElements(ebx, &call_builtin); | 1465 __ CheckFastSmiOnlyElements(ebx, &call_builtin); |
1466 // edi: elements array | 1466 // edi: elements array |
1467 // edx: receiver | 1467 // edx: receiver |
1468 // ebx: map | 1468 // ebx: map |
1469 __ LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS, | 1469 Label try_holey_map; |
1470 __ LoadTransitionedArrayMapConditional(FAST_HOLEY_SMI_ELEMENTS, | |
Jakob Kummerow
2012/05/13 21:55:27
Didn't you mean to check for packed FAST_SMI_ELEME
danno
2012/05/22 11:05:21
Done.
| |
1471 FAST_HOLEY_ELEMENTS, | |
1472 ebx, | |
1473 edi, | |
1474 &try_holey_map); | |
1475 | |
1476 ElementsTransitionGenerator:: | |
1477 GenerateMapChangeElementTransition(masm()); | |
1478 // Restore edi. | |
1479 __ mov(edi, FieldOperand(edx, JSArray::kElementsOffset)); | |
1480 __ jmp(&fast_object); | |
1481 | |
1482 __ bind(&try_holey_map); | |
1483 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, | |
1470 FAST_ELEMENTS, | 1484 FAST_ELEMENTS, |
1471 ebx, | 1485 ebx, |
1472 edi, | 1486 edi, |
1473 &call_builtin); | 1487 &call_builtin); |
1474 ElementsTransitionGenerator::GenerateSmiOnlyToObject(masm()); | 1488 ElementsTransitionGenerator:: |
1489 GenerateMapChangeElementTransition(masm()); | |
1475 // Restore edi. | 1490 // Restore edi. |
1476 __ mov(edi, FieldOperand(edx, JSArray::kElementsOffset)); | 1491 __ mov(edi, FieldOperand(edx, JSArray::kElementsOffset)); |
1477 __ bind(&fast_object); | 1492 __ bind(&fast_object); |
1478 } else { | 1493 } else { |
1479 __ CheckFastObjectElements(ebx, &call_builtin); | 1494 __ CheckFastObjectElements(ebx, &call_builtin); |
1480 } | 1495 } |
1481 | 1496 |
1482 // Save new length. | 1497 // Save new length. |
1483 __ mov(FieldOperand(edx, JSArray::kLengthOffset), eax); | 1498 __ mov(FieldOperand(edx, JSArray::kLengthOffset), eax); |
1484 | 1499 |
(...skipping 2326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3811 // ----------------------------------- | 3826 // ----------------------------------- |
3812 Label miss_force_generic, grow, slow, transition_elements_kind; | 3827 Label miss_force_generic, grow, slow, transition_elements_kind; |
3813 Label check_capacity, prepare_slow, finish_store, commit_backing_store; | 3828 Label check_capacity, prepare_slow, finish_store, commit_backing_store; |
3814 | 3829 |
3815 // This stub is meant to be tail-jumped to, the receiver must already | 3830 // This stub is meant to be tail-jumped to, the receiver must already |
3816 // have been verified by the caller to not be a smi. | 3831 // have been verified by the caller to not be a smi. |
3817 | 3832 |
3818 // Check that the key is a smi or a heap number convertible to a smi. | 3833 // Check that the key is a smi or a heap number convertible to a smi. |
3819 GenerateSmiKeyCheck(masm, ecx, ebx, xmm0, xmm1, &miss_force_generic); | 3834 GenerateSmiKeyCheck(masm, ecx, ebx, xmm0, xmm1, &miss_force_generic); |
3820 | 3835 |
3821 if (elements_kind == FAST_SMI_ONLY_ELEMENTS) { | 3836 if (IsFastSmiElementsKind(elements_kind)) { |
3822 __ JumpIfNotSmi(eax, &transition_elements_kind); | 3837 __ JumpIfNotSmi(eax, &transition_elements_kind); |
3823 } | 3838 } |
3824 | 3839 |
3825 // Get the elements array and make sure it is a fast element array, not 'cow'. | 3840 // Get the elements array and make sure it is a fast element array, not 'cow'. |
3826 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); | 3841 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); |
3827 if (is_js_array) { | 3842 if (is_js_array) { |
3828 // Check that the key is within bounds. | 3843 // Check that the key is within bounds. |
3829 __ cmp(ecx, FieldOperand(edx, JSArray::kLengthOffset)); // smis. | 3844 __ cmp(ecx, FieldOperand(edx, JSArray::kLengthOffset)); // smis. |
3830 if (grow_mode == ALLOW_JSARRAY_GROWTH) { | 3845 if (grow_mode == ALLOW_JSARRAY_GROWTH) { |
3831 __ j(above_equal, &grow); | 3846 __ j(above_equal, &grow); |
3832 } else { | 3847 } else { |
3833 __ j(above_equal, &miss_force_generic); | 3848 __ j(above_equal, &miss_force_generic); |
3834 } | 3849 } |
3835 } else { | 3850 } else { |
3836 // Check that the key is within bounds. | 3851 // Check that the key is within bounds. |
3837 __ cmp(ecx, FieldOperand(edi, FixedArray::kLengthOffset)); // smis. | 3852 __ cmp(ecx, FieldOperand(edi, FixedArray::kLengthOffset)); // smis. |
3838 __ j(above_equal, &miss_force_generic); | 3853 __ j(above_equal, &miss_force_generic); |
3839 } | 3854 } |
3840 | 3855 |
3841 __ cmp(FieldOperand(edi, HeapObject::kMapOffset), | 3856 __ cmp(FieldOperand(edi, HeapObject::kMapOffset), |
3842 Immediate(masm->isolate()->factory()->fixed_array_map())); | 3857 Immediate(masm->isolate()->factory()->fixed_array_map())); |
3843 __ j(not_equal, &miss_force_generic); | 3858 __ j(not_equal, &miss_force_generic); |
3844 | 3859 |
3845 __ bind(&finish_store); | 3860 __ bind(&finish_store); |
3846 if (elements_kind == FAST_SMI_ONLY_ELEMENTS) { | 3861 if (IsFastSmiElementsKind(elements_kind)) { |
3847 // ecx is a smi, use times_half_pointer_size instead of | 3862 // ecx is a smi, use times_half_pointer_size instead of |
3848 // times_pointer_size | 3863 // times_pointer_size |
3849 __ mov(FieldOperand(edi, | 3864 __ mov(FieldOperand(edi, |
3850 ecx, | 3865 ecx, |
3851 times_half_pointer_size, | 3866 times_half_pointer_size, |
3852 FixedArray::kHeaderSize), eax); | 3867 FixedArray::kHeaderSize), eax); |
3853 } else { | 3868 } else { |
3854 ASSERT(elements_kind == FAST_ELEMENTS); | 3869 ASSERT(IsFastObjectElementsKind(elements_kind)); |
3855 // Do the store and update the write barrier. | 3870 // Do the store and update the write barrier. |
3856 // ecx is a smi, use times_half_pointer_size instead of | 3871 // ecx is a smi, use times_half_pointer_size instead of |
3857 // times_pointer_size | 3872 // times_pointer_size |
3858 __ lea(ecx, FieldOperand(edi, | 3873 __ lea(ecx, FieldOperand(edi, |
3859 ecx, | 3874 ecx, |
3860 times_half_pointer_size, | 3875 times_half_pointer_size, |
3861 FixedArray::kHeaderSize)); | 3876 FixedArray::kHeaderSize)); |
3862 __ mov(Operand(ecx, 0), eax); | 3877 __ mov(Operand(ecx, 0), eax); |
3863 // Make sure to preserve the value in register eax. | 3878 // Make sure to preserve the value in register eax. |
3864 __ mov(ebx, eax); | 3879 __ mov(ebx, eax); |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4081 __ jmp(ic_slow, RelocInfo::CODE_TARGET); | 4096 __ jmp(ic_slow, RelocInfo::CODE_TARGET); |
4082 } | 4097 } |
4083 } | 4098 } |
4084 | 4099 |
4085 | 4100 |
4086 #undef __ | 4101 #undef __ |
4087 | 4102 |
4088 } } // namespace v8::internal | 4103 } } // namespace v8::internal |
4089 | 4104 |
4090 #endif // V8_TARGET_ARCH_IA32 | 4105 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |