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 1925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1936 return GetContentArray()->data_start() + ToValueIndex(descriptor_number); | 1936 return GetContentArray()->data_start() + ToValueIndex(descriptor_number); |
1937 } | 1937 } |
1938 | 1938 |
1939 | 1939 |
1940 Object* DescriptorArray::GetValue(int descriptor_number) { | 1940 Object* DescriptorArray::GetValue(int descriptor_number) { |
1941 ASSERT(descriptor_number < number_of_descriptors()); | 1941 ASSERT(descriptor_number < number_of_descriptors()); |
1942 return GetContentArray()->get(ToValueIndex(descriptor_number)); | 1942 return GetContentArray()->get(ToValueIndex(descriptor_number)); |
1943 } | 1943 } |
1944 | 1944 |
1945 | 1945 |
1946 void DescriptorArray::SetNullValueUnchecked(int descriptor_number, Heap* heap) { | |
1947 ASSERT(descriptor_number < number_of_descriptors()); | |
1948 ASSERT(!HEAP->InNewSpace(heap->null_value())); | |
Michael Starzinger
2012/06/01 09:00:33
That assertion is already in FixedArray::set_null_
| |
1949 GetContentArray()->set_null_unchecked(heap, ToValueIndex(descriptor_number)); | |
1950 } | |
1951 | |
1952 | |
1946 PropertyDetails DescriptorArray::GetDetails(int descriptor_number) { | 1953 PropertyDetails DescriptorArray::GetDetails(int descriptor_number) { |
1947 ASSERT(descriptor_number < number_of_descriptors()); | 1954 ASSERT(descriptor_number < number_of_descriptors()); |
1948 Object* details = GetContentArray()->get(ToDetailsIndex(descriptor_number)); | 1955 Object* details = GetContentArray()->get(ToDetailsIndex(descriptor_number)); |
1949 return PropertyDetails(Smi::cast(details)); | 1956 return PropertyDetails(Smi::cast(details)); |
1950 } | 1957 } |
1951 | 1958 |
1952 | 1959 |
1960 void DescriptorArray::SetDetailsUnchecked(int descriptor_number, Smi* value) { | |
1961 ASSERT(descriptor_number < number_of_descriptors()); | |
1962 GetContentArray()->set_unchecked(ToDetailsIndex(descriptor_number), value); | |
1963 } | |
1964 | |
1965 | |
1953 PropertyType DescriptorArray::GetType(int descriptor_number) { | 1966 PropertyType DescriptorArray::GetType(int descriptor_number) { |
1954 return GetDetails(descriptor_number).type(); | 1967 return GetDetails(descriptor_number).type(); |
1955 } | 1968 } |
1956 | 1969 |
1957 | 1970 |
1958 int DescriptorArray::GetFieldIndex(int descriptor_number) { | 1971 int DescriptorArray::GetFieldIndex(int descriptor_number) { |
1959 return Descriptor::IndexFromValue(GetValue(descriptor_number)); | 1972 return Descriptor::IndexFromValue(GetValue(descriptor_number)); |
1960 } | 1973 } |
1961 | 1974 |
1962 | 1975 |
(...skipping 3080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5043 #undef WRITE_UINT32_FIELD | 5056 #undef WRITE_UINT32_FIELD |
5044 #undef READ_SHORT_FIELD | 5057 #undef READ_SHORT_FIELD |
5045 #undef WRITE_SHORT_FIELD | 5058 #undef WRITE_SHORT_FIELD |
5046 #undef READ_BYTE_FIELD | 5059 #undef READ_BYTE_FIELD |
5047 #undef WRITE_BYTE_FIELD | 5060 #undef WRITE_BYTE_FIELD |
5048 | 5061 |
5049 | 5062 |
5050 } } // namespace v8::internal | 5063 } } // namespace v8::internal |
5051 | 5064 |
5052 #endif // V8_OBJECTS_INL_H_ | 5065 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |