OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1967 // kRequiresSlowElementsLimit. | 1967 // kRequiresSlowElementsLimit. |
1968 inline bool requires_slow_elements(); | 1968 inline bool requires_slow_elements(); |
1969 | 1969 |
1970 // Get the value of the max number key that has been added to this | 1970 // Get the value of the max number key that has been added to this |
1971 // dictionary. max_number_key can only be called if | 1971 // dictionary. max_number_key can only be called if |
1972 // requires_slow_elements returns false. | 1972 // requires_slow_elements returns false. |
1973 inline uint32_t max_number_key(); | 1973 inline uint32_t max_number_key(); |
1974 | 1974 |
1975 // Accessors for next enumeration index. | 1975 // Accessors for next enumeration index. |
1976 void SetNextEnumerationIndex(int index) { | 1976 void SetNextEnumerationIndex(int index) { |
1977 fast_set(this, kNextEnumnerationIndexIndex, Smi::FromInt(index)); | 1977 fast_set(this, kNextEnumerationIndexIndex, Smi::FromInt(index)); |
1978 } | 1978 } |
1979 | 1979 |
1980 int NextEnumerationIndex() { | 1980 int NextEnumerationIndex() { |
1981 return Smi::cast(get(kNextEnumnerationIndexIndex))->value(); | 1981 return Smi::cast(get(kNextEnumerationIndexIndex))->value(); |
1982 } | 1982 } |
1983 | 1983 |
1984 // Returns a new array for dictionary usage. Might return Failure. | 1984 // Returns a new array for dictionary usage. Might return Failure. |
1985 static Object* Allocate(int at_least_space_for); | 1985 static Object* Allocate(int at_least_space_for); |
1986 | 1986 |
1987 // Ensure enough space for n additional elements. | 1987 // Ensure enough space for n additional elements. |
1988 Object* EnsureCapacity(int n, HashTableKey* key); | 1988 Object* EnsureCapacity(int n, HashTableKey* key); |
1989 | 1989 |
1990 #ifdef DEBUG | 1990 #ifdef DEBUG |
1991 void Print(); | 1991 void Print(); |
(...skipping 23 matching lines...) Expand all Loading... |
2015 Object* key, | 2015 Object* key, |
2016 Object* value, | 2016 Object* value, |
2017 PropertyDetails details); | 2017 PropertyDetails details); |
2018 | 2018 |
2019 void UpdateMaxNumberKey(uint32_t key); | 2019 void UpdateMaxNumberKey(uint32_t key); |
2020 | 2020 |
2021 // Generate new enumneration indices to avoid enumeration insdex overflow. | 2021 // Generate new enumneration indices to avoid enumeration insdex overflow. |
2022 Object* GenerateNewEnumerationIndices(); | 2022 Object* GenerateNewEnumerationIndices(); |
2023 | 2023 |
2024 static const int kMaxNumberKeyIndex = kPrefixStartIndex; | 2024 static const int kMaxNumberKeyIndex = kPrefixStartIndex; |
2025 static const int kNextEnumnerationIndexIndex = kMaxNumberKeyIndex + 1; | 2025 static const int kNextEnumerationIndexIndex = kMaxNumberKeyIndex + 1; |
2026 | 2026 |
2027 DISALLOW_IMPLICIT_CONSTRUCTORS(Dictionary); | 2027 DISALLOW_IMPLICIT_CONSTRUCTORS(Dictionary); |
2028 }; | 2028 }; |
2029 | 2029 |
2030 | 2030 |
2031 // ByteArray represents fixed sized byte arrays. Used by the outside world, | 2031 // ByteArray represents fixed sized byte arrays. Used by the outside world, |
2032 // such as PCRE, and also by the memory allocator and garbage collector to | 2032 // such as PCRE, and also by the memory allocator and garbage collector to |
2033 // fill in free blocks in the heap. | 2033 // fill in free blocks in the heap. |
2034 class ByteArray: public Array { | 2034 class ByteArray: public Array { |
2035 public: | 2035 public: |
(...skipping 2020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4056 } else { | 4056 } else { |
4057 value &= ~(1 << bit_position); | 4057 value &= ~(1 << bit_position); |
4058 } | 4058 } |
4059 return value; | 4059 return value; |
4060 } | 4060 } |
4061 }; | 4061 }; |
4062 | 4062 |
4063 } } // namespace v8::internal | 4063 } } // namespace v8::internal |
4064 | 4064 |
4065 #endif // V8_OBJECTS_H_ | 4065 #endif // V8_OBJECTS_H_ |
OLD | NEW |