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 1911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1922 return number; | 1922 return number; |
1923 } | 1923 } |
1924 | 1924 |
1925 | 1925 |
1926 String* DescriptorArray::GetKey(int descriptor_number) { | 1926 String* DescriptorArray::GetKey(int descriptor_number) { |
1927 ASSERT(descriptor_number < number_of_descriptors()); | 1927 ASSERT(descriptor_number < number_of_descriptors()); |
1928 return String::cast(get(ToKeyIndex(descriptor_number))); | 1928 return String::cast(get(ToKeyIndex(descriptor_number))); |
1929 } | 1929 } |
1930 | 1930 |
1931 | 1931 |
| 1932 Object** DescriptorArray::GetValueSlot(int descriptor_number) { |
| 1933 ASSERT(descriptor_number < number_of_descriptors()); |
| 1934 return GetContentArray()->data_start() + ToValueIndex(descriptor_number); |
| 1935 } |
| 1936 |
| 1937 |
1932 Object* DescriptorArray::GetValue(int descriptor_number) { | 1938 Object* DescriptorArray::GetValue(int descriptor_number) { |
1933 ASSERT(descriptor_number < number_of_descriptors()); | 1939 ASSERT(descriptor_number < number_of_descriptors()); |
1934 return GetContentArray()->get(ToValueIndex(descriptor_number)); | 1940 return GetContentArray()->get(ToValueIndex(descriptor_number)); |
1935 } | 1941 } |
1936 | 1942 |
1937 | 1943 |
1938 PropertyDetails DescriptorArray::GetDetails(int descriptor_number) { | 1944 PropertyDetails DescriptorArray::GetDetails(int descriptor_number) { |
1939 ASSERT(descriptor_number < number_of_descriptors()); | 1945 ASSERT(descriptor_number < number_of_descriptors()); |
1940 Object* details = GetContentArray()->get(ToDetailsIndex(descriptor_number)); | 1946 Object* details = GetContentArray()->get(ToDetailsIndex(descriptor_number)); |
1941 return PropertyDetails(Smi::cast(details)); | 1947 return PropertyDetails(Smi::cast(details)); |
1942 } | 1948 } |
1943 | 1949 |
1944 | 1950 |
| 1951 FixedArray* DescriptorArray::RawGetContentArray() { |
| 1952 Object* array = this->get(DescriptorArray::kContentArrayIndex); |
| 1953 return static_cast<FixedArray*>(array); |
| 1954 } |
| 1955 |
| 1956 |
| 1957 Object* DescriptorArray::RawGetValue(int descriptor_number) { |
| 1958 ASSERT(descriptor_number < number_of_descriptors()); |
| 1959 return RawGetContentArray()->get(ToValueIndex(descriptor_number)); |
| 1960 } |
| 1961 |
| 1962 |
| 1963 PropertyDetails DescriptorArray::RawGetDetails(int descriptor_number) { |
| 1964 ASSERT(descriptor_number < number_of_descriptors()); |
| 1965 Object* details = RawGetContentArray()->get(ToDetailsIndex(descriptor_number))
; |
| 1966 return PropertyDetails(Smi::cast(details)); |
| 1967 } |
| 1968 |
| 1969 |
1945 PropertyType DescriptorArray::GetType(int descriptor_number) { | 1970 PropertyType DescriptorArray::GetType(int descriptor_number) { |
1946 return GetDetails(descriptor_number).type(); | 1971 return GetDetails(descriptor_number).type(); |
1947 } | 1972 } |
1948 | 1973 |
1949 | 1974 |
1950 int DescriptorArray::GetFieldIndex(int descriptor_number) { | 1975 int DescriptorArray::GetFieldIndex(int descriptor_number) { |
1951 return Descriptor::IndexFromValue(GetValue(descriptor_number)); | 1976 return Descriptor::IndexFromValue(GetValue(descriptor_number)); |
1952 } | 1977 } |
1953 | 1978 |
1954 | 1979 |
(...skipping 3072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5027 #undef WRITE_UINT32_FIELD | 5052 #undef WRITE_UINT32_FIELD |
5028 #undef READ_SHORT_FIELD | 5053 #undef READ_SHORT_FIELD |
5029 #undef WRITE_SHORT_FIELD | 5054 #undef WRITE_SHORT_FIELD |
5030 #undef READ_BYTE_FIELD | 5055 #undef READ_BYTE_FIELD |
5031 #undef WRITE_BYTE_FIELD | 5056 #undef WRITE_BYTE_FIELD |
5032 | 5057 |
5033 | 5058 |
5034 } } // namespace v8::internal | 5059 } } // namespace v8::internal |
5035 | 5060 |
5036 #endif // V8_OBJECTS_INL_H_ | 5061 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |