| 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 2815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2826 ALLOCATE_VARSIZE_MAP(STRING_TYPE, undetectable_string) | 2826 ALLOCATE_VARSIZE_MAP(STRING_TYPE, undetectable_string) |
| 2827 undetectable_string_map()->set_is_undetectable(); | 2827 undetectable_string_map()->set_is_undetectable(); |
| 2828 | 2828 |
| 2829 ALLOCATE_VARSIZE_MAP(ASCII_STRING_TYPE, undetectable_ascii_string); | 2829 ALLOCATE_VARSIZE_MAP(ASCII_STRING_TYPE, undetectable_ascii_string); |
| 2830 undetectable_ascii_string_map()->set_is_undetectable(); | 2830 undetectable_ascii_string_map()->set_is_undetectable(); |
| 2831 | 2831 |
| 2832 ALLOCATE_VARSIZE_MAP(FIXED_DOUBLE_ARRAY_TYPE, fixed_double_array) | 2832 ALLOCATE_VARSIZE_MAP(FIXED_DOUBLE_ARRAY_TYPE, fixed_double_array) |
| 2833 ALLOCATE_VARSIZE_MAP(BYTE_ARRAY_TYPE, byte_array) | 2833 ALLOCATE_VARSIZE_MAP(BYTE_ARRAY_TYPE, byte_array) |
| 2834 ALLOCATE_VARSIZE_MAP(FREE_SPACE_TYPE, free_space) | 2834 ALLOCATE_VARSIZE_MAP(FREE_SPACE_TYPE, free_space) |
| 2835 | 2835 |
| 2836 #define ALLOCATE_EXTERNAL_ARRAY_MAP(TYPE, type) \ | 2836 #define ALLOCATE_EXTERNAL_ARRAY_MAP(Type, type, TYPE, ctype, size) \ |
| 2837 ALLOCATE_MAP(EXTERNAL_##TYPE##_ARRAY_TYPE, ExternalArray::kAlignedSize, \ | 2837 ALLOCATE_MAP(EXTERNAL_##TYPE##_ARRAY_TYPE, ExternalArray::kAlignedSize, \ |
| 2838 external_##type##_array) | 2838 external_##type##_array) |
| 2839 | 2839 |
| 2840 ALLOCATE_EXTERNAL_ARRAY_MAP(PIXEL, pixel) | 2840 TYPED_ARRAYS(ALLOCATE_EXTERNAL_ARRAY_MAP) |
| 2841 ALLOCATE_EXTERNAL_ARRAY_MAP(BYTE, byte) | |
| 2842 ALLOCATE_EXTERNAL_ARRAY_MAP(UNSIGNED_BYTE, unsigned_byte) | |
| 2843 ALLOCATE_EXTERNAL_ARRAY_MAP(SHORT, short) // NOLINT | |
| 2844 ALLOCATE_EXTERNAL_ARRAY_MAP(UNSIGNED_SHORT, unsigned_short) | |
| 2845 ALLOCATE_EXTERNAL_ARRAY_MAP(INT, int) | |
| 2846 ALLOCATE_EXTERNAL_ARRAY_MAP(UNSIGNED_INT, unsigned_int) | |
| 2847 ALLOCATE_EXTERNAL_ARRAY_MAP(FLOAT, float) | |
| 2848 ALLOCATE_EXTERNAL_ARRAY_MAP(DOUBLE, double) | |
| 2849 #undef ALLOCATE_EXTERNAL_ARRAY_MAP | 2841 #undef ALLOCATE_EXTERNAL_ARRAY_MAP |
| 2850 | 2842 |
| 2851 ALLOCATE_VARSIZE_MAP(FIXED_UINT8_ARRAY_TYPE, fixed_uint8_array) | 2843 #define ALLOCATE_FIXED_TYPED_ARRAY_MAP(Type, type, TYPE, ctype, size) \ |
| 2852 ALLOCATE_VARSIZE_MAP(FIXED_UINT8_CLAMPED_ARRAY_TYPE, | 2844 ALLOCATE_VARSIZE_MAP(FIXED_##TYPE##_ARRAY_TYPE, \ |
| 2853 fixed_uint8_clamped_array) | 2845 fixed_##type##_array) |
| 2854 ALLOCATE_VARSIZE_MAP(FIXED_INT8_ARRAY_TYPE, fixed_int8_array) | 2846 |
| 2855 ALLOCATE_VARSIZE_MAP(FIXED_UINT16_ARRAY_TYPE, fixed_uint16_array) | 2847 TYPED_ARRAYS(ALLOCATE_FIXED_TYPED_ARRAY_MAP) |
| 2856 ALLOCATE_VARSIZE_MAP(FIXED_INT16_ARRAY_TYPE, fixed_int16_array) | 2848 #undef ALLOCATE_FIXED_TYPED_ARRAY_MAP |
| 2857 ALLOCATE_VARSIZE_MAP(FIXED_UINT32_ARRAY_TYPE, fixed_uint32_array) | |
| 2858 ALLOCATE_VARSIZE_MAP(FIXED_INT32_ARRAY_TYPE, fixed_int32_array) | |
| 2859 ALLOCATE_VARSIZE_MAP(FIXED_FLOAT32_ARRAY_TYPE, fixed_float32_array) | |
| 2860 ALLOCATE_VARSIZE_MAP(FIXED_FLOAT64_ARRAY_TYPE, fixed_float64_array) | |
| 2861 | 2849 |
| 2862 ALLOCATE_VARSIZE_MAP(FIXED_ARRAY_TYPE, non_strict_arguments_elements) | 2850 ALLOCATE_VARSIZE_MAP(FIXED_ARRAY_TYPE, non_strict_arguments_elements) |
| 2863 | 2851 |
| 2864 ALLOCATE_VARSIZE_MAP(CODE_TYPE, code) | 2852 ALLOCATE_VARSIZE_MAP(CODE_TYPE, code) |
| 2865 | 2853 |
| 2866 ALLOCATE_MAP(CELL_TYPE, Cell::kSize, cell) | 2854 ALLOCATE_MAP(CELL_TYPE, Cell::kSize, cell) |
| 2867 ALLOCATE_MAP(PROPERTY_CELL_TYPE, PropertyCell::kSize, global_property_cell) | 2855 ALLOCATE_MAP(PROPERTY_CELL_TYPE, PropertyCell::kSize, global_property_cell) |
| 2868 ALLOCATE_MAP(FILLER_TYPE, kPointerSize, one_pointer_filler) | 2856 ALLOCATE_MAP(FILLER_TYPE, kPointerSize, one_pointer_filler) |
| 2869 ALLOCATE_MAP(FILLER_TYPE, 2 * kPointerSize, two_pointer_filler) | 2857 ALLOCATE_MAP(FILLER_TYPE, 2 * kPointerSize, two_pointer_filler) |
| 2870 | 2858 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2902 #undef ALLOCATE_VARSIZE_MAP | 2890 #undef ALLOCATE_VARSIZE_MAP |
| 2903 #undef ALLOCATE_MAP | 2891 #undef ALLOCATE_MAP |
| 2904 } | 2892 } |
| 2905 | 2893 |
| 2906 { // Empty arrays | 2894 { // Empty arrays |
| 2907 { ByteArray* byte_array; | 2895 { ByteArray* byte_array; |
| 2908 if (!AllocateByteArray(0, TENURED)->To(&byte_array)) return false; | 2896 if (!AllocateByteArray(0, TENURED)->To(&byte_array)) return false; |
| 2909 set_empty_byte_array(byte_array); | 2897 set_empty_byte_array(byte_array); |
| 2910 } | 2898 } |
| 2911 | 2899 |
| 2912 #define ALLOCATE_EMPTY_EXTERNAL_ARRAY(Type, type) \ | 2900 #define ALLOCATE_EMPTY_EXTERNAL_ARRAY(Type, type, TYPE, ctype, size) \ |
| 2913 { ExternalArray* obj; \ | 2901 { ExternalArray* obj; \ |
| 2914 if (!AllocateEmptyExternalArray(kExternal##Type##Array)->To(&obj)) \ | 2902 if (!AllocateEmptyExternalArray(kExternal##Type##Array)->To(&obj)) \ |
| 2915 return false; \ | 2903 return false; \ |
| 2916 set_empty_external_##type##_array(obj); \ | 2904 set_empty_external_##type##_array(obj); \ |
| 2917 } | 2905 } |
| 2918 | 2906 |
| 2919 ALLOCATE_EMPTY_EXTERNAL_ARRAY(Byte, byte) | 2907 TYPED_ARRAYS(ALLOCATE_EMPTY_EXTERNAL_ARRAY) |
| 2920 ALLOCATE_EMPTY_EXTERNAL_ARRAY(UnsignedByte, unsigned_byte) | |
| 2921 ALLOCATE_EMPTY_EXTERNAL_ARRAY(Short, short) // NOLINT | |
| 2922 ALLOCATE_EMPTY_EXTERNAL_ARRAY(UnsignedShort, unsigned_short) | |
| 2923 ALLOCATE_EMPTY_EXTERNAL_ARRAY(Int, int) | |
| 2924 ALLOCATE_EMPTY_EXTERNAL_ARRAY(UnsignedInt, unsigned_int) | |
| 2925 ALLOCATE_EMPTY_EXTERNAL_ARRAY(Float, float) | |
| 2926 ALLOCATE_EMPTY_EXTERNAL_ARRAY(Double, double) | |
| 2927 ALLOCATE_EMPTY_EXTERNAL_ARRAY(Pixel, pixel) | |
| 2928 #undef ALLOCATE_EMPTY_EXTERNAL_ARRAY | 2908 #undef ALLOCATE_EMPTY_EXTERNAL_ARRAY |
| 2929 } | 2909 } |
| 2930 ASSERT(!InNewSpace(empty_fixed_array())); | 2910 ASSERT(!InNewSpace(empty_fixed_array())); |
| 2931 return true; | 2911 return true; |
| 2932 } | 2912 } |
| 2933 | 2913 |
| 2934 | 2914 |
| 2935 MaybeObject* Heap::AllocateHeapNumber(double value, PretenureFlag pretenure) { | 2915 MaybeObject* Heap::AllocateHeapNumber(double value, PretenureFlag pretenure) { |
| 2936 // Statically ensure that it is safe to allocate heap numbers in paged | 2916 // Statically ensure that it is safe to allocate heap numbers in paged |
| 2937 // spaces. | 2917 // spaces. |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3606 | 3586 |
| 3607 | 3587 |
| 3608 Map* Heap::MapForExternalArrayType(ExternalArrayType array_type) { | 3588 Map* Heap::MapForExternalArrayType(ExternalArrayType array_type) { |
| 3609 return Map::cast(roots_[RootIndexForExternalArrayType(array_type)]); | 3589 return Map::cast(roots_[RootIndexForExternalArrayType(array_type)]); |
| 3610 } | 3590 } |
| 3611 | 3591 |
| 3612 | 3592 |
| 3613 Heap::RootListIndex Heap::RootIndexForExternalArrayType( | 3593 Heap::RootListIndex Heap::RootIndexForExternalArrayType( |
| 3614 ExternalArrayType array_type) { | 3594 ExternalArrayType array_type) { |
| 3615 switch (array_type) { | 3595 switch (array_type) { |
| 3616 case kExternalByteArray: | 3596 #define ARRAY_TYPE_TO_ROOT_INDEX(Type, type, TYPE, ctype, size) \ |
| 3617 return kExternalByteArrayMapRootIndex; | 3597 case kExternal##Type##Array: \ |
| 3618 case kExternalUnsignedByteArray: | 3598 return kExternal##Type##ArrayMapRootIndex; |
| 3619 return kExternalUnsignedByteArrayMapRootIndex; | 3599 |
| 3620 case kExternalShortArray: | 3600 TYPED_ARRAYS(ARRAY_TYPE_TO_ROOT_INDEX) |
| 3621 return kExternalShortArrayMapRootIndex; | 3601 #undef ARRAY_TYPE_TO_ROOT_INDEX |
| 3622 case kExternalUnsignedShortArray: | 3602 |
| 3623 return kExternalUnsignedShortArrayMapRootIndex; | |
| 3624 case kExternalIntArray: | |
| 3625 return kExternalIntArrayMapRootIndex; | |
| 3626 case kExternalUnsignedIntArray: | |
| 3627 return kExternalUnsignedIntArrayMapRootIndex; | |
| 3628 case kExternalFloatArray: | |
| 3629 return kExternalFloatArrayMapRootIndex; | |
| 3630 case kExternalDoubleArray: | |
| 3631 return kExternalDoubleArrayMapRootIndex; | |
| 3632 case kExternalPixelArray: | |
| 3633 return kExternalPixelArrayMapRootIndex; | |
| 3634 default: | 3603 default: |
| 3635 UNREACHABLE(); | 3604 UNREACHABLE(); |
| 3636 return kUndefinedValueRootIndex; | 3605 return kUndefinedValueRootIndex; |
| 3637 } | 3606 } |
| 3638 } | 3607 } |
| 3639 | 3608 |
| 3640 | 3609 |
| 3641 Map* Heap::MapForFixedTypedArray(ExternalArrayType array_type) { | 3610 Map* Heap::MapForFixedTypedArray(ExternalArrayType array_type) { |
| 3642 return Map::cast(roots_[RootIndexForFixedTypedArray(array_type)]); | 3611 return Map::cast(roots_[RootIndexForFixedTypedArray(array_type)]); |
| 3643 } | 3612 } |
| 3644 | 3613 |
| 3645 | 3614 |
| 3646 Heap::RootListIndex Heap::RootIndexForFixedTypedArray( | 3615 Heap::RootListIndex Heap::RootIndexForFixedTypedArray( |
| 3647 ExternalArrayType array_type) { | 3616 ExternalArrayType array_type) { |
| 3648 switch (array_type) { | 3617 switch (array_type) { |
| 3649 case kExternalByteArray: | 3618 #define ARRAY_TYPE_TO_ROOT_INDEX(Type, type, TYPE, ctype, size) \ |
| 3650 return kFixedInt8ArrayMapRootIndex; | 3619 case kExternal##Type##Array: \ |
| 3651 case kExternalUnsignedByteArray: | 3620 return kFixed##Type##ArrayMapRootIndex; |
| 3652 return kFixedUint8ArrayMapRootIndex; | 3621 |
| 3653 case kExternalShortArray: | 3622 TYPED_ARRAYS(ARRAY_TYPE_TO_ROOT_INDEX) |
| 3654 return kFixedInt16ArrayMapRootIndex; | 3623 #undef ARRAY_TYPE_TO_ROOT_INDEX |
| 3655 case kExternalUnsignedShortArray: | 3624 |
| 3656 return kFixedUint16ArrayMapRootIndex; | |
| 3657 case kExternalIntArray: | |
| 3658 return kFixedInt32ArrayMapRootIndex; | |
| 3659 case kExternalUnsignedIntArray: | |
| 3660 return kFixedUint32ArrayMapRootIndex; | |
| 3661 case kExternalFloatArray: | |
| 3662 return kFixedFloat32ArrayMapRootIndex; | |
| 3663 case kExternalDoubleArray: | |
| 3664 return kFixedFloat64ArrayMapRootIndex; | |
| 3665 case kExternalPixelArray: | |
| 3666 return kFixedUint8ClampedArrayMapRootIndex; | |
| 3667 default: | 3625 default: |
| 3668 UNREACHABLE(); | 3626 UNREACHABLE(); |
| 3669 return kUndefinedValueRootIndex; | 3627 return kUndefinedValueRootIndex; |
| 3670 } | 3628 } |
| 3671 } | 3629 } |
| 3672 | 3630 |
| 3673 | 3631 |
| 3674 Heap::RootListIndex Heap::RootIndexForEmptyExternalArray( | 3632 Heap::RootListIndex Heap::RootIndexForEmptyExternalArray( |
| 3675 ElementsKind elementsKind) { | 3633 ElementsKind elementsKind) { |
| 3676 switch (elementsKind) { | 3634 switch (elementsKind) { |
| 3677 case EXTERNAL_BYTE_ELEMENTS: | 3635 #define ELEMENT_KIND_TO_ROOT_INDEX(Type, type, TYPE, ctype, size) \ |
| 3678 return kEmptyExternalByteArrayRootIndex; | 3636 case EXTERNAL_##TYPE##_ELEMENTS: \ |
| 3679 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: | 3637 return kEmptyExternal##Type##ArrayRootIndex; |
| 3680 return kEmptyExternalUnsignedByteArrayRootIndex; | 3638 |
| 3681 case EXTERNAL_SHORT_ELEMENTS: | 3639 TYPED_ARRAYS(ELEMENT_KIND_TO_ROOT_INDEX) |
| 3682 return kEmptyExternalShortArrayRootIndex; | 3640 #undef ELEMENT_KIND_TO_ROOT_INDEX |
| 3683 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: | 3641 |
| 3684 return kEmptyExternalUnsignedShortArrayRootIndex; | |
| 3685 case EXTERNAL_INT_ELEMENTS: | |
| 3686 return kEmptyExternalIntArrayRootIndex; | |
| 3687 case EXTERNAL_UNSIGNED_INT_ELEMENTS: | |
| 3688 return kEmptyExternalUnsignedIntArrayRootIndex; | |
| 3689 case EXTERNAL_FLOAT_ELEMENTS: | |
| 3690 return kEmptyExternalFloatArrayRootIndex; | |
| 3691 case EXTERNAL_DOUBLE_ELEMENTS: | |
| 3692 return kEmptyExternalDoubleArrayRootIndex; | |
| 3693 case EXTERNAL_PIXEL_ELEMENTS: | |
| 3694 return kEmptyExternalPixelArrayRootIndex; | |
| 3695 default: | 3642 default: |
| 3696 UNREACHABLE(); | 3643 UNREACHABLE(); |
| 3697 return kUndefinedValueRootIndex; | 3644 return kUndefinedValueRootIndex; |
| 3698 } | 3645 } |
| 3699 } | 3646 } |
| 3700 | 3647 |
| 3701 | 3648 |
| 3702 ExternalArray* Heap::EmptyExternalArrayForMap(Map* map) { | 3649 ExternalArray* Heap::EmptyExternalArrayForMap(Map* map) { |
| 3703 return ExternalArray::cast( | 3650 return ExternalArray::cast( |
| 3704 roots_[RootIndexForEmptyExternalArray(map->elements_kind())]); | 3651 roots_[RootIndexForEmptyExternalArray(map->elements_kind())]); |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3926 reinterpret_cast<ExternalArray*>(result)->set_external_pointer( | 3873 reinterpret_cast<ExternalArray*>(result)->set_external_pointer( |
| 3927 external_pointer); | 3874 external_pointer); |
| 3928 | 3875 |
| 3929 return result; | 3876 return result; |
| 3930 } | 3877 } |
| 3931 | 3878 |
| 3932 static void ForFixedTypedArray(ExternalArrayType array_type, | 3879 static void ForFixedTypedArray(ExternalArrayType array_type, |
| 3933 int* element_size, | 3880 int* element_size, |
| 3934 ElementsKind* element_kind) { | 3881 ElementsKind* element_kind) { |
| 3935 switch (array_type) { | 3882 switch (array_type) { |
| 3936 case kExternalUnsignedByteArray: | 3883 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ |
| 3937 *element_size = 1; | 3884 case kExternal##Type##Array: \ |
| 3938 *element_kind = UINT8_ELEMENTS; | 3885 *element_size = size; \ |
| 3886 *element_kind = TYPE##_ELEMENTS; \ |
| 3939 return; | 3887 return; |
| 3940 case kExternalByteArray: | 3888 |
| 3941 *element_size = 1; | 3889 TYPED_ARRAYS(TYPED_ARRAY_CASE) |
| 3942 *element_kind = INT8_ELEMENTS; | 3890 #undef TYPED_ARRAY_CASE |
| 3943 return; | 3891 |
| 3944 case kExternalUnsignedShortArray: | |
| 3945 *element_size = 2; | |
| 3946 *element_kind = UINT16_ELEMENTS; | |
| 3947 return; | |
| 3948 case kExternalShortArray: | |
| 3949 *element_size = 2; | |
| 3950 *element_kind = INT16_ELEMENTS; | |
| 3951 return; | |
| 3952 case kExternalUnsignedIntArray: | |
| 3953 *element_size = 4; | |
| 3954 *element_kind = UINT32_ELEMENTS; | |
| 3955 return; | |
| 3956 case kExternalIntArray: | |
| 3957 *element_size = 4; | |
| 3958 *element_kind = INT32_ELEMENTS; | |
| 3959 return; | |
| 3960 case kExternalFloatArray: | |
| 3961 *element_size = 4; | |
| 3962 *element_kind = FLOAT32_ELEMENTS; | |
| 3963 return; | |
| 3964 case kExternalDoubleArray: | |
| 3965 *element_size = 8; | |
| 3966 *element_kind = FLOAT64_ELEMENTS; | |
| 3967 return; | |
| 3968 case kExternalPixelArray: | |
| 3969 *element_size = 1; | |
| 3970 *element_kind = UINT8_CLAMPED_ELEMENTS; | |
| 3971 return; | |
| 3972 default: | 3892 default: |
| 3973 *element_size = 0; // Bogus | 3893 *element_size = 0; // Bogus |
| 3974 *element_kind = UINT8_ELEMENTS; // Bogus | 3894 *element_kind = UINT8_ELEMENTS; // Bogus |
| 3975 UNREACHABLE(); | 3895 UNREACHABLE(); |
| 3976 } | 3896 } |
| 3977 } | 3897 } |
| 3978 | 3898 |
| 3979 | 3899 |
| 3980 MaybeObject* Heap::AllocateFixedTypedArray(int length, | 3900 MaybeObject* Heap::AllocateFixedTypedArray(int length, |
| 3981 ExternalArrayType array_type, | 3901 ExternalArrayType array_type, |
| 3982 PretenureFlag pretenure) { | 3902 PretenureFlag pretenure) { |
| 3983 int element_size; | 3903 int element_size; |
| 3984 ElementsKind elements_kind; | 3904 ElementsKind elements_kind; |
| 3985 ForFixedTypedArray(array_type, &element_size, &elements_kind); | 3905 ForFixedTypedArray(array_type, &element_size, &elements_kind); |
| 3986 int size = OBJECT_POINTER_ALIGN( | 3906 int size = OBJECT_POINTER_ALIGN( |
| 3987 length * element_size + FixedTypedArrayBase::kDataOffset); | 3907 length * element_size + FixedTypedArrayBase::kDataOffset); |
| 3988 #ifndef V8_HOST_ARCH_64_BIT | 3908 #ifndef V8_HOST_ARCH_64_BIT |
| 3989 if (array_type == kExternalDoubleArray) { | 3909 if (array_type == kExternalFloat64Array) { |
| 3990 size += kPointerSize; | 3910 size += kPointerSize; |
| 3991 } | 3911 } |
| 3992 #endif | 3912 #endif |
| 3993 AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, pretenure); | 3913 AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, pretenure); |
| 3994 | 3914 |
| 3995 HeapObject* object; | 3915 HeapObject* object; |
| 3996 MaybeObject* maybe_object = AllocateRaw(size, space, OLD_DATA_SPACE); | 3916 MaybeObject* maybe_object = AllocateRaw(size, space, OLD_DATA_SPACE); |
| 3997 if (!maybe_object->To(&object)) return maybe_object; | 3917 if (!maybe_object->To(&object)) return maybe_object; |
| 3998 | 3918 |
| 3999 if (array_type == kExternalDoubleArray) { | 3919 if (array_type == kExternalFloat64Array) { |
| 4000 object = EnsureDoubleAligned(this, object, size); | 3920 object = EnsureDoubleAligned(this, object, size); |
| 4001 } | 3921 } |
| 4002 | 3922 |
| 4003 FixedTypedArrayBase* elements = | 3923 FixedTypedArrayBase* elements = |
| 4004 reinterpret_cast<FixedTypedArrayBase*>(object); | 3924 reinterpret_cast<FixedTypedArrayBase*>(object); |
| 4005 elements->set_map(MapForFixedTypedArray(array_type)); | 3925 elements->set_map(MapForFixedTypedArray(array_type)); |
| 4006 elements->set_length(length); | 3926 elements->set_length(length); |
| 4007 return elements; | 3927 return elements; |
| 4008 } | 3928 } |
| 4009 | 3929 |
| (...skipping 3731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7741 static_cast<int>(object_sizes_last_time_[index])); | 7661 static_cast<int>(object_sizes_last_time_[index])); |
| 7742 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 7662 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 7743 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7663 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 7744 | 7664 |
| 7745 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7665 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 7746 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7666 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 7747 ClearObjectStats(); | 7667 ClearObjectStats(); |
| 7748 } | 7668 } |
| 7749 | 7669 |
| 7750 } } // namespace v8::internal | 7670 } } // namespace v8::internal |
| OLD | NEW |