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 4046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4057 return Smi::cast(this->get(kNextEnumerationIndexIndex))->value(); | 4057 return Smi::cast(this->get(kNextEnumerationIndexIndex))->value(); |
4058 } | 4058 } |
4059 | 4059 |
4060 // Returns a new array for dictionary usage. Might return Failure. | 4060 // Returns a new array for dictionary usage. Might return Failure. |
4061 MUST_USE_RESULT static MaybeObject* Allocate( | 4061 MUST_USE_RESULT static MaybeObject* Allocate( |
4062 Heap* heap, | 4062 Heap* heap, |
4063 int at_least_space_for, | 4063 int at_least_space_for, |
4064 PretenureFlag pretenure = NOT_TENURED); | 4064 PretenureFlag pretenure = NOT_TENURED); |
4065 | 4065 |
4066 // Creates a new dictionary. | 4066 // Creates a new dictionary. |
4067 static Handle<Derived> New( | 4067 MUST_USE_RESULT static Handle<Derived> New( |
4068 Isolate* isolate, | 4068 Isolate* isolate, |
4069 int at_least_space_for, | 4069 int at_least_space_for, |
4070 PretenureFlag pretenure = NOT_TENURED); | 4070 PretenureFlag pretenure = NOT_TENURED); |
4071 | 4071 |
4072 // Ensure enough space for n additional elements. | 4072 // Ensure enough space for n additional elements. |
4073 MUST_USE_RESULT MaybeObject* EnsureCapacity(int n, Key key); | 4073 MUST_USE_RESULT MaybeObject* EnsureCapacity(int n, Key key); |
4074 | 4074 |
4075 static Handle<Derived> EnsureCapacity(Handle<Derived> obj, int n, Key key); | 4075 static Handle<Derived> EnsureCapacity(Handle<Derived> obj, int n, Key key); |
4076 | 4076 |
4077 #ifdef OBJECT_PRINT | 4077 #ifdef OBJECT_PRINT |
4078 void Print(FILE* out = stdout); | 4078 void Print(FILE* out = stdout); |
4079 #endif | 4079 #endif |
4080 // Returns the key (slow). | 4080 // Returns the key (slow). |
4081 Object* SlowReverseLookup(Object* value); | 4081 Object* SlowReverseLookup(Object* value); |
4082 | 4082 |
4083 // Sets the entry to (key, value) pair. | 4083 // Sets the entry to (key, value) pair. |
4084 inline void SetEntry(int entry, | 4084 inline void SetEntry(int entry, |
4085 Object* key, | 4085 Object* key, |
4086 Object* value); | 4086 Object* value); |
4087 inline void SetEntry(int entry, | 4087 inline void SetEntry(int entry, |
4088 Object* key, | 4088 Object* key, |
4089 Object* value, | 4089 Object* value, |
4090 PropertyDetails details); | 4090 PropertyDetails details); |
4091 | 4091 |
4092 MUST_USE_RESULT MaybeObject* Add(Key key, | 4092 MUST_USE_RESULT static Handle<Derived> Add( |
4093 Object* value, | 4093 Handle<Derived> dictionary, |
4094 PropertyDetails details); | 4094 Key key, |
| 4095 Handle<Object> value, |
| 4096 PropertyDetails details); |
4095 | 4097 |
4096 protected: | 4098 protected: |
4097 // Generic at put operation. | 4099 // Generic at put operation. |
4098 MUST_USE_RESULT static Handle<Derived> AtPut( | 4100 MUST_USE_RESULT static Handle<Derived> AtPut( |
4099 Handle<Derived> dictionary, | 4101 Handle<Derived> dictionary, |
4100 Key key, | 4102 Key key, |
4101 Handle<Object> value); | 4103 Handle<Object> value); |
4102 | 4104 |
4103 // Add entry to dictionary. | 4105 // Add entry to dictionary. |
4104 MUST_USE_RESULT MaybeObject* AddEntry(Key key, | 4106 MUST_USE_RESULT MaybeObject* AddEntry(Key key, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4143 } | 4145 } |
4144 | 4146 |
4145 // Copies enumerable keys to preallocated fixed array. | 4147 // Copies enumerable keys to preallocated fixed array. |
4146 void CopyEnumKeysTo(FixedArray* storage); | 4148 void CopyEnumKeysTo(FixedArray* storage); |
4147 static void DoGenerateNewEnumerationIndices( | 4149 static void DoGenerateNewEnumerationIndices( |
4148 Handle<NameDictionary> dictionary); | 4150 Handle<NameDictionary> dictionary); |
4149 | 4151 |
4150 // Find entry for key, otherwise return kNotFound. Optimized version of | 4152 // Find entry for key, otherwise return kNotFound. Optimized version of |
4151 // HashTable::FindEntry. | 4153 // HashTable::FindEntry. |
4152 int FindEntry(Name* key); | 4154 int FindEntry(Name* key); |
4153 | |
4154 // TODO(mstarzinger): Temporary wrapper until handlified. | |
4155 static Handle<NameDictionary> AddNameEntry(Handle<NameDictionary> dict, | |
4156 Handle<Name> name, | |
4157 Handle<Object> value, | |
4158 PropertyDetails details); | |
4159 }; | 4155 }; |
4160 | 4156 |
4161 | 4157 |
4162 class NumberDictionaryShape : public BaseShape<uint32_t> { | 4158 class NumberDictionaryShape : public BaseShape<uint32_t> { |
4163 public: | 4159 public: |
4164 static inline bool IsMatch(uint32_t key, Object* other); | 4160 static inline bool IsMatch(uint32_t key, Object* other); |
4165 // TODO(ishell): This should be eventually replaced with AsHandle(). | 4161 // TODO(ishell): This should be eventually replaced with AsHandle(). |
4166 MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap, | 4162 MUST_USE_RESULT static inline MaybeObject* AsObject(Heap* heap, |
4167 uint32_t key); | 4163 uint32_t key); |
4168 static inline Handle<Object> AsHandle(Isolate* isolate, uint32_t key); | 4164 static inline Handle<Object> AsHandle(Isolate* isolate, uint32_t key); |
(...skipping 7120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11289 } else { | 11285 } else { |
11290 value &= ~(1 << bit_position); | 11286 value &= ~(1 << bit_position); |
11291 } | 11287 } |
11292 return value; | 11288 return value; |
11293 } | 11289 } |
11294 }; | 11290 }; |
11295 | 11291 |
11296 } } // namespace v8::internal | 11292 } } // namespace v8::internal |
11297 | 11293 |
11298 #endif // V8_OBJECTS_H_ | 11294 #endif // V8_OBJECTS_H_ |
OLD | NEW |